@remotion/promo-pages 4.0.463 → 4.0.464

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.
@@ -1,15 +1,26 @@
1
+ var __create = Object.create;
2
+ var __getProtoOf = Object.getPrototypeOf;
1
3
  var __defProp = Object.defineProperty;
2
- var __returnValue = (v) => v;
3
- function __exportSetter(name, newValue) {
4
- this[name] = __returnValue.bind(null, newValue);
5
- }
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __toESM = (mod, isNodeMode, target) => {
7
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
8
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
9
+ for (let key of __getOwnPropNames(mod))
10
+ if (!__hasOwnProp.call(to, key))
11
+ __defProp(to, key, {
12
+ get: () => mod[key],
13
+ enumerable: true
14
+ });
15
+ return to;
16
+ };
6
17
  var __export = (target, all) => {
7
18
  for (var name in all)
8
19
  __defProp(target, name, {
9
20
  get: all[name],
10
21
  enumerable: true,
11
22
  configurable: true,
12
- set: __exportSetter.bind(all, name)
23
+ set: (newValue) => all[name] = () => newValue
13
24
  });
14
25
  };
15
26
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
@@ -29,7 +40,7 @@ __export(exports_vidstack_CZgUA94N, {
29
40
  waitTimeout: () => waitTimeout,
30
41
  waitIdlePeriod: () => waitIdlePeriod,
31
42
  useStateContext: () => useStateContext,
32
- useState: () => useState44,
43
+ useState: () => useState42,
33
44
  useSignalRecord: () => useSignalRecord,
34
45
  useSignal: () => useSignal,
35
46
  useReactScope: () => useReactScope,
@@ -667,7 +678,7 @@ class State {
667
678
  }
668
679
  }
669
680
  }
