@remotion/promo-pages 4.0.502 → 4.0.503

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/Homepage.js +1207 -1160
  2. package/dist/components/Homepage.js +15 -2
  3. package/dist/components/homepage/CanvasSectionTitle.d.ts +4 -0
  4. package/dist/components/homepage/CanvasSectionTitle.js +14 -0
  5. package/dist/components/homepage/ChooseTemplate.d.ts +2 -0
  6. package/dist/components/homepage/ChooseTemplate.js +25 -0
  7. package/dist/components/homepage/CommunityStatsItems.js +1 -1
  8. package/dist/components/homepage/Demo/index.js +1 -1
  9. package/dist/components/homepage/EditorStarterSection.d.ts +3 -0
  10. package/dist/components/homepage/EditorStarterSection.js +8 -0
  11. package/dist/components/homepage/FreePricing.js +2 -2
  12. package/dist/components/homepage/GitHubButton.js +1 -1
  13. package/dist/components/homepage/MakeVideosAgentically.js +4 -2
  14. package/dist/components/homepage/MakeVideosInteractively.js +4 -2
  15. package/dist/components/homepage/MakeVideosProgrammatically.js +3 -1
  16. package/dist/components/homepage/MoreTemplatesButton.d.ts +2 -0
  17. package/dist/components/homepage/MoreTemplatesButton.js +11 -0
  18. package/dist/components/homepage/PricingBulletPoint.js +4 -1
  19. package/dist/components/homepage/use-transparent-video-source.d.ts +4 -0
  20. package/dist/components/homepage/use-transparent-video-source.js +9 -0
  21. package/dist/design.js +3988 -3988
  22. package/dist/experts.js +3949 -3949
  23. package/dist/homepage/Pricing.js +3988 -3988
  24. package/dist/prompts/PromptsGallery.js +3988 -3988
  25. package/dist/prompts/PromptsShow.js +3604 -3604
  26. package/dist/prompts/PromptsSubmit.css +2578 -0
  27. package/dist/prompts/PromptsSubmit.js +3988 -3988
  28. package/dist/team.js +3988 -3988
  29. package/dist/template-modal-content.js +3988 -3988
  30. package/dist/templates.js +3988 -3989
  31. package/package.json +13 -13
package/dist/Homepage.js CHANGED
@@ -915,7 +915,7 @@ import { useMemo as useMemo42 } from "react";
915
915
 
916
916
  // ../core/dist/esm/index.mjs
917
917
  import { createContext } from "react";
918
- import { Suspense, useCallback as useCallback7, useContext as useContext18, useEffect as useEffect3 } from "react";
918
+ import { Suspense, useCallback as useCallback4, useContext as useContext9, useEffect as useEffect2 } from "react";
919
919
  import { createPortal } from "react-dom";
920
920
  import { createContext as createContext2 } from "react";
921
921
  import { jsx as jsx2 } from "react/jsx-runtime";
@@ -927,56 +927,56 @@ import { createContext as createContext5, useCallback, useContext, useMemo, useR
927
927
  import { jsx as jsx22 } from "react/jsx-runtime";
928
928
  import { createContext as createContext7, useContext as useContext3 } from "react";
929
929
  import { jsx as jsx3 } from "react/jsx-runtime";
930
- import { useCallback as useCallback6, useRef as useRef6 } from "react";
931
930
  import { forwardRef, useMemo as useMemo3 } from "react";
932
931
  import { jsx as jsx4 } from "react/jsx-runtime";
933
- import React4 from "react";
932
+ import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
933
+ import { createContext as createContext9, createRef, useContext as useContext5, useMemo as useMemo5 } from "react";
934
+ import React4, { createContext as createContext8, useCallback as useCallback2, useMemo as useMemo4 } from "react";
935
+ import { jsx as jsx6 } from "react/jsx-runtime";
936
+ import { useContext as useContext4, useState } from "react";
937
+ import React5 from "react";
938
+ import { createContext as createContext11, useCallback as useCallback3, useContext as useContext7 } from "react";
939
+ import { createContext as createContext10 } from "react";
940
+ import * as React6 from "react";
941
+ import React7, { useMemo as useMemo6, useRef as useRef2 } from "react";
942
+ import { useContext as useContext8, useMemo as useMemo7 } from "react";
943
+ import { jsx as jsx7 } from "react/jsx-runtime";
944
+ import React9 from "react";
934
945
  import {
935
946
  forwardRef as forwardRef3,
936
- useCallback as useCallback5,
937
- useContext as useContext17,
938
- useEffect as useEffect2,
939
- useMemo as useMemo14,
940
- useRef as useRef5,
947
+ useCallback as useCallback6,
948
+ useContext as useContext18,
949
+ useEffect as useEffect3,
950
+ useMemo as useMemo15,
951
+ useRef as useRef6,
941
952
  useState as useState5
942
953
  } from "react";
943
- import { useContext as useContext13, useMemo as useMemo10 } from "react";
944
- import { createContext as createContext8 } from "react";
945
- import { useContext as useContext9, useMemo as useMemo8 } from "react";
954
+ import { useContext as useContext14, useMemo as useMemo11 } from "react";
955
+ import { createContext as createContext12 } from "react";
956
+ import { useContext as useContext10, useMemo as useMemo9 } from "react";
946
957
  import {
947
- createContext as createContext11,
958
+ createContext as createContext13,
948
959
  useLayoutEffect,
949
- useMemo as useMemo4,
950
- useRef as useRef2,
960
+ useMemo as useMemo8,
961
+ useRef as useRef3,
951
962
  useState as useState2
952
963
  } from "react";
953
- import { createContext as createContext10, useCallback as useCallback2, useContext as useContext6 } from "react";
954
- import { createContext as createContext9 } from "react";
955
- import * as React5 from "react";
956
- import { useContext as useContext5, useState } from "react";
957
- import React6 from "react";
958
- import { jsx as jsx5 } from "react/jsx-runtime";
959
- import { useContext as useContext8, useMemo as useMemo7 } from "react";
960
- import { createContext as createContext13, createRef, useContext as useContext7, useMemo as useMemo6 } from "react";
961
- import React8, { createContext as createContext12, useCallback as useCallback3, useMemo as useMemo5 } from "react";
962
- import { jsx as jsx6 } from "react/jsx-runtime";
963
- import { useContext as useContext10 } from "react";
964
- import { useContext as useContext12 } from "react";
965
- import { useContext as useContext11, useMemo as useMemo9 } from "react";
966
- import { jsx as jsx7 } from "react/jsx-runtime";
967
- import React10, { useCallback as useCallback4, useMemo as useMemo11, useRef as useRef3, useState as useState3 } from "react";
968
964
  import { jsx as jsx8 } from "react/jsx-runtime";
969
- import React11, { createContext as createContext14 } from "react";
965
+ import { useContext as useContext11 } from "react";
966
+ import { useContext as useContext13 } from "react";
967
+ import { useContext as useContext12, useMemo as useMemo10 } from "react";
970
968
  import { jsx as jsx9 } from "react/jsx-runtime";
971
- import { useContext as useContext14, useMemo as useMemo12 } from "react";
972
- import { createContext as createContext15 } from "react";
973
- import React12, { forwardRef as forwardRef2, useContext as useContext16, useMemo as useMemo13, useState as useState4 } from "react";
974
- import { useContext as useContext15, useRef as useRef4 } from "react";
975
- import { createContext as createContext16 } from "react";
969
+ import React12, { useCallback as useCallback5, useMemo as useMemo12, useRef as useRef4, useState as useState3 } from "react";
976
970
  import { jsx as jsx10 } from "react/jsx-runtime";
971
+ import React13, { createContext as createContext14 } from "react";
977
972
  import { jsx as jsx11 } from "react/jsx-runtime";
978
- import { jsx as jsx12, jsxs as jsxs2 } from "react/jsx-runtime";
979
- import React15, { useMemo as useMemo15, useRef as useRef7 } from "react";
973
+ import { useContext as useContext15, useMemo as useMemo13 } from "react";
974
+ import { createContext as createContext15 } from "react";
975
+ import React14, { forwardRef as forwardRef2, useContext as useContext17, useMemo as useMemo14, useState as useState4 } from "react";
976
+ import { useContext as useContext16, useRef as useRef5 } from "react";
977
+ import { createContext as createContext16 } from "react";
978
+ import { jsx as jsx12 } from "react/jsx-runtime";
979
+ import { useCallback as useCallback7, useRef as useRef7 } from "react";
980
980
  import { jsx as jsx13 } from "react/jsx-runtime";
981
981
  import {
982
982
  forwardRef as forwardRef4,
@@ -1581,448 +1581,306 @@ var AbsoluteFillElementRefForwarding = (props, ref) => {
1581
1581
  });
1582
1582
  };
1583
1583
  var AbsoluteFillElement = forwardRef(AbsoluteFillElementRefForwarding);
