@remotion/promo-pages 4.0.498 → 4.0.500

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.
@@ -18712,7 +18712,7 @@ var getDefaultConfig = () => {
18712
18712
  var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
18713
18713
 
18714
18714
  // ../design/dist/esm/index.mjs
18715
- import React33, { useEffect as useEffect21, useMemo as useMemo43, useState as useState23 } from "react";
18715
+ import React33, { useEffect as useEffect21, useMemo as useMemo44, useState as useState23 } from "react";
18716
18716
 
18717
18717
  // ../paths/dist/esm/index.mjs
18718
18718
  var cutLInstruction = ({
@@ -21548,8 +21548,9 @@ import {
21548
21548
  useRef as useRef9,
21549
21549
  useState as useState6
21550
21550
  } from "react";
21551
- import React16, { useCallback as useCallback7, useImperativeHandle, useMemo as useMemo17, useRef as useRef8 } from "react";
21552
- import { useEffect as useEffect4, useMemo as useMemo16, useRef as useRef7 } from "react";
21551
+ import { useMemo as useMemo16 } from "react";
21552
+ import React16, { useCallback as useCallback7, useImperativeHandle, useMemo as useMemo18, useRef as useRef8 } from "react";
21553
+ import { useEffect as useEffect4, useMemo as useMemo17, useRef as useRef7 } from "react";
21553
21554
  import { jsx as jsx13 } from "react/jsx-runtime";
21554
21555
  import { jsx as jsx14 } from "react/jsx-runtime";
21555
21556
  import { useContext as useContext19, useLayoutEffect as useLayoutEffect4, useState as useState8 } from "react";
@@ -21558,18 +21559,18 @@ import {
21558
21559
  useCallback as useCallback8,
21559
21560
  useImperativeHandle as useImperativeHandle3,
21560
21561
  useLayoutEffect as useLayoutEffect3,
21561
- useMemo as useMemo18,
21562
+ useMemo as useMemo19,
21562
21563
  useRef as useRef10,
21563
21564
  useState as useState7
21564
21565
  } from "react";
21565
21566
  import { jsx as jsx15 } from "react/jsx-runtime";
21566
21567
  import { forwardRef as forwardRef7, useCallback as useCallback14, useContext as useContext31 } from "react";
21567
- import React17, { createContext as createContext18, useMemo as useMemo19 } from "react";
21568
+ import React17, { createContext as createContext18, useMemo as useMemo20 } from "react";
21568
21569
  import { jsx as jsx16 } from "react/jsx-runtime";
21569
21570
  import { useContext as useContext20 } from "react";
21570
21571
  import { createContext as createContext19, useEffect as useEffect6, useState as useState9 } from "react";
21571
21572
  import { jsx as jsx17 } from "react/jsx-runtime";
21572
- import { createContext as createContext20, useMemo as useMemo20, useReducer } from "react";
21573
+ import { createContext as createContext20, useMemo as useMemo21, useReducer } from "react";
21573
21574
  import { jsx as jsx18 } from "react/jsx-runtime";
21574
21575
  import { useCallback as useCallback13 } from "react";
21575
21576
  import React23, {
@@ -21577,7 +21578,7 @@ import React23, {
21577
21578
  useContext as useContext29,
21578
21579
  useEffect as useEffect14,
21579
21580
  useImperativeHandle as useImperativeHandle4,
21580
- useMemo as useMemo28,
21581
+ useMemo as useMemo29,
21581
21582
  useRef as useRef19,
21582
21583
  useState as useState14
21583
21584
  } from "react";
@@ -21588,14 +21589,14 @@ import React20, {
21588
21589
  useCallback as useCallback9,
21589
21590
  useContext as useContext21,
21590
21591
  useEffect as useEffect7,
21591
- useMemo as useMemo22,
21592
+ useMemo as useMemo23,
21592
21593
  useRef as useRef12,
21593
21594
  useState as useState10
21594
21595
  } from "react";
21595
- import { useMemo as useMemo21, useRef as useRef11 } from "react";
21596
+ import { useMemo as useMemo22, useRef as useRef11 } from "react";
21596
21597
  import { jsx as jsx19, jsxs as jsxs2 } from "react/jsx-runtime";
21597
21598
  import { useRef as useRef13 } from "react";
21598
- import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo23, useState as useState11 } from "react";
21599
+ import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo24, useState as useState11 } from "react";
21599
21600
  import { useContext as useContext23 } from "react";
21600
21601
  import {
21601
21602
  useCallback as useCallback12,
@@ -21604,14 +21605,14 @@ import {
21604
21605
  useLayoutEffect as useLayoutEffect7,
21605
21606
  useRef as useRef18
21606
21607
  } from "react";
21607
- import { useCallback as useCallback11, useMemo as useMemo26, useRef as useRef16 } from "react";
21608
- import { useContext as useContext26, useMemo as useMemo25 } from "react";
21608
+ import { useCallback as useCallback11, useMemo as useMemo27, useRef as useRef16 } from "react";
21609
+ import { useContext as useContext26, useMemo as useMemo26 } from "react";
21609
21610
  import React21, {
21610
21611
  useCallback as useCallback10,
21611
21612
  useContext as useContext25,
21612
21613
  useEffect as useEffect9,
21613
21614
  useLayoutEffect as useLayoutEffect6,
21614
- useMemo as useMemo24,
21615
+ useMemo as useMemo25,
21615
21616
  useRef as useRef15,
21616
21617
  useState as useState12
21617
21618
  } from "react";
@@ -21620,7 +21621,7 @@ import React22 from "react";
21620
21621
  import { useEffect as useEffect10, useState as useState13 } from "react";
21621
21622
  import { useEffect as useEffect11, useRef as useRef17 } from "react";
21622
21623
  import { useEffect as useEffect13 } from "react";
21623
- import { createContext as createContext22, useContext as useContext28, useMemo as useMemo27 } from "react";
21624
+ import { createContext as createContext22, useContext as useContext28, useMemo as useMemo28 } from "react";
21624
21625
  import { jsx as jsx21 } from "react/jsx-runtime";
21625
21626
  import {
21626
21627
  forwardRef as forwardRef6,
@@ -21628,7 +21629,7 @@ import {
21628
21629
  useEffect as useEffect15,
21629
21630
  useImperativeHandle as useImperativeHandle5,
21630
21631
  useLayoutEffect as useLayoutEffect8,
21631
- useMemo as useMemo29,
21632
+ useMemo as useMemo30,
21632
21633
  useRef as useRef20
21633
21634
  } from "react";
21634
21635
  import { jsx as jsx22 } from "react/jsx-runtime";
@@ -21638,7 +21639,7 @@ import {
21638
21639
  useCallback as useCallback15,
21639
21640
  useEffect as useEffect16,
21640
21641
  useImperativeHandle as useImperativeHandle6,
21641
- useMemo as useMemo30,
21642
+ useMemo as useMemo31,
21642
21643
  useRef as useRef21,
21643
21644
  useState as useState15
21644
21645
  } from "react";
@@ -21649,7 +21650,7 @@ import {
21649
21650
  useCallback as useCallback16,
21650
21651
  useContext as useContext32,
21651
21652
  useLayoutEffect as useLayoutEffect9,
21652
- useMemo as useMemo31,
21653
+ useMemo as useMemo32,
21653
21654
  useRef as useRef22
21654
21655
  } from "react";
21655
21656
  import { jsx as jsx25 } from "react/jsx-runtime";
@@ -21659,7 +21660,7 @@ import {
21659
21660
  useContext as useContext33,
21660
21661
  useImperativeHandle as useImperativeHandle7,
21661
21662
  useLayoutEffect as useLayoutEffect10,
21662
- useMemo as useMemo32,
21663
+ useMemo as useMemo33,
21663
21664
  useRef as useRef23,
21664
21665
  useState as useState16
21665
21666
  } from "react";
@@ -21681,14 +21682,14 @@ import React31 from "react";
21681
21682
  import {
21682
21683
  useCallback as useCallback21,
21683
21684
  useImperativeHandle as useImperativeHandle8,
21684
- useMemo as useMemo33,
21685
+ useMemo as useMemo34,
21685
21686
  useRef as useRef26,
21686
21687
  useState as useState19
21687
21688
  } from "react";
21688
21689
  import { jsx as jsx30 } from "react/jsx-runtime";
21689
21690
  import React32 from "react";
21690
- import { useMemo as useMemo35 } from "react";
21691
- import { createContext as createContext24, useContext as useContext35, useMemo as useMemo34 } from "react";
21691
+ import { useMemo as useMemo36 } from "react";
21692
+ import { createContext as createContext24, useContext as useContext35, useMemo as useMemo35 } from "react";
21692
21693
  import { jsx as jsx31 } from "react/jsx-runtime";
21693
21694
  import { jsx as jsx32 } from "react/jsx-runtime";
21694
21695
  import React34 from "react";
@@ -21700,7 +21701,7 @@ import {
21700
21701
  useContext as useContext37,
21701
21702
  useEffect as useEffect17,
21702
21703
  useLayoutEffect as useLayoutEffect12,
21703
- useMemo as useMemo36,
21704
+ useMemo as useMemo37,
21704
21705
  useState as useState20
21705
21706
  } from "react";
21706
21707
  import { jsx as jsx33 } from "react/jsx-runtime";
@@ -21710,18 +21711,18 @@ import React38, {
21710
21711
  useContext as useContext38,
21711
21712
  useEffect as useEffect19,
21712
21713
  useImperativeHandle as useImperativeHandle9,
21713
- useMemo as useMemo37,
21714
+ useMemo as useMemo38,
21714
21715
  useRef as useRef27,
21715
21716
  useState as useState21
21716
21717
  } from "react";
21717
21718
  import { useEffect as useEffect18 } from "react";
21718
21719
  import { jsx as jsx34 } from "react/jsx-runtime";
21719
21720
  import { jsx as jsx35 } from "react/jsx-runtime";
21720
- import React40, { useMemo as useMemo38 } from "react";
21721
+ import React40, { useMemo as useMemo39 } from "react";
21721
21722
  import { jsx as jsx36 } from "react/jsx-runtime";
21722
21723
  import React42, {
21723
21724
  forwardRef as forwardRef14,
21724
- useMemo as useMemo39
21725
+ useMemo as useMemo40
21725
21726
  } from "react";
21726
21727
  import React41 from "react";
21727
21728
  import { jsx as jsx37, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
@@ -21733,7 +21734,7 @@ import {
21733
21734
  useEffect as useEffect20,
21734
21735
  useImperativeHandle as useImperativeHandle10,
21735
21736
  useLayoutEffect as useLayoutEffect13,
21736
- useMemo as useMemo40,
21737
+ useMemo as useMemo41,
21737
21738
  useRef as useRef28
21738
21739
  } from "react";
21739
21740
  import { jsx as jsx38 } from "react/jsx-runtime";
@@ -22913,7 +22914,7 @@ var getSingleChildComponent = (children) => {
22913
22914
  }
22914
22915
  return child.type;
22915
22916
  };
22916
- var VERSION = "4.0.498";
22917
+ var VERSION = "4.0.500";
22917
22918
  var checkMultipleRemotionVersions = () => {
22918
22919
  if (typeof globalThis === "undefined") {
22919
22920
  return;
@@ -22955,38 +22956,6 @@ __export2(exports_timeline_position_state, {
22955
22956
  getFrameForComposition: () => getFrameForComposition,
22956
22957
  clampFrameToCompositionRange: () => clampFrameToCompositionRange
22957
22958
  });
22958
- function mulberry32(a) {
22959
- let t = a + 1831565813;
22960
- t = Math.imul(t ^ t >>> 15, t | 1);
22961
- t ^= t + Math.imul(t ^ t >>> 7, t | 61);
22962
- return ((t ^ t >>> 14) >>> 0) / 4294967296;
22963
- }
22964
- function hashCode(str) {
22965
- let i = 0;
22966
- let chr = 0;
22967
- let hash = 0;
22968
- for (i = 0;i < str.length; i++) {
22969
- chr = str.charCodeAt(i);
22970
- hash = (hash << 5) - hash + chr;
22971
- hash |= 0;
22972
- }
22973
- return hash;
22974
- }
22975
- var random = (seed, dummy) => {
22976
- if (dummy !== undefined) {
22977
- throw new TypeError("random() takes only one argument");
22978
- }
22979
- if (seed === null) {
22980
- return Math.random();
22981
- }
22982
- if (typeof seed === "string") {
22983
- return mulberry32(hashCode(seed));
22984
- }
22985
- if (typeof seed === "number") {
22986
- return mulberry32(seed * 10000000000);
22987
- }
22988
- throw new Error("random() argument must be a number or a string");
22989
- };
22990
22959
  var SetTimelineContext = createContext13({
22991
22960
  setFrame: () => {
22992
22961
  throw new Error("default");
@@ -23003,7 +22972,6 @@ var TimelineContextProvider = ({ children, frameState }) => {
23003
22972
  const imperativePlaying = useRef3(false);
23004
22973
  const [playbackRate, setPlaybackRate] = useState2(1);
23005
22974
  const audioAndVideoTags = useRef3([]);
23006
- const [remotionRootId] = useState2(() => String(random(null)));
23007
22975
  const [_frame, setFrame] = useState2(() => getInitialFrameState());
23008
22976
  const frame = frameState ?? _frame;
23009
22977
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
@@ -23038,10 +23006,9 @@ var TimelineContextProvider = ({ children, frameState }) => {
23038
23006
  frame,
23039
23007
  playing,
23040
23008
  imperativePlaying,
23041
- rootId: remotionRootId,
23042
23009
  audioAndVideoTags
23043
23010
  };
23044
- }, [frame, playing, remotionRootId]);
23011
+ }, [frame, playing]);
23045
23012
  const playbackRateContextValue = useMemo8(() => {
23046
23013
  return {
23047
23014
  playbackRate,
@@ -23430,6 +23397,29 @@ var backgroundSchema = {
23430
23397
  description: "Color"
23431
23398
  }
23432
23399
  };
23400
+ var svgStrokeSchema = {
23401
+ stroke: {
23402
+ type: "color",
23403
+ default: "none",
23404
+ description: "Stroke"
23405
+ },
23406
+ strokeWidth: {
23407
+ type: "number",
23408
+ default: 1,
23409
+ description: "Stroke width",
23410
+ min: 0,
23411
+ step: 1,
23412
+ hiddenFromList: false
23413
+ }
23414
+ };
23415
+ var svgPaintSchema = {
23416
+ fill: {
23417
+ type: "color",
23418
+ default: undefined,
23419
+ description: "Fill"
23420
+ },
23421
+ ...svgStrokeSchema
23422
+ };
23433
23423
  var textContentSchema = {
23434
23424
  children: {
23435
23425
  type: "text-content",
@@ -23460,7 +23450,51 @@ var premountSchema = {
23460
23450
  var sequencePremountSchema = {
23461
23451
  ...premountSchema
23462
23452
  };
23453
+ var cropSchema = {
23454
+ cropLeft: {
23455
+ type: "number",
23456
+ default: 0,
23457
+ description: "Crop left",
23458
+ min: 0,
23459
+ max: 1,
23460
+ step: 0.01,
23461
+ hiddenFromList: false,
23462
+ keyframable: true
23463
+ },
23464
+ cropRight: {
23465
+ type: "number",
23466
+ default: 0,
23467
+ description: "Crop right",
23468
+ min: 0,
23469
+ max: 1,
23470
+ step: 0.01,
23471
+ hiddenFromList: false,
23472
+ keyframable: true
23473
+ },
23474
+ cropTop: {
23475
+ type: "number",
23476
+ default: 0,
23477
+ description: "Crop top",
23478
+ min: 0,
23479
+ max: 1,
23480
+ step: 0.01,
23481
+ hiddenFromList: false,
23482
+ keyframable: true
23483
+ },
23484
+ cropBottom: {
23485
+ type: "number",
23486
+ default: 0,
23487
+ description: "Crop bottom",
23488
+ min: 0,
23489
+ max: 1,
23490
+ step: 0.01,
23491
+ hiddenFromList: false,
23492
+ keyframable: true
23493
+ }
23494
+ };
23495
+ var sequenceCropSchema = cropSchema;
23463
23496
  var sequenceStyleSchema = {
23497
+ ...sequenceCropSchema,
23464
23498
  ...transformSchema,
23465
23499
  ...backgroundSchema,
23466
23500
  ...borderSchema,
@@ -23549,6 +23583,54 @@ var sequenceSchemaDefaultLayoutNone = {
23549
23583
  default: "none"
23550
23584
  }
23551
23585
  };
23586
+ var clampCrop = (value) => {
23587
+ return Math.min(1, Math.max(0, value ?? 0));
23588
+ };
23589
+ var resolveAxis = (start, end) => {
23590
+ const resolvedStart = clampCrop(start);
23591
+ const resolvedEnd = clampCrop(end);
23592
+ if (resolvedStart + resolvedEnd > 1) {
23593
+ return [0.5, 0.5];
23594
+ }
23595
+ return [resolvedStart, resolvedEnd];
23596
+ };
23597
+ var resolveSequenceCrop = ({
23598
+ cropLeft,
23599
+ cropRight,
23600
+ cropTop,
23601
+ cropBottom
23602
+ }) => {
23603
+ const [left, right] = resolveAxis(cropLeft, cropRight);
23604
+ const [top, bottom] = resolveAxis(cropTop, cropBottom);
23605
+ return { left, right, top, bottom };
23606
+ };
23607
+ var getSequenceCropClipPath = ({
23608
+ left,
23609
+ right,
23610
+ top,
23611
+ bottom,
23612
+ borderRadius
23613
+ }) => {
23614
+ if (left === 0 && right === 0 && top === 0 && bottom === 0) {
23615
+ return null;
23616
+ }
23617
+ const serializedBorderRadius = typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
23618
+ const rounded = serializedBorderRadius ? ` round ${serializedBorderRadius}` : "";
23619
+ return `inset(${top * 100}% ${right * 100}% ${bottom * 100}% ${left * 100}%${rounded})`;
23620
+ };
23621
+ var validateSequenceCrop = (crop, componentName = "<Sequence />") => {
23622
+ for (const [name, value] of Object.entries(crop)) {
23623
+ if (value === undefined) {
23624
+ continue;
23625
+ }
23626
+ if (typeof value !== "number" || !Number.isFinite(value)) {
23627
+ throw new TypeError(`The "${name}" prop of ${componentName} must be a finite number, but got ${String(value)}.`);
23628
+ }
23629
+ if (value < 0 || value > 1) {
23630
+ throw new RangeError(`The "${name}" prop of ${componentName} must be between 0 and 1, but got ${value}.`);
23631
+ }
23632
+ }
23633
+ };
23552
23634
  var SequenceManager = React12.createContext({
23553
23635
  registerSequence: () => {
23554
23636
  throw new Error("SequenceManagerContext not initialized");
@@ -25968,7 +26050,7 @@ var withInteractivitySchema = ({
25968
26050
  const flatKeys = Object.keys(flatSchema);
25969
26051
  const Wrapped = forwardRef2((props, ref) => {
25970
26052
  const env = useRemotionEnvironment();
25971
- if (!env.isStudio || env.isReadOnlyStudio || env.isRendering) {
26053
+ if (!env.isStudio || env.isRendering) {
25972
26054
  return React14.createElement(Component, {
25973
26055
  ...props,
25974
26056
  controls: null,
@@ -25998,7 +26080,7 @@ var withInteractivitySchema = ({
25998
26080
  stackToOverrideMap[stack] = newOverrideId;
25999
26081
  return newOverrideId;
26000
26082
  });
26001
- const nodePath = nodePathMapping.overrideIdToNodePathMappings[overrideId] ?? null;
26083
+ const nodePath = env.isReadOnlyStudio ? null : nodePathMapping.overrideIdToNodePathMappings[overrideId] ?? null;
26002
26084
  const runtimeValues = flatKeys.map((key) => getRuntimeValueForSchemaKey({
26003
26085
  flatSchema,
26004
26086
  key,
@@ -26069,17 +26151,32 @@ var RegularSequenceRefForwardingFunction = ({
26069
26151
  _remotionInternalPostmountDisplay: postmountDisplay,
26070
26152
  _remotionInternalIsMedia: isMedia,
26071
26153
  outlineRef: passedRefForOutline,
26154
+ cropLeft,
26155
+ cropRight,
26156
+ cropTop,
26157
+ cropBottom,
26072
26158
  ...other
26073
26159
  }, ref) => {
26074
26160
  const { layout = "absolute-fill" } = other;
26075
26161
  const [id] = useState5(() => String(Math.random()));
26076
26162
  const parentSequence = useContext18(SequenceContext);
26077
- const { rootId } = useTimelineContext();
26078
26163
  const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
26079
26164
  const nonce = useNonce();
26080
26165
  if (layout !== "absolute-fill" && layout !== "none") {
26081
26166
  throw new TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${layout}`);
26082
26167
  }
26168
+ const cropProps = { cropLeft, cropRight, cropTop, cropBottom };
26169
+ const hasCropProp = Object.values(cropProps).some((value) => value !== undefined);
26170
+ if (layout === "none" && hasCropProp) {
26171
+ throw new TypeError('The cropLeft, cropRight, cropTop and cropBottom props of <Sequence /> are only supported with layout="absolute-fill".');
26172
+ }
26173
+ validateSequenceCrop(cropProps);
26174
+ const {
26175
+ left: resolvedCropLeft,
26176
+ right: resolvedCropRight,
26177
+ top: resolvedCropTop,
26178
+ bottom: resolvedCropBottom
26179
+ } = resolveSequenceCrop(cropProps);
26083
26180
  if (layout === "none" && typeof other.style !== "undefined") {
26084
26181
  throw new TypeError('If layout="none", you may not pass a style. Passed: ' + JSON.stringify(other.style));
26085
26182
  }
@@ -26205,7 +26302,6 @@ var RegularSequenceRefForwardingFunction = ({
26205
26302
  parent: parentSequence?.id ?? null,
26206
26303
  postmountDisplay: postmountDisplay ?? null,
26207
26304
  premountDisplay: premountDisplay ?? null,
26208
- rootId,
26209
26305
  showInTimeline,
26210
26306
  src: isMedia.src,
26211
26307
  getStack: () => stackRef.current,
@@ -26232,7 +26328,6 @@ var RegularSequenceRefForwardingFunction = ({
26232
26328
  playbackRate: isMedia.data.playbackRate,
26233
26329
  postmountDisplay: postmountDisplay ?? null,
26234
26330
  premountDisplay: premountDisplay ?? null,
26235
- rootId,
26236
26331
  showInTimeline,
26237
26332
  src: isMedia.data.src,
26238
26333
  getStack: () => stackRef.current,
@@ -26259,7 +26354,6 @@ var RegularSequenceRefForwardingFunction = ({
26259
26354
  documentationLink: resolvedDocumentationLink,
26260
26355
  parent: parentSequence?.id ?? null,
26261
26356
  type: "sequence",
26262
- rootId,
26263
26357
  showInTimeline,
26264
26358
  nonce: nonce.get(),
26265
26359
  loopDisplay,
@@ -26285,7 +26379,6 @@ var RegularSequenceRefForwardingFunction = ({
26285
26379
  unregisterSequence,
26286
26380
  parentSequence?.id,
26287
26381
  actualDurationInFrames,
26288
- rootId,
26289
26382
  from,
26290
26383
  trimBefore,
26291
26384
  registeredTrimBefore,
@@ -26314,6 +26407,13 @@ var RegularSequenceRefForwardingFunction = ({
26314
26407
  children: content
26315
26408
  });
26316
26409
  const styleIfThere = other.layout === "none" ? undefined : other.style;
26410
+ const cropClipPath = getSequenceCropClipPath({
26411
+ left: resolvedCropLeft,
26412
+ right: resolvedCropRight,
26413
+ top: resolvedCropTop,
26414
+ bottom: resolvedCropBottom,
26415
+ borderRadius: styleIfThere?.borderRadius
26416
+ });
26317
26417
  const sequenceRef = useCallback6((node) => {
26318
26418
  wrapperRefForOutline.current = node;
26319
26419
  if (typeof ref === "function") {
@@ -26327,9 +26427,12 @@ var RegularSequenceRefForwardingFunction = ({
26327
26427
  flexDirection: undefined,
26328
26428
  ...width ? { width } : {},
26329
26429
  ...height ? { height } : {},
26330
- ...styleIfThere ?? {}
26430
+ ...styleIfThere ?? {},
26431
+ ...cropClipPath ? {
26432
+ clipPath: cropClipPath
26433
+ } : {}
26331
26434
  };
26332
- }, [height, styleIfThere, width]);
26435
+ }, [cropClipPath, height, styleIfThere, width]);
26333
26436
  if (ref !== null && layout === "none") {
26334
26437
  throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');
26335
26438
  }
@@ -26428,6 +26531,26 @@ var SequenceWithoutFrom = withInteractivitySchema({
26428
26531
  schema: sequenceSchemaWithoutFrom,
26429
26532
  supportsEffects: false
26430
26533
  });
26534
+ var useCropStyle = ({
26535
+ cropLeft,
26536
+ cropRight,
26537
+ cropTop,
26538
+ cropBottom,
26539
+ style,
26540
+ componentName
26541
+ }) => {
26542
+ validateSequenceCrop({ cropLeft, cropRight, cropTop, cropBottom }, componentName);
26543
+ return useMemo16(() => {
26544
+ const cropClipPath = getSequenceCropClipPath({
26545
+ ...resolveSequenceCrop({ cropLeft, cropRight, cropTop, cropBottom }),
26546
+ borderRadius: style?.borderRadius
26547
+ });
26548
+ if (cropClipPath === null) {
26549
+ return style;
26550
+ }
26551
+ return { ...style, clipPath: cropClipPath };
26552
+ }, [cropBottom, cropLeft, cropRight, cropTop, style]);
26553
+ };
26431
26554
  var calculateImageFit = (fit, imageSize, canvasSize) => {
26432
26555
  switch (fit) {
26433
26556
  case "fill": {
@@ -26720,7 +26843,7 @@ var useEffectChainState = () => {
26720
26843
  }
26721
26844
  };
26722
26845
  }, []);
26723
- return useMemo16(() => ({
26846
+ return useMemo17(() => ({
26724
26847
  get: (width, height) => {
26725
26848
  if (!sizeRef.current || sizeRef.current.width !== width || sizeRef.current.height !== height) {
26726
26849
  if (chainStateRef.current) {
@@ -26736,7 +26859,7 @@ var useEffectChainState = () => {
26736
26859
  var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effects, ...props }, ref) => {
26737
26860
  const canvasRef = useRef8(null);
26738
26861
  const chainState = useEffectChainState();
26739
- const sourceCanvas = useMemo17(() => {
26862
+ const sourceCanvas = useMemo18(() => {
26740
26863
  if (typeof document === "undefined") {
26741
26864
  return null;
26742
26865
  }
@@ -26998,6 +27121,7 @@ var animatedImageSchema = {
26998
27121
  keyframable: false
26999
27122
  },
27000
27123
  ...baseSchema,
27124
+ ...cropSchema,
27001
27125
  ...premountSchema,
27002
27126
  playbackRate: {
27003
27127
  type: "number",
@@ -27192,6 +27316,10 @@ var AnimatedImageInner = ({
27192
27316
  postmountFor,
27193
27317
  styleWhilePremounted,
27194
27318
  styleWhilePostmounted,
27319
+ cropLeft,
27320
+ cropRight,
27321
+ cropTop,
27322
+ cropBottom,
27195
27323
  requestInit,
27196
27324
  effects = [],
27197
27325
  controls,
@@ -27221,6 +27349,14 @@ var AnimatedImageInner = ({
27221
27349
  styleWhilePostmounted: styleWhilePostmounted ?? null,
27222
27350
  hideWhilePremounted: "display-none"
27223
27351
  });
27352
+ const croppedStyle = useCropStyle({
27353
+ cropLeft,
27354
+ cropRight,
27355
+ cropTop,
27356
+ cropBottom,
27357
+ style: premountingStyle,
27358
+ componentName: "<AnimatedImage />"
27359
+ });
27224
27360
  const canvasProps = getCanvasPropsFromSequenceProps(sequenceProps);
27225
27361
  const animatedImageProps = {
27226
27362
  src,
@@ -27232,7 +27368,7 @@ var AnimatedImageInner = ({
27232
27368
  loopBehavior,
27233
27369
  id,
27234
27370
  className,
27235
- style: premountingStyle ?? undefined,
27371
+ style: croppedStyle ?? undefined,
27236
27372
  requestInit,
27237
27373
  ...canvasProps
27238
27374
  };
@@ -27373,7 +27509,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
27373
27509
  };
27374
27510
  }
27375
27511
  }, []);
27376
- const contextValue = useMemo18(() => {
27512
+ const contextValue = useMemo19(() => {
27377
27513
  return {
27378
27514
  registerRenderAsset,
27379
27515
  unregisterRenderAsset,
@@ -27502,14 +27638,14 @@ var Loop = ({
27502
27638
  const iteration = Math.floor(currentFrame / durationInFrames);
27503
27639
  const start = iteration * durationInFrames;
27504
27640
  const from = Math.min(start, maxFrame);
27505
- const loopDisplay = useMemo19(() => {
27641
+ const loopDisplay = useMemo20(() => {
27506
27642
  return {
27507
27643
  numberOfTimes: Math.min(compDuration / durationInFrames, times),
27508
27644
  startOffset: -from,
27509
27645
  durationInFrames
27510
27646
  };
27511
27647
  }, [compDuration, durationInFrames, from, times]);
27512
- const loopContext = useMemo19(() => {
27648
+ const loopContext = useMemo20(() => {
27513
27649
  return {
27514
27650
  iteration: Math.floor(currentFrame / durationInFrames),
27515
27651
  durationInFrames
@@ -27881,7 +28017,7 @@ var DurationsContext = createContext20({
27881
28017
  });
27882
28018
  var DurationsContextProvider = ({ children }) => {
27883
28019
  const [durations, setDurations] = useReducer(durationReducer, {});
27884
- const value = useMemo20(() => {
28020
+ const value = useMemo21(() => {
27885
28021
  return {
27886
28022
  durations,
27887
28023
  setDurations
@@ -27908,6 +28044,38 @@ var getCrossOriginValue = ({
27908
28044
  }
27909
28045
  return;
27910
28046
  };
28047
+ function mulberry32(a2) {
28048
+ let t = a2 + 1831565813;
28049
+ t = Math.imul(t ^ t >>> 15, t | 1);
28050
+ t ^= t + Math.imul(t ^ t >>> 7, t | 61);
28051
+ return ((t ^ t >>> 14) >>> 0) / 4294967296;
28052
+ }
28053
+ function hashCode(str) {
28054
+ let i = 0;
28055
+ let chr = 0;
28056
+ let hash = 0;
28057
+ for (i = 0;i < str.length; i++) {
28058
+ chr = str.charCodeAt(i);
28059
+ hash = (hash << 5) - hash + chr;
28060
+ hash |= 0;
28061
+ }
28062
+ return hash;
28063
+ }
28064
+ var random = (seed, dummy) => {
28065
+ if (dummy !== undefined) {
28066
+ throw new TypeError("random() takes only one argument");
28067
+ }
28068
+ if (seed === null) {
28069
+ return Math.random();
28070
+ }
28071
+ if (typeof seed === "string") {
28072
+ return mulberry32(hashCode(seed));
28073
+ }
28074
+ if (typeof seed === "number") {
28075
+ return mulberry32(seed * 10000000000);
28076
+ }
28077
+ throw new Error("random() argument must be a number or a string");
28078
+ };
27911
28079
  var playAndHandleNotAllowedError = ({
27912
28080
  mediaRef,
27913
28081
  mediaType,
@@ -28024,7 +28192,7 @@ var useSingletonAudioContext = ({
28024
28192
  if (sampleRate !== initialSampleRate.current) {
28025
28193
  throw new Error(`Changing the AudioContext sample rate dynamically is not supported. The sample rate was initialized with ${initialSampleRate.current} Hz, but ${sampleRate} Hz was passed later.`);
28026
28194
  }
28027
- const context = useMemo21(() => {
28195
+ const context = useMemo22(() => {
28028
28196
  if (env.isRendering) {
28029
28197
  return null;
28030
28198
  }
@@ -28158,9 +28326,9 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
28158
28326
  });
28159
28327
  const audioContextIsPlayingEventually = useRef12(false);
28160
28328
  const isResuming = useRef12(null);
28161
- const audioSyncAnchor = useMemo22(() => ({ value: 0 }), []);
28329
+ const audioSyncAnchor = useMemo23(() => ({ value: 0 }), []);
28162
28330
  const audioSyncAnchorListeners = useRef12([]);
28163
- const audioSyncAnchorEmitter = useMemo22(() => {
28331
+ const audioSyncAnchorEmitter = useMemo23(() => {
28164
28332
  return {
28165
28333
  dispatch: (event2) => {
28166
28334
  audioSyncAnchorListeners.current.forEach((l) => l(event2));
@@ -28180,7 +28348,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
28180
28348
  const unscheduleAudioNode = useCallback9((node) => {
28181
28349
  nodesToResume.current.delete(node);
28182
28350
  }, []);
28183
- const scheduleAudioNode = useMemo22(() => {
28351
+ const scheduleAudioNode = useMemo23(() => {
28184
28352
  return ({
28185
28353
  node,
28186
28354
  mediaTimestamp,
@@ -28272,7 +28440,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
28272
28440
  audioContextIsPlayingEventually.current = false;
28273
28441
  return ctxAndGain.suspend();
28274
28442
  }, [ctxAndGain]);
28275
- const audioContextValue = useMemo22(() => {
28443
+ const audioContextValue = useMemo23(() => {
28276
28444
  return {
28277
28445
  audioContext: ctxAndGain?.audioContext ?? null,
28278
28446
  getAudioContextState: () => ctxAndGain?.getState() ?? null,
@@ -28454,7 +28622,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
28454
28622
  });
28455
28623
  resume?.();
28456
28624
  }, [logLevel, mountTime, refs, env.isPlayer, resume]);
28457
- const audioTagsValue = useMemo22(() => {
28625
+ const audioTagsValue = useMemo23(() => {
28458
28626
  return {
28459
28627
  registerAudio,
28460
28628
  unregisterAudio,
@@ -28469,7 +28637,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
28469
28637
  unregisterAudio,
28470
28638
  updateAudio
28471
28639
  ]);
28472
- const sharedAudioTagElements = useMemo22(() => {
28640
+ const sharedAudioTagElements = useMemo23(() => {
28473
28641
  return refs.map(({ id, ref }) => {
28474
28642
  return /* @__PURE__ */ jsx19("audio", {
28475
28643
  ref,
@@ -28837,7 +29005,7 @@ var useBasicMediaInTimeline = ({
28837
29005
  parentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null,
28838
29006
  loop
28839
29007
  });
28840
- const volumes = useMemo23(() => {
29008
+ const volumes = useMemo24(() => {
28841
29009
  if (typeof volume === "number") {
28842
29010
  return volume;
28843
29011
  }
@@ -28856,15 +29024,13 @@ var useBasicMediaInTimeline = ({
28856
29024
  }, [initialVolume, mediaType, src, volume]);
28857
29025
  const doesVolumeChange = typeof volume === "function";
28858
29026
  const nonce = useNonce();
28859
- const { rootId } = useTimelineContext();
28860
29027
  const startMediaFrom = 0 - mediaStartsAt + (trimBefore ?? 0);
28861
- const memoizedResult = useMemo23(() => {
29028
+ const memoizedResult = useMemo24(() => {
28862
29029
  return {
28863
29030
  volumes,
28864
29031
  duration,
28865
29032
  doesVolumeChange,
28866
29033
  nonce,
28867
- rootId,
28868
29034
  finalDisplayName: displayName ?? getAssetDisplayName(src),
28869
29035
  startMediaFrom,
28870
29036
  src,
@@ -28875,7 +29041,6 @@ var useBasicMediaInTimeline = ({
28875
29041
  duration,
28876
29042
  doesVolumeChange,
28877
29043
  nonce,
28878
- rootId,
28879
29044
  displayName,
28880
29045
  src,
28881
29046
  startMediaFrom,
@@ -28904,7 +29069,7 @@ var useMediaInTimeline = ({
28904
29069
  const { registerSequence, unregisterSequence } = useContext24(SequenceManager);
28905
29070
  const { durationInFrames } = useVideoConfig();
28906
29071
  const mediaStartsAt = useMediaStartsAt();
28907
- const { volumes, duration, doesVolumeChange, nonce, rootId, finalDisplayName } = useBasicMediaInTimeline({
29072
+ const { volumes, duration, doesVolumeChange, nonce, finalDisplayName } = useBasicMediaInTimeline({
28908
29073
  volume,
28909
29074
  mediaVolume,
28910
29075
  mediaType,
@@ -28938,7 +29103,6 @@ var useMediaInTimeline = ({
28938
29103
  parent: parentSequence?.id ?? null,
28939
29104
  displayName: finalDisplayName,
28940
29105
  documentationLink,
28941
- rootId,
28942
29106
  volume: volumes,
28943
29107
  showInTimeline: true,
28944
29108
  nonce: nonce.get(),
@@ -28979,7 +29143,6 @@ var useMediaInTimeline = ({
28979
29143
  postmountDisplay,
28980
29144
  loopDisplay,
28981
29145
  documentationLink,
28982
- rootId,
28983
29146
  finalDisplayName,
28984
29147
  isStudio,
28985
29148
  refForOutline
@@ -29066,7 +29229,7 @@ var useBufferManager = (logLevel, mountTime) => {
29066
29229
  }
29067
29230
  }, [blocks]);
29068
29231
  }
29069
- return useMemo24(() => {
29232
+ return useMemo25(() => {
29070
29233
  return { addBlock, listenForBuffering, listenForResume, buffering };
29071
29234
  }, [addBlock, buffering, listenForBuffering, listenForResume]);
29072
29235
  };
@@ -29101,7 +29264,7 @@ var useBufferState = () => {
29101
29264
  const buffer = useContext26(BufferingContextReact);
29102
29265
  const logLevel = useLogLevel();
29103
29266
  const addBlock = buffer ? buffer.addBlock : null;
29104
- return useMemo25(() => ({
29267
+ return useMemo26(() => ({
29105
29268
  delayPlayback: () => {
29106
29269
  if (!addBlock) {
29107
29270
  throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a <Composition>. Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");
@@ -29209,7 +29372,7 @@ var useBufferUntilFirstFrame = ({
29209
29372
  onVariableFpsVideoDetected,
29210
29373
  pauseWhenBuffering
29211
29374
  ]);
29212
- return useMemo26(() => {
29375
+ return useMemo27(() => {
29213
29376
  return {
29214
29377
  isBuffering: () => bufferingRef.current,
29215
29378
  bufferUntilFirstFrame
@@ -29880,14 +30043,14 @@ var SetMediaVolumeContext = createContext22({
29880
30043
  var useMediaVolumeState = () => {
29881
30044
  const { mediaVolume } = useContext28(MediaVolumeContext);
29882
30045
  const { setMediaVolume } = useContext28(SetMediaVolumeContext);
29883
- return useMemo27(() => {
30046
+ return useMemo28(() => {
29884
30047
  return [mediaVolume, setMediaVolume];
29885
30048
  }, [mediaVolume, setMediaVolume]);
29886
30049
  };
29887
30050
  var usePlayerMutedState = () => {
29888
30051
  const { playerMuted } = useContext28(MediaVolumeContext);
29889
30052
  const { setPlayerMuted } = useContext28(SetMediaVolumeContext);
29890
- return useMemo27(() => {
30053
+ return useMemo28(() => {
29891
30054
  return [playerMuted, setPlayerMuted];
29892
30055
  }, [playerMuted, setPlayerMuted]);
29893
30056
  };
@@ -29954,7 +30117,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
29954
30117
  requestsVideoFrame: false,
29955
30118
  isClientSideRendering: false
29956
30119
  });
29957
- const propsToPass = useMemo28(() => {
30120
+ const propsToPass = useMemo29(() => {
29958
30121
  return {
29959
30122
  muted: muted || playerMuted || userPreferredVolume <= 0,
29960
30123
  src: preloadedSrc,
@@ -29971,7 +30134,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
29971
30134
  userPreferredVolume,
29972
30135
  crossOriginValue
29973
30136
  ]);
29974
- const id = useMemo28(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
30137
+ const id = useMemo29(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
29975
30138
  src,
29976
30139
  sequenceContext?.relativeFrom,
29977
30140
  sequenceContext?.cumulatedFrom,
@@ -30104,7 +30267,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
30104
30267
  const sequenceContext = useContext30(SequenceContext);
30105
30268
  const { registerRenderAsset, unregisterRenderAsset } = useContext30(RenderAssetManager);
30106
30269
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
30107
- const id = useMemo29(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
30270
+ const id = useMemo30(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
30108
30271
  props.src,
30109
30272
  sequenceContext?.relativeFrom,
30110
30273
  sequenceContext?.cumulatedFrom,
@@ -30378,7 +30541,8 @@ var solidSchema = {
30378
30541
  },
30379
30542
  ...transformSchema,
30380
30543
  ...backgroundSchema,
30381
- ...borderSchema
30544
+ ...borderSchema,
30545
+ ...cropSchema
30382
30546
  };
30383
30547
  var SolidInner = ({
30384
30548
  color,
@@ -30400,7 +30564,7 @@ var SolidInner = ({
30400
30564
  effects,
30401
30565
  overrideId: overrideId ?? null
30402
30566
  });
30403
- const sourceCanvas = useMemo30(() => {
30567
+ const sourceCanvas = useMemo31(() => {
30404
30568
  if (typeof document === "undefined") {
30405
30569
  return null;
30406
30570
  }
@@ -30468,7 +30632,7 @@ var SolidInner = ({
30468
30632
  cancelRender2,
30469
30633
  memoizedEffects
30470
30634
  ]);
30471
- const canvasStyle = useMemo30(() => {
30635
+ const canvasStyle = useMemo31(() => {
30472
30636
  return {
30473
30637
  width,
30474
30638
  height,
@@ -30499,6 +30663,10 @@ var SolidOuter = forwardRef8(({
30499
30663
  hidden,
30500
30664
  showInTimeline,
30501
30665
  pixelDensity,
30666
+ cropLeft,
30667
+ cropRight,
30668
+ cropTop,
30669
+ cropBottom,
30502
30670
  ...props2
30503
30671
  }, ref) => {
30504
30672
  const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
@@ -30506,6 +30674,14 @@ var SolidOuter = forwardRef8(({
30506
30674
  useImperativeHandle6(ref, () => {
30507
30675
  return actualRef.current;
30508
30676
  }, []);
30677
+ const croppedStyle = useCropStyle({
30678
+ cropLeft,
30679
+ cropRight,
30680
+ cropTop,
30681
+ cropBottom,
30682
+ style: style ?? null,
30683
+ componentName: "<Solid />"
30684
+ });
30509
30685
  return /* @__PURE__ */ jsx24(Sequence, {
30510
30686
  layout: "none",
30511
30687
  from,
@@ -30527,7 +30703,7 @@ var SolidOuter = forwardRef8(({
30527
30703
  height,
30528
30704
  width,
30529
30705
  className,
30530
- style,
30706
+ style: croppedStyle ?? undefined,
30531
30707
  effects,
30532
30708
  pixelDensity
30533
30709
  })
@@ -30556,6 +30732,17 @@ var isHtmlInCanvasSupported = () => {
30556
30732
  return cachedSupport;
30557
30733
  };
30558
30734
  var HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = "HTML in Canvas is not supported. Two common causes: Chrome is older than version 148 (update Chrome), or the HTML-in-Canvas flag is disabled at chrome://flags/#canvas-draw-element (enable it and restart Chrome).";
30735
+ var MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS = 152;
30736
+ var getChromeMajorVersion = () => {
30737
+ if (typeof navigator === "undefined") {
30738
+ return null;
30739
+ }
30740
+ const match = navigator.userAgent.match(/\b(?:HeadlessChrome|Chrome)\/(\d+)/);
30741
+ if (!match) {
30742
+ return null;
30743
+ }
30744
+ return Number(match[1]);
30745
+ };
30559
30746
  function assertHtmlInCanvasDimensions(width, height) {
30560
30747
  if (typeof width !== "number" || typeof height !== "number") {
30561
30748
  throw new Error(`HtmlInCanvas: \`width\` and \`height\` must be numbers. Received width=${String(width)}, height=${String(height)}.`);
@@ -30619,6 +30806,10 @@ var HtmlInCanvasContent = forwardRef9(({
30619
30806
  }, ref) => {
30620
30807
  const ancestor = useContext32(HtmlInCanvasAncestorContext);
30621
30808
  assertHtmlInCanvasDimensions(width, height);
30809
+ const chromeMajorVersion = getChromeMajorVersion();
30810
+ if (ancestor && chromeMajorVersion !== null && chromeMajorVersion < MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS) {
30811
+ throw new Error(`Nested <HtmlInCanvas> components require Chrome ${MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS} or newer, but the current browser is Chrome ${chromeMajorVersion}. Upgrade Chrome or avoid nesting components that use <HtmlInCanvas>, such as shapes with effects.`);
30812
+ }
30622
30813
  const resolvedPixelDensity = resolveHtmlInCanvasPixelDensity(pixelDensity);
30623
30814
  const canvasWidth = Math.ceil(width * resolvedPixelDensity);
30624
30815
  const canvasHeight = Math.ceil(height * resolvedPixelDensity);
@@ -30837,20 +31028,20 @@ var HtmlInCanvasContent = forwardRef9(({
30837
31028
  continueRender2(handle);
30838
31029
  };
30839
31030
  }, [width, height, continueRender2, delayRender2, canvasSizeKey]);
30840
- const innerStyle = useMemo31(() => {
31031
+ const innerStyle = useMemo32(() => {
30841
31032
  return {
30842
31033
  width,
30843
31034
  height
30844
31035
  };
30845
31036
  }, [width, height]);
30846
- const canvasStyle = useMemo31(() => {
31037
+ const canvasStyle = useMemo32(() => {
30847
31038
  return {
30848
31039
  width,
30849
31040
  height,
30850
31041
  ...style ?? {}
30851
31042
  };
30852
31043
  }, [height, style, width]);
30853
- const ancestorValue = useMemo31(() => {
31044
+ const ancestorValue = useMemo32(() => {
30854
31045
  return {
30855
31046
  requestParentPaint: () => {
30856
31047
  canvas2dRef.current?.requestPaint?.();
@@ -30883,6 +31074,10 @@ var HtmlInCanvasInner = forwardRef9(({
30883
31074
  pixelDensity,
30884
31075
  controls,
30885
31076
  style,
31077
+ cropLeft,
31078
+ cropRight,
31079
+ cropTop,
31080
+ cropBottom,
30886
31081
  durationInFrames,
30887
31082
  name,
30888
31083
  ...sequenceProps
@@ -30897,6 +31092,14 @@ var HtmlInCanvasInner = forwardRef9(({
30897
31092
  ref.current = node;
30898
31093
  }
30899
31094
  }, [ref]);
31095
+ const croppedStyle = useCropStyle({
31096
+ cropLeft,
31097
+ cropRight,
31098
+ cropTop,
31099
+ cropBottom,
31100
+ style: style ?? null,
31101
+ componentName: "<HtmlInCanvas />"
31102
+ });
30900
31103
  return /* @__PURE__ */ jsx25(Sequence, {
30901
31104
  durationInFrames,
30902
31105
  name: name ?? "<HtmlInCanvas>",
@@ -30915,7 +31118,7 @@ var HtmlInCanvasInner = forwardRef9(({
30915
31118
  onInit,
30916
31119
  pixelDensity,
30917
31120
  controls,
30918
- style,
31121
+ style: croppedStyle ?? undefined,
30919
31122
  children
30920
31123
  })
30921
31124
  });
@@ -30934,7 +31137,8 @@ var htmlInCanvasSchema = {
30934
31137
  },
30935
31138
  ...transformSchema,
30936
31139
  ...backgroundSchema,
30937
- ...borderSchema
31140
+ ...borderSchema,
31141
+ ...cropSchema
30938
31142
  };
30939
31143
  var HtmlInCanvasWrapped = withInteractivitySchema({
30940
31144
  Component: HtmlInCanvasInner,
@@ -30956,6 +31160,7 @@ function truncateSrcForLabel(src) {
30956
31160
  }
30957
31161
  var canvasImageSchema = {
30958
31162
  ...baseSchema,
31163
+ ...cropSchema,
30959
31164
  ...premountSchema,
30960
31165
  fit: {
30961
31166
  type: "enum",
@@ -31086,7 +31291,7 @@ var CanvasImageContent = forwardRef10(({
31086
31291
  continueRender2(pending.handle);
31087
31292
  pendingLoadDelayRef.current = null;
31088
31293
  }, [continueRender2]);
31089
- const sourceCanvas = useMemo32(() => {
31294
+ const sourceCanvas = useMemo33(() => {
31090
31295
  if (typeof document === "undefined") {
31091
31296
  return null;
31092
31297
  }
@@ -31300,9 +31505,14 @@ var CanvasImageInner = forwardRef10(({
31300
31505
  hidden,
31301
31506
  name,
31302
31507
  showInTimeline,
31508
+ cropLeft,
31509
+ cropRight,
31510
+ cropTop,
31511
+ cropBottom,
31303
31512
  stack,
31304
31513
  controls,
31305
31514
  _remotionInternalDocumentationLink,
31515
+ _remotionInternalCropComponentName,
31306
31516
  outlineRef,
31307
31517
  ...canvasProps
31308
31518
  }, ref) => {
@@ -31332,6 +31542,14 @@ var CanvasImageInner = forwardRef10(({
31332
31542
  styleWhilePostmounted: styleWhilePostmounted ?? null,
31333
31543
  hideWhilePremounted: "display-none"
31334
31544
  });
31545
+ const croppedStyle = useCropStyle({
31546
+ cropLeft,
31547
+ cropRight,
31548
+ cropTop,
31549
+ cropBottom,
31550
+ style: premountingStyle,
31551
+ componentName: _remotionInternalCropComponentName ?? "<CanvasImage />"
31552
+ });
31335
31553
  return /* @__PURE__ */ jsx26(Freeze, {
31336
31554
  frame: freezeFrame,
31337
31555
  active: isPremountingOrPostmounting,
@@ -31363,7 +31581,7 @@ var CanvasImageInner = forwardRef10(({
31363
31581
  effects,
31364
31582
  controls,
31365
31583
  className,
31366
- style: premountingStyle ?? undefined,
31584
+ style: croppedStyle ?? undefined,
31367
31585
  id,
31368
31586
  onError,
31369
31587
  pauseWhenLoading,
@@ -31594,6 +31812,10 @@ var NativeImgInner = ({
31594
31812
  style,
31595
31813
  styleWhilePremounted,
31596
31814
  styleWhilePostmounted,
31815
+ cropLeft,
31816
+ cropRight,
31817
+ cropTop,
31818
+ cropBottom,
31597
31819
  controls,
31598
31820
  outlineRef: refForOutline,
31599
31821
  ...props2
@@ -31619,6 +31841,14 @@ var NativeImgInner = ({
31619
31841
  styleWhilePostmounted: styleWhilePostmounted ?? null,
31620
31842
  hideWhilePremounted: "display-none"
31621
31843
  });
31844
+ const croppedStyle = useCropStyle({
31845
+ cropLeft,
31846
+ cropRight,
31847
+ cropTop,
31848
+ cropBottom,
31849
+ style: premountingStyle,
31850
+ componentName: "<Img />"
31851
+ });
31622
31852
  return /* @__PURE__ */ jsx28(Freeze, {
31623
31853
  frame: freezeFrame,
31624
31854
  active: isPremountingOrPostmounting,
@@ -31643,7 +31873,7 @@ var NativeImgInner = ({
31643
31873
  children: /* @__PURE__ */ jsx28(ImgContent, {
31644
31874
  src,
31645
31875
  refForOutline,
31646
- style: premountingStyle ?? undefined,
31876
+ style: croppedStyle ?? undefined,
31647
31877
  ...props2
31648
31878
  })
31649
31879
  })
@@ -31658,6 +31888,7 @@ var imgSchema = {
31658
31888
  keyframable: false
31659
31889
  },
31660
31890
  ...baseSchema,
31891
+ ...cropSchema,
31661
31892
  ...premountSchema,
31662
31893
  ...transformSchema,
31663
31894
  ...backgroundSchema,
@@ -31726,6 +31957,10 @@ var ImgInner = ({
31726
31957
  height,
31727
31958
  className,
31728
31959
  style,
31960
+ cropLeft,
31961
+ cropRight,
31962
+ cropTop,
31963
+ cropBottom,
31729
31964
  id,
31730
31965
  pauseWhenLoading,
31731
31966
  maxRetries,
@@ -31757,6 +31992,10 @@ var ImgInner = ({
31757
31992
  height,
31758
31993
  className,
31759
31994
  style,
31995
+ cropLeft,
31996
+ cropRight,
31997
+ cropTop,
31998
+ cropBottom,
31760
31999
  id,
31761
32000
  pauseWhenLoading: shouldPauseWhenLoading,
31762
32001
  maxRetries,
@@ -31786,6 +32025,10 @@ var ImgInner = ({
31786
32025
  effects,
31787
32026
  className,
31788
32027
  style,
32028
+ cropLeft,
32029
+ cropRight,
32030
+ cropTop,
32031
+ cropBottom,
31789
32032
  id,
31790
32033
  pauseWhenLoading: shouldPauseWhenLoading,
31791
32034
  maxRetries,
@@ -31804,6 +32047,7 @@ var ImgInner = ({
31804
32047
  showInTimeline,
31805
32048
  stack,
31806
32049
  _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
32050
+ _remotionInternalCropComponentName: "<Img />",
31807
32051
  controls,
31808
32052
  outlineRef: refForOutline,
31809
32053
  ...canvasProps
@@ -31852,9 +32096,22 @@ var interactiveTextElementSchema = {
31852
32096
  };
31853
32097
  var interactiveSvgTextElementSchema = {
31854
32098
  ...interactiveElementSchema,
32099
+ ...svgPaintSchema,
31855
32100
  ...textSchema,
31856
32101
  ...textContentSchema
31857
32102
  };
32103
+ var interactiveSvgElementSchema = {
32104
+ ...interactiveElementSchema,
32105
+ ...svgPaintSchema
32106
+ };
32107
+ var interactiveSvgStrokeElementSchema = {
32108
+ ...interactiveElementSchema,
32109
+ ...svgStrokeSchema
32110
+ };
32111
+ var interactiveSvgRootElementSchema = {
32112
+ ...interactiveBorderElementSchema,
32113
+ ...svgPaintSchema
32114
+ };
31858
32115
  var setRef = (ref, value) => {
31859
32116
  if (typeof ref === "function") {
31860
32117
  ref(value);
@@ -31922,8 +32179,11 @@ var makeInteractiveElement = (tag, displayName, schema) => {
31922
32179
  var makeInteractiveTextElement = (tag, displayName) => {
31923
32180
  return makeInteractiveElement(tag, displayName, interactiveTextElementSchema);
31924
32181
  };
31925
- var makeInteractiveNonTextElement = (tag, displayName) => {
31926
- return makeInteractiveElement(tag, displayName, interactiveElementSchema);
32182
+ var makeInteractiveSvgElement = (tag, displayName) => {
32183
+ return makeInteractiveElement(tag, displayName, interactiveSvgElementSchema);
32184
+ };
32185
+ var makeInteractiveSvgStrokeElement = (tag, displayName) => {
32186
+ return makeInteractiveElement(tag, displayName, interactiveSvgStrokeElementSchema);
31927
32187
  };
31928
32188
  var Interactive = {
31929
32189
  baseSchema,
@@ -31931,6 +32191,9 @@ var Interactive = {
31931
32191
  textSchema,
31932
32192
  backgroundSchema,
31933
32193
  borderSchema,
32194
+ cropSchema,
32195
+ svgPaintSchema,
32196
+ svgStrokeSchema,
31934
32197
  premountSchema,
31935
32198
  sequenceSchema,
31936
32199
  withSchema,
@@ -31939,13 +32202,13 @@ var Interactive = {
31939
32202
  Article: makeInteractiveTextElement("article", "<Interactive.Article>"),
31940
32203
  Aside: makeInteractiveTextElement("aside", "<Interactive.Aside>"),
31941
32204
  Button: makeInteractiveTextElement("button", "<Interactive.Button>"),
31942
- Circle: makeInteractiveNonTextElement("circle", "<Interactive.Circle>"),
32205
+ Circle: makeInteractiveSvgElement("circle", "<Interactive.Circle>"),
31943
32206
  Code: makeInteractiveTextElement("code", "<Interactive.Code>"),
31944
32207
  Div: makeInteractiveTextElement("div", "<Interactive.Div>"),
31945
- Ellipse: makeInteractiveNonTextElement("ellipse", "<Interactive.Ellipse>"),
32208
+ Ellipse: makeInteractiveSvgElement("ellipse", "<Interactive.Ellipse>"),
31946
32209
  Em: makeInteractiveTextElement("em", "<Interactive.Em>"),
31947
32210
  Footer: makeInteractiveTextElement("footer", "<Interactive.Footer>"),
31948
- G: makeInteractiveNonTextElement("g", "<Interactive.G>"),
32211
+ G: makeInteractiveSvgElement("g", "<Interactive.G>"),
31949
32212
  H1: makeInteractiveTextElement("h1", "<Interactive.H1>"),
31950
32213
  H2: makeInteractiveTextElement("h2", "<Interactive.H2>"),
31951
32214
  H3: makeInteractiveTextElement("h3", "<Interactive.H3>"),
@@ -31955,19 +32218,19 @@ var Interactive = {
31955
32218
  Header: makeInteractiveTextElement("header", "<Interactive.Header>"),
31956
32219
  Label: makeInteractiveTextElement("label", "<Interactive.Label>"),
31957
32220
  Li: makeInteractiveTextElement("li", "<Interactive.Li>"),
31958
- Line: makeInteractiveNonTextElement("line", "<Interactive.Line>"),
32221
+ Line: makeInteractiveSvgStrokeElement("line", "<Interactive.Line>"),
31959
32222
  Main: makeInteractiveTextElement("main", "<Interactive.Main>"),
31960
32223
  Nav: makeInteractiveTextElement("nav", "<Interactive.Nav>"),
31961
32224
  Ol: makeInteractiveTextElement("ol", "<Interactive.Ol>"),
31962
32225
  P: makeInteractiveTextElement("p", "<Interactive.P>"),
31963
- Path: makeInteractiveNonTextElement("path", "<Interactive.Path>"),
32226
+ Path: makeInteractiveSvgElement("path", "<Interactive.Path>"),
31964
32227
  Pre: makeInteractiveTextElement("pre", "<Interactive.Pre>"),
31965
- Rect: makeInteractiveNonTextElement("rect", "<Interactive.Rect>"),
32228
+ Rect: makeInteractiveSvgElement("rect", "<Interactive.Rect>"),
31966
32229
  Section: makeInteractiveTextElement("section", "<Interactive.Section>"),
31967
32230
  Small: makeInteractiveTextElement("small", "<Interactive.Small>"),
31968
32231
  Span: makeInteractiveTextElement("span", "<Interactive.Span>"),
31969
32232
  Strong: makeInteractiveTextElement("strong", "<Interactive.Strong>"),
31970
- Svg: makeInteractiveElement("svg", "<Interactive.Svg>", interactiveBorderElementSchema),
32233
+ Svg: makeInteractiveElement("svg", "<Interactive.Svg>", interactiveSvgRootElementSchema),
31971
32234
  Text: makeInteractiveElement("text", "<Interactive.Text>", interactiveSvgTextElementSchema),
31972
32235
  Ul: makeInteractiveTextElement("ul", "<Interactive.Ul>")
31973
32236
  };
@@ -32055,7 +32318,7 @@ var CompositionManagerProvider = ({
32055
32318
  getCompositions: () => currentcompositionsRef.current
32056
32319
  };
32057
32320
  }, []);
32058
- const compositionManagerSetters = useMemo33(() => {
32321
+ const compositionManagerSetters = useMemo34(() => {
32059
32322
  return {
32060
32323
  registerComposition,
32061
32324
  unregisterComposition,
@@ -32071,7 +32334,7 @@ var CompositionManagerProvider = ({
32071
32334
  unregisterFolder,
32072
32335
  onlyRenderComposition
32073
32336
  ]);
32074
- const compositionManagerContextValue = useMemo33(() => {
32337
+ const compositionManagerContextValue = useMemo34(() => {
32075
32338
  return {
32076
32339
  compositions,
32077
32340
  folders,
@@ -32193,7 +32456,7 @@ var MediaEnabledProvider = ({
32193
32456
  videoEnabled,
32194
32457
  audioEnabled
32195
32458
  }) => {
32196
- const value = useMemo34(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
32459
+ const value = useMemo35(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
32197
32460
  return /* @__PURE__ */ jsx31(MediaEnabledContext.Provider, {
32198
32461
  value,
32199
32462
  children
@@ -32209,13 +32472,13 @@ var RemotionRootContexts = ({
32209
32472
  audioEnabled,
32210
32473
  frameState
32211
32474
  }) => {
32212
- const nonceContext = useMemo35(() => {
32475
+ const nonceContext = useMemo36(() => {
32213
32476
  let counter = 0;
32214
32477
  return {
32215
32478
  getNonce: () => counter++
32216
32479
  };
32217
32480
  }, []);
32218
- const logging = useMemo35(() => {
32481
+ const logging = useMemo36(() => {
32219
32482
  return { logLevel, mountTime: Date.now() };
32220
32483
  }, [logLevel]);
32221
32484
  return /* @__PURE__ */ jsx32(LogLevelContext.Provider, {
@@ -32522,7 +32785,7 @@ var OffthreadVideoForRendering = ({
32522
32785
  if (!src) {
32523
32786
  throw new TypeError("No `src` was passed to <OffthreadVideo>.");
32524
32787
  }
32525
- const id = useMemo36(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
32788
+ const id = useMemo37(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
32526
32789
  src,
32527
32790
  sequenceContext?.cumulatedFrom,
32528
32791
  sequenceContext?.relativeFrom,
@@ -32577,14 +32840,14 @@ var OffthreadVideoForRendering = ({
32577
32840
  sequenceContext?.cumulatedNegativeFrom,
32578
32841
  audioStreamIndex
32579
32842
  ]);
32580
- const currentTime = useMemo36(() => {
32843
+ const currentTime = useMemo37(() => {
32581
32844
  return getExpectedMediaFrameUncorrected({
32582
32845
  frame,
32583
32846
  playbackRate: playbackRate || 1,
32584
32847
  startFrom: -mediaStartsAt
32585
32848
  }) / videoConfig.fps;
32586
32849
  }, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
32587
- const actualSrc = useMemo36(() => {
32850
+ const actualSrc = useMemo37(() => {
32588
32851
  return getOffthreadVideoSource({
32589
32852
  src,
32590
32853
  currentTime,
@@ -32672,7 +32935,7 @@ var OffthreadVideoForRendering = ({
32672
32935
  cancelRender("Failed to load image with src " + imageSrc);
32673
32936
  }
32674
32937
  }, [imageSrc, onError]);
32675
- const className = useMemo36(() => {
32938
+ const className = useMemo37(() => {
32676
32939
  return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
32677
32940
  }, [props2.className]);
32678
32941
  const onImageFrame = useCallback22((img) => {
@@ -32741,7 +33004,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
32741
33004
  throw new Error("SharedAudioContext not found");
32742
33005
  }
32743
33006
  const videoRef = useRef27(null);
32744
- const sharedSource = useMemo37(() => {
33007
+ const sharedSource = useMemo38(() => {
32745
33008
  if (!context.audioContext) {
32746
33009
  return null;
32747
33010
  }
@@ -32944,7 +33207,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
32944
33207
  current.preload = "auto";
32945
33208
  }
32946
33209
  }, []);
32947
- const actualStyle = useMemo37(() => {
33210
+ const actualStyle = useMemo38(() => {
32948
33211
  return {
32949
33212
  ...style
32950
33213
  };
@@ -33141,7 +33404,7 @@ function useRemotionContexts() {
33141
33404
  const visualModePropStatusesRefContext = React40.useContext(VisualModePropStatusesRefContext);
33142
33405
  const bufferManagerContext = React40.useContext(BufferingContextReact);
33143
33406
  const logLevelContext = React40.useContext(LogLevelContext);
33144
- return useMemo38(() => ({
33407
+ return useMemo39(() => ({
33145
33408
  compositionManagerCtx,
33146
33409
  timelineContext,
33147
33410
  setTimelineContext,
@@ -33250,6 +33513,7 @@ var Internals = {
33250
33513
  sequenceStyleSchema,
33251
33514
  sequenceVisualStyleSchema,
33252
33515
  sequencePremountSchema,
33516
+ sequenceCropSchema,
33253
33517
  textSchema,
33254
33518
  transformSchema,
33255
33519
  premountSchema,
@@ -33373,7 +33637,9 @@ var Internals = {
33373
33637
  hiddenField,
33374
33638
  durationInFramesField,
33375
33639
  freezeField,
33376
- fromField
33640
+ fromField,
33641
+ resolveSequenceCrop,
33642
+ useCropStyle
33377
33643
  };
33378
33644
  var flattenChildren = (children) => {
33379
33645
  const childrenArray = React41.Children.toArray(children);
@@ -33443,7 +33709,7 @@ var validateSeriesSequenceProps = ({
33443
33709
  return offset;
33444
33710
  };
33445
33711
  var SeriesInner = (props2) => {
33446
- const childrenValue = useMemo39(() => {
33712
+ const childrenValue = useMemo40(() => {
33447
33713
  const flattenedChildren = flattenChildren(props2.children);
33448
33714
  const renderChildren = (i, startFrame) => {
33449
33715
  if (i === flattenedChildren.length) {
@@ -33779,7 +34045,7 @@ var VideoForRenderingForwardFunction = ({
33779
34045
  const mountTime = useMountTime();
33780
34046
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
33781
34047
  const { registerRenderAsset, unregisterRenderAsset } = useContext39(RenderAssetManager);
33782
- const id = useMemo40(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
34048
+ const id = useMemo41(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
33783
34049
  props2.src,
33784
34050
  sequenceContext?.cumulatedFrom,
33785
34051
  sequenceContext?.relativeFrom,
@@ -34110,7 +34376,7 @@ addSequenceStackTraces(Composition);
34110
34376
  addSequenceStackTraces(Folder);
34111
34377
 
34112
34378
  // ../shapes/dist/esm/index.mjs
34113
- import React, { useCallback as useCallback26, useMemo as useMemo41, useRef as useRef29 } from "react";
34379
+ import React, { useCallback as useCallback26, useMemo as useMemo42, useRef as useRef29 } from "react";
34114
34380
  import { version } from "react-dom";
34115
34381
  import { jsx as jsx40, jsxs as jsxs4 } from "react/jsx-runtime";
34116
34382
  import { jsx as jsx210 } from "react/jsx-runtime";
@@ -34292,13 +34558,13 @@ var RenderSvg = ({
34292
34558
  stack,
34293
34559
  ...props
34294
34560
  }) => {
34295
- const actualStyle = useMemo41(() => {
34561
+ const actualStyle = useMemo42(() => {
34296
34562
  return {
34297
34563
  overflow: "visible",
34298
34564
  ...style ?? {}
34299
34565
  };
34300
34566
  }, [style]);
34301
- const actualPathStyle = useMemo41(() => {
34567
+ const actualPathStyle = useMemo42(() => {
34302
34568
  return {
34303
34569
  transformBox: "fill-box",
34304
34570
  ...pathStyle ?? {}
@@ -37279,7 +37545,7 @@ var useHoverTransforms = (ref, disabled) => {
37279
37545
  progress: 0,
37280
37546
  isActive: false
37281
37547
  });
37282
- const eventTarget = useMemo43(() => new EventTarget, []);
37548
+ const eventTarget = useMemo44(() => new EventTarget, []);
37283
37549
  useEffect21(() => {
37284
37550
  if (disabled) {
37285
37551
  eventTarget.dispatchEvent(new Event("disabled"));