670
- function useState44(state) {
681
+ function useState42(state) {
671
682
  return useContext45(state);
672
683
  }
673
684
  function camelToKebabCase(str) {
@@ -15028,7 +15039,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
15028
15039
  SliderThumbnail = class SliderThumbnail extends Thumbnail {
15029
15040
  #slider;
15030
15041
  onAttach(el) {
15031
- this.#slider = useState44(Slider.state);
15042
+ this.#slider = useState42(Slider.state);
15032
15043
  }
15033
15044
  getTime() {
15034
15045
  const { duration, clipStartTime } = this.media.$state;
@@ -15055,7 +15066,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
15055
15066
  }
15056
15067
  onSetup() {
15057
15068
  this.#media = useMediaContext();
15058
- this.#slider = useState44(Slider.state);
15069
+ this.#slider = useState42(Slider.state);
15059
15070
  this.#watchCrossOrigin();
15060
15071
  this.setAttributes({
15061
15072
  "data-loading": this.#isLoading.bind(this),
@@ -15141,7 +15152,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
15141
15152
  #text;
15142
15153
  #slider;
15143
15154
  onSetup() {
15144
- this.#slider = useState44(Slider.state);
15155
+ this.#slider = useState42(Slider.state);
15145
15156
  this.#format = useContext45(sliderValueFormatContext);
15146
15157
  this.#text = computed(this.getValueText.bind(this));
15147
15158
  }
@@ -15182,7 +15193,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
15182
15193
  #slider;
15183
15194
  onSetup() {
15184
15195
  this.#slider = useContext45(sliderContext);
15185
- const { active } = useState44(Slider.state);
15196
+ const { active } = useState42(Slider.state);
15186
15197
  this.setAttributes({
15187
15198
  "data-visible": active
15188
15199
  });
@@ -15723,7 +15734,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
15723
15734
  }
15724
15735
  onSetup() {
15725
15736
  this.#media = useMediaContext();
15726
- this.#sliderState = useState44(TimeSlider.state);
15737
+ this.#sliderState = useState42(TimeSlider.state);
15727
15738
  }
15728
15739
  onAttach(el) {
15729
15740
  watchActiveTextTrack(this.#media.textTracks, "chapters", this.#setTrack.bind(this));
@@ -17359,7 +17370,7 @@ var init_vidstack_D5Pzx_k5 = __esm(() => {
17359
17370
  import * as React24 from "react";
17360
17371
  import * as React3 from "react";
17361
17372
  import { Fragment as Fragment2, jsx as jsx38 } from "react/jsx-runtime";
17362
- import React52, { useCallback as useCallback22, useRef as useRef24, useState as useState22 } from "react";
17373
+ import React52, { useCallback as useCallback24, useRef as useRef25, useState as useState22 } from "react";
17363
17374
 
17364
17375
  // ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
17365
17376
  function r(e) {
@@ -18701,7 +18712,7 @@ var getDefaultConfig = () => {
18701
18712
  var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
18702
18713
 
18703
18714
  // ../design/dist/esm/index.mjs
18704
- import React33, { useEffect as useEffect20, useMemo as useMemo38, useState as useState23 } from "react";
18715
+ import React33, { useEffect as useEffect20, useMemo as useMemo39, useState as useState21 } from "react";
18705
18716
 
18706
18717
  // ../paths/dist/esm/index.mjs
18707
18718
  var cutLInstruction = ({
@@ -23066,13 +23077,6 @@ import * as React6 from "react";
23066
23077
  import React7, { useMemo as useMemo6, useRef as useRef2 } from "react";
23067
23078
  import { useContext as useContext8, useMemo as useMemo7 } from "react";
23068
23079
  import { jsx as jsx72 } from "react/jsx-runtime";
23069
- import {
23070
- forwardRef as forwardRef4,
23071
- useCallback as useCallback6,
23072
- useEffect as useEffect5,
23073
- useMemo as useMemo16,
23074
- useState as useState6
23075
- } from "react";
23076
23080
  import {
23077
23081
  forwardRef as forwardRef3,
23078
23082
  useContext as useContext17,
@@ -23080,6 +23084,7 @@ import {
23080
23084
  useMemo as useMemo14,
23081
23085
  useState as useState5
23082
23086
  } from "react";
23087
+ import { useRef as useRef6 } from "react";
23083
23088
  import { useContext as useContext14, useMemo as useMemo11 } from "react";
23084
23089
  import { createContext as createContext12 } from "react";
23085
23090
  import { useContext as useContext10, useMemo as useMemo9 } from "react";
@@ -23102,18 +23107,25 @@ import React12, { forwardRef as forwardRef2, useState as useState4, useContext a
23102
23107
  import { useContext as useContext15, useRef as useRef5 } from "react";
23103
23108
  import { createContext as createContext15 } from "react";
23104
23109
  import { jsx as jsx112 } from "react/jsx-runtime";
23105
- import { useEffect as useEffect4, useMemo as useMemo15, useRef as useRef6 } from "react";
23110
+ import {
23111
+ forwardRef as forwardRef4,
23112
+ useEffect as useEffect5,
23113
+ useImperativeHandle as useImperativeHandle2,
23114
+ useLayoutEffect as useLayoutEffect2,
23115
+ useRef as useRef9,
23116
+ useState as useState6
23117
+ } from "react";
23118
+ import React14, { useCallback as useCallback6, useImperativeHandle, useMemo as useMemo16, useRef as useRef8 } from "react";
23119
+ import { useEffect as useEffect4, useMemo as useMemo15, useRef as useRef7 } from "react";
23106
23120
  import { jsx as jsx12 } from "react/jsx-runtime";
23121
+ import { jsx as jsx13 } from "react/jsx-runtime";
23107
23122
  import {
23108
23123
  forwardRef as forwardRef5,
23124
+ useCallback as useCallback7,
23109
23125
  useEffect as useEffect6,
23110
- useImperativeHandle as useImperativeHandle2,
23111
- useLayoutEffect as useLayoutEffect2,
23112
- useRef as useRef8,
23126
+ useMemo as useMemo17,
23113
23127
  useState as useState7
23114
23128
  } from "react";
23115
- import React15, { useCallback as useCallback7, useImperativeHandle, useRef as useRef7 } from "react";
23116
- import { jsx as jsx13 } from "react/jsx-runtime";
23117
23129
  import { jsx as jsx14 } from "react/jsx-runtime";
23118
23130
  import {
23119
23131
  createContext as createContext16,
@@ -23121,78 +23133,78 @@ import {
23121
23133
  useCallback as useCallback8,
23122
23134
  useContext as useContext18,
23123
23135
  useLayoutEffect as useLayoutEffect3,
23124
- useMemo as useMemo17,
23125
- useRef as useRef9,
23126
- useState as useState8
23136
+ useMemo as useMemo18,
23137
+ useRef as useRef10
23127
23138
  } from "react";
23128
23139
  import { jsx as jsx15 } from "react/jsx-runtime";
23129
- import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useState as useState10 } from "react";
23140
+ import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useState as useState9 } from "react";
23130
23141
  import {
23131
23142
  createContext as createContext17,
23132
23143
  useCallback as useCallback9,
23133
23144
  useImperativeHandle as useImperativeHandle3,
23134
23145
  useLayoutEffect as useLayoutEffect4,
23135
- useMemo as useMemo18,
23136
- useRef as useRef10,
23137
- useState as useState9
23146
+ useMemo as useMemo19,
23147
+ useRef as useRef11,
23148
+ useState as useState8
23138
23149
  } from "react";
23139
23150
  import { jsx as jsx16 } from "react/jsx-runtime";
23140
- import { forwardRef as forwardRef9, useCallback as useCallback14, useContext as useContext31 } from "react";
23141
- import React17, { createContext as createContext18, useMemo as useMemo19 } from "react";
23151
+ import { forwardRef as forwardRef9, useCallback as useCallback15, useContext as useContext31 } from "react";
23152
+ import React17, { createContext as createContext18, useMemo as useMemo20 } from "react";
23142
23153
  import { jsx as jsx17 } from "react/jsx-runtime";
23143
23154
  import { useContext as useContext20 } from "react";
23144
- import { createContext as createContext19, useEffect as useEffect7, useState as useState11 } from "react";
23155
+ import { createContext as createContext19, useEffect as useEffect7, useState as useState10 } from "react";
23145
23156
  import { jsx as jsx18 } from "react/jsx-runtime";
23146
- import { createContext as createContext20, useMemo as useMemo20, useReducer } from "react";
23157
+ import { createContext as createContext20, useMemo as useMemo21, useReducer } from "react";
23147
23158
  import { jsx as jsx19 } from "react/jsx-runtime";
23159
+ import { useCallback as useCallback14 } from "react";
23148
23160
  import React23, {
23149
23161
  forwardRef as forwardRef7,
23150
23162
  useContext as useContext29,
23151
23163
  useEffect as useEffect14,
23152
23164
  useImperativeHandle as useImperativeHandle4,
23153
- useMemo as useMemo28,
23154
- useRef as useRef18,
23155
- useState as useState16
23165
+ useMemo as useMemo29,
23166
+ useRef as useRef19,
23167
+ useState as useState15
23156
23168
  } from "react";
23157
- import { useContext as useContext22, useLayoutEffect as useLayoutEffect6, useRef as useRef13 } from "react";
23169
+ import { useContext as useContext22, useLayoutEffect as useLayoutEffect6, useRef as useRef14 } from "react";
23158
23170
  import React20, {
23159
23171
  createContext as createContext21,
23160
23172
  createRef as createRef2,
23161
23173
  useCallback as useCallback10,
23162
23174
  useContext as useContext21,
23163
- useMemo as useMemo22,
23164
- useRef as useRef11,
23165
- useState as useState12
23175
+ useMemo as useMemo23,
23176
+ useRef as useRef12,
23177
+ useState as useState11
23166
23178
  } from "react";
23167
- import { useMemo as useMemo21 } from "react";
23179
+ import { useMemo as useMemo22 } from "react";
23168
23180
  import { jsx as jsx20, jsxs as jsxs22 } from "react/jsx-runtime";
23169
- import { useRef as useRef12 } from "react";
23170
- import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo23, useState as useState13 } from "react";
23181
+ import { useRef as useRef13 } from "react";
23182
+ import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo24, useState as useState12 } from "react";
23171
23183
  import { useContext as useContext23 } from "react";
23172
23184
  import {
23173
23185
  useCallback as useCallback13,
23174
23186
  useContext as useContext27,
23175
23187
  useEffect as useEffect12,
23176
23188
  useLayoutEffect as useLayoutEffect8,
23177
- useRef as useRef17
23189
+ useRef as useRef18
23178
23190
  } from "react";
23179
- import { useCallback as useCallback12, useMemo as useMemo26, useRef as useRef15 } from "react";
23180
- import { useContext as useContext26, useMemo as useMemo25 } from "react";
23191
+ import { useCallback as useCallback12, useMemo as useMemo27, useRef as useRef16 } from "react";
23192
+ import { useContext as useContext26, useMemo as useMemo26 } from "react";
23181
23193
  import React21, {
23182
23194
  useCallback as useCallback11,
23183
23195
  useContext as useContext25,
23184
23196
  useEffect as useEffect9,
23185
23197
  useLayoutEffect as useLayoutEffect7,
23186
- useMemo as useMemo24,
23187
- useRef as useRef14,
23188
- useState as useState14
23198
+ useMemo as useMemo25,
23199
+ useRef as useRef15,
23200
+ useState as useState13
23189
23201
  } from "react";
23190
23202
  import { jsx as jsx21 } from "react/jsx-runtime";
23191
23203
  import React22 from "react";
23192
- import { useEffect as useEffect10, useState as useState15 } from "react";
23193
- import { useEffect as useEffect11, useRef as useRef16 } from "react";
23204
+ import { useEffect as useEffect10, useState as useState14 } from "react";
23205
+ import { useEffect as useEffect11, useRef as useRef17 } from "react";
23194
23206
  import { useEffect as useEffect13 } from "react";
23195
- import { createContext as createContext22, useContext as useContext28, useMemo as useMemo27 } from "react";
23207
+ import { createContext as createContext22, useContext as useContext28, useMemo as useMemo28 } from "react";
23196
23208
  import { jsx as jsx222 } from "react/jsx-runtime";
23197
23209
  import {
23198
23210
  forwardRef as forwardRef8,
@@ -23200,47 +23212,47 @@ import {
23200
23212
  useEffect as useEffect15,
23201
23213
  useImperativeHandle as useImperativeHandle5,
23202
23214
  useLayoutEffect as useLayoutEffect9,
23203
- useMemo as useMemo29,
23204
- useRef as useRef19
23215
+ useMemo as useMemo30,
23216
+ useRef as useRef20
23205
23217
  } from "react";
23206
23218
  import { jsx as jsx23 } from "react/jsx-runtime";
23207
23219
  import { jsx as jsx24 } from "react/jsx-runtime";
23208
- import { forwardRef as forwardRef10, useCallback as useCallback15, useState as useState17 } from "react";
23220
+ import { forwardRef as forwardRef10, useCallback as useCallback16, useState as useState16 } from "react";
23209
23221
  import { jsx as jsx25 } from "react/jsx-runtime";
23210
23222
  import {
23211
- useCallback as useCallback16,
23223
+ useCallback as useCallback17,
23212
23224
  useContext as useContext32,
23213
23225
  useImperativeHandle as useImperativeHandle6,
23214
23226
  useLayoutEffect as useLayoutEffect10,
23215
- useRef as useRef20,
23216
- useState as useState18
23227
+ useRef as useRef21,
23228
+ useState as useState17
23217
23229
  } from "react";
23218
23230
  import { jsx as jsx26 } from "react/jsx-runtime";
23219
23231
  import { createRef as createRef3 } from "react";
23220
23232
  import React28 from "react";
23221
23233
  import {
23222
- useCallback as useCallback17,
23234
+ useCallback as useCallback18,
23223
23235
  useImperativeHandle as useImperativeHandle7,
23224
- useMemo as useMemo30,
23225
- useRef as useRef21,
23226
- useState as useState19
23236
+ useMemo as useMemo31,
23237
+ useRef as useRef22,
23238
+ useState as useState18
23227
23239
  } from "react";
23228
23240
  import { jsx as jsx27 } from "react/jsx-runtime";
23229
23241
  import React29 from "react";
23230
- import { useMemo as useMemo322 } from "react";
23231
- import { createContext as createContext23, useContext as useContext33, useMemo as useMemo31 } from "react";
23242
+ import { useMemo as useMemo33 } from "react";
23243
+ import { createContext as createContext23, useContext as useContext33, useMemo as useMemo322 } from "react";
23232
23244
  import { jsx as jsx28 } from "react/jsx-runtime";
23233
23245
  import { jsx as jsx29 } from "react/jsx-runtime";
23234
23246
  import React31 from "react";
23235
23247
  import React32, { createContext as createContext24 } from "react";
23236
- import { useCallback as useCallback19 } from "react";
23248
+ import { useCallback as useCallback21 } from "react";
23237
23249
  import {
23238
- useCallback as useCallback18,
23250
+ useCallback as useCallback19,
23239
23251
  useContext as useContext34,
23240
23252
  useEffect as useEffect16,
23241
23253
  useLayoutEffect as useLayoutEffect11,
23242
- useMemo as useMemo33,
23243
- useState as useState20
23254
+ useMemo as useMemo34,
23255
+ useState as useState19
23244
23256
  } from "react";
23245
23257
  import { jsx as jsx30 } from "react/jsx-runtime";
23246
23258
  import React34, {
@@ -23248,45 +23260,42 @@ import React34, {
23248
23260
  useContext as useContext35,
23249
23261
  useEffect as useEffect18,
23250
23262
  useImperativeHandle as useImperativeHandle8,
23251
- useMemo as useMemo34,
23252
- useRef as useRef22,
23253
- useState as useState21
23263
+ useMemo as useMemo35,
23264
+ useRef as useRef23,
23265
+ useState as useState20,
23266
+ useCallback as useCallback20
23254
23267
  } from "react";
23255
23268
  import { useEffect as useEffect17 } from "react";
23256
23269
  import { jsx as jsx31 } from "react/jsx-runtime";
23257
23270
  import { jsx as jsx322 } from "react/jsx-runtime";
23258
- import React36, { useMemo as useMemo35 } from "react";
23271
+ import React36, { useMemo as useMemo36 } from "react";
23259
23272
  import { jsx as jsx33 } from "react/jsx-runtime";
23260
- import { Children, forwardRef as forwardRef12, useMemo as useMemo36 } from "react";
23273
+ import { Children, forwardRef as forwardRef12, useMemo as useMemo37 } from "react";
23261
23274
  import React37 from "react";
23262
23275
  import React38, { createContext as createContext25 } from "react";
23263
23276
  import { jsx as jsx34 } from "react/jsx-runtime";
23264
23277
  import { jsx as jsx35 } from "react/jsx-runtime";
23265
23278
  import React40 from "react";
23266
- import { forwardRef as forwardRef14, useCallback as useCallback20, useContext as useContext37 } from "react";
23279
+ import { forwardRef as forwardRef14, useCallback as useCallback22, useContext as useContext37 } from "react";
23267
23280
  import {
23268
23281
  forwardRef as forwardRef13,
23269
23282
  useContext as useContext36,
23270
23283
  useEffect as useEffect19,
23271
23284
  useImperativeHandle as useImperativeHandle9,
23272
23285
  useLayoutEffect as useLayoutEffect12,
23273
- useMemo as useMemo37,
23274
- useRef as useRef23
23286
+ useMemo as useMemo38,
23287
+ useRef as useRef24
23275
23288
  } from "react";
23276
23289
  import { jsx as jsx36 } from "react/jsx-runtime";
23277
23290
  import { jsx as jsx37 } from "react/jsx-runtime";
23278
23291
  var __defProp2 = Object.defineProperty;
23279
- var __returnValue2 = (v) => v;
23280
- function __exportSetter2(name, newValue) {
23281
- this[name] = __returnValue2.bind(null, newValue);
23282
- }
23283
23292
  var __export2 = (target, all) => {
23284
23293
  for (var name in all)
23285
23294
  __defProp2(target, name, {
23286
23295
  get: all[name],
23287
23296
  enumerable: true,
23288
23297
  configurable: true,
23289
- set: __exportSetter2.bind(all, name)
23298
+ set: (newValue) => all[name] = () => newValue
23290
23299
  });
23291
23300
  };
23292
23301
  if (typeof createContext !== "function") {
@@ -24351,75 +24360,33 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
24351
24360
  var addSequenceStackTraces = (component) => {
24352
24361
  componentsToAddStacksTo.push(component);
24353
24362
  };
24354
- var sequenceStyleSchema = {
24355
- "style.translate": {
24356
- type: "translate",
24357
- step: 1,
24358
- default: "0px 0px",
24359
- description: "Offset"
24360
- },
24361
- "style.scale": {
24362
- type: "number",
24363
- min: 0.05,
24364
- max: 100,
24365
- step: 0.01,
24366
- default: 1,
24367
- description: "Scale"
24368
- },
24369
- "style.rotate": {
24370
- type: "rotation",
24371
- step: 1,
24372
- default: "0deg",
24373
- description: "Rotation"
24374
- },
24375
- "style.opacity": {
24376
- type: "number",
24377
- min: 0,
24378
- max: 1,
24379
- step: 0.01,
24380
- default: 1,
24381
- description: "Opacity"
24382
- },
24383
- premountFor: {
24384
- type: "number",
24385
- default: 0,
24386
- description: "Premount For",
24387
- min: 0,
24388
- step: 1
24389
- },
24390
- postmountFor: {
24391
- type: "hidden"
24392
- },
24393
- styleWhilePremounted: {
24394
- type: "hidden"
24395
- },
24396
- styleWhilePostmounted: {
24397
- type: "hidden"
24363
+ var VERSION = "4.0.464";
24364
+ var checkMultipleRemotionVersions = () => {
24365
+ if (typeof globalThis === "undefined") {
24366
+ return;
24398
24367
  }
24399
- };
24400
- var hiddenField = {
24401
- type: "boolean",
24402
- default: false,
24403
- description: "Hidden"
24404
- };
24405
- var sequenceSchema = {
24406
- hidden: hiddenField,
24407
- layout: {
24408
- type: "enum",
24409
- default: "absolute-fill",
24410
- description: "Layout",
24411
- variants: {
24412
- "absolute-fill": sequenceStyleSchema,
24413
- none: {}
24368
+ const set = () => {
24369
+ globalThis.remotion_imported = VERSION;
24370
+ if (typeof window !== "undefined") {
24371
+ window.remotion_imported = VERSION;
24414
24372
  }
24373
+ };
24374
+ const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
24375
+ if (alreadyImported) {
24376
+ if (alreadyImported === VERSION) {
24377
+ return;
24378
+ }
24379
+ if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
24380
+ set();
24381
+ return;
24382
+ }
24383
+ throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
24384
+ VERSION,
24385
+ typeof alreadyImported === "string" ? alreadyImported : "an older version"
24386
+ ].filter(truthy2).join(" and ")}. This will cause things to break in an unexpected way.
24387
+ Check that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`);
24415
24388
  }
24416
- };
24417
- var sequenceSchemaDefaultLayoutNone = {
24418
- ...sequenceSchema,
24419
- layout: {
24420
- ...sequenceSchema.layout,
24421
- default: "none"
24422
- }
24389
+ set();
24423
24390
  };
24424
24391
  var SequenceContext = createContext12(null);
24425
24392
  var exports_timeline_position_state = {};
@@ -24755,6 +24722,82 @@ var Freeze = ({
24755
24722
  var PremountContext = createContext14({
24756
24723
  premountFramesRemaining: 0
24757
24724
  });
24725
+ var sequenceVisualStyleSchema = {
24726
+ "style.translate": {
24727
+ type: "translate",
24728
+ step: 1,
24729
+ default: "0px 0px",
24730
+ description: "Offset"
24731
+ },
24732
+ "style.scale": {
24733
+ type: "number",
24734
+ min: 0.05,
24735
+ max: 100,
24736
+ step: 0.01,
24737
+ default: 1,
24738
+ description: "Scale"
24739
+ },
24740
+ "style.rotate": {
24741
+ type: "rotation",
24742
+ step: 1,
24743
+ default: "0deg",
24744
+ description: "Rotation"
24745
+ },
24746
+ "style.opacity": {
24747
+ type: "number",
24748
+ min: 0,
24749
+ max: 1,
24750
+ step: 0.01,
24751
+ default: 1,
24752
+ description: "Opacity"
24753
+ }
24754
+ };
24755
+ var sequencePremountSchema = {
24756
+ premountFor: {
24757
+ type: "number",
24758
+ default: 0,
24759
+ description: "Premount For",
24760
+ min: 0,
24761
+ step: 1
24762
+ },
24763
+ postmountFor: {
24764
+ type: "hidden"
24765
+ },
24766
+ styleWhilePremounted: {
24767
+ type: "hidden"
24768
+ },
24769
+ styleWhilePostmounted: {
24770
+ type: "hidden"
24771
+ }
24772
+ };
24773
+ var sequenceStyleSchema = {
24774
+ ...sequenceVisualStyleSchema,
24775
+ ...sequencePremountSchema
24776
+ };
24777
+ var hiddenField = {
24778
+ type: "boolean",
24779
+ default: false,
24780
+ description: "Hidden"
24781
+ };
24782
+ var sequenceSchema = {
24783
+ hidden: hiddenField,
24784
+ layout: {
24785
+ type: "enum",
24786
+ default: "absolute-fill",
24787
+ description: "Layout",
24788
+ variants: {
24789
+ "absolute-fill": sequenceStyleSchema,
24790
+ none: {}
24791
+ }
24792
+ }
24793
+ };
24794
+ var sequenceSchemaDefaultLayoutNone = {
24795
+ ...sequenceSchema,
24796
+ layout: {
24797
+ ...sequenceSchema.layout,
24798
+ default: "none"
24799
+ }
24800
+ };
24758
24801
  var SequenceManager = React11.createContext({
24759
24802
  registerSequence: () => {
24760
24803
  throw new Error("SequenceManagerContext not initialized");
@@ -25437,7 +25480,8 @@ var RegularSequenceRefForwardingFunction = ({
25437
25480
  }, [name]);
25438
25481
  const env = useRemotionEnvironment();
25439
25482
  const inheritedStack = other?.stack ?? null;
25440
- const [stackDoesntChange] = useState5(() => stack ?? inheritedStack);
25483
+ const stackRef = useRef6(null);
25484
+ stackRef.current = stack ?? inheritedStack;
25441
25485
  useEffect3(() => {
25442
25486
  if (!env.isStudio) {
25443
25487
  return;
@@ -25461,7 +25505,7 @@ var RegularSequenceRefForwardingFunction = ({
25461
25505
  rootId,
25462
25506
  showInTimeline,
25463
25507
  src: isMedia.data.src,
25464
- stack: stackDoesntChange,
25508
+ getStack: () => stackRef.current,
25465
25509
  startMediaFrom: isMedia.data.startMediaFrom,
25466
25510
  volume: isMedia.data.volumes
25467
25511
  });
@@ -25480,7 +25524,7 @@ var RegularSequenceRefForwardingFunction = ({
25480
25524
  showInTimeline,
25481
25525
  nonce: nonce.get(),
25482
25526
  loopDisplay,
25483
- stack: stackDoesntChange,
25527
+ getStack: () => stackRef.current,
25484
25528
  premountDisplay: premountDisplay ?? null,
25485
25529
  postmountDisplay: postmountDisplay ?? null,
25486
25530
  controls: controls ?? null,
@@ -25503,7 +25547,6 @@ var RegularSequenceRefForwardingFunction = ({
25503
25547
  showInTimeline,
25504
25548
  nonce,
25505
25549
  loopDisplay,
25506
- stackDoesntChange,
25507
25550
  premountDisplay,
25508
25551
  postmountDisplay,
25509
25552
  env.isStudio,
@@ -25612,6 +25655,10 @@ var SequenceRefForwardingFunction = (props, ref) => {
25612
25655
  };
25613
25656
  var SequenceInner = forwardRef3(SequenceRefForwardingFunction);
25614
25657
  var Sequence = wrapInSchema(SequenceInner, sequenceSchema);
25658
+ var WEBGL_CONTEXT_DOCS_URL = "https://remotion.dev/docs/troubleshooting/webgl2-context";
25659
+ var webGlContextErrorMessage = (versionLabel, effectName) => `Failed to acquire ${versionLabel} context for ${effectName}. ` + 'Pass --gl=angle when using the CLI, set chromiumOptions: { gl: "angle" } when using SSR APIs, ' + 'or set "OpenGL render backend" to "angle" in the Advanced section when rendering in the Studio. ' + `See ${WEBGL_CONTEXT_DOCS_URL}`;
25660
+ var createWebGLContextError = (effectName) => new Error(webGlContextErrorMessage("WebGL", effectName));
25661
+ var createWebGL2ContextError = (effectName) => new Error(webGlContextErrorMessage("WebGL2", effectName));
25615
25662
 
25616
25663
  class CanvasPool {
25617
25664
  width;
@@ -25660,7 +25707,7 @@ class CanvasPool {
25660
25707
  preserveDrawingBuffer: true
25661
25708
  });
25662
25709
  if (!ctx) {
25663
- throw new Error("Failed to acquire WebGL2 context for canvas effect");
25710
+ throw createWebGL2ContextError("canvas effect");
25664
25711
  }
25665
25712
  canvas.addEventListener("webglcontextlost", (e) => {
25666
25713
  e.preventDefault();
@@ -25827,8 +25874,8 @@ var runEffectChain = async ({
25827
25874
  return true;
25828
25875
  };
25829
25876
  var useEffectChainState = () => {
25830
- const chainStateRef = useRef6(null);
25831
- const sizeRef = useRef6(null);
25877
+ const chainStateRef = useRef7(null);
25878
+ const sizeRef = useRef7(null);
25832
25879
  useEffect4(() => {
25833
25880
  return () => {
25834
25881
  if (chainStateRef.current) {
@@ -25849,186 +25896,6 @@ var useEffectChainState = () => {
25849
25896
  }
25850
25897
  }), []);
25851
25898
  };
25852
- var solidSchema = {
25853
- color: {
25854
- type: "color",
25855
- default: "#ffffff",
25856
- description: "Color"
25857
- },
25858
- width: {
25859
- type: "number",
25860
- min: 1,
25861
- step: 1,
25862
- default: 1920,
25863
- description: "Width"
25864
- },
25865
- height: {
25866
- type: "number",
25867
- min: 1,
25868
- step: 1,
25869
- default: 1080,
25870
- description: "Height"
25871
- },
25872
- ...sequenceStyleSchema
25873
- };
25874
- var SolidInner = ({
25875
- color,
25876
- width,
25877
- height,
25878
- _experimentalEffects: experimentalEffects = [],
25879
- className,
25880
- style,
25881
- overrideId,
25882
- ref
25883
- }) => {
25884
- const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
25885
- const [outputCanvas, setOutputCanvas] = useState6(null);
25886
- const memoizedEffects = useMemoizedEffects({
25887
- effects: experimentalEffects,
25888
- overrideId: overrideId ?? null
25889
- });
25890
- const sourceCanvas = useMemo16(() => {
25891
- if (typeof document === "undefined") {
25892
- return null;
25893
- }
25894
- const canvas = document.createElement("canvas");
25895
- canvas.width = 1;
25896
- canvas.height = 1;
25897
- return canvas;
25898
- }, []);
25899
- const chainState = useEffectChainState();
25900
- const canvasRef = useCallback6((canvas) => {
25901
- setOutputCanvas(canvas);
25902
- if (typeof ref === "function") {
25903
- ref(canvas);
25904
- } else if (ref) {
25905
- ref.current = canvas;
25906
- }
25907
- }, [ref]);
25908
- useEffect5(() => {
25909
- if (!outputCanvas || !sourceCanvas) {
25910
- return;
25911
- }
25912
- const handle = delayRender2("Solid effect chain");
25913
- if (!chainState) {
25914
- continueRender2(handle);
25915
- return () => {
25916
- continueRender2(handle);
25917
- };
25918
- }
25919
- const ctx = sourceCanvas.getContext("2d", { colorSpace: "srgb" });
25920
- if (!ctx) {
25921
- cancelRender2(new Error("Failed to acquire 2D context for <Solid> source"));
25922
- return;
25923
- }
25924
- ctx.fillStyle = color;
25925
- ctx.fillRect(0, 0, 1, 1);
25926
- runEffectChain({
25927
- state: chainState.get(width, height),
25928
- source: sourceCanvas,
25929
- effects: memoizedEffects,
25930
- output: outputCanvas,
25931
- width,
25932
- height
25933
- }).then((completed) => {
25934
- if (completed) {
25935
- continueRender2(handle);
25936
- }
25937
- }).catch((err) => {
25938
- cancelRender2(err);
25939
- });
25940
- return () => {
25941
- continueRender2(handle);
25942
- };
25943
- }, [
25944
- color,
25945
- outputCanvas,
25946
- sourceCanvas,
25947
- chainState,
25948
- width,
25949
- height,
25950
- delayRender2,
25951
- continueRender2,
25952
- cancelRender2,
25953
- memoizedEffects
25954
- ]);
25955
- return /* @__PURE__ */ jsx12("canvas", {
25956
- ref: canvasRef,
25957
- width,
25958
- height,
25959
- className,
25960
- style
25961
- });
25962
- };
25963
- var SolidOuter = forwardRef4(({
25964
- _experimentalEffects = [],
25965
- _experimentalControls: controls,
25966
- color,
25967
- height,
25968
- width,
25969
- className,
25970
- durationInFrames,
25971
- style,
25972
- name,
25973
- from,
25974
- hidden,
25975
- showInTimeline,
25976
- ...props
25977
- }, ref) => {
25978
- const memoizedEffectDefinitions = useMemoizedEffectDefinitions(_experimentalEffects);
25979
- return /* @__PURE__ */ jsx12(Sequence, {
25980
- layout: "none",
25981
- from,
25982
- hidden,
25983
- showInTimeline,
25984
- _experimentalControls: controls,
25985
- _experimentalEffects: memoizedEffectDefinitions,
25986
- durationInFrames,
25987
- name: name ?? "<Solid>",
25988
- ...props,
25989
- children: /* @__PURE__ */ jsx12(SolidInner, {
25990
- ref,
25991
- overrideId: controls?.overrideId ?? null,
25992
- color,
25993
- height,
25994
- width,
25995
- className,
25996
- style,
25997
- _experimentalEffects
25998
- })
25999
- });
26000
- });
26001
- var Solid = wrapInSchema(SolidOuter, solidSchema);
26002
- Solid.displayName = "Solid";
26003
- addSequenceStackTraces(Solid);
26004
- var VERSION = "4.0.463";
26005
- var checkMultipleRemotionVersions = () => {
26006
- if (typeof globalThis === "undefined") {
26007
- return;
26008
- }
26009
- const set = () => {
26010
- globalThis.remotion_imported = VERSION;
26011
- if (typeof window !== "undefined") {
26012
- window.remotion_imported = VERSION;
26013
- }
26014
- };
26015
- const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
26016
- if (alreadyImported) {
26017
- if (alreadyImported === VERSION) {
26018
- return;
26019
- }
26020
- if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
26021
- set();
26022
- return;
26023
- }
26024
- throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
26025
- VERSION,
26026
- typeof alreadyImported === "string" ? alreadyImported : "an older version"
26027
- ].filter(truthy2).join(" and ")}. This will cause things to break in an unexpected way.
26028
- Check that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`);
26029
- }
26030
- set();
26031
- };
26032
25899
  var calcArgs = (fit, frameSize, canvasSize) => {
26033
25900
  switch (fit) {
26034
25901
  case "fill": {
@@ -26077,29 +25944,49 @@ var calcArgs = (fit, frameSize, canvasSize) => {
26077
25944
  throw new Error("Unknown fit: " + fit);
26078
25945
  }
26079
25946
  };
26080
- var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref) => {
26081
- const canvasRef = useRef7(null);
26082
- const draw = useCallback7((imageData) => {
25947
+ var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effects }, ref) => {
25948
+ const canvasRef = useRef8(null);
25949
+ const chainState = useEffectChainState();
25950
+ const sourceCanvas = useMemo16(() => {
25951
+ if (typeof document === "undefined") {
25952
+ return null;
25953
+ }
25954
+ return document.createElement("canvas");
25955
+ }, []);
25956
+ const draw = useCallback6(async (imageData) => {
26083
25957
  const canvas = canvasRef.current;
26084
25958
  const canvasWidth = width ?? imageData.displayWidth;
26085
25959
  const canvasHeight = height ?? imageData.displayHeight;
26086
25960
  if (!canvas) {
26087
25961
  throw new Error("Canvas ref is not set");
26088
25962
  }
26089
- const ctx = canvasRef.current?.getContext("2d");
26090
- if (!ctx) {
26091
- throw new Error("Could not get 2d context");
25963
+ if (!sourceCanvas) {
25964
+ throw new Error("Source canvas is not available");
26092
25965
  }
26093
- canvas.width = canvasWidth;
26094
- canvas.height = canvasHeight;
26095
- ctx.drawImage(imageData, ...calcArgs(fit, {
25966
+ sourceCanvas.width = canvasWidth;
25967
+ sourceCanvas.height = canvasHeight;
25968
+ const sourceCtx = sourceCanvas.getContext("2d");
25969
+ if (!sourceCtx) {
25970
+ throw new Error("Could not get 2d context for source canvas");
25971
+ }
25972
+ sourceCtx.drawImage(imageData, ...calcArgs(fit, {
26096
25973
  height: imageData.displayHeight,
26097
25974
  width: imageData.displayWidth
26098
25975
  }, {
26099
25976
  width: canvasWidth,
26100
25977
  height: canvasHeight
26101
25978
  }));
26102
- }, [fit, height, width]);
25979
+ canvas.width = canvasWidth;
25980
+ canvas.height = canvasHeight;
25981
+ return runEffectChain({
25982
+ state: chainState.get(canvasWidth, canvasHeight),
25983
+ source: sourceCanvas,
25984
+ effects,
25985
+ output: canvas,
25986
+ width: canvasWidth,
25987
+ height: canvasHeight
25988
+ });
25989
+ }, [chainState, effects, fit, height, sourceCanvas, width]);
26103
25990
  useImperativeHandle(ref, () => {
26104
25991
  return {
26105
25992
  draw,
@@ -26118,13 +26005,13 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref
26118
26005
  }
26119
26006
  };
26120
26007
  }, [draw]);
26121
- return /* @__PURE__ */ jsx13("canvas", {
26008
+ return /* @__PURE__ */ jsx12("canvas", {
26122
26009
  ref: canvasRef,
26123
26010
  className,
26124
26011
  style
26125
26012
  });
26126
26013
  };
26127
- var Canvas = React15.forwardRef(CanvasRefForwardingFunction);
26014
+ var Canvas = React14.forwardRef(CanvasRefForwardingFunction);
26128
26015
  var CACHE_SIZE = 5;
26129
26016
  var getActualTime = ({
26130
26017
  loopBehavior,
@@ -26280,10 +26167,10 @@ var animatedImageSchema = {
26280
26167
  default: 1,
26281
26168
  description: "Playback Rate"
26282
26169
  },
26283
- ...sequenceStyleSchema,
26170
+ ...sequenceVisualStyleSchema,
26284
26171
  hidden: hiddenField
26285
26172
  };
26286
- var AnimatedImageContent = forwardRef5(({
26173
+ var AnimatedImageContent = forwardRef4(({
26287
26174
  src,
26288
26175
  width,
26289
26176
  height,
@@ -26291,26 +26178,24 @@ var AnimatedImageContent = forwardRef5(({
26291
26178
  loopBehavior = "loop",
26292
26179
  playbackRate = 1,
26293
26180
  fit = "fill",
26181
+ effects,
26182
+ controls,
26294
26183
  ...props
26295
26184
  }, canvasRef) => {
26296
- const mountState = useRef8({ isMounted: true });
26297
- useEffect6(() => {
26298
- const { current } = mountState;
26299
- current.isMounted = true;
26300
- return () => {
26301
- current.isMounted = false;
26302
- };
26303
- }, []);
26304
26185
  const resolvedSrc = resolveAnimatedImageSource(src);
26305
- const [imageDecoder, setImageDecoder] = useState7(null);
26186
+ const [imageDecoder, setImageDecoder] = useState6(null);
26306
26187
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
26307
- const [decodeHandle] = useState7(() => delayRender2(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
26188
+ const [decodeHandle] = useState6(() => delayRender2(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
26308
26189
  const frame = useCurrentFrame();
26309
26190
  const { fps } = useVideoConfig();
26310
26191
  const currentTime = frame / playbackRate / fps;
26311
- const currentTimeRef = useRef8(currentTime);
26192
+ const currentTimeRef = useRef9(currentTime);
26312
26193
  currentTimeRef.current = currentTime;
26313
- const ref = useRef8(null);
26194
+ const ref = useRef9(null);
26195
+ const memoizedEffects = useMemoizedEffects({
26196
+ effects,
26197
+ overrideId: controls?.overrideId ?? null
26198
+ });
26314
26199
  useImperativeHandle2(canvasRef, () => {
26315
26200
  const c = ref.current?.getCanvas();
26316
26201
  if (!c) {
@@ -26318,8 +26203,8 @@ var AnimatedImageContent = forwardRef5(({
26318
26203
  }
26319
26204
  return c;
26320
26205
  }, []);
26321
- const [initialLoopBehavior] = useState7(() => loopBehavior);
26322
- useEffect6(() => {
26206
+ const [initialLoopBehavior] = useState6(() => loopBehavior);
26207
+ useEffect5(() => {
26323
26208
  const controller = new AbortController;
26324
26209
  decodeImage({
26325
26210
  resolvedSrc,
@@ -26356,16 +26241,24 @@ var AnimatedImageContent = forwardRef5(({
26356
26241
  return;
26357
26242
  }
26358
26243
  const delay = delayRender2(`Rendering frame at ${currentTime} of <AnimatedImage src="${src}"/>`);
26359
- imageDecoder.getFrame(currentTime, loopBehavior).then((videoFrame) => {
26360
- if (mountState.current.isMounted) {
26361
- if (videoFrame === null) {
26362
- ref.current?.clear();
26363
- } else {
26364
- ref.current?.draw(videoFrame.frame);
26365
- }
26244
+ let cancelled = false;
26245
+ imageDecoder.getFrame(currentTime, loopBehavior).then(async (videoFrame) => {
26246
+ if (cancelled) {
26247
+ return;
26248
+ }
26249
+ if (videoFrame === null) {
26250
+ ref.current?.clear();
26251
+ continueRender2(delay);
26252
+ return;
26253
+ }
26254
+ const completed = await ref.current?.draw(videoFrame.frame);
26255
+ if (completed && !cancelled) {
26256
+ continueRender2(delay);
26366
26257
  }
26367
- continueRender2(delay);
26368
26258
  }).catch((err) => {
26259
+ if (cancelled) {
26260
+ return;
26261
+ }
26369
26262
  if (onError) {
26370
26263
  onError(err);
26371
26264
  continueRender2(delay);
@@ -26373,6 +26266,10 @@ var AnimatedImageContent = forwardRef5(({
26373
26266
  cancelRender(err);
26374
26267
  }
26375
26268
  });
26269
+ return () => {
26270
+ cancelled = true;
26271
+ continueRender2(delay);
26272
+ };
26376
26273
  }, [
26377
26274
  currentTime,
26378
26275
  imageDecoder,
@@ -26380,13 +26277,18 @@ var AnimatedImageContent = forwardRef5(({
26380
26277
  onError,
26381
26278
  src,
26382
26279
  continueRender2,
26383
- delayRender2
26280
+ delayRender2,
26281
+ memoizedEffects,
26282
+ fit,
26283
+ width,
26284
+ height
26384
26285
  ]);
26385
- return /* @__PURE__ */ jsx14(Canvas, {
26286
+ return /* @__PURE__ */ jsx13(Canvas, {
26386
26287
  ref,
26387
26288
  width,
26388
26289
  height,
26389
26290
  fit,
26291
+ effects: memoizedEffects,
26390
26292
  ...props
26391
26293
  });
26392
26294
  });
@@ -26403,12 +26305,14 @@ var AnimatedImageInner = ({
26403
26305
  className,
26404
26306
  style,
26405
26307
  durationInFrames,
26308
+ _experimentalEffects: effects = [],
26406
26309
  _experimentalControls: controls,
26407
26310
  ref,
26408
26311
  ...sequenceProps
26409
26312
  }) => {
26410
26313
  const { durationInFrames: videoDuration } = useVideoConfig();
26411
26314
  const resolvedDuration = durationInFrames ?? videoDuration;
26315
+ const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
26412
26316
  const animatedImageProps = {
26413
26317
  src,
26414
26318
  width,
@@ -26421,21 +26325,179 @@ var AnimatedImageInner = ({
26421
26325
  className,
26422
26326
  style
26423
26327
  };
26424
- return /* @__PURE__ */ jsx14(Sequence, {
26328
+ return /* @__PURE__ */ jsx13(Sequence, {
26425
26329
  layout: "none",
26426
26330
  durationInFrames: resolvedDuration,
26427
26331
  name: "<AnimatedImage>",
26428
26332
  _experimentalControls: controls,
26333
+ _experimentalEffects: memoizedEffectDefinitions,
26429
26334
  ...sequenceProps,
26430
- children: /* @__PURE__ */ jsx14(AnimatedImageContent, {
26335
+ children: /* @__PURE__ */ jsx13(AnimatedImageContent, {
26431
26336
  ...animatedImageProps,
26432
- ref
26337
+ ref,
26338
+ effects,
26339
+ controls
26433
26340
  })
26434
26341
  });
26435
26342
  };
26436
26343
  var AnimatedImage = wrapInSchema(AnimatedImageInner, animatedImageSchema);
26437
26344
  AnimatedImage.displayName = "AnimatedImage";
26438
26345
  addSequenceStackTraces(AnimatedImage);
26346
+ var solidSchema = {
26347
+ color: {
26348
+ type: "color",
26349
+ default: "transparent",
26350
+ description: "Color"
26351
+ },
26352
+ width: {
26353
+ type: "number",
26354
+ min: 1,
26355
+ step: 1,
26356
+ default: 1920,
26357
+ description: "Width"
26358
+ },
26359
+ height: {
26360
+ type: "number",
26361
+ min: 1,
26362
+ step: 1,
26363
+ default: 1080,
26364
+ description: "Height"
26365
+ },
26366
+ ...sequenceVisualStyleSchema
26367
+ };
26368
+ var SolidInner = ({
26369
+ color,
26370
+ width,
26371
+ height,
26372
+ _experimentalEffects: experimentalEffects = [],
26373
+ className,
26374
+ style,
26375
+ overrideId,
26376
+ ref
26377
+ }) => {
26378
+ const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
26379
+ const [outputCanvas, setOutputCanvas] = useState7(null);
26380
+ const memoizedEffects = useMemoizedEffects({
26381
+ effects: experimentalEffects,
26382
+ overrideId: overrideId ?? null
26383
+ });
26384
+ const sourceCanvas = useMemo17(() => {
26385
+ if (typeof document === "undefined") {
26386
+ return null;
26387
+ }
26388
+ const canvas = document.createElement("canvas");
26389
+ canvas.width = 1;
26390
+ canvas.height = 1;
26391
+ return canvas;
26392
+ }, []);
26393
+ const chainState = useEffectChainState();
26394
+ const canvasRef = useCallback7((canvas) => {
26395
+ setOutputCanvas(canvas);
26396
+ if (typeof ref === "function") {
26397
+ ref(canvas);
26398
+ } else if (ref) {
26399
+ ref.current = canvas;
26400
+ }
26401
+ }, [ref]);
26402
+ useEffect6(() => {
26403
+ if (!outputCanvas || !sourceCanvas) {
26404
+ return;
26405
+ }
26406
+ const handle = delayRender2("Solid effect chain");
26407
+ if (!chainState) {
26408
+ continueRender2(handle);
26409
+ return () => {
26410
+ continueRender2(handle);
26411
+ };
26412
+ }
26413
+ const ctx = sourceCanvas.getContext("2d", { colorSpace: "srgb" });
26414
+ if (!ctx) {
26415
+ cancelRender2(new Error("Failed to acquire 2D context for <Solid> source"));
26416
+ return;
26417
+ }
26418
+ ctx.clearRect(0, 0, 1, 1);
26419
+ if (color !== undefined) {
26420
+ ctx.fillStyle = color;
26421
+ ctx.fillRect(0, 0, 1, 1);
26422
+ }
26423
+ runEffectChain({
26424
+ state: chainState.get(width, height),
26425
+ source: sourceCanvas,
26426
+ effects: memoizedEffects,
26427
+ output: outputCanvas,
26428
+ width,
26429
+ height
26430
+ }).then((completed) => {
26431
+ if (completed) {
26432
+ continueRender2(handle);
26433
+ }
26434
+ }).catch((err) => {
26435
+ cancelRender2(err);
26436
+ });
26437
+ return () => {
26438
+ continueRender2(handle);
26439
+ };
26440
+ }, [
26441
+ color,
26442
+ outputCanvas,
26443
+ sourceCanvas,
26444
+ chainState,
26445
+ width,
26446
+ height,
26447
+ delayRender2,
26448
+ continueRender2,
26449
+ cancelRender2,
26450
+ memoizedEffects
26451
+ ]);
26452
+ return /* @__PURE__ */ jsx14("canvas", {
26453
+ ref: canvasRef,
26454
+ width,
26455
+ height,
26456
+ className,
26457
+ style
26458
+ });
26459
+ };
26460
+ var SolidOuter = forwardRef5(({
26461
+ _experimentalEffects = [],
26462
+ _experimentalControls: controls,
26463
+ color,
26464
+ height,
26465
+ width,
26466
+ className,
26467
+ durationInFrames,
26468
+ style,
26469
+ name,
26470
+ from,
26471
+ hidden,
26472
+ showInTimeline,
26473
+ ...props
26474
+ }, ref) => {
26475
+ const memoizedEffectDefinitions = useMemoizedEffectDefinitions(_experimentalEffects);
26476
+ return /* @__PURE__ */ jsx14(Sequence, {
26477
+ layout: "none",
26478
+ from,
26479
+ hidden,
26480
+ showInTimeline,
26481
+ _experimentalControls: controls,
26482
+ _experimentalEffects: memoizedEffectDefinitions,
26483
+ durationInFrames,
26484
+ name: name ?? "<Solid>",
26485
+ ...props,
26486
+ children: /* @__PURE__ */ jsx14(SolidInner, {
26487
+ ref,
26488
+ overrideId: controls?.overrideId ?? null,
26489
+ color,
26490
+ height,
26491
+ width,
26492
+ className,
26493
+ style,
26494
+ _experimentalEffects
26495
+ })
26496
+ });
26497
+ });
26498
+ var Solid = wrapInSchema(SolidOuter, solidSchema);
26499
+ Solid.displayName = "Solid";
26500
+ addSequenceStackTraces(Solid);
26439
26501
  var cachedSupport = null;
26440
26502
  var isHtmlInCanvasSupported = () => {
26441
26503
  if (cachedSupport !== null) {
@@ -26446,7 +26508,7 @@ var isHtmlInCanvasSupported = () => {
26446
26508
  }
26447
26509
  const canvas = document.createElement("canvas");
26448
26510
  const ctx = canvas.getContext("2d");
26449
- cachedSupport = typeof ctx?.drawElementImage === "function" && typeof canvas.requestPaint === "function" && typeof canvas.captureElementImage === "function";
26511
+ cachedSupport = typeof ctx?.drawElementImage === "function" && typeof canvas.requestPaint === "function" && typeof canvas.captureElementImage === "function" && "transferControlToOffscreen" in HTMLCanvasElement.prototype;
26450
26512
  return cachedSupport;
26451
26513
  };
26452
26514
  var HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = "HTML in Canvas is not supported. Two common causes: Chrome is older than version 148 (update Chrome), or the HTML-in-Canvas flag is disabled at chrome://flags/#canvas-draw-element (enable it and restart Chrome).";
@@ -26482,8 +26544,10 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
26482
26544
  if (!isHtmlInCanvasSupported()) {
26483
26545
  cancelRender2(new Error(HTML_IN_CANVAS_UNSUPPORTED_MESSAGE));
26484
26546
  }
26485
- const canvas2dRef = useRef9(null);
26486
- const divRef = useRef9(null);
26547
+ const canvas2dRef = useRef10(null);
26548
+ const offscreenRef = useRef10(null);
26549
+ const divRef = useRef10(null);
26550
+ const canvasSizeKey = `${width}x${height}`;
26487
26551
  const setLayoutCanvasRef = useCallback8((node) => {
26488
26552
  canvas2dRef.current = node;
26489
26553
  if (typeof ref === "function") {
@@ -26492,45 +26556,48 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
26492
26556
  ref.current = node;
26493
26557
  }
26494
26558
  }, [ref]);
26495
- const [offscreenCanvas] = useState8(() => new OffscreenCanvas(1, 1));
26496
26559
  const chainState = useEffectChainState();
26497
26560
  const memoizedEffects = useMemoizedEffects({
26498
26561
  effects,
26499
26562
  overrideId: controls?.overrideId ?? null
26500
26563
  });
26501
- const effectsRef = useRef9(memoizedEffects);
26564
+ const effectsRef = useRef10(memoizedEffects);
26502
26565
  effectsRef.current = memoizedEffects;
26503
- const onPaintRef = useRef9(onPaint);
26566
+ const onPaintRef = useRef10(onPaint);
26504
26567
  onPaintRef.current = onPaint;
26505
- const onInitRef = useRef9(onInit);
26568
+ const onInitRef = useRef10(onInit);
26506
26569
  onInitRef.current = onInit;
26507
- const initializedRef = useRef9(false);
26508
- const onInitCleanupRef = useRef9(null);
26509
- const unmountedRef = useRef9(false);
26570
+ const initializedRef = useRef10(false);
26571
+ const onInitCleanupRef = useRef10(null);
26572
+ const unmountedRef = useRef10(false);
26510
26573
  const onPaintCb = useCallback8(async () => {
26511
26574
  const element = divRef.current;
26512
26575
  if (!element) {
26513
26576
  throw new Error("Canvas or scene element not found");
26514
26577
  }
26515
- offscreenCanvas.width = width;
26516
- offscreenCanvas.height = height;
26578
+ const offscreen = offscreenRef.current;
26579
+ if (!offscreen) {
26580
+ throw new Error("HtmlInCanvas: offscreen canvas not ready (transferControlToOffscreen failed or canvas is remounting)");
26581
+ }
26582
+ offscreen.width = width;
26583
+ offscreen.height = height;
26517
26584
  try {
26518
- const layoutCanvas = canvas2dRef.current;
26519
- if (!layoutCanvas) {
26585
+ const placeholderCanvas = canvas2dRef.current;
26586
+ if (!placeholderCanvas) {
26520
26587
  throw new Error("Canvas not found");
26521
26588
  }
26522
- const layout2d = layoutCanvas.getContext("2d");
26523
- if (!layout2d) {
26524
- throw new Error("Failed to acquire 2D context for <HtmlInCanvas> layout canvas");
26589
+ const offscreen2d = offscreen.getContext("2d");
26590
+ if (!offscreen2d) {
26591
+ throw new Error("Failed to acquire 2D context for <HtmlInCanvas> offscreen canvas");
26525
26592
  }
26526
26593
  const handle = delayRender("onPaint");
26527
26594
  if (!initializedRef.current) {
26528
26595
  initializedRef.current = true;
26529
- const initImage = layoutCanvas.captureElementImage(element);
26596
+ const initImage = placeholderCanvas.captureElementImage(element);
26530
26597
  const currentOnInit = onInitRef.current;
26531
26598
  if (currentOnInit) {
26532
26599
  const cleanup = await currentOnInit({
26533
- canvas: offscreenCanvas,
26600
+ canvas: offscreen,
26534
26601
  element,
26535
26602
  elementImage: initImage
26536
26603
  });
@@ -26545,17 +26612,17 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
26545
26612
  }
26546
26613
  }
26547
26614
  const handler = onPaintRef.current ?? defaultOnPaint;
26548
- const elImage = layoutCanvas.captureElementImage(element);
26615
+ const elImage = placeholderCanvas.captureElementImage(element);
26549
26616
  await handler({
26550
- canvas: offscreenCanvas,
26617
+ canvas: offscreen,
26551
26618
  element,
26552
26619
  elementImage: elImage
26553
26620
  });
26554
26621
  await runEffectChain({
26555
26622
  state: chainState.get(width, height),
26556
- source: offscreenCanvas,
26623
+ source: offscreen,
26557
26624
  effects: effectsRef.current,
26558
- output: canvas2dRef.current,
26625
+ output: offscreen,
26559
26626
  width,
26560
26627
  height
26561
26628
  });
@@ -26563,29 +26630,30 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
26563
26630
  } catch (error2) {
26564
26631
  cancelRender2(error2);
26565
26632
  }
26566
- }, [
26567
- chainState,
26568
- continueRender2,
26569
- cancelRender2,
26570
- width,
26571
- height,
26572
- offscreenCanvas
26573
- ]);
26633
+ }, [chainState, continueRender2, cancelRender2, width, height]);
26574
26634
  useLayoutEffect3(() => {
26575
- const canvas = canvas2dRef.current;
26576
- if (!canvas) {
26635
+ const placeholder = canvas2dRef.current;
26636
+ if (!placeholder) {
26577
26637
  throw new Error("Canvas not found");
26578
26638
  }
26579
- canvas.layoutSubtree = true;
26580
- canvas.addEventListener("paint", onPaintCb);
26639
+ placeholder.layoutSubtree = true;
26640
+ const offscreen = placeholder.transferControlToOffscreen();
26641
+ offscreenRef.current = offscreen;
26642
+ offscreen.width = width;
26643
+ offscreen.height = height;
26644
+ initializedRef.current = false;
26645
+ unmountedRef.current = false;
26646
+ placeholder.addEventListener("paint", onPaintCb);
26581
26647
  return () => {
26582
- canvas.removeEventListener("paint", onPaintCb);
26648
+ placeholder.removeEventListener("paint", onPaintCb);
26649
+ offscreenRef.current = null;
26650
+ initializedRef.current = false;
26583
26651
  unmountedRef.current = true;
26584
26652
  onInitCleanupRef.current?.();
26585
26653
  onInitCleanupRef.current = null;
26586
26654
  };
26587
- }, [onPaintCb, cancelRender2]);
26588
- const onPaintChangedRef = useRef9(false);
26655
+ }, [onPaintCb, cancelRender2, width, height]);
26656
+ const onPaintChangedRef = useRef10(false);
26589
26657
  useLayoutEffect3(() => {
26590
26658
  if (!onPaintChangedRef.current) {
26591
26659
  onPaintChangedRef.current = true;
@@ -26609,8 +26677,8 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
26609
26677
  return () => {
26610
26678
  continueRender2(handle);
26611
26679
  };
26612
- }, [width, height, continueRender2]);
26613
- const innerStyle = useMemo17(() => {
26680
+ }, [width, height, continueRender2, canvasSizeKey]);
26681
+ const innerStyle = useMemo18(() => {
26614
26682
  return {
26615
26683
  width,
26616
26684
  height
@@ -26631,7 +26699,7 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
26631
26699
  style: innerStyle,
26632
26700
  children
26633
26701
  })
26634
- })
26702
+ }, canvasSizeKey)
26635
26703
  });
26636
26704
  });
26637
26705
  HtmlInCanvasContent.displayName = "HtmlInCanvasContent";
@@ -26673,7 +26741,7 @@ var HtmlInCanvasInner = forwardRef6(({
26673
26741
  });
26674
26742
  HtmlInCanvasInner.displayName = "HtmlInCanvas";
26675
26743
  var htmlInCanvasSchema = {
26676
- ...sequenceStyleSchema,
26744
+ ...sequenceVisualStyleSchema,
26677
26745
  hidden: hiddenField
26678
26746
  };
26679
26747
  var HtmlInCanvasWrapped = wrapInSchema(HtmlInCanvasInner, htmlInCanvasSchema);
@@ -26721,8 +26789,8 @@ var RenderAssetManager = createContext17({
26721
26789
  renderAssets: []
26722
26790
  });
26723
26791
  var RenderAssetManagerProvider = ({ children, collectAssets }) => {
26724
- const [renderAssets, setRenderAssets] = useState9([]);
26725
- const renderAssetsRef = useRef10([]);
26792
+ const [renderAssets, setRenderAssets] = useState8([]);
26793
+ const renderAssetsRef = useRef11([]);
26726
26794
  const registerRenderAsset = useCallback9((renderAsset) => {
26727
26795
  validateRenderAsset(renderAsset);
26728
26796
  renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
@@ -26754,7 +26822,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
26754
26822
  };
26755
26823
  }
26756
26824
  }, []);
26757
- const contextValue = useMemo18(() => {
26825
+ const contextValue = useMemo19(() => {
26758
26826
  return {
26759
26827
  registerRenderAsset,
26760
26828
  unregisterRenderAsset,
@@ -26771,7 +26839,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
26771
26839
  const { registerRenderAsset, unregisterRenderAsset } = useContext19(RenderAssetManager);
26772
26840
  const env = useRemotionEnvironment();
26773
26841
  const frame = useCurrentFrame();
26774
- const [id] = useState10(() => {
26842
+ const [id] = useState9(() => {
26775
26843
  return String(Math.random());
26776
26844
  });
26777
26845
  useLayoutEffect5(() => {
@@ -26883,14 +26951,14 @@ var Loop = ({
26883
26951
  const iteration = Math.floor(currentFrame / durationInFrames);
26884
26952
  const start = iteration * durationInFrames;
26885
26953
  const from = Math.min(start, maxFrame);
26886
- const loopDisplay = useMemo19(() => {
26954
+ const loopDisplay = useMemo20(() => {
26887
26955
  return {
26888
26956
  numberOfTimes: Math.min(compDuration / durationInFrames, times),
26889
26957
  startOffset: -from,
26890
26958
  durationInFrames
26891
26959
  };
26892
26960
  }, [compDuration, durationInFrames, from, times]);
26893
- const loopContext = useMemo19(() => {
26961
+ const loopContext = useMemo20(() => {
26894
26962
  return {
26895
26963
  iteration: Math.floor(currentFrame / durationInFrames),
26896
26964
  durationInFrames
@@ -26928,7 +26996,7 @@ var setPreloads = (updater) => {
26928
26996
  updaters.forEach((u) => u());
26929
26997
  };
26930
26998
  var PrefetchProvider = ({ children }) => {
26931
- const [_preloads, _setPreloads] = useState11(() => preloads);
26999
+ const [_preloads, _setPreloads] = useState10(() => preloads);
26932
27000
  useEffect7(() => {
26933
27001
  const updaterFunction = () => {
26934
27002
  _setPreloads(preloads);
@@ -27252,7 +27320,7 @@ var DurationsContext = createContext20({
27252
27320
  });
27253
27321
  var DurationsContextProvider = ({ children }) => {
27254
27322
  const [durations, setDurations] = useReducer(durationReducer, {});
27255
- const value = useMemo20(() => {
27323
+ const value = useMemo21(() => {
27256
27324
  return {
27257
27325
  durations,
27258
27326
  setDurations
@@ -27386,7 +27454,7 @@ var useSingletonAudioContext = ({
27386
27454
  audioEnabled
27387
27455
  }) => {
27388
27456
  const env = useRemotionEnvironment();
27389
- const context = useMemo21(() => {
27457
+ const context = useMemo22(() => {
27390
27458
  if (env.isRendering) {
27391
27459
  return null;
27392
27460
  }
@@ -27467,11 +27535,11 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
27467
27535
  latencyHint: audioLatencyHint,
27468
27536
  audioEnabled
27469
27537
  });
27470
- const audioContextIsPlayingEventually = useRef11(false);
27471
- const isResuming = useRef11(null);
27472
- const audioSyncAnchor = useMemo22(() => ({ value: 0 }), []);
27473
- const audioSyncAnchorListeners = useRef11([]);
27474
- const audioSyncAnchorEmitter = useMemo22(() => {
27538
+ const audioContextIsPlayingEventually = useRef12(false);
27539
+ const isResuming = useRef12(null);
27540
+ const audioSyncAnchor = useMemo23(() => ({ value: 0 }), []);
27541
+ const audioSyncAnchorListeners = useRef12([]);
27542
+ const audioSyncAnchorEmitter = useMemo23(() => {
27475
27543
  return {
27476
27544
  dispatch: (event2) => {
27477
27545
  audioSyncAnchorListeners.current.forEach((l) => l(event2));
@@ -27486,12 +27554,12 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
27486
27554
  }
27487
27555
  };
27488
27556
  }, []);
27489
- const prevEndTimes = useRef11({ scheduledEndTime: null, mediaEndTime: null });
27490
- const nodesToResume = useRef11(new Map);
27557
+ const prevEndTimes = useRef12({ scheduledEndTime: null, mediaEndTime: null });
27558
+ const nodesToResume = useRef12(new Map);
27491
27559
  const unscheduleAudioNode = useCallback10((node) => {
27492
27560
  nodesToResume.current.delete(node);
27493
27561
  }, []);
27494
- const scheduleAudioNode = useMemo22(() => {
27562
+ const scheduleAudioNode = useMemo23(() => {
27495
27563
  return ({
27496
27564
  node,
27497
27565
  mediaTimestamp,
@@ -27576,7 +27644,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
27576
27644
  audioContextIsPlayingEventually.current = false;
27577
27645
  ctxAndGain.audioContext.suspend();
27578
27646
  }, [ctxAndGain]);
27579
- const audioContextValue = useMemo22(() => {
27647
+ const audioContextValue = useMemo23(() => {
27580
27648
  return {
27581
27649
  audioContext: ctxAndGain?.audioContext ?? null,
27582
27650
  gainNode: ctxAndGain?.gainNode ?? null,
@@ -27604,8 +27672,8 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
27604
27672
  });
27605
27673
  };
27606
27674
  var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
27607
- const audios = useRef11([]);
27608
- const [initialNumberOfAudioTags] = useState12(numberOfAudioTags);
27675
+ const audios = useRef12([]);
27676
+ const [initialNumberOfAudioTags] = useState11(numberOfAudioTags);
27609
27677
  if (numberOfAudioTags !== initialNumberOfAudioTags) {
27610
27678
  throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
27611
27679
  }
@@ -27615,7 +27683,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
27615
27683
  const audioCtx = useContext21(SharedAudioContext);
27616
27684
  const audioContext = audioCtx?.audioContext ?? null;
27617
27685
  const resume = audioCtx?.resume;
27618
- const refs = useMemo22(() => {
27686
+ const refs = useMemo23(() => {
27619
27687
  return new Array(numberOfAudioTags).fill(true).map(() => {
27620
27688
  const ref = createRef2();
27621
27689
  return {
@@ -27638,7 +27706,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
27638
27706
  });
27639
27707
  };
27640
27708
  }, [refs]);
27641
- const takenAudios = useRef11(new Array(numberOfAudioTags).fill(false));
27709
+ const takenAudios = useRef12(new Array(numberOfAudioTags).fill(false));
27642
27710
  const rerenderAudios = useCallback10(() => {
27643
27711
  refs.forEach(({ ref, id }) => {
27644
27712
  const data = audios.current?.find((a) => a.id === id);
@@ -27752,7 +27820,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
27752
27820
  });
27753
27821
  resume?.();
27754
27822
  }, [logLevel, mountTime, refs, env.isPlayer, resume]);
27755
- const audioTagsValue = useMemo22(() => {
27823
+ const audioTagsValue = useMemo23(() => {
27756
27824
  return {
27757
27825
  registerAudio,
27758
27826
  unregisterAudio,
@@ -27789,7 +27857,7 @@ var useSharedAudio = ({
27789
27857
  }) => {
27790
27858
  const audioCtx = useContext21(SharedAudioContext);
27791
27859
  const tagsCtx = useContext21(SharedAudioTagsContext);
27792
- const [elem] = useState12(() => {
27860
+ const [elem] = useState11(() => {
27793
27861
  if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
27794
27862
  return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
27795
27863
  }
@@ -27925,9 +27993,9 @@ var useAppendVideoFragment = ({
27925
27993
  duration: initialDuration,
27926
27994
  fps
27927
27995
  }) => {
27928
- const actualFromRef = useRef12(initialActualFrom);
27929
- const actualDuration = useRef12(initialDuration);
27930
- const actualSrc = useRef12(initialActualSrc);
27996
+ const actualFromRef = useRef13(initialActualFrom);
27997
+ const actualDuration = useRef13(initialDuration);
27998
+ const actualSrc = useRef13(initialActualSrc);
27931
27999
  if (!isSubsetOfDuration({
27932
28000
  prevStartFrom: actualFromRef.current,
27933
28001
  newStartFrom: initialActualFrom,
@@ -27964,8 +28032,8 @@ var useVolume = ({
27964
28032
  source,
27965
28033
  shouldUseWebAudioApi
27966
28034
  }) => {
27967
- const audioStuffRef = useRef13(null);
27968
- const currentVolumeRef = useRef13(volume);
28035
+ const audioStuffRef = useRef14(null);
28036
+ const currentVolumeRef = useRef14(volume);
27969
28037
  currentVolumeRef.current = volume;
27970
28038
  const sharedAudioContext = useContext22(SharedAudioContext);
27971
28039
  if (!sharedAudioContext) {
@@ -28122,7 +28190,7 @@ var useBasicMediaInTimeline = ({
28122
28190
  throw new Error("No src passed");
28123
28191
  }
28124
28192
  const parentSequence = useContext24(SequenceContext);
28125
- const [initialVolume] = useState13(() => volume);
28193
+ const [initialVolume] = useState12(() => volume);
28126
28194
  const duration = getTimelineDuration({
28127
28195
  compositionDurationInFrames: sequenceDurationInFrames,
28128
28196
  playbackRate,
@@ -28131,7 +28199,7 @@ var useBasicMediaInTimeline = ({
28131
28199
  parentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null,
28132
28200
  loop
28133
28201
  });
28134
- const volumes = useMemo23(() => {
28202
+ const volumes = useMemo24(() => {
28135
28203
  if (typeof volume === "number") {
28136
28204
  return volume;
28137
28205
  }
@@ -28152,7 +28220,7 @@ var useBasicMediaInTimeline = ({
28152
28220
  const nonce = useNonce();
28153
28221
  const { rootId } = useTimelineContext();
28154
28222
  const startMediaFrom = 0 - mediaStartsAt + (trimBefore ?? 0);
28155
- const memoizedResult = useMemo23(() => {
28223
+ const memoizedResult = useMemo24(() => {
28156
28224
  return {
28157
28225
  volumes,
28158
28226
  duration,
@@ -28181,7 +28249,7 @@ var useImageInTimeline = ({
28181
28249
  src,
28182
28250
  displayName,
28183
28251
  id,
28184
- stack,
28252
+ getStack,
28185
28253
  showInTimeline,
28186
28254
  premountDisplay,
28187
28255
  postmountDisplay,
@@ -28228,7 +28296,7 @@ var useImageInTimeline = ({
28228
28296
  showInTimeline: true,
28229
28297
  nonce: nonce.get(),
28230
28298
  loopDisplay,
28231
- stack,
28299
+ getStack,
28232
28300
  premountDisplay,
28233
28301
  postmountDisplay,
28234
28302
  controls,
@@ -28245,7 +28313,7 @@ var useImageInTimeline = ({
28245
28313
  registerSequence,
28246
28314
  unregisterSequence,
28247
28315
  nonce,
28248
- stack,
28316
+ getStack,
28249
28317
  showInTimeline,
28250
28318
  premountDisplay,
28251
28319
  postmountDisplay,
@@ -28264,7 +28332,7 @@ var useMediaInTimeline = ({
28264
28332
  playbackRate,
28265
28333
  displayName,
28266
28334
  id,
28267
- stack,
28335
+ getStack,
28268
28336
  showInTimeline,
28269
28337
  premountDisplay,
28270
28338
  postmountDisplay,
@@ -28315,7 +28383,7 @@ var useMediaInTimeline = ({
28315
28383
  doesVolumeChange,
28316
28384
  loopDisplay,
28317
28385
  playbackRate,
28318
- stack,
28386
+ getStack,
28319
28387
  premountDisplay,
28320
28388
  postmountDisplay,
28321
28389
  controls: null,
@@ -28337,7 +28405,7 @@ var useMediaInTimeline = ({
28337
28405
  mediaType,
28338
28406
  startsAt,
28339
28407
  playbackRate,
28340
- stack,
28408
+ getStack,
28341
28409
  showInTimeline,
28342
28410
  premountDisplay,
28343
28411
  postmountDisplay,
@@ -28348,12 +28416,12 @@ var useMediaInTimeline = ({
28348
28416
  ]);
28349
28417
  };
28350
28418
  var useBufferManager = (logLevel, mountTime) => {
28351
- const [blocks, setBlocks] = useState14([]);
28352
- const [onBufferingCallbacks, setOnBufferingCallbacks] = useState14([]);
28353
- const [onResumeCallbacks, setOnResumeCallbacks] = useState14([]);
28419
+ const [blocks, setBlocks] = useState13([]);
28420
+ const [onBufferingCallbacks, setOnBufferingCallbacks] = useState13([]);
28421
+ const [onResumeCallbacks, setOnResumeCallbacks] = useState13([]);
28354
28422
  const env = useRemotionEnvironment();
28355
28423
  const rendering = env.isRendering;
28356
- const buffering = useRef14(false);
28424
+ const buffering = useRef15(false);
28357
28425
  const addBlock = useCallback11((block) => {
28358
28426
  if (rendering) {
28359
28427
  return {
@@ -28426,7 +28494,7 @@ var useBufferManager = (logLevel, mountTime) => {
28426
28494
  }
28427
28495
  }, [blocks]);
28428
28496
  }
28429
- return useMemo24(() => {
28497
+ return useMemo25(() => {
28430
28498
  return { addBlock, listenForBuffering, listenForResume, buffering };
28431
28499
  }, [addBlock, buffering, listenForBuffering, listenForResume]);
28432
28500
  };
@@ -28440,7 +28508,7 @@ var BufferingProvider = ({ children }) => {
28440
28508
  });
28441
28509
  };
28442
28510
  var useIsPlayerBuffering = (bufferManager) => {
28443
- const [isBuffering, setIsBuffering] = useState14(bufferManager.buffering.current);
28511
+ const [isBuffering, setIsBuffering] = useState13(bufferManager.buffering.current);
28444
28512
  useEffect9(() => {
28445
28513
  const onBuffer = () => {
28446
28514
  setIsBuffering(true);
@@ -28465,7 +28533,7 @@ var useBufferState = () => {
28465
28533
  const buffer = useContext26(BufferingContextReact);
28466
28534
  const logLevel = useLogLevel();
28467
28535
  const addBlock = buffer ? buffer.addBlock : null;
28468
- return useMemo25(() => ({
28536
+ return useMemo26(() => ({
28469
28537
  delayPlayback: () => {
28470
28538
  if (!addBlock) {
28471
28539
  throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a <Composition>. Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");
@@ -28500,7 +28568,7 @@ var useBufferUntilFirstFrame = ({
28500
28568
  logLevel,
28501
28569
  mountTime
28502
28570
  }) => {
28503
- const bufferingRef = useRef15(false);
28571
+ const bufferingRef = useRef16(false);
28504
28572
  const { delayPlayback } = useBufferState();
28505
28573
  const bufferUntilFirstFrame = useCallback12((requestedTime) => {
28506
28574
  if (mediaType !== "video") {
@@ -28573,7 +28641,7 @@ var useBufferUntilFirstFrame = ({
28573
28641
  onVariableFpsVideoDetected,
28574
28642
  pauseWhenBuffering
28575
28643
  ]);
28576
- return useMemo26(() => {
28644
+ return useMemo27(() => {
28577
28645
  return {
28578
28646
  isBuffering: () => bufferingRef.current,
28579
28647
  bufferUntilFirstFrame
@@ -28621,7 +28689,7 @@ var useMediaBuffering = ({
28621
28689
  src
28622
28690
  }) => {
28623
28691
  const buffer = useBufferState();
28624
- const [isBuffering, setIsBuffering] = useState15(false);
28692
+ const [isBuffering, setIsBuffering] = useState14(false);
28625
28693
  useEffect10(() => {
28626
28694
  let cleanupFns = [];
28627
28695
  const { current } = element;
@@ -28754,7 +28822,7 @@ var useRequestVideoCallbackTime = ({
28754
28822
  lastSeek,
28755
28823
  onVariableFpsVideoDetected
28756
28824
  }) => {
28757
- const currentTime = useRef16(null);
28825
+ const currentTime = useRef17(null);
28758
28826
  useEffect11(() => {
28759
28827
  const { current } = mediaRef;
28760
28828
  if (current) {
@@ -29011,14 +29079,14 @@ var useMediaPlayback = ({
29011
29079
  const buffering = useContext27(BufferingContextReact);
29012
29080
  const { fps } = useVideoConfig();
29013
29081
  const mediaStartsAt = useMediaStartsAt();
29014
- const lastSeekDueToShift = useRef17(null);
29015
- const lastSeek = useRef17(null);
29082
+ const lastSeekDueToShift = useRef18(null);
29083
+ const lastSeek = useRef18(null);
29016
29084
  const logLevel = useLogLevel();
29017
29085
  const mountTime = useMountTime();
29018
29086
  if (!buffering) {
29019
29087
  throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
29020
29088
  }
29021
- const isVariableFpsVideoMap = useRef17({});
29089
+ const isVariableFpsVideoMap = useRef18({});
29022
29090
  const onVariableFpsVideoDetected = useCallback13(() => {
29023
29091
  if (!src) {
29024
29092
  return;
@@ -29301,14 +29369,14 @@ var SetMediaVolumeContext = createContext22({
29301
29369
  var useMediaVolumeState = () => {
29302
29370
  const { mediaVolume } = useContext28(MediaVolumeContext);
29303
29371
  const { setMediaVolume } = useContext28(SetMediaVolumeContext);
29304
- return useMemo27(() => {
29372
+ return useMemo28(() => {
29305
29373
  return [mediaVolume, setMediaVolume];
29306
29374
  }, [mediaVolume, setMediaVolume]);
29307
29375
  };
29308
29376
  var useMediaMutedState = () => {
29309
29377
  const { mediaMuted } = useContext28(MediaVolumeContext);
29310
29378
  const { setMediaMuted } = useContext28(SetMediaVolumeContext);
29311
- return useMemo27(() => {
29379
+ return useMemo28(() => {
29312
29380
  return [mediaMuted, setMediaMuted];
29313
29381
  }, [mediaMuted, setMediaMuted]);
29314
29382
  };
@@ -29318,7 +29386,7 @@ var warnAboutTooHighVolume = (volume) => {
29318
29386
  }
29319
29387
  };
29320
29388
  var AudioForDevelopmentForwardRefFunction = (props, ref) => {
29321
- const [initialShouldPreMountAudioElements] = useState16(props.shouldPreMountAudioTags);
29389
+ const [initialShouldPreMountAudioElements] = useState15(props.shouldPreMountAudioTags);
29322
29390
  if (props.shouldPreMountAudioTags !== initialShouldPreMountAudioElements) {
29323
29391
  throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");
29324
29392
  }
@@ -29363,7 +29431,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
29363
29431
  }
29364
29432
  const preloadedSrc = usePreload(src);
29365
29433
  const sequenceContext = useContext29(SequenceContext);
29366
- const [timelineId] = useState16(() => String(Math.random()));
29434
+ const [timelineId] = useState15(() => String(Math.random()));
29367
29435
  const userPreferredVolume = evaluateVolume({
29368
29436
  frame: volumePropFrame,
29369
29437
  volume,
@@ -29375,7 +29443,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
29375
29443
  requestsVideoFrame: false,
29376
29444
  isClientSideRendering: false
29377
29445
  });
29378
- const propsToPass = useMemo28(() => {
29446
+ const propsToPass = useMemo29(() => {
29379
29447
  return {
29380
29448
  muted: muted || mediaMuted || userPreferredVolume <= 0,
29381
29449
  src: preloadedSrc,
@@ -29392,7 +29460,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
29392
29460
  userPreferredVolume,
29393
29461
  crossOriginValue
29394
29462
  ]);
29395
- const id = useMemo28(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
29463
+ const id = useMemo29(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
29396
29464
  src,
29397
29465
  sequenceContext?.relativeFrom,
29398
29466
  sequenceContext?.cumulatedFrom,
@@ -29410,6 +29478,9 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
29410
29478
  premounting: Boolean(sequenceContext?.premounting),
29411
29479
  postmounting: Boolean(sequenceContext?.postmounting)
29412
29480
  });
29481
+ const getStack = useCallback14(() => {
29482
+ return _remotionInternalStack ?? null;
29483
+ }, [_remotionInternalStack]);
29413
29484
  useMediaInTimeline({
29414
29485
  volume,
29415
29486
  mediaVolume,
@@ -29418,7 +29489,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
29418
29489
  playbackRate: playbackRate ?? 1,
29419
29490
  displayName: name ?? null,
29420
29491
  id: timelineId,
29421
- stack: _remotionInternalStack,
29492
+ getStack,
29422
29493
  showInTimeline,
29423
29494
  premountDisplay: sequenceContext?.premountDisplay ?? null,
29424
29495
  postmountDisplay: sequenceContext?.postmountDisplay ?? null,
@@ -29463,7 +29534,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
29463
29534
  useImperativeHandle4(ref, () => {
29464
29535
  return audioRef.current;
29465
29536
  }, [audioRef]);
29466
- const currentOnDurationCallback = useRef18(onDuration);
29537
+ const currentOnDurationCallback = useRef19(onDuration);
29467
29538
  currentOnDurationCallback.current = onDuration;
29468
29539
  useEffect14(() => {
29469
29540
  const { current } = audioRef;
@@ -29494,7 +29565,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
29494
29565
  };
29495
29566
  var AudioForPreview = forwardRef7(AudioForDevelopmentForwardRefFunction);
29496
29567
  var AudioForRenderingRefForwardingFunction = (props, ref) => {
29497
- const audioRef = useRef19(null);
29568
+ const audioRef = useRef20(null);
29498
29569
  const {
29499
29570
  volume: volumeProp,
29500
29571
  playbackRate,
@@ -29520,7 +29591,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
29520
29591
  const sequenceContext = useContext30(SequenceContext);
29521
29592
  const { registerRenderAsset, unregisterRenderAsset } = useContext30(RenderAssetManager);
29522
29593
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
29523
- const id = useMemo29(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
29594
+ const id = useMemo30(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
29524
29595
  props.src,
29525
29596
  sequenceContext?.relativeFrom,
29526
29597
  sequenceContext?.cumulatedFrom,
@@ -29651,7 +29722,7 @@ var AudioRefForwardingFunction = (props, ref) => {
29651
29722
  throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
29652
29723
  }
29653
29724
  const preloadedSrc = usePreload(props.src);
29654
- const onError = useCallback14((e) => {
29725
+ const onError = useCallback15((e) => {
29655
29726
  console.log(e.currentTarget.error);
29656
29727
  const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
29657
29728
  if (loop) {
@@ -29665,7 +29736,7 @@ var AudioRefForwardingFunction = (props, ref) => {
29665
29736
  console.warn(errMessage);
29666
29737
  }
29667
29738
  }, [loop, onRemotionError, preloadedSrc]);
29668
- const onDuration = useCallback14((src, durationInSeconds) => {
29739
+ const onDuration = useCallback15((src, durationInSeconds) => {
29669
29740
  setDurations({ type: "got-duration", durationInSeconds, src });
29670
29741
  }, [setDurations]);
29671
29742
  const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
@@ -29755,15 +29826,15 @@ var IFrameRefForwarding = ({
29755
29826
  ...props2
29756
29827
  }, ref) => {
29757
29828
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
29758
- const [handle] = useState17(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
29829
+ const [handle] = useState16(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
29759
29830
  retries: delayRenderRetries ?? undefined,
29760
29831
  timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
29761
29832
  }));
29762
- const didLoad = useCallback15((e) => {
29833
+ const didLoad = useCallback16((e) => {
29763
29834
  continueRender2(handle);
29764
29835
  onLoad?.(e);
29765
29836
  }, [handle, onLoad, continueRender2]);
29766
- const didGetError = useCallback15((e) => {
29837
+ const didGetError = useCallback16((e) => {
29767
29838
  continueRender2(handle);
29768
29839
  if (onError) {
29769
29840
  onError(e);
@@ -29801,8 +29872,8 @@ var ImgContent = ({
29801
29872
  ref,
29802
29873
  ...props2
29803
29874
  }) => {
29804
- const imageRef = useRef20(null);
29805
- const errors = useRef20({});
29875
+ const imageRef = useRef21(null);
29876
+ const errors = useRef21({});
29806
29877
  const { delayPlayback } = useBufferState();
29807
29878
  const sequenceContext = useContext32(SequenceContext);
29808
29879
  const _propsValid = true;
@@ -29813,7 +29884,7 @@ var ImgContent = ({
29813
29884
  return imageRef.current;
29814
29885
  }, []);
29815
29886
  const actualSrc = usePreload(src);
29816
- const retryIn = useCallback16((timeout) => {
29887
+ const retryIn = useCallback17((timeout) => {
29817
29888
  if (!imageRef.current) {
29818
29889
  return;
29819
29890
  }
@@ -29831,7 +29902,7 @@ var ImgContent = ({
29831
29902
  }, timeout);
29832
29903
  }, []);
29833
29904
  const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
29834
- const didGetError = useCallback16((e) => {
29905
+ const didGetError = useCallback17((e) => {
29835
29906
  if (!errors.current) {
29836
29907
  return;
29837
29908
  }
@@ -29943,15 +30014,18 @@ var ImgInner = ({
29943
30014
  ...props2
29944
30015
  }) => {
29945
30016
  const sequenceContext = useContext32(SequenceContext);
29946
- const [timelineId] = useState18(() => String(Math.random()));
30017
+ const [timelineId] = useState17(() => String(Math.random()));
29947
30018
  if (!src) {
29948
30019
  throw new Error('No "src" prop was passed to <Img>.');
29949
30020
  }
30021
+ const stackRef = useRef21(null);
30022
+ stackRef.current = stack ?? null;
30023
+ const getStack = useCallback17(() => stackRef.current, []);
29950
30024
  useImageInTimeline({
29951
30025
  src,
29952
30026
  displayName: name ?? null,
29953
30027
  id: timelineId,
29954
- stack: stack ?? null,
30028
+ getStack,
29955
30029
  showInTimeline: showInTimeline ?? true,
29956
30030
  premountDisplay: sequenceContext?.premountDisplay ?? null,
29957
30031
  postmountDisplay: sequenceContext?.postmountDisplay ?? null,
@@ -29967,7 +30041,7 @@ var ImgInner = ({
29967
30041
  });
29968
30042
  };
29969
30043
  var imgSchema = {
29970
- ...sequenceStyleSchema,
30044
+ ...sequenceVisualStyleSchema,
29971
30045
  hidden: hiddenField
29972
30046
  };
29973
30047
  var Img = wrapInSchema(ImgInner, imgSchema);
@@ -29980,18 +30054,18 @@ var CompositionManagerProvider = ({
29980
30054
  initialCompositions,
29981
30055
  initialCanvasContent
29982
30056
  }) => {
29983
- const [folders, setFolders] = useState19([]);
29984
- const [canvasContent, setCanvasContent] = useState19(initialCanvasContent);
29985
- const [compositions, setCompositions] = useState19(initialCompositions);
29986
- const currentcompositionsRef = useRef21(compositions);
29987
- const updateCompositions = useCallback17((updateComps) => {
30057
+ const [folders, setFolders] = useState18([]);
30058
+ const [canvasContent, setCanvasContent] = useState18(initialCanvasContent);
30059
+ const [compositions, setCompositions] = useState18(initialCompositions);
30060
+ const currentcompositionsRef = useRef22(compositions);
30061
+ const updateCompositions = useCallback18((updateComps) => {
29988
30062
  setCompositions((comps) => {
29989
30063
  const updated = updateComps(comps);
29990
30064
  currentcompositionsRef.current = updated;
29991
30065
  return updated;
29992
30066
  });
29993
30067
  }, []);
29994
- const registerComposition = useCallback17((comp) => {
30068
+ const registerComposition = useCallback18((comp) => {
29995
30069
  updateCompositions((comps) => {
29996
30070
  if (comps.find((c2) => c2.id === comp.id)) {
29997
30071
  throw new Error(`Multiple composition with id ${comp.id} are registered.`);
@@ -29999,12 +30073,12 @@ var CompositionManagerProvider = ({
29999
30073
  return [...comps, comp];
30000
30074
  });
30001
30075
  }, [updateCompositions]);
30002
- const unregisterComposition = useCallback17((id) => {
30076
+ const unregisterComposition = useCallback18((id) => {
30003
30077
  setCompositions((comps) => {
30004
30078
  return comps.filter((c2) => c2.id !== id);
30005
30079
  });
30006
30080
  }, []);
30007
- const registerFolder = useCallback17((name, parent, nonce) => {
30081
+ const registerFolder = useCallback18((name, parent, nonce) => {
30008
30082
  setFolders((prevFolders) => {
30009
30083
  return [
30010
30084
  ...prevFolders,
@@ -30016,7 +30090,7 @@ var CompositionManagerProvider = ({
30016
30090
  ];
30017
30091
  });
30018
30092
  }, []);
30019
- const unregisterFolder = useCallback17((name, parent) => {
30093
+ const unregisterFolder = useCallback18((name, parent) => {
30020
30094
  setFolders((prevFolders) => {
30021
30095
  return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
30022
30096
  });
@@ -30026,7 +30100,7 @@ var CompositionManagerProvider = ({
30026
30100
  getCompositions: () => currentcompositionsRef.current
30027
30101
  };
30028
30102
  }, []);
30029
- const compositionManagerSetters = useMemo30(() => {
30103
+ const compositionManagerSetters = useMemo31(() => {
30030
30104
  return {
30031
30105
  registerComposition,
30032
30106
  unregisterComposition,
@@ -30042,7 +30116,7 @@ var CompositionManagerProvider = ({
30042
30116
  unregisterFolder,
30043
30117
  onlyRenderComposition
30044
30118
  ]);
30045
- const compositionManagerContextValue = useMemo30(() => {
30119
+ const compositionManagerContextValue = useMemo31(() => {
30046
30120
  return {
30047
30121
  compositions,
30048
30122
  folders,
@@ -30122,7 +30196,7 @@ var disabledEffectField = {
30122
30196
  description: "Disabled"
30123
30197
  };
30124
30198
  var createEffect = (definition) => {
30125
- const userCalculateKey = definition.calculateKey;
30199
+ const { calculateKey: userCalculateKey, validateParams } = definition;
30126
30200
  const widened = {
30127
30201
  ...definition,
30128
30202
  calculateKey: (params) => {
@@ -30134,12 +30208,15 @@ var createEffect = (definition) => {
30134
30208
  ...definition.schema
30135
30209
  }
30136
30210
  };
30137
- const factory = (params = {}) => ({
30138
- definition: widened,
30139
- params,
30140
- effectKey: widened.calculateKey(params),
30141
- memoized: false
30142
- });
30211
+ const factory = (params = {}) => {
30212
+ validateParams(params);
30213
+ return {
30214
+ definition: widened,
30215
+ params,
30216
+ effectKey: widened.calculateKey(params),
30217
+ memoized: false
30218
+ };
30219
+ };
30143
30220
  return factory;
30144
30221
  };
30145
30222
  var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
@@ -30190,7 +30267,7 @@ var MediaEnabledProvider = ({
30190
30267
  videoEnabled,
30191
30268
  audioEnabled
30192
30269
  }) => {
30193
- const value = useMemo31(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
30270
+ const value = useMemo322(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
30194
30271
  return /* @__PURE__ */ jsx28(MediaEnabledContext.Provider, {
30195
30272
  value,
30196
30273
  children
@@ -30205,13 +30282,13 @@ var RemotionRootContexts = ({
30205
30282
  audioEnabled,
30206
30283
  frameState
30207
30284
  }) => {
30208
- const nonceContext = useMemo322(() => {
30285
+ const nonceContext = useMemo33(() => {
30209
30286
  let counter = 0;
30210
30287
  return {
30211
30288
  getNonce: () => counter++
30212
30289
  };
30213
30290
  }, []);
30214
- const logging = useMemo322(() => {
30291
+ const logging = useMemo33(() => {
30215
30292
  return { logLevel, mountTime: Date.now() };
30216
30293
  }, [logLevel]);
30217
30294
  return /* @__PURE__ */ jsx29(LogLevelContext.Provider, {
@@ -30505,7 +30582,7 @@ var OffthreadVideoForRendering = ({
30505
30582
  if (!src) {
30506
30583
  throw new TypeError("No `src` was passed to <OffthreadVideo>.");
30507
30584
  }
30508
- const id = useMemo33(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
30585
+ const id = useMemo34(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
30509
30586
  src,
30510
30587
  sequenceContext?.cumulatedFrom,
30511
30588
  sequenceContext?.relativeFrom,
@@ -30560,14 +30637,14 @@ var OffthreadVideoForRendering = ({
30560
30637
  sequenceContext?.relativeFrom,
30561
30638
  audioStreamIndex
30562
30639
  ]);
30563
- const currentTime = useMemo33(() => {
30640
+ const currentTime = useMemo34(() => {
30564
30641
  return getExpectedMediaFrameUncorrected({
30565
30642
  frame,
30566
30643
  playbackRate: playbackRate || 1,
30567
30644
  startFrom: -mediaStartsAt
30568
30645
  }) / videoConfig.fps;
30569
30646
  }, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
30570
- const actualSrc = useMemo33(() => {
30647
+ const actualSrc = useMemo34(() => {
30571
30648
  return getOffthreadVideoSource({
30572
30649
  src,
30573
30650
  currentTime,
@@ -30575,7 +30652,7 @@ var OffthreadVideoForRendering = ({
30575
30652
  toneMapped
30576
30653
  });
30577
30654
  }, [toneMapped, currentTime, src, transparent]);
30578
- const [imageSrc, setImageSrc] = useState20(null);
30655
+ const [imageSrc, setImageSrc] = useState19(null);
30579
30656
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
30580
30657
  useLayoutEffect11(() => {
30581
30658
  if (!window.remotion_videoEnabled) {
@@ -30648,17 +30725,17 @@ var OffthreadVideoForRendering = ({
30648
30725
  continueRender2,
30649
30726
  delayRender2
30650
30727
  ]);
30651
- const onErr = useCallback18(() => {
30728
+ const onErr = useCallback19(() => {
30652
30729
  if (onError) {
30653
30730
  onError?.(new Error("Failed to load image with src " + imageSrc));
30654
30731
  } else {
30655
30732
  cancelRender("Failed to load image with src " + imageSrc);
30656
30733
  }
30657
30734
  }, [imageSrc, onError]);
30658
- const className = useMemo33(() => {
30735
+ const className = useMemo34(() => {
30659
30736
  return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy2).join(" ");
30660
30737
  }, [props2.className]);
30661
- const onImageFrame = useCallback18((img) => {
30738
+ const onImageFrame = useCallback19((img) => {
30662
30739
  if (onVideoFrame) {
30663
30740
  onVideoFrame(img);
30664
30741
  }
@@ -30717,8 +30794,8 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
30717
30794
  if (!context) {
30718
30795
  throw new Error("SharedAudioContext not found");
30719
30796
  }
30720
- const videoRef = useRef22(null);
30721
- const sharedSource = useMemo34(() => {
30797
+ const videoRef = useRef23(null);
30798
+ const sharedSource = useMemo35(() => {
30722
30799
  if (!context.audioContext) {
30723
30800
  return null;
30724
30801
  }
@@ -30773,7 +30850,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
30773
30850
  const parentSequence = useContext35(SequenceContext);
30774
30851
  const logLevel = useLogLevel();
30775
30852
  const mountTime = useMountTime();
30776
- const [timelineId] = useState21(() => String(Math.random()));
30853
+ const [timelineId] = useState20(() => String(Math.random()));
30777
30854
  if (typeof acceptableTimeShift !== "undefined") {
30778
30855
  throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
30779
30856
  }
@@ -30785,6 +30862,9 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
30785
30862
  mediaVolume
30786
30863
  });
30787
30864
  warnAboutTooHighVolume(userPreferredVolume);
30865
+ const getStack = useCallback20(() => {
30866
+ return _remotionInternalStack ?? null;
30867
+ }, [_remotionInternalStack]);
30788
30868
  useMediaInTimeline({
30789
30869
  volume,
30790
30870
  mediaVolume,
@@ -30793,7 +30873,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
30793
30873
  playbackRate: props2.playbackRate ?? 1,
30794
30874
  displayName: name ?? null,
30795
30875
  id: timelineId,
30796
- stack: _remotionInternalStack,
30876
+ getStack,
30797
30877
  showInTimeline,
30798
30878
  premountDisplay: parentSequence?.premountDisplay ?? null,
30799
30879
  postmountDisplay: parentSequence?.postmountDisplay ?? null,
@@ -30839,7 +30919,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
30839
30919
  useImperativeHandle8(ref, () => {
30840
30920
  return videoRef.current;
30841
30921
  }, []);
30842
- useState21(() => playbackLogging({
30922
+ useState20(() => playbackLogging({
30843
30923
  logLevel,
30844
30924
  message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
30845
30925
  tag: "video",
@@ -30885,7 +30965,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
30885
30965
  current.removeEventListener("error", errorHandler);
30886
30966
  };
30887
30967
  }, [onError, src]);
30888
- const currentOnDurationCallback = useRef22(onDuration);
30968
+ const currentOnDurationCallback = useRef23(onDuration);
30889
30969
  currentOnDurationCallback.current = onDuration;
30890
30970
  useEmitVideoFrame({ ref: videoRef, onVideoFrame });
30891
30971
  useEffect18(() => {
@@ -30916,7 +30996,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
30916
30996
  current.preload = "auto";
30917
30997
  }
30918
30998
  }, []);
30919
- const actualStyle = useMemo34(() => {
30999
+ const actualStyle = useMemo35(() => {
30920
31000
  return {
30921
31001
  ...style
30922
31002
  };
@@ -30955,7 +31035,7 @@ var InnerOffthreadVideo = (props2) => {
30955
31035
  if (environment.isClientSideRendering) {
30956
31036
  throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
30957
31037
  }
30958
- const onDuration = useCallback19(() => {
31038
+ const onDuration = useCallback21(() => {
30959
31039
  return;
30960
31040
  }, []);
30961
31041
  if (typeof props2.src !== "string") {
@@ -31111,7 +31191,7 @@ function useRemotionContexts() {
31111
31191
  const sequenceManagerContext = React36.useContext(SequenceManager);
31112
31192
  const bufferManagerContext = React36.useContext(BufferingContextReact);
31113
31193
  const logLevelContext = React36.useContext(LogLevelContext);
31114
- return useMemo35(() => ({
31194
+ return useMemo36(() => ({
31115
31195
  compositionManagerCtx,
31116
31196
  timelineContext,
31117
31197
  setTimelineContext,
@@ -31203,6 +31283,8 @@ var Internals = {
31203
31283
  wrapInSchema,
31204
31284
  sequenceSchema,
31205
31285
  sequenceStyleSchema,
31286
+ sequenceVisualStyleSchema,
31287
+ sequencePremountSchema,
31206
31288
  flattenActiveSchema,
31207
31289
  getFlatSchemaWithAllKeys,
31208
31290
  RemotionRootContexts,
@@ -31297,6 +31379,8 @@ var Internals = {
31297
31379
  useMemoizedEffects,
31298
31380
  useMemoizedEffectDefinitions,
31299
31381
  createEffect,
31382
+ createWebGLContextError,
31383
+ createWebGL2ContextError,
31300
31384
  computeEffectiveSchemaValuesDotNotation,
31301
31385
  OverrideIdsToNodePathsGettersContext,
31302
31386
  OverrideIdsToNodePathsSettersContext,
@@ -31369,7 +31453,7 @@ var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
31369
31453
  };
31370
31454
  var SeriesSequence = forwardRef12(SeriesSequenceRefForwardingFunction);
31371
31455
  var SeriesInner = (props2) => {
31372
- const childrenValue = useMemo36(() => {
31456
+ const childrenValue = useMemo37(() => {
31373
31457
  let startFrame = 0;
31374
31458
  const flattenedChildren = flattenChildren(props2.children);
31375
31459
  return Children.map(flattenedChildren, (child, i) => {
@@ -31899,7 +31983,7 @@ var VideoForRenderingForwardFunction = ({
31899
31983
  const frame = useCurrentFrame();
31900
31984
  const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
31901
31985
  const videoConfig = useUnsafeVideoConfig();
31902
- const videoRef = useRef23(null);
31986
+ const videoRef = useRef24(null);
31903
31987
  const sequenceContext = useContext36(SequenceContext);
31904
31988
  const mediaStartsAt = useMediaStartsAt();
31905
31989
  const environment = useRemotionEnvironment();
@@ -31907,7 +31991,7 @@ var VideoForRenderingForwardFunction = ({
31907
31991
  const mountTime = useMountTime();
31908
31992
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
31909
31993
  const { registerRenderAsset, unregisterRenderAsset } = useContext36(RenderAssetManager);
31910
- const id = useMemo37(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
31994
+ const id = useMemo38(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
31911
31995
  props2.src,
31912
31996
  sequenceContext?.cumulatedFrom,
31913
31997
  sequenceContext?.relativeFrom,
@@ -32124,10 +32208,10 @@ var VideoForwardingFunction = (props2, ref) => {
32124
32208
  throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
32125
32209
  }
32126
32210
  const preloadedSrc = usePreload(props2.src);
32127
- const onDuration = useCallback20((src, durationInSeconds) => {
32211
+ const onDuration = useCallback22((src, durationInSeconds) => {
32128
32212
  setDurations({ type: "got-duration", durationInSeconds, src });
32129
32213
  }, [setDurations]);
32130
- const onVideoFrame = useCallback20(() => {}, []);
32214
+ const onVideoFrame = useCallback22(() => {}, []);
32131
32215
  const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
32132
32216
  validateMediaTrimProps({ startFrom, endAt, trimBefore, trimAfter });
32133
32217
  const { trimBeforeValue, trimAfterValue } = resolveTrimProps({
@@ -32235,7 +32319,7 @@ addSequenceStackTraces(Composition);
32235
32319
  // ../design/dist/esm/index.mjs
32236
32320
  import { jsx as jsx210, Fragment as Fragment3 } from "react/jsx-runtime";
32237
32321
  import { jsx as jsx39, jsxs as jsxs3 } from "react/jsx-runtime";
32238
- import { useEffect as useEffect22, useMemo as useMemo210, useRef as useRef25 } from "react";
32322
+ import { useEffect as useEffect22, useMemo as useMemo210, useRef as useRef26 } from "react";
32239
32323
  import { jsx as jsx43 } from "react/jsx-runtime";
32240
32324
  import { jsx as jsx53, jsxs as jsxs23 } from "react/jsx-runtime";
32241
32325
  import React62 from "react";
@@ -32262,8 +32346,8 @@ import * as React16 from "react";
32262
32346
  import * as React13 from "react";
32263
32347
  import * as ReactDOM from "react-dom";
32264
32348
  import { jsx as jsx172 } from "react/jsx-runtime";
32265
- import * as React14 from "react";
32266
- import * as React152 from "react";
32349
+ import * as React142 from "react";
32350
+ import * as React15 from "react";
32267
32351
  import { jsx as jsx182 } from "react/jsx-runtime";
32268
32352
  import * as React172 from "react";
32269
32353
  import * as React18 from "react";
@@ -32287,8 +32371,8 @@ import * as React282 from "react";
32287
32371
  import { jsx as jsx232 } from "react/jsx-runtime";
32288
32372
  import * as React35 from "react";
32289
32373
  import * as React312 from "react";
32290
- import * as React292 from "react";
32291
32374
  import { useState as useState112 } from "react";
32375
+ import * as React292 from "react";
32292
32376
  import * as React30 from "react";
32293
32377
  import * as React342 from "react";
32294
32378
  import * as React332 from "react";
@@ -32489,7 +32573,7 @@ var useHoverTransforms = (ref, disabled) => {
32489
32573
  progress: 0,
32490
32574
  isActive: false
32491
32575
  });
32492
- const eventTarget = useMemo38(() => new EventTarget, []);
32576
+ const eventTarget = useMemo39(() => new EventTarget, []);
32493
32577
  useEffect20(() => {
32494
32578
  if (disabled) {
32495
32579
  eventTarget.dispatchEvent(new Event("disabled"));
@@ -32636,7 +32720,7 @@ var getAngle = (ref, coordinates) => {
32636
32720
  };
32637
32721
  var lastCoordinates = null;
32638
32722
  var useMousePosition = (ref) => {
32639
- const [angle, setAngle] = useState23(getAngle(ref.current, lastCoordinates));
32723
+ const [angle, setAngle] = useState21(getAngle(ref.current, lastCoordinates));
32640
32724
  useEffect20(() => {
32641
32725
  const element = ref.current;
32642
32726
  if (!element) {
@@ -32757,7 +32841,7 @@ var Spinner = ({ size, duration }) => {
32757
32841
  height: size
32758
32842
  };
32759
32843
  }, [size]);
32760
- const pathsRef = useRef25([]);
32844
+ const pathsRef = useRef26([]);
32761
32845
  useEffect22(() => {
32762
32846
  const animate = () => {
32763
32847
  const now = performance.now();
@@ -32803,9 +32887,9 @@ var Button = ({
32803
32887
  ...rest
32804
32888
  }) => {
32805
32889
  const [dimensions, setDimensions] = useState22(null);
32806
- const ref = useRef24(null);
32890
+ const ref = useRef25(null);
32807
32891
  const { isActive, progress } = useHoverTransforms(ref, Boolean(disabled || loading));
32808
- const onPointerEnter = useCallback22((e) => {
32892
+ const onPointerEnter = useCallback24((e) => {
32809
32893
  if (e.pointerType !== "mouse") {
32810
32894
  return;
32811
32895
  }
@@ -32842,7 +32926,7 @@ var Button = ({
32842
32926
  const isDisabled = disabled || loading;
32843
32927
  const isAnchor = !asChild && "href" in rest && rest.href !== undefined;
32844
32928
  const sharedClasses = cn("text-text", "inline-flex", "justify-center", "bg-button-bg", "items-center", "font-brand", "border-solid", "text-[1em]", "rounded-lg", "border-black", "border-2", "border-b-4", "cursor-pointer", "px-4", "h-12", "flex-row", "items-center", "relative", "overflow-hidden", isDisabled && "cursor-default opacity-50", className);
32845
- const preventInteraction = useCallback22((e) => {
32929
+ const preventInteraction = useCallback24((e) => {
32846
32930
  e.preventDefault();
32847
32931
  e.stopPropagation();
32848
32932
  }, []);
@@ -33317,15 +33401,15 @@ function dispatchDiscreteCustomEvent(target, event2) {
33317
33401
  ReactDOM.flushSync(() => target.dispatchEvent(event2));
33318
33402
  }
33319
33403
  function useCallbackRef(callback) {
33320
- const callbackRef = React14.useRef(callback);
33321
- React14.useEffect(() => {
33404
+ const callbackRef = React142.useRef(callback);
33405
+ React142.useEffect(() => {
33322
33406
  callbackRef.current = callback;
33323
33407
  });
33324
- return React14.useMemo(() => (...args) => callbackRef.current?.(...args), []);
33408
+ return React142.useMemo(() => (...args) => callbackRef.current?.(...args), []);
33325
33409
  }
33326
33410
  function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
33327
33411
  const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
33328
- React152.useEffect(() => {
33412
+ React15.useEffect(() => {
33329
33413
  const handleKeyDown = (event2) => {
33330
33414
  if (event2.key === "Escape") {
33331
33415
  onEscapeKeyDown(event2);
@@ -36043,7 +36127,7 @@ var hideOthers = function(originalTarget, parentNode, markerName) {
36043
36127
  return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
36044
36128
  };
36045
36129
  var __assign = function() {
36046
- __assign = Object.assign || function __assign2(t) {
36130
+ __assign = Object.assign || function __assign(t) {
36047
36131
  for (var s, i = 1, n = arguments.length;i < n; i++) {
36048
36132
  s = arguments[i];
36049
36133
  for (var p in s)
@@ -37830,17 +37914,17 @@ function createContextScope2(scopeName, createContextScopeDeps = []) {
37830
37914
  let defaultContexts = [];
37831
37915
  function createContext32(rootComponentName, defaultContext) {
37832
37916
  const BaseContext = React382.createContext(defaultContext);
37833
- const index3 = defaultContexts.length;
37917
+ const index2 = defaultContexts.length;
37834
37918
  defaultContexts = [...defaultContexts, defaultContext];
37835
37919
  const Provider = (props) => {
37836
37920
  const { scope, children, ...context } = props;
37837
- const Context = scope?.[scopeName]?.[index3] || BaseContext;
37921
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
37838
37922
  const value = React382.useMemo(() => context, Object.values(context));
37839
37923
  return /* @__PURE__ */ jsx272(Context.Provider, { value, children });
37840
37924
  };
37841
37925
  Provider.displayName = rootComponentName + "Provider";
37842
37926
  function useContext222(consumerName, scope) {
37843
- const Context = scope?.[scopeName]?.[index3] || BaseContext;
37927
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
37844
37928
  const context = React382.useContext(Context);
37845
37929
  if (context)
37846
37930
  return context;
@@ -38037,10 +38121,10 @@ var OrderedDict = class _OrderedDict extends Map {
38037
38121
  super.set(key, value);
38038
38122
  return this;
38039
38123
  }
38040
- insert(index3, key, value) {
38124
+ insert(index2, key, value) {
38041
38125
  const has = this.has(key);
38042
38126
  const length2 = this.#keys.length;
38043
- const relativeIndex = toSafeInteger(index3);
38127
+ const relativeIndex = toSafeInteger(index2);
38044
38128
  let actualIndex = relativeIndex >= 0 ? relativeIndex : length2 + relativeIndex;
38045
38129
  const safeIndex = actualIndex < 0 || actualIndex >= length2 ? -1 : actualIndex;
38046
38130
  if (safeIndex === this.size || has && safeIndex === this.size - 1 || safeIndex === -1) {
@@ -38078,39 +38162,39 @@ var OrderedDict = class _OrderedDict extends Map {
38078
38162
  }
38079
38163
  return this;
38080
38164
  }
38081
- with(index3, key, value) {
38165
+ with(index2, key, value) {
38082
38166
  const copy = new _OrderedDict(this);
38083
- copy.insert(index3, key, value);
38167
+ copy.insert(index2, key, value);
38084
38168
  return copy;
38085
38169
  }
38086
38170
  before(key) {
38087
- const index3 = this.#keys.indexOf(key) - 1;
38088
- if (index3 < 0) {
38171
+ const index2 = this.#keys.indexOf(key) - 1;
38172
+ if (index2 < 0) {
38089
38173
  return;
38090
38174
  }
38091
- return this.entryAt(index3);
38175
+ return this.entryAt(index2);
38092
38176
  }
38093
38177
  setBefore(key, newKey, value) {
38094
- const index3 = this.#keys.indexOf(key);
38095
- if (index3 === -1) {
38178
+ const index2 = this.#keys.indexOf(key);
38179
+ if (index2 === -1) {
38096
38180
  return this;
38097
38181
  }
38098
- return this.insert(index3, newKey, value);
38182
+ return this.insert(index2, newKey, value);
38099
38183
  }
38100
38184
  after(key) {
38101
- let index3 = this.#keys.indexOf(key);
38102
- index3 = index3 === -1 || index3 === this.size - 1 ? -1 : index3 + 1;
38103
- if (index3 === -1) {
38185
+ let index2 = this.#keys.indexOf(key);
38186
+ index2 = index2 === -1 || index2 === this.size - 1 ? -1 : index2 + 1;
38187
+ if (index2 === -1) {
38104
38188
  return;
38105
38189
  }
38106
- return this.entryAt(index3);
38190
+ return this.entryAt(index2);
38107
38191
  }
38108
38192
  setAfter(key, newKey, value) {
38109
- const index3 = this.#keys.indexOf(key);
38110
- if (index3 === -1) {
38193
+ const index2 = this.#keys.indexOf(key);
38194
+ if (index2 === -1) {
38111
38195
  return this;
38112
38196
  }
38113
- return this.insert(index3 + 1, newKey, value);
38197
+ return this.insert(index2 + 1, newKey, value);
38114
38198
  }
38115
38199
  first() {
38116
38200
  return this.entryAt(0);
@@ -38129,21 +38213,21 @@ var OrderedDict = class _OrderedDict extends Map {
38129
38213
  }
38130
38214
  return deleted;
38131
38215
  }
38132
- deleteAt(index3) {
38133
- const key = this.keyAt(index3);
38216
+ deleteAt(index2) {
38217
+ const key = this.keyAt(index2);
38134
38218
  if (key !== undefined) {
38135
38219
  return this.delete(key);
38136
38220
  }
38137
38221
  return false;
38138
38222
  }
38139
- at(index3) {
38140
- const key = at(this.#keys, index3);
38223
+ at(index2) {
38224
+ const key = at(this.#keys, index2);
38141
38225
  if (key !== undefined) {
38142
38226
  return this.get(key);
38143
38227
  }
38144
38228
  }
38145
- entryAt(index3) {
38146
- const key = at(this.#keys, index3);
38229
+ entryAt(index2) {
38230
+ const key = at(this.#keys, index2);
38147
38231
  if (key !== undefined) {
38148
38232
  return [key, this.get(key)];
38149
38233
  }
@@ -38151,15 +38235,15 @@ var OrderedDict = class _OrderedDict extends Map {
38151
38235
  indexOf(key) {
38152
38236
  return this.#keys.indexOf(key);
38153
38237
  }
38154
- keyAt(index3) {
38155
- return at(this.#keys, index3);
38238
+ keyAt(index2) {
38239
+ return at(this.#keys, index2);
38156
38240
  }
38157
38241
  from(key, offset4) {
38158
- const index3 = this.indexOf(key);
38159
- if (index3 === -1) {
38242
+ const index2 = this.indexOf(key);
38243
+ if (index2 === -1) {
38160
38244
  return;
38161
38245
  }
38162
- let dest = index3 + offset4;
38246
+ let dest = index2 + offset4;
38163
38247
  if (dest < 0)
38164
38248
  dest = 0;
38165
38249
  if (dest >= this.size)
@@ -38167,11 +38251,11 @@ var OrderedDict = class _OrderedDict extends Map {
38167
38251
  return this.at(dest);
38168
38252
  }
38169
38253
  keyFrom(key, offset4) {
38170
- const index3 = this.indexOf(key);
38171
- if (index3 === -1) {
38254
+ const index2 = this.indexOf(key);
38255
+ if (index2 === -1) {
38172
38256
  return;
38173
38257
  }
38174
- let dest = index3 + offset4;
38258
+ let dest = index2 + offset4;
38175
38259
  if (dest < 0)
38176
38260
  dest = 0;
38177
38261
  if (dest >= this.size)
@@ -38179,68 +38263,68 @@ var OrderedDict = class _OrderedDict extends Map {
38179
38263
  return this.keyAt(dest);
38180
38264
  }
38181
38265
  find(predicate, thisArg) {
38182
- let index3 = 0;
38266
+ let index2 = 0;
38183
38267
  for (const entry of this) {
38184
- if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
38268
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
38185
38269
  return entry;
38186
38270
  }
38187
- index3++;
38271
+ index2++;
38188
38272
  }
38189
38273
  return;
38190
38274
  }
38191
38275
  findIndex(predicate, thisArg) {
38192
- let index3 = 0;
38276
+ let index2 = 0;
38193
38277
  for (const entry of this) {
38194
- if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
38195
- return index3;
38278
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
38279
+ return index2;
38196
38280
  }
38197
- index3++;
38281
+ index2++;
38198
38282
  }
38199
38283
  return -1;
38200
38284
  }
38201
38285
  filter(predicate, thisArg) {
38202
38286
  const entries = [];
38203
- let index3 = 0;
38287
+ let index2 = 0;
38204
38288
  for (const entry of this) {
38205
- if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
38289
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
38206
38290
  entries.push(entry);
38207
38291
  }
38208
- index3++;
38292
+ index2++;
38209
38293
  }
38210
38294
  return new _OrderedDict(entries);
38211
38295
  }
38212
38296
  map(callbackfn, thisArg) {
38213
38297
  const entries = [];
38214
- let index3 = 0;
38298
+ let index2 = 0;
38215
38299
  for (const entry of this) {
38216
- entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index3, this])]);
38217
- index3++;
38300
+ entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index2, this])]);
38301
+ index2++;
38218
38302
  }
38219
38303
  return new _OrderedDict(entries);
38220
38304
  }
38221
38305
  reduce(...args) {
38222
38306
  const [callbackfn, initialValue] = args;
38223
- let index3 = 0;
38307
+ let index2 = 0;
38224
38308
  let accumulator = initialValue ?? this.at(0);
38225
38309
  for (const entry of this) {
38226
- if (index3 === 0 && args.length === 1) {
38310
+ if (index2 === 0 && args.length === 1) {
38227
38311
  accumulator = entry;
38228
38312
  } else {
38229
- accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index3, this]);
38313
+ accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index2, this]);
38230
38314
  }
38231
- index3++;
38315
+ index2++;
38232
38316
  }
38233
38317
  return accumulator;
38234
38318
  }
38235
38319
  reduceRight(...args) {
38236
38320
  const [callbackfn, initialValue] = args;
38237
38321
  let accumulator = initialValue ?? this.at(-1);
38238
- for (let index3 = this.size - 1;index3 >= 0; index3--) {
38239
- const entry = this.at(index3);
38240
- if (index3 === this.size - 1 && args.length === 1) {
38322
+ for (let index2 = this.size - 1;index2 >= 0; index2--) {
38323
+ const entry = this.at(index2);
38324
+ if (index2 === this.size - 1 && args.length === 1) {
38241
38325
  accumulator = entry;
38242
38326
  } else {
38243
- accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index3, this]);
38327
+ accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index2, this]);
38244
38328
  }
38245
38329
  }
38246
38330
  return accumulator;
@@ -38251,8 +38335,8 @@ var OrderedDict = class _OrderedDict extends Map {
38251
38335
  }
38252
38336
  toReversed() {
38253
38337
  const reversed = new _OrderedDict;
38254
- for (let index3 = this.size - 1;index3 >= 0; index3--) {
38255
- const key = this.keyAt(index3);
38338
+ for (let index2 = this.size - 1;index2 >= 0; index2--) {
38339
+ const key = this.keyAt(index2);
38256
38340
  const element = this.get(key);
38257
38341
  reversed.set(key, element);
38258
38342
  }
@@ -38275,44 +38359,44 @@ var OrderedDict = class _OrderedDict extends Map {
38275
38359
  if (end !== undefined && end > 0) {
38276
38360
  stop = end - 1;
38277
38361
  }
38278
- for (let index3 = start;index3 <= stop; index3++) {
38279
- const key = this.keyAt(index3);
38362
+ for (let index2 = start;index2 <= stop; index2++) {
38363
+ const key = this.keyAt(index2);
38280
38364
  const element = this.get(key);
38281
38365
  result.set(key, element);
38282
38366
  }
38283
38367
  return result;
38284
38368
  }
38285
38369
  every(predicate, thisArg) {
38286
- let index3 = 0;
38370
+ let index2 = 0;
38287
38371
  for (const entry of this) {
38288
- if (!Reflect.apply(predicate, thisArg, [entry, index3, this])) {
38372
+ if (!Reflect.apply(predicate, thisArg, [entry, index2, this])) {
38289
38373
  return false;
38290
38374
  }
38291
- index3++;
38375
+ index2++;
38292
38376
  }
38293
38377
  return true;
38294
38378
  }
38295
38379
  some(predicate, thisArg) {
38296
- let index3 = 0;
38380
+ let index2 = 0;
38297
38381
  for (const entry of this) {
38298
- if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
38382
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
38299
38383
  return true;
38300
38384
  }
38301
- index3++;
38385
+ index2++;
38302
38386
  }
38303
38387
  return false;
38304
38388
  }
38305
38389
  };
38306
- function at(array, index3) {
38390
+ function at(array, index2) {
38307
38391
  if ("at" in Array.prototype) {
38308
- return Array.prototype.at.call(array, index3);
38392
+ return Array.prototype.at.call(array, index2);
38309
38393
  }
38310
- const actualIndex = toSafeIndex(array, index3);
38394
+ const actualIndex = toSafeIndex(array, index2);
38311
38395
  return actualIndex === -1 ? undefined : array[actualIndex];
38312
38396
  }
38313
- function toSafeIndex(array, index3) {
38397
+ function toSafeIndex(array, index2) {
38314
38398
  const length2 = array.length;
38315
- const relativeIndex = toSafeInteger(index3);
38399
+ const relativeIndex = toSafeInteger(index2);
38316
38400
  const actualIndex = relativeIndex >= 0 ? relativeIndex : length2 + relativeIndex;
38317
38401
  return actualIndex < 0 || actualIndex >= length2 ? -1 : actualIndex;
38318
38402
  }
@@ -38364,7 +38448,7 @@ var Primitive2 = NODES2.reduce((primitive, node) => {
38364
38448
  Node2.displayName = `Primitive.${node}`;
38365
38449
  return { ...primitive, [node]: Node2 };
38366
38450
  }, {});
38367
- function useCallbackRef4(callback) {
38451
+ function useCallbackRef3(callback) {
38368
38452
  const callbackRef = React44.useRef(callback);
38369
38453
  React44.useEffect(() => {
38370
38454
  callbackRef.current = callback;
@@ -38468,7 +38552,7 @@ var RovingFocusGroupImpl = React47.forwardRef((props, forwardedRef) => {
38468
38552
  caller: GROUP_NAME2
38469
38553
  });
38470
38554
  const [isTabbingBackOut, setIsTabbingBackOut] = React47.useState(false);
38471
- const handleEntryFocus = useCallbackRef4(onEntryFocus);
38555
+ const handleEntryFocus = useCallbackRef3(onEntryFocus);
38472
38556
  const getItems = useCollection2(__scopeRovingFocusGroup);
38473
38557
  const isClickFocusRef = React47.useRef(false);
38474
38558
  const [focusableItemsCount, setFocusableItemsCount] = React47.useState(0);
@@ -38621,7 +38705,7 @@ function focusFirst2(candidates, preventScroll = false) {
38621
38705
  }
38622
38706
  }
38623
38707
  function wrapArray2(array, startIndex) {
38624
- return array.map((_, index3) => array[(startIndex + index3) % array.length]);
38708
+ return array.map((_, index2) => array[(startIndex + index2) % array.length]);
38625
38709
  }
38626
38710
  var Root3 = RovingFocusGroup;
38627
38711
  var Item2 = RovingFocusGroupItem;
@@ -38936,7 +39020,7 @@ var Triangle2 = (props) => {
38936
39020
  };
38937
39021
 
38938
39022
  // src/components/prompts/CopyPromptButton.tsx
38939
- import { useCallback as useCallback32, useState as useState40 } from "react";
39023
+ import { useCallback as useCallback34, useState as useState38 } from "react";
38940
39024
 
38941
39025
  // src/components/prompts/ClipboardIcon.tsx
38942
39026
  import { jsx as jsx40 } from "react/jsx-runtime";
@@ -38956,8 +39040,8 @@ var ClipboardIcon = ({ size: size4 = 16, color = "currentColor" }) => {
38956
39040
  // src/components/prompts/CopyPromptButton.tsx
38957
39041
  import { jsx as jsx41, jsxs as jsxs6 } from "react/jsx-runtime";
38958
39042
  var CopyPromptButton = ({ prompt }) => {
38959
- const [copied, setCopied] = useState40(false);
38960
- const onCopy = useCallback32(() => {
39043
+ const [copied, setCopied] = useState38(false);
39044
+ const onCopy = useCallback34(() => {
38961
39045
  navigator.clipboard.writeText(prompt);
38962
39046
  setCopied(true);
38963
39047
  setTimeout(() => setCopied(false), 2000);
@@ -38986,7 +39070,7 @@ var CopyPromptButton = ({ prompt }) => {
38986
39070
  };
38987
39071
 
38988
39072
  // src/components/prompts/LikeButton.tsx
38989
- import { useCallback as useCallback34, useEffect as useEffect41, useState as useState42 } from "react";
39073
+ import { useCallback as useCallback36, useEffect as useEffect41, useState as useState40 } from "react";
38990
39074
 
38991
39075
  // src/components/prompts/config.ts
38992
39076
  var REMOTION_PRO_ORIGIN = "https://www.remotion.pro";
@@ -39063,13 +39147,13 @@ var getRelativeTime = (dateStr) => {
39063
39147
  };
39064
39148
 
39065
39149
  // src/components/prompts/use-heart-animation.ts
39066
- import { useCallback as useCallback33, useRef as useRef42, useState as useState41 } from "react";
39150
+ import { useCallback as useCallback35, useRef as useRef43, useState as useState39 } from "react";
39067
39151
  var DURATION = 300;
39068
39152
  var useHeartAnimation = () => {
39069
- const [scale, setScale] = useState41(1);
39070
- const [roundness, setRoundness] = useState41(0.09);
39071
- const rafRef = useRef42(0);
39072
- const animate = useCallback33(() => {
39153
+ const [scale, setScale] = useState39(1);
39154
+ const [roundness, setRoundness] = useState39(0.09);
39155
+ const rafRef = useRef43(0);
39156
+ const animate = useCallback35(() => {
39073
39157
  cancelAnimationFrame(rafRef.current);
39074
39158
  const start = performance.now();
39075
39159
  const tick = (now) => {
@@ -39094,13 +39178,13 @@ var useHeartAnimation = () => {
39094
39178
  // src/components/prompts/LikeButton.tsx
39095
39179
  import { jsx as jsx44, jsxs as jsxs8 } from "react/jsx-runtime";
39096
39180
  var LikeButton = ({ submissionId, initialLikeCount }) => {
39097
- const [liked, setLiked] = useState42(false);
39098
- const [likeCount, setLikeCount] = useState42(initialLikeCount);
39181
+ const [liked, setLiked] = useState40(false);
39182
+ const [likeCount, setLikeCount] = useState40(initialLikeCount);
39099
39183
  const { scale, roundness, animate } = useHeartAnimation();
39100
39184
  useEffect41(() => {
39101
39185
  setLiked(getLikedIds().has(submissionId));
39102
39186
  }, [submissionId]);
39103
- const onClick = useCallback34(async () => {
39187
+ const onClick = useCallback36(async () => {
39104
39188
  if (liked) {
39105
39189
  setLiked(false);
39106
39190
  setLikeCount((c) => c - 1);
@@ -41621,10 +41705,10 @@ import"react-dom";
41621
41705
  "use client";
41622
41706
 
41623
41707
  // src/components/prompts/MuxPlayer.tsx
41624
- import { useCallback as useCallback36 } from "react";
41708
+ import { useCallback as useCallback38 } from "react";
41625
41709
  import { jsx as jsx46, jsxs as jsxs9 } from "react/jsx-runtime";
41626
41710
  var MuxPlayer = ({ playbackId, title, rounded = true }) => {
41627
- const onProviderChange = useCallback36((provider2, _e) => {
41711
+ const onProviderChange = useCallback38((provider2, _e) => {
41628
41712
  if (isHLSProvider(provider2)) {
41629
41713
  provider2.library = () => import("hls.js");
41630
41714
  }