1584
- var componentsToAddStacksTo = [];
1585
- var sequenceComponent = null;
1586
- var stacksByControls = new WeakMap;
1587
- var REMOTION_INTERNAL_STACK_PROP = "_remotionInternalStack";
1588
- var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
1589
- var addSequenceStackTraces = (component) => {
1590
- componentsToAddStacksTo.push(component);
1584
+ var rotate = {
1585
+ transform: `rotate(90deg)`
1591
1586
  };
1592
- var setSequenceComponent = (component) => {
1593
- sequenceComponent = component;
1587
+ var ICON_SIZE = 40;
1588
+ var label = {
1589
+ color: "white",
1590
+ fontSize: 14,
1591
+ fontFamily: "sans-serif"
1594
1592
  };
1595
- var getSequenceComponent = () => sequenceComponent;
1596
- var setStackForControls = (controls, stack) => {
1597
- if (stack === undefined) {
1598
- stacksByControls.delete(controls);
1599
- return;
1600
- }
1601
- stacksByControls.set(controls, stack);
1593
+ var container = {
1594
+ justifyContent: "center",
1595
+ alignItems: "center"
1602
1596
  };
1603
- var getStackForControls = (controls) => {
1604
- return stacksByControls.get(controls) ?? null;
1597
+ var Loading = () => {
1598
+ return /* @__PURE__ */ jsxs2(AbsoluteFillElement, {
1599
+ style: container,
1600
+ id: "remotion-comp-loading",
1601
+ children: [
1602
+ /* @__PURE__ */ jsx5("style", {
1603
+ type: "text/css",
1604
+ children: `
1605
+ @keyframes anim {
1606
+ from {
1607
+ opacity: 0
1608
+ }
1609
+ to {
1610
+ opacity: 1
1611
+ }
1612
+ }
1613
+ #remotion-comp-loading {
1614
+ animation: anim 2s;
1615
+ animation-fill-mode: forwards;
1616
+ }
1617
+ `
1618
+ }),
1619
+ /* @__PURE__ */ jsx5("svg", {
1620
+ width: ICON_SIZE,
1621
+ height: ICON_SIZE,
1622
+ viewBox: "-100 -100 400 400",
1623
+ style: rotate,
1624
+ children: /* @__PURE__ */ jsx5("path", {
1625
+ fill: "#555",
1626
+ stroke: "#555",
1627
+ strokeWidth: "100",
1628
+ strokeLinejoin: "round",
1629
+ d: "M 2 172 a 196 100 0 0 0 195 5 A 196 240 0 0 0 100 2.259 A 196 240 0 0 0 2 172 z"
1630
+ })
1631
+ }),
1632
+ /* @__PURE__ */ jsxs2("p", {
1633
+ style: label,
1634
+ children: [
1635
+ "Resolving ",
1636
+ "<Suspense>",
1637
+ "..."
1638
+ ]
1639
+ })
1640
+ ]
1641
+ });
1605
1642
  };
1606
- var getSingleChildComponent = (children) => {
1607
- const mountedChildren = React4.Children.toArray(children);
1608
- if (mountedChildren.length !== 1) {
1609
- return null;
1643
+ var _portalNode = null;
1644
+ var portalNode = () => {
1645
+ if (!_portalNode) {
1646
+ if (typeof document === "undefined") {
1647
+ throw new Error("Tried to call an API that only works in the browser from outside the browser");
1648
+ }
1649
+ _portalNode = document.createElement("div");
1650
+ _portalNode.style.position = "absolute";
1651
+ _portalNode.style.top = "0px";
1652
+ _portalNode.style.left = "0px";
1653
+ _portalNode.style.right = "0px";
1654
+ _portalNode.style.bottom = "0px";
1655
+ _portalNode.style.width = "100%";
1656
+ _portalNode.style.height = "100%";
1657
+ _portalNode.style.display = "flex";
1658
+ _portalNode.style.flexDirection = "column";
1659
+ const containerNode = document.createElement("div");
1660
+ containerNode.style.position = "fixed";
1661
+ containerNode.style.top = -999999 + "px";
1662
+ containerNode.appendChild(_portalNode);
1663
+ document.body.appendChild(containerNode);
1610
1664
  }
1611
- const child = mountedChildren[0];
1612
- if (!React4.isValidElement(child)) {
1665
+ return _portalNode;
1666
+ };
1667
+ var getKey = () => {
1668
+ return `remotion_inputPropsOverride` + window.location.origin;
1669
+ };
1670
+ var getInputPropsOverride = () => {
1671
+ if (typeof localStorage === "undefined")
1613
1672
  return null;
1614
- }
1615
- if (typeof child.type !== "function" && typeof child.type !== "object") {
1673
+ const override = localStorage.getItem(getKey());
1674
+ if (!override)
1616
1675
  return null;
1617
- }
1618
- return child.type;
1676
+ return JSON.parse(override);
1619
1677
  };
1620
- var captionsSchema = {
1621
- captions: {
1622
- type: "remotion-captions",
1623
- default: undefined,
1624
- description: "Captions",
1625
- keyframable: false
1678
+ var setInputPropsOverride = (override) => {
1679
+ if (typeof localStorage === "undefined")
1680
+ return;
1681
+ if (override === null) {
1682
+ localStorage.removeItem(getKey());
1683
+ return;
1626
1684
  }
1685
+ localStorage.setItem(getKey(), JSON.stringify(override));
1627
1686
  };
1628
- var transformSchema = {
1629
- "style.transformOrigin": {
1630
- type: "transform-origin",
1631
- step: 1,
1632
- default: "50% 50%",
1633
- description: "Transform origin"
1634
- },
1635
- "style.translate": {
1636
- type: "translate",
1637
- step: 1,
1638
- default: "0px 0px",
1639
- description: "Offset"
1640
- },
1641
- "style.scale": {
1642
- type: "scale",
1643
- max: 100,
1644
- step: 0.01,
1645
- default: 1,
1646
- description: "Scale",
1647
- defaultKeyframeOutput: "perceptual-scale"
1648
- },
1649
- "style.rotate": {
1650
- type: "rotation-css",
1651
- step: 1,
1652
- default: "0deg",
1653
- description: "Rotation"
1654
- },
1655
- "style.opacity": {
1656
- type: "number",
1657
- min: 0,
1658
- max: 1,
1659
- step: 0.01,
1660
- default: 1,
1661
- description: "Opacity",
1662
- hiddenFromList: false
1687
+ var didWarnSSRImport = false;
1688
+ var warnOnceSSRImport = () => {
1689
+ if (didWarnSSRImport) {
1690
+ return;
1663
1691
  }
1692
+ didWarnSSRImport = true;
1693
+ console.warn("Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object.");
1694
+ console.warn("To hide this warning, don't call this function on the server:");
1695
+ console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
1664
1696
  };
1665
- var sequenceVisualStyleSchema = transformSchema;
1666
- var textSchema = {
1667
- "style.color": {
1668
- type: "color",
1669
- default: undefined,
1670
- description: "Color"
1671
- },
1672
- "style.fontFamily": {
1673
- type: "font-family",
1674
- default: undefined,
1675
- description: "Font family",
1676
- keyframable: false
1677
- },
1678
- "style.fontSize": {
1679
- type: "number",
1680
- default: undefined,
1681
- min: 0,
1682
- step: 1,
1683
- description: "Font size",
1684
- hiddenFromList: false
1685
- },
1686
- "style.lineHeight": {
1687
- type: "number",
1688
- default: undefined,
1689
- min: 0,
1690
- step: 0.05,
1691
- description: "Line height",
1692
- hiddenFromList: false
1693
- },
1694
- "style.fontWeight": {
1695
- type: "enum",
1696
- default: "400",
1697
- description: "Font weight",
1698
- variants: {
1699
- "100": {},
1700
- "200": {},
1701
- "300": {},
1702
- "400": {},
1703
- "500": {},
1704
- "600": {},
1705
- "700": {},
1706
- "800": {},
1707
- "900": {},
1708
- normal: {},
1709
- bold: {}
1710
- }
1711
- },
1712
- "style.fontStyle": {
1713
- type: "enum",
1714
- default: "normal",
1715
- description: "Font style",
1716
- variants: {
1717
- normal: {},
1718
- italic: {},
1719
- oblique: {}
1720
- }
1721
- },
1722
- "style.textAlign": {
1723
- type: "enum",
1724
- default: "left",
1725
- description: "Text align",
1726
- variants: {
1727
- left: {},
1728
- center: {},
1729
- right: {},
1730
- justify: {},
1731
- start: {},
1732
- end: {}
1733
- }
1734
- },
1735
- "style.letterSpacing": {
1736
- type: "number",
1737
- default: undefined,
1738
- step: 0.1,
1739
- description: "Letter spacing",
1740
- hiddenFromList: false
1697
+ var getInputProps = () => {
1698
+ if (typeof window === "undefined") {
1699
+ warnOnceSSRImport();
1700
+ return {};
1741
1701
  }
1742
- };
1743
- var borderSchema = {
1744
- "style.borderWidth": {
1745
- type: "number",
1746
- default: undefined,
1747
- min: 0,
1748
- step: 1,
1749
- description: "Border width",
1750
- hiddenFromList: false
1751
- },
1752
- "style.borderStyle": {
1753
- type: "enum",
1754
- default: "none",
1755
- description: "Border style",
1756
- variants: {
1757
- none: {},
1758
- hidden: {},
1759
- solid: {},
1760
- dashed: {},
1761
- dotted: {},
1762
- double: {},
1763
- groove: {},
1764
- ridge: {},
1765
- inset: {},
1766
- outset: {}
1767
- }
1768
- },
1769
- "style.borderColor": {
1770
- type: "color",
1771
- default: undefined,
1772
- description: "Border color"
1702
+ if (getRemotionEnvironment().isPlayer) {
1703
+ throw new Error("You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.");
1773
1704
  }
1774
- };
1775
- var borderRadiusSchema = {
1776
- "style.borderRadius": {
1777
- type: "number",
1778
- default: 0,
1779
- min: 0,
1780
- step: 1,
1781
- description: "Border radius",
1782
- hiddenFromList: false,
1783
- keyframable: true
1784
- },
1785
- "style.borderTopLeftRadius": {
1786
- type: "number",
1787
- default: 0,
1788
- min: 0,
1789
- step: 1,
1790
- description: "Top left radius",
1791
- hiddenFromList: false
1792
- },
1793
- "style.borderTopRightRadius": {
1794
- type: "number",
1795
- default: 0,
1796
- min: 0,
1797
- step: 1,
1798
- description: "Top right radius",
1799
- hiddenFromList: false
1800
- },
1801
- "style.borderBottomRightRadius": {
1802
- type: "number",
1803
- default: 0,
1804
- min: 0,
1805
- step: 1,
1806
- description: "Bottom right radius",
1807
- hiddenFromList: false
1808
- },
1809
- "style.borderBottomLeftRadius": {
1810
- type: "number",
1811
- default: 0,
1812
- min: 0,
1813
- step: 1,
1814
- description: "Bottom left radius",
1815
- hiddenFromList: false
1705
+ const override = getInputPropsOverride();
1706
+ if (override) {
1707
+ return override;
1816
1708
  }
1817
- };
1818
- var backgroundSchema = {
1819
- "style.backgroundColor": {
1820
- type: "color",
1821
- default: "transparent",
1822
- description: "Color"
1709
+ if (typeof window === "undefined" || typeof window.remotion_inputProps === "undefined") {
1710
+ throw new Error("Cannot call `getInputProps()` - window.remotion_inputProps is not set. This API is only available if you are in the Studio, or while you are rendering server-side.");
1711
+ }
1712
+ const param = window.remotion_inputProps;
1713
+ if (!param) {
1714
+ return {};
1823
1715
  }
1716
+ const parsed = deserializeJSONWithSpecialTypes(param);
1717
+ return parsed;
1824
1718
  };
1825
- var svgStrokeSchema = {
1826
- stroke: {
1827
- type: "color",
1828
- default: "none",
1829
- description: "Stroke"
1830
- },
1831
- strokeWidth: {
1832
- type: "number",
1833
- default: 1,
1834
- description: "Stroke width",
1835
- min: 0,
1836
- step: 1,
1837
- hiddenFromList: false
1719
+ var EditorPropsContext = createContext8({
1720
+ props: {},
1721
+ updateProps: () => {
1722
+ throw new Error("Not implemented");
1838
1723
  }
1724
+ });
1725
+ var timeValueRef = React4.createRef();
1726
+ var EditorPropsProvider = ({ children }) => {
1727
+ const [props, setProps] = React4.useState({});
1728
+ const updateProps = useCallback2(({
1729
+ defaultProps,
1730
+ id,
1731
+ newProps
1732
+ }) => {
1733
+ setProps((prev) => {
1734
+ return {
1735
+ ...prev,
1736
+ [id]: typeof newProps === "function" ? newProps(prev[id] ?? defaultProps) : newProps
1737
+ };
1738
+ });
1739
+ }, []);
1740
+ const ctx = useMemo4(() => {
1741
+ return { props, updateProps };
1742
+ }, [props, updateProps]);
1743
+ return /* @__PURE__ */ jsx6(EditorPropsContext.Provider, {
1744
+ value: ctx,
1745
+ children
1746
+ });
1839
1747
  };
1840
- var svgPaintSchema = {
1841
- fill: {
1842
- type: "color",
1843
- default: undefined,
1844
- description: "Fill"
1845
- },
1846
- ...svgStrokeSchema
1748
+ var RemotionEnvironmentContext = React5.createContext(null);
1749
+ var useRemotionEnvironment = () => {
1750
+ const context = useContext4(RemotionEnvironmentContext);
1751
+ const [env] = useState(() => getRemotionEnvironment());
1752
+ return context ?? env;
1847
1753
  };
1848
- var textContentSchema = {
1849
- children: {
1850
- type: "text-content",
1851
- default: "",
1852
- description: "Text",
1853
- keyframable: false
1754
+ function validateDimension(amount, nameOfProp, location) {
1755
+ if (typeof amount !== "number") {
1756
+ throw new Error(`The "${nameOfProp}" prop ${location} must be a number, but you passed a value of type ${typeof amount}`);
1854
1757
  }
1855
- };
1856
- var premountSchema = {
1857
- premountFor: {
1858
- type: "number",
1859
- default: 0,
1860
- description: "Premount For",
1861
- min: 0,
1862
- step: 1,
1863
- hiddenFromList: false,
1864
- keyframable: false
1865
- },
1866
- postmountFor: {
1867
- type: "number",
1868
- default: 0,
1869
- min: 0,
1870
- step: 1,
1871
- hiddenFromList: true,
1872
- keyframable: false
1758
+ if (isNaN(amount)) {
1759
+ throw new TypeError(`The "${nameOfProp}" prop ${location} must not be NaN, but is NaN.`);
1873
1760
  }
1874
- };
1875
- var sequencePremountSchema = {
1876
- ...premountSchema
1877
- };
1878
- var cropSchema = {
1879
- cropLeft: {
1880
- type: "number",
1881
- default: 0,
1882
- description: "Crop left",
1883
- min: 0,
1884
- max: 1,
1885
- step: 0.01,
1886
- hiddenFromList: false,
1887
- keyframable: true
1888
- },
1889
- cropRight: {
1890
- type: "number",
1891
- default: 0,
1892
- description: "Crop right",
1893
- min: 0,
1894
- max: 1,
1895
- step: 0.01,
1896
- hiddenFromList: false,
1897
- keyframable: true
1898
- },
1899
- cropTop: {
1900
- type: "number",
1901
- default: 0,
1902
- description: "Crop top",
1903
- min: 0,
1904
- max: 1,
1905
- step: 0.01,
1906
- hiddenFromList: false,
1907
- keyframable: true
1908
- },
1909
- cropBottom: {
1910
- type: "number",
1911
- default: 0,
1912
- description: "Crop bottom",
1913
- min: 0,
1914
- max: 1,
1915
- step: 0.01,
1916
- hiddenFromList: false,
1917
- keyframable: true
1761
+ if (!Number.isFinite(amount)) {
1762
+ throw new TypeError(`The "${nameOfProp}" prop ${location} must be finite, but is ${amount}.`);
1763
+ }
1764
+ if (amount % 1 !== 0) {
1765
+ throw new TypeError(`The "${nameOfProp}" prop ${location} must be an integer, but is ${amount}.`);
1766
+ }
1767
+ if (amount <= 0) {
1768
+ throw new TypeError(`The "${nameOfProp}" prop ${location} must be positive, but got ${amount}.`);
1769
+ }
1770
+ }
1771
+ function validateDurationInFrames(durationInFrames, options) {
1772
+ const { allowFloats, component } = options;
1773
+ if (typeof durationInFrames === "undefined") {
1774
+ throw new Error(`The "durationInFrames" prop ${component} is missing.`);
1775
+ }
1776
+ if (typeof durationInFrames !== "number") {
1777
+ throw new Error(`The "durationInFrames" prop ${component} must be a number, but you passed a value of type ${typeof durationInFrames}`);
1778
+ }
1779
+ if (durationInFrames <= 0) {
1780
+ throw new TypeError(`The "durationInFrames" prop ${component} must be positive, but got ${durationInFrames}.`);
1781
+ }
1782
+ if (!allowFloats && durationInFrames % 1 !== 0) {
1783
+ throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
1784
+ }
1785
+ if (!Number.isFinite(durationInFrames)) {
1786
+ throw new TypeError(`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`);
1787
+ }
1788
+ }
1789
+ function validateFps(fps, location, isGif) {
1790
+ if (typeof fps !== "number") {
1791
+ throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
1792
+ }
1793
+ if (!Number.isFinite(fps)) {
1794
+ throw new Error(`"fps" must be a finite, but you passed ${fps} ${location}`);
1795
+ }
1796
+ if (isNaN(fps)) {
1797
+ throw new Error(`"fps" must not be NaN, but got ${fps} ${location}`);
1798
+ }
1799
+ if (fps <= 0) {
1800
+ throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
1918
1801
  }
1802
+ if (isGif && fps > 50) {
1803
+ throw new TypeError(`The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif`);
1804
+ }
1805
+ }
1806
+ var ResolveCompositionContext = createContext9(null);
1807
+ var resolveCompositionsRef = createRef();
1808
+ var needsResolution = (composition) => {
1809
+ return Boolean(composition.calculateMetadata);
1919
1810
  };
1920
- var sequenceCropSchema = cropSchema;
1921
- var sequenceStyleSchema = {
1922
- ...sequenceCropSchema,
1923
- ...transformSchema,
1924
- ...backgroundSchema,
1925
- ...borderSchema,
1926
- ...borderRadiusSchema,
1927
- ...sequencePremountSchema
1928
- };
1929
- var hiddenField = {
1930
- type: "boolean",
1931
- default: false,
1932
- description: "Hidden"
1933
- };
1934
- var showInTimelineField = {
1935
- type: "hidden"
1936
- };
1937
- var sequenceNameField = {
1938
- type: "hidden"
1939
- };
1940
- var extendSchemaWithSequenceName = (schema) => {
1941
- return {
1942
- name: sequenceNameField,
1943
- ...schema
1944
- };
1945
- };
1946
- var durationInFramesField = {
1947
- type: "number",
1948
- default: undefined,
1949
- min: 1,
1950
- step: 1,
1951
- hiddenFromList: true
1952
- };
1953
- var fromField = {
1954
- type: "number",
1955
- default: 0,
1956
- step: 1,
1957
- hiddenFromList: true
1958
- };
1959
- var trimBeforeField = {
1960
- type: "number",
1961
- default: 0,
1962
- min: 0,
1963
- step: 1,
1964
- hiddenFromList: true
1965
- };
1966
- var freezeField = {
1967
- type: "number",
1968
- default: null,
1969
- step: 1,
1970
- hiddenFromList: true
1971
- };
1972
- var baseSchema = {
1973
- durationInFrames: durationInFramesField,
1974
- from: fromField,
1975
- trimBefore: trimBeforeField,
1976
- freeze: freezeField,
1977
- hidden: hiddenField,
1978
- name: sequenceNameField,
1979
- showInTimeline: showInTimelineField
1980
- };
1981
- var sequenceSchema = {
1982
- ...baseSchema,
1983
- layout: {
1984
- type: "enum",
1985
- default: "absolute-fill",
1986
- description: "Layout",
1987
- variants: {
1988
- "absolute-fill": sequenceStyleSchema,
1989
- none: {}
1811
+ var useResolvedVideoConfig = (preferredCompositionId) => {
1812
+ const context = useContext5(ResolveCompositionContext);
1813
+ const { props: allEditorProps } = useContext5(EditorPropsContext);
1814
+ const { compositions, canvasContent, currentCompositionMetadata } = useContext5(CompositionManager);
1815
+ const currentComposition = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
1816
+ const compositionId = preferredCompositionId ?? currentComposition;
1817
+ const composition = compositions.find((c) => c.id === compositionId);
1818
+ const selectedEditorProps = useMemo5(() => {
1819
+ return composition ? allEditorProps[composition.id] ?? {} : {};
1820
+ }, [allEditorProps, composition]);
1821
+ const env = useRemotionEnvironment();
1822
+ return useMemo5(() => {
1823
+ if (!composition) {
1824
+ return null;
1990
1825
  }
1991
- }
1992
- };
1993
- var baseSchemaWithoutFrom = {
1994
- durationInFrames: durationInFramesField,
1995
- trimBefore: trimBeforeField,
1996
- freeze: freezeField,
1997
- hidden: hiddenField,
1998
- name: sequenceNameField,
1999
- showInTimeline: showInTimelineField
2000
- };
2001
- var sequenceSchemaWithoutFrom = {
2002
- ...baseSchemaWithoutFrom,
2003
- layout: sequenceSchema.layout
2004
- };
2005
- var sequenceSchemaDefaultLayoutNone = {
2006
- ...sequenceSchema,
2007
- layout: {
2008
- ...sequenceSchema.layout,
2009
- default: "none"
2010
- }
1826
+ if (currentCompositionMetadata) {
1827
+ return {
1828
+ type: "success",
1829
+ metadataSource: null,
1830
+ result: {
1831
+ ...currentCompositionMetadata,
1832
+ id: composition.id,
1833
+ defaultProps: composition.defaultProps ?? {}
1834
+ }
1835
+ };
1836
+ }
1837
+ if (!needsResolution(composition)) {
1838
+ validateDurationInFrames(composition.durationInFrames, {
1839
+ allowFloats: false,
1840
+ component: `in <Composition id="${composition.id}">`
1841
+ });
1842
+ validateFps(composition.fps, `in <Composition id="${composition.id}">`, false);
1843
+ validateDimension(composition.width, "width", `in <Composition id="${composition.id}">`);
1844
+ validateDimension(composition.height, "height", `in <Composition id="${composition.id}">`);
1845
+ return {
1846
+ type: "success",
1847
+ metadataSource: null,
1848
+ result: {
1849
+ width: composition.width,
1850
+ height: composition.height,
1851
+ fps: composition.fps,
1852
+ id: composition.id,
1853
+ durationInFrames: composition.durationInFrames,
1854
+ defaultProps: composition.defaultProps ?? {},
1855
+ props: {
1856
+ ...composition.defaultProps ?? {},
1857
+ ...selectedEditorProps ?? {},
1858
+ ...typeof window === "undefined" || env.isPlayer || !window.remotion_inputProps ? {} : getInputProps() ?? {}
1859
+ },
1860
+ defaultCodec: null,
1861
+ defaultOutName: null,
1862
+ defaultVideoImageFormat: null,
1863
+ defaultPixelFormat: null,
1864
+ defaultProResProfile: null,
1865
+ defaultSampleRate: null
1866
+ }
1867
+ };
1868
+ }
1869
+ if (!context) {
1870
+ return null;
1871
+ }
1872
+ if (!context[composition.id]) {
1873
+ return null;
1874
+ }
1875
+ return context[composition.id];
1876
+ }, [
1877
+ composition,
1878
+ context,
1879
+ currentCompositionMetadata,
1880
+ selectedEditorProps,
1881
+ env.isPlayer
1882
+ ]);
2011
1883
  };
2012
- var SequenceContext = createContext8(null);
2013
- var exports_timeline_position_state = {};
2014
- __export2(exports_timeline_position_state, {
2015
- useTimelineSetFrame: () => useTimelineSetFrame,
2016
- useTimelinePosition: () => useTimelinePosition,
2017
- useTimelineContext: () => useTimelineContext,
2018
- usePlayingState: () => usePlayingState,
2019
- usePlaybackRate: () => usePlaybackRate,
2020
- useAbsoluteTimelinePosition: () => useAbsoluteTimelinePosition,
2021
- persistCurrentFrame: () => persistCurrentFrame,
2022
- getInitialFrameState: () => getInitialFrameState,
2023
- getFrameForComposition: () => getFrameForComposition,
2024
- clampFrameToCompositionRange: () => clampFrameToCompositionRange
2025
- });
2026
1884
  var getErrorStackWithMessage = (error) => {
2027
1885
  const stack = error.stack ?? "";
2028
1886
  return stack.startsWith("Error:") ? stack : `${error.message}
@@ -2138,11 +1996,11 @@ var defaultTimeout = 30000;
2138
1996
  var delayRenderInternal = ({
2139
1997
  scope,
2140
1998
  environment,
2141
- label,
1999
+ label: label2,
2142
2000
  options
2143
2001
  }) => {
2144
- if (typeof label !== "string" && label !== null) {
2145
- throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(label));
2002
+ if (typeof label2 !== "string" && label2 !== null) {
2003
+ throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(label2));
2146
2004
  }
2147
2005
  const handle = Math.random();
2148
2006
  scope.remotion_delayRenderHandles.push(handle);
@@ -2151,12 +2009,12 @@ var delayRenderInternal = ({
2151
2009
  const timeoutToUse = (options?.timeoutInMilliseconds ?? scope.remotion_puppeteerTimeout ?? defaultTimeout) - 2000;
2152
2010
  const retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);
2153
2011
  scope.remotion_delayRenderTimeouts[handle] = {
2154
- label: label ?? null,
2012
+ label: label2 ?? null,
2155
2013
  startTime: Date.now(),
2156
2014
  timeout: setTimeout(() => {
2157
2015
  const message = [
2158
2016
  `A delayRender()`,
2159
- label ? `"${label}"` : null,
2017
+ label2 ? `"${label2}"` : null,
2160
2018
  `was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
2161
2019
  retriesLeft > 0 ? DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
2162
2020
  retriesLeft > 0 ? DELAY_RENDER_RETRY_TOKEN : null,
@@ -2189,10 +2047,10 @@ var continueRenderInternal = ({
2189
2047
  const handleExists = scope.remotion_delayRenderHandles.includes(handle);
2190
2048
  const timeoutEntry = scope.remotion_delayRenderTimeouts[handle];
2191
2049
  if (handleExists && environment.isRendering && timeoutEntry) {
2192
- const { label, startTime, timeout } = timeoutEntry;
2050
+ const { label: label2, startTime, timeout } = timeoutEntry;
2193
2051
  clearTimeout(timeout);
2194
2052
  const message = [
2195
- label ? `"${label}"` : "A handle",
2053
+ label2 ? `"${label2}"` : "A handle",
2196
2054
  DELAY_RENDER_CLEAR_TOKEN,
2197
2055
  `${Date.now() - startTime}ms`
2198
2056
  ].filter(truthy).join(" ");
@@ -2204,47 +2062,41 @@ var continueRenderInternal = ({
2204
2062
  scope.remotion_renderReady = true;
2205
2063
  }
2206
2064
  };
2207
- var LogLevelContext = createContext9({
2065
+ var LogLevelContext = createContext10({
2208
2066
  logLevel: "info",
2209
2067
  mountTime: 0
2210
2068
  });
2211
2069
  var useLogLevel = () => {
2212
- const { logLevel } = React5.useContext(LogLevelContext);
2070
+ const { logLevel } = React6.useContext(LogLevelContext);
2213
2071
  if (logLevel === null) {
2214
2072
  throw new Error("useLogLevel must be used within a LogLevelProvider");
2215
2073
  }
2216
2074
  return logLevel;
2217
2075
  };
2218
2076
  var useMountTime = () => {
2219
- const { mountTime } = React5.useContext(LogLevelContext);
2077
+ const { mountTime } = React6.useContext(LogLevelContext);
2220
2078
  if (mountTime === null) {
2221
2079
  throw new Error("useMountTime must be used within a LogLevelProvider");
2222
2080
  }
2223
2081
  return mountTime;
2224
2082
  };
2225
- var RemotionEnvironmentContext = React6.createContext(null);
2226
- var useRemotionEnvironment = () => {
2227
- const context = useContext5(RemotionEnvironmentContext);
2228
- const [env] = useState(() => getRemotionEnvironment());
2229
- return context ?? env;
2230
- };
2231
- var DelayRenderContextType = createContext10(null);
2083
+ var DelayRenderContextType = createContext11(null);
2232
2084
  var useDelayRender = () => {
2233
2085
  const environment = useRemotionEnvironment();
2234
- const scope = useContext6(DelayRenderContextType) ?? (typeof window !== "undefined" ? window : undefined);
2086
+ const scope = useContext7(DelayRenderContextType) ?? (typeof window !== "undefined" ? window : undefined);
2235
2087
  const logLevel = useLogLevel();
2236
- const delayRender2 = useCallback2((label, options) => {
2088
+ const delayRender2 = useCallback3((label2, options) => {
2237
2089
  if (!scope) {
2238
2090
  return Math.random();
2239
2091
  }
2240
2092
  return delayRenderInternal({
2241
2093
  scope,
2242
2094
  environment,
2243
- label: label ?? null,
2095
+ label: label2 ?? null,
2244
2096
  options: options ?? {}
2245
2097
  });
2246
2098
  }, [environment, scope]);
2247
- const continueRender2 = useCallback2((handle) => {
2099
+ const continueRender2 = useCallback3((handle) => {
2248
2100
  if (!scope) {
2249
2101
  return;
2250
2102
  }
@@ -2255,12 +2107,306 @@ var useDelayRender = () => {
2255
2107
  logLevel
2256
2108
  });
2257
2109
  }, [environment, logLevel, scope]);
2258
- const cancelRender2 = useCallback2((err) => {
2110
+ const cancelRender2 = useCallback3((err) => {
2259
2111
  return cancelRenderInternal(scope ?? (typeof window !== "undefined" ? window : undefined), err);
2260
2112
  }, [scope]);
2261
2113
  return { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 };
2262
2114
  };
2263
- var SetTimelineContext = createContext11({
2115
+ var useLazyComponent = ({
2116
+ compProps,
2117
+ componentName,
2118
+ noSuspense
2119
+ }) => {
2120
+ const componentRef = useRef2(null);
2121
+ if ("component" in compProps) {
2122
+ componentRef.current = compProps.component;
2123
+ }
2124
+ const lazy = useMemo6(() => {
2125
+ if ("component" in compProps) {
2126
+ if (typeof document === "undefined" || noSuspense) {
2127
+ return compProps.component;
2128
+ }
2129
+ if (typeof compProps.component === "undefined") {
2130
+ throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${componentName}/> component.`);
2131
+ }
2132
+ const Wrapper = (props) => {
2133
+ const Comp = componentRef.current;
2134
+ return React7.createElement(Comp, props);
2135
+ };
2136
+ return Wrapper;
2137
+ }
2138
+ if ("lazyComponent" in compProps && typeof compProps.lazyComponent !== "undefined") {
2139
+ if (typeof compProps.lazyComponent === "undefined") {
2140
+ throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${componentName}/> component.`);
2141
+ }
2142
+ return React7.lazy(compProps.lazyComponent);
2143
+ }
2144
+ throw new Error("You must pass either 'component' or 'lazyComponent'");
2145
+ }, [compProps.lazyComponent]);
2146
+ return lazy;
2147
+ };
2148
+ var useVideo = () => {
2149
+ const { canvasContent, compositions, currentCompositionMetadata } = useContext8(CompositionManager);
2150
+ const selected = compositions.find((c) => {
2151
+ return canvasContent?.type === "composition" && c.id === canvasContent.compositionId;
2152
+ });
2153
+ const resolved = useResolvedVideoConfig(selected?.id ?? null);
2154
+ return useMemo7(() => {
2155
+ if (!resolved) {
2156
+ return null;
2157
+ }
2158
+ if (resolved.type === "error") {
2159
+ return null;
2160
+ }
2161
+ if (resolved.type === "loading") {
2162
+ return null;
2163
+ }
2164
+ if (!selected) {
2165
+ return null;
2166
+ }
2167
+ return {
2168
+ ...resolved.result,
2169
+ defaultProps: selected.defaultProps ?? {},
2170
+ id: selected.id,
2171
+ ...currentCompositionMetadata ?? {},
2172
+ component: selected.component
2173
+ };
2174
+ }, [currentCompositionMetadata, resolved, selected]);
2175
+ };
2176
+ var getRegex2 = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
2177
+ var isCompositionIdValid = (id) => id.match(getRegex2());
2178
+ var validateCompositionId = (id) => {
2179
+ if (!isCompositionIdValid(id)) {
2180
+ throw new Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${id}`);
2181
+ }
2182
+ };
2183
+ var invalidCompositionErrorMessage = `Composition ID must match ${String(getRegex2())}`;
2184
+ var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
2185
+ if (!defaultProps) {
2186
+ return;
2187
+ }
2188
+ if (typeof defaultProps !== "object") {
2189
+ throw new Error(`"${name}" must be an object, but you passed a value of type ${typeof defaultProps}`);
2190
+ }
2191
+ if (Array.isArray(defaultProps)) {
2192
+ throw new Error(`"${name}" must be an object, an array was passed ${compositionId ? `for composition "${compositionId}"` : ""}`);
2193
+ }
2194
+ };
2195
+ var Fallback = () => {
2196
+ const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
2197
+ useEffect2(() => {
2198
+ const fallback = delayRender2("Waiting for Root component to unsuspend");
2199
+ return () => continueRender2(fallback);
2200
+ }, [continueRender2, delayRender2]);
2201
+ return null;
2202
+ };
2203
+ var InnerComposition = ({
2204
+ width,
2205
+ height,
2206
+ fps,
2207
+ durationInFrames,
2208
+ id,
2209
+ defaultProps,
2210
+ schema,
2211
+ ...compProps
2212
+ }) => {
2213
+ const compManager = useContext9(CompositionSetters);
2214
+ const { registerComposition, unregisterComposition } = compManager;
2215
+ const video = useVideo();
2216
+ const lazy = useLazyComponent({
2217
+ compProps,
2218
+ componentName: "Composition",
2219
+ noSuspense: false
2220
+ });
2221
+ const nonce = useNonce();
2222
+ const isPlayer = useIsPlayer();
2223
+ const environment = useRemotionEnvironment();
2224
+ const canUseComposition = useContext9(CanUseRemotionHooks);
2225
+ if (typeof window !== "undefined") {
2226
+ window.remotion_seenCompositionIds = Array.from(new Set([...window.remotion_seenCompositionIds ?? [], id]));
2227
+ }
2228
+ if (canUseComposition) {
2229
+ if (isPlayer) {
2230
+ throw new Error("<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help.");
2231
+ }
2232
+ throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
2233
+ }
2234
+ const { folderName, parentName } = useContext9(FolderContext);
2235
+ const stack = compProps._remotionInternalStack ?? null;
2236
+ const componentFromProps = "component" in compProps ? compProps.component : null;
2237
+ useEffect2(() => {
2238
+ if (!id) {
2239
+ throw new Error("No id for composition passed.");
2240
+ }
2241
+ validateCompositionId(id);
2242
+ validateDefaultAndInputProps(defaultProps, "defaultProps", id);
2243
+ registerComposition({
2244
+ durationInFrames: durationInFrames ?? undefined,
2245
+ fps: fps ?? undefined,
2246
+ height: height ?? undefined,
2247
+ width: width ?? undefined,
2248
+ id,
2249
+ folderName,
2250
+ component: lazy,
2251
+ defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
2252
+ nonce: nonce.get(),
2253
+ parentFolderName: parentName,
2254
+ componentFromProps,
2255
+ schema: schema ?? null,
2256
+ calculateMetadata: compProps.calculateMetadata ?? null,
2257
+ stack
2258
+ });
2259
+ return () => {
2260
+ unregisterComposition(id);
2261
+ };
2262
+ }, [
2263
+ durationInFrames,
2264
+ fps,
2265
+ height,
2266
+ lazy,
2267
+ id,
2268
+ folderName,
2269
+ defaultProps,
2270
+ width,
2271
+ nonce,
2272
+ parentName,
2273
+ componentFromProps,
2274
+ schema,
2275
+ compProps.calculateMetadata,
2276
+ stack,
2277
+ registerComposition,
2278
+ unregisterComposition
2279
+ ]);
2280
+ const resolved = useResolvedVideoConfig(id);
2281
+ const { setError, clearError } = useContext9(CompositionRenderErrorContext);
2282
+ const onError = useCallback4((error2) => {
2283
+ setError(error2);
2284
+ }, [setError]);
2285
+ const onClear = useCallback4(() => {
2286
+ clearError();
2287
+ }, [clearError]);
2288
+ if (environment.isStudio && video && video.component === lazy && video.id === id) {
2289
+ const Comp = lazy;
2290
+ if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
2291
+ return null;
2292
+ }
2293
+ return createPortal(/* @__PURE__ */ jsx7(CanUseRemotionHooksProvider, {
2294
+ children: /* @__PURE__ */ jsx7(CompositionErrorBoundary, {
2295
+ onError,
2296
+ onClear,
2297
+ children: /* @__PURE__ */ jsx7(Suspense, {
2298
+ fallback: /* @__PURE__ */ jsx7(Loading, {}),
2299
+ children: /* @__PURE__ */ jsx7(Comp, {
2300
+ ...resolved.result.props ?? {}
2301
+ })
2302
+ })
2303
+ })
2304
+ }), portalNode());
2305
+ }
2306
+ if (environment.isRendering && video && video.component === lazy && video.id === id) {
2307
+ const Comp = lazy;
2308
+ if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
2309
+ return null;
2310
+ }
2311
+ return createPortal(/* @__PURE__ */ jsx7(CanUseRemotionHooksProvider, {
2312
+ children: /* @__PURE__ */ jsx7(Suspense, {
2313
+ fallback: /* @__PURE__ */ jsx7(Fallback, {}),
2314
+ children: /* @__PURE__ */ jsx7(Comp, {
2315
+ ...resolved.result.props ?? {}
2316
+ })
2317
+ })
2318
+ }), portalNode());
2319
+ }
2320
+ return null;
2321
+ };
2322
+ var Composition = (props) => {
2323
+ const { onlyRenderComposition } = useContext9(CompositionSetters);
2324
+ if (onlyRenderComposition && onlyRenderComposition !== props.id) {
2325
+ return null;
2326
+ }
2327
+ return /* @__PURE__ */ jsx7(InnerComposition, {
2328
+ ...props
2329
+ });
2330
+ };
2331
+ var componentsToAddStacksTo = [];
2332
+ var sequenceComponent = null;
2333
+ var stacksByControls = new WeakMap;
2334
+ var REMOTION_INTERNAL_STACK_PROP = "_remotionInternalStack";
2335
+ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
2336
+ var addSequenceStackTraces = (component) => {
2337
+ componentsToAddStacksTo.push(component);
2338
+ };
2339
+ var setSequenceComponent = (component) => {
2340
+ sequenceComponent = component;
2341
+ };
2342
+ var getSequenceComponent = () => sequenceComponent;
2343
+ var setStackForControls = (controls, stack) => {
2344
+ if (stack === undefined) {
2345
+ stacksByControls.delete(controls);
2346
+ return;
2347
+ }
2348
+ stacksByControls.set(controls, stack);
2349
+ };
2350
+ var getStackForControls = (controls) => {
2351
+ return stacksByControls.get(controls) ?? null;
2352
+ };
2353
+ var getSingleChildComponent = (children) => {
2354
+ const mountedChildren = React9.Children.toArray(children);
2355
+ if (mountedChildren.length !== 1) {
2356
+ return null;
2357
+ }
2358
+ const child = mountedChildren[0];
2359
+ if (!React9.isValidElement(child)) {
2360
+ return null;
2361
+ }
2362
+ if (typeof child.type !== "function" && typeof child.type !== "object") {
2363
+ return null;
2364
+ }
2365
+ return child.type;
2366
+ };
2367
+ var VERSION = "4.0.503";
2368
+ var checkMultipleRemotionVersions = () => {
2369
+ if (typeof globalThis === "undefined") {
2370
+ return;
2371
+ }
2372
+ const set = () => {
2373
+ globalThis.remotion_imported = VERSION;
2374
+ if (typeof window !== "undefined") {
2375
+ window.remotion_imported = VERSION;
2376
+ }
2377
+ };
2378
+ const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
2379
+ if (alreadyImported) {
2380
+ if (alreadyImported === VERSION) {
2381
+ return;
2382
+ }
2383
+ if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
2384
+ set();
2385
+ return;
2386
+ }
2387
+ throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
2388
+ VERSION,
2389
+ typeof alreadyImported === "string" ? alreadyImported : "an older version"
2390
+ ].filter(truthy).join(" and ")}. This will cause things to break in an unexpected way.
2391
+ 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.`);
2392
+ }
2393
+ set();
2394
+ };
2395
+ var SequenceContext = createContext12(null);
2396
+ var exports_timeline_position_state = {};
2397
+ __export2(exports_timeline_position_state, {
2398
+ useTimelineSetFrame: () => useTimelineSetFrame,
2399
+ useTimelinePosition: () => useTimelinePosition,
2400
+ useTimelineContext: () => useTimelineContext,
2401
+ usePlayingState: () => usePlayingState,
2402
+ usePlaybackRate: () => usePlaybackRate,
2403
+ useAbsoluteTimelinePosition: () => useAbsoluteTimelinePosition,
2404
+ persistCurrentFrame: () => persistCurrentFrame,
2405
+ getInitialFrameState: () => getInitialFrameState,
2406
+ getFrameForComposition: () => getFrameForComposition,
2407
+ clampFrameToCompositionRange: () => clampFrameToCompositionRange
2408
+ });
2409
+ var SetTimelineContext = createContext13({
2264
2410
  setFrame: () => {
2265
2411
  throw new Error("default");
2266
2412
  },
@@ -2268,14 +2414,14 @@ var SetTimelineContext = createContext11({
2268
2414
  throw new Error("default");
2269
2415
  }
2270
2416
  });
2271
- var TimelineContext = createContext11(null);
2272
- var PlaybackRateContext = createContext11(null);
2273
- var AbsoluteTimeContext = createContext11(null);
2417
+ var TimelineContext = createContext13(null);
2418
+ var PlaybackRateContext = createContext13(null);
2419
+ var AbsoluteTimeContext = createContext13(null);
2274
2420
  var TimelineContextProvider = ({ children, frameState }) => {
2275
2421
  const [playing, setPlaying] = useState2(false);
2276
- const imperativePlaying = useRef2(false);
2422
+ const imperativePlaying = useRef3(false);
2277
2423
  const [playbackRate, setPlaybackRate] = useState2(1);
2278
- const audioAndVideoTags = useRef2([]);
2424
+ const audioAndVideoTags = useRef3([]);
2279
2425
  const [_frame, setFrame] = useState2(() => getInitialFrameState());
2280
2426
  const frame = frameState ?? _frame;
2281
2427
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
@@ -2305,7 +2451,7 @@ var TimelineContextProvider = ({ children, frameState }) => {
2305
2451
  window.remotion_isPlayer = false;
2306
2452
  }, [continueRender2, delayRender2]);
2307
2453
  }
2308
- const timelineContextValue = useMemo4(() => {
2454
+ const timelineContextValue = useMemo8(() => {
2309
2455
  return {
2310
2456
  frame,
2311
2457
  playing,
@@ -2313,25 +2459,25 @@ var TimelineContextProvider = ({ children, frameState }) => {
2313
2459
  audioAndVideoTags
2314
2460
  };
2315
2461
  }, [frame, playing]);
2316
- const playbackRateContextValue = useMemo4(() => {
2462
+ const playbackRateContextValue = useMemo8(() => {
2317
2463
  return {
2318
2464
  playbackRate,
2319
2465
  setPlaybackRate
2320
2466
  };
2321
2467
  }, [playbackRate]);
2322
- const setTimelineContextValue = useMemo4(() => {
2468
+ const setTimelineContextValue = useMemo8(() => {
2323
2469
  return {
2324
2470
  setFrame,
2325
2471
  setPlaying
2326
2472
  };
2327
2473
  }, []);
2328
- return /* @__PURE__ */ jsx5(AbsoluteTimeContext.Provider, {
2474
+ return /* @__PURE__ */ jsx8(AbsoluteTimeContext.Provider, {
2329
2475
  value: timelineContextValue,
2330
- children: /* @__PURE__ */ jsx5(PlaybackRateContext.Provider, {
2476
+ children: /* @__PURE__ */ jsx8(PlaybackRateContext.Provider, {
2331
2477
  value: playbackRateContextValue,
2332
- children: /* @__PURE__ */ jsx5(TimelineContext.Provider, {
2478
+ children: /* @__PURE__ */ jsx8(TimelineContext.Provider, {
2333
2479
  value: timelineContextValue,
2334
- children: /* @__PURE__ */ jsx5(SetTimelineContext.Provider, {
2480
+ children: /* @__PURE__ */ jsx8(SetTimelineContext.Provider, {
2335
2481
  value: setTimelineContextValue,
2336
2482
  children
2337
2483
  })
@@ -2339,245 +2485,6 @@ var TimelineContextProvider = ({ children, frameState }) => {
2339
2485
  })
2340
2486
  });
2341
2487
  };
2342
- var getKey = () => {
2343
- return `remotion_inputPropsOverride` + window.location.origin;
2344
- };
2345
- var getInputPropsOverride = () => {
2346
- if (typeof localStorage === "undefined")
2347
- return null;
2348
- const override = localStorage.getItem(getKey());
2349
- if (!override)
2350
- return null;
2351
- return JSON.parse(override);
2352
- };
2353
- var setInputPropsOverride = (override) => {
2354
- if (typeof localStorage === "undefined")
2355
- return;
2356
- if (override === null) {
2357
- localStorage.removeItem(getKey());
2358
- return;
2359
- }
2360
- localStorage.setItem(getKey(), JSON.stringify(override));
2361
- };
2362
- var didWarnSSRImport = false;
2363
- var warnOnceSSRImport = () => {
2364
- if (didWarnSSRImport) {
2365
- return;
2366
- }
2367
- didWarnSSRImport = true;
2368
- console.warn("Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object.");
2369
- console.warn("To hide this warning, don't call this function on the server:");
2370
- console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
2371
- };
2372
- var getInputProps = () => {
2373
- if (typeof window === "undefined") {
2374
- warnOnceSSRImport();
2375
- return {};
2376
- }
2377
- if (getRemotionEnvironment().isPlayer) {
2378
- throw new Error("You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.");
2379
- }
2380
- const override = getInputPropsOverride();
2381
- if (override) {
2382
- return override;
2383
- }
2384
- if (typeof window === "undefined" || typeof window.remotion_inputProps === "undefined") {
2385
- throw new Error("Cannot call `getInputProps()` - window.remotion_inputProps is not set. This API is only available if you are in the Studio, or while you are rendering server-side.");
2386
- }
2387
- const param = window.remotion_inputProps;
2388
- if (!param) {
2389
- return {};
2390
- }
2391
- const parsed = deserializeJSONWithSpecialTypes(param);
2392
- return parsed;
2393
- };
2394
- var EditorPropsContext = createContext12({
2395
- props: {},
2396
- updateProps: () => {
2397
- throw new Error("Not implemented");
2398
- }
2399
- });
2400
- var timeValueRef = React8.createRef();
2401
- var EditorPropsProvider = ({ children }) => {
2402
- const [props, setProps] = React8.useState({});
2403
- const updateProps = useCallback3(({
2404
- defaultProps,
2405
- id,
2406
- newProps
2407
- }) => {
2408
- setProps((prev) => {
2409
- return {
2410
- ...prev,
2411
- [id]: typeof newProps === "function" ? newProps(prev[id] ?? defaultProps) : newProps
2412
- };
2413
- });
2414
- }, []);
2415
- const ctx = useMemo5(() => {
2416
- return { props, updateProps };
2417
- }, [props, updateProps]);
2418
- return /* @__PURE__ */ jsx6(EditorPropsContext.Provider, {
2419
- value: ctx,
2420
- children
2421
- });
2422
- };
2423
- function validateDimension(amount, nameOfProp, location) {
2424
- if (typeof amount !== "number") {
2425
- throw new Error(`The "${nameOfProp}" prop ${location} must be a number, but you passed a value of type ${typeof amount}`);
2426
- }
2427
- if (isNaN(amount)) {
2428
- throw new TypeError(`The "${nameOfProp}" prop ${location} must not be NaN, but is NaN.`);
2429
- }
2430
- if (!Number.isFinite(amount)) {
2431
- throw new TypeError(`The "${nameOfProp}" prop ${location} must be finite, but is ${amount}.`);
2432
- }
2433
- if (amount % 1 !== 0) {
2434
- throw new TypeError(`The "${nameOfProp}" prop ${location} must be an integer, but is ${amount}.`);
2435
- }
2436
- if (amount <= 0) {
2437
- throw new TypeError(`The "${nameOfProp}" prop ${location} must be positive, but got ${amount}.`);
2438
- }
2439
- }
2440
- function validateDurationInFrames(durationInFrames, options) {
2441
- const { allowFloats, component } = options;
2442
- if (typeof durationInFrames === "undefined") {
2443
- throw new Error(`The "durationInFrames" prop ${component} is missing.`);
2444
- }
2445
- if (typeof durationInFrames !== "number") {
2446
- throw new Error(`The "durationInFrames" prop ${component} must be a number, but you passed a value of type ${typeof durationInFrames}`);
2447
- }
2448
- if (durationInFrames <= 0) {
2449
- throw new TypeError(`The "durationInFrames" prop ${component} must be positive, but got ${durationInFrames}.`);
2450
- }
2451
- if (!allowFloats && durationInFrames % 1 !== 0) {
2452
- throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
2453
- }
2454
- if (!Number.isFinite(durationInFrames)) {
2455
- throw new TypeError(`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`);
2456
- }
2457
- }
2458
- function validateFps(fps, location, isGif) {
2459
- if (typeof fps !== "number") {
2460
- throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
2461
- }
2462
- if (!Number.isFinite(fps)) {
2463
- throw new Error(`"fps" must be a finite, but you passed ${fps} ${location}`);
2464
- }
2465
- if (isNaN(fps)) {
2466
- throw new Error(`"fps" must not be NaN, but got ${fps} ${location}`);
2467
- }
2468
- if (fps <= 0) {
2469
- throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
2470
- }
2471
- if (isGif && fps > 50) {
2472
- throw new TypeError(`The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif`);
2473
- }
2474
- }
2475
- var ResolveCompositionContext = createContext13(null);
2476
- var resolveCompositionsRef = createRef();
2477
- var needsResolution = (composition) => {
2478
- return Boolean(composition.calculateMetadata);
2479
- };
2480
- var useResolvedVideoConfig = (preferredCompositionId) => {
2481
- const context = useContext7(ResolveCompositionContext);
2482
- const { props: allEditorProps } = useContext7(EditorPropsContext);
2483
- const { compositions, canvasContent, currentCompositionMetadata } = useContext7(CompositionManager);
2484
- const currentComposition = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
2485
- const compositionId = preferredCompositionId ?? currentComposition;
2486
- const composition = compositions.find((c) => c.id === compositionId);
2487
- const selectedEditorProps = useMemo6(() => {
2488
- return composition ? allEditorProps[composition.id] ?? {} : {};
2489
- }, [allEditorProps, composition]);
2490
- const env = useRemotionEnvironment();
2491
- return useMemo6(() => {
2492
- if (!composition) {
2493
- return null;
2494
- }
2495
- if (currentCompositionMetadata) {
2496
- return {
2497
- type: "success",
2498
- metadataSource: null,
2499
- result: {
2500
- ...currentCompositionMetadata,
2501
- id: composition.id,
2502
- defaultProps: composition.defaultProps ?? {}
2503
- }
2504
- };
2505
- }
2506
- if (!needsResolution(composition)) {
2507
- validateDurationInFrames(composition.durationInFrames, {
2508
- allowFloats: false,
2509
- component: `in <Composition id="${composition.id}">`
2510
- });
2511
- validateFps(composition.fps, `in <Composition id="${composition.id}">`, false);
2512
- validateDimension(composition.width, "width", `in <Composition id="${composition.id}">`);
2513
- validateDimension(composition.height, "height", `in <Composition id="${composition.id}">`);
2514
- return {
2515
- type: "success",
2516
- metadataSource: null,
2517
- result: {
2518
- width: composition.width,
2519
- height: composition.height,
2520
- fps: composition.fps,
2521
- id: composition.id,
2522
- durationInFrames: composition.durationInFrames,
2523
- defaultProps: composition.defaultProps ?? {},
2524
- props: {
2525
- ...composition.defaultProps ?? {},
2526
- ...selectedEditorProps ?? {},
2527
- ...typeof window === "undefined" || env.isPlayer || !window.remotion_inputProps ? {} : getInputProps() ?? {}
2528
- },
2529
- defaultCodec: null,
2530
- defaultOutName: null,
2531
- defaultVideoImageFormat: null,
2532
- defaultPixelFormat: null,
2533
- defaultProResProfile: null,
2534
- defaultSampleRate: null
2535
- }
2536
- };
2537
- }
2538
- if (!context) {
2539
- return null;
2540
- }
2541
- if (!context[composition.id]) {
2542
- return null;
2543
- }
2544
- return context[composition.id];
2545
- }, [
2546
- composition,
2547
- context,
2548
- currentCompositionMetadata,
2549
- selectedEditorProps,
2550
- env.isPlayer
2551
- ]);
2552
- };
2553
- var useVideo = () => {
2554
- const { canvasContent, compositions, currentCompositionMetadata } = useContext8(CompositionManager);
2555
- const selected = compositions.find((c) => {
2556
- return canvasContent?.type === "composition" && c.id === canvasContent.compositionId;
2557
- });
2558
- const resolved = useResolvedVideoConfig(selected?.id ?? null);
2559
- return useMemo7(() => {
2560
- if (!resolved) {
2561
- return null;
2562
- }
2563
- if (resolved.type === "error") {
2564
- return null;
2565
- }
2566
- if (resolved.type === "loading") {
2567
- return null;
2568
- }
2569
- if (!selected) {
2570
- return null;
2571
- }
2572
- return {
2573
- ...resolved.result,
2574
- defaultProps: selected.defaultProps ?? {},
2575
- id: selected.id,
2576
- ...currentCompositionMetadata ?? {},
2577
- component: selected.component
2578
- };
2579
- }, [currentCompositionMetadata, resolved, selected]);
2580
- };
2581
2488
  var makeKey = () => {
2582
2489
  return `remotion.time-all`;
2583
2490
  };
@@ -2613,14 +2520,14 @@ var useTimelinePositionFromContext = (state) => {
2613
2520
  return clampFrameToCompositionRange(unclamped, videoConfig.durationInFrames);
2614
2521
  };
2615
2522
  var useTimelineContext = () => {
2616
- const state = useContext9(TimelineContext);
2523
+ const state = useContext10(TimelineContext);
2617
2524
  if (state === null) {
2618
2525
  throw new Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
2619
2526
  }
2620
2527
  return state;
2621
2528
  };
2622
2529
  var usePlaybackRate = () => {
2623
- const state = useContext9(PlaybackRateContext);
2530
+ const state = useContext10(PlaybackRateContext);
2624
2531
  if (state === null) {
2625
2532
  throw new Error("PlaybackRateContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
2626
2533
  }
@@ -2631,23 +2538,23 @@ var useTimelinePosition = () => {
2631
2538
  return useTimelinePositionFromContext(state);
2632
2539
  };
2633
2540
  var useAbsoluteTimelinePosition = () => {
2634
- const state = useContext9(AbsoluteTimeContext);
2541
+ const state = useContext10(AbsoluteTimeContext);
2635
2542
  if (state === null) {
2636
2543
  throw new Error("AbsoluteTimeContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
2637
2544
  }
2638
2545
  return useTimelinePositionFromContext(state);
2639
2546
  };
2640
2547
  var useTimelineSetFrame = () => {
2641
- const { setFrame } = useContext9(SetTimelineContext);
2548
+ const { setFrame } = useContext10(SetTimelineContext);
2642
2549
  return setFrame;
2643
2550
  };
2644
2551
  var usePlayingState = () => {
2645
2552
  const { playing, imperativePlaying } = useTimelineContext();
2646
- const { setPlaying } = useContext9(SetTimelineContext);
2647
- return useMemo8(() => [playing, setPlaying, imperativePlaying], [imperativePlaying, playing, setPlaying]);
2553
+ const { setPlaying } = useContext10(SetTimelineContext);
2554
+ return useMemo9(() => [playing, setPlaying, imperativePlaying], [imperativePlaying, playing, setPlaying]);
2648
2555
  };
2649
2556
  var useCurrentFrame = () => {
2650
- const canUseRemotionHooks = useContext10(CanUseRemotionHooks);
2557
+ const canUseRemotionHooks = useContext11(CanUseRemotionHooks);
2651
2558
  const env = useRemotionEnvironment();
2652
2559
  if (!canUseRemotionHooks) {
2653
2560
  if (env.isPlayer) {
@@ -2656,17 +2563,17 @@ var useCurrentFrame = () => {
2656
2563
  throw new Error(`useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions`);
2657
2564
  }
2658
2565
  const frame = useTimelinePosition();
2659
- const context = useContext10(SequenceContext);
2566
+ const context = useContext11(SequenceContext);
2660
2567
  const contextOffset = context ? context.cumulatedFrom + context.relativeFrom : 0;
2661
2568
  return frame - contextOffset;
2662
2569
  };
2663
2570
  var useUnsafeVideoConfig = () => {
2664
- const context = useContext11(SequenceContext);
2571
+ const context = useContext12(SequenceContext);
2665
2572
  const ctxWidth = context?.width ?? null;
2666
2573
  const ctxHeight = context?.height ?? null;
2667
2574
  const ctxDuration = context?.durationInFrames ?? null;
2668
2575
  const video = useVideo();
2669
- return useMemo9(() => {
2576
+ return useMemo10(() => {
2670
2577
  if (!video) {
2671
2578
  return null;
2672
2579
  }
@@ -2704,7 +2611,7 @@ var useUnsafeVideoConfig = () => {
2704
2611
  };
2705
2612
  var useVideoConfig = () => {
2706
2613
  const videoConfig = useUnsafeVideoConfig();
2707
- const context = useContext12(CanUseRemotionHooks);
2614
+ const context = useContext13(CanUseRemotionHooks);
2708
2615
  const isPlayer = useIsPlayer();
2709
2616
  if (!videoConfig) {
2710
2617
  if (typeof window !== "undefined" && window.remotion_isPlayer || isPlayer) {
@@ -2740,7 +2647,7 @@ var Freeze = ({
2740
2647
  if (!Number.isFinite(frameToFreeze)) {
2741
2648
  throw new Error(`The 'frame' prop of <Freeze /> must be a finite number, but it is ${frameToFreeze}.`);
2742
2649
  }
2743
- const isActive = useMemo10(() => {
2650
+ const isActive = useMemo11(() => {
2744
2651
  if (typeof active === "boolean") {
2745
2652
  return active;
2746
2653
  }
@@ -2749,9 +2656,9 @@ var Freeze = ({
2749
2656
  }
2750
2657
  }, [active, frame]);
2751
2658
  const timelineContext = useTimelineContext();
2752
- const sequenceContext = useContext13(SequenceContext);
2659
+ const sequenceContext = useContext14(SequenceContext);
2753
2660
  const relativeFrom = sequenceContext?.relativeFrom ?? 0;
2754
- const timelineValue = useMemo10(() => {
2661
+ const timelineValue = useMemo11(() => {
2755
2662
  if (!isActive) {
2756
2663
  return timelineContext;
2757
2664
  }
@@ -2766,7 +2673,7 @@ var Freeze = ({
2766
2673
  }
2767
2674
  };
2768
2675
  }, [isActive, timelineContext, videoConfig.id, frameToFreeze, relativeFrom]);
2769
- const newSequenceContext = useMemo10(() => {
2676
+ const newSequenceContext = useMemo11(() => {
2770
2677
  if (!sequenceContext) {
2771
2678
  return null;
2772
2679
  }
@@ -2778,14 +2685,406 @@ var Freeze = ({
2778
2685
  cumulatedFrom: 0
2779
2686
  };
2780
2687
  }, [sequenceContext, isActive]);
2781
- return /* @__PURE__ */ jsx7(TimelineContext.Provider, {
2688
+ return /* @__PURE__ */ jsx9(TimelineContext.Provider, {
2782
2689
  value: timelineValue,
2783
- children: /* @__PURE__ */ jsx7(SequenceContext.Provider, {
2690
+ children: /* @__PURE__ */ jsx9(SequenceContext.Provider, {
2784
2691
  value: newSequenceContext,
2785
2692
  children
2786
2693
  })
2787
2694
  });
2788
2695
  };
2696
+ var captionsSchema = {
2697
+ captions: {
2698
+ type: "remotion-captions",
2699
+ default: undefined,
2700
+ description: "Captions",
2701
+ keyframable: false
2702
+ }
2703
+ };
2704
+ var transformSchema = {
2705
+ "style.transformOrigin": {
2706
+ type: "transform-origin",
2707
+ step: 1,
2708
+ default: "50% 50%",
2709
+ description: "Transform origin"
2710
+ },
2711
+ "style.translate": {
2712
+ type: "translate",
2713
+ step: 1,
2714
+ default: "0px 0px",
2715
+ description: "Offset"
2716
+ },
2717
+ "style.scale": {
2718
+ type: "scale",
2719
+ max: 100,
2720
+ step: 0.01,
2721
+ default: 1,
2722
+ description: "Scale",
2723
+ defaultKeyframeOutput: "perceptual-scale"
2724
+ },
2725
+ "style.rotate": {
2726
+ type: "rotation-css",
2727
+ step: 1,
2728
+ default: "0deg",
2729
+ description: "Rotation"
2730
+ },
2731
+ "style.opacity": {
2732
+ type: "number",
2733
+ min: 0,
2734
+ max: 1,
2735
+ step: 0.01,
2736
+ default: 1,
2737
+ description: "Opacity",
2738
+ hiddenFromList: false
2739
+ }
2740
+ };
2741
+ var sequenceVisualStyleSchema = transformSchema;
2742
+ var textSchema = {
2743
+ "style.color": {
2744
+ type: "color",
2745
+ default: undefined,
2746
+ description: "Color"
2747
+ },
2748
+ "style.fontFamily": {
2749
+ type: "font-family",
2750
+ default: undefined,
2751
+ description: "Font family",
2752
+ keyframable: false
2753
+ },
2754
+ "style.fontSize": {
2755
+ type: "number",
2756
+ default: undefined,
2757
+ min: 0,
2758
+ step: 1,
2759
+ description: "Font size",
2760
+ hiddenFromList: false
2761
+ },
2762
+ "style.lineHeight": {
2763
+ type: "number",
2764
+ default: undefined,
2765
+ min: 0,
2766
+ step: 0.05,
2767
+ description: "Line height",
2768
+ hiddenFromList: false
2769
+ },
2770
+ "style.fontWeight": {
2771
+ type: "enum",
2772
+ default: "400",
2773
+ description: "Font weight",
2774
+ variants: {
2775
+ "100": {},
2776
+ "200": {},
2777
+ "300": {},
2778
+ "400": {},
2779
+ "500": {},
2780
+ "600": {},
2781
+ "700": {},
2782
+ "800": {},
2783
+ "900": {},
2784
+ normal: {},
2785
+ bold: {}
2786
+ }
2787
+ },
2788
+ "style.fontStyle": {
2789
+ type: "enum",
2790
+ default: "normal",
2791
+ description: "Font style",
2792
+ variants: {
2793
+ normal: {},
2794
+ italic: {},
2795
+ oblique: {}
2796
+ }
2797
+ },
2798
+ "style.textAlign": {
2799
+ type: "enum",
2800
+ default: "left",
2801
+ description: "Text align",
2802
+ variants: {
2803
+ left: {},
2804
+ center: {},
2805
+ right: {},
2806
+ justify: {},
2807
+ start: {},
2808
+ end: {}
2809
+ }
2810
+ },
2811
+ "style.letterSpacing": {
2812
+ type: "number",
2813
+ default: undefined,
2814
+ step: 0.1,
2815
+ description: "Letter spacing",
2816
+ hiddenFromList: false
2817
+ }
2818
+ };
2819
+ var borderSchema = {
2820
+ "style.borderWidth": {
2821
+ type: "number",
2822
+ default: undefined,
2823
+ min: 0,
2824
+ step: 1,
2825
+ description: "Border width",
2826
+ hiddenFromList: false
2827
+ },
2828
+ "style.borderStyle": {
2829
+ type: "enum",
2830
+ default: "none",
2831
+ description: "Border style",
2832
+ variants: {
2833
+ none: {},
2834
+ hidden: {},
2835
+ solid: {},
2836
+ dashed: {},
2837
+ dotted: {},
2838
+ double: {},
2839
+ groove: {},
2840
+ ridge: {},
2841
+ inset: {},
2842
+ outset: {}
2843
+ }
2844
+ },
2845
+ "style.borderColor": {
2846
+ type: "color",
2847
+ default: undefined,
2848
+ description: "Border color"
2849
+ }
2850
+ };
2851
+ var borderRadiusSchema = {
2852
+ "style.borderRadius": {
2853
+ type: "number",
2854
+ default: 0,
2855
+ min: 0,
2856
+ step: 1,
2857
+ description: "Border radius",
2858
+ hiddenFromList: false,
2859
+ keyframable: true
2860
+ },
2861
+ "style.borderTopLeftRadius": {
2862
+ type: "number",
2863
+ default: 0,
2864
+ min: 0,
2865
+ step: 1,
2866
+ description: "Top left radius",
2867
+ hiddenFromList: false
2868
+ },
2869
+ "style.borderTopRightRadius": {
2870
+ type: "number",
2871
+ default: 0,
2872
+ min: 0,
2873
+ step: 1,
2874
+ description: "Top right radius",
2875
+ hiddenFromList: false
2876
+ },
2877
+ "style.borderBottomRightRadius": {
2878
+ type: "number",
2879
+ default: 0,
2880
+ min: 0,
2881
+ step: 1,
2882
+ description: "Bottom right radius",
2883
+ hiddenFromList: false
2884
+ },
2885
+ "style.borderBottomLeftRadius": {
2886
+ type: "number",
2887
+ default: 0,
2888
+ min: 0,
2889
+ step: 1,
2890
+ description: "Bottom left radius",
2891
+ hiddenFromList: false
2892
+ }
2893
+ };
2894
+ var backgroundSchema = {
2895
+ "style.backgroundColor": {
2896
+ type: "color",
2897
+ default: "transparent",
2898
+ description: "Color"
2899
+ }
2900
+ };
2901
+ var svgStrokeSchema = {
2902
+ stroke: {
2903
+ type: "color",
2904
+ default: "none",
2905
+ description: "Stroke"
2906
+ },
2907
+ strokeWidth: {
2908
+ type: "number",
2909
+ default: 1,
2910
+ description: "Stroke width",
2911
+ min: 0,
2912
+ step: 1,
2913
+ hiddenFromList: false
2914
+ }
2915
+ };
2916
+ var svgPaintSchema = {
2917
+ fill: {
2918
+ type: "color",
2919
+ default: undefined,
2920
+ description: "Fill"
2921
+ },
2922
+ ...svgStrokeSchema
2923
+ };
2924
+ var textContentSchema = {
2925
+ children: {
2926
+ type: "text-content",
2927
+ default: "",
2928
+ description: "Text",
2929
+ keyframable: false
2930
+ }
2931
+ };
2932
+ var premountSchema = {
2933
+ premountFor: {
2934
+ type: "number",
2935
+ default: 0,
2936
+ description: "Premount For",
2937
+ min: 0,
2938
+ step: 1,
2939
+ hiddenFromList: false,
2940
+ keyframable: false
2941
+ },
2942
+ postmountFor: {
2943
+ type: "number",
2944
+ default: 0,
2945
+ min: 0,
2946
+ step: 1,
2947
+ hiddenFromList: true,
2948
+ keyframable: false
2949
+ }
2950
+ };
2951
+ var sequencePremountSchema = {
2952
+ ...premountSchema
2953
+ };
2954
+ var cropSchema = {
2955
+ cropLeft: {
2956
+ type: "number",
2957
+ default: 0,
2958
+ description: "Crop left",
2959
+ min: 0,
2960
+ max: 1,
2961
+ step: 0.01,
2962
+ hiddenFromList: false,
2963
+ keyframable: true
2964
+ },
2965
+ cropRight: {
2966
+ type: "number",
2967
+ default: 0,
2968
+ description: "Crop right",
2969
+ min: 0,
2970
+ max: 1,
2971
+ step: 0.01,
2972
+ hiddenFromList: false,
2973
+ keyframable: true
2974
+ },
2975
+ cropTop: {
2976
+ type: "number",
2977
+ default: 0,
2978
+ description: "Crop top",
2979
+ min: 0,
2980
+ max: 1,
2981
+ step: 0.01,
2982
+ hiddenFromList: false,
2983
+ keyframable: true
2984
+ },
2985
+ cropBottom: {
2986
+ type: "number",
2987
+ default: 0,
2988
+ description: "Crop bottom",
2989
+ min: 0,
2990
+ max: 1,
2991
+ step: 0.01,
2992
+ hiddenFromList: false,
2993
+ keyframable: true
2994
+ }
2995
+ };
2996
+ var sequenceCropSchema = cropSchema;
2997
+ var sequenceStyleSchema = {
2998
+ ...sequenceCropSchema,
2999
+ ...transformSchema,
3000
+ ...backgroundSchema,
3001
+ ...borderSchema,
3002
+ ...borderRadiusSchema,
3003
+ ...sequencePremountSchema
3004
+ };
3005
+ var hiddenField = {
3006
+ type: "boolean",
3007
+ default: false,
3008
+ description: "Hidden"
3009
+ };
3010
+ var showInTimelineField = {
3011
+ type: "hidden"
3012
+ };
3013
+ var sequenceNameField = {
3014
+ type: "hidden"
3015
+ };
3016
+ var extendSchemaWithSequenceName = (schema) => {
3017
+ return {
3018
+ name: sequenceNameField,
3019
+ ...schema
3020
+ };
3021
+ };
3022
+ var durationInFramesField = {
3023
+ type: "number",
3024
+ default: undefined,
3025
+ min: 1,
3026
+ step: 1,
3027
+ hiddenFromList: true
3028
+ };
3029
+ var fromField = {
3030
+ type: "number",
3031
+ default: 0,
3032
+ step: 1,
3033
+ hiddenFromList: true
3034
+ };
3035
+ var trimBeforeField = {
3036
+ type: "number",
3037
+ default: 0,
3038
+ min: 0,
3039
+ step: 1,
3040
+ hiddenFromList: true
3041
+ };
3042
+ var freezeField = {
3043
+ type: "number",
3044
+ default: null,
3045
+ step: 1,
3046
+ hiddenFromList: true
3047
+ };
3048
+ var baseSchema = {
3049
+ durationInFrames: durationInFramesField,
3050
+ from: fromField,
3051
+ trimBefore: trimBeforeField,
3052
+ freeze: freezeField,
3053
+ hidden: hiddenField,
3054
+ name: sequenceNameField,
3055
+ showInTimeline: showInTimelineField
3056
+ };
3057
+ var sequenceSchema = {
3058
+ ...baseSchema,
3059
+ layout: {
3060
+ type: "enum",
3061
+ default: "absolute-fill",
3062
+ description: "Layout",
3063
+ variants: {
3064
+ "absolute-fill": sequenceStyleSchema,
3065
+ none: {}
3066
+ }
3067
+ }
3068
+ };
3069
+ var baseSchemaWithoutFrom = {
3070
+ durationInFrames: durationInFramesField,
3071
+ trimBefore: trimBeforeField,
3072
+ freeze: freezeField,
3073
+ hidden: hiddenField,
3074
+ name: sequenceNameField,
3075
+ showInTimeline: showInTimelineField
3076
+ };
3077
+ var sequenceSchemaWithoutFrom = {
3078
+ ...baseSchemaWithoutFrom,
3079
+ layout: sequenceSchema.layout
3080
+ };
3081
+ var sequenceSchemaDefaultLayoutNone = {
3082
+ ...sequenceSchema,
3083
+ layout: {
3084
+ ...sequenceSchema.layout,
3085
+ default: "none"
3086
+ }
3087
+ };
2789
3088
  var clampCrop = (value) => {
2790
3089
  return Math.min(1, Math.max(0, value ?? 0));
2791
3090
  };
@@ -2842,7 +3141,7 @@ var validateSequenceCrop = (crop, componentName = "<Sequence />") => {
2842
3141
  }
2843
3142
  }
2844
3143
  };
2845
- var SequenceManager = React10.createContext({
3144
+ var SequenceManager = React12.createContext({
2846
3145
  registerSequence: () => {
2847
3146
  throw new Error("SequenceManagerContext not initialized");
2848
3147
  },
@@ -2851,19 +3150,19 @@ var SequenceManager = React10.createContext({
2851
3150
  },
2852
3151
  sequences: []
2853
3152
  });
2854
- var SequenceManagerRefContext = React10.createContext({
3153
+ var SequenceManagerRefContext = React12.createContext({
2855
3154
  current: []
2856
3155
  });
2857
3156
  var makeSequencePropsSubscriptionKey = (key) => {
2858
3157
  return `${key.absolutePath}\x00${key.nodePath.join(".")}\x00${key.sequenceKeys.join(".")}\x00${key.effectKeys.map((keys) => keys.join(".")).join(".")}`;
2859
3158
  };
2860
- var VisualModePropStatusesContext = React10.createContext({
3159
+ var VisualModePropStatusesContext = React12.createContext({
2861
3160
  propStatuses: {}
2862
3161
  });
2863
- var VisualModePropStatusesRefContext = React10.createContext({
3162
+ var VisualModePropStatusesRefContext = React12.createContext({
2864
3163
  current: {}
2865
3164
  });
2866
- var VisualModeDragOverridesContext = React10.createContext({
3165
+ var VisualModeDragOverridesContext = React12.createContext({
2867
3166
  getDragOverrides: () => {
2868
3167
  throw new Error("VisualModeDragOverridesContext not initialized");
2869
3168
  },
@@ -2871,7 +3170,7 @@ var VisualModeDragOverridesContext = React10.createContext({
2871
3170
  throw new Error("VisualModeDragOverridesContext not initialized");
2872
3171
  }
2873
3172
  });
2874
- var VisualModeSettersContext = React10.createContext({
3173
+ var VisualModeSettersContext = React12.createContext({
2875
3174
  setDragOverrides: () => {
2876
3175
  throw new Error("VisualModeSettersContext not initialized");
2877
3176
  },
@@ -2891,16 +3190,16 @@ var VisualModeSettersContext = React10.createContext({
2891
3190
  var effectDragOverridesKey = (nodePath, effectIndex) => `${makeSequencePropsSubscriptionKey(nodePath)}.effects.${effectIndex}`;
2892
3191
  var SequenceManagerProvider = ({ children }) => {
2893
3192
  const [sequences, setSequences] = useState3([]);
2894
- const sequencesRef = useRef3(sequences);
3193
+ const sequencesRef = useRef4(sequences);
2895
3194
  sequencesRef.current = sequences;
2896
3195
  const [dragOverrides, setControlOverrides] = useState3({});
2897
- const controlOverridesRef = useRef3(dragOverrides);
3196
+ const controlOverridesRef = useRef4(dragOverrides);
2898
3197
  controlOverridesRef.current = dragOverrides;
2899
3198
  const [effectDragOverridesState, setEffectDragOverridesState] = useState3({});
2900
3199
  const [propStatuses, setPropStatusesMapState] = useState3({});
2901
- const propStatusesRef = useRef3(propStatuses);
3200
+ const propStatusesRef = useRef4(propStatuses);
2902
3201
  propStatusesRef.current = propStatuses;
2903
- const setDragOverrides = useCallback4((nodePath, key, value) => {
3202
+ const setDragOverrides = useCallback5((nodePath, key, value) => {
2904
3203
  setControlOverrides((prev) => ({
2905
3204
  ...prev,
2906
3205
  [makeSequencePropsSubscriptionKey(nodePath)]: {
@@ -2909,7 +3208,7 @@ var SequenceManagerProvider = ({ children }) => {
2909
3208
  }
2910
3209
  }));
2911
3210
  }, []);
2912
- const clearDragOverrides = useCallback4((nodePath) => {
3211
+ const clearDragOverrides = useCallback5((nodePath) => {
2913
3212
  setControlOverrides((prev) => {
2914
3213
  const key = makeSequencePropsSubscriptionKey(nodePath);
2915
3214
  if (!prev[key]) {
@@ -2920,7 +3219,7 @@ var SequenceManagerProvider = ({ children }) => {
2920
3219
  return next;
2921
3220
  });
2922
3221
  }, []);
2923
- const setEffectDragOverrides = useCallback4((nodePath, effectIndex, key, value) => {
3222
+ const setEffectDragOverrides = useCallback5((nodePath, effectIndex, key, value) => {
2924
3223
  setEffectDragOverridesState((prev) => {
2925
3224
  const mapKey = effectDragOverridesKey(nodePath, effectIndex);
2926
3225
  return {
@@ -2932,7 +3231,7 @@ var SequenceManagerProvider = ({ children }) => {
2932
3231
  };
2933
3232
  });
2934
3233
  }, []);
2935
- const clearEffectDragOverrides = useCallback4((nodePath, effectIndex) => {
3234
+ const clearEffectDragOverrides = useCallback5((nodePath, effectIndex) => {
2936
3235
  setEffectDragOverridesState((prev) => {
2937
3236
  const mapKey = effectDragOverridesKey(nodePath, effectIndex);
2938
3237
  if (!prev[mapKey]) {
@@ -2943,7 +3242,7 @@ var SequenceManagerProvider = ({ children }) => {
2943
3242
  return next;
2944
3243
  });
2945
3244
  }, []);
2946
- const setPropStatuses = useCallback4((nodePath, values) => {
3245
+ const setPropStatuses = useCallback5((nodePath, values) => {
2947
3246
  setPropStatusesMapState((prev) => {
2948
3247
  const key = makeSequencePropsSubscriptionKey(nodePath);
2949
3248
  const prevKey = prev[key];
@@ -2954,39 +3253,39 @@ var SequenceManagerProvider = ({ children }) => {
2954
3253
  return { ...prev, [key]: newKey };
2955
3254
  });
2956
3255
  }, []);
2957
- const registerSequence = useCallback4((seq) => {
3256
+ const registerSequence = useCallback5((seq) => {
2958
3257
  setSequences((seqs) => {
2959
3258
  return [...seqs, seq];
2960
3259
  });
2961
3260
  }, []);
2962
- const unregisterSequence = useCallback4((seq) => {
3261
+ const unregisterSequence = useCallback5((seq) => {
2963
3262
  setSequences((seqs) => seqs.filter((s) => s.id !== seq));
2964
3263
  }, []);
2965
- const sequenceContext = useMemo11(() => {
3264
+ const sequenceContext = useMemo12(() => {
2966
3265
  return {
2967
3266
  registerSequence,
2968
3267
  sequences,
2969
3268
  unregisterSequence
2970
3269
  };
2971
3270
  }, [registerSequence, sequences, unregisterSequence]);
2972
- const getDragOverrides = useCallback4((nodePath) => {
3271
+ const getDragOverrides = useCallback5((nodePath) => {
2973
3272
  return dragOverrides[makeSequencePropsSubscriptionKey(nodePath)] ?? {};
2974
3273
  }, [dragOverrides]);
2975
- const getEffectDragOverrides = useCallback4((nodePath, effectIndex) => {
3274
+ const getEffectDragOverrides = useCallback5((nodePath, effectIndex) => {
2976
3275
  return effectDragOverridesState[effectDragOverridesKey(nodePath, effectIndex)] ?? {};
2977
3276
  }, [effectDragOverridesState]);
2978
- const propStatusesContext = useMemo11(() => {
3277
+ const propStatusesContext = useMemo12(() => {
2979
3278
  return {
2980
3279
  propStatuses
2981
3280
  };
2982
3281
  }, [propStatuses]);
2983
- const dragOverridesContext = useMemo11(() => {
3282
+ const dragOverridesContext = useMemo12(() => {
2984
3283
  return {
2985
3284
  getDragOverrides,
2986
3285
  getEffectDragOverrides
2987
3286
  };
2988
3287
  }, [getDragOverrides, getEffectDragOverrides]);
2989
- const settersContext = useMemo11(() => {
3288
+ const settersContext = useMemo12(() => {
2990
3289
  return {
2991
3290
  setDragOverrides,
2992
3291
  clearDragOverrides,
@@ -3001,17 +3300,17 @@ var SequenceManagerProvider = ({ children }) => {
3001
3300
  clearEffectDragOverrides,
3002
3301
  setPropStatuses
3003
3302
  ]);
3004
- return /* @__PURE__ */ jsx8(SequenceManagerRefContext.Provider, {
3303
+ return /* @__PURE__ */ jsx10(SequenceManagerRefContext.Provider, {
3005
3304
  value: sequencesRef,
3006
- children: /* @__PURE__ */ jsx8(SequenceManager.Provider, {
3305
+ children: /* @__PURE__ */ jsx10(SequenceManager.Provider, {
3007
3306
  value: sequenceContext,
3008
- children: /* @__PURE__ */ jsx8(VisualModePropStatusesRefContext.Provider, {
3307
+ children: /* @__PURE__ */ jsx10(VisualModePropStatusesRefContext.Provider, {
3009
3308
  value: propStatusesRef,
3010
- children: /* @__PURE__ */ jsx8(VisualModePropStatusesContext.Provider, {
3309
+ children: /* @__PURE__ */ jsx10(VisualModePropStatusesContext.Provider, {
3011
3310
  value: propStatusesContext,
3012
- children: /* @__PURE__ */ jsx8(VisualModeDragOverridesContext.Provider, {
3311
+ children: /* @__PURE__ */ jsx10(VisualModeDragOverridesContext.Provider, {
3013
3312
  value: dragOverridesContext,
3014
- children: /* @__PURE__ */ jsx8(VisualModeSettersContext.Provider, {
3313
+ children: /* @__PURE__ */ jsx10(VisualModeSettersContext.Provider, {
3015
3314
  value: settersContext,
3016
3315
  children
3017
3316
  })
@@ -3023,19 +3322,19 @@ var SequenceManagerProvider = ({ children }) => {
3023
3322
  };
3024
3323
  var IsInsideSeriesContext = createContext14(false);
3025
3324
  var IsInsideSeriesContainer = ({ children }) => {
3026
- return /* @__PURE__ */ jsx9(IsInsideSeriesContext.Provider, {
3325
+ return /* @__PURE__ */ jsx11(IsInsideSeriesContext.Provider, {
3027
3326
  value: true,
3028
3327
  children
3029
3328
  });
3030
3329
  };
3031
3330
  var IsNotInsideSeriesProvider = ({ children }) => {
3032
- return /* @__PURE__ */ jsx9(IsInsideSeriesContext.Provider, {
3331
+ return /* @__PURE__ */ jsx11(IsInsideSeriesContext.Provider, {
3033
3332
  value: false,
3034
3333
  children
3035
3334
  });
3036
3335
  };
3037
3336
  var useRequireToBeInsideSeries = () => {
3038
- const isInsideSeries = React11.useContext(IsInsideSeriesContext);
3337
+ const isInsideSeries = React13.useContext(IsInsideSeriesContext);
3039
3338
  if (!isInsideSeries) {
3040
3339
  throw new Error("This component must be inside a <Series /> component.");
3041
3340
  }
@@ -3057,7 +3356,7 @@ var usePremounting = ({
3057
3356
  styleWhilePostmounted,
3058
3357
  hideWhilePremounted
3059
3358
  }) => {
3060
- const parentPremountContext = useContext14(PremountContext);
3359
+ const parentPremountContext = useContext15(PremountContext);
3061
3360
  const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
3062
3361
  const environment = useRemotionEnvironment();
3063
3362
  const { fps } = useVideoConfig();
@@ -3068,7 +3367,7 @@ var usePremounting = ({
3068
3367
  const postmountingActive = !environment.isRendering && frame > endThreshold && frame <= endThreshold + effectivePostmountFor;
3069
3368
  const isPremountingOrPostmounting = premountingActive || postmountingActive;
3070
3369
  const freezeFrame = premountingActive ? from : postmountingActive ? from + durationInFrames - 1 : 0;
3071
- const premountingStyle = useMemo12(() => {
3370
+ const premountingStyle = useMemo13(() => {
3072
3371
  if (!isPremountingOrPostmounting) {
3073
3372
  return style;
3074
3373
  }
@@ -4875,7 +5174,7 @@ var resolvePropStatusOverrides = (propStatus, frame) => {
4875
5174
  return hasAny ? out : null;
4876
5175
  };
4877
5176
  var useMemoizedEffectDefinitions = (effects) => {
4878
- const previousRef = useRef4(null);
5177
+ const previousRef = useRef5(null);
4879
5178
  const definitions = effects.map((descriptor) => descriptor.definition);
4880
5179
  const previous = previousRef.current;
4881
5180
  const isSame = previous !== null && previous.length === definitions.length && previous.every((def, i) => def === definitions[i]);
@@ -4920,11 +5219,11 @@ var useMemoizedEffects = ({
4920
5219
  effects,
4921
5220
  overrideId
4922
5221
  }) => {
4923
- const previousRef = useRef4(null);
4924
- const { propStatuses } = useContext15(VisualModePropStatusesContext);
4925
- const { getEffectDragOverrides } = useContext15(VisualModeDragOverridesContext);
5222
+ const previousRef = useRef5(null);
5223
+ const { propStatuses } = useContext16(VisualModePropStatusesContext);
5224
+ const { getEffectDragOverrides } = useContext16(VisualModeDragOverridesContext);
4926
5225
  const frame = useCurrentFrame();
4927
- const { overrideIdToNodePathMappings } = useContext15(OverrideIdsToNodePathsGettersContext);
5226
+ const { overrideIdToNodePathMappings } = useContext16(OverrideIdsToNodePathsGettersContext);
4928
5227
  const previous = previousRef.current;
4929
5228
  const nodePath = overrideId ? overrideIdToNodePathMappings[overrideId] ?? null : null;
4930
5229
  const resolved = effects.map((descriptor, index) => {
@@ -5267,22 +5566,22 @@ var withInteractivitySchema = ({
5267
5566
  const cleanProps = propsWithoutInternalStack;
5268
5567
  const env = useRemotionEnvironment();
5269
5568
  if (!env.isStudio || env.isRendering) {
5270
- return React12.createElement(Component, {
5569
+ return React14.createElement(Component, {
5271
5570
  ...cleanProps,
5272
5571
  controls: null,
5273
5572
  ref
5274
5573
  });
5275
5574
  }
5276
- const { propStatuses } = useContext16(VisualModePropStatusesContext);
5277
- const { getDragOverrides } = useContext16(VisualModeDragOverridesContext);
5278
- const nodePathMapping = useContext16(OverrideIdsToNodePathsGettersContext);
5575
+ const { propStatuses } = useContext17(VisualModePropStatusesContext);
5576
+ const { getDragOverrides } = useContext17(VisualModeDragOverridesContext);
5577
+ const nodePathMapping = useContext17(OverrideIdsToNodePathsGettersContext);
5279
5578
  const frame = useCurrentFrame();
5280
5579
  if (cleanProps.controls) {
5281
5580
  const passedControls = cleanProps.controls;
5282
5581
  if (getStackForControls(passedControls) === null) {
5283
5582
  setStackForControls(passedControls, internalStack);
5284
5583
  }
5285
- return React12.createElement(Component, {
5584
+ return React14.createElement(Component, {
5286
5585
  ...cleanProps,
5287
5586
  ref
5288
5587
  });
@@ -5305,8 +5604,8 @@ var withInteractivitySchema = ({
5305
5604
  key,
5306
5605
  props: cleanProps
5307
5606
  }));
5308
- const currentRuntimeValueDotNotation = useMemo13(() => readValuesFromProps(cleanProps, flatKeys, flatSchema), runtimeValues);
5309
- const controls = useMemo13(() => {
5607
+ const currentRuntimeValueDotNotation = useMemo14(() => readValuesFromProps(cleanProps, flatKeys, flatSchema), runtimeValues);
5608
+ const controls = useMemo14(() => {
5310
5609
  return {
5311
5610
  schema: schemaWithSequenceName,
5312
5611
  currentRuntimeValueDotNotation,
@@ -5317,7 +5616,7 @@ var withInteractivitySchema = ({
5317
5616
  };
5318
5617
  }, [currentRuntimeValueDotNotation, overrideId]);
5319
5618
  setStackForControls(controls, internalStack);
5320
- const { merged: valuesDotNotation, propsToDelete } = useMemo13(() => {
5619
+ const { merged: valuesDotNotation, propsToDelete } = useMemo14(() => {
5321
5620
  return computeEffectiveSchemaValuesDotNotation({
5322
5621
  schema: schemaWithSequenceName,
5323
5622
  currentValue: currentRuntimeValueDotNotation,
@@ -5340,7 +5639,7 @@ var withInteractivitySchema = ({
5340
5639
  schemaKeys: activeKeys,
5341
5640
  propsToDelete
5342
5641
  });
5343
- return React12.createElement(Component, {
5642
+ return React14.createElement(Component, {
5344
5643
  ...mergedProps,
5345
5644
  controls,
5346
5645
  ref
@@ -5379,7 +5678,7 @@ var RegularSequenceRefForwardingFunction = ({
5379
5678
  }, ref) => {
5380
5679
  const { layout = "absolute-fill" } = other;
5381
5680
  const [id] = useState5(() => String(Math.random()));
5382
- const parentSequence = useContext17(SequenceContext);
5681
+ const parentSequence = useContext18(SequenceContext);
5383
5682
  const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
5384
5683
  const nonce = useNonce();
5385
5684
  if (layout !== "absolute-fill" && layout !== "none") {
@@ -5441,13 +5740,13 @@ var RegularSequenceRefForwardingFunction = ({
5441
5740
  const absoluteFrom = (parentSequence?.absoluteFrom ?? 0) + effectiveRelativeFrom;
5442
5741
  const parentSequenceDuration = parentSequence ? Math.min(parentSequence.durationInFrames - effectiveRelativeFrom, durationInFrames) : durationInFrames;
5443
5742
  const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
5444
- const { registerSequence, unregisterSequence } = useContext17(SequenceManager);
5445
- const wrapperRefForOutline = useRef5(null);
5743
+ const { registerSequence, unregisterSequence } = useContext18(SequenceManager);
5744
+ const wrapperRefForOutline = useRef6(null);
5446
5745
  const refForOutline = other.layout === "none" ? passedRefForOutline ?? null : passedRefForOutline ?? wrapperRefForOutline;
5447
- const premounting = useMemo14(() => {
5746
+ const premounting = useMemo15(() => {
5448
5747
  return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
5449
5748
  }, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
5450
- const postmounting = useMemo14(() => {
5749
+ const postmounting = useMemo15(() => {
5451
5750
  return parentSequence?.postmounting || Boolean(other._remotionInternalIsPostmounting);
5452
5751
  }, [other._remotionInternalIsPostmounting, parentSequence?.postmounting]);
5453
5752
  const currentSequenceStart = cumulatedFrom + effectiveRelativeFrom;
@@ -5455,7 +5754,7 @@ var RegularSequenceRefForwardingFunction = ({
5455
5754
  const parentFirstFrame = parentSequence ? parentSequenceStart - parentSequence.cumulatedNegativeFrom : 0;
5456
5755
  const firstFrame = Math.max(0, parentFirstFrame, currentSequenceStart);
5457
5756
  const cumulatedNegativeFrom = currentSequenceStart - firstFrame;
5458
- const contextValue = useMemo14(() => {
5757
+ const contextValue = useMemo15(() => {
5459
5758
  return {
5460
5759
  absoluteFrom,
5461
5760
  cumulatedFrom,
@@ -5486,13 +5785,13 @@ var RegularSequenceRefForwardingFunction = ({
5486
5785
  postmountDisplay,
5487
5786
  cumulatedNegativeFrom
5488
5787
  ]);
5489
- const timelineClipName = useMemo14(() => {
5788
+ const timelineClipName = useMemo15(() => {
5490
5789
  return name ?? "";
5491
5790
  }, [name]);
5492
5791
  const resolvedDocumentationLink = documentationLink ?? "https://www.remotion.dev/docs/sequence";
5493
5792
  const env = useRemotionEnvironment();
5494
- const isInsideSeries = useContext17(IsInsideSeriesContext);
5495
- const stackRef = useRef5(null);
5793
+ const isInsideSeries = useContext18(IsInsideSeriesContext);
5794
+ const stackRef = useRef6(null);
5496
5795
  stackRef.current = controls ? getStackForControls(controls) ?? stack ?? null : stack ?? null;
5497
5796
  const registeredFrozenFrame = typeof freeze === "number" ? freeze : null;
5498
5797
  const registeredTrimBefore = trimBefore === 0 ? null : trimBefore;
@@ -5500,7 +5799,7 @@ var RegularSequenceRefForwardingFunction = ({
5500
5799
  const startMediaFrom = isMedia && isMedia.type !== "image" ? isMedia.data.startMediaFrom + parentCumulatedNegativeFrom - cumulatedNegativeFrom : null;
5501
5800
  const mediaFrameAtSequenceZero = isMedia && isMedia.type !== "image" ? isMedia.data.startMediaFrom + parentCumulatedNegativeFrom : null;
5502
5801
  const frozenMediaFrame = isMedia && isMedia.type !== "image" && mediaFrameAtSequenceZero !== null ? registeredFrozenFrame === null ? null : mediaFrameAtSequenceZero + (loopDisplay ? registeredFrozenFrame % loopDisplay.durationInFrames : registeredFrozenFrame) * isMedia.data.playbackRate : null;
5503
- useEffect2(() => {
5802
+ useEffect3(() => {
5504
5803
  if (!env.isStudio) {
5505
5804
  return;
5506
5805
  }
@@ -5621,7 +5920,7 @@ var RegularSequenceRefForwardingFunction = ({
5621
5920
  ]);
5622
5921
  const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
5623
5922
  const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
5624
- const frozenContent = content === null || typeof freeze === "undefined" || freeze === null ? content : /* @__PURE__ */ jsx10(Freeze, {
5923
+ const frozenContent = content === null || typeof freeze === "undefined" || freeze === null ? content : /* @__PURE__ */ jsx12(Freeze, {
5625
5924
  frame: freeze,
5626
5925
  children: content
5627
5926
  });
@@ -5633,7 +5932,7 @@ var RegularSequenceRefForwardingFunction = ({
5633
5932
  bottom: resolvedCropBottom,
5634
5933
  style: styleIfThere
5635
5934
  });
5636
- const sequenceRef = useCallback5((node) => {
5935
+ const sequenceRef = useCallback6((node) => {
5637
5936
  wrapperRefForOutline.current = node;
5638
5937
  if (typeof ref === "function") {
5639
5938
  ref(node);
@@ -5641,7 +5940,7 @@ var RegularSequenceRefForwardingFunction = ({
5641
5940
  ref.current = node;
5642
5941
  }
5643
5942
  }, [ref]);
5644
- const defaultStyle = useMemo14(() => {
5943
+ const defaultStyle = useMemo15(() => {
5645
5944
  return {
5646
5945
  flexDirection: undefined,
5647
5946
  ...width ? { width } : {},
@@ -5658,9 +5957,9 @@ var RegularSequenceRefForwardingFunction = ({
5658
5957
  if (hidden) {
5659
5958
  return null;
5660
5959
  }
5661
- return /* @__PURE__ */ jsx10(SequenceContext.Provider, {
5960
+ return /* @__PURE__ */ jsx12(SequenceContext.Provider, {
5662
5961
  value: contextValue,
5663
- children: frozenContent === null ? null : other.layout === "none" ? frozenContent : /* @__PURE__ */ jsx10(AbsoluteFillElement, {
5962
+ children: frozenContent === null ? null : other.layout === "none" ? frozenContent : /* @__PURE__ */ jsx12(AbsoluteFillElement, {
5664
5963
  ref: sequenceRef,
5665
5964
  style: defaultStyle,
5666
5965
  className: other.className,
@@ -5699,10 +5998,10 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
5699
5998
  styleWhilePostmounted: styleWhilePostmounted ?? null,
5700
5999
  hideWhilePremounted: "opacity"
5701
6000
  });
5702
- return /* @__PURE__ */ jsx10(Freeze, {
6001
+ return /* @__PURE__ */ jsx12(Freeze, {
5703
6002
  frame: freezeFrame,
5704
6003
  active: isPremountingOrPostmounting,
5705
- children: /* @__PURE__ */ jsx10(SequenceInner, {
6004
+ children: /* @__PURE__ */ jsx12(SequenceInner, {
5706
6005
  ref,
5707
6006
  from,
5708
6007
  durationInFrames,
@@ -5722,14 +6021,14 @@ var SequenceRefForwardingFunction = (props, ref) => {
5722
6021
  if (props.layout !== "none" && !env.isRendering) {
5723
6022
  const effectivePremountFor = ENABLE_V5_BREAKING_CHANGES ? props.premountFor ?? fps : props.premountFor;
5724
6023
  if (effectivePremountFor || props.postmountFor) {
5725
- return /* @__PURE__ */ jsx10(PremountedPostmountedSequence, {
6024
+ return /* @__PURE__ */ jsx12(PremountedPostmountedSequence, {
5726
6025
  ref,
5727
6026
  ...props,
5728
6027
  premountFor: effectivePremountFor
5729
6028
  });
5730
6029
  }
5731
6030
  }
5732
- return /* @__PURE__ */ jsx10(RegularSequence, {
6031
+ return /* @__PURE__ */ jsx12(RegularSequence, {
5733
6032
  ...props,
5734
6033
  ref
5735
6034
  });
@@ -5781,19 +6080,19 @@ var AbsoluteFillInner = ({
5781
6080
  ...divProps
5782
6081
  }) => {
5783
6082
  const videoConfig = useUnsafeVideoConfig();
5784
- const refForOutline = useRef6(null);
5785
- const callbackRef = useCallback6((element) => {
6083
+ const refForOutline = useRef7(null);
6084
+ const callbackRef = useCallback7((element) => {
5786
6085
  refForOutline.current = element;
5787
6086
  setRef(ref, element);
5788
6087
  }, [ref]);
5789
6088
  if (videoConfig === null) {
5790
- return hidden ? null : /* @__PURE__ */ jsx11(AbsoluteFillElement, {
6089
+ return hidden ? null : /* @__PURE__ */ jsx13(AbsoluteFillElement, {
5791
6090
  ref: callbackRef,
5792
6091
  ...divProps,
5793
6092
  children
5794
6093
  });
5795
6094
  }
5796
- return /* @__PURE__ */ jsx11(Sequence, {
6095
+ return /* @__PURE__ */ jsx13(Sequence, {
5797
6096
  layout: "none",
5798
6097
  from: from ?? 0,
5799
6098
  trimBefore,
@@ -5806,7 +6105,7 @@ var AbsoluteFillInner = ({
5806
6105
  _remotionInternalStack: stack,
5807
6106
  _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/absolute-fill",
5808
6107
  outlineRef: refForOutline,
5809
- children: /* @__PURE__ */ jsx11(AbsoluteFillElement, {
6108
+ children: /* @__PURE__ */ jsx13(AbsoluteFillElement, {
5810
6109
  ref: callbackRef,
5811
6110
  ...divProps,
5812
6111
  children
@@ -5821,305 +6120,6 @@ var AbsoluteFill = withInteractivitySchema({
5821
6120
  supportsEffects: false
5822
6121
  });
5823
6122
  addSequenceStackTraces(AbsoluteFill);
5824
- var rotate = {
5825
- transform: `rotate(90deg)`
5826
- };
5827
- var ICON_SIZE = 40;
5828
- var label = {
5829
- color: "white",
5830
- fontSize: 14,
5831
- fontFamily: "sans-serif"
5832
- };
5833
- var container = {
5834
- justifyContent: "center",
5835
- alignItems: "center"
5836
- };
5837
- var Loading = () => {
5838
- return /* @__PURE__ */ jsxs2(AbsoluteFill, {
5839
- style: container,
5840
- id: "remotion-comp-loading",
5841
- children: [
5842
- /* @__PURE__ */ jsx12("style", {
5843
- type: "text/css",
5844
- children: `
5845
- @keyframes anim {
5846
- from {
5847
- opacity: 0
5848
- }
5849
- to {
5850
- opacity: 1
5851
- }
5852
- }
5853
- #remotion-comp-loading {
5854
- animation: anim 2s;
5855
- animation-fill-mode: forwards;
5856
- }
5857
- `
5858
- }),
5859
- /* @__PURE__ */ jsx12("svg", {
5860
- width: ICON_SIZE,
5861
- height: ICON_SIZE,
5862
- viewBox: "-100 -100 400 400",
5863
- style: rotate,
5864
- children: /* @__PURE__ */ jsx12("path", {
5865
- fill: "#555",
5866
- stroke: "#555",
5867
- strokeWidth: "100",
5868
- strokeLinejoin: "round",
5869
- d: "M 2 172 a 196 100 0 0 0 195 5 A 196 240 0 0 0 100 2.259 A 196 240 0 0 0 2 172 z"
5870
- })
5871
- }),
5872
- /* @__PURE__ */ jsxs2("p", {
5873
- style: label,
5874
- children: [
5875
- "Resolving ",
5876
- "<Suspense>",
5877
- "..."
5878
- ]
5879
- })
5880
- ]
5881
- });
5882
- };
5883
- var _portalNode = null;
5884
- var portalNode = () => {
5885
- if (!_portalNode) {
5886
- if (typeof document === "undefined") {
5887
- throw new Error("Tried to call an API that only works in the browser from outside the browser");
5888
- }
5889
- _portalNode = document.createElement("div");
5890
- _portalNode.style.position = "absolute";
5891
- _portalNode.style.top = "0px";
5892
- _portalNode.style.left = "0px";
5893
- _portalNode.style.right = "0px";
5894
- _portalNode.style.bottom = "0px";
5895
- _portalNode.style.width = "100%";
5896
- _portalNode.style.height = "100%";
5897
- _portalNode.style.display = "flex";
5898
- _portalNode.style.flexDirection = "column";
5899
- const containerNode = document.createElement("div");
5900
- containerNode.style.position = "fixed";
5901
- containerNode.style.top = -999999 + "px";
5902
- containerNode.appendChild(_portalNode);
5903
- document.body.appendChild(containerNode);
5904
- }
5905
- return _portalNode;
5906
- };
5907
- var useLazyComponent = ({
5908
- compProps,
5909
- componentName,
5910
- noSuspense
5911
- }) => {
5912
- const componentRef = useRef7(null);
5913
- if ("component" in compProps) {
5914
- componentRef.current = compProps.component;
5915
- }
5916
- const lazy = useMemo15(() => {
5917
- if ("component" in compProps) {
5918
- if (typeof document === "undefined" || noSuspense) {
5919
- return compProps.component;
5920
- }
5921
- if (typeof compProps.component === "undefined") {
5922
- throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${componentName}/> component.`);
5923
- }
5924
- const Wrapper = (props) => {
5925
- const Comp = componentRef.current;
5926
- return React15.createElement(Comp, props);
5927
- };
5928
- return Wrapper;
5929
- }
5930
- if ("lazyComponent" in compProps && typeof compProps.lazyComponent !== "undefined") {
5931
- if (typeof compProps.lazyComponent === "undefined") {
5932
- throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${componentName}/> component.`);
5933
- }
5934
- return React15.lazy(compProps.lazyComponent);
5935
- }
5936
- throw new Error("You must pass either 'component' or 'lazyComponent'");
5937
- }, [compProps.lazyComponent]);
5938
- return lazy;
5939
- };
5940
- var getRegex2 = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
5941
- var isCompositionIdValid = (id) => id.match(getRegex2());
5942
- var validateCompositionId = (id) => {
5943
- if (!isCompositionIdValid(id)) {
5944
- throw new Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${id}`);
5945
- }
5946
- };
5947
- var invalidCompositionErrorMessage = `Composition ID must match ${String(getRegex2())}`;
5948
- var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
5949
- if (!defaultProps) {
5950
- return;
5951
- }
5952
- if (typeof defaultProps !== "object") {
5953
- throw new Error(`"${name}" must be an object, but you passed a value of type ${typeof defaultProps}`);
5954
- }
5955
- if (Array.isArray(defaultProps)) {
5956
- throw new Error(`"${name}" must be an object, an array was passed ${compositionId ? `for composition "${compositionId}"` : ""}`);
5957
- }
5958
- };
5959
- var Fallback = () => {
5960
- const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
5961
- useEffect3(() => {
5962
- const fallback = delayRender2("Waiting for Root component to unsuspend");
5963
- return () => continueRender2(fallback);
5964
- }, [continueRender2, delayRender2]);
5965
- return null;
5966
- };
5967
- var InnerComposition = ({
5968
- width,
5969
- height,
5970
- fps,
5971
- durationInFrames,
5972
- id,
5973
- defaultProps,
5974
- schema,
5975
- ...compProps
5976
- }) => {
5977
- const compManager = useContext18(CompositionSetters);
5978
- const { registerComposition, unregisterComposition } = compManager;
5979
- const video = useVideo();
5980
- const lazy = useLazyComponent({
5981
- compProps,
5982
- componentName: "Composition",
5983
- noSuspense: false
5984
- });
5985
- const nonce = useNonce();
5986
- const isPlayer = useIsPlayer();
5987
- const environment = useRemotionEnvironment();
5988
- const canUseComposition = useContext18(CanUseRemotionHooks);
5989
- if (typeof window !== "undefined") {
5990
- window.remotion_seenCompositionIds = Array.from(new Set([...window.remotion_seenCompositionIds ?? [], id]));
5991
- }
5992
- if (canUseComposition) {
5993
- if (isPlayer) {
5994
- throw new Error("<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help.");
5995
- }
5996
- throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
5997
- }
5998
- const { folderName, parentName } = useContext18(FolderContext);
5999
- const stack = compProps._remotionInternalStack ?? null;
6000
- const componentFromProps = "component" in compProps ? compProps.component : null;
6001
- useEffect3(() => {
6002
- if (!id) {
6003
- throw new Error("No id for composition passed.");
6004
- }
6005
- validateCompositionId(id);
6006
- validateDefaultAndInputProps(defaultProps, "defaultProps", id);
6007
- registerComposition({
6008
- durationInFrames: durationInFrames ?? undefined,
6009
- fps: fps ?? undefined,
6010
- height: height ?? undefined,
6011
- width: width ?? undefined,
6012
- id,
6013
- folderName,
6014
- component: lazy,
6015
- defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
6016
- nonce: nonce.get(),
6017
- parentFolderName: parentName,
6018
- componentFromProps,
6019
- schema: schema ?? null,
6020
- calculateMetadata: compProps.calculateMetadata ?? null,
6021
- stack
6022
- });
6023
- return () => {
6024
- unregisterComposition(id);
6025
- };
6026
- }, [
6027
- durationInFrames,
6028
- fps,
6029
- height,
6030
- lazy,
6031
- id,
6032
- folderName,
6033
- defaultProps,
6034
- width,
6035
- nonce,
6036
- parentName,
6037
- componentFromProps,
6038
- schema,
6039
- compProps.calculateMetadata,
6040
- stack,
6041
- registerComposition,
6042
- unregisterComposition
6043
- ]);
6044
- const resolved = useResolvedVideoConfig(id);
6045
- const { setError, clearError } = useContext18(CompositionRenderErrorContext);
6046
- const onError = useCallback7((error2) => {
6047
- setError(error2);
6048
- }, [setError]);
6049
- const onClear = useCallback7(() => {
6050
- clearError();
6051
- }, [clearError]);
6052
- if (environment.isStudio && video && video.component === lazy && video.id === id) {
6053
- const Comp = lazy;
6054
- if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
6055
- return null;
6056
- }
6057
- return createPortal(/* @__PURE__ */ jsx13(CanUseRemotionHooksProvider, {
6058
- children: /* @__PURE__ */ jsx13(CompositionErrorBoundary, {
6059
- onError,
6060
- onClear,
6061
- children: /* @__PURE__ */ jsx13(Suspense, {
6062
- fallback: /* @__PURE__ */ jsx13(Loading, {}),
6063
- children: /* @__PURE__ */ jsx13(Comp, {
6064
- ...resolved.result.props ?? {}
6065
- })
6066
- })
6067
- })
6068
- }), portalNode());
6069
- }
6070
- if (environment.isRendering && video && video.component === lazy && video.id === id) {
6071
- const Comp = lazy;
6072
- if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
6073
- return null;
6074
- }
6075
- return createPortal(/* @__PURE__ */ jsx13(CanUseRemotionHooksProvider, {
6076
- children: /* @__PURE__ */ jsx13(Suspense, {
6077
- fallback: /* @__PURE__ */ jsx13(Fallback, {}),
6078
- children: /* @__PURE__ */ jsx13(Comp, {
6079
- ...resolved.result.props ?? {}
6080
- })
6081
- })
6082
- }), portalNode());
6083
- }
6084
- return null;
6085
- };
6086
- var Composition = (props) => {
6087
- const { onlyRenderComposition } = useContext18(CompositionSetters);
6088
- if (onlyRenderComposition && onlyRenderComposition !== props.id) {
6089
- return null;
6090
- }
6091
- return /* @__PURE__ */ jsx13(InnerComposition, {
6092
- ...props
6093
- });
6094
- };
6095
- var VERSION = "4.0.502";
6096
- var checkMultipleRemotionVersions = () => {
6097
- if (typeof globalThis === "undefined") {
6098
- return;
6099
- }
6100
- const set = () => {
6101
- globalThis.remotion_imported = VERSION;
6102
- if (typeof window !== "undefined") {
6103
- window.remotion_imported = VERSION;
6104
- }
6105
- };
6106
- const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
6107
- if (alreadyImported) {
6108
- if (alreadyImported === VERSION) {
6109
- return;
6110
- }
6111
- if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
6112
- set();
6113
- return;
6114
- }
6115
- throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
6116
- VERSION,
6117
- typeof alreadyImported === "string" ? alreadyImported : "an older version"
6118
- ].filter(truthy).join(" and ")}. This will cause things to break in an unexpected way.
6119
- 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.`);
6120
- }
6121
- set();
6122
- };
6123
6123
  var useCropStyle = ({
6124
6124
  cropLeft,
6125
6125
  cropRight,
@@ -14405,7 +14405,7 @@ import { useMemo as useMemo55 } from "react";
14405
14405
 
14406
14406
  // ../design/dist/esm/index.mjs
14407
14407
  import * as React25 from "react";
14408
- import * as React7 from "react";
14408
+ import * as React8 from "react";
14409
14409
  import { Fragment as Fragment22, jsx as jsx46 } from "react/jsx-runtime";
14410
14410
  import React52, { useCallback as useCallback28, useRef as useRef210, useState as useState22 } from "react";
14411
14411
 
@@ -21442,21 +21442,21 @@ import { jsx as jsx113 } from "react/jsx-runtime";
21442
21442
  import { jsx as jsx123 } from "react/jsx-runtime";
21443
21443
  import * as React362 from "react";
21444
21444
  import * as ReactDOM4 from "react-dom";
21445
- import React112 from "react";
21445
+ import React11 from "react";
21446
21446
  import * as React82 from "react";
21447
21447
  import { jsx as jsx132 } from "react/jsx-runtime";
21448
- import * as React9 from "react";
21449
- import * as React102 from "react";
21448
+ import * as React92 from "react";
21449
+ import * as React10 from "react";
21450
21450
  import { Fragment as Fragment5, jsx as jsx142 } from "react/jsx-runtime";
21451
21451
  import { jsx as jsx152 } from "react/jsx-runtime";
21452
21452
  import * as React122 from "react";
21453
21453
  import { jsx as jsx162 } from "react/jsx-runtime";
21454
21454
  import * as React16 from "react";
21455
- import * as React13 from "react";
21455
+ import * as React132 from "react";
21456
21456
  import * as ReactDOM from "react-dom";
21457
21457
  import { jsx as jsx172 } from "react/jsx-runtime";
21458
- import * as React14 from "react";
21459
- import * as React152 from "react";
21458
+ import * as React142 from "react";
21459
+ import * as React15 from "react";
21460
21460
  import { jsx as jsx182 } from "react/jsx-runtime";
21461
21461
  import * as React172 from "react";
21462
21462
  import * as React182 from "react";
@@ -21553,7 +21553,7 @@ function composeRefs(...refs) {
21553
21553
  };
21554
21554
  }
21555
21555
  function useComposedRefs(...refs) {
21556
- return React7.useCallback(composeRefs(...refs), refs);
21556
+ return React8.useCallback(composeRefs(...refs), refs);
21557
21557
  }
21558
21558
  var REACT_LAZY_TYPE = Symbol.for("react.lazy");
21559
21559
  var use = React25[" use ".trim().toString()];
@@ -22342,45 +22342,45 @@ function composeRefs2(...refs) {
22342
22342
  return (node) => refs.forEach((ref) => setRef22(ref, node));
22343
22343
  }
22344
22344
  function useComposedRefs2(...refs) {
22345
- return React9.useCallback(composeRefs2(...refs), refs);
22345
+ return React92.useCallback(composeRefs2(...refs), refs);
22346
22346
  }
22347
- var Slot2 = React102.forwardRef((props, forwardedRef) => {
22347
+ var Slot2 = React10.forwardRef((props, forwardedRef) => {
22348
22348
  const { children, ...slotProps } = props;
22349
- const childrenArray = React102.Children.toArray(children);
22349
+ const childrenArray = React10.Children.toArray(children);
22350
22350
  const slottable = childrenArray.find(isSlottable2);
22351
22351
  if (slottable) {
22352
22352
  const newElement = slottable.props.children;
22353
22353
  const newChildren = childrenArray.map((child) => {
22354
22354
  if (child === slottable) {
22355
- if (React102.Children.count(newElement) > 1)
22356
- return React102.Children.only(null);
22357
- return React102.isValidElement(newElement) ? newElement.props.children : null;
22355
+ if (React10.Children.count(newElement) > 1)
22356
+ return React10.Children.only(null);
22357
+ return React10.isValidElement(newElement) ? newElement.props.children : null;
22358
22358
  } else {
22359
22359
  return child;
22360
22360
  }
22361
22361
  });
22362
- return /* @__PURE__ */ jsx142(SlotClone, { ...slotProps, ref: forwardedRef, children: React102.isValidElement(newElement) ? React102.cloneElement(newElement, undefined, newChildren) : null });
22362
+ return /* @__PURE__ */ jsx142(SlotClone, { ...slotProps, ref: forwardedRef, children: React10.isValidElement(newElement) ? React10.cloneElement(newElement, undefined, newChildren) : null });
22363
22363
  }
22364
22364
  return /* @__PURE__ */ jsx142(SlotClone, { ...slotProps, ref: forwardedRef, children });
22365
22365
  });
22366
22366
  Slot2.displayName = "Slot";
22367
- var SlotClone = React102.forwardRef((props, forwardedRef) => {
22367
+ var SlotClone = React10.forwardRef((props, forwardedRef) => {
22368
22368
  const { children, ...slotProps } = props;
22369
- if (React102.isValidElement(children)) {
22369
+ if (React10.isValidElement(children)) {
22370
22370
  const childrenRef = getElementRef2(children);
22371
- return React102.cloneElement(children, {
22371
+ return React10.cloneElement(children, {
22372
22372
  ...mergeProps2(slotProps, children.props),
22373
22373
  ref: forwardedRef ? composeRefs2(forwardedRef, childrenRef) : childrenRef
22374
22374
  });
22375
22375
  }
22376
- return React102.Children.count(children) > 1 ? React102.Children.only(null) : null;
22376
+ return React10.Children.count(children) > 1 ? React10.Children.only(null) : null;
22377
22377
  });
22378
22378
  SlotClone.displayName = "SlotClone";
22379
22379
  var Slottable2 = ({ children }) => {
22380
22380
  return /* @__PURE__ */ jsx142(Fragment5, { children });
22381
22381
  };
22382
22382
  function isSlottable2(child) {
22383
- return React102.isValidElement(child) && child.type === Slottable2;
22383
+ return React10.isValidElement(child) && child.type === Slottable2;
22384
22384
  }
22385
22385
  function mergeProps2(slotProps, childProps) {
22386
22386
  const overrideProps = { ...childProps };
@@ -22424,13 +22424,13 @@ function createCollection(name) {
22424
22424
  const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map });
22425
22425
  const CollectionProvider = (props) => {
22426
22426
  const { scope, children } = props;
22427
- const ref = React112.useRef(null);
22428
- const itemMap = React112.useRef(/* @__PURE__ */ new Map).current;
22427
+ const ref = React11.useRef(null);
22428
+ const itemMap = React11.useRef(/* @__PURE__ */ new Map).current;
22429
22429
  return /* @__PURE__ */ jsx152(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
22430
22430
  };
22431
22431
  CollectionProvider.displayName = PROVIDER_NAME;
22432
22432
  const COLLECTION_SLOT_NAME = name + "CollectionSlot";
22433
- const CollectionSlot = React112.forwardRef((props, forwardedRef) => {
22433
+ const CollectionSlot = React11.forwardRef((props, forwardedRef) => {
22434
22434
  const { scope, children } = props;
22435
22435
  const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
22436
22436
  const composedRefs = useComposedRefs2(forwardedRef, context.collectionRef);
@@ -22439,12 +22439,12 @@ function createCollection(name) {
22439
22439
  CollectionSlot.displayName = COLLECTION_SLOT_NAME;
22440
22440
  const ITEM_SLOT_NAME = name + "CollectionItemSlot";
22441
22441
  const ITEM_DATA_ATTR = "data-radix-collection-item";
22442
- const CollectionItemSlot = React112.forwardRef((props, forwardedRef) => {
22442
+ const CollectionItemSlot = React11.forwardRef((props, forwardedRef) => {
22443
22443
  const { scope, children, ...itemData } = props;
22444
- const ref = React112.useRef(null);
22444
+ const ref = React11.useRef(null);
22445
22445
  const composedRefs = useComposedRefs2(forwardedRef, ref);
22446
22446
  const context = useCollectionContext(ITEM_SLOT_NAME, scope);
22447
- React112.useEffect(() => {
22447
+ React11.useEffect(() => {
22448
22448
  context.itemMap.set(ref, { ref, ...itemData });
22449
22449
  return () => void context.itemMap.delete(ref);
22450
22450
  });
@@ -22453,7 +22453,7 @@ function createCollection(name) {
22453
22453
  CollectionItemSlot.displayName = ITEM_SLOT_NAME;
22454
22454
  function useCollection(scope) {
22455
22455
  const context = useCollectionContext(name + "CollectionConsumer", scope);
22456
- const getItems = React112.useCallback(() => {
22456
+ const getItems = React11.useCallback(() => {
22457
22457
  const collectionNode = context.collectionRef.current;
22458
22458
  if (!collectionNode)
22459
22459
  return [];
@@ -22494,7 +22494,7 @@ var NODES = [
22494
22494
  "ul"
22495
22495
  ];
22496
22496
  var Primitive = NODES.reduce((primitive, node) => {
22497
- const Node2 = React13.forwardRef((props, forwardedRef) => {
22497
+ const Node2 = React132.forwardRef((props, forwardedRef) => {
22498
22498
  const { asChild, ...primitiveProps } = props;
22499
22499
  const Comp = asChild ? Slot2 : node;
22500
22500
  if (typeof window !== "undefined") {
@@ -22510,15 +22510,15 @@ function dispatchDiscreteCustomEvent(target, event) {
22510
22510
  ReactDOM.flushSync(() => target.dispatchEvent(event));
22511
22511
  }
22512
22512
  function useCallbackRef(callback) {
22513
- const callbackRef = React14.useRef(callback);
22514
- React14.useEffect(() => {
22513
+ const callbackRef = React142.useRef(callback);
22514
+ React142.useEffect(() => {
22515
22515
  callbackRef.current = callback;
22516
22516
  });
22517
- return React14.useMemo(() => (...args) => callbackRef.current?.(...args), []);
22517
+ return React142.useMemo(() => (...args) => callbackRef.current?.(...args), []);
22518
22518
  }
22519
22519
  function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
22520
22520
  const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
22521
- React152.useEffect(() => {
22521
+ React15.useEffect(() => {
22522
22522
  const handleKeyDown = (event) => {
22523
22523
  if (event.key === "Escape") {
22524
22524
  onEscapeKeyDown(event);
@@ -30539,7 +30539,7 @@ import {
30539
30539
  useRef as useRef122,
30540
30540
  useState as useState132
30541
30541
  } from "react";
30542
- import React103, {
30542
+ import React102, {
30543
30543
  Suspense as Suspense2,
30544
30544
  forwardRef as forwardRef36,
30545
30545
  useCallback as useCallback102,
@@ -32225,7 +32225,7 @@ import {
32225
32225
  useRef as useRef142,
32226
32226
  useState as useState142
32227
32227
  } from "react";
32228
- import React132, {
32228
+ import React133, {
32229
32229
  forwardRef as forwardRef37,
32230
32230
  Suspense as Suspense22,
32231
32231
  useCallback as useCallback122,
@@ -34604,7 +34604,7 @@ var useClickPreventionOnDoubleClick = (onClick, onDoubleClick, doubleClickToFull
34604
34604
  }, [doubleClickToFullscreen, handleDoubleClick, handlePointerDown, onClick]);
34605
34605
  return returnValue;
34606
34606
  };
34607
- var reactVersion = React103.version.split(".")[0];
34607
+ var reactVersion = React102.version.split(".")[0];
34608
34608
  if (reactVersion === "0") {
34609
34609
  throw new Error(`Version ${reactVersion} of "react" is not supported by Remotion`);
34610
34610
  }
@@ -35621,7 +35621,7 @@ var useThumbnail = () => {
35621
35621
  }, [emitter]);
35622
35622
  return returnValue;
35623
35623
  };
35624
- var reactVersion2 = React132.version.split(".")[0];
35624
+ var reactVersion2 = React133.version.split(".")[0];
35625
35625
  if (reactVersion2 === "0") {
35626
35626
  throw new Error(`Version ${reactVersion2} of "react" is not supported by Remotion`);
35627
35627
  }
@@ -44016,7 +44016,7 @@ import {
44016
44016
  import { BufferTarget, StreamTarget } from "mediabunny";
44017
44017
 
44018
44018
  // ../core/dist/esm/version.mjs
44019
- var VERSION2 = "4.0.502";
44019
+ var VERSION2 = "4.0.503";
44020
44020
 
44021
44021
  // ../web-renderer/dist/esm/index.mjs
44022
44022
  import { AudioSample, VideoSample } from "mediabunny";
@@ -44591,15 +44591,17 @@ var runNestedHtmlInCanvasProbe = () => {
44591
44591
  const innerTarget = document.createElement("div");
44592
44592
  const outerCtx = outer.getContext("2d");
44593
44593
  const innerCtx = inner2.getContext("2d");
44594
+ const density = devicePixelRatio;
44595
+ const canvasSize = Math.ceil(4 * density);
44594
44596
  if (!outerCtx || !innerCtx || typeof outer.requestPaint !== "function" || typeof inner2.requestPaint !== "function") {
44595
44597
  return Promise.resolve(false);
44596
44598
  }
44597
44599
  outer.layoutSubtree = true;
44598
44600
  inner2.layoutSubtree = true;
44599
- outer.width = 4;
44600
- outer.height = 4;
44601
- inner2.width = 4;
44602
- inner2.height = 4;
44601
+ outer.width = canvasSize;
44602
+ outer.height = canvasSize;
44603
+ inner2.width = canvasSize;
44604
+ inner2.height = canvasSize;
44603
44605
  Object.assign(outer.style, {
44604
44606
  display: "block",
44605
44607
  height: "4px",
@@ -44650,10 +44652,10 @@ var runNestedHtmlInCanvasProbe = () => {
44650
44652
  inner2.addEventListener("paint", () => {
44651
44653
  try {
44652
44654
  innerCtx.reset();
44655
+ innerCtx.scale(density, density);
44653
44656
  const transform = innerCtx.drawElementImage(innerTarget, 0, 0, 4, 4);
44654
44657
  innerTarget.style.transform = transform.toString();
44655
44658
  innerPainted = true;
44656
- requestAnimationFrame(() => outer.requestPaint());
44657
44659
  } catch {
44658
44660
  settle(false);
44659
44661
  }
@@ -44664,6 +44666,7 @@ var runNestedHtmlInCanvasProbe = () => {
44664
44666
  }
44665
44667
  try {
44666
44668
  outerCtx.reset();
44669
+ outerCtx.scale(density, density);
44667
44670
  if (typeof outer.captureElementImage !== "function") {
44668
44671
  settle(false);
44669
44672
  return;
@@ -44672,13 +44675,15 @@ var runNestedHtmlInCanvasProbe = () => {
44672
44675
  const transform = outerCtx.drawElementImage(elementImage, 0, 0, 4, 4);
44673
44676
  elementImage.close();
44674
44677
  outerTarget.style.transform = transform.toString();
44675
- const pixel = outerCtx.getImageData(2, 2, 1, 1).data;
44678
+ const sampleCoordinate = Math.floor(canvasSize / 2);
44679
+ const pixel = outerCtx.getImageData(sampleCoordinate, sampleCoordinate, 1, 1).data;
44676
44680
  settle(pixel[0] > 200 && pixel[1] < 20 && pixel[2] < 20 && pixel[3] > 200);
44677
44681
  } catch {
44678
44682
  settle(false);
44679
44683
  }
44680
44684
  });
44681
44685
  inner2.requestPaint();
44686
+ outer.requestPaint();
44682
44687
  });
44683
44688
  };
44684
44689
  var supportsNestedHtmlInCanvas = () => {
@@ -48327,9 +48332,21 @@ var processNode = async ({
48327
48332
  }
48328
48333
  }
48329
48334
  const previousTransform = context.getTransform();
48330
- context.setTransform(new DOMMatrix);
48335
+ const is3DPrecomposition = precompositing.needs3DTransformViaWebGL;
48336
+ if (is3DPrecomposition) {
48337
+ context.setTransform(new DOMMatrix);
48338
+ } else {
48339
+ setTransform({
48340
+ ctx: context,
48341
+ transform: totalMatrix,
48342
+ parentRect,
48343
+ scale
48344
+ });
48345
+ }
48346
+ const destinationRect = is3DPrecomposition ? rectAfterTransforms : precomposeRect;
48347
+ const parentOffsetScale = is3DPrecomposition ? scale : 1;
48331
48348
  const drawPrecomposedCanvas = () => {
48332
- context.drawImage(drawable, 0, 0, drawable.width, drawable.height, rectAfterTransforms.left - parentRect.x * scale, rectAfterTransforms.top - parentRect.y * scale, rectAfterTransforms.width, rectAfterTransforms.height);
48349
+ context.drawImage(drawable, 0, 0, drawable.width, drawable.height, destinationRect.left - parentRect.x * parentOffsetScale, destinationRect.top - parentRect.y * parentOffsetScale, destinationRect.width, destinationRect.height);
48333
48350
  };
48334
48351
  if (precompositing.needsFilterPrecompositing) {
48335
48352
  applyFilterToDrawOperation({
@@ -48408,6 +48425,36 @@ var findWords = (span) => {
48408
48425
  }
48409
48426
  return tokens;
48410
48427
  };
48428
+ var fontStretchOptions = [
48429
+ { keyword: "ultra-condensed", percentage: 50 },
48430
+ { keyword: "extra-condensed", percentage: 62.5 },
48431
+ { keyword: "condensed", percentage: 75 },
48432
+ { keyword: "semi-condensed", percentage: 87.5 },
48433
+ { keyword: "normal", percentage: 100 },
48434
+ { keyword: "semi-expanded", percentage: 112.5 },
48435
+ { keyword: "expanded", percentage: 125 },
48436
+ { keyword: "extra-expanded", percentage: 150 },
48437
+ { keyword: "ultra-expanded", percentage: 200 }
48438
+ ];
48439
+ var getCanvasFontStretch = (fontStretch) => {
48440
+ const keyword = fontStretchOptions.find((option) => option.keyword === fontStretch);
48441
+ if (keyword) {
48442
+ return keyword.keyword;
48443
+ }
48444
+ const percentage = Number.parseFloat(fontStretch);
48445
+ if (!Number.isFinite(percentage)) {
48446
+ return "normal";
48447
+ }
48448
+ let closest = fontStretchOptions[0];
48449
+ for (const option of fontStretchOptions.slice(1)) {
48450
+ const distance2 = Math.abs(option.percentage - percentage);
48451
+ const closestDistance = Math.abs(closest.percentage - percentage);
48452
+ if (distance2 < closestDistance || distance2 === closestDistance && percentage >= 100) {
48453
+ closest = option;
48454
+ }
48455
+ }
48456
+ return closest.keyword;
48457
+ };
48411
48458
  var parsePaintOrder = (paintOrder) => {
48412
48459
  const paintOrderValue = paintOrder || "normal";
48413
48460
  const paintOrderParts = paintOrderValue === "normal" ? ["fill", "stroke"] : paintOrderValue.split(/\s+/).filter(Boolean);
@@ -48666,7 +48713,7 @@ var drawText = ({
48666
48713
  contextToDraw.font = `${fontStyle} ${fontWeight} ${fontSizePx}px ${fontFamily}`;
48667
48714
  contextToDraw.fontVariantCaps = fontVariantCaps;
48668
48715
  contextToDraw.fontKerning = fontKerning;
48669
- contextToDraw.fontStretch = fontStretch;
48716
+ contextToDraw.fontStretch = getCanvasFontStretch(fontStretch);
48670
48717
  contextToDraw.textRendering = textRendering;
48671
48718
  contextToDraw.fillStyle = onlyBackgroundClipText ? "black" : webkitTextFillColor;
48672
48719
  contextToDraw.letterSpacing = letterSpacing;