@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.
package/dist/design.js CHANGED
@@ -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);
@@ -25,7 +36,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
25
36
  import * as React24 from "react";
26
37
  import * as React3 from "react";
27
38
  import { Fragment as Fragment2, jsx as jsx38 } from "react/jsx-runtime";
28
- import React52, { useCallback as useCallback22, useRef as useRef24, useState as useState22 } from "react";
39
+ import React52, { useCallback as useCallback24, useRef as useRef25, useState as useState22 } from "react";
29
40
 
30
41
  // ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
31
42
  function r(e) {
@@ -1367,7 +1378,7 @@ var getDefaultConfig = () => {
1367
1378
  var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
1368
1379
 
1369
1380
  // ../design/dist/esm/index.mjs
1370
- import React33, { useEffect as useEffect20, useMemo as useMemo38, useState as useState23 } from "react";
1381
+ import React33, { useEffect as useEffect20, useMemo as useMemo39, useState as useState21 } from "react";
1371
1382
 
1372
1383
  // ../paths/dist/esm/index.mjs
1373
1384
  var cutLInstruction = ({
@@ -5732,13 +5743,6 @@ import * as React6 from "react";
5732
5743
  import React7, { useMemo as useMemo6, useRef as useRef2 } from "react";
5733
5744
  import { useContext as useContext8, useMemo as useMemo7 } from "react";
5734
5745
  import { jsx as jsx72 } from "react/jsx-runtime";
5735
- import {
5736
- forwardRef as forwardRef4,
5737
- useCallback as useCallback6,
5738
- useEffect as useEffect5,
5739
- useMemo as useMemo16,
5740
- useState as useState6
5741
- } from "react";
5742
5746
  import {
5743
5747
  forwardRef as forwardRef3,
5744
5748
  useContext as useContext17,
@@ -5746,6 +5750,7 @@ import {
5746
5750
  useMemo as useMemo14,
5747
5751
  useState as useState5
5748
5752
  } from "react";
5753
+ import { useRef as useRef6 } from "react";
5749
5754
  import { useContext as useContext14, useMemo as useMemo11 } from "react";
5750
5755
  import { createContext as createContext12 } from "react";
5751
5756
  import { useContext as useContext10, useMemo as useMemo9 } from "react";
@@ -5768,18 +5773,25 @@ import React12, { forwardRef as forwardRef2, useState as useState4, useContext a
5768
5773
  import { useContext as useContext15, useRef as useRef5 } from "react";
5769
5774
  import { createContext as createContext15 } from "react";
5770
5775
  import { jsx as jsx112 } from "react/jsx-runtime";
5771
- import { useEffect as useEffect4, useMemo as useMemo15, useRef as useRef6 } from "react";
5776
+ import {
5777
+ forwardRef as forwardRef4,
5778
+ useEffect as useEffect5,
5779
+ useImperativeHandle as useImperativeHandle2,
5780
+ useLayoutEffect as useLayoutEffect2,
5781
+ useRef as useRef9,
5782
+ useState as useState6
5783
+ } from "react";
5784
+ import React14, { useCallback as useCallback6, useImperativeHandle, useMemo as useMemo16, useRef as useRef8 } from "react";
5785
+ import { useEffect as useEffect4, useMemo as useMemo15, useRef as useRef7 } from "react";
5772
5786
  import { jsx as jsx12 } from "react/jsx-runtime";
5787
+ import { jsx as jsx13 } from "react/jsx-runtime";
5773
5788
  import {
5774
5789
  forwardRef as forwardRef5,
5790
+ useCallback as useCallback7,
5775
5791
  useEffect as useEffect6,
5776
- useImperativeHandle as useImperativeHandle2,
5777
- useLayoutEffect as useLayoutEffect2,
5778
- useRef as useRef8,
5792
+ useMemo as useMemo17,
5779
5793
  useState as useState7
5780
5794
  } from "react";
5781
- import React15, { useCallback as useCallback7, useImperativeHandle, useRef as useRef7 } from "react";
5782
- import { jsx as jsx13 } from "react/jsx-runtime";
5783
5795
  import { jsx as jsx14 } from "react/jsx-runtime";
5784
5796
  import {
5785
5797
  createContext as createContext16,
@@ -5787,78 +5799,78 @@ import {
5787
5799
  useCallback as useCallback8,
5788
5800
  useContext as useContext18,
5789
5801
  useLayoutEffect as useLayoutEffect3,
5790
- useMemo as useMemo17,
5791
- useRef as useRef9,
5792
- useState as useState8
5802
+ useMemo as useMemo18,
5803
+ useRef as useRef10
5793
5804
  } from "react";
5794
5805
  import { jsx as jsx15 } from "react/jsx-runtime";
5795
- import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useState as useState10 } from "react";
5806
+ import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useState as useState9 } from "react";
5796
5807
  import {
5797
5808
  createContext as createContext17,
5798
5809
  useCallback as useCallback9,
5799
5810
  useImperativeHandle as useImperativeHandle3,
5800
5811
  useLayoutEffect as useLayoutEffect4,
5801
- useMemo as useMemo18,
5802
- useRef as useRef10,
5803
- useState as useState9
5812
+ useMemo as useMemo19,
5813
+ useRef as useRef11,
5814
+ useState as useState8
5804
5815
  } from "react";
5805
5816
  import { jsx as jsx16 } from "react/jsx-runtime";
5806
- import { forwardRef as forwardRef9, useCallback as useCallback14, useContext as useContext31 } from "react";
5807
- import React17, { createContext as createContext18, useMemo as useMemo19 } from "react";
5817
+ import { forwardRef as forwardRef9, useCallback as useCallback15, useContext as useContext31 } from "react";
5818
+ import React17, { createContext as createContext18, useMemo as useMemo20 } from "react";
5808
5819
  import { jsx as jsx17 } from "react/jsx-runtime";
5809
5820
  import { useContext as useContext20 } from "react";
5810
- import { createContext as createContext19, useEffect as useEffect7, useState as useState11 } from "react";
5821
+ import { createContext as createContext19, useEffect as useEffect7, useState as useState10 } from "react";
5811
5822
  import { jsx as jsx18 } from "react/jsx-runtime";
5812
- import { createContext as createContext20, useMemo as useMemo20, useReducer } from "react";
5823
+ import { createContext as createContext20, useMemo as useMemo21, useReducer } from "react";
5813
5824
  import { jsx as jsx19 } from "react/jsx-runtime";
5825
+ import { useCallback as useCallback14 } from "react";
5814
5826
  import React23, {
5815
5827
  forwardRef as forwardRef7,
5816
5828
  useContext as useContext29,
5817
5829
  useEffect as useEffect14,
5818
5830
  useImperativeHandle as useImperativeHandle4,
5819
- useMemo as useMemo28,
5820
- useRef as useRef18,
5821
- useState as useState16
5831
+ useMemo as useMemo29,
5832
+ useRef as useRef19,
5833
+ useState as useState15
5822
5834
  } from "react";
5823
- import { useContext as useContext22, useLayoutEffect as useLayoutEffect6, useRef as useRef13 } from "react";
5835
+ import { useContext as useContext22, useLayoutEffect as useLayoutEffect6, useRef as useRef14 } from "react";
5824
5836
  import React20, {
5825
5837
  createContext as createContext21,
5826
5838
  createRef as createRef2,
5827
5839
  useCallback as useCallback10,
5828
5840
  useContext as useContext21,
5829
- useMemo as useMemo22,
5830
- useRef as useRef11,
5831
- useState as useState12
5841
+ useMemo as useMemo23,
5842
+ useRef as useRef12,
5843
+ useState as useState11
5832
5844
  } from "react";
5833
- import { useMemo as useMemo21 } from "react";
5845
+ import { useMemo as useMemo22 } from "react";
5834
5846
  import { jsx as jsx20, jsxs as jsxs22 } from "react/jsx-runtime";
5835
- import { useRef as useRef12 } from "react";
5836
- import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo23, useState as useState13 } from "react";
5847
+ import { useRef as useRef13 } from "react";
5848
+ import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo24, useState as useState12 } from "react";
5837
5849
  import { useContext as useContext23 } from "react";
5838
5850
  import {
5839
5851
  useCallback as useCallback13,
5840
5852
  useContext as useContext27,
5841
5853
  useEffect as useEffect12,
5842
5854
  useLayoutEffect as useLayoutEffect8,
5843
- useRef as useRef17
5855
+ useRef as useRef18
5844
5856
  } from "react";
5845
- import { useCallback as useCallback12, useMemo as useMemo26, useRef as useRef15 } from "react";
5846
- import { useContext as useContext26, useMemo as useMemo25 } from "react";
5857
+ import { useCallback as useCallback12, useMemo as useMemo27, useRef as useRef16 } from "react";
5858
+ import { useContext as useContext26, useMemo as useMemo26 } from "react";
5847
5859
  import React21, {
5848
5860
  useCallback as useCallback11,
5849
5861
  useContext as useContext25,
5850
5862
  useEffect as useEffect9,
5851
5863
  useLayoutEffect as useLayoutEffect7,
5852
- useMemo as useMemo24,
5853
- useRef as useRef14,
5854
- useState as useState14
5864
+ useMemo as useMemo25,
5865
+ useRef as useRef15,
5866
+ useState as useState13
5855
5867
  } from "react";
5856
5868
  import { jsx as jsx21 } from "react/jsx-runtime";
5857
5869
  import React22 from "react";
5858
- import { useEffect as useEffect10, useState as useState15 } from "react";
5859
- import { useEffect as useEffect11, useRef as useRef16 } from "react";
5870
+ import { useEffect as useEffect10, useState as useState14 } from "react";
5871
+ import { useEffect as useEffect11, useRef as useRef17 } from "react";
5860
5872
  import { useEffect as useEffect13 } from "react";
5861
- import { createContext as createContext22, useContext as useContext28, useMemo as useMemo27 } from "react";
5873
+ import { createContext as createContext22, useContext as useContext28, useMemo as useMemo28 } from "react";
5862
5874
  import { jsx as jsx222 } from "react/jsx-runtime";
5863
5875
  import {
5864
5876
  forwardRef as forwardRef8,
@@ -5866,47 +5878,47 @@ import {
5866
5878
  useEffect as useEffect15,
5867
5879
  useImperativeHandle as useImperativeHandle5,
5868
5880
  useLayoutEffect as useLayoutEffect9,
5869
- useMemo as useMemo29,
5870
- useRef as useRef19
5881
+ useMemo as useMemo30,
5882
+ useRef as useRef20
5871
5883
  } from "react";
5872
5884
  import { jsx as jsx23 } from "react/jsx-runtime";
5873
5885
  import { jsx as jsx24 } from "react/jsx-runtime";
5874
- import { forwardRef as forwardRef10, useCallback as useCallback15, useState as useState17 } from "react";
5886
+ import { forwardRef as forwardRef10, useCallback as useCallback16, useState as useState16 } from "react";
5875
5887
  import { jsx as jsx25 } from "react/jsx-runtime";
5876
5888
  import {
5877
- useCallback as useCallback16,
5889
+ useCallback as useCallback17,
5878
5890
  useContext as useContext32,
5879
5891
  useImperativeHandle as useImperativeHandle6,
5880
5892
  useLayoutEffect as useLayoutEffect10,
5881
- useRef as useRef20,
5882
- useState as useState18
5893
+ useRef as useRef21,
5894
+ useState as useState17
5883
5895
  } from "react";
5884
5896
  import { jsx as jsx26 } from "react/jsx-runtime";
5885
5897
  import { createRef as createRef3 } from "react";
5886
5898
  import React28 from "react";
5887
5899
  import {
5888
- useCallback as useCallback17,
5900
+ useCallback as useCallback18,
5889
5901
  useImperativeHandle as useImperativeHandle7,
5890
- useMemo as useMemo30,
5891
- useRef as useRef21,
5892
- useState as useState19
5902
+ useMemo as useMemo31,
5903
+ useRef as useRef22,
5904
+ useState as useState18
5893
5905
  } from "react";
5894
5906
  import { jsx as jsx27 } from "react/jsx-runtime";
5895
5907
  import React29 from "react";
5896
- import { useMemo as useMemo322 } from "react";
5897
- import { createContext as createContext23, useContext as useContext33, useMemo as useMemo31 } from "react";
5908
+ import { useMemo as useMemo33 } from "react";
5909
+ import { createContext as createContext23, useContext as useContext33, useMemo as useMemo322 } from "react";
5898
5910
  import { jsx as jsx28 } from "react/jsx-runtime";
5899
5911
  import { jsx as jsx29 } from "react/jsx-runtime";
5900
5912
  import React31 from "react";
5901
5913
  import React32, { createContext as createContext24 } from "react";
5902
- import { useCallback as useCallback19 } from "react";
5914
+ import { useCallback as useCallback21 } from "react";
5903
5915
  import {
5904
- useCallback as useCallback18,
5916
+ useCallback as useCallback19,
5905
5917
  useContext as useContext34,
5906
5918
  useEffect as useEffect16,
5907
5919
  useLayoutEffect as useLayoutEffect11,
5908
- useMemo as useMemo33,
5909
- useState as useState20
5920
+ useMemo as useMemo34,
5921
+ useState as useState19
5910
5922
  } from "react";
5911
5923
  import { jsx as jsx30 } from "react/jsx-runtime";
5912
5924
  import React34, {
@@ -5914,45 +5926,42 @@ import React34, {
5914
5926
  useContext as useContext35,
5915
5927
  useEffect as useEffect18,
5916
5928
  useImperativeHandle as useImperativeHandle8,
5917
- useMemo as useMemo34,
5918
- useRef as useRef22,
5919
- useState as useState21
5929
+ useMemo as useMemo35,
5930
+ useRef as useRef23,
5931
+ useState as useState20,
5932
+ useCallback as useCallback20
5920
5933
  } from "react";
5921
5934
  import { useEffect as useEffect17 } from "react";
5922
5935
  import { jsx as jsx31 } from "react/jsx-runtime";
5923
5936
  import { jsx as jsx322 } from "react/jsx-runtime";
5924
- import React36, { useMemo as useMemo35 } from "react";
5937
+ import React36, { useMemo as useMemo36 } from "react";
5925
5938
  import { jsx as jsx33 } from "react/jsx-runtime";
5926
- import { Children, forwardRef as forwardRef12, useMemo as useMemo36 } from "react";
5939
+ import { Children, forwardRef as forwardRef12, useMemo as useMemo37 } from "react";
5927
5940
  import React37 from "react";
5928
5941
  import React38, { createContext as createContext25 } from "react";
5929
5942
  import { jsx as jsx34 } from "react/jsx-runtime";
5930
5943
  import { jsx as jsx35 } from "react/jsx-runtime";
5931
5944
  import React40 from "react";
5932
- import { forwardRef as forwardRef14, useCallback as useCallback20, useContext as useContext37 } from "react";
5945
+ import { forwardRef as forwardRef14, useCallback as useCallback22, useContext as useContext37 } from "react";
5933
5946
  import {
5934
5947
  forwardRef as forwardRef13,
5935
5948
  useContext as useContext36,
5936
5949
  useEffect as useEffect19,
5937
5950
  useImperativeHandle as useImperativeHandle9,
5938
5951
  useLayoutEffect as useLayoutEffect12,
5939
- useMemo as useMemo37,
5940
- useRef as useRef23
5952
+ useMemo as useMemo38,
5953
+ useRef as useRef24
5941
5954
  } from "react";
5942
5955
  import { jsx as jsx36 } from "react/jsx-runtime";
5943
5956
  import { jsx as jsx37 } from "react/jsx-runtime";
5944
5957
  var __defProp2 = Object.defineProperty;
5945
- var __returnValue2 = (v) => v;
5946
- function __exportSetter2(name, newValue) {
5947
- this[name] = __returnValue2.bind(null, newValue);
5948
- }
5949
5958
  var __export2 = (target, all) => {
5950
5959
  for (var name in all)
5951
5960
  __defProp2(target, name, {
5952
5961
  get: all[name],
5953
5962
  enumerable: true,
5954
5963
  configurable: true,
5955
- set: __exportSetter2.bind(all, name)
5964
+ set: (newValue) => all[name] = () => newValue
5956
5965
  });
5957
5966
  };
5958
5967
  if (typeof createContext !== "function") {
@@ -7017,75 +7026,33 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
7017
7026
  var addSequenceStackTraces = (component) => {
7018
7027
  componentsToAddStacksTo.push(component);
7019
7028
  };
7020
- var sequenceStyleSchema = {
7021
- "style.translate": {
7022
- type: "translate",
7023
- step: 1,
7024
- default: "0px 0px",
7025
- description: "Offset"
7026
- },
7027
- "style.scale": {
7028
- type: "number",
7029
- min: 0.05,
7030
- max: 100,
7031
- step: 0.01,
7032
- default: 1,
7033
- description: "Scale"
7034
- },
7035
- "style.rotate": {
7036
- type: "rotation",
7037
- step: 1,
7038
- default: "0deg",
7039
- description: "Rotation"
7040
- },
7041
- "style.opacity": {
7042
- type: "number",
7043
- min: 0,
7044
- max: 1,
7045
- step: 0.01,
7046
- default: 1,
7047
- description: "Opacity"
7048
- },
7049
- premountFor: {
7050
- type: "number",
7051
- default: 0,
7052
- description: "Premount For",
7053
- min: 0,
7054
- step: 1
7055
- },
7056
- postmountFor: {
7057
- type: "hidden"
7058
- },
7059
- styleWhilePremounted: {
7060
- type: "hidden"
7061
- },
7062
- styleWhilePostmounted: {
7063
- type: "hidden"
7029
+ var VERSION = "4.0.464";
7030
+ var checkMultipleRemotionVersions = () => {
7031
+ if (typeof globalThis === "undefined") {
7032
+ return;
7064
7033
  }
7065
- };
7066
- var hiddenField = {
7067
- type: "boolean",
7068
- default: false,
7069
- description: "Hidden"
7070
- };
7071
- var sequenceSchema = {
7072
- hidden: hiddenField,
7073
- layout: {
7074
- type: "enum",
7075
- default: "absolute-fill",
7076
- description: "Layout",
7077
- variants: {
7078
- "absolute-fill": sequenceStyleSchema,
7079
- none: {}
7034
+ const set = () => {
7035
+ globalThis.remotion_imported = VERSION;
7036
+ if (typeof window !== "undefined") {
7037
+ window.remotion_imported = VERSION;
7080
7038
  }
7039
+ };
7040
+ const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
7041
+ if (alreadyImported) {
7042
+ if (alreadyImported === VERSION) {
7043
+ return;
7044
+ }
7045
+ if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
7046
+ set();
7047
+ return;
7048
+ }
7049
+ throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
7050
+ VERSION,
7051
+ typeof alreadyImported === "string" ? alreadyImported : "an older version"
7052
+ ].filter(truthy2).join(" and ")}. This will cause things to break in an unexpected way.
7053
+ 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.`);
7081
7054
  }
7082
- };
7083
- var sequenceSchemaDefaultLayoutNone = {
7084
- ...sequenceSchema,
7085
- layout: {
7086
- ...sequenceSchema.layout,
7087
- default: "none"
7088
- }
7055
+ set();
7089
7056
  };
7090
7057
  var SequenceContext = createContext12(null);
7091
7058
  var exports_timeline_position_state = {};
@@ -7421,6 +7388,82 @@ var Freeze = ({
7421
7388
  var PremountContext = createContext14({
7422
7389
  premountFramesRemaining: 0
7423
7390
  });
7391
+ var sequenceVisualStyleSchema = {
7392
+ "style.translate": {
7393
+ type: "translate",
7394
+ step: 1,
7395
+ default: "0px 0px",
7396
+ description: "Offset"
7397
+ },
7398
+ "style.scale": {
7399
+ type: "number",
7400
+ min: 0.05,
7401
+ max: 100,
7402
+ step: 0.01,
7403
+ default: 1,
7404
+ description: "Scale"
7405
+ },
7406
+ "style.rotate": {
7407
+ type: "rotation",
7408
+ step: 1,
7409
+ default: "0deg",
7410
+ description: "Rotation"
7411
+ },
7412
+ "style.opacity": {
7413
+ type: "number",
7414
+ min: 0,
7415
+ max: 1,
7416
+ step: 0.01,
7417
+ default: 1,
7418
+ description: "Opacity"
7419
+ }
7420
+ };
7421
+ var sequencePremountSchema = {
7422
+ premountFor: {
7423
+ type: "number",
7424
+ default: 0,
7425
+ description: "Premount For",
7426
+ min: 0,
7427
+ step: 1
7428
+ },
7429
+ postmountFor: {
7430
+ type: "hidden"
7431
+ },
7432
+ styleWhilePremounted: {
7433
+ type: "hidden"
7434
+ },
7435
+ styleWhilePostmounted: {
7436
+ type: "hidden"
7437
+ }
7438
+ };
7439
+ var sequenceStyleSchema = {
7440
+ ...sequenceVisualStyleSchema,
7441
+ ...sequencePremountSchema
7442
+ };
7443
+ var hiddenField = {
7444
+ type: "boolean",
7445
+ default: false,
7446
+ description: "Hidden"
7447
+ };
7448
+ var sequenceSchema = {
7449
+ hidden: hiddenField,
7450
+ layout: {
7451
+ type: "enum",
7452
+ default: "absolute-fill",
7453
+ description: "Layout",
7454
+ variants: {
7455
+ "absolute-fill": sequenceStyleSchema,
7456
+ none: {}
7457
+ }
7458
+ }
7459
+ };
7460
+ var sequenceSchemaDefaultLayoutNone = {
7461
+ ...sequenceSchema,
7462
+ layout: {
7463
+ ...sequenceSchema.layout,
7464
+ default: "none"
7465
+ }
7466
+ };
7424
7467
  var SequenceManager = React11.createContext({
7425
7468
  registerSequence: () => {
7426
7469
  throw new Error("SequenceManagerContext not initialized");
@@ -8103,7 +8146,8 @@ var RegularSequenceRefForwardingFunction = ({
8103
8146
  }, [name]);
8104
8147
  const env = useRemotionEnvironment();
8105
8148
  const inheritedStack = other?.stack ?? null;
8106
- const [stackDoesntChange] = useState5(() => stack ?? inheritedStack);
8149
+ const stackRef = useRef6(null);
8150
+ stackRef.current = stack ?? inheritedStack;
8107
8151
  useEffect3(() => {
8108
8152
  if (!env.isStudio) {
8109
8153
  return;
@@ -8127,7 +8171,7 @@ var RegularSequenceRefForwardingFunction = ({
8127
8171
  rootId,
8128
8172
  showInTimeline,
8129
8173
  src: isMedia.data.src,
8130
- stack: stackDoesntChange,
8174
+ getStack: () => stackRef.current,
8131
8175
  startMediaFrom: isMedia.data.startMediaFrom,
8132
8176
  volume: isMedia.data.volumes
8133
8177
  });
@@ -8146,7 +8190,7 @@ var RegularSequenceRefForwardingFunction = ({
8146
8190
  showInTimeline,
8147
8191
  nonce: nonce.get(),
8148
8192
  loopDisplay,
8149
- stack: stackDoesntChange,
8193
+ getStack: () => stackRef.current,
8150
8194
  premountDisplay: premountDisplay ?? null,
8151
8195
  postmountDisplay: postmountDisplay ?? null,
8152
8196
  controls: controls ?? null,
@@ -8169,7 +8213,6 @@ var RegularSequenceRefForwardingFunction = ({
8169
8213
  showInTimeline,
8170
8214
  nonce,
8171
8215
  loopDisplay,
8172
- stackDoesntChange,
8173
8216
  premountDisplay,
8174
8217
  postmountDisplay,
8175
8218
  env.isStudio,
@@ -8278,6 +8321,10 @@ var SequenceRefForwardingFunction = (props, ref) => {
8278
8321
  };
8279
8322
  var SequenceInner = forwardRef3(SequenceRefForwardingFunction);
8280
8323
  var Sequence = wrapInSchema(SequenceInner, sequenceSchema);
8324
+ var WEBGL_CONTEXT_DOCS_URL = "https://remotion.dev/docs/troubleshooting/webgl2-context";
8325
+ 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}`;
8326
+ var createWebGLContextError = (effectName) => new Error(webGlContextErrorMessage("WebGL", effectName));
8327
+ var createWebGL2ContextError = (effectName) => new Error(webGlContextErrorMessage("WebGL2", effectName));
8281
8328
 
8282
8329
  class CanvasPool {
8283
8330
  width;
@@ -8326,7 +8373,7 @@ class CanvasPool {
8326
8373
  preserveDrawingBuffer: true
8327
8374
  });
8328
8375
  if (!ctx) {
8329
- throw new Error("Failed to acquire WebGL2 context for canvas effect");
8376
+ throw createWebGL2ContextError("canvas effect");
8330
8377
  }
8331
8378
  canvas.addEventListener("webglcontextlost", (e) => {
8332
8379
  e.preventDefault();
@@ -8484,216 +8531,36 @@ var runEffectChain = async ({
8484
8531
  if (!lastTarget) {
8485
8532
  return true;
8486
8533
  }
8487
- const outCtx = output.getContext("2d");
8488
- if (!outCtx) {
8489
- throw new Error("Failed to acquire 2D context for output canvas");
8490
- }
8491
- outCtx.clearRect(0, 0, width, height);
8492
- outCtx.drawImage(lastTarget, 0, 0, width, height);
8493
- return true;
8494
- };
8495
- var useEffectChainState = () => {
8496
- const chainStateRef = useRef6(null);
8497
- const sizeRef = useRef6(null);
8498
- useEffect4(() => {
8499
- return () => {
8500
- if (chainStateRef.current) {
8501
- cleanupEffectChainState(chainStateRef.current);
8502
- }
8503
- };
8504
- }, []);
8505
- return useMemo15(() => ({
8506
- get: (width, height) => {
8507
- if (!sizeRef.current || sizeRef.current.width !== width || sizeRef.current.height !== height) {
8508
- if (chainStateRef.current) {
8509
- cleanupEffectChainState(chainStateRef.current);
8510
- }
8511
- chainStateRef.current = createEffectChainState(width, height);
8512
- sizeRef.current = { width, height };
8513
- }
8514
- return chainStateRef.current;
8515
- }
8516
- }), []);
8517
- };
8518
- var solidSchema = {
8519
- color: {
8520
- type: "color",
8521
- default: "#ffffff",
8522
- description: "Color"
8523
- },
8524
- width: {
8525
- type: "number",
8526
- min: 1,
8527
- step: 1,
8528
- default: 1920,
8529
- description: "Width"
8530
- },
8531
- height: {
8532
- type: "number",
8533
- min: 1,
8534
- step: 1,
8535
- default: 1080,
8536
- description: "Height"
8537
- },
8538
- ...sequenceStyleSchema
8539
- };
8540
- var SolidInner = ({
8541
- color,
8542
- width,
8543
- height,
8544
- _experimentalEffects: experimentalEffects = [],
8545
- className,
8546
- style,
8547
- overrideId,
8548
- ref
8549
- }) => {
8550
- const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
8551
- const [outputCanvas, setOutputCanvas] = useState6(null);
8552
- const memoizedEffects = useMemoizedEffects({
8553
- effects: experimentalEffects,
8554
- overrideId: overrideId ?? null
8555
- });
8556
- const sourceCanvas = useMemo16(() => {
8557
- if (typeof document === "undefined") {
8558
- return null;
8559
- }
8560
- const canvas = document.createElement("canvas");
8561
- canvas.width = 1;
8562
- canvas.height = 1;
8563
- return canvas;
8564
- }, []);
8565
- const chainState = useEffectChainState();
8566
- const canvasRef = useCallback6((canvas) => {
8567
- setOutputCanvas(canvas);
8568
- if (typeof ref === "function") {
8569
- ref(canvas);
8570
- } else if (ref) {
8571
- ref.current = canvas;
8572
- }
8573
- }, [ref]);
8574
- useEffect5(() => {
8575
- if (!outputCanvas || !sourceCanvas) {
8576
- return;
8577
- }
8578
- const handle = delayRender2("Solid effect chain");
8579
- if (!chainState) {
8580
- continueRender2(handle);
8581
- return () => {
8582
- continueRender2(handle);
8583
- };
8584
- }
8585
- const ctx = sourceCanvas.getContext("2d", { colorSpace: "srgb" });
8586
- if (!ctx) {
8587
- cancelRender2(new Error("Failed to acquire 2D context for <Solid> source"));
8588
- return;
8589
- }
8590
- ctx.fillStyle = color;
8591
- ctx.fillRect(0, 0, 1, 1);
8592
- runEffectChain({
8593
- state: chainState.get(width, height),
8594
- source: sourceCanvas,
8595
- effects: memoizedEffects,
8596
- output: outputCanvas,
8597
- width,
8598
- height
8599
- }).then((completed) => {
8600
- if (completed) {
8601
- continueRender2(handle);
8602
- }
8603
- }).catch((err) => {
8604
- cancelRender2(err);
8605
- });
8606
- return () => {
8607
- continueRender2(handle);
8608
- };
8609
- }, [
8610
- color,
8611
- outputCanvas,
8612
- sourceCanvas,
8613
- chainState,
8614
- width,
8615
- height,
8616
- delayRender2,
8617
- continueRender2,
8618
- cancelRender2,
8619
- memoizedEffects
8620
- ]);
8621
- return /* @__PURE__ */ jsx12("canvas", {
8622
- ref: canvasRef,
8623
- width,
8624
- height,
8625
- className,
8626
- style
8627
- });
8628
- };
8629
- var SolidOuter = forwardRef4(({
8630
- _experimentalEffects = [],
8631
- _experimentalControls: controls,
8632
- color,
8633
- height,
8634
- width,
8635
- className,
8636
- durationInFrames,
8637
- style,
8638
- name,
8639
- from,
8640
- hidden,
8641
- showInTimeline,
8642
- ...props
8643
- }, ref) => {
8644
- const memoizedEffectDefinitions = useMemoizedEffectDefinitions(_experimentalEffects);
8645
- return /* @__PURE__ */ jsx12(Sequence, {
8646
- layout: "none",
8647
- from,
8648
- hidden,
8649
- showInTimeline,
8650
- _experimentalControls: controls,
8651
- _experimentalEffects: memoizedEffectDefinitions,
8652
- durationInFrames,
8653
- name: name ?? "<Solid>",
8654
- ...props,
8655
- children: /* @__PURE__ */ jsx12(SolidInner, {
8656
- ref,
8657
- overrideId: controls?.overrideId ?? null,
8658
- color,
8659
- height,
8660
- width,
8661
- className,
8662
- style,
8663
- _experimentalEffects
8664
- })
8665
- });
8666
- });
8667
- var Solid = wrapInSchema(SolidOuter, solidSchema);
8668
- Solid.displayName = "Solid";
8669
- addSequenceStackTraces(Solid);
8670
- var VERSION = "4.0.463";
8671
- var checkMultipleRemotionVersions = () => {
8672
- if (typeof globalThis === "undefined") {
8673
- return;
8674
- }
8675
- const set = () => {
8676
- globalThis.remotion_imported = VERSION;
8677
- if (typeof window !== "undefined") {
8678
- window.remotion_imported = VERSION;
8679
- }
8680
- };
8681
- const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
8682
- if (alreadyImported) {
8683
- if (alreadyImported === VERSION) {
8684
- return;
8685
- }
8686
- if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
8687
- set();
8688
- return;
8689
- }
8690
- throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
8691
- VERSION,
8692
- typeof alreadyImported === "string" ? alreadyImported : "an older version"
8693
- ].filter(truthy2).join(" and ")}. This will cause things to break in an unexpected way.
8694
- 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.`);
8534
+ const outCtx = output.getContext("2d");
8535
+ if (!outCtx) {
8536
+ throw new Error("Failed to acquire 2D context for output canvas");
8695
8537
  }
8696
- set();
8538
+ outCtx.clearRect(0, 0, width, height);
8539
+ outCtx.drawImage(lastTarget, 0, 0, width, height);
8540
+ return true;
8541
+ };
8542
+ var useEffectChainState = () => {
8543
+ const chainStateRef = useRef7(null);
8544
+ const sizeRef = useRef7(null);
8545
+ useEffect4(() => {
8546
+ return () => {
8547
+ if (chainStateRef.current) {
8548
+ cleanupEffectChainState(chainStateRef.current);
8549
+ }
8550
+ };
8551
+ }, []);
8552
+ return useMemo15(() => ({
8553
+ get: (width, height) => {
8554
+ if (!sizeRef.current || sizeRef.current.width !== width || sizeRef.current.height !== height) {
8555
+ if (chainStateRef.current) {
8556
+ cleanupEffectChainState(chainStateRef.current);
8557
+ }
8558
+ chainStateRef.current = createEffectChainState(width, height);
8559
+ sizeRef.current = { width, height };
8560
+ }
8561
+ return chainStateRef.current;
8562
+ }
8563
+ }), []);
8697
8564
  };
8698
8565
  var calcArgs = (fit, frameSize, canvasSize) => {
8699
8566
  switch (fit) {
@@ -8743,29 +8610,49 @@ var calcArgs = (fit, frameSize, canvasSize) => {
8743
8610
  throw new Error("Unknown fit: " + fit);
8744
8611
  }
8745
8612
  };
8746
- var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref) => {
8747
- const canvasRef = useRef7(null);
8748
- const draw = useCallback7((imageData) => {
8613
+ var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effects }, ref) => {
8614
+ const canvasRef = useRef8(null);
8615
+ const chainState = useEffectChainState();
8616
+ const sourceCanvas = useMemo16(() => {
8617
+ if (typeof document === "undefined") {
8618
+ return null;
8619
+ }
8620
+ return document.createElement("canvas");
8621
+ }, []);
8622
+ const draw = useCallback6(async (imageData) => {
8749
8623
  const canvas = canvasRef.current;
8750
8624
  const canvasWidth = width ?? imageData.displayWidth;
8751
8625
  const canvasHeight = height ?? imageData.displayHeight;
8752
8626
  if (!canvas) {
8753
8627
  throw new Error("Canvas ref is not set");
8754
8628
  }
8755
- const ctx = canvasRef.current?.getContext("2d");
8756
- if (!ctx) {
8757
- throw new Error("Could not get 2d context");
8629
+ if (!sourceCanvas) {
8630
+ throw new Error("Source canvas is not available");
8758
8631
  }
8759
- canvas.width = canvasWidth;
8760
- canvas.height = canvasHeight;
8761
- ctx.drawImage(imageData, ...calcArgs(fit, {
8632
+ sourceCanvas.width = canvasWidth;
8633
+ sourceCanvas.height = canvasHeight;
8634
+ const sourceCtx = sourceCanvas.getContext("2d");
8635
+ if (!sourceCtx) {
8636
+ throw new Error("Could not get 2d context for source canvas");
8637
+ }
8638
+ sourceCtx.drawImage(imageData, ...calcArgs(fit, {
8762
8639
  height: imageData.displayHeight,
8763
8640
  width: imageData.displayWidth
8764
8641
  }, {
8765
8642
  width: canvasWidth,
8766
8643
  height: canvasHeight
8767
8644
  }));
8768
- }, [fit, height, width]);
8645
+ canvas.width = canvasWidth;
8646
+ canvas.height = canvasHeight;
8647
+ return runEffectChain({
8648
+ state: chainState.get(canvasWidth, canvasHeight),
8649
+ source: sourceCanvas,
8650
+ effects,
8651
+ output: canvas,
8652
+ width: canvasWidth,
8653
+ height: canvasHeight
8654
+ });
8655
+ }, [chainState, effects, fit, height, sourceCanvas, width]);
8769
8656
  useImperativeHandle(ref, () => {
8770
8657
  return {
8771
8658
  draw,
@@ -8784,13 +8671,13 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref
8784
8671
  }
8785
8672
  };
8786
8673
  }, [draw]);
8787
- return /* @__PURE__ */ jsx13("canvas", {
8674
+ return /* @__PURE__ */ jsx12("canvas", {
8788
8675
  ref: canvasRef,
8789
8676
  className,
8790
8677
  style
8791
8678
  });
8792
8679
  };
8793
- var Canvas = React15.forwardRef(CanvasRefForwardingFunction);
8680
+ var Canvas = React14.forwardRef(CanvasRefForwardingFunction);
8794
8681
  var CACHE_SIZE = 5;
8795
8682
  var getActualTime = ({
8796
8683
  loopBehavior,
@@ -8946,10 +8833,10 @@ var animatedImageSchema = {
8946
8833
  default: 1,
8947
8834
  description: "Playback Rate"
8948
8835
  },
8949
- ...sequenceStyleSchema,
8836
+ ...sequenceVisualStyleSchema,
8950
8837
  hidden: hiddenField
8951
8838
  };
8952
- var AnimatedImageContent = forwardRef5(({
8839
+ var AnimatedImageContent = forwardRef4(({
8953
8840
  src,
8954
8841
  width,
8955
8842
  height,
@@ -8957,26 +8844,24 @@ var AnimatedImageContent = forwardRef5(({
8957
8844
  loopBehavior = "loop",
8958
8845
  playbackRate = 1,
8959
8846
  fit = "fill",
8847
+ effects,
8848
+ controls,
8960
8849
  ...props
8961
8850
  }, canvasRef) => {
8962
- const mountState = useRef8({ isMounted: true });
8963
- useEffect6(() => {
8964
- const { current } = mountState;
8965
- current.isMounted = true;
8966
- return () => {
8967
- current.isMounted = false;
8968
- };
8969
- }, []);
8970
8851
  const resolvedSrc = resolveAnimatedImageSource(src);
8971
- const [imageDecoder, setImageDecoder] = useState7(null);
8852
+ const [imageDecoder, setImageDecoder] = useState6(null);
8972
8853
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
8973
- const [decodeHandle] = useState7(() => delayRender2(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
8854
+ const [decodeHandle] = useState6(() => delayRender2(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
8974
8855
  const frame = useCurrentFrame();
8975
8856
  const { fps } = useVideoConfig();
8976
8857
  const currentTime = frame / playbackRate / fps;
8977
- const currentTimeRef = useRef8(currentTime);
8858
+ const currentTimeRef = useRef9(currentTime);
8978
8859
  currentTimeRef.current = currentTime;
8979
- const ref = useRef8(null);
8860
+ const ref = useRef9(null);
8861
+ const memoizedEffects = useMemoizedEffects({
8862
+ effects,
8863
+ overrideId: controls?.overrideId ?? null
8864
+ });
8980
8865
  useImperativeHandle2(canvasRef, () => {
8981
8866
  const c = ref.current?.getCanvas();
8982
8867
  if (!c) {
@@ -8984,8 +8869,8 @@ var AnimatedImageContent = forwardRef5(({
8984
8869
  }
8985
8870
  return c;
8986
8871
  }, []);
8987
- const [initialLoopBehavior] = useState7(() => loopBehavior);
8988
- useEffect6(() => {
8872
+ const [initialLoopBehavior] = useState6(() => loopBehavior);
8873
+ useEffect5(() => {
8989
8874
  const controller = new AbortController;
8990
8875
  decodeImage({
8991
8876
  resolvedSrc,
@@ -9022,16 +8907,24 @@ var AnimatedImageContent = forwardRef5(({
9022
8907
  return;
9023
8908
  }
9024
8909
  const delay = delayRender2(`Rendering frame at ${currentTime} of <AnimatedImage src="${src}"/>`);
9025
- imageDecoder.getFrame(currentTime, loopBehavior).then((videoFrame) => {
9026
- if (mountState.current.isMounted) {
9027
- if (videoFrame === null) {
9028
- ref.current?.clear();
9029
- } else {
9030
- ref.current?.draw(videoFrame.frame);
9031
- }
8910
+ let cancelled = false;
8911
+ imageDecoder.getFrame(currentTime, loopBehavior).then(async (videoFrame) => {
8912
+ if (cancelled) {
8913
+ return;
8914
+ }
8915
+ if (videoFrame === null) {
8916
+ ref.current?.clear();
8917
+ continueRender2(delay);
8918
+ return;
8919
+ }
8920
+ const completed = await ref.current?.draw(videoFrame.frame);
8921
+ if (completed && !cancelled) {
8922
+ continueRender2(delay);
9032
8923
  }
9033
- continueRender2(delay);
9034
8924
  }).catch((err) => {
8925
+ if (cancelled) {
8926
+ return;
8927
+ }
9035
8928
  if (onError) {
9036
8929
  onError(err);
9037
8930
  continueRender2(delay);
@@ -9039,6 +8932,10 @@ var AnimatedImageContent = forwardRef5(({
9039
8932
  cancelRender(err);
9040
8933
  }
9041
8934
  });
8935
+ return () => {
8936
+ cancelled = true;
8937
+ continueRender2(delay);
8938
+ };
9042
8939
  }, [
9043
8940
  currentTime,
9044
8941
  imageDecoder,
@@ -9046,13 +8943,18 @@ var AnimatedImageContent = forwardRef5(({
9046
8943
  onError,
9047
8944
  src,
9048
8945
  continueRender2,
9049
- delayRender2
8946
+ delayRender2,
8947
+ memoizedEffects,
8948
+ fit,
8949
+ width,
8950
+ height
9050
8951
  ]);
9051
- return /* @__PURE__ */ jsx14(Canvas, {
8952
+ return /* @__PURE__ */ jsx13(Canvas, {
9052
8953
  ref,
9053
8954
  width,
9054
8955
  height,
9055
8956
  fit,
8957
+ effects: memoizedEffects,
9056
8958
  ...props
9057
8959
  });
9058
8960
  });
@@ -9069,12 +8971,14 @@ var AnimatedImageInner = ({
9069
8971
  className,
9070
8972
  style,
9071
8973
  durationInFrames,
8974
+ _experimentalEffects: effects = [],
9072
8975
  _experimentalControls: controls,
9073
8976
  ref,
9074
8977
  ...sequenceProps
9075
8978
  }) => {
9076
8979
  const { durationInFrames: videoDuration } = useVideoConfig();
9077
8980
  const resolvedDuration = durationInFrames ?? videoDuration;
8981
+ const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
9078
8982
  const animatedImageProps = {
9079
8983
  src,
9080
8984
  width,
@@ -9087,21 +8991,179 @@ var AnimatedImageInner = ({
9087
8991
  className,
9088
8992
  style
9089
8993
  };
9090
- return /* @__PURE__ */ jsx14(Sequence, {
8994
+ return /* @__PURE__ */ jsx13(Sequence, {
9091
8995
  layout: "none",
9092
8996
  durationInFrames: resolvedDuration,
9093
8997
  name: "<AnimatedImage>",
9094
8998
  _experimentalControls: controls,
8999
+ _experimentalEffects: memoizedEffectDefinitions,
9095
9000
  ...sequenceProps,
9096
- children: /* @__PURE__ */ jsx14(AnimatedImageContent, {
9001
+ children: /* @__PURE__ */ jsx13(AnimatedImageContent, {
9097
9002
  ...animatedImageProps,
9098
- ref
9003
+ ref,
9004
+ effects,
9005
+ controls
9099
9006
  })
9100
9007
  });
9101
9008
  };
9102
9009
  var AnimatedImage = wrapInSchema(AnimatedImageInner, animatedImageSchema);
9103
9010
  AnimatedImage.displayName = "AnimatedImage";
9104
9011
  addSequenceStackTraces(AnimatedImage);
9012
+ var solidSchema = {
9013
+ color: {
9014
+ type: "color",
9015
+ default: "transparent",
9016
+ description: "Color"
9017
+ },
9018
+ width: {
9019
+ type: "number",
9020
+ min: 1,
9021
+ step: 1,
9022
+ default: 1920,
9023
+ description: "Width"
9024
+ },
9025
+ height: {
9026
+ type: "number",
9027
+ min: 1,
9028
+ step: 1,
9029
+ default: 1080,
9030
+ description: "Height"
9031
+ },
9032
+ ...sequenceVisualStyleSchema
9033
+ };
9034
+ var SolidInner = ({
9035
+ color,
9036
+ width,
9037
+ height,
9038
+ _experimentalEffects: experimentalEffects = [],
9039
+ className,
9040
+ style,
9041
+ overrideId,
9042
+ ref
9043
+ }) => {
9044
+ const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
9045
+ const [outputCanvas, setOutputCanvas] = useState7(null);
9046
+ const memoizedEffects = useMemoizedEffects({
9047
+ effects: experimentalEffects,
9048
+ overrideId: overrideId ?? null
9049
+ });
9050
+ const sourceCanvas = useMemo17(() => {
9051
+ if (typeof document === "undefined") {
9052
+ return null;
9053
+ }
9054
+ const canvas = document.createElement("canvas");
9055
+ canvas.width = 1;
9056
+ canvas.height = 1;
9057
+ return canvas;
9058
+ }, []);
9059
+ const chainState = useEffectChainState();
9060
+ const canvasRef = useCallback7((canvas) => {
9061
+ setOutputCanvas(canvas);
9062
+ if (typeof ref === "function") {
9063
+ ref(canvas);
9064
+ } else if (ref) {
9065
+ ref.current = canvas;
9066
+ }
9067
+ }, [ref]);
9068
+ useEffect6(() => {
9069
+ if (!outputCanvas || !sourceCanvas) {
9070
+ return;
9071
+ }
9072
+ const handle = delayRender2("Solid effect chain");
9073
+ if (!chainState) {
9074
+ continueRender2(handle);
9075
+ return () => {
9076
+ continueRender2(handle);
9077
+ };
9078
+ }
9079
+ const ctx = sourceCanvas.getContext("2d", { colorSpace: "srgb" });
9080
+ if (!ctx) {
9081
+ cancelRender2(new Error("Failed to acquire 2D context for <Solid> source"));
9082
+ return;
9083
+ }
9084
+ ctx.clearRect(0, 0, 1, 1);
9085
+ if (color !== undefined) {
9086
+ ctx.fillStyle = color;
9087
+ ctx.fillRect(0, 0, 1, 1);
9088
+ }
9089
+ runEffectChain({
9090
+ state: chainState.get(width, height),
9091
+ source: sourceCanvas,
9092
+ effects: memoizedEffects,
9093
+ output: outputCanvas,
9094
+ width,
9095
+ height
9096
+ }).then((completed) => {
9097
+ if (completed) {
9098
+ continueRender2(handle);
9099
+ }
9100
+ }).catch((err) => {
9101
+ cancelRender2(err);
9102
+ });
9103
+ return () => {
9104
+ continueRender2(handle);
9105
+ };
9106
+ }, [
9107
+ color,
9108
+ outputCanvas,
9109
+ sourceCanvas,
9110
+ chainState,
9111
+ width,
9112
+ height,
9113
+ delayRender2,
9114
+ continueRender2,
9115
+ cancelRender2,
9116
+ memoizedEffects
9117
+ ]);
9118
+ return /* @__PURE__ */ jsx14("canvas", {
9119
+ ref: canvasRef,
9120
+ width,
9121
+ height,
9122
+ className,
9123
+ style
9124
+ });
9125
+ };
9126
+ var SolidOuter = forwardRef5(({
9127
+ _experimentalEffects = [],
9128
+ _experimentalControls: controls,
9129
+ color,
9130
+ height,
9131
+ width,
9132
+ className,
9133
+ durationInFrames,
9134
+ style,
9135
+ name,
9136
+ from,
9137
+ hidden,
9138
+ showInTimeline,
9139
+ ...props
9140
+ }, ref) => {
9141
+ const memoizedEffectDefinitions = useMemoizedEffectDefinitions(_experimentalEffects);
9142
+ return /* @__PURE__ */ jsx14(Sequence, {
9143
+ layout: "none",
9144
+ from,
9145
+ hidden,
9146
+ showInTimeline,
9147
+ _experimentalControls: controls,
9148
+ _experimentalEffects: memoizedEffectDefinitions,
9149
+ durationInFrames,
9150
+ name: name ?? "<Solid>",
9151
+ ...props,
9152
+ children: /* @__PURE__ */ jsx14(SolidInner, {
9153
+ ref,
9154
+ overrideId: controls?.overrideId ?? null,
9155
+ color,
9156
+ height,
9157
+ width,
9158
+ className,
9159
+ style,
9160
+ _experimentalEffects
9161
+ })
9162
+ });
9163
+ });
9164
+ var Solid = wrapInSchema(SolidOuter, solidSchema);
9165
+ Solid.displayName = "Solid";
9166
+ addSequenceStackTraces(Solid);
9105
9167
  var cachedSupport = null;
9106
9168
  var isHtmlInCanvasSupported = () => {
9107
9169
  if (cachedSupport !== null) {
@@ -9112,7 +9174,7 @@ var isHtmlInCanvasSupported = () => {
9112
9174
  }
9113
9175
  const canvas = document.createElement("canvas");
9114
9176
  const ctx = canvas.getContext("2d");
9115
- cachedSupport = typeof ctx?.drawElementImage === "function" && typeof canvas.requestPaint === "function" && typeof canvas.captureElementImage === "function";
9177
+ cachedSupport = typeof ctx?.drawElementImage === "function" && typeof canvas.requestPaint === "function" && typeof canvas.captureElementImage === "function" && "transferControlToOffscreen" in HTMLCanvasElement.prototype;
9116
9178
  return cachedSupport;
9117
9179
  };
9118
9180
  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).";
@@ -9148,8 +9210,10 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
9148
9210
  if (!isHtmlInCanvasSupported()) {
9149
9211
  cancelRender2(new Error(HTML_IN_CANVAS_UNSUPPORTED_MESSAGE));
9150
9212
  }
9151
- const canvas2dRef = useRef9(null);
9152
- const divRef = useRef9(null);
9213
+ const canvas2dRef = useRef10(null);
9214
+ const offscreenRef = useRef10(null);
9215
+ const divRef = useRef10(null);
9216
+ const canvasSizeKey = `${width}x${height}`;
9153
9217
  const setLayoutCanvasRef = useCallback8((node) => {
9154
9218
  canvas2dRef.current = node;
9155
9219
  if (typeof ref === "function") {
@@ -9158,45 +9222,48 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
9158
9222
  ref.current = node;
9159
9223
  }
9160
9224
  }, [ref]);
9161
- const [offscreenCanvas] = useState8(() => new OffscreenCanvas(1, 1));
9162
9225
  const chainState = useEffectChainState();
9163
9226
  const memoizedEffects = useMemoizedEffects({
9164
9227
  effects,
9165
9228
  overrideId: controls?.overrideId ?? null
9166
9229
  });
9167
- const effectsRef = useRef9(memoizedEffects);
9230
+ const effectsRef = useRef10(memoizedEffects);
9168
9231
  effectsRef.current = memoizedEffects;
9169
- const onPaintRef = useRef9(onPaint);
9232
+ const onPaintRef = useRef10(onPaint);
9170
9233
  onPaintRef.current = onPaint;
9171
- const onInitRef = useRef9(onInit);
9234
+ const onInitRef = useRef10(onInit);
9172
9235
  onInitRef.current = onInit;
9173
- const initializedRef = useRef9(false);
9174
- const onInitCleanupRef = useRef9(null);
9175
- const unmountedRef = useRef9(false);
9236
+ const initializedRef = useRef10(false);
9237
+ const onInitCleanupRef = useRef10(null);
9238
+ const unmountedRef = useRef10(false);
9176
9239
  const onPaintCb = useCallback8(async () => {
9177
9240
  const element = divRef.current;
9178
9241
  if (!element) {
9179
9242
  throw new Error("Canvas or scene element not found");
9180
9243
  }
9181
- offscreenCanvas.width = width;
9182
- offscreenCanvas.height = height;
9244
+ const offscreen = offscreenRef.current;
9245
+ if (!offscreen) {
9246
+ throw new Error("HtmlInCanvas: offscreen canvas not ready (transferControlToOffscreen failed or canvas is remounting)");
9247
+ }
9248
+ offscreen.width = width;
9249
+ offscreen.height = height;
9183
9250
  try {
9184
- const layoutCanvas = canvas2dRef.current;
9185
- if (!layoutCanvas) {
9251
+ const placeholderCanvas = canvas2dRef.current;
9252
+ if (!placeholderCanvas) {
9186
9253
  throw new Error("Canvas not found");
9187
9254
  }
9188
- const layout2d = layoutCanvas.getContext("2d");
9189
- if (!layout2d) {
9190
- throw new Error("Failed to acquire 2D context for <HtmlInCanvas> layout canvas");
9255
+ const offscreen2d = offscreen.getContext("2d");
9256
+ if (!offscreen2d) {
9257
+ throw new Error("Failed to acquire 2D context for <HtmlInCanvas> offscreen canvas");
9191
9258
  }
9192
9259
  const handle = delayRender("onPaint");
9193
9260
  if (!initializedRef.current) {
9194
9261
  initializedRef.current = true;
9195
- const initImage = layoutCanvas.captureElementImage(element);
9262
+ const initImage = placeholderCanvas.captureElementImage(element);
9196
9263
  const currentOnInit = onInitRef.current;
9197
9264
  if (currentOnInit) {
9198
9265
  const cleanup = await currentOnInit({
9199
- canvas: offscreenCanvas,
9266
+ canvas: offscreen,
9200
9267
  element,
9201
9268
  elementImage: initImage
9202
9269
  });
@@ -9211,17 +9278,17 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
9211
9278
  }
9212
9279
  }
9213
9280
  const handler = onPaintRef.current ?? defaultOnPaint;
9214
- const elImage = layoutCanvas.captureElementImage(element);
9281
+ const elImage = placeholderCanvas.captureElementImage(element);
9215
9282
  await handler({
9216
- canvas: offscreenCanvas,
9283
+ canvas: offscreen,
9217
9284
  element,
9218
9285
  elementImage: elImage
9219
9286
  });
9220
9287
  await runEffectChain({
9221
9288
  state: chainState.get(width, height),
9222
- source: offscreenCanvas,
9289
+ source: offscreen,
9223
9290
  effects: effectsRef.current,
9224
- output: canvas2dRef.current,
9291
+ output: offscreen,
9225
9292
  width,
9226
9293
  height
9227
9294
  });
@@ -9229,29 +9296,30 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
9229
9296
  } catch (error2) {
9230
9297
  cancelRender2(error2);
9231
9298
  }
9232
- }, [
9233
- chainState,
9234
- continueRender2,
9235
- cancelRender2,
9236
- width,
9237
- height,
9238
- offscreenCanvas
9239
- ]);
9299
+ }, [chainState, continueRender2, cancelRender2, width, height]);
9240
9300
  useLayoutEffect3(() => {
9241
- const canvas = canvas2dRef.current;
9242
- if (!canvas) {
9301
+ const placeholder = canvas2dRef.current;
9302
+ if (!placeholder) {
9243
9303
  throw new Error("Canvas not found");
9244
9304
  }
9245
- canvas.layoutSubtree = true;
9246
- canvas.addEventListener("paint", onPaintCb);
9305
+ placeholder.layoutSubtree = true;
9306
+ const offscreen = placeholder.transferControlToOffscreen();
9307
+ offscreenRef.current = offscreen;
9308
+ offscreen.width = width;
9309
+ offscreen.height = height;
9310
+ initializedRef.current = false;
9311
+ unmountedRef.current = false;
9312
+ placeholder.addEventListener("paint", onPaintCb);
9247
9313
  return () => {
9248
- canvas.removeEventListener("paint", onPaintCb);
9314
+ placeholder.removeEventListener("paint", onPaintCb);
9315
+ offscreenRef.current = null;
9316
+ initializedRef.current = false;
9249
9317
  unmountedRef.current = true;
9250
9318
  onInitCleanupRef.current?.();
9251
9319
  onInitCleanupRef.current = null;
9252
9320
  };
9253
- }, [onPaintCb, cancelRender2]);
9254
- const onPaintChangedRef = useRef9(false);
9321
+ }, [onPaintCb, cancelRender2, width, height]);
9322
+ const onPaintChangedRef = useRef10(false);
9255
9323
  useLayoutEffect3(() => {
9256
9324
  if (!onPaintChangedRef.current) {
9257
9325
  onPaintChangedRef.current = true;
@@ -9275,8 +9343,8 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
9275
9343
  return () => {
9276
9344
  continueRender2(handle);
9277
9345
  };
9278
- }, [width, height, continueRender2]);
9279
- const innerStyle = useMemo17(() => {
9346
+ }, [width, height, continueRender2, canvasSizeKey]);
9347
+ const innerStyle = useMemo18(() => {
9280
9348
  return {
9281
9349
  width,
9282
9350
  height
@@ -9297,7 +9365,7 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
9297
9365
  style: innerStyle,
9298
9366
  children
9299
9367
  })
9300
- })
9368
+ }, canvasSizeKey)
9301
9369
  });
9302
9370
  });
9303
9371
  HtmlInCanvasContent.displayName = "HtmlInCanvasContent";
@@ -9339,7 +9407,7 @@ var HtmlInCanvasInner = forwardRef6(({
9339
9407
  });
9340
9408
  HtmlInCanvasInner.displayName = "HtmlInCanvas";
9341
9409
  var htmlInCanvasSchema = {
9342
- ...sequenceStyleSchema,
9410
+ ...sequenceVisualStyleSchema,
9343
9411
  hidden: hiddenField
9344
9412
  };
9345
9413
  var HtmlInCanvasWrapped = wrapInSchema(HtmlInCanvasInner, htmlInCanvasSchema);
@@ -9387,8 +9455,8 @@ var RenderAssetManager = createContext17({
9387
9455
  renderAssets: []
9388
9456
  });
9389
9457
  var RenderAssetManagerProvider = ({ children, collectAssets }) => {
9390
- const [renderAssets, setRenderAssets] = useState9([]);
9391
- const renderAssetsRef = useRef10([]);
9458
+ const [renderAssets, setRenderAssets] = useState8([]);
9459
+ const renderAssetsRef = useRef11([]);
9392
9460
  const registerRenderAsset = useCallback9((renderAsset) => {
9393
9461
  validateRenderAsset(renderAsset);
9394
9462
  renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
@@ -9420,7 +9488,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
9420
9488
  };
9421
9489
  }
9422
9490
  }, []);
9423
- const contextValue = useMemo18(() => {
9491
+ const contextValue = useMemo19(() => {
9424
9492
  return {
9425
9493
  registerRenderAsset,
9426
9494
  unregisterRenderAsset,
@@ -9437,7 +9505,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
9437
9505
  const { registerRenderAsset, unregisterRenderAsset } = useContext19(RenderAssetManager);
9438
9506
  const env = useRemotionEnvironment();
9439
9507
  const frame = useCurrentFrame();
9440
- const [id] = useState10(() => {
9508
+ const [id] = useState9(() => {
9441
9509
  return String(Math.random());
9442
9510
  });
9443
9511
  useLayoutEffect5(() => {
@@ -9549,14 +9617,14 @@ var Loop = ({
9549
9617
  const iteration = Math.floor(currentFrame / durationInFrames);
9550
9618
  const start = iteration * durationInFrames;
9551
9619
  const from = Math.min(start, maxFrame);
9552
- const loopDisplay = useMemo19(() => {
9620
+ const loopDisplay = useMemo20(() => {
9553
9621
  return {
9554
9622
  numberOfTimes: Math.min(compDuration / durationInFrames, times),
9555
9623
  startOffset: -from,
9556
9624
  durationInFrames
9557
9625
  };
9558
9626
  }, [compDuration, durationInFrames, from, times]);
9559
- const loopContext = useMemo19(() => {
9627
+ const loopContext = useMemo20(() => {
9560
9628
  return {
9561
9629
  iteration: Math.floor(currentFrame / durationInFrames),
9562
9630
  durationInFrames
@@ -9594,7 +9662,7 @@ var setPreloads = (updater) => {
9594
9662
  updaters.forEach((u) => u());
9595
9663
  };
9596
9664
  var PrefetchProvider = ({ children }) => {
9597
- const [_preloads, _setPreloads] = useState11(() => preloads);
9665
+ const [_preloads, _setPreloads] = useState10(() => preloads);
9598
9666
  useEffect7(() => {
9599
9667
  const updaterFunction = () => {
9600
9668
  _setPreloads(preloads);
@@ -9918,7 +9986,7 @@ var DurationsContext = createContext20({
9918
9986
  });
9919
9987
  var DurationsContextProvider = ({ children }) => {
9920
9988
  const [durations, setDurations] = useReducer(durationReducer, {});
9921
- const value = useMemo20(() => {
9989
+ const value = useMemo21(() => {
9922
9990
  return {
9923
9991
  durations,
9924
9992
  setDurations
@@ -10052,7 +10120,7 @@ var useSingletonAudioContext = ({
10052
10120
  audioEnabled
10053
10121
  }) => {
10054
10122
  const env = useRemotionEnvironment();
10055
- const context = useMemo21(() => {
10123
+ const context = useMemo22(() => {
10056
10124
  if (env.isRendering) {
10057
10125
  return null;
10058
10126
  }
@@ -10133,11 +10201,11 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
10133
10201
  latencyHint: audioLatencyHint,
10134
10202
  audioEnabled
10135
10203
  });
10136
- const audioContextIsPlayingEventually = useRef11(false);
10137
- const isResuming = useRef11(null);
10138
- const audioSyncAnchor = useMemo22(() => ({ value: 0 }), []);
10139
- const audioSyncAnchorListeners = useRef11([]);
10140
- const audioSyncAnchorEmitter = useMemo22(() => {
10204
+ const audioContextIsPlayingEventually = useRef12(false);
10205
+ const isResuming = useRef12(null);
10206
+ const audioSyncAnchor = useMemo23(() => ({ value: 0 }), []);
10207
+ const audioSyncAnchorListeners = useRef12([]);
10208
+ const audioSyncAnchorEmitter = useMemo23(() => {
10141
10209
  return {
10142
10210
  dispatch: (event) => {
10143
10211
  audioSyncAnchorListeners.current.forEach((l) => l(event));
@@ -10152,12 +10220,12 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
10152
10220
  }
10153
10221
  };
10154
10222
  }, []);
10155
- const prevEndTimes = useRef11({ scheduledEndTime: null, mediaEndTime: null });
10156
- const nodesToResume = useRef11(new Map);
10223
+ const prevEndTimes = useRef12({ scheduledEndTime: null, mediaEndTime: null });
10224
+ const nodesToResume = useRef12(new Map);
10157
10225
  const unscheduleAudioNode = useCallback10((node) => {
10158
10226
  nodesToResume.current.delete(node);
10159
10227
  }, []);
10160
- const scheduleAudioNode = useMemo22(() => {
10228
+ const scheduleAudioNode = useMemo23(() => {
10161
10229
  return ({
10162
10230
  node,
10163
10231
  mediaTimestamp,
@@ -10242,7 +10310,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
10242
10310
  audioContextIsPlayingEventually.current = false;
10243
10311
  ctxAndGain.audioContext.suspend();
10244
10312
  }, [ctxAndGain]);
10245
- const audioContextValue = useMemo22(() => {
10313
+ const audioContextValue = useMemo23(() => {
10246
10314
  return {
10247
10315
  audioContext: ctxAndGain?.audioContext ?? null,
10248
10316
  gainNode: ctxAndGain?.gainNode ?? null,
@@ -10270,8 +10338,8 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
10270
10338
  });
10271
10339
  };
10272
10340
  var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
10273
- const audios = useRef11([]);
10274
- const [initialNumberOfAudioTags] = useState12(numberOfAudioTags);
10341
+ const audios = useRef12([]);
10342
+ const [initialNumberOfAudioTags] = useState11(numberOfAudioTags);
10275
10343
  if (numberOfAudioTags !== initialNumberOfAudioTags) {
10276
10344
  throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
10277
10345
  }
@@ -10281,7 +10349,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
10281
10349
  const audioCtx = useContext21(SharedAudioContext);
10282
10350
  const audioContext = audioCtx?.audioContext ?? null;
10283
10351
  const resume = audioCtx?.resume;
10284
- const refs = useMemo22(() => {
10352
+ const refs = useMemo23(() => {
10285
10353
  return new Array(numberOfAudioTags).fill(true).map(() => {
10286
10354
  const ref = createRef2();
10287
10355
  return {
@@ -10304,7 +10372,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
10304
10372
  });
10305
10373
  };
10306
10374
  }, [refs]);
10307
- const takenAudios = useRef11(new Array(numberOfAudioTags).fill(false));
10375
+ const takenAudios = useRef12(new Array(numberOfAudioTags).fill(false));
10308
10376
  const rerenderAudios = useCallback10(() => {
10309
10377
  refs.forEach(({ ref, id }) => {
10310
10378
  const data = audios.current?.find((a) => a.id === id);
@@ -10418,7 +10486,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
10418
10486
  });
10419
10487
  resume?.();
10420
10488
  }, [logLevel, mountTime, refs, env.isPlayer, resume]);
10421
- const audioTagsValue = useMemo22(() => {
10489
+ const audioTagsValue = useMemo23(() => {
10422
10490
  return {
10423
10491
  registerAudio,
10424
10492
  unregisterAudio,
@@ -10455,7 +10523,7 @@ var useSharedAudio = ({
10455
10523
  }) => {
10456
10524
  const audioCtx = useContext21(SharedAudioContext);
10457
10525
  const tagsCtx = useContext21(SharedAudioTagsContext);
10458
- const [elem] = useState12(() => {
10526
+ const [elem] = useState11(() => {
10459
10527
  if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
10460
10528
  return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
10461
10529
  }
@@ -10591,9 +10659,9 @@ var useAppendVideoFragment = ({
10591
10659
  duration: initialDuration,
10592
10660
  fps
10593
10661
  }) => {
10594
- const actualFromRef = useRef12(initialActualFrom);
10595
- const actualDuration = useRef12(initialDuration);
10596
- const actualSrc = useRef12(initialActualSrc);
10662
+ const actualFromRef = useRef13(initialActualFrom);
10663
+ const actualDuration = useRef13(initialDuration);
10664
+ const actualSrc = useRef13(initialActualSrc);
10597
10665
  if (!isSubsetOfDuration({
10598
10666
  prevStartFrom: actualFromRef.current,
10599
10667
  newStartFrom: initialActualFrom,
@@ -10630,8 +10698,8 @@ var useVolume = ({
10630
10698
  source,
10631
10699
  shouldUseWebAudioApi
10632
10700
  }) => {
10633
- const audioStuffRef = useRef13(null);
10634
- const currentVolumeRef = useRef13(volume);
10701
+ const audioStuffRef = useRef14(null);
10702
+ const currentVolumeRef = useRef14(volume);
10635
10703
  currentVolumeRef.current = volume;
10636
10704
  const sharedAudioContext = useContext22(SharedAudioContext);
10637
10705
  if (!sharedAudioContext) {
@@ -10788,7 +10856,7 @@ var useBasicMediaInTimeline = ({
10788
10856
  throw new Error("No src passed");
10789
10857
  }
10790
10858
  const parentSequence = useContext24(SequenceContext);
10791
- const [initialVolume] = useState13(() => volume);
10859
+ const [initialVolume] = useState12(() => volume);
10792
10860
  const duration = getTimelineDuration({
10793
10861
  compositionDurationInFrames: sequenceDurationInFrames,
10794
10862
  playbackRate,
@@ -10797,7 +10865,7 @@ var useBasicMediaInTimeline = ({
10797
10865
  parentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null,
10798
10866
  loop
10799
10867
  });
10800
- const volumes = useMemo23(() => {
10868
+ const volumes = useMemo24(() => {
10801
10869
  if (typeof volume === "number") {
10802
10870
  return volume;
10803
10871
  }
@@ -10818,7 +10886,7 @@ var useBasicMediaInTimeline = ({
10818
10886
  const nonce = useNonce();
10819
10887
  const { rootId } = useTimelineContext();
10820
10888
  const startMediaFrom = 0 - mediaStartsAt + (trimBefore ?? 0);
10821
- const memoizedResult = useMemo23(() => {
10889
+ const memoizedResult = useMemo24(() => {
10822
10890
  return {
10823
10891
  volumes,
10824
10892
  duration,
@@ -10847,7 +10915,7 @@ var useImageInTimeline = ({
10847
10915
  src,
10848
10916
  displayName,
10849
10917
  id,
10850
- stack,
10918
+ getStack,
10851
10919
  showInTimeline,
10852
10920
  premountDisplay,
10853
10921
  postmountDisplay,
@@ -10894,7 +10962,7 @@ var useImageInTimeline = ({
10894
10962
  showInTimeline: true,
10895
10963
  nonce: nonce.get(),
10896
10964
  loopDisplay,
10897
- stack,
10965
+ getStack,
10898
10966
  premountDisplay,
10899
10967
  postmountDisplay,
10900
10968
  controls,
@@ -10911,7 +10979,7 @@ var useImageInTimeline = ({
10911
10979
  registerSequence,
10912
10980
  unregisterSequence,
10913
10981
  nonce,
10914
- stack,
10982
+ getStack,
10915
10983
  showInTimeline,
10916
10984
  premountDisplay,
10917
10985
  postmountDisplay,
@@ -10930,7 +10998,7 @@ var useMediaInTimeline = ({
10930
10998
  playbackRate,
10931
10999
  displayName,
10932
11000
  id,
10933
- stack,
11001
+ getStack,
10934
11002
  showInTimeline,
10935
11003
  premountDisplay,
10936
11004
  postmountDisplay,
@@ -10981,7 +11049,7 @@ var useMediaInTimeline = ({
10981
11049
  doesVolumeChange,
10982
11050
  loopDisplay,
10983
11051
  playbackRate,
10984
- stack,
11052
+ getStack,
10985
11053
  premountDisplay,
10986
11054
  postmountDisplay,
10987
11055
  controls: null,
@@ -11003,7 +11071,7 @@ var useMediaInTimeline = ({
11003
11071
  mediaType,
11004
11072
  startsAt,
11005
11073
  playbackRate,
11006
- stack,
11074
+ getStack,
11007
11075
  showInTimeline,
11008
11076
  premountDisplay,
11009
11077
  postmountDisplay,
@@ -11014,12 +11082,12 @@ var useMediaInTimeline = ({
11014
11082
  ]);
11015
11083
  };
11016
11084
  var useBufferManager = (logLevel, mountTime) => {
11017
- const [blocks, setBlocks] = useState14([]);
11018
- const [onBufferingCallbacks, setOnBufferingCallbacks] = useState14([]);
11019
- const [onResumeCallbacks, setOnResumeCallbacks] = useState14([]);
11085
+ const [blocks, setBlocks] = useState13([]);
11086
+ const [onBufferingCallbacks, setOnBufferingCallbacks] = useState13([]);
11087
+ const [onResumeCallbacks, setOnResumeCallbacks] = useState13([]);
11020
11088
  const env = useRemotionEnvironment();
11021
11089
  const rendering = env.isRendering;
11022
- const buffering = useRef14(false);
11090
+ const buffering = useRef15(false);
11023
11091
  const addBlock = useCallback11((block) => {
11024
11092
  if (rendering) {
11025
11093
  return {
@@ -11092,7 +11160,7 @@ var useBufferManager = (logLevel, mountTime) => {
11092
11160
  }
11093
11161
  }, [blocks]);
11094
11162
  }
11095
- return useMemo24(() => {
11163
+ return useMemo25(() => {
11096
11164
  return { addBlock, listenForBuffering, listenForResume, buffering };
11097
11165
  }, [addBlock, buffering, listenForBuffering, listenForResume]);
11098
11166
  };
@@ -11106,7 +11174,7 @@ var BufferingProvider = ({ children }) => {
11106
11174
  });
11107
11175
  };
11108
11176
  var useIsPlayerBuffering = (bufferManager) => {
11109
- const [isBuffering, setIsBuffering] = useState14(bufferManager.buffering.current);
11177
+ const [isBuffering, setIsBuffering] = useState13(bufferManager.buffering.current);
11110
11178
  useEffect9(() => {
11111
11179
  const onBuffer = () => {
11112
11180
  setIsBuffering(true);
@@ -11131,7 +11199,7 @@ var useBufferState = () => {
11131
11199
  const buffer = useContext26(BufferingContextReact);
11132
11200
  const logLevel = useLogLevel();
11133
11201
  const addBlock = buffer ? buffer.addBlock : null;
11134
- return useMemo25(() => ({
11202
+ return useMemo26(() => ({
11135
11203
  delayPlayback: () => {
11136
11204
  if (!addBlock) {
11137
11205
  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");
@@ -11166,7 +11234,7 @@ var useBufferUntilFirstFrame = ({
11166
11234
  logLevel,
11167
11235
  mountTime
11168
11236
  }) => {
11169
- const bufferingRef = useRef15(false);
11237
+ const bufferingRef = useRef16(false);
11170
11238
  const { delayPlayback } = useBufferState();
11171
11239
  const bufferUntilFirstFrame = useCallback12((requestedTime) => {
11172
11240
  if (mediaType !== "video") {
@@ -11239,7 +11307,7 @@ var useBufferUntilFirstFrame = ({
11239
11307
  onVariableFpsVideoDetected,
11240
11308
  pauseWhenBuffering
11241
11309
  ]);
11242
- return useMemo26(() => {
11310
+ return useMemo27(() => {
11243
11311
  return {
11244
11312
  isBuffering: () => bufferingRef.current,
11245
11313
  bufferUntilFirstFrame
@@ -11287,7 +11355,7 @@ var useMediaBuffering = ({
11287
11355
  src
11288
11356
  }) => {
11289
11357
  const buffer = useBufferState();
11290
- const [isBuffering, setIsBuffering] = useState15(false);
11358
+ const [isBuffering, setIsBuffering] = useState14(false);
11291
11359
  useEffect10(() => {
11292
11360
  let cleanupFns = [];
11293
11361
  const { current } = element;
@@ -11420,7 +11488,7 @@ var useRequestVideoCallbackTime = ({
11420
11488
  lastSeek,
11421
11489
  onVariableFpsVideoDetected
11422
11490
  }) => {
11423
- const currentTime = useRef16(null);
11491
+ const currentTime = useRef17(null);
11424
11492
  useEffect11(() => {
11425
11493
  const { current } = mediaRef;
11426
11494
  if (current) {
@@ -11677,14 +11745,14 @@ var useMediaPlayback = ({
11677
11745
  const buffering = useContext27(BufferingContextReact);
11678
11746
  const { fps } = useVideoConfig();
11679
11747
  const mediaStartsAt = useMediaStartsAt();
11680
- const lastSeekDueToShift = useRef17(null);
11681
- const lastSeek = useRef17(null);
11748
+ const lastSeekDueToShift = useRef18(null);
11749
+ const lastSeek = useRef18(null);
11682
11750
  const logLevel = useLogLevel();
11683
11751
  const mountTime = useMountTime();
11684
11752
  if (!buffering) {
11685
11753
  throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
11686
11754
  }
11687
- const isVariableFpsVideoMap = useRef17({});
11755
+ const isVariableFpsVideoMap = useRef18({});
11688
11756
  const onVariableFpsVideoDetected = useCallback13(() => {
11689
11757
  if (!src) {
11690
11758
  return;
@@ -11967,14 +12035,14 @@ var SetMediaVolumeContext = createContext22({
11967
12035
  var useMediaVolumeState = () => {
11968
12036
  const { mediaVolume } = useContext28(MediaVolumeContext);
11969
12037
  const { setMediaVolume } = useContext28(SetMediaVolumeContext);
11970
- return useMemo27(() => {
12038
+ return useMemo28(() => {
11971
12039
  return [mediaVolume, setMediaVolume];
11972
12040
  }, [mediaVolume, setMediaVolume]);
11973
12041
  };
11974
12042
  var useMediaMutedState = () => {
11975
12043
  const { mediaMuted } = useContext28(MediaVolumeContext);
11976
12044
  const { setMediaMuted } = useContext28(SetMediaVolumeContext);
11977
- return useMemo27(() => {
12045
+ return useMemo28(() => {
11978
12046
  return [mediaMuted, setMediaMuted];
11979
12047
  }, [mediaMuted, setMediaMuted]);
11980
12048
  };
@@ -11984,7 +12052,7 @@ var warnAboutTooHighVolume = (volume) => {
11984
12052
  }
11985
12053
  };
11986
12054
  var AudioForDevelopmentForwardRefFunction = (props, ref) => {
11987
- const [initialShouldPreMountAudioElements] = useState16(props.shouldPreMountAudioTags);
12055
+ const [initialShouldPreMountAudioElements] = useState15(props.shouldPreMountAudioTags);
11988
12056
  if (props.shouldPreMountAudioTags !== initialShouldPreMountAudioElements) {
11989
12057
  throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");
11990
12058
  }
@@ -12029,7 +12097,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12029
12097
  }
12030
12098
  const preloadedSrc = usePreload(src);
12031
12099
  const sequenceContext = useContext29(SequenceContext);
12032
- const [timelineId] = useState16(() => String(Math.random()));
12100
+ const [timelineId] = useState15(() => String(Math.random()));
12033
12101
  const userPreferredVolume = evaluateVolume({
12034
12102
  frame: volumePropFrame,
12035
12103
  volume,
@@ -12041,7 +12109,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12041
12109
  requestsVideoFrame: false,
12042
12110
  isClientSideRendering: false
12043
12111
  });
12044
- const propsToPass = useMemo28(() => {
12112
+ const propsToPass = useMemo29(() => {
12045
12113
  return {
12046
12114
  muted: muted || mediaMuted || userPreferredVolume <= 0,
12047
12115
  src: preloadedSrc,
@@ -12058,7 +12126,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12058
12126
  userPreferredVolume,
12059
12127
  crossOriginValue
12060
12128
  ]);
12061
- const id = useMemo28(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
12129
+ const id = useMemo29(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
12062
12130
  src,
12063
12131
  sequenceContext?.relativeFrom,
12064
12132
  sequenceContext?.cumulatedFrom,
@@ -12076,6 +12144,9 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12076
12144
  premounting: Boolean(sequenceContext?.premounting),
12077
12145
  postmounting: Boolean(sequenceContext?.postmounting)
12078
12146
  });
12147
+ const getStack = useCallback14(() => {
12148
+ return _remotionInternalStack ?? null;
12149
+ }, [_remotionInternalStack]);
12079
12150
  useMediaInTimeline({
12080
12151
  volume,
12081
12152
  mediaVolume,
@@ -12084,7 +12155,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12084
12155
  playbackRate: playbackRate ?? 1,
12085
12156
  displayName: name ?? null,
12086
12157
  id: timelineId,
12087
- stack: _remotionInternalStack,
12158
+ getStack,
12088
12159
  showInTimeline,
12089
12160
  premountDisplay: sequenceContext?.premountDisplay ?? null,
12090
12161
  postmountDisplay: sequenceContext?.postmountDisplay ?? null,
@@ -12129,7 +12200,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12129
12200
  useImperativeHandle4(ref, () => {
12130
12201
  return audioRef.current;
12131
12202
  }, [audioRef]);
12132
- const currentOnDurationCallback = useRef18(onDuration);
12203
+ const currentOnDurationCallback = useRef19(onDuration);
12133
12204
  currentOnDurationCallback.current = onDuration;
12134
12205
  useEffect14(() => {
12135
12206
  const { current } = audioRef;
@@ -12160,7 +12231,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12160
12231
  };
12161
12232
  var AudioForPreview = forwardRef7(AudioForDevelopmentForwardRefFunction);
12162
12233
  var AudioForRenderingRefForwardingFunction = (props, ref) => {
12163
- const audioRef = useRef19(null);
12234
+ const audioRef = useRef20(null);
12164
12235
  const {
12165
12236
  volume: volumeProp,
12166
12237
  playbackRate,
@@ -12186,7 +12257,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
12186
12257
  const sequenceContext = useContext30(SequenceContext);
12187
12258
  const { registerRenderAsset, unregisterRenderAsset } = useContext30(RenderAssetManager);
12188
12259
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
12189
- const id = useMemo29(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
12260
+ const id = useMemo30(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
12190
12261
  props.src,
12191
12262
  sequenceContext?.relativeFrom,
12192
12263
  sequenceContext?.cumulatedFrom,
@@ -12317,7 +12388,7 @@ var AudioRefForwardingFunction = (props, ref) => {
12317
12388
  throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
12318
12389
  }
12319
12390
  const preloadedSrc = usePreload(props.src);
12320
- const onError = useCallback14((e) => {
12391
+ const onError = useCallback15((e) => {
12321
12392
  console.log(e.currentTarget.error);
12322
12393
  const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
12323
12394
  if (loop) {
@@ -12331,7 +12402,7 @@ var AudioRefForwardingFunction = (props, ref) => {
12331
12402
  console.warn(errMessage);
12332
12403
  }
12333
12404
  }, [loop, onRemotionError, preloadedSrc]);
12334
- const onDuration = useCallback14((src, durationInSeconds) => {
12405
+ const onDuration = useCallback15((src, durationInSeconds) => {
12335
12406
  setDurations({ type: "got-duration", durationInSeconds, src });
12336
12407
  }, [setDurations]);
12337
12408
  const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
@@ -12421,15 +12492,15 @@ var IFrameRefForwarding = ({
12421
12492
  ...props2
12422
12493
  }, ref) => {
12423
12494
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
12424
- const [handle] = useState17(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
12495
+ const [handle] = useState16(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
12425
12496
  retries: delayRenderRetries ?? undefined,
12426
12497
  timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
12427
12498
  }));
12428
- const didLoad = useCallback15((e) => {
12499
+ const didLoad = useCallback16((e) => {
12429
12500
  continueRender2(handle);
12430
12501
  onLoad?.(e);
12431
12502
  }, [handle, onLoad, continueRender2]);
12432
- const didGetError = useCallback15((e) => {
12503
+ const didGetError = useCallback16((e) => {
12433
12504
  continueRender2(handle);
12434
12505
  if (onError) {
12435
12506
  onError(e);
@@ -12467,8 +12538,8 @@ var ImgContent = ({
12467
12538
  ref,
12468
12539
  ...props2
12469
12540
  }) => {
12470
- const imageRef = useRef20(null);
12471
- const errors = useRef20({});
12541
+ const imageRef = useRef21(null);
12542
+ const errors = useRef21({});
12472
12543
  const { delayPlayback } = useBufferState();
12473
12544
  const sequenceContext = useContext32(SequenceContext);
12474
12545
  const _propsValid = true;
@@ -12479,7 +12550,7 @@ var ImgContent = ({
12479
12550
  return imageRef.current;
12480
12551
  }, []);
12481
12552
  const actualSrc = usePreload(src);
12482
- const retryIn = useCallback16((timeout) => {
12553
+ const retryIn = useCallback17((timeout) => {
12483
12554
  if (!imageRef.current) {
12484
12555
  return;
12485
12556
  }
@@ -12497,7 +12568,7 @@ var ImgContent = ({
12497
12568
  }, timeout);
12498
12569
  }, []);
12499
12570
  const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
12500
- const didGetError = useCallback16((e) => {
12571
+ const didGetError = useCallback17((e) => {
12501
12572
  if (!errors.current) {
12502
12573
  return;
12503
12574
  }
@@ -12609,15 +12680,18 @@ var ImgInner = ({
12609
12680
  ...props2
12610
12681
  }) => {
12611
12682
  const sequenceContext = useContext32(SequenceContext);
12612
- const [timelineId] = useState18(() => String(Math.random()));
12683
+ const [timelineId] = useState17(() => String(Math.random()));
12613
12684
  if (!src) {
12614
12685
  throw new Error('No "src" prop was passed to <Img>.');
12615
12686
  }
12687
+ const stackRef = useRef21(null);
12688
+ stackRef.current = stack ?? null;
12689
+ const getStack = useCallback17(() => stackRef.current, []);
12616
12690
  useImageInTimeline({
12617
12691
  src,
12618
12692
  displayName: name ?? null,
12619
12693
  id: timelineId,
12620
- stack: stack ?? null,
12694
+ getStack,
12621
12695
  showInTimeline: showInTimeline ?? true,
12622
12696
  premountDisplay: sequenceContext?.premountDisplay ?? null,
12623
12697
  postmountDisplay: sequenceContext?.postmountDisplay ?? null,
@@ -12633,7 +12707,7 @@ var ImgInner = ({
12633
12707
  });
12634
12708
  };
12635
12709
  var imgSchema = {
12636
- ...sequenceStyleSchema,
12710
+ ...sequenceVisualStyleSchema,
12637
12711
  hidden: hiddenField
12638
12712
  };
12639
12713
  var Img = wrapInSchema(ImgInner, imgSchema);
@@ -12646,18 +12720,18 @@ var CompositionManagerProvider = ({
12646
12720
  initialCompositions,
12647
12721
  initialCanvasContent
12648
12722
  }) => {
12649
- const [folders, setFolders] = useState19([]);
12650
- const [canvasContent, setCanvasContent] = useState19(initialCanvasContent);
12651
- const [compositions, setCompositions] = useState19(initialCompositions);
12652
- const currentcompositionsRef = useRef21(compositions);
12653
- const updateCompositions = useCallback17((updateComps) => {
12723
+ const [folders, setFolders] = useState18([]);
12724
+ const [canvasContent, setCanvasContent] = useState18(initialCanvasContent);
12725
+ const [compositions, setCompositions] = useState18(initialCompositions);
12726
+ const currentcompositionsRef = useRef22(compositions);
12727
+ const updateCompositions = useCallback18((updateComps) => {
12654
12728
  setCompositions((comps) => {
12655
12729
  const updated = updateComps(comps);
12656
12730
  currentcompositionsRef.current = updated;
12657
12731
  return updated;
12658
12732
  });
12659
12733
  }, []);
12660
- const registerComposition = useCallback17((comp) => {
12734
+ const registerComposition = useCallback18((comp) => {
12661
12735
  updateCompositions((comps) => {
12662
12736
  if (comps.find((c2) => c2.id === comp.id)) {
12663
12737
  throw new Error(`Multiple composition with id ${comp.id} are registered.`);
@@ -12665,12 +12739,12 @@ var CompositionManagerProvider = ({
12665
12739
  return [...comps, comp];
12666
12740
  });
12667
12741
  }, [updateCompositions]);
12668
- const unregisterComposition = useCallback17((id) => {
12742
+ const unregisterComposition = useCallback18((id) => {
12669
12743
  setCompositions((comps) => {
12670
12744
  return comps.filter((c2) => c2.id !== id);
12671
12745
  });
12672
12746
  }, []);
12673
- const registerFolder = useCallback17((name, parent, nonce) => {
12747
+ const registerFolder = useCallback18((name, parent, nonce) => {
12674
12748
  setFolders((prevFolders) => {
12675
12749
  return [
12676
12750
  ...prevFolders,
@@ -12682,7 +12756,7 @@ var CompositionManagerProvider = ({
12682
12756
  ];
12683
12757
  });
12684
12758
  }, []);
12685
- const unregisterFolder = useCallback17((name, parent) => {
12759
+ const unregisterFolder = useCallback18((name, parent) => {
12686
12760
  setFolders((prevFolders) => {
12687
12761
  return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
12688
12762
  });
@@ -12692,7 +12766,7 @@ var CompositionManagerProvider = ({
12692
12766
  getCompositions: () => currentcompositionsRef.current
12693
12767
  };
12694
12768
  }, []);
12695
- const compositionManagerSetters = useMemo30(() => {
12769
+ const compositionManagerSetters = useMemo31(() => {
12696
12770
  return {
12697
12771
  registerComposition,
12698
12772
  unregisterComposition,
@@ -12708,7 +12782,7 @@ var CompositionManagerProvider = ({
12708
12782
  unregisterFolder,
12709
12783
  onlyRenderComposition
12710
12784
  ]);
12711
- const compositionManagerContextValue = useMemo30(() => {
12785
+ const compositionManagerContextValue = useMemo31(() => {
12712
12786
  return {
12713
12787
  compositions,
12714
12788
  folders,
@@ -12788,7 +12862,7 @@ var disabledEffectField = {
12788
12862
  description: "Disabled"
12789
12863
  };
12790
12864
  var createEffect = (definition) => {
12791
- const userCalculateKey = definition.calculateKey;
12865
+ const { calculateKey: userCalculateKey, validateParams } = definition;
12792
12866
  const widened = {
12793
12867
  ...definition,
12794
12868
  calculateKey: (params) => {
@@ -12800,12 +12874,15 @@ var createEffect = (definition) => {
12800
12874
  ...definition.schema
12801
12875
  }
12802
12876
  };
12803
- const factory = (params = {}) => ({
12804
- definition: widened,
12805
- params,
12806
- effectKey: widened.calculateKey(params),
12807
- memoized: false
12808
- });
12877
+ const factory = (params = {}) => {
12878
+ validateParams(params);
12879
+ return {
12880
+ definition: widened,
12881
+ params,
12882
+ effectKey: widened.calculateKey(params),
12883
+ memoized: false
12884
+ };
12885
+ };
12809
12886
  return factory;
12810
12887
  };
12811
12888
  var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
@@ -12856,7 +12933,7 @@ var MediaEnabledProvider = ({
12856
12933
  videoEnabled,
12857
12934
  audioEnabled
12858
12935
  }) => {
12859
- const value = useMemo31(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
12936
+ const value = useMemo322(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
12860
12937
  return /* @__PURE__ */ jsx28(MediaEnabledContext.Provider, {
12861
12938
  value,
12862
12939
  children
@@ -12871,13 +12948,13 @@ var RemotionRootContexts = ({
12871
12948
  audioEnabled,
12872
12949
  frameState
12873
12950
  }) => {
12874
- const nonceContext = useMemo322(() => {
12951
+ const nonceContext = useMemo33(() => {
12875
12952
  let counter = 0;
12876
12953
  return {
12877
12954
  getNonce: () => counter++
12878
12955
  };
12879
12956
  }, []);
12880
- const logging = useMemo322(() => {
12957
+ const logging = useMemo33(() => {
12881
12958
  return { logLevel, mountTime: Date.now() };
12882
12959
  }, [logLevel]);
12883
12960
  return /* @__PURE__ */ jsx29(LogLevelContext.Provider, {
@@ -13171,7 +13248,7 @@ var OffthreadVideoForRendering = ({
13171
13248
  if (!src) {
13172
13249
  throw new TypeError("No `src` was passed to <OffthreadVideo>.");
13173
13250
  }
13174
- const id = useMemo33(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
13251
+ const id = useMemo34(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
13175
13252
  src,
13176
13253
  sequenceContext?.cumulatedFrom,
13177
13254
  sequenceContext?.relativeFrom,
@@ -13226,14 +13303,14 @@ var OffthreadVideoForRendering = ({
13226
13303
  sequenceContext?.relativeFrom,
13227
13304
  audioStreamIndex
13228
13305
  ]);
13229
- const currentTime = useMemo33(() => {
13306
+ const currentTime = useMemo34(() => {
13230
13307
  return getExpectedMediaFrameUncorrected({
13231
13308
  frame,
13232
13309
  playbackRate: playbackRate || 1,
13233
13310
  startFrom: -mediaStartsAt
13234
13311
  }) / videoConfig.fps;
13235
13312
  }, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
13236
- const actualSrc = useMemo33(() => {
13313
+ const actualSrc = useMemo34(() => {
13237
13314
  return getOffthreadVideoSource({
13238
13315
  src,
13239
13316
  currentTime,
@@ -13241,7 +13318,7 @@ var OffthreadVideoForRendering = ({
13241
13318
  toneMapped
13242
13319
  });
13243
13320
  }, [toneMapped, currentTime, src, transparent]);
13244
- const [imageSrc, setImageSrc] = useState20(null);
13321
+ const [imageSrc, setImageSrc] = useState19(null);
13245
13322
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
13246
13323
  useLayoutEffect11(() => {
13247
13324
  if (!window.remotion_videoEnabled) {
@@ -13314,17 +13391,17 @@ var OffthreadVideoForRendering = ({
13314
13391
  continueRender2,
13315
13392
  delayRender2
13316
13393
  ]);
13317
- const onErr = useCallback18(() => {
13394
+ const onErr = useCallback19(() => {
13318
13395
  if (onError) {
13319
13396
  onError?.(new Error("Failed to load image with src " + imageSrc));
13320
13397
  } else {
13321
13398
  cancelRender("Failed to load image with src " + imageSrc);
13322
13399
  }
13323
13400
  }, [imageSrc, onError]);
13324
- const className = useMemo33(() => {
13401
+ const className = useMemo34(() => {
13325
13402
  return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy2).join(" ");
13326
13403
  }, [props2.className]);
13327
- const onImageFrame = useCallback18((img) => {
13404
+ const onImageFrame = useCallback19((img) => {
13328
13405
  if (onVideoFrame) {
13329
13406
  onVideoFrame(img);
13330
13407
  }
@@ -13383,8 +13460,8 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
13383
13460
  if (!context) {
13384
13461
  throw new Error("SharedAudioContext not found");
13385
13462
  }
13386
- const videoRef = useRef22(null);
13387
- const sharedSource = useMemo34(() => {
13463
+ const videoRef = useRef23(null);
13464
+ const sharedSource = useMemo35(() => {
13388
13465
  if (!context.audioContext) {
13389
13466
  return null;
13390
13467
  }
@@ -13439,7 +13516,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
13439
13516
  const parentSequence = useContext35(SequenceContext);
13440
13517
  const logLevel = useLogLevel();
13441
13518
  const mountTime = useMountTime();
13442
- const [timelineId] = useState21(() => String(Math.random()));
13519
+ const [timelineId] = useState20(() => String(Math.random()));
13443
13520
  if (typeof acceptableTimeShift !== "undefined") {
13444
13521
  throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
13445
13522
  }
@@ -13451,6 +13528,9 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
13451
13528
  mediaVolume
13452
13529
  });
13453
13530
  warnAboutTooHighVolume(userPreferredVolume);
13531
+ const getStack = useCallback20(() => {
13532
+ return _remotionInternalStack ?? null;
13533
+ }, [_remotionInternalStack]);
13454
13534
  useMediaInTimeline({
13455
13535
  volume,
13456
13536
  mediaVolume,
@@ -13459,7 +13539,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
13459
13539
  playbackRate: props2.playbackRate ?? 1,
13460
13540
  displayName: name ?? null,
13461
13541
  id: timelineId,
13462
- stack: _remotionInternalStack,
13542
+ getStack,
13463
13543
  showInTimeline,
13464
13544
  premountDisplay: parentSequence?.premountDisplay ?? null,
13465
13545
  postmountDisplay: parentSequence?.postmountDisplay ?? null,
@@ -13505,7 +13585,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
13505
13585
  useImperativeHandle8(ref, () => {
13506
13586
  return videoRef.current;
13507
13587
  }, []);
13508
- useState21(() => playbackLogging({
13588
+ useState20(() => playbackLogging({
13509
13589
  logLevel,
13510
13590
  message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
13511
13591
  tag: "video",
@@ -13551,7 +13631,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
13551
13631
  current.removeEventListener("error", errorHandler);
13552
13632
  };
13553
13633
  }, [onError, src]);
13554
- const currentOnDurationCallback = useRef22(onDuration);
13634
+ const currentOnDurationCallback = useRef23(onDuration);
13555
13635
  currentOnDurationCallback.current = onDuration;
13556
13636
  useEmitVideoFrame({ ref: videoRef, onVideoFrame });
13557
13637
  useEffect18(() => {
@@ -13582,7 +13662,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
13582
13662
  current.preload = "auto";
13583
13663
  }
13584
13664
  }, []);
13585
- const actualStyle = useMemo34(() => {
13665
+ const actualStyle = useMemo35(() => {
13586
13666
  return {
13587
13667
  ...style
13588
13668
  };
@@ -13621,7 +13701,7 @@ var InnerOffthreadVideo = (props2) => {
13621
13701
  if (environment.isClientSideRendering) {
13622
13702
  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");
13623
13703
  }
13624
- const onDuration = useCallback19(() => {
13704
+ const onDuration = useCallback21(() => {
13625
13705
  return;
13626
13706
  }, []);
13627
13707
  if (typeof props2.src !== "string") {
@@ -13777,7 +13857,7 @@ function useRemotionContexts() {
13777
13857
  const sequenceManagerContext = React36.useContext(SequenceManager);
13778
13858
  const bufferManagerContext = React36.useContext(BufferingContextReact);
13779
13859
  const logLevelContext = React36.useContext(LogLevelContext);
13780
- return useMemo35(() => ({
13860
+ return useMemo36(() => ({
13781
13861
  compositionManagerCtx,
13782
13862
  timelineContext,
13783
13863
  setTimelineContext,
@@ -13869,6 +13949,8 @@ var Internals = {
13869
13949
  wrapInSchema,
13870
13950
  sequenceSchema,
13871
13951
  sequenceStyleSchema,
13952
+ sequenceVisualStyleSchema,
13953
+ sequencePremountSchema,
13872
13954
  flattenActiveSchema,
13873
13955
  getFlatSchemaWithAllKeys,
13874
13956
  RemotionRootContexts,
@@ -13963,6 +14045,8 @@ var Internals = {
13963
14045
  useMemoizedEffects,
13964
14046
  useMemoizedEffectDefinitions,
13965
14047
  createEffect,
14048
+ createWebGLContextError,
14049
+ createWebGL2ContextError,
13966
14050
  computeEffectiveSchemaValuesDotNotation,
13967
14051
  OverrideIdsToNodePathsGettersContext,
13968
14052
  OverrideIdsToNodePathsSettersContext,
@@ -14035,7 +14119,7 @@ var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
14035
14119
  };
14036
14120
  var SeriesSequence = forwardRef12(SeriesSequenceRefForwardingFunction);
14037
14121
  var SeriesInner = (props2) => {
14038
- const childrenValue = useMemo36(() => {
14122
+ const childrenValue = useMemo37(() => {
14039
14123
  let startFrame = 0;
14040
14124
  const flattenedChildren = flattenChildren(props2.children);
14041
14125
  return Children.map(flattenedChildren, (child, i) => {
@@ -14565,7 +14649,7 @@ var VideoForRenderingForwardFunction = ({
14565
14649
  const frame = useCurrentFrame();
14566
14650
  const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
14567
14651
  const videoConfig = useUnsafeVideoConfig();
14568
- const videoRef = useRef23(null);
14652
+ const videoRef = useRef24(null);
14569
14653
  const sequenceContext = useContext36(SequenceContext);
14570
14654
  const mediaStartsAt = useMediaStartsAt();
14571
14655
  const environment = useRemotionEnvironment();
@@ -14573,7 +14657,7 @@ var VideoForRenderingForwardFunction = ({
14573
14657
  const mountTime = useMountTime();
14574
14658
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
14575
14659
  const { registerRenderAsset, unregisterRenderAsset } = useContext36(RenderAssetManager);
14576
- const id = useMemo37(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
14660
+ const id = useMemo38(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
14577
14661
  props2.src,
14578
14662
  sequenceContext?.cumulatedFrom,
14579
14663
  sequenceContext?.relativeFrom,
@@ -14790,10 +14874,10 @@ var VideoForwardingFunction = (props2, ref) => {
14790
14874
  throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
14791
14875
  }
14792
14876
  const preloadedSrc = usePreload(props2.src);
14793
- const onDuration = useCallback20((src, durationInSeconds) => {
14877
+ const onDuration = useCallback22((src, durationInSeconds) => {
14794
14878
  setDurations({ type: "got-duration", durationInSeconds, src });
14795
14879
  }, [setDurations]);
14796
- const onVideoFrame = useCallback20(() => {}, []);
14880
+ const onVideoFrame = useCallback22(() => {}, []);
14797
14881
  const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
14798
14882
  validateMediaTrimProps({ startFrom, endAt, trimBefore, trimAfter });
14799
14883
  const { trimBeforeValue, trimAfterValue } = resolveTrimProps({
@@ -14901,7 +14985,7 @@ addSequenceStackTraces(Composition);
14901
14985
  // ../design/dist/esm/index.mjs
14902
14986
  import { jsx as jsx210, Fragment as Fragment3 } from "react/jsx-runtime";
14903
14987
  import { jsx as jsx39, jsxs as jsxs3 } from "react/jsx-runtime";
14904
- import { useEffect as useEffect22, useMemo as useMemo210, useRef as useRef25 } from "react";
14988
+ import { useEffect as useEffect22, useMemo as useMemo210, useRef as useRef26 } from "react";
14905
14989
  import { jsx as jsx43 } from "react/jsx-runtime";
14906
14990
  import { jsx as jsx53, jsxs as jsxs23 } from "react/jsx-runtime";
14907
14991
  import React62 from "react";
@@ -14928,8 +15012,8 @@ import * as React16 from "react";
14928
15012
  import * as React13 from "react";
14929
15013
  import * as ReactDOM from "react-dom";
14930
15014
  import { jsx as jsx172 } from "react/jsx-runtime";
14931
- import * as React14 from "react";
14932
- import * as React152 from "react";
15015
+ import * as React142 from "react";
15016
+ import * as React15 from "react";
14933
15017
  import { jsx as jsx182 } from "react/jsx-runtime";
14934
15018
  import * as React172 from "react";
14935
15019
  import * as React18 from "react";
@@ -14953,8 +15037,8 @@ import * as React282 from "react";
14953
15037
  import { jsx as jsx232 } from "react/jsx-runtime";
14954
15038
  import * as React35 from "react";
14955
15039
  import * as React312 from "react";
14956
- import * as React292 from "react";
14957
15040
  import { useState as useState112 } from "react";
15041
+ import * as React292 from "react";
14958
15042
  import * as React30 from "react";
14959
15043
  import * as React342 from "react";
14960
15044
  import * as React332 from "react";
@@ -15155,7 +15239,7 @@ var useHoverTransforms = (ref, disabled) => {
15155
15239
  progress: 0,
15156
15240
  isActive: false
15157
15241
  });
15158
- const eventTarget = useMemo38(() => new EventTarget, []);
15242
+ const eventTarget = useMemo39(() => new EventTarget, []);
15159
15243
  useEffect20(() => {
15160
15244
  if (disabled) {
15161
15245
  eventTarget.dispatchEvent(new Event("disabled"));
@@ -15302,7 +15386,7 @@ var getAngle = (ref, coordinates) => {
15302
15386
  };
15303
15387
  var lastCoordinates = null;
15304
15388
  var useMousePosition = (ref) => {
15305
- const [angle, setAngle] = useState23(getAngle(ref.current, lastCoordinates));
15389
+ const [angle, setAngle] = useState21(getAngle(ref.current, lastCoordinates));
15306
15390
  useEffect20(() => {
15307
15391
  const element = ref.current;
15308
15392
  if (!element) {
@@ -15423,7 +15507,7 @@ var Spinner = ({ size, duration }) => {
15423
15507
  height: size
15424
15508
  };
15425
15509
  }, [size]);
15426
- const pathsRef = useRef25([]);
15510
+ const pathsRef = useRef26([]);
15427
15511
  useEffect22(() => {
15428
15512
  const animate = () => {
15429
15513
  const now = performance.now();
@@ -15469,9 +15553,9 @@ var Button = ({
15469
15553
  ...rest
15470
15554
  }) => {
15471
15555
  const [dimensions, setDimensions] = useState22(null);
15472
- const ref = useRef24(null);
15556
+ const ref = useRef25(null);
15473
15557
  const { isActive, progress } = useHoverTransforms(ref, Boolean(disabled || loading));
15474
- const onPointerEnter = useCallback22((e) => {
15558
+ const onPointerEnter = useCallback24((e) => {
15475
15559
  if (e.pointerType !== "mouse") {
15476
15560
  return;
15477
15561
  }
@@ -15508,7 +15592,7 @@ var Button = ({
15508
15592
  const isDisabled = disabled || loading;
15509
15593
  const isAnchor = !asChild && "href" in rest && rest.href !== undefined;
15510
15594
  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);
15511
- const preventInteraction = useCallback22((e) => {
15595
+ const preventInteraction = useCallback24((e) => {
15512
15596
  e.preventDefault();
15513
15597
  e.stopPropagation();
15514
15598
  }, []);
@@ -15983,15 +16067,15 @@ function dispatchDiscreteCustomEvent(target, event) {
15983
16067
  ReactDOM.flushSync(() => target.dispatchEvent(event));
15984
16068
  }
15985
16069
  function useCallbackRef(callback) {
15986
- const callbackRef = React14.useRef(callback);
15987
- React14.useEffect(() => {
16070
+ const callbackRef = React142.useRef(callback);
16071
+ React142.useEffect(() => {
15988
16072
  callbackRef.current = callback;
15989
16073
  });
15990
- return React14.useMemo(() => (...args) => callbackRef.current?.(...args), []);
16074
+ return React142.useMemo(() => (...args) => callbackRef.current?.(...args), []);
15991
16075
  }
15992
16076
  function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
15993
16077
  const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
15994
- React152.useEffect(() => {
16078
+ React15.useEffect(() => {
15995
16079
  const handleKeyDown = (event) => {
15996
16080
  if (event.key === "Escape") {
15997
16081
  onEscapeKeyDown(event);
@@ -18709,7 +18793,7 @@ var hideOthers = function(originalTarget, parentNode, markerName) {
18709
18793
  return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
18710
18794
  };
18711
18795
  var __assign = function() {
18712
- __assign = Object.assign || function __assign2(t) {
18796
+ __assign = Object.assign || function __assign(t) {
18713
18797
  for (var s, i = 1, n = arguments.length;i < n; i++) {
18714
18798
  s = arguments[i];
18715
18799
  for (var p in s)
@@ -20496,17 +20580,17 @@ function createContextScope2(scopeName, createContextScopeDeps = []) {
20496
20580
  let defaultContexts = [];
20497
20581
  function createContext32(rootComponentName, defaultContext) {
20498
20582
  const BaseContext = React382.createContext(defaultContext);
20499
- const index3 = defaultContexts.length;
20583
+ const index2 = defaultContexts.length;
20500
20584
  defaultContexts = [...defaultContexts, defaultContext];
20501
20585
  const Provider = (props) => {
20502
20586
  const { scope, children, ...context } = props;
20503
- const Context = scope?.[scopeName]?.[index3] || BaseContext;
20587
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
20504
20588
  const value = React382.useMemo(() => context, Object.values(context));
20505
20589
  return /* @__PURE__ */ jsx272(Context.Provider, { value, children });
20506
20590
  };
20507
20591
  Provider.displayName = rootComponentName + "Provider";
20508
20592
  function useContext222(consumerName, scope) {
20509
- const Context = scope?.[scopeName]?.[index3] || BaseContext;
20593
+ const Context = scope?.[scopeName]?.[index2] || BaseContext;
20510
20594
  const context = React382.useContext(Context);
20511
20595
  if (context)
20512
20596
  return context;
@@ -20703,10 +20787,10 @@ var OrderedDict = class _OrderedDict extends Map {
20703
20787
  super.set(key, value);
20704
20788
  return this;
20705
20789
  }
20706
- insert(index3, key, value) {
20790
+ insert(index2, key, value) {
20707
20791
  const has = this.has(key);
20708
20792
  const length2 = this.#keys.length;
20709
- const relativeIndex = toSafeInteger(index3);
20793
+ const relativeIndex = toSafeInteger(index2);
20710
20794
  let actualIndex = relativeIndex >= 0 ? relativeIndex : length2 + relativeIndex;
20711
20795
  const safeIndex = actualIndex < 0 || actualIndex >= length2 ? -1 : actualIndex;
20712
20796
  if (safeIndex === this.size || has && safeIndex === this.size - 1 || safeIndex === -1) {
@@ -20744,39 +20828,39 @@ var OrderedDict = class _OrderedDict extends Map {
20744
20828
  }
20745
20829
  return this;
20746
20830
  }
20747
- with(index3, key, value) {
20831
+ with(index2, key, value) {
20748
20832
  const copy = new _OrderedDict(this);
20749
- copy.insert(index3, key, value);
20833
+ copy.insert(index2, key, value);
20750
20834
  return copy;
20751
20835
  }
20752
20836
  before(key) {
20753
- const index3 = this.#keys.indexOf(key) - 1;
20754
- if (index3 < 0) {
20837
+ const index2 = this.#keys.indexOf(key) - 1;
20838
+ if (index2 < 0) {
20755
20839
  return;
20756
20840
  }
20757
- return this.entryAt(index3);
20841
+ return this.entryAt(index2);
20758
20842
  }
20759
20843
  setBefore(key, newKey, value) {
20760
- const index3 = this.#keys.indexOf(key);
20761
- if (index3 === -1) {
20844
+ const index2 = this.#keys.indexOf(key);
20845
+ if (index2 === -1) {
20762
20846
  return this;
20763
20847
  }
20764
- return this.insert(index3, newKey, value);
20848
+ return this.insert(index2, newKey, value);
20765
20849
  }
20766
20850
  after(key) {
20767
- let index3 = this.#keys.indexOf(key);
20768
- index3 = index3 === -1 || index3 === this.size - 1 ? -1 : index3 + 1;
20769
- if (index3 === -1) {
20851
+ let index2 = this.#keys.indexOf(key);
20852
+ index2 = index2 === -1 || index2 === this.size - 1 ? -1 : index2 + 1;
20853
+ if (index2 === -1) {
20770
20854
  return;
20771
20855
  }
20772
- return this.entryAt(index3);
20856
+ return this.entryAt(index2);
20773
20857
  }
20774
20858
  setAfter(key, newKey, value) {
20775
- const index3 = this.#keys.indexOf(key);
20776
- if (index3 === -1) {
20859
+ const index2 = this.#keys.indexOf(key);
20860
+ if (index2 === -1) {
20777
20861
  return this;
20778
20862
  }
20779
- return this.insert(index3 + 1, newKey, value);
20863
+ return this.insert(index2 + 1, newKey, value);
20780
20864
  }
20781
20865
  first() {
20782
20866
  return this.entryAt(0);
@@ -20795,21 +20879,21 @@ var OrderedDict = class _OrderedDict extends Map {
20795
20879
  }
20796
20880
  return deleted;
20797
20881
  }
20798
- deleteAt(index3) {
20799
- const key = this.keyAt(index3);
20882
+ deleteAt(index2) {
20883
+ const key = this.keyAt(index2);
20800
20884
  if (key !== undefined) {
20801
20885
  return this.delete(key);
20802
20886
  }
20803
20887
  return false;
20804
20888
  }
20805
- at(index3) {
20806
- const key = at(this.#keys, index3);
20889
+ at(index2) {
20890
+ const key = at(this.#keys, index2);
20807
20891
  if (key !== undefined) {
20808
20892
  return this.get(key);
20809
20893
  }
20810
20894
  }
20811
- entryAt(index3) {
20812
- const key = at(this.#keys, index3);
20895
+ entryAt(index2) {
20896
+ const key = at(this.#keys, index2);
20813
20897
  if (key !== undefined) {
20814
20898
  return [key, this.get(key)];
20815
20899
  }
@@ -20817,15 +20901,15 @@ var OrderedDict = class _OrderedDict extends Map {
20817
20901
  indexOf(key) {
20818
20902
  return this.#keys.indexOf(key);
20819
20903
  }
20820
- keyAt(index3) {
20821
- return at(this.#keys, index3);
20904
+ keyAt(index2) {
20905
+ return at(this.#keys, index2);
20822
20906
  }
20823
20907
  from(key, offset4) {
20824
- const index3 = this.indexOf(key);
20825
- if (index3 === -1) {
20908
+ const index2 = this.indexOf(key);
20909
+ if (index2 === -1) {
20826
20910
  return;
20827
20911
  }
20828
- let dest = index3 + offset4;
20912
+ let dest = index2 + offset4;
20829
20913
  if (dest < 0)
20830
20914
  dest = 0;
20831
20915
  if (dest >= this.size)
@@ -20833,11 +20917,11 @@ var OrderedDict = class _OrderedDict extends Map {
20833
20917
  return this.at(dest);
20834
20918
  }
20835
20919
  keyFrom(key, offset4) {
20836
- const index3 = this.indexOf(key);
20837
- if (index3 === -1) {
20920
+ const index2 = this.indexOf(key);
20921
+ if (index2 === -1) {
20838
20922
  return;
20839
20923
  }
20840
- let dest = index3 + offset4;
20924
+ let dest = index2 + offset4;
20841
20925
  if (dest < 0)
20842
20926
  dest = 0;
20843
20927
  if (dest >= this.size)
@@ -20845,68 +20929,68 @@ var OrderedDict = class _OrderedDict extends Map {
20845
20929
  return this.keyAt(dest);
20846
20930
  }
20847
20931
  find(predicate, thisArg) {
20848
- let index3 = 0;
20932
+ let index2 = 0;
20849
20933
  for (const entry of this) {
20850
- if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
20934
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
20851
20935
  return entry;
20852
20936
  }
20853
- index3++;
20937
+ index2++;
20854
20938
  }
20855
20939
  return;
20856
20940
  }
20857
20941
  findIndex(predicate, thisArg) {
20858
- let index3 = 0;
20942
+ let index2 = 0;
20859
20943
  for (const entry of this) {
20860
- if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
20861
- return index3;
20944
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
20945
+ return index2;
20862
20946
  }
20863
- index3++;
20947
+ index2++;
20864
20948
  }
20865
20949
  return -1;
20866
20950
  }
20867
20951
  filter(predicate, thisArg) {
20868
20952
  const entries = [];
20869
- let index3 = 0;
20953
+ let index2 = 0;
20870
20954
  for (const entry of this) {
20871
- if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
20955
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
20872
20956
  entries.push(entry);
20873
20957
  }
20874
- index3++;
20958
+ index2++;
20875
20959
  }
20876
20960
  return new _OrderedDict(entries);
20877
20961
  }
20878
20962
  map(callbackfn, thisArg) {
20879
20963
  const entries = [];
20880
- let index3 = 0;
20964
+ let index2 = 0;
20881
20965
  for (const entry of this) {
20882
- entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index3, this])]);
20883
- index3++;
20966
+ entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index2, this])]);
20967
+ index2++;
20884
20968
  }
20885
20969
  return new _OrderedDict(entries);
20886
20970
  }
20887
20971
  reduce(...args) {
20888
20972
  const [callbackfn, initialValue] = args;
20889
- let index3 = 0;
20973
+ let index2 = 0;
20890
20974
  let accumulator = initialValue ?? this.at(0);
20891
20975
  for (const entry of this) {
20892
- if (index3 === 0 && args.length === 1) {
20976
+ if (index2 === 0 && args.length === 1) {
20893
20977
  accumulator = entry;
20894
20978
  } else {
20895
- accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index3, this]);
20979
+ accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index2, this]);
20896
20980
  }
20897
- index3++;
20981
+ index2++;
20898
20982
  }
20899
20983
  return accumulator;
20900
20984
  }
20901
20985
  reduceRight(...args) {
20902
20986
  const [callbackfn, initialValue] = args;
20903
20987
  let accumulator = initialValue ?? this.at(-1);
20904
- for (let index3 = this.size - 1;index3 >= 0; index3--) {
20905
- const entry = this.at(index3);
20906
- if (index3 === this.size - 1 && args.length === 1) {
20988
+ for (let index2 = this.size - 1;index2 >= 0; index2--) {
20989
+ const entry = this.at(index2);
20990
+ if (index2 === this.size - 1 && args.length === 1) {
20907
20991
  accumulator = entry;
20908
20992
  } else {
20909
- accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index3, this]);
20993
+ accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index2, this]);
20910
20994
  }
20911
20995
  }
20912
20996
  return accumulator;
@@ -20917,8 +21001,8 @@ var OrderedDict = class _OrderedDict extends Map {
20917
21001
  }
20918
21002
  toReversed() {
20919
21003
  const reversed = new _OrderedDict;
20920
- for (let index3 = this.size - 1;index3 >= 0; index3--) {
20921
- const key = this.keyAt(index3);
21004
+ for (let index2 = this.size - 1;index2 >= 0; index2--) {
21005
+ const key = this.keyAt(index2);
20922
21006
  const element = this.get(key);
20923
21007
  reversed.set(key, element);
20924
21008
  }
@@ -20941,44 +21025,44 @@ var OrderedDict = class _OrderedDict extends Map {
20941
21025
  if (end !== undefined && end > 0) {
20942
21026
  stop = end - 1;
20943
21027
  }
20944
- for (let index3 = start;index3 <= stop; index3++) {
20945
- const key = this.keyAt(index3);
21028
+ for (let index2 = start;index2 <= stop; index2++) {
21029
+ const key = this.keyAt(index2);
20946
21030
  const element = this.get(key);
20947
21031
  result.set(key, element);
20948
21032
  }
20949
21033
  return result;
20950
21034
  }
20951
21035
  every(predicate, thisArg) {
20952
- let index3 = 0;
21036
+ let index2 = 0;
20953
21037
  for (const entry of this) {
20954
- if (!Reflect.apply(predicate, thisArg, [entry, index3, this])) {
21038
+ if (!Reflect.apply(predicate, thisArg, [entry, index2, this])) {
20955
21039
  return false;
20956
21040
  }
20957
- index3++;
21041
+ index2++;
20958
21042
  }
20959
21043
  return true;
20960
21044
  }
20961
21045
  some(predicate, thisArg) {
20962
- let index3 = 0;
21046
+ let index2 = 0;
20963
21047
  for (const entry of this) {
20964
- if (Reflect.apply(predicate, thisArg, [entry, index3, this])) {
21048
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
20965
21049
  return true;
20966
21050
  }
20967
- index3++;
21051
+ index2++;
20968
21052
  }
20969
21053
  return false;
20970
21054
  }
20971
21055
  };
20972
- function at(array, index3) {
21056
+ function at(array, index2) {
20973
21057
  if ("at" in Array.prototype) {
20974
- return Array.prototype.at.call(array, index3);
21058
+ return Array.prototype.at.call(array, index2);
20975
21059
  }
20976
- const actualIndex = toSafeIndex(array, index3);
21060
+ const actualIndex = toSafeIndex(array, index2);
20977
21061
  return actualIndex === -1 ? undefined : array[actualIndex];
20978
21062
  }
20979
- function toSafeIndex(array, index3) {
21063
+ function toSafeIndex(array, index2) {
20980
21064
  const length2 = array.length;
20981
- const relativeIndex = toSafeInteger(index3);
21065
+ const relativeIndex = toSafeInteger(index2);
20982
21066
  const actualIndex = relativeIndex >= 0 ? relativeIndex : length2 + relativeIndex;
20983
21067
  return actualIndex < 0 || actualIndex >= length2 ? -1 : actualIndex;
20984
21068
  }
@@ -21030,7 +21114,7 @@ var Primitive2 = NODES2.reduce((primitive, node) => {
21030
21114
  Node2.displayName = `Primitive.${node}`;
21031
21115
  return { ...primitive, [node]: Node2 };
21032
21116
  }, {});
21033
- function useCallbackRef4(callback) {
21117
+ function useCallbackRef3(callback) {
21034
21118
  const callbackRef = React44.useRef(callback);
21035
21119
  React44.useEffect(() => {
21036
21120
  callbackRef.current = callback;
@@ -21134,7 +21218,7 @@ var RovingFocusGroupImpl = React47.forwardRef((props, forwardedRef) => {
21134
21218
  caller: GROUP_NAME2
21135
21219
  });
21136
21220
  const [isTabbingBackOut, setIsTabbingBackOut] = React47.useState(false);
21137
- const handleEntryFocus = useCallbackRef4(onEntryFocus);
21221
+ const handleEntryFocus = useCallbackRef3(onEntryFocus);
21138
21222
  const getItems = useCollection2(__scopeRovingFocusGroup);
21139
21223
  const isClickFocusRef = React47.useRef(false);
21140
21224
  const [focusableItemsCount, setFocusableItemsCount] = React47.useState(0);
@@ -21287,7 +21371,7 @@ function focusFirst2(candidates, preventScroll = false) {
21287
21371
  }
21288
21372
  }
21289
21373
  function wrapArray2(array, startIndex) {
21290
- return array.map((_, index3) => array[(startIndex + index3) % array.length]);
21374
+ return array.map((_, index2) => array[(startIndex + index2) % array.length]);
21291
21375
  }
21292
21376
  var Root3 = RovingFocusGroup;
21293
21377
  var Item2 = RovingFocusGroupItem;
@@ -21602,10 +21686,10 @@ var Triangle2 = (props) => {
21602
21686
  };
21603
21687
 
21604
21688
  // src/components/design.tsx
21605
- import { useCallback as useCallback33, useState as useState41 } from "react";
21689
+ import { useCallback as useCallback35, useState as useState39 } from "react";
21606
21690
 
21607
21691
  // src/components/ManageTeamMembers.tsx
21608
- import React53, { useCallback as useCallback32, useState as useState40 } from "react";
21692
+ import React53, { useCallback as useCallback34, useState as useState38 } from "react";
21609
21693
  import { jsx as jsx40, jsxs as jsxs6, Fragment as Fragment9 } from "react/jsx-runtime";
21610
21694
  function generateId() {
21611
21695
  return Math.random().toString(36).substr(2, 9);
@@ -21649,9 +21733,9 @@ var Row = ({ value, onChange, onDelete, disableDelete }) => {
21649
21733
  });
21650
21734
  };
21651
21735
  var ManageTeamMembers = () => {
21652
- const [members, setMembers] = useState40(initialMembers);
21736
+ const [members, setMembers] = useState38(initialMembers);
21653
21737
  const displayedMembers = [...members, { id: "NEW", name: "" }];
21654
- const updateMember = useCallback32((idx, value) => {
21738
+ const updateMember = useCallback34((idx, value) => {
21655
21739
  if (idx === members.length) {
21656
21740
  if (value.trim() !== "") {
21657
21741
  setMembers((prev) => [...prev, { id: generateId(), name: value }]);
@@ -21660,11 +21744,11 @@ var ManageTeamMembers = () => {
21660
21744
  setMembers((prev) => prev.map((m, i) => i === idx ? { ...m, name: value } : m));
21661
21745
  }
21662
21746
  }, [members.length]);
21663
- const deleteMember = useCallback32((idx) => {
21747
+ const deleteMember = useCallback34((idx) => {
21664
21748
  setMembers((prev) => prev.filter((_, i) => i !== idx));
21665
21749
  }, []);
21666
- const [loading, setLoading] = useState40(false);
21667
- const save = useCallback32(() => {
21750
+ const [loading, setLoading] = useState38(false);
21751
+ const save = useCallback34(() => {
21668
21752
  setLoading(true);
21669
21753
  setTimeout(() => {
21670
21754
  setLoading(false);
@@ -21719,24 +21803,24 @@ var Explainer = ({ children }) => {
21719
21803
  });
21720
21804
  };
21721
21805
  var DesignPage = () => {
21722
- const [count4, setCount] = useState41(10);
21723
- const [active, setActive] = useState41(false);
21724
- const [submitButtonActive, setSubmitButtonActive] = useState41(true);
21725
- const [submitButtonPrimaryActive, setSubmitButtonPrimaryActive] = useState41(true);
21726
- const onClick = useCallback33(() => {
21806
+ const [count4, setCount] = useState39(10);
21807
+ const [active, setActive] = useState39(false);
21808
+ const [submitButtonActive, setSubmitButtonActive] = useState39(true);
21809
+ const [submitButtonPrimaryActive, setSubmitButtonPrimaryActive] = useState39(true);
21810
+ const onClick = useCallback35(() => {
21727
21811
  setSubmitButtonActive(false);
21728
21812
  setTimeout(() => {
21729
21813
  setSubmitButtonActive(true);
21730
21814
  }, 1000);
21731
21815
  }, []);
21732
- const onClickPrimary = useCallback33(() => {
21816
+ const onClickPrimary = useCallback35(() => {
21733
21817
  setSubmitButtonPrimaryActive(false);
21734
21818
  setTimeout(() => {
21735
21819
  setSubmitButtonPrimaryActive(true);
21736
21820
  }, 1000);
21737
21821
  }, []);
21738
- const [saving, setSaving] = useState41(false);
21739
- const save = useCallback33(() => {
21822
+ const [saving, setSaving] = useState39(false);
21823
+ const save = useCallback35(() => {
21740
21824
  setSaving(true);
21741
21825
  setTimeout(() => {
21742
21826
  setSaving(false);