@1agh/maude 0.39.1 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/apps/studio/annotations-context-toolbar.tsx +44 -1
- package/apps/studio/annotations-layer.tsx +253 -3
- package/apps/studio/annotations-model.ts +107 -6
- package/apps/studio/api.ts +812 -64
- package/apps/studio/bin/_html-playwright.mjs +9 -1
- package/apps/studio/bin/_pdf-playwright.mjs +8 -1
- package/apps/studio/bin/_png-playwright.mjs +8 -1
- package/apps/studio/bin/_pw-launch.mjs +54 -0
- package/apps/studio/bin/_svg-playwright.mjs +8 -1
- package/apps/studio/bin/_video-playwright.mjs +452 -0
- package/apps/studio/bin/prep.sh +8 -1
- package/apps/studio/canvas-edit.ts +1885 -104
- package/apps/studio/canvas-lib.tsx +19 -0
- package/apps/studio/canvas-list-watch.ts +6 -2
- package/apps/studio/canvas-shell.tsx +27 -0
- package/apps/studio/client/app.jsx +1029 -30
- package/apps/studio/client/github.js +7 -0
- package/apps/studio/client/panels/TimelinePanel.jsx +860 -0
- package/apps/studio/client/panels/timeline-parse.js +229 -0
- package/apps/studio/client/panels/timeline-snap.js +55 -0
- package/apps/studio/client/styles/3-shell-maude.css +107 -0
- package/apps/studio/config.schema.json +14 -0
- package/apps/studio/context-menu.tsx +1 -1
- package/apps/studio/context.ts +113 -1
- package/apps/studio/dist/client.bundle.js +88 -16
- package/apps/studio/dist/comment-mount.js +1 -1
- package/apps/studio/dist/runtime/.min-sizes.json +11 -1
- package/apps/studio/dist/runtime/@remotion_media.js +491 -0
- package/apps/studio/dist/runtime/@remotion_player.js +56 -0
- package/apps/studio/dist/runtime/@remotion_transitions.js +300 -0
- package/apps/studio/dist/runtime/@remotion_transitions_clock-wipe.js +1 -0
- package/apps/studio/dist/runtime/@remotion_transitions_fade.js +1 -0
- package/apps/studio/dist/runtime/@remotion_transitions_flip.js +1 -0
- package/apps/studio/dist/runtime/@remotion_transitions_none.js +1 -0
- package/apps/studio/dist/runtime/@remotion_transitions_slide.js +1 -0
- package/apps/studio/dist/runtime/@remotion_transitions_wipe.js +1 -0
- package/apps/studio/dist/runtime/REMOTION-LICENSE.md +28 -0
- package/apps/studio/dist/runtime/remotion.js +42 -0
- package/apps/studio/dist/styles.css +1 -1
- package/apps/studio/exporters/_browser-bundles.ts +117 -0
- package/apps/studio/exporters/_runtime.ts +69 -0
- package/apps/studio/exporters/html.ts +4 -3
- package/apps/studio/exporters/index.ts +28 -2
- package/apps/studio/exporters/pdf.ts +4 -3
- package/apps/studio/exporters/png.ts +5 -3
- package/apps/studio/exporters/pptx.ts +6 -4
- package/apps/studio/exporters/svg.ts +9 -5
- package/apps/studio/exporters/video-encode-lib.ts +200 -0
- package/apps/studio/exporters/video-render-lib.ts +108 -0
- package/apps/studio/exporters/video.ts +184 -0
- package/apps/studio/http.ts +535 -27
- package/apps/studio/input-router.tsx +7 -1
- package/apps/studio/runtime-bundle.ts +30 -0
- package/apps/studio/server.ts +34 -9
- package/apps/studio/test/annotations-roundtrip.test.ts +47 -0
- package/apps/studio/test/canvas-create-api.test.ts +76 -0
- package/apps/studio/test/canvas-edit.test.ts +90 -0
- package/apps/studio/test/canvas-list-watch.test.ts +49 -0
- package/apps/studio/test/canvas-media-drop.test.ts +30 -1
- package/apps/studio/test/canvas-origin-gate.test.ts +36 -0
- package/apps/studio/test/clip-addressing.test.ts +732 -0
- package/apps/studio/test/config-reload.test.ts +230 -0
- package/apps/studio/test/dns-rebinding-guard.test.ts +74 -0
- package/apps/studio/test/edit-persistence.test.ts +91 -0
- package/apps/studio/test/exporters/runtime.test.ts +59 -0
- package/apps/studio/test/file-lock.test.ts +84 -0
- package/apps/studio/test/fixtures/video-comp-fixture.tsx +82 -0
- package/apps/studio/test/timeline-parse.test.ts +127 -0
- package/apps/studio/test/timeline-snap.test.ts +85 -0
- package/apps/studio/test/video-asset.test.ts +163 -0
- package/apps/studio/test/video-comp-fixture.test.ts +50 -0
- package/apps/studio/test/video-comp.test.ts +168 -0
- package/apps/studio/test/video-render-bridge.test.ts +149 -0
- package/apps/studio/use-annotation-resize.tsx +6 -3
- package/apps/studio/use-canvas-media-drop.tsx +66 -4
- package/apps/studio/video-comp.tsx +444 -0
- package/apps/studio/whats-new.json +27 -0
- package/apps/studio/ws.ts +5 -0
- package/package.json +8 -8
- package/plugins/design/templates/_shell.html +25 -2
- package/plugins/design/templates/design-system-inspiration/_MAPPING.md +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var YG=Object.defineProperty;var ZG=(b,h)=>{for(var j in h)YG(b,j,{get:h[j],enumerable:!0,configurable:!0,set:(k)=>h[j]=()=>k})};var mj={};ZG(mj,{watchStaticFile:()=>$W,useVideoConfig:()=>wb,useRemotionEnvironment:()=>d,usePixelDensity:()=>wW,useDelayRender:()=>Kb,useCurrentScale:()=>jW,useCurrentFrame:()=>qb,useBufferState:()=>lh,staticFile:()=>fW,spring:()=>yk,registerRoot:()=>AU,random:()=>qh,prefetch:()=>kQ,measureSpring:()=>wq,isHtmlInCanvasSupported:()=>$q,interpolateColors:()=>hB,interpolate:()=>Sh,getStaticFiles:()=>jU,getRemotionEnvironment:()=>o,getInputProps:()=>Uz,delayRender:()=>Rk,createEffect:()=>ZB,continueRender:()=>gJ,cancelRender:()=>bh,assertValidInterpolatePosterizeOption:()=>rz,assertValidInterpolateEasingOption:()=>ez,Video:()=>eW,VERSION:()=>pb,Still:()=>VW,Solid:()=>Zq,Series:()=>QG,Sequence:()=>hb,OffthreadVideo:()=>JG,MediaPlaybackError:()=>vb,Loop:()=>_h,Internals:()=>gW,Interactive:()=>vU,Img:()=>Nq,IFrame:()=>BU,HtmlInCanvas:()=>Lq,Html5Video:()=>rb,Html5Audio:()=>eb,HTML_IN_CANVAS_UNSUPPORTED_MESSAGE:()=>aB,Freeze:()=>ok,FolderContext:()=>Mj,Folder:()=>Kz,Experimental:()=>rW,Easing:()=>gh,Config:()=>TG,Composition:()=>sk,CanvasImage:()=>lj,Audio:()=>DT,Artifact:()=>NB,AnimatedImage:()=>Jq,AbsoluteFill:()=>_k});import{createContext as LG}from"react";import{Suspense as vq,useCallback as xq,useContext as $h,useEffect as qz}from"react";import{createPortal as Eq}from"react-dom";import{createContext as OG}from"react";import{jsx as RG}from"react/jsx-runtime";import{createContext as gG}from"react";import yG from"react";import{createContext as Bz}from"react";import{createContext as DG,useContext as Pq,useEffect as FG,useMemo as vG}from"react";import{createContext as xG,useCallback as EG,useContext as HG,useMemo as PG,useRef as Cq}from"react";import{jsx as cG}from"react/jsx-runtime";import{createContext as VG,useContext as AG}from"react";import{jsx as _G}from"react/jsx-runtime";import{forwardRef as mG,useMemo as uG}from"react";import{jsx as dG}from"react/jsx-runtime";import{jsx as ij,jsxs as fq}from"react/jsx-runtime";import{createContext as tG,createRef as oG,useContext as pj,useMemo as Vq}from"react";import Wz,{createContext as bJ,useCallback as hJ,useMemo as jJ}from"react";import{jsx as kJ}from"react/jsx-runtime";import{useContext as wJ,useState as zJ}from"react";import BJ from"react";import{createContext as KJ,useCallback as aj,useContext as MJ}from"react";import{createContext as yJ}from"react";import*as dk from"react";import lq,{useMemo as DJ,useRef as FJ}from"react";import{useContext as vJ,useMemo as xJ}from"react";import{jsx as Ub}from"react/jsx-runtime";import{forwardRef as ik,useCallback as VJ,useContext as qj,useEffect as AJ,useMemo as ib,useRef as mq,useState as _J}from"react";import{useContext as lJ,useMemo as nj}from"react";import{createContext as mJ}from"react";import{useContext as Ph,useMemo as uJ}from"react";import{createContext as yj,useLayoutEffect as dJ,useMemo as tj,useRef as uq,useState as mh}from"react";import{jsx as uh}from"react/jsx-runtime";import{useContext as sq}from"react";import{useContext as pJ}from"react";import{useContext as aJ,useMemo as nJ}from"react";import{jsx as iq}from"react/jsx-runtime";import{createContext as jK}from"react";import Bh,{useCallback as Nb,useMemo as dh,useRef as oj,useState as sh}from"react";import{jsx as db}from"react/jsx-runtime";import pq,{createContext as qK}from"react";import{jsx as _z}from"react/jsx-runtime";import rj,{forwardRef as GK,useContext as bk,useMemo as hk,useState as JK}from"react";import{useContext as jk,useRef as lz}from"react";import{createContext as kB}from"react";import{jsx as Ib}from"react/jsx-runtime";import{forwardRef as GM,useEffect as JM,useImperativeHandle as MB,useLayoutEffect as KM,useRef as wj,useState as Jk}from"react";import MM,{useCallback as QM,useImperativeHandle as TM,useMemo as UM,useRef as WM}from"react";import{useEffect as NM,useMemo as OM,useRef as Jw}from"react";import{jsx as RM}from"react/jsx-runtime";import{jsx as Fk}from"react/jsx-runtime";import{useContext as CM,useLayoutEffect as SM,useState as cM}from"react";import{createContext as fM,useCallback as Mw,useImperativeHandle as IM,useLayoutEffect as VM,useMemo as AM,useRef as _M,useState as lM}from"react";import{jsx as dM}from"react/jsx-runtime";import{forwardRef as iM,useCallback as Qw,useContext as Tw}from"react";import pM,{createContext as aM,useMemo as Uw}from"react";import{jsx as Ww}from"react/jsx-runtime";import{useContext as tM}from"react";import{createContext as oM,useEffect as eM,useState as rM}from"react";import{jsx as bQ}from"react/jsx-runtime";import{createContext as zQ,useMemo as BQ,useReducer as GQ}from"react";import{jsx as JQ}from"react/jsx-runtime";import{useCallback as MQ}from"react";import Yw,{forwardRef as QQ,useContext as TQ,useEffect as UQ,useImperativeHandle as WQ,useMemo as Zw,useRef as XQ,useState as $w}from"react";import{useContext as YQ,useLayoutEffect as ZQ,useRef as Lw}from"react";import Oh,{createContext as FB,createRef as $Q,useCallback as Rb,useContext as vk,useEffect as LQ,useMemo as nb,useRef as fb,useState as vB}from"react";import{useMemo as NQ,useRef as OQ}from"react";import{jsx as xB,jsxs as DQ}from"react/jsx-runtime";import{useRef as Kk}from"react";import{useContext as Pk,useEffect as SB,useMemo as gw,useState as IQ}from"react";import{useContext as VQ}from"react";import{useCallback as lQ,useContext as mQ,useEffect as Dw,useLayoutEffect as uQ,useRef as Mk}from"react";import{useCallback as dQ,useMemo as sQ,useRef as iQ}from"react";import{useContext as pQ,useMemo as aQ}from"react";import nQ,{useCallback as Qk,useContext as tQ,useEffect as IB,useLayoutEffect as oQ,useMemo as eQ,useRef as rQ,useState as Bj}from"react";import{jsx as bT}from"react/jsx-runtime";import qT from"react";import{useEffect as zT,useState as BT}from"react";import{useEffect as JT,useRef as KT}from"react";import{useEffect as TT}from"react";import{createContext as dB,useContext as Yj,useMemo as sB}from"react";import{jsx as UT}from"react/jsx-runtime";import{forwardRef as XT,useContext as vw,useEffect as YT,useImperativeHandle as ZT,useLayoutEffect as $T,useMemo as LT,useRef as NT}from"react";import{jsx as OT}from"react/jsx-runtime";import{jsx as Cb}from"react/jsx-runtime";import{forwardRef as FT,useCallback as vT,useEffect as xT,useImperativeHandle as ET,useMemo as xw,useRef as HT,useState as PT}from"react";import{jsx as Ck}from"react/jsx-runtime";import{createContext as IT,forwardRef as pB,useCallback as Sk,useContext as VT,useLayoutEffect as Tk,useMemo as Ew,useRef as Tb}from"react";import{jsx as Rh}from"react/jsx-runtime";import{forwardRef as oB,useCallback as dT,useContext as sT,useEffect as Sw,useImperativeHandle as iT,useMemo as pT,useRef as aT,useState as cw}from"react";import{jsx as ck}from"react/jsx-runtime";import{forwardRef as kU,useCallback as Vw,useState as qU}from"react";import{jsx as wU}from"react/jsx-runtime";import{useCallback as Uk,useContext as GU,useLayoutEffect as JU,useRef as fk}from"react";import{jsx as yh}from"react/jsx-runtime";import NU,{forwardRef as OU,useCallback as RU,useRef as gU}from"react";import{jsx as yU}from"react/jsx-runtime";import{createRef as xU}from"react";import EU from"react";import{useCallback as Zh,useImperativeHandle as HU,useMemo as Aw,useRef as PU,useState as Wk}from"react";import{jsx as _w}from"react/jsx-runtime";import IU from"react";import{useMemo as lw}from"react";import{createContext as mU,useContext as jG,useMemo as uU}from"react";import{jsx as dU}from"react/jsx-runtime";import{jsx as Mb}from"react/jsx-runtime";import oU from"react";import Ik,{createContext as hW}from"react";import kW,{useContext as dw}from"react";import{useCallback as zW}from"react";import{useCallback as sw,useContext as iw,useEffect as BW,useLayoutEffect as GW,useMemo as jj,useState as JW}from"react";import{jsx as MW}from"react/jsx-runtime";import pw,{forwardRef as TW,useCallback as UW,useContext as aw,useEffect as Xk,useImperativeHandle as WW,useMemo as nw,useRef as tw,useState as ow}from"react";import{useEffect as XW}from"react";import{jsx as YW}from"react/jsx-runtime";import{jsx as Nh}from"react/jsx-runtime";import e,{useMemo as LW}from"react";import{jsx as r}from"react/jsx-runtime";import{Children as yW,forwardRef as DW,useMemo as FW}from"react";import ew from"react";import{jsx as Kj}from"react/jsx-runtime";import IW from"react";import{forwardRef as AW,useCallback as _W,useContext as lW}from"react";import{forwardRef as mW,useContext as bz,useEffect as hz,useImperativeHandle as uW,useLayoutEffect as dW,useMemo as sW,useRef as iW}from"react";import{jsx as aW}from"react/jsx-runtime";import{jsx as Sb}from"react/jsx-runtime";var $G=Object.defineProperty,kz=(b,h)=>{for(var j in h)$G(b,j,{get:h[j],enumerable:!0,configurable:!0,set:(k)=>h[j]=()=>k})};if(typeof LG!=="function")throw Error(['Remotion requires React.createContext, but it is "undefined".','If you are in a React Server Component, turn it into a client component by adding "use client" at the top of the file.',"","Before:",' import {useCurrentFrame} from "remotion";',"","After:",' "use client";',' import {useCurrentFrame} from "remotion";'].join(`
|
|
2
|
+
`));var NG=()=>{throw Error("<Clipper> has been removed as of Remotion v4.0.228. The native clipping APIs were experimental and subject to removal at any time. We removed them because they were sparingly used and made rendering often slower rather than faster.")},xb=OG(!1),Zk=({children:b})=>{return RG(xb.Provider,{value:!0,children:b})},wz=gG({setError:()=>{},clearError:()=>{}}),Hq=()=>{try{if(typeof __webpack_module__>"u")return null;return __webpack_module__.hot??null}catch{return null}};class zz extends yG.Component{state={hasError:!1};hmrStatusHandler=null;static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(b){this.props.onError(b),this.subscribeToHmrReset()}componentDidMount(){if(!this.state.hasError)this.props.onClear()}componentDidUpdate(b,h){if(h.hasError&&!this.state.hasError)this.props.onClear()}componentWillUnmount(){this.unsubscribeFromHmrReset()}subscribeToHmrReset(){if(this.hmrStatusHandler)return;let b=Hq();if(!b)return;let h=(j)=>{if(j!=="idle")return;this.unsubscribeFromHmrReset(),this.setState({hasError:!1})};this.hmrStatusHandler=h,b.addStatusHandler(h)}unsubscribeFromHmrReset(){let b=this.hmrStatusHandler;if(!b)return;this.hmrStatusHandler=null;let h=Hq();if(!h)return;h.removeStatusHandler(b)}render(){if(this.state.hasError)return null;return this.props.children}}var jh=Bz({compositions:[],folders:[],currentCompositionMetadata:null,canvasContent:null}),vh=Bz({registerComposition:()=>{return},unregisterComposition:()=>{return},registerFolder:()=>{return},unregisterFolder:()=>{return},setCanvasContent:()=>{return},onlyRenderComposition:null}),xh=xG({getNonce:()=>0}),kj=0;try{if(typeof __webpack_module__<"u"){if(__webpack_module__.hot)__webpack_module__.hot.addStatusHandler((b)=>{if(b==="idle")kj++})}}catch{}var Zj=()=>{let h=HG(xh).getNonce(),j=Cq(h);j.current=h;let k=Cq([[kj,h]]),q=EG(()=>{if(kj!==k.current[k.current.length-1][0])k.current=[...k.current,[kj,j.current]];return k.current},[k]);return PG(()=>{return{get:q}},[q])};function kh(b){return Boolean(b)}var Gz=()=>/^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g,Jz=(b)=>b.match(Gz()),CG=(b)=>{if(b===void 0||b===null)throw TypeError("You must pass a name to a <Folder />.");if(typeof b!=="string")throw TypeError(`The "name" you pass into <Folder /> must be a string. Got: ${typeof b}`);if(!Jz(b))throw Error(`Folder name can only contain a-z, A-Z, 0-9 and -. You passed ${b}`)},SG=`Folder name must match ${String(Gz())}`,Mj=DG({folderName:null,parentName:null}),Kz=(b)=>{let{name:h,children:j}=b,k=Pq(Mj),{registerFolder:q,unregisterFolder:w}=Pq(vh),z=Zj(),B=b.stack??null;CG(h);let G=[k.parentName,k.folderName].filter(kh),J=G.length===0?null:G.join("/"),K=vG(()=>{return{folderName:h,parentName:J}},[h,J]);return FG(()=>{return q(h,J,z.get(),B),()=>{w(h,J)}},[h,k.folderName,J,q,w,z,B]),cG(Mj.Provider,{value:K,children:j})};function Sq(){return["NOD","E_EN","V"].join("")}var cq=()=>{return["e","nv"].join("")},o=()=>{let b=typeof window<"u"&&window.remotion_isPlayer,h=typeof window<"u"&&typeof window.process<"u"&&typeof window.process.env<"u"&&(window.process[cq()][Sq()]==="test"||window.process[cq()][Sq()]==="production"&&typeof window<"u"&&typeof window.remotion_puppeteerTimeout<"u"),j=typeof window<"u"&&window.remotion_isStudio,k=typeof window<"u"&&window.remotion_isReadOnlyStudio;return{isStudio:j,isRendering:h,isPlayer:b,isReadOnlyStudio:k,isClientSideRendering:!1}},$k="remotion-date:",Lk="remotion-file:",fG=({data:b,indent:h,staticBase:j})=>{let k=!1,q=!1,w=!1,z=!1;try{return{serializedString:JSON.stringify(b,function(G,J){let K=this[G];if(K instanceof Date)return k=!0,`${$k}${K.toISOString()}`;if(K instanceof Map)return w=!0,J;if(K instanceof Set)return z=!0,J;if(typeof K==="string"&&j!==null&&K.startsWith(j))return q=!0,`${Lk}${K.replace(j+"/","")}`;return J},h),customDateUsed:k,customFileUsed:q,mapUsed:w,setUsed:z}}catch(B){throw Error("Could not serialize the passed input props to JSON: "+B.message)}},Mz=(b)=>{return JSON.parse(b,(h,j)=>{if(typeof j==="string"&&j.startsWith($k))return new Date(j.replace($k,""));if(typeof j==="string"&&j.startsWith(Lk))return`${window.remotion_staticBase}/${j.replace(Lk,"")}`;return j})},IG=(b)=>{return Mz(fG({data:b,indent:2,staticBase:window.remotion_staticBase}).serializedString)},cb=(b)=>{if(o().isStudio)return IG(b);return b},Qz=VG(!1),lG=({children:b})=>{return _G(Qz.Provider,{value:!0,children:b})},$j=()=>{return AG(Qz)},Fb=({className:b,classPrefix:h,type:j})=>{if(!b)return!1;if(j==="exact"){let k=b.split(" ");return h.some((q)=>{return k.some((w)=>{return w.trim()===q||w.trim().endsWith(`:${q}`)||w.trim().endsWith(`!${q}`)})})}return h.some((k)=>{return b.startsWith(k)||b.includes(` ${k}`)||b.includes(`!${k}`)||b.includes(`:${k}`)})},sG=(b,h)=>{let{style:j,...k}=b,q=uG(()=>{return{position:"absolute",top:Fb({className:k.className,classPrefix:["top-","inset-"],type:"prefix"})?void 0:0,left:Fb({className:k.className,classPrefix:["left-","inset-"],type:"prefix"})?void 0:0,right:Fb({className:k.className,classPrefix:["right-","inset-"],type:"prefix"})?void 0:0,bottom:Fb({className:k.className,classPrefix:["bottom-","inset-"],type:"prefix"})?void 0:0,width:Fb({className:k.className,classPrefix:["w-"],type:"prefix"})?void 0:"100%",height:Fb({className:k.className,classPrefix:["h-"],type:"prefix"})?void 0:"100%",display:Fb({className:k.className,classPrefix:["block","inline-block","inline","flex","inline-flex","flow-root","grid","inline-grid","contents","list-item","hidden"],type:"exact"})?void 0:"flex",flexDirection:Fb({className:k.className,classPrefix:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"],type:"exact"})?void 0:"column",...j}},[k.className,j]);return dG("div",{ref:h,style:q,...k})},_k=mG(sG),iG={transform:"rotate(90deg)"},Iq=40,pG={color:"white",fontSize:14,fontFamily:"sans-serif"},aG={justifyContent:"center",alignItems:"center"},nG=()=>{return fq(_k,{style:aG,id:"remotion-comp-loading",children:[ij("style",{type:"text/css",children:`
|
|
3
|
+
@keyframes anim {
|
|
4
|
+
from {
|
|
5
|
+
opacity: 0
|
|
6
|
+
}
|
|
7
|
+
to {
|
|
8
|
+
opacity: 1
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
#remotion-comp-loading {
|
|
12
|
+
animation: anim 2s;
|
|
13
|
+
animation-fill-mode: forwards;
|
|
14
|
+
}
|
|
15
|
+
`}),ij("svg",{width:Iq,height:Iq,viewBox:"-100 -100 400 400",style:iG,children:ij("path",{fill:"#555",stroke:"#555",strokeWidth:"100",strokeLinejoin:"round",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"})}),fq("p",{style:pG,children:["Resolving ","<Suspense>","..."]})]})},kb=null,Nk=()=>{if(!kb){if(typeof document>"u")throw Error("Tried to call an API that only works in the browser from outside the browser");kb=document.createElement("div"),kb.style.position="absolute",kb.style.top="0px",kb.style.left="0px",kb.style.right="0px",kb.style.bottom="0px",kb.style.width="100%",kb.style.height="100%",kb.style.display="flex",kb.style.flexDirection="column";let b=document.createElement("div");b.style.position="fixed",b.style.top="-999999px",b.appendChild(kb),document.body.appendChild(b)}return kb},Ok=()=>{return"remotion_inputPropsOverride"+window.location.origin},Tz=()=>{if(typeof localStorage>"u")return null;let b=localStorage.getItem(Ok());if(!b)return null;return JSON.parse(b)},eG=(b)=>{if(typeof localStorage>"u")return;if(b===null){localStorage.removeItem(Ok());return}localStorage.setItem(Ok(),JSON.stringify(b))},Aq=!1,rG=()=>{if(Aq)return;Aq=!0,console.warn("Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object."),console.warn("To hide this warning, don't call this function on the server:"),console.warn(" typeof window === 'undefined' ? {} : getInputProps()")},Uz=()=>{if(typeof window>"u")return rG(),{};if(o().isPlayer)throw Error("You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.");let b=Tz();if(b)return b;if(typeof window>"u"||typeof window.remotion_inputProps>"u")throw 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.");let h=window.remotion_inputProps;if(!h)return{};return Mz(h)},lk=bJ({props:{},updateProps:()=>{throw Error("Not implemented")}}),qJ=Wz.createRef(),Xz=({children:b})=>{let[h,j]=Wz.useState({}),k=hJ(({defaultProps:w,id:z,newProps:B})=>{j((G)=>{return{...G,[z]:typeof B==="function"?B(G[z]??w):B}})},[]),q=jJ(()=>{return{props:h,updateProps:k}},[h,k]);return kJ(lk.Provider,{value:q,children:b})},Yz=BJ.createContext(null),d=()=>{let b=wJ(Yz),[h]=zJ(()=>o());return b??h};function Qj(b,h,j){if(typeof b!=="number")throw Error(`The "${h}" prop ${j} must be a number, but you passed a value of type ${typeof b}`);if(isNaN(b))throw TypeError(`The "${h}" prop ${j} must not be NaN, but is NaN.`);if(!Number.isFinite(b))throw TypeError(`The "${h}" prop ${j} must be finite, but is ${b}.`);if(b%1!==0)throw TypeError(`The "${h}" prop ${j} must be an integer, but is ${b}.`);if(b<=0)throw TypeError(`The "${h}" prop ${j} must be positive, but got ${b}.`)}function Lj(b,h){let{allowFloats:j,component:k}=h;if(typeof b>"u")throw Error(`The "durationInFrames" prop ${k} is missing.`);if(typeof b!=="number")throw Error(`The "durationInFrames" prop ${k} must be a number, but you passed a value of type ${typeof b}`);if(b<=0)throw TypeError(`The "durationInFrames" prop ${k} must be positive, but got ${b}.`);if(!j&&b%1!==0)throw TypeError(`The "durationInFrames" prop ${k} must be an integer, but got ${b}.`);if(!Number.isFinite(b))throw TypeError(`The "durationInFrames" prop ${k} must be finite, but got ${b}.`)}function Nj(b,h,j){if(typeof b!=="number")throw Error(`"fps" must be a number, but you passed a value of type ${typeof b} ${h}`);if(!Number.isFinite(b))throw Error(`"fps" must be a finite, but you passed ${b} ${h}`);if(isNaN(b))throw Error(`"fps" must not be NaN, but got ${b} ${h}`);if(b<=0)throw TypeError(`"fps" must be positive, but got ${b} ${h}`);if(j&&b>50)throw 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")}var Oj=tG(null),GJ=oG(),JJ=(b)=>{return Boolean(b.calculateMetadata)},mk=(b)=>{let h=pj(Oj),{props:j}=pj(lk),{compositions:k,canvasContent:q,currentCompositionMetadata:w}=pj(jh),z=q?.type==="composition"?q.compositionId:null,B=b??z,G=k.find((Q)=>Q.id===B),J=Vq(()=>{return G?j[G.id]??{}:{}},[j,G]),K=d();return Vq(()=>{if(!G)return null;if(w)return{type:"success",result:{...w,id:G.id,defaultProps:G.defaultProps??{}}};if(!JJ(G))return Lj(G.durationInFrames,{allowFloats:!1,component:`in <Composition id="${G.id}">`}),Nj(G.fps,`in <Composition id="${G.id}">`,!1),Qj(G.width,"width",`in <Composition id="${G.id}">`),Qj(G.height,"height",`in <Composition id="${G.id}">`),{type:"success",result:{width:G.width,height:G.height,fps:G.fps,id:G.id,durationInFrames:G.durationInFrames,defaultProps:G.defaultProps??{},props:{...G.defaultProps??{},...J??{},...typeof window>"u"||K.isPlayer||!window.remotion_inputProps?{}:Uz()??{}},defaultCodec:null,defaultOutName:null,defaultVideoImageFormat:null,defaultPixelFormat:null,defaultProResProfile:null,defaultSampleRate:null}};if(!h)return null;if(!h[G.id])return null;return h[G.id]},[G,h,w,J,K.isPlayer])},Zz=(b)=>{let h=b.stack??"";return h.startsWith("Error:")?h:`${b.message}
|
|
16
|
+
${h}`},QJ=(b)=>{if(b instanceof Error)return!0;if(b===null)return!1;if(typeof b!=="object")return!1;if(!("stack"in b))return!1;if(typeof b.stack!=="string")return!1;if(!("message"in b))return!1;if(typeof b.message!=="string")return!1;return!0};function uk(b,h){let j;if(QJ(h)){if(j=h,!j.stack)j.stack=Error(j.message).stack}else if(typeof h==="string")j=Error(h);else j=Error("Rendering was cancelled");if(b)b.remotion_cancelledError=Zz(j);throw j}function bh(b){return uk(typeof window<"u"?window:void 0,b)}var TJ=["trace","verbose","info","warn","error"],_q=(b)=>{return TJ.indexOf(b)},Rj=(b,h)=>{return _q(b)<=_q(h)},Eh=({args:b,logLevel:h,tag:j})=>{let k=[...b];if(o().isRendering&&!o().isClientSideRendering)k.unshift(Symbol.for(`__remotion_level_${h}`));if(j&&o().isRendering&&!o().isClientSideRendering)k.unshift(Symbol.for(`__remotion_tag_${j}`));return k},UJ=(b,...h)=>{if(Rj(b.logLevel,"verbose"))return console.debug(...Eh({args:h,logLevel:"verbose",tag:b.tag}))},WJ=(b,...h)=>{if(Rj(b.logLevel,"trace"))return console.debug(...Eh({args:h,logLevel:"trace",tag:b.tag}))},XJ=(b,...h)=>{if(Rj(b.logLevel,"info"))return console.log(...Eh({args:h,logLevel:"info",tag:b.tag}))},YJ=(b,...h)=>{if(Rj(b.logLevel,"warn"))return console.warn(...Eh({args:h,logLevel:"warn",tag:b.tag}))},ZJ=(b,...h)=>{return console.error(...Eh({args:h,logLevel:"error",tag:b.tag}))},p={trace:WJ,verbose:UJ,info:XJ,warn:YJ,error:ZJ};if(typeof window<"u"){if(window.remotion_renderReady=!1,!window.remotion_delayRenderTimeouts)window.remotion_delayRenderTimeouts={};window.remotion_delayRenderHandles=[]}var $J="The delayRender was called:",LJ="Retries left: ",NJ="- Rendering the frame will be retried.",OJ="handle was cleared after",RJ=30000,$z=({scope:b,environment:h,label:j,options:k})=>{if(typeof j!=="string"&&j!==null)throw Error("The label parameter of delayRender() must be a string or undefined, got: "+JSON.stringify(j));let q=Math.random();b.remotion_delayRenderHandles.push(q);let w=Error().stack?.replace(/^Error/g,"")??"";if(h.isRendering){let z=(k?.timeoutInMilliseconds??b.remotion_puppeteerTimeout??RJ)-2000,B=(k?.retries??0)-(b.remotion_attempt-1);b.remotion_delayRenderTimeouts[q]={label:j??null,startTime:Date.now(),timeout:setTimeout(()=>{let G=["A delayRender()",j?`"${j}"`:null,`was called but not cleared after ${z}ms. See https://remotion.dev/docs/timeout for help.`,B>0?LJ+B:null,B>0?NJ:null,$J,w].filter(kh).join(" ");if(h.isClientSideRendering)b.remotion_cancelledError=Zz(Error(G));else uk(b,Error(G))},z)}}return b.remotion_renderReady=!1,q},Rk=(b,h)=>{if(typeof window>"u")return Math.random();return $z({scope:window,environment:o(),label:b??null,options:h??{}})},Lz=({scope:b,handle:h,environment:j,logLevel:k})=>{if(typeof h>"u")throw TypeError("The continueRender() method must be called with a parameter that is the return value of delayRender(). No value was passed.");if(typeof h!=="number")throw TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: "+JSON.stringify(h));if(b.remotion_delayRenderHandles=b.remotion_delayRenderHandles.filter((q)=>{if(q===h){if(j.isRendering&&b!==void 0){if(!b.remotion_delayRenderTimeouts[h])return!1;let{label:w,startTime:z,timeout:B}=b.remotion_delayRenderTimeouts[h];clearTimeout(B);let G=[w?`"${w}"`:"A handle",OJ,`${Date.now()-z}ms`].filter(kh).join(" ");p.verbose({logLevel:k,tag:"delayRender()"},G),delete b.remotion_delayRenderTimeouts[h]}return!1}return!0}),b.remotion_delayRenderHandles.length===0)b.remotion_renderReady=!0},gJ=(b)=>{if(typeof window>"u")return;Lz({scope:window,handle:b,environment:o(),logLevel:window.remotion_logLevel??"info"})},Ab=yJ({logLevel:"info",mountTime:0}),Xb=()=>{let{logLevel:b}=dk.useContext(Ab);if(b===null)throw Error("useLogLevel must be used within a LogLevelProvider");return b},Hh=()=>{let{mountTime:b}=dk.useContext(Ab);if(b===null)throw Error("useMountTime must be used within a LogLevelProvider");return b},Nz=KJ(null),Kb=()=>{let b=d(),h=MJ(Nz)??(typeof window<"u"?window:void 0),j=Xb(),k=aj((z,B)=>{if(!h)return Math.random();return $z({scope:h,environment:b,label:z??null,options:B??{}})},[b,h]),q=aj((z)=>{if(!h)return;Lz({scope:h,handle:z,environment:b,logLevel:j})},[b,j,h]),w=aj((z)=>{return uk(h??(typeof window<"u"?window:void 0),z)},[h]);return{delayRender:k,continueRender:q,cancelRender:w}},Oz=({compProps:b,componentName:h,noSuspense:j})=>{let k=FJ(null);if("component"in b)k.current=b.component;return DJ(()=>{if("component"in b){if(typeof document>"u"||j)return b.component;if(typeof b.component>"u")throw Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${h}/> component.`);return(z)=>{let B=k.current;return lq.createElement(B,z)}}if("lazyComponent"in b&&typeof b.lazyComponent<"u"){if(typeof b.lazyComponent>"u")throw Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${h}/> component.`);return lq.lazy(b.lazyComponent)}throw Error("You must pass either 'component' or 'lazyComponent'")},[b.lazyComponent])},gj=()=>{let{canvasContent:b,compositions:h,currentCompositionMetadata:j}=vJ(jh),k=h.find((w)=>{return b?.type==="composition"&&w.id===b.compositionId}),q=mk(k?.id??null);return xJ(()=>{if(!q)return null;if(q.type==="error")return null;if(q.type==="loading")return null;if(!k)return null;return{...q.result,defaultProps:k.defaultProps??{},id:k.id,...j??{},component:k.component}},[j,q,k])},Rz=()=>/^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g,gz=(b)=>b.match(Rz()),EJ=(b)=>{if(!gz(b))throw Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${b}`)},HJ=`Composition ID must match ${String(Rz())}`,PJ=(b,h,j)=>{if(!b)return;if(typeof b!=="object")throw Error(`"${h}" must be an object, but you passed a value of type ${typeof b}`);if(Array.isArray(b))throw Error(`"${h}" must be an object, an array was passed ${j?`for composition "${j}"`:""}`)},CJ=()=>{let{continueRender:b,delayRender:h}=Kb();return qz(()=>{let j=h("Waiting for Root component to unsuspend");return()=>b(j)},[b,h]),null},SJ=({width:b,height:h,fps:j,durationInFrames:k,id:q,defaultProps:w,schema:z,...B})=>{let G=$h(vh),{registerComposition:J,unregisterComposition:K}=G,Q=gj(),M=Oz({compProps:B,componentName:"Composition",noSuspense:!1}),T=Zj(),U=$j(),W=d(),Y=$h(xb);if(typeof window<"u")window.remotion_seenCompositionIds=Array.from(new Set([...window.remotion_seenCompositionIds??[],q]));if(Y){if(U)throw Error("<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help.");throw Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.")}let{folderName:X,parentName:O}=$h(Mj),L=B.stack??null;qz(()=>{if(!q)throw Error("No id for composition passed.");return EJ(q),PJ(w,"defaultProps",q),J({durationInFrames:k??void 0,fps:j??void 0,height:h??void 0,width:b??void 0,id:q,folderName:X,component:M,defaultProps:cb(w??{}),nonce:T.get(),parentFolderName:O,schema:z??null,calculateMetadata:B.calculateMetadata??null,stack:L}),()=>{K(q)}},[k,j,h,M,q,X,w,b,T,O,z,B.calculateMetadata,L,J,K]);let $=mk(q),{setError:Z,clearError:N}=$h(wz),R=xq((g)=>{Z(g)},[Z]),F=xq(()=>{N()},[N]);if(W.isStudio&&Q&&Q.component===M&&Q.id===q){let g=M;if($===null||$.type!=="success"&&$.type!=="success-and-refreshing")return null;return Eq(Ub(Zk,{children:Ub(zz,{onError:R,onClear:F,children:Ub(vq,{fallback:Ub(nG,{}),children:Ub(g,{...$.result.props??{}})})})}),Nk())}if(W.isRendering&&Q&&Q.component===M&&Q.id===q){let g=M;if($===null||$.type!=="success"&&$.type!=="success-and-refreshing")return null;return Eq(Ub(Zk,{children:Ub(vq,{fallback:Ub(CJ,{}),children:Ub(g,{...$.result.props??{}})})}),Nk())}return null},sk=(b)=>{let{onlyRenderComposition:h}=$h(vh);if(h&&h!==b.id)return null;return Ub(SJ,{...b})},yz=[],cJ=()=>yz,bb=(b)=>{yz.push(b)},pb="4.0.484",fJ=()=>{if(typeof globalThis>"u")return;let b=()=>{if(globalThis.remotion_imported=pb,typeof window<"u")window.remotion_imported=pb},h=globalThis.remotion_imported||typeof window<"u"&&window.remotion_imported;if(h){if(h===pb)return;if(typeof h==="string"&&h.includes("webcodecs")){b();return}throw TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[pb,typeof h==="string"?h:"an older version"].filter(kh).join(" and ")}. This will cause things to break in an unexpected way.
|
|
17
|
+
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.`)}b()},IJ=()=>{throw Error("<Null> has been removed as of Remotion v4.0.228. The native clipping APIs were experimental and subject to removal at any time. We removed them because they were sparingly used and made rendering often slower rather than faster.")},a=mJ(null),gk={};kz(gk,{useTimelineSetFrame:()=>Pz,useTimelinePosition:()=>Hb,useTimelineContext:()=>Eb,usePlayingState:()=>Cz,usePlaybackRate:()=>tk,useAbsoluteTimelinePosition:()=>Hz,persistCurrentFrame:()=>Dz,getInitialFrameState:()=>Fz,getFrameForComposition:()=>vz,clampFrameToCompositionRange:()=>xz});function dq(b){let h=b+1831565813;return h=Math.imul(h^h>>>15,h|1),h^=h+Math.imul(h^h>>>7,h|61),((h^h>>>14)>>>0)/4294967296}function sJ(b){let h=0,j=0,k=0;for(h=0;h<b.length;h++)j=b.charCodeAt(h),k=(k<<5)-k+j,k|=0;return k}var qh=(b,h)=>{if(h!==void 0)throw TypeError("random() takes only one argument");if(b===null)return Math.random();if(typeof b==="string")return dq(sJ(b));if(typeof b==="number")return dq(b*10000000000);throw Error("random() argument must be a number or a string")},wh=yj({setFrame:()=>{throw Error("default")},setPlaying:()=>{throw Error("default")}}),zh=yj(null),pk=yj(null),ak=yj(null),iJ=({children:b,frameState:h})=>{let[j,k]=mh(!1),q=uq(!1),[w,z]=mh(1),B=uq([]),[G]=mh(()=>String(qh(null))),[J,K]=mh(()=>Fz()),Q=h??J,{delayRender:M,continueRender:T}=Kb();if(typeof window<"u")dJ(()=>{window.remotion_setFrame=(X,O,L)=>{window.remotion_attempt=L;let $=M(`Setting the current frame to ${X}`),Z=!0;if(K((N)=>{if((N[O]??window.remotion_initialFrame)===X)return Z=!1,N;return{...N,[O]:X}}),Z)requestAnimationFrame(()=>T($));else T($)},window.remotion_isPlayer=!1},[T,M]);let U=tj(()=>{return{frame:Q,playing:j,imperativePlaying:q,rootId:G,audioAndVideoTags:B}},[Q,j,G]),W=tj(()=>{return{playbackRate:w,setPlaybackRate:z}},[w]),Y=tj(()=>{return{setFrame:K,setPlaying:k}},[]);return uh(ak.Provider,{value:U,children:uh(pk.Provider,{value:W,children:uh(zh.Provider,{value:U,children:uh(wh.Provider,{value:Y,children:b})})})})},nk=()=>{return"remotion.time-all"},Dz=(b)=>{localStorage.setItem(nk(),JSON.stringify(b))},Fz=()=>{let b=localStorage.getItem(nk())??"{}";return JSON.parse(b)},vz=(b)=>{let h=localStorage.getItem(nk())??"{}",j=JSON.parse(h);if(j[b]!==void 0)return Number(j[b]);if(typeof window>"u")return 0;return window.remotion_initialFrame??0},xz=(b,h)=>{return Math.max(0,Math.min(Math.max(0,h-1),b))},Ez=(b)=>{let h=gj(),j=d();if(!h)return typeof window>"u"?0:window.remotion_initialFrame??0;let k=b.frame[h.id]??(j.isPlayer?0:vz(h.id));return xz(k,h.durationInFrames)},Eb=()=>{let b=Ph(zh);if(b===null)throw Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return b},tk=()=>{let b=Ph(pk);if(b===null)throw Error("PlaybackRateContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return b},Hb=()=>{let b=Eb();return Ez(b)},Hz=()=>{let b=Ph(ak);if(b===null)throw Error("AbsoluteTimeContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return Ez(b)},Pz=()=>{let{setFrame:b}=Ph(wh);return b},Cz=()=>{let{playing:b,imperativePlaying:h}=Eb(),{setPlaying:j}=Ph(wh);return uJ(()=>[b,j,h],[h,b,j])},qb=()=>{let b=sq(xb),h=d();if(!b){if(h.isPlayer)throw Error("useCurrentFrame can only be called inside a component that was passed to <Player>. See: https://www.remotion.dev/docs/player/examples");throw 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")}let j=Hb(),k=sq(a),q=k?k.cumulatedFrom+k.relativeFrom:0;return j-q},Ch=()=>{let b=aJ(a),h=b?.width??null,j=b?.height??null,k=b?.durationInFrames??null,q=gj();return nJ(()=>{if(!q)return null;let{id:w,durationInFrames:z,fps:B,height:G,width:J,defaultProps:K,props:Q,defaultCodec:M,defaultOutName:T,defaultVideoImageFormat:U,defaultPixelFormat:W,defaultProResProfile:Y,defaultSampleRate:X}=q;return{id:w,width:h??J,height:j??G,fps:B,durationInFrames:k??z,defaultProps:K,props:Q,defaultCodec:M,defaultOutName:T,defaultVideoImageFormat:U,defaultPixelFormat:W,defaultProResProfile:Y,defaultSampleRate:X}},[k,j,h,q])},wb=()=>{let b=Ch(),h=pJ(xb),j=$j();if(!b){if(typeof window<"u"&&window.remotion_isPlayer||j)throw Error(["No video config found. Likely reasons:","- You are probably calling useVideoConfig() from outside the component passed to <Player />. See https://www.remotion.dev/docs/player/examples for how to set up the Player correctly.","- You have multiple versions of Remotion installed which causes the React context to get lost."].join("-"));throw Error("No video config found. You are probably calling useVideoConfig() from a component which has not been registered as a <Composition />. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions for more information.")}if(!h)throw Error("Called useVideoConfig() outside a Remotion composition.");return b},ok=({frame:b,children:h,active:j=!0})=>{let k=qb(),q=wb();if(typeof b>"u")throw Error("The <Freeze /> component requires a 'frame' prop, but none was passed.");if(typeof b!=="number")throw Error(`The 'frame' prop of <Freeze /> must be a number, but is of type ${typeof b}`);if(Number.isNaN(b))throw Error("The 'frame' prop of <Freeze /> must be a real number, but it is NaN.");if(!Number.isFinite(b))throw Error(`The 'frame' prop of <Freeze /> must be a finite number, but it is ${b}.`);let w=nj(()=>{if(typeof j==="boolean")return j;if(typeof j==="function")return j(k)},[j,k]),z=Eb(),B=lJ(a),G=B?.relativeFrom??0,J=nj(()=>{if(!w)return z;return{...z,playing:!1,imperativePlaying:{current:!1},frame:{[q.id]:b+G}}},[w,z,q.id,b,G]),K=nj(()=>{if(!B)return null;if(!w)return B;return{...B,cumulatedFrom:0}},[B,w]);return iq(zh.Provider,{value:J,children:iq(a.Provider,{value:K,children:h})})},Yb={"style.transformOrigin":{type:"transform-origin",step:1,default:"50% 50%",description:"Transform origin"},"style.translate":{type:"translate",step:1,default:"0px 0px",description:"Offset"},"style.scale":{type:"scale",max:100,step:0.01,default:1,description:"Scale"},"style.rotate":{type:"rotation-css",step:1,default:"0deg",description:"Rotation"},"style.opacity":{type:"number",min:0,max:1,step:0.01,default:1,description:"Opacity",hiddenFromList:!1}},tJ=Yb,ek={"style.color":{type:"color",default:void 0,description:"Color"},"style.fontSize":{type:"number",default:void 0,min:0,step:1,description:"Font size",hiddenFromList:!1},"style.lineHeight":{type:"number",default:void 0,min:0,step:0.05,description:"Line height",hiddenFromList:!1},"style.fontWeight":{type:"enum",default:"400",description:"Font weight",variants:{"100":{},"200":{},"300":{},"400":{},"500":{},"600":{},"700":{},"800":{},"900":{},normal:{},bold:{}}},"style.fontStyle":{type:"enum",default:"normal",description:"Font style",variants:{normal:{},italic:{},oblique:{}}},"style.textAlign":{type:"enum",default:"left",description:"Text align",variants:{left:{},center:{},right:{},justify:{},start:{},end:{}}},"style.letterSpacing":{type:"number",default:void 0,step:0.1,description:"Letter spacing",hiddenFromList:!1}},Dj={premountFor:{type:"number",default:0,description:"Premount For",min:0,step:1,hiddenFromList:!1},postmountFor:{type:"number",default:0,min:0,step:1,hiddenFromList:!0},styleWhilePremounted:{type:"hidden"},styleWhilePostmounted:{type:"hidden"}},oJ=Dj,Sz={...Yb,...Dj},rk={type:"boolean",default:!1,description:"Hidden"},cz={type:"hidden"},bq={type:"hidden"},eJ=(b)=>{return{name:bq,...b}},hq={type:"number",default:void 0,min:1,step:1,hiddenFromList:!0},fz={type:"number",default:0,step:1,hiddenFromList:!0},Iz={type:"number",default:0,min:0,step:1,hiddenFromList:!0},jq={type:"number",default:null,step:1,hiddenFromList:!0},yb={durationInFrames:hq,from:fz,trimBefore:Iz,freeze:jq,hidden:rk,name:bq,showInTimeline:cz},hh={...yb,layout:{type:"enum",default:"absolute-fill",description:"Layout",variants:{"absolute-fill":Sz,none:{}}}},rJ={durationInFrames:hq,trimBefore:Iz,freeze:jq,hidden:rk,name:bq,showInTimeline:cz},bK={...rJ,layout:hh.layout},hK={...hh,layout:{...hh.layout,default:"none"}},Vz=jK({premountFramesRemaining:0}),Gh=Bh.createContext({registerSequence:()=>{throw Error("SequenceManagerContext not initialized")},unregisterSequence:()=>{throw Error("SequenceManagerContext not initialized")},sequences:[]}),Fj=Bh.createContext({current:[]}),Ob=(b)=>{return`${b.nodePath.join(".")}.${b.sequenceKeys.join(".")}.${b.effectKeys.map((h)=>h.join(".")).join(".")}`},vj=Bh.createContext({propStatuses:{}}),xj=Bh.createContext({current:{}}),Ej=Bh.createContext({getDragOverrides:()=>{throw Error("VisualModeDragOverridesContext not initialized")},getEffectDragOverrides:()=>{throw Error("VisualModeDragOverridesContext not initialized")}}),Az=Bh.createContext({setDragOverrides:()=>{throw Error("VisualModeSettersContext not initialized")},clearDragOverrides:()=>{throw Error("VisualModeSettersContext not initialized")},setEffectDragOverrides:()=>{throw Error("VisualModeSettersContext not initialized")},clearEffectDragOverrides:()=>{throw Error("VisualModeSettersContext not initialized")},setPropStatuses:()=>{throw Error("VisualModeSettersContext not initialized")}}),ej=(b,h)=>`${Ob(b)}.effects.${h}`,kK=({children:b})=>{let[h,j]=sh([]),k=oj(h);k.current=h;let[q,w]=sh({}),z=oj(q);z.current=q;let[B,G]=sh({}),[J,K]=sh({}),Q=oj(J);Q.current=J;let M=Nb((g,v,y)=>{w((x)=>({...x,[Ob(g)]:{...x[Ob(g)],[v]:y}}))},[]),T=Nb((g)=>{w((v)=>{let y=Ob(g);if(!v[y])return v;let x={...v};return delete x[y],x})},[]),U=Nb((g,v,y,x)=>{G((D)=>{let C=ej(g,v);return{...D,[C]:{...D[C],[y]:x}}})},[]),W=Nb((g,v)=>{G((y)=>{let x=ej(g,v);if(!y[x])return y;let D={...y};return delete D[x],D})},[]),Y=Nb((g,v)=>{K((y)=>{let x=Ob(g),D=y[x],C=v(D);if(D===C)return y;return{...y,[x]:C}})},[]),X=Nb((g)=>{j((v)=>{return[...v,g]})},[]),O=Nb((g)=>{j((v)=>v.filter((y)=>y.id!==g))},[]),L=dh(()=>{return{registerSequence:X,sequences:h,unregisterSequence:O}},[X,h,O]),$=Nb((g)=>{return q[Ob(g)]??{}},[q]),Z=Nb((g,v)=>{return B[ej(g,v)]??{}},[B]),N=dh(()=>{return{propStatuses:J}},[J]),R=dh(()=>{return{getDragOverrides:$,getEffectDragOverrides:Z}},[$,Z]),F=dh(()=>{return{setDragOverrides:M,clearDragOverrides:T,setEffectDragOverrides:U,clearEffectDragOverrides:W,setPropStatuses:Y}},[M,T,U,W,Y]);return db(Fj.Provider,{value:k,children:db(Gh.Provider,{value:L,children:db(xj.Provider,{value:Q,children:db(vj.Provider,{value:N,children:db(Ej.Provider,{value:R,children:db(Az.Provider,{value:F,children:b})})})})})})},Hj=qK(!1),wK=({children:b})=>{return _z(Hj.Provider,{value:!0,children:b})},zK=({children:b})=>{return _z(Hj.Provider,{value:!1,children:b})},BK=()=>{if(!pq.useContext(Hj))throw Error("This component must be inside a <Series /> component.")},kq=!1,KK=(b,h)=>{for(let j of h){let k=j.split("."),q=[b],w=b;for(let z=0;z<k.length-1;z++){let B=k[z],G=w[B];if(G===void 0||G===null){w=null;break}w=G,q.push(w)}if(w===null)continue;delete w[k[k.length-1]];for(let z=q.length-1;z>0;z--){let B=q[z];if(Object.keys(B).length===0){let G=k[z-1];delete q[z-1][G]}else break}}return b},MK=4,QK=0.001,TK=0.0000001,UK=10,Lh=11,ih=1/(Lh-1),WK=typeof Float32Array==="function";function mz(b,h){return 1-3*h+3*b}function uz(b,h){return 3*h-6*b}function dz(b){return 3*b}function Tj(b,h,j){return((mz(h,j)*b+uz(h,j))*b+dz(h))*b}function sz(b,h,j){return 3*mz(h,j)*b*b+2*uz(h,j)*b+dz(h)}function XK({aX:b,_aA:h,_aB:j,mX1:k,mX2:q}){let w,z,B=0,G=h,J=j;do if(z=G+(J-G)/2,w=Tj(z,k,q)-b,w>0)J=z;else G=z;while(Math.abs(w)>TK&&++B<UK);return z}function YK(b,h,j,k){let q=h;for(let w=0;w<MK;++w){let z=sz(q,j,k);if(z===0)return q;let B=Tj(q,j,k)-b;q-=B/z}return q}function iz(b,h,j,k){if(!(b>=0&&b<=1&&j>=0&&j<=1))throw Error("bezier x values must be in [0, 1] range");let q=WK?new Float32Array(Lh):Array(Lh);if(b!==h||j!==k)for(let z=0;z<Lh;++z)q[z]=Tj(z*ih,b,j);function w(z){let B=0,G=1,J=Lh-1;for(;G!==J&&q[G]<=z;++G)B+=ih;--G;let K=(z-q[G])/(q[G+1]-q[G]),Q=B+K*ih,M=sz(Q,b,j);if(M>=QK)return YK(z,Q,b,j);if(M===0)return Q;return XK({aX:z,_aA:B,_aB:B+ih,mX1:b,mX2:j})}return function(z){let B=Math.min(1,Math.max(0,z));if(b===h&&j===k)return B;if(B===0)return 0;if(B===1)return 1;return Tj(w(B),h,k)}}var ZK=(b)=>{return Math.round(b*1e6)/1e6},$K=new Set(["deg","rad","grad","turn"]),pz=new Set(["%","cap","ch","cm","cqb","cqh","cqi","cqmax","cqmin","cqw","dvh","dvw","em","ex","ic","in","lh","lvh","lvw","mm","pc","pt","px","q","rem","rlh","svh","svw","vb","vh","vi","vmax","vmin","vw"]),az=/^([+-]?(?:\d+\.?\d*|\.\d+))([a-zA-Z%]+)?$/,nz=new Set(["left","center","right","top","bottom"]),ab=(b)=>{if(b==="left")return[{axis:"x",value:{value:0,unit:"%"}}];if(b==="right")return[{axis:"x",value:{value:100,unit:"%"}}];if(b==="top")return[{axis:"y",value:{value:0,unit:"%"}}];if(b==="bottom")return[{axis:"y",value:{value:100,unit:"%"}}];return[{axis:"x",value:{value:50,unit:"%"}},{axis:"y",value:{value:50,unit:"%"}}]},Th={value:50,unit:"%"},aq=(b)=>{return String(ZK(b))},LK=(b,h)=>{let j=az.exec(b);if(j===null)throw TypeError(`Cannot interpolate "${h}" because "${b}" is not a supported scale, translate, or rotate value`);let k=j[2]??null,q=Number(j[1]);if(!Number.isFinite(q))throw TypeError(`Cannot interpolate "${h}" because "${b}" is not finite`);if(k===null)return{kind:"scale",value:q,unit:null};if($K.has(k))return{kind:"rotate",value:q,unit:k};if(pz.has(k))return{kind:"translate",value:q,unit:k};throw TypeError(`Cannot interpolate "${h}" because "${k}" is not a supported translate or rotate unit`)},tz=({component:b,value:h,allowPercentage:j})=>{let k=az.exec(b);if(k===null)throw TypeError(`Cannot interpolate "${h}" because "${b}" is not a supported transform-origin ${j?"length-percentage":"z length"}`);let q=k[2]??null,w=Number(k[1]);if(!Number.isFinite(w))throw TypeError(`Cannot interpolate "${h}" because "${b}" is not finite`);if(q===null||!pz.has(q)||!j&&q==="%")throw TypeError(`Cannot interpolate "${h}" because "${b}" is not a supported transform-origin ${j?"length-percentage":"z length"}`);return{value:w,unit:q}},kk=(b,h)=>{let j=b.toLowerCase();if(nz.has(j))return{type:"keyword",keyword:j};return{type:"length-percentage",parsed:tz({component:b,value:h,allowPercentage:!0})}},NK=(b,h,j)=>{let k=[];for(let q of ab(b))for(let w of ab(h)){if(q.axis===w.axis)continue;k.push(q.axis==="x"?[q.value,w.value]:[w.value,q.value])}if(k.length===0)throw TypeError(`Cannot interpolate "${j}" because "${b} ${h}" is not a valid transform-origin keyword pair`);return k[0]},OK=(b,h)=>{if(b.length===1){let B=kk(b[0],h);if(B.type==="length-percentage")return[B.parsed,Th];if(B.keyword==="top"||B.keyword==="bottom")return[Th,ab(B.keyword)[0].value];return[ab(B.keyword)[0].value,Th]}let j=kk(b[0],h),k=kk(b[1],h);if(j.type==="length-percentage"&&k.type==="length-percentage")return[j.parsed,k.parsed];if(j.type==="keyword"&&k.type==="keyword")return NK(j.keyword,k.keyword,h);let q=j.type==="keyword"?j:k.type==="keyword"?k:null,w=j.type==="length-percentage"?j.parsed:k.type==="length-percentage"?k.parsed:null;if(q===null||w===null)throw Error("Expected a keyword and a length-percentage value");let z=j.type==="keyword";if(q.keyword==="left"||q.keyword==="right"){if(!z)throw TypeError(`Cannot interpolate "${h}" because horizontal transform-origin keywords must come before a length-percentage value`);return[ab(q.keyword)[0].value,w]}if(q.keyword==="top"||q.keyword==="bottom")return[w,ab(q.keyword)[0].value];return z?[Th,w]:[w,Th]},RK=(b,h)=>{let[j,k]=OK(h.slice(0,2),b),q=h[2]===void 0?{value:0,unit:null}:tz({component:h[2],value:b,allowPercentage:!1});return{kind:"translate",values:[j.value,k.value,q.value],units:[j.unit,k.unit,q.unit],dimensions:h[2]===void 0?2:3}},gK=(b)=>{if(typeof b==="number"){if(!Number.isFinite(b))throw Error(`outputRange must contain only finite numbers, but got [${b}]`);return{kind:"scale",values:[b,b,1],units:[null,null,null],dimensions:1}}let h=b.trim().split(/\s+/);if(h.length<1||h.length>3||h[0]==="")throw TypeError(`String outputRange values must contain 1 to 3 components, but got "${b}"`);if(h.some((q)=>nz.has(q.toLowerCase())))return RK(b,h);let j=h.map((q)=>LK(q,b)),[{kind:k}]=j;for(let q of j)if(q.kind!==k)throw TypeError(`Cannot interpolate "${b}" because it mixes ${k} and ${q.kind} values`);if(k==="scale"){let q=j[0].value,w=j[1]?.value??q,z=j[2]?.value??1;return{kind:k,values:[q,w,z],units:[null,null,null],dimensions:j.length}}return{kind:k,values:[j[0].value,j[1]?.value??0,j[2]?.value??0],units:[j[0].unit,j[1]?.unit??null,j[2]?.unit??null],dimensions:j.length}},yK=({kind:b,values:h,units:j,dimensions:k})=>{if(b==="scale")return h.slice(0,k).map((q)=>aq(q)).join(" ");return h.slice(0,k).map((q,w)=>`${aq(q)}${j[w]}`).join(" ")};function DK(b,h,j,k){let{extrapolateLeft:q,extrapolateRight:w,easing:z}=k,B=b,[G,J]=h,[K,Q]=j;if(B<G){if(q==="identity")return B;if(q==="clamp")B=G;else if(q==="wrap"){let M=J-G;B=((B-G)%M+M)%M+G}}if(B>J){if(w==="identity")return B;if(w==="clamp")B=J;else if(w==="wrap"){let M=J-G;B=((B-G)%M+M)%M+G}}if(K===Q)return K;return B=(B-G)/(J-G),B=z(B),B=B*(Q-K)+K,B}function FK(b,h){let j;for(j=1;j<h.length-1;++j)if(h[j]>=b)break;return j-1}var vK=(b)=>b,oz=(b)=>{return b.remotionShouldExtendRight===!0},nq=({easing:b,segmentIndex:h})=>{if(b===void 0)return vK;if(typeof b==="function")return b;return b[h]},tq=({input:b,inputRange:h,outputRange:j,easing:k,extrapolateLeft:q,extrapolateRight:w})=>{return DK(b,h,j,{easing:k,extrapolateLeft:q,extrapolateRight:b>h[1]&&w==="clamp"&&oz(k)?"extend":w})},qq=({input:b,inputRange:h,outputRange:j,options:k})=>{if(h.length===1)return j[0];let q=k?.easing,w="extend";if(k?.extrapolateLeft!==void 0)w=k.extrapolateLeft;let z="extend";if(k?.extrapolateRight!==void 0)z=k.extrapolateRight;let B=k?.posterize===void 0?b:Math.floor(b/k.posterize)*k.posterize,G=FK(B,h),J=nq({easing:q,segmentIndex:G}),K=tq({input:B,inputRange:[h[G],h[G+1]],outputRange:[j[G],j[G+1]],easing:J,extrapolateLeft:w,extrapolateRight:z});for(let Q=0;Q<G;Q++){let M=nq({easing:q,segmentIndex:Q});if(!oz(M))continue;let T=h[Q+1];if(B<=T)continue;let U=tq({input:B,inputRange:[h[Q],T],outputRange:[j[Q],j[Q+1]],easing:M,extrapolateLeft:w,extrapolateRight:"extend"});K+=U-j[Q+1]}return K},xK=({input:b,inputRange:h,outputRange:j,options:k})=>{let q=j.map(gK),w=q[0]?.kind;if(w===void 0)throw Error("outputRange must have at least 1 element");for(let G of q)if(G.kind!==w)throw TypeError(`Cannot interpolate ${w} values with ${G.kind} values`);let z=Math.max(...q.map((G)=>G.dimensions)),B=[null,null,null];if(w!=="scale")for(let G=0;G<z;G++){for(let J of q){let K=J.units[G];if(K===null)continue;if(B[G]===null){B[G]=K;continue}if(B[G]!==K)throw TypeError(`Cannot interpolate ${w} values with different units on axis ${G+1}: ${B[G]} and ${K}`)}if(B[G]===null)throw TypeError(`Cannot interpolate ${w} values because axis ${G+1} has no unit`)}return yK({kind:w,values:[0,0,0].map((G,J)=>qq({input:b,inputRange:h,outputRange:q.map((K)=>K.values[J]),options:k})),units:B,dimensions:z})},EK=(b)=>{let h=b[0]?.length;if(h===void 0)throw Error("outputRange must have at least 1 element");if(h===0)throw TypeError("outputRange tuples must contain at least 1 number");for(let j of b){if(j.length!==h)throw TypeError(`outputRange tuples must all have the same length, but got ${h} and ${j.length}`);for(let k of j)if(typeof k!=="number"||!Number.isFinite(k))throw TypeError(`outputRange tuples must contain only finite numbers, but got [${j.join(",")}]`)}return h},HK=({input:b,inputRange:h,outputRange:j,options:k})=>{let q=EK(j);return Array(q).fill(!0).map((w,z)=>qq({input:b,inputRange:h,outputRange:j.map((B)=>B[z]),options:k}))};function PK(b){for(let h=1;h<b.length;++h)if(!(b[h]>b[h-1]))throw Error(`inputRange must be strictly monotonically increasing but got [${b.join(",")}]`)}function oq(b,h){if(h.length<1)throw Error(b+" must have at least 1 element");for(let j of h){if(typeof j!=="number")throw Error(`${b} must contain only numbers`);if(!Number.isFinite(j))throw Error(`${b} must contain only finite numbers, but got [${h.join(",")}]`)}}function ez(b,h){if(b===void 0)return;if(typeof b==="function")return;let j=h-1;if(b.length!==j)throw Error(`When easing is an array, it must have one entry per segment between keyframes (length inputRange.length - 1 = ${j}), but got length ${b.length}`);for(let k=0;k<b.length;k++)if(typeof b[k]!=="function")throw Error(`easing[${k}] must be a function`)}function rz(b){if(b===void 0)return;if(typeof b!=="number"||!Number.isFinite(b)||b<=0)throw Error(`posterize must be a positive finite number, but got ${b}`)}function Sh(b,h,j,k){if(typeof b>"u")throw Error("input can not be undefined");if(typeof h>"u")throw Error("inputRange can not be undefined");if(typeof j>"u")throw Error("outputRange can not be undefined");if(h.length!==j.length)throw Error("inputRange ("+h.length+") and outputRange ("+j.length+") must have the same length");if(oq("inputRange",h),PK(h),ez(k?.easing,h.length),rz(k?.posterize),typeof b!=="number")throw TypeError("Cannot interpolate an input which is not a number");if(!Array.isArray(j))throw Error("outputRange must contain only numbers");if(j.some((w)=>typeof w==="string")){if(!j.every((w)=>typeof w==="string"||typeof w==="number"))throw TypeError("outputRange must contain only numbers, or supported scale, translate, and rotate strings");return xK({input:b,inputRange:h,outputRange:j,options:k})}if(j.every((w)=>Array.isArray(w)))return HK({input:b,inputRange:h,outputRange:j,options:k});if(!j.every((w)=>typeof w==="number"))throw TypeError("outputRange must contain only numbers, numeric tuples, or supported scale, translate, and rotate strings");return oq("outputRange",j),qq({input:b,inputRange:h,outputRange:j,options:k})}var CK=({allowFloats:b,durationInFrames:h,frame:j})=>{if(typeof j>"u")throw TypeError('Argument missing for parameter "frame"');if(typeof j!=="number")throw TypeError(`Argument passed for "frame" is not a number: ${j}`);if(!Number.isFinite(j))throw RangeError(`Frame ${j} is not finite`);if(j%1!==0&&!b)throw RangeError(`Argument for frame must be an integer, but got ${j}`);if(j<0&&j<-h)throw RangeError(`Cannot use frame ${j}: Duration of composition is ${h}, therefore the lowest frame that can be rendered is ${-h}`);if(j>h-1)throw RangeError(`Cannot use frame ${j}: Duration of composition is ${h}, therefore the highest frame that can be rendered is ${h-1}`)},SK=(b)=>{if(typeof b>"u")return;if(typeof b!=="number")throw TypeError(`A "duration" of a spring must be a "number" but is "${typeof b}"`);if(Number.isNaN(b))throw TypeError('A "duration" of a spring is NaN, which it must not be');if(!Number.isFinite(b))throw TypeError('A "duration" of a spring must be finite, but is '+b);if(b<=0)throw TypeError('A "duration" of a spring must be positive, but is '+b)},cK={damping:10,mass:1,stiffness:100,overshootClamping:!1},qk={};function fK({animation:b,now:h,config:j}){let{toValue:k,lastTimestamp:q,current:w,velocity:z}=b,B=Math.min(h-q,64);if(j.damping<=0)throw Error("Spring damping must be greater than 0, otherwise the spring() animation will never end, causing an infinite loop.");let{damping:G,mass:J,stiffness:K}=j,Q=[k,q,w,z,G,J,K,h].join("-");if(qk[Q])return qk[Q];let M=-z,T=k-w,U=G/(2*Math.sqrt(K*J)),W=Math.sqrt(K/J),Y=W*Math.sqrt(1-U**2),X=B/1000,O=Math.sin(Y*X),L=Math.cos(Y*X),$=Math.exp(-U*W*X),Z=$*(O*((M+U*W*T)/Y)+T*L),N=k-Z,R=U*W*Z-$*(L*(M+U*W*T)-Y*T*O),F=Math.exp(-W*X),g=k-F*(T+(M+W*T)*X),v=F*(M*(X*W-1)+X*T*W*W),y={toValue:k,prevPosition:w,lastTimestamp:h,current:U<1?N:g,velocity:U<1?R:v};return qk[Q]=y,y}var wk={};function bB({frame:b,fps:h,config:j={}}){let w=[b,h,j.damping,j.mass,j.overshootClamping,j.stiffness].join("-");if(wk[w])return wk[w];let z={lastTimestamp:0,current:0,toValue:1,velocity:0,prevPosition:0},B=Math.max(0,b),G=B%1;for(let J=0;J<=Math.floor(B);J++){if(J===Math.floor(B))J+=G;let K=J/h*1000;z=fK({animation:z,now:K,config:{...cK,...j}})}return wk[w]=z,z}var zk=new Map;function wq({fps:b,config:h={},threshold:j=0.005}){if(typeof j!=="number")throw TypeError(`threshold must be a number, got ${j} of type ${typeof j}`);if(j===0)return 1/0;if(j===1)return 0;if(isNaN(j))throw TypeError("Threshold is NaN");if(!Number.isFinite(j))throw TypeError("Threshold is not finite");if(j<0)throw TypeError("Threshold is below 0");let k=[b,h.damping,h.mass,h.overshootClamping,h.stiffness,j].join("-");if(zk.has(k))return zk.get(k);Nj(b,"to the measureSpring() function",!1);let q=0,w=0,z=()=>{return bB({fps:b,frame:q,config:h})},B=z(),G=()=>{return Math.abs(B.current-B.toValue)},J=G();while(J>=j)q++,B=z(),J=G();w=q;for(let K=0;K<20;K++)if(q++,B=z(),J=G(),J>=j)K=0,w=q+1;return zk.set(k,w),w}function yk({frame:b,fps:h,config:j={},from:k=0,to:q=1,durationInFrames:w,durationRestThreshold:z,delay:B=0,reverse:G=!1}){SK(w),CK({frame:b,durationInFrames:1/0,allowFloats:!0}),Nj(h,"to spring()",!1);let J=G||typeof w<"u",K=J?wq({fps:h,config:j,threshold:z}):void 0,Q=J?{get:()=>K}:{get:()=>{throw Error("did not calculate natural duration, this is an error with Remotion. Please report")}},T=(G?(w??Q.get())-b:b)+(G?B:-B),U=w===void 0?T:T/(w/Q.get());if(w&&T>w)return q;let W=bB({fps:h,frame:U,config:j}),Y=j.overshootClamping?q>=k?Math.min(W.current,q):Math.max(W.current,q):W.current;return k===0&&q===1?Y:Sh(Y,[0,1],[k,q])}var eq=(b)=>Math.min(1,Math.max(0,b)),Uh=30;class gh{static step0(b){return b>0?1:0}static step1(b){return b>=1?1:0}static linear(b){return b}static ease(b){return gh.bezier(0.42,0,1,1)(b)}static quad(b){return b*b}static cubic(b){return b*b*b}static poly(b){return(h)=>h**b}static sin(b){return 1-Math.cos(b*Math.PI/2)}static circle(b){let h=eq(b);return 1-Math.sqrt(1-h*h)}static exp(b){return 2**(10*(b-1))}static elastic(b=1){let h=b*Math.PI;return(j)=>1-Math.cos(j*Math.PI/2)**3*Math.cos(j*h)}static back(b=1.70158){return(h)=>h*h*((b+1)*h-b)}static spring({allowTail:b=!1,durationRestThreshold:h,...j}={}){return Object.assign((q)=>{if(q<=0)return 0;if(!b&&q>=1)return 1;if(b)return yk({fps:Uh,frame:q*wq({fps:Uh,config:j,threshold:h}),config:j});return yk({fps:Uh,frame:q*Uh,config:j,durationInFrames:Uh,durationRestThreshold:h})},{remotionShouldExtendRight:b})}static bounce(b){let h=eq(b);if(h<0.36363636363636365)return 7.5625*h*h;if(h<0.7272727272727273){let k=h-0.5454545454545454;return 7.5625*k*k+0.75}if(h<0.9090909090909091){let k=h-0.8181818181818182;return 7.5625*k*k+0.9375}let j=h-0.9545454545454546;return 7.5625*j*j+0.984375}static bezier(b,h,j,k){return iz(b,h,j,k)}static in(b){return b}static out(b){return(h)=>1-b(1-h)}static inOut(b){return(h)=>{if(h<0.5)return b(h*2)/2;return 1-b((1-h)*2)/2}}}var Qb="[-+]?\\d*\\.?\\d+",ph=Qb+"%";function ah(...b){return"\\(\\s*("+b.join(")\\s*,\\s*(")+")\\s*\\)"}var nh="(?:none|[-+]?\\d*\\.?\\d+(?:%|deg|rad|grad|turn)?)";function Wh(b){return new RegExp(b+"\\(\\s*("+nh+")\\s+("+nh+")\\s+("+nh+")(?:\\s*\\/\\s*("+nh+"))?\\s*\\)")}function IK(){let b={rgb:void 0,rgba:void 0,hsl:void 0,hsla:void 0,hex3:void 0,hex4:void 0,hex5:void 0,hex6:void 0,hex8:void 0,oklch:void 0,oklab:void 0,lab:void 0,lch:void 0,hwb:void 0};if(b.rgb===void 0)b.rgb=new RegExp("rgb"+ah(Qb,Qb,Qb)),b.rgba=new RegExp("rgba"+ah(Qb,Qb,Qb,Qb)),b.hsl=new RegExp("hsl"+ah(Qb,ph,ph)),b.hsla=new RegExp("hsla"+ah(Qb,ph,ph,Qb)),b.hex3=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,b.hex4=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,b.hex6=/^#([0-9a-fA-F]{6})$/,b.hex8=/^#([0-9a-fA-F]{8})$/,b.oklch=Wh("oklch"),b.oklab=Wh("oklab"),b.lab=Wh("lab"),b.lch=Wh("lch"),b.hwb=Wh("hwb");return b}function tb(b,h,j){if(j<0)j+=1;if(j>1)j-=1;if(j<0.16666666666666666)return b+(h-b)*6*j;if(j<0.5)return h;if(j<0.6666666666666666)return b+(h-b)*(0.6666666666666666-j)*6;return b}function rq(b,h,j){let k=j<0.5?j*(1+h):j+h-j*h,q=2*j-k,w=tb(q,k,b+0.3333333333333333),z=tb(q,k,b),B=tb(q,k,b-0.3333333333333333);return Math.round(w*255)<<24|Math.round(z*255)<<16|Math.round(B*255)<<8}function sb(b){let h=Number.parseInt(b,10);if(h<0)return 0;if(h>255)return 255;return h}function bw(b){return(Number.parseFloat(b)%360+360)%360/360}function hw(b){let h=Number.parseFloat(b);if(h<0)return 0;if(h>1)return 255;return Math.round(h*255)}function th(b){let h=Number.parseFloat(b);if(h<0)return 0;if(h>100)return 1;return h/100}function Jb(b,h){if(b==="none")return 0;if(b.endsWith("%"))return Number.parseFloat(b)/100*h;return Number.parseFloat(b)}function Bk(b){if(b==="none")return 0;if(b.endsWith("rad"))return Number.parseFloat(b)*180/Math.PI;if(b.endsWith("grad"))return Number.parseFloat(b)*0.9;if(b.endsWith("turn"))return Number.parseFloat(b)*360;return Number.parseFloat(b)}function Xh(b){if(b===void 0||b==="none")return 1;if(b.endsWith("%"))return Math.max(0,Math.min(1,Number.parseFloat(b)/100));return Math.max(0,Math.min(1,Number.parseFloat(b)))}function ob(b){if(b<=0.0031308)return 12.92*b;return 1.055*b**0.4166666666666667-0.055}function oh(b){return Math.max(0,Math.min(1,b))}function Yh(b,h,j,k){let q=Math.round(oh(b)*255),w=Math.round(oh(h)*255),z=Math.round(oh(j)*255),B=Math.round(oh(k)*255);return(q<<24|w<<16|z<<8|B)>>>0}function jw(b,h,j){let k=b+0.3963377774*h+0.2158037573*j,q=b-0.1055613458*h-0.0638541728*j,w=b-0.0894841775*h-1.291485548*j,z=k*k*k,B=q*q*q,G=w*w*w,J=4.0767416621*z-3.3077115913*B+0.2309699292*G,K=-1.2684380046*z+2.6097574011*B-0.3413193965*G,Q=-0.0041960863*z-0.7034186147*B+1.707614701*G;return[ob(J),ob(K),ob(Q)]}function kw(b,h,j){let G=(b+16)/116,J=h/500+G,K=G-j/200,Q=J*J*J,M=K*K*K,T=Q>0.008856451679035631?Q:(116*J-16)/903.2962962962963,U=b>8?((b+16)/116)**3:b/903.2962962962963,W=M>0.008856451679035631?M:(116*K-16)/903.2962962962963,Y=T*0.95047,X=U*1,O=W*1.08883,L=3.2404542*Y-1.5371385*X-0.4985314*O,$=-0.969266*Y+1.8760108*X+0.041556*O,Z=0.0556434*Y-0.2040259*X+1.0572252*O;return[ob(L),ob($),ob(Z)]}function VK(b,h,j){if(h+j>=1){let J=h/(h+j);return[J,J,J]}let k=1,q=0,w=tb(q,k,b+0.3333333333333333),z=tb(q,k,b),B=tb(q,k,b-0.3333333333333333),G=1-h-j;return[w*G+h,z*G+h,B*G+h]}var qw={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199};function AK(b){let h=IK(),j;if(h.hex6){if(j=h.hex6.exec(b))return Number.parseInt(j[1]+"ff",16)>>>0}if(qw[b]!==void 0)return qw[b];if(h.rgb){if(j=h.rgb.exec(b))return(sb(j[1])<<24|sb(j[2])<<16|sb(j[3])<<8|255)>>>0}if(h.rgba){if(j=h.rgba.exec(b))return(sb(j[1])<<24|sb(j[2])<<16|sb(j[3])<<8|hw(j[4]))>>>0}if(h.hex3){if(j=h.hex3.exec(b))return Number.parseInt(j[1]+j[1]+j[2]+j[2]+j[3]+j[3]+"ff",16)>>>0}if(h.hex8){if(j=h.hex8.exec(b))return Number.parseInt(j[1],16)>>>0}if(h.hex4){if(j=h.hex4.exec(b))return Number.parseInt(j[1]+j[1]+j[2]+j[2]+j[3]+j[3]+j[4]+j[4],16)>>>0}if(h.hsl){if(j=h.hsl.exec(b))return(rq(bw(j[1]),th(j[2]),th(j[3]))|255)>>>0}if(h.hsla){if(j=h.hsla.exec(b))return(rq(bw(j[1]),th(j[2]),th(j[3]))|hw(j[4]))>>>0}if(h.oklch){if(j=h.oklch.exec(b)){let k=Jb(j[1],1),q=Jb(j[2],0.4),w=Bk(j[3]),z=Xh(j[4]),B=w*Math.PI/180,[G,J,K]=jw(k,q*Math.cos(B),q*Math.sin(B));return Yh(G,J,K,z)}}if(h.oklab){if(j=h.oklab.exec(b)){let k=Jb(j[1],1),q=Jb(j[2],0.4),w=Jb(j[3],0.4),z=Xh(j[4]),[B,G,J]=jw(k,q,w);return Yh(B,G,J,z)}}if(h.lab){if(j=h.lab.exec(b)){let k=Jb(j[1],100),q=Jb(j[2],125),w=Jb(j[3],125),z=Xh(j[4]),[B,G,J]=kw(k,q,w);return Yh(B,G,J,z)}}if(h.lch){if(j=h.lch.exec(b)){let k=Jb(j[1],100),q=Jb(j[2],150),w=Bk(j[3]),z=Xh(j[4]),B=w*Math.PI/180,[G,J,K]=kw(k,q*Math.cos(B),q*Math.sin(B));return Yh(G,J,K,z)}}if(h.hwb){if(j=h.hwb.exec(b)){let k=Bk(j[1]),q=Jb(j[2],1),w=Jb(j[3],1),z=Xh(j[4]),[B,G,J]=VK(k/360,q,w);return Yh(B,G,J,z)}}throw Error(`invalid color string ${b} provided`)}var ww=(b)=>{return(b>>24&255)/255},_K=(b)=>{return b>>16&255},lK=(b)=>{return b>>8&255},mK=(b)=>{return b&255},uK=(b,h,j,k)=>{return`rgba(${b}, ${h}, ${j}, ${k})`};function dK(b){let h=AK(b);return(h<<24|h>>>8)>>>0}var sK=(b,h,j,k)=>{let[q,w,z,B]=[_K,lK,mK,ww].map((G)=>{let J=Sh(b,h,j.map((K)=>G(K)),{easing:k?.easing,extrapolateLeft:"clamp",extrapolateRight:"clamp",posterize:k?.posterize});if(G===ww)return Number(J.toFixed(3));return Math.round(J)});return uK(q,w,z,B)},hB=(b,h,j,k)=>{if(typeof b>"u")throw TypeError("input can not be undefined");if(typeof h>"u")throw TypeError("inputRange can not be undefined");if(typeof j>"u")throw TypeError("outputRange can not be undefined");if(h.length!==j.length)throw TypeError("inputRange ("+h.length+" values provided) and outputRange ("+j.length+" values provided) must have the same length");let q=j.map((w)=>dK(w));return sK(b,h,q,k)},zw=({easing:b,forceSpringAllowTail:h})=>{switch(b.type){case"linear":return gh.linear;case"spring":return gh.spring({allowTail:h??b.allowTail??void 0,damping:b.damping,durationRestThreshold:b.durationRestThreshold??void 0,mass:b.mass,overshootClamping:b.overshootClamping,stiffness:b.stiffness});case"bezier":return iz(b.x1,b.y1,b.x2,b.y2);default:throw TypeError(`Unsupported easing: ${JSON.stringify(b)}`)}},ch=({frame:b,forceSpringAllowTail:h,status:j})=>{let{keyframes:k,easing:q,clamping:w,interpolationFunction:z}=j;if(k.length===0)return null;let B=[...k].sort((K,Q)=>K.frame-Q.frame),G=B.map((K)=>K.frame),J=B.map((K)=>K.value);if(z==="interpolateColors"){if(!J.every((K)=>typeof K==="string"))return null;if(k.length===1)return J[0];try{return hB(b,G,J,{easing:q.map((K)=>zw({easing:K,forceSpringAllowTail:h})),posterize:j.posterize})}catch{return null}}if(z!=="interpolate")return null;try{return Sh(b,G,J,{easing:q.map((K)=>zw({easing:K,forceSpringAllowTail:h})),extrapolateLeft:w.left,extrapolateRight:w.right,posterize:j.posterize})}catch{return null}},Pj=({dragOverrideValue:b,frame:h})=>{if(b===void 0)return{type:"none"};if(b.type==="static")return{type:"resolved",value:b.value};if(h===null)return{type:"none"};let j=ch({forceSpringAllowTail:null,frame:h,status:b.status});if(j===null)return{type:"none"};return{type:"resolved",value:j}},jB=({propStatus:b,dragOverrideValue:h,defaultValue:j,frame:k=null,shouldResortToDefaultValueIfUndefined:q=!1})=>{let w=Pj({dragOverrideValue:h,frame:k});if(w.type==="resolved"&&w.value!==void 0)return w.value;if(b.status==="keyframed"){if(k!==null)return ch({forceSpringAllowTail:null,frame:k,status:b});return q?j:void 0}if(b.codeValue===void 0&&q)return j;return b.codeValue},zq=kB({overrideIdToNodePathMappings:{}}),iK=kB({setOverrideIdToNodePath:()=>{throw Error("OverrideIdsToNodePathsSettersContext not initialized")}}),pK=({descriptor:b,propStatusOverrides:h,dragOverrides:j,frame:k})=>{if(!h&&!j)return{params:b.params,effectKey:b.effectKey};let q={...b.params};if(h){for(let[w,z]of Object.entries(h))if(z!==void 0)q[w]=z}if(j)for(let[w,z]of Object.entries(j)){let B=Pj({dragOverrideValue:z,frame:k});if(B.type==="resolved")q[w]=B.value}return{params:q,effectKey:b.definition.calculateKey(q)}},aK=(b,h)=>{if(!b)return null;let j={},k=!1;for(let[q,w]of Object.entries(b)){if(w.status==="static"){j[q]=w.codeValue,k=!0;continue}if(w.status==="keyframed"){let z=ch({forceSpringAllowTail:null,frame:h,status:w});if(z!==null)j[q]=z,k=!0}}return k?j:null},fh=(b)=>{let h=lz(null),j=b.map((w)=>w.definition),k=h.current;if(k!==null&&k.length===j.length&&k.every((w,z)=>w===j[z]))return k;return h.current=j,j},qB=({propStatuses:b,nodePath:h,effectIndex:j})=>{let k=b[Ob(h)];if(!k)return{type:"cannot-update-sequence",reason:"not-found"};if(!k.canUpdate)return{type:"cannot-update-sequence",reason:k.reason};let q=k.effects.find((w)=>w.effectIndex===j);if(!q)return{type:"cannot-update-effect",reason:"not-found"};if(!q.canUpdate)return{type:"cannot-update-effect",reason:q.reason};return{type:"can-update-effect",props:q.props}},wB=(b,h)=>{let j=b[Ob(h)];if(!j)return;if(!j.canUpdate)return;return j.props},Ih=({effects:b,overrideId:h})=>{let j=lz(null),{propStatuses:k}=jk(vj),{getEffectDragOverrides:q}=jk(Ej),w=qb(),{overrideIdToNodePathMappings:z}=jk(zq),B=j.current,G=h?z[h]??null:null,J=b.map((M,T)=>{if(G===null)return{descriptor:M,params:M.params,effectKey:M.effectKey};let U=qB({propStatuses:k,nodePath:G,effectIndex:T}),W=U.type==="can-update-effect"?aK(U.props,w):null,Y=q(G,T),X=Object.keys(Y).length===0?null:Y,{params:O,effectKey:L}=pK({descriptor:M,propStatusOverrides:W,dragOverrides:X,frame:w});return{descriptor:M,params:O,effectKey:L}});if(B!==null&&B.length===J.length&&B.every((M,T)=>M.definition===J[T].descriptor.definition&&M.effectKey===J[T].effectKey))return B;let Q=J.map(({descriptor:M,params:T,effectKey:U})=>({definition:M.definition,effectKey:U,params:T,memoized:!0}));return j.current=Q,Q},Bq=(b,h)=>{let j={};for(let k of Object.keys(b)){let q=b[k];if(q.type==="hidden")continue;else if(q.type==="enum"){j[k]=q;let w=h(k)??q.default,z=q.variants[w];if(z)Object.assign(j,Bq(z,h))}else j[k]=q}return j},Gq=(b)=>{let h={},j=(k,q)=>{if(k in h)throw Error(`Duplicate key "${k}" in schema: discriminated union variants must not share keys`);h[k]=q};for(let k of Object.keys(b)){let q=b[k];if(j(k,q),q.type==="enum")for(let w of Object.values(q.variants)){let z=Gq(w);for(let B of Object.keys(z))j(B,z[B])}}return h},zB=({schema:b,key:h,value:j})=>{let k=b[h];if(!k)throw Error("Key "+JSON.stringify(h)+" not found in schema");if(typeof j!=="string")throw Error("Value must be a string, but is "+JSON.stringify(j));if(k.type!=="enum")throw Error("Key "+JSON.stringify(h)+" is not an enum");if(!k.variants[j])throw Error("Value for "+JSON.stringify(h)+" must be one of "+Object.keys(k.variants).map((B)=>JSON.stringify(B)).join(", ")+", got "+JSON.stringify(j));let w=Object.keys(k.variants).filter((B)=>B!==j),z=new Set;for(let B of w){let G=k.variants[B],J=Object.keys(G);for(let K of J)z.add(K)}return[...z]},Bw={type:"linear"},nK=({insertedKeyframeIndex:b,easingLength:h,keyframeCount:j})=>{if(!(b>0&&b<j-1)||h===0)return null;return Math.min(b-1,h-1)},tK=(b)=>{return{type:"static",value:b}},oK=({status:b,frame:h,value:j})=>{let k=b.keyframes.findIndex((z)=>z.frame===h),q=k===-1?[...b.keyframes,{frame:h,value:j}].sort((z,B)=>z.frame-B.frame):b.keyframes.map((z,B)=>B===k?{frame:h,value:j}:z),w=[...b.easing];if(k===-1){let z=q.findIndex((J)=>J.frame===h),B=nK({insertedKeyframeIndex:z,easingLength:w.length,keyframeCount:q.length}),G=B===null?Bw:w[B];w.splice(z,0,G)}while(w.length<q.length-1)w.push(Bw);if(w.length>q.length-1)w.length=q.length-1;return{type:"keyframed",status:{...b,keyframes:q,easing:w}}},eK=(b)=>{if(b?.type!=="static")return;return b.value},rK=(b)=>{return b!==null&&b.status==="keyframed"},BB=(b,h)=>{if(h in b)return b[h];for(let j of Object.values(b)){if(j.type!=="enum")continue;for(let k of Object.values(j.variants)){let q=BB(k,h);if(q)return q}}return},GB=({schema:b,currentValue:h,overrideValues:j,propStatus:k,frame:q})=>{let w={},z=new Set;for(let B of Object.keys(h)){let G=k?.[B]??null,J=BB(b,B);if(J?.type==="hidden")continue;let K;if(G===null)K=h[B];else if(rK(G))if(J?.type==="array"||J?.keyframable===!1)K=h[B];else{let Q=Pj({dragOverrideValue:j[B],frame:q});if(Q.type==="resolved")K=Q.value;else if(q!==null)K=ch({forceSpringAllowTail:null,frame:q,status:G})??h[B];else K=h[B]}else if(G.status==="computed")K=h[B];else K=jB({propStatus:G,dragOverrideValue:j[B],defaultValue:J?.default,frame:q,shouldResortToDefaultValueIfUndefined:!1});if(K===void 0)z.add(B);w[B]=K}for(let B of Object.keys(j))if(b[B]?.type==="enum"){let G=zB({schema:b,key:B,value:w[B]});for(let J of G)z.add(J)}return{merged:w,propsToDelete:z}},JB=(b,h)=>{let j=h.split("."),k=b;for(let q of j){if(k===null||k===void 0||typeof k!=="object")return;k=k[q]}return k},bM=(b,h)=>{let j={};for(let k of h)j[k]=JB(b,k);return j},hM=(b,h)=>{return Object.keys(Bq(b,(j)=>h[j]))},jM=({props:b,valuesDotNotation:h,schemaKeys:j,propsToDelete:k})=>{let q={...b};for(let w of j){let z=h[w],B=w.split(".");if(B.length===1){q[w]=z;continue}let G=q;for(let J=0;J<B.length-1;J++){let K=B[J];if(typeof G[K]==="object"&&G[K]!==null)G[K]={...G[K]};else G[K]={};G=G[K]}G[B[B.length-1]]=z}return KK(q,k),q},Gw={},Zb=({Component:b,componentName:h,componentIdentity:j,schema:k,supportsEffects:q})=>{let w=eJ(k),z=Gq(w),B=Object.keys(z),G=GK((J,K)=>{let Q=d();if(!Q.isStudio||Q.isReadOnlyStudio||Q.isRendering)return rj.createElement(b,{...J,controls:null,ref:K});let{propStatuses:M}=bk(vj),{getDragOverrides:T}=bk(Ej),U=bk(zq),W=qb();if(J.controls)return rj.createElement(b,{...J,ref:K});let[Y]=JK(()=>{let{stack:g}=J;if(!g)return String(Math.random());let v=Gw[g];if(v)return v;let y=String(Math.random());return Gw[g]=y,y}),X=U.overrideIdToNodePathMappings[Y]??null,O=B.map((g)=>JB(J,g)),L=hk(()=>bM(J,B),O),$=hk(()=>{return{schema:w,currentRuntimeValueDotNotation:L,overrideId:Y,supportsEffects:q,componentIdentity:j,componentName:h}},[L,Y]),{merged:Z,propsToDelete:N}=hk(()=>{return GB({schema:w,currentValue:L,overrideValues:X===null?{}:T(X),propStatus:X===null?void 0:wB(M,X),frame:W})},[L,T,X,M,W]),R=hM(w,Z),F=jM({props:J,valuesDotNotation:Z,schemaKeys:R,propsToDelete:N});return rj.createElement(b,{...F,controls:$,ref:K})});return G.displayName=`withInteractivitySchema(${b.displayName||b.name||"Component"})`,G},Gk=[],kM=({from:b=0,trimBefore:h=0,freeze:j,durationInFrames:k=1/0,children:q,name:w,height:z,width:B,showInTimeline:G=!0,hidden:J=!1,controls:K,_remotionInternalEffects:Q,_remotionInternalLoopDisplay:M,_remotionInternalStack:T,_remotionInternalDocumentationLink:U,_remotionInternalPremountDisplay:W,_remotionInternalPostmountDisplay:Y,_remotionInternalIsMedia:X,outlineRef:O,...L},$)=>{let{layout:Z="absolute-fill"}=L,[N]=_J(()=>String(Math.random())),R=qj(a),{rootId:F}=Eb(),g=R?R.cumulatedFrom+R.relativeFrom:0,v=Zj();if(Z!=="absolute-fill"&&Z!=="none")throw TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${Z}`);if(Z==="none"&&typeof L.style<"u")throw TypeError('If layout="none", you may not pass a style. Passed: '+JSON.stringify(L.style));if(typeof k!=="number")throw TypeError(`You passed to durationInFrames an argument of type ${typeof k}, but it must be a number.`);if(k<=0)throw TypeError(`durationInFrames must be positive, but got ${k}`);if(typeof b!=="number")throw TypeError(`You passed to the "from" props of your <Sequence> an argument of type ${typeof b}, but it must be a number.`);if(!Number.isFinite(b))throw TypeError(`The "from" prop of a sequence must be finite, but got ${b}.`);if(typeof h!=="number")throw TypeError(`You passed to the "trimBefore" prop of your <Sequence> an argument of type ${typeof h}, but it must be a number.`);if(h<0)throw TypeError(`The "trimBefore" prop of <Sequence /> must be greater than or equal to 0, but got ${h}.`);if(Number.isNaN(h))throw TypeError('The "trimBefore" prop of <Sequence /> must be a real number, but it is NaN.');if(!Number.isFinite(h))throw TypeError(`The "trimBefore" prop of <Sequence /> must be finite, but it is ${h}.`);if(typeof j<"u"&&j!==null){if(typeof j!=="number")throw TypeError(`The "freeze" prop of <Sequence /> must be a number, but is of type ${typeof j}.`);if(Number.isNaN(j))throw TypeError('The "freeze" prop of <Sequence /> must be a real number, but it is NaN.');if(!Number.isFinite(j))throw TypeError(`The "freeze" prop of <Sequence /> must be finite, but it is ${j}.`)}let y=Hb(),x=wb(),D=b-h,C=(R?.absoluteFrom??0)+D,c=R?Math.min(R.durationInFrames-D,k):k,I=Math.max(0,Math.min(x.durationInFrames-b,c)),{registerSequence:H,unregisterSequence:E}=qj(Gh),P=mq(null),S=L.layout==="none"?O??null:O??P,V=ib(()=>{return R?.premounting||Boolean(L._remotionInternalIsPremounting)},[L._remotionInternalIsPremounting,R?.premounting]),_=ib(()=>{return R?.postmounting||Boolean(L._remotionInternalIsPostmounting)},[L._remotionInternalIsPostmounting,R?.postmounting]),l=g+D,u=R?R.cumulatedFrom+R.relativeFrom:0,f=R?u-R.cumulatedNegativeFrom:0,s=Math.max(0,f,l),i=l-s,zb=ib(()=>{return{absoluteFrom:C,cumulatedFrom:g,relativeFrom:D,cumulatedNegativeFrom:i,durationInFrames:I,parentFrom:R?.relativeFrom??0,id:N,height:z??R?.height??null,width:B??R?.width??null,premounting:V,postmounting:_,premountDisplay:W??null,postmountDisplay:Y??null}},[g,C,D,I,R,N,z,B,V,_,W,Y,i]),Bb=ib(()=>{return w??""},[w]),Gb=U??"https://www.remotion.dev/docs/sequence",t=d(),jb=qj(Hj),mb=L?.stack??null,$b=mq(null);$b.current=T??mb;let Lb=typeof j==="number"?j:null,m=h===0?null:h,Db=R?.cumulatedNegativeFrom??0,ub=X&&X.type!=="image"?X.data.startMediaFrom+Db-i:null,yq=X&&X.type!=="image"?X.data.startMediaFrom+Db:null,Dq=X&&X.type!=="image"&&yq!==null?Lb===null?null:yq+(M?Lb%M.durationInFrames:Lb)*X.data.playbackRate:null;AJ(()=>{if(!t.isStudio)return;if(X){if(X.type==="image")H({type:"image",controls:K??null,effects:Q??Gk,displayName:Bb,documentationLink:Gb,duration:I,from:b,trimBefore:m,id:N,loopDisplay:M,nonce:v.get(),parent:R?.id??null,postmountDisplay:Y??null,premountDisplay:W??null,rootId:F,showInTimeline:G,src:X.src,getStack:()=>$b.current,refForOutline:S??null,isInsideSeries:jb,frozenFrame:Lb});else H({type:X.type,controls:K??null,effects:Q??Gk,displayName:Bb,documentationLink:Gb,doesVolumeChange:X.data.doesVolumeChange,duration:I,from:b,trimBefore:m,id:N,loopDisplay:M,nonce:v.get(),parent:R?.id??null,playbackRate:X.data.playbackRate,postmountDisplay:Y??null,premountDisplay:W??null,rootId:F,showInTimeline:G,src:X.data.src,getStack:()=>$b.current,startMediaFrom:ub??X.data.startMediaFrom,volume:X.data.volumes,refForOutline:S??null,isInsideSeries:jb,frozenFrame:Lb,frozenMediaFrame:Dq});return()=>{E(N)}}return H({from:b,trimBefore:m,duration:I,id:N,displayName:Bb,documentationLink:Gb,parent:R?.id??null,type:"sequence",rootId:F,showInTimeline:G,nonce:v.get(),loopDisplay:M,getStack:()=>$b.current,premountDisplay:W??null,postmountDisplay:Y??null,controls:K??null,effects:Q??Gk,refForOutline:S??null,isInsideSeries:jb,frozenFrame:Lb}),()=>{E(N)}},[k,N,w,H,Bb,E,R?.id,I,F,b,h,m,G,v,M,W,Y,t.isStudio,K,Q,X,Gb,S,jb,Lb,ub,Dq]);let UG=Math.ceil(g+b+k-1),uj=y<g+b?null:y>UG?null:q,dj=uj===null||typeof j>"u"||j===null?uj:Ib(ok,{frame:j,children:uj}),Fq=L.layout==="none"?void 0:L.style,WG=VJ((sj)=>{if(P.current=sj,typeof $==="function")$(sj);else if($)$.current=sj},[$]),XG=ib(()=>{return{flexDirection:void 0,...B?{width:B}:{},...z?{height:z}:{},...Fq??{}}},[z,Fq,B]);if($!==null&&Z==="none")throw TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');if(J)return null;return Ib(a.Provider,{value:zb,children:dj===null?null:L.layout==="none"?dj:Ib(_k,{ref:WG,style:XG,className:L.className,children:dj})})},qM=ik(kM),wM=(b,h)=>{let j=qj(Vz),k=qb()-j.premountFramesRemaining;if(b.layout==="none")throw Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');let{style:q,from:w=0,durationInFrames:z=1/0,premountFor:B=0,postmountFor:G=0,styleWhilePremounted:J,styleWhilePostmounted:K,...Q}=b,M=Math.ceil(w+z-1),T=k<w&&k>=w-B,U=k>M&&k<=M+G,W=T?w:U?w+z-1:0,Y=T||U,X=ib(()=>{return{...q,opacity:T||U?0:1,pointerEvents:T||U?"none":q?.pointerEvents??void 0,...T?J:{},...U?K:{}}},[q,T,U,J,K]);return Ib(ok,{frame:W,active:Y,children:Ib(Cj,{ref:h,from:w,durationInFrames:z,style:X,_remotionInternalPremountDisplay:B,_remotionInternalPostmountDisplay:G,_remotionInternalIsPremounting:T,_remotionInternalIsPostmounting:U,...Q})})},zM=ik(wM),BM=(b,h)=>{let j=d(),{fps:k}=wb();if(b.layout!=="none"&&!j.isRendering){let q=kq?b.premountFor??k:b.premountFor;if(q||b.postmountFor)return Ib(zM,{ref:h,...b,premountFor:q})}return Ib(qM,{...b,ref:h})},Cj=ik(BM),KB=Cj,hb=Zb({Component:Cj,componentName:"<Sequence>",componentIdentity:"dev.remotion.remotion.Sequence",schema:hh,supportsEffects:!1}),pX=Zb({Component:Cj,componentName:"<Sequence>",componentIdentity:null,schema:bK,supportsEffects:!1}),QB=(b,h,j)=>{switch(b){case"fill":return[0,0,h.width,h.height,0,0,j.width,j.height];case"contain":{let k=Math.min(j.width/h.width,j.height/h.height),q=(j.width-h.width*k)/2,w=(j.height-h.height*k)/2;return[0,0,h.width,h.height,q,w,h.width*k,h.height*k]}case"cover":{let k=Math.max(j.width/h.width,j.height/h.height),q=(j.width-h.width*k)/2,w=(j.height-h.height*k)/2;return[0,0,h.width,h.height,q,w,h.width*k,h.height*k]}default:throw Error("Unknown fit: "+b)}},XM="https://remotion.dev/docs/troubleshooting/webgl2-context",TB=(b,h)=>`Failed to acquire ${b} context for ${h}. Pass --gl=angle when using the CLI, set chromiumOptions: { gl: "angle" } when using SSR APIs, or set "OpenGL render backend" to "angle" in the Advanced section when rendering in the Studio. See ${XM}`,YM=(b)=>Error(TB("WebGL",b)),UB=(b)=>Error(TB("WebGL2",b));class WB{width;height;pairs=new Map;lostContexts=new Set;constructor(b,h){this.width=b,this.height=h}getPair(b){let h=this.pairs.get(b);if(h)return h;let j=[this.allocateCanvas(b),this.allocateCanvas(b)];return this.pairs.set(b,j),j}assertContextNotLost(b){if(this.lostContexts.has(b))throw Error("WebGL context was lost during canvas effect rendering. This typically happens in headless or memory-constrained environments (e.g. Remotion Lambda). Try reducing concurrency or increasing the Lambda function memory.")}allocateCanvas(b){let h=document.createElement("canvas");switch(h.width=this.width,h.height=this.height,b){case"2d":{if(!h.getContext("2d",{colorSpace:"srgb"}))throw Error("Failed to acquire 2D context for canvas effect");return h}case"webgl2":{let j=h.getContext("webgl2",{premultipliedAlpha:!0,alpha:!0,preserveDrawingBuffer:!0});if(!j)throw UB("canvas effect");return h.addEventListener("webglcontextlost",(k)=>{k.preventDefault(),this.lostContexts.add(h)}),h.addEventListener("webglcontextrestored",()=>{this.lostContexts.delete(h)}),j.pixelStorei(j.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),h}case"webgpu":{if(typeof navigator>"u"||!("gpu"in navigator))throw Error("WebGPU is not available in this environment for canvas effect");return h}default:throw Error(`Unknown effect backend: ${b}`)}}}var ZM=(b)=>{let h=[],j=[],k=null;for(let q of b){let{backend:w}=q.definition;if(k===null||w===k)j.push(q),k=w;else h.push({backend:k,effects:j}),j=[q],k=w}if(k!==null&&j.length>0)h.push({backend:k,effects:j});return h},eh=null,$M=()=>{if(eh)return eh;return eh=(async()=>{if(typeof navigator>"u"||!("gpu"in navigator))throw Error("WebGPU is not available in this environment");let{gpu:b}=navigator,h=await b.requestAdapter();if(!h)throw Error("No WebGPU adapter available");return h.requestDevice()})(),eh},XB=(b,h)=>({pool:new WB(b,h),setupCache:new WeakMap,cleanupRegistry:[],currentRunId:0}),Dk=(b)=>{b.currentRunId++;for(let h of b.cleanupRegistry)h.definition.cleanup(h.state)},LM=(b,h,j)=>{let k=h,q=b.setupCache.get(k);if(!q)q=new WeakMap,b.setupCache.set(k,q);if(q.has(j))return q.get(j);let w=h.setup(j);return q.set(j,w),b.cleanupRegistry.push({definition:k,state:w}),w},Vh=async({state:b,source:h,effects:j,output:k,width:q,height:w})=>{let z=++b.currentRunId,B=()=>b.currentRunId!==z,G=j.filter((Y)=>!Y.params.disabled),J=ZM(G),K=h,Q=null;if(J.length===0){if(h===k)return!0;let Y=k.getContext("2d");if(!Y)throw Error("Failed to acquire 2D context for output canvas");return Y.clearRect(0,0,q,w),Y.drawImage(K,0,0,q,w),!0}let M=!1;for(let Y of J)if(Y.backend==="webgpu"){M=!0;break}let T=M?await $M():null;if(B())return!1;let U=!0;for(let Y=0;Y<J.length;Y++){let X=J[Y],[O,L]=b.pool.getPair(X.backend),$=O;for(let N of X.effects){let R=N.definition,F=LM(b,R,$);if(R.apply({source:K,target:$,state:F,params:N.params,width:q,height:w,gpuDevice:T,flipSourceY:X.backend==="webgl2"?U:!1}),X.backend==="webgl2")U=!0,b.pool.assertContextNotLost($);K=$,$=$===O?L:O}Q=K??Q;let Z=J[Y+1];if(Z&&Z.backend!==X.backend&&Q)if(X.backend==="2d"&&Z.backend==="webgl2")K=Q,U=!0;else{let N=await createImageBitmap(Q);if(B())return N.close(),!1;if(K=N,Z.backend==="webgl2")U=!1}}if(!Q)return!0;let W=k.getContext("2d");if(!W)throw Error("Failed to acquire 2D context for output canvas");return W.clearRect(0,0,q,w),W.drawImage(Q,0,0,q,w),!0},Ah=()=>{let b=Jw(null),h=Jw(null);return NM(()=>{return()=>{if(b.current)Dk(b.current)}},[]),OM(()=>({get:(j,k)=>{if(!h.current||h.current.width!==j||h.current.height!==k){if(b.current)Dk(b.current);b.current=XB(j,k),h.current={width:j,height:k}}return b.current}}),[])},gM=({width:b,height:h,fit:j,className:k,style:q,effects:w},z)=>{let B=WM(null),G=Ah(),J=UM(()=>{if(typeof document>"u")return null;return document.createElement("canvas")},[]),K=QM((Q)=>{let M=B.current,T=b??Q.displayWidth,U=h??Q.displayHeight;if(!M)throw Error("Canvas ref is not set");if(!J)throw Error("Source canvas is not available");J.width=T,J.height=U;let W=J.getContext("2d");if(!W)throw Error("Could not get 2d context for source canvas");return W.drawImage(Q,...QB(j,{height:Q.displayHeight,width:Q.displayWidth},{width:T,height:U})),M.width=T,M.height=U,Vh({state:G.get(T,U),source:J,effects:w,output:M,width:T,height:U})},[G,w,j,h,J,b]);return TM(z,()=>{return{draw:K,getCanvas:()=>{if(!B.current)throw Error("Canvas ref is not set");return B.current},clear:()=>{let Q=B.current?.getContext("2d");if(!Q)throw Error("Could not get 2d context");Q.clearRect(0,0,B.current.width,B.current.height)}}},[K]),RM("canvas",{ref:B,className:k,style:q})},yM=MM.forwardRef(gM),DM=5,Kw=({loopBehavior:b,durationFound:h,timeInSec:j})=>{return b==="loop"?h?j%h:j:Math.min(j,h||1/0)},FM=async({resolvedSrc:b,signal:h,requestInit:j,currentTime:k,initialLoopBehavior:q})=>{if(typeof ImageDecoder>"u")throw Error("Your browser does not support the WebCodecs ImageDecoder API.");let w=await fetch(b,{...j,signal:h}),{body:z}=w;if(!z)throw Error("Got no body");let B=new ImageDecoder({data:z,type:w.headers.get("Content-Type")||"image/gif"});await B.completed;let{selectedTrack:G}=B.tracks;if(!G)throw Error("No selected track");let J=[],K=null,Q=async(W)=>{let Y=J.find((O)=>O.frameIndex===W);if(Y&&Y.frame)return Y;let X=await B.decode({frameIndex:W,completeFramesOnly:!0});if(Y)Y.frame=X.image;else J.push({frame:X.image,frameIndex:W,timeInSeconds:X.image.timestamp/1e6});return{frame:X.image,frameIndex:W,timeInSeconds:X.image.timestamp/1e6}},M=(W)=>{let X=J.filter((O)=>O.frame).sort((O,L)=>{let $=Math.abs(O.timeInSeconds-W),Z=Math.abs(L.timeInSeconds-W);return $-Z});for(let O=0;O<X.length;O++){if(O<DM)continue;let L=X[O];L.frame=null}},T=async({timeInSec:W,loopBehavior:Y})=>{let X=Kw({durationFound:K,loopBehavior:Y,timeInSec:W}),L=J.filter((Z)=>Z.timeInSeconds<=X).map((Z)=>Z.frameIndex).reduce((Z,N)=>Math.max(Z,N),0),$=L;while(!0){let Z=await Q($);if($++,!Z.frame)throw Error("No frame found");if(!Z.frame.duration)break;if($===G.frameCount&&K===null)K=(Z.frame.timestamp+Z.frame.duration)/1e6;if(Z.timeInSeconds>X||$===G.frameCount)break}if(G.frameCount-L<3&&Y==="loop")await Q(0);M(X)};return await T({timeInSec:k,loopBehavior:q}),await T({timeInSec:k,loopBehavior:q}),{getFrame:async(W,Y)=>{if(K!==null&&W>K&&Y==="clear-after-finish")return null;let X=Kw({loopBehavior:Y,durationFound:K,timeInSec:W});await T({timeInSec:X,loopBehavior:Y});let L=J.filter(($)=>$.frame).reduce(($,Z)=>{let N=Math.abs($.timeInSeconds-X),R=Math.abs(Z.timeInSeconds-X);return N<R?$:Z});if(!L.frame)throw Error("No frame found");return L},frameCount:G.frameCount}},vM=(b)=>{if(!b)return null;let h={...b};delete h.signal;let{headers:j,...k}=h;return JSON.stringify({...k,headers:j?Array.from(new Headers(j).entries()):null})},xM=(b)=>{if(typeof window>"u")return b;return new URL(b,window.origin).href},EM={...yb,playbackRate:{type:"number",min:0,max:10,step:0.1,default:1,description:"Playback rate",hiddenFromList:!1,keyframable:!1},...Yb},YB=GM(({src:b,width:h,height:j,onError:k,loopBehavior:q="loop",playbackRate:w=1,fit:z="fill",requestInit:B,effects:G,controls:J,...K},Q)=>{let M=xM(b),[T,U]=Jk(null),{delayRender:W,continueRender:Y}=Kb(),[X]=Jk(()=>W(`Rendering <AnimatedImage/> with src="${M}"`)),O=qb(),{fps:L}=wb(),$=O/w/L,Z=wj($);Z.current=$;let N=vM(B),R=wj(B);R.current=B;let F=wj(null),g=Ih({effects:G,overrideId:J?.overrideId??null});MB(Q,()=>{let y=F.current?.getCanvas();if(!y)throw Error("Canvas ref is not set");return y},[]);let[v]=Jk(()=>q);return JM(()=>{let y=new AbortController;return FM({resolvedSrc:M,signal:y.signal,requestInit:R.current,currentTime:Z.current,initialLoopBehavior:v}).then((x)=>{U(x),Y(X)}).catch((x)=>{if(x.name==="AbortError"){Y(X);return}if(k)k?.(x),Y(X);else bh(x)}),()=>{y.abort()}},[M,X,k,N,v,Y]),KM(()=>{if(!T)return;let y=W(`Rendering frame at ${$} of <AnimatedImage src="${b}"/>`),x=!1;return T.getFrame($,q).then(async(D)=>{if(x)return;if(D===null){F.current?.clear(),Y(y);return}if(await F.current?.draw(D.frame)&&!x)Y(y)}).catch((D)=>{if(x)return;if(k)k(D),Y(y);else bh(D)}),()=>{x=!0,Y(y)}},[$,T,q,k,b,Y,W,g,z,h,j]),Fk(yM,{ref:F,width:h,height:j,fit:z,effects:g,...K})});YB.displayName="AnimatedImageContent";var HM=({src:b,width:h,height:j,onError:k,fit:q,playbackRate:w,loopBehavior:z,id:B,className:G,style:J,durationInFrames:K,requestInit:Q,effects:M=[],controls:T,ref:U,...W})=>{let{durationInFrames:Y}=wb(),X=K??Y,O=wj(null),L=fh(M);return MB(U,()=>{return O.current},[]),Fk(hb,{layout:"none",durationInFrames:X,name:"<AnimatedImage>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/animatedimage",controls:T,_remotionInternalEffects:L,...W,outlineRef:O,children:Fk(YB,{...{src:b,width:h,height:j,onError:k,fit:q,playbackRate:w,loopBehavior:z,id:B,className:G,style:J,requestInit:Q},ref:O,effects:M,controls:T})})},Jq=Zb({Component:HM,componentName:"<AnimatedImage>",componentIdentity:"dev.remotion.remotion.AnimatedImage",schema:EM,supportsEffects:!0});Jq.displayName="AnimatedImage";bb(Jq);var PM={type:"boolean",default:!1,description:"Disabled"},ZB=(b)=>{let{calculateKey:h,validateParams:j}=b,k={...b,documentationLink:b.documentationLink??null,calculateKey:(w)=>{let z=w.disabled??!1;return`${h(w)}-disabled-${z}`},schema:{disabled:PM,...b.schema}};return(w={})=>{return j(w),{definition:k,params:w,effectKey:k.calculateKey(w),memoized:!1}}},mM=(b)=>{if(typeof b!=="string")throw TypeError(`The "filename" must be a string, but you passed a value of type ${typeof b}`);if(b.trim()==="")throw Error("The `filename` must not be empty");if(!b.match(/^([0-9a-zA-Z-!_.*'()/:&$@=;+,?]+)/g))throw Error('The `filename` must match "/^([0-9a-zA-Z-!_.*\'()/:&$@=;+,?]+)/g". Use forward slashes only, even on Windows.')},uM=(b)=>{if(typeof b!=="string"&&!(b instanceof Uint8Array))throw TypeError(`The "content" must be a string or Uint8Array, but you passed a value of type ${typeof b}`);if(typeof b==="string"&&b.trim()==="")throw Error("The `content` must not be empty")},$B=(b)=>{if(b.type!=="artifact")return;if(mM(b.filename),b.contentType==="thumbnail")return;uM(b.content)},Pb=fM({registerRenderAsset:()=>{return},unregisterRenderAsset:()=>{return},renderAssets:[]}),sM=({children:b,collectAssets:h})=>{let[j,k]=lM([]),q=_M([]),w=Mw((G)=>{$B(G),q.current=[...q.current,G],k(q.current)},[]);if(h)IM(h,()=>{return{collectAssets:()=>{let G=q.current;return q.current=[],k([]),G}}},[]);let z=Mw((G)=>{q.current=q.current.filter((J)=>J.id!==G),k(q.current)},[]);VM(()=>{if(typeof window<"u")window.remotion_collectAssets=()=>{let G=q.current;return q.current=[],k([]),G}},[]);let B=AM(()=>{return{registerRenderAsset:w,unregisterRenderAsset:z,renderAssets:j}},[j,w,z]);return dM(Pb.Provider,{value:B,children:b})},LB=Symbol("Thumbnail"),NB=({filename:b,content:h,downloadBehavior:j})=>{let{registerRenderAsset:k,unregisterRenderAsset:q}=CM(Pb),w=d(),z=qb(),[B]=cM(()=>{return String(Math.random())});return SM(()=>{if(!w.isRendering)return;if(h instanceof Uint8Array)k({type:"artifact",id:B,content:btoa(new TextDecoder("utf8").decode(h)),filename:b,frame:z,contentType:"binary",downloadBehavior:j??null});else if(h===LB)k({type:"artifact",id:B,filename:b,frame:z,contentType:"thumbnail",downloadBehavior:j??null});else k({type:"artifact",id:B,content:h,filename:b,frame:z,contentType:"text",downloadBehavior:j??null});return()=>{return q(B)}},[h,w.isRendering,b,z,B,k,q,j]),null};NB.Thumbnail=LB;var Wb=(b)=>{if(typeof window>"u")return b;if(b.startsWith("http://")||b.startsWith("https://")||b.startsWith("file://")||b.startsWith("blob:")||b.startsWith("data:"))return b;return new URL(b,window.origin).href},Sj=({trimAfter:b,mediaDurationInFrames:h,playbackRate:j,trimBefore:k})=>{let q=h;if(typeof b<"u")q=b;if(typeof k<"u")q-=k;let w=q/j;return Number(w.toFixed(10))},OB=aM(null),nM=()=>{return pM.useContext(OB)},_h=({durationInFrames:b,times:h=1/0,children:j,name:k,showInTimeline:q,...w})=>{let z=qb(),{durationInFrames:B}=wb();if(Lj(b,{component:"of the <Loop /> component",allowFloats:!0}),typeof h!=="number")throw TypeError(`You passed to "times" an argument of type ${typeof h}, but it must be a number.`);if(h!==1/0&&h%1!==0)throw TypeError(`The "times" prop of a loop must be an integer, but got ${h}.`);if(h<0)throw TypeError(`The "times" prop of a loop must be at least 0, but got ${h}`);let G=Math.ceil(B/b),J=Math.min(G,h),K=w.layout==="none"?void 0:w.style,Q=b*(J-1),T=Math.floor(z/b)*b,U=Math.min(T,Q),W=Uw(()=>{return{numberOfTimes:Math.min(B/b,h),startOffset:-U,durationInFrames:b}},[B,b,U,h]),Y=Uw(()=>{return{iteration:Math.floor(z/b),durationInFrames:b}},[z,b]);return Ww(OB.Provider,{value:Y,children:Ww(hb,{durationInFrames:b,from:U,name:k??"<Loop>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/loop",_remotionInternalLoopDisplay:W,layout:w.layout,style:K,showInTimeline:q,children:j})})};_h.useLoop=nM;var n=({logLevel:b,tag:h,message:j,mountTime:k})=>{let q=[k?Date.now()-k+"ms ":null,h].filter(Boolean).join(" ");p.trace({logLevel:b,tag:null},`[${q}]`,j)},cj=oM({}),Uj={},zj=[],Xw=(b)=>{Uj=b(Uj),zj.forEach((h)=>h())},RB=({children:b})=>{let[h,j]=rM(()=>Uj);return eM(()=>{let k=()=>{j(Uj)};return zj.push(k),()=>{zj=zj.filter((q)=>q!==k)}},[]),bQ(cj.Provider,{value:h,children:b})},gB=(b)=>{let h=b.indexOf("#");if(h===-1)return null;return h},yB=(b)=>{let h=gB(b);if(h===null)return b;return b.slice(0,h)},_b=(b)=>{let h=tM(cj),j=gB(b),k=yB(b);if(!h[k])return b;if(j!==null)return h[k]+b.slice(j);return h[k]},hQ=function(b){let h=new FileReader;return new Promise((j,k)=>{h.onload=function(){let q=h.result;j(q)},h.onerror=(q)=>{return k(q)},h.readAsDataURL(b)})},jQ=async({reader:b,contentType:h,contentLength:j,onProgress:k})=>{let q=0,w=[];while(!0){let{done:G,value:J}=await b.read();if(G)break;if(w.push(J),q+=J.length,k)k({loadedBytes:q,totalBytes:j})}let z=new Uint8Array(q),B=0;for(let G of w)z.set(G,B),B+=G.length;return new Blob([z],{type:h??void 0})},kQ=(b,h)=>{let j=h?.method??"blob-url",k=h?.logLevel??"info",q=yB(b);if(o().isRendering)return{free:()=>{return},waitUntilDone:()=>Promise.resolve(q)};p.verbose({logLevel:k,tag:"prefetch"},`Starting prefetch ${q}`);let w=!1,z=null,B=()=>{return},G=()=>{return},J=new Promise((M,T)=>{B=M,G=T});J.catch(()=>{return});let K=new AbortController,Q=null;return fetch(q,{signal:K.signal,credentials:h?.credentials??void 0}).then((M)=>{if(w)return null;if(!M.ok)throw Error(`HTTP error, status = ${M.status}`);let T=M.headers.get("Content-Type"),U=h?.contentType??T;if(!(U&&(U.startsWith("video/")||U.startsWith("audio/")||U.startsWith("image/"))))console.warn(`Called prefetch() on ${q} which returned a "Content-Type" of ${T}. Prefetched content should have a proper content type (video/... or audio/...) or a contentType passed the options of prefetch(). Otherwise, prefetching will not work properly in all browsers.`);if(!M.body)throw Error(`HTTP response of ${q} has no body`);let Y=M.body.getReader();return Q=Y,jQ({reader:Y,contentType:h?.contentType??T??null,contentLength:M.headers.get("Content-Length")?parseInt(M.headers.get("Content-Length"),10):null,onProgress:h?.onProgress})}).then((M)=>{if(!M||w)return;let T=h?.contentType?new Blob([M],{type:h.contentType}):M;if(j==="base64")return hQ(T);return URL.createObjectURL(T)}).then((M)=>{if(w)return;n({logLevel:k,tag:"prefetch",message:`Finished prefetch ${q} with method ${j}`,mountTime:null}),z=M,Xw((T)=>({...T,[q]:z})),B(z)}).catch((M)=>{if(M?.message.includes("free() called"))return;G(M)}),{free:()=>{if(n({logLevel:k,tag:"prefetch",message:`Freeing ${q}`,mountTime:null}),z){if(j==="blob-url")URL.revokeObjectURL(z);Xw((M)=>{let T={...M};return delete T[q],T})}else{if(w)return;w=!0;let M=Error("free() called");G(M);try{K.abort(M)}catch{}Q?.cancel(M).catch(()=>{return})}},waitUntilDone:()=>{return J}}},fj=(b,h)=>{if(typeof b.volume!=="number"&&typeof b.volume!=="function"&&typeof b.volume<"u")throw TypeError(`You have passed a volume of type ${typeof b.volume} to your <${h} /> component. Volume must be a number or a function with the signature '(frame: number) => number' undefined.`);if(typeof b.volume==="number"&&b.volume<0)throw TypeError(`You have passed a volume below 0 to your <${h} /> component. Volume must be between 0 and 1`);if(typeof b.playbackRate!=="number"&&typeof b.playbackRate<"u")throw TypeError(`You have passed a playbackRate of type ${typeof b.playbackRate} to your <${h} /> component. Playback rate must a real number or undefined.`);if(typeof b.playbackRate==="number"&&(isNaN(b.playbackRate)||!Number.isFinite(b.playbackRate)||b.playbackRate<=0))throw TypeError(`You have passed a playbackRate of ${b.playbackRate} to your <${h} /> component. Playback rate must be a real number above 0.`);if(typeof b.preservePitch!=="boolean"&&typeof b.preservePitch<"u")throw TypeError(`'preservePitch' must be a boolean or undefined but got '${typeof b.preservePitch}' instead`)},qQ=(b,h)=>{if(typeof b<"u"){if(typeof b!=="number")throw TypeError(`type of startFrom prop must be a number, instead got type ${typeof b}.`);if(isNaN(b)||b===1/0)throw TypeError("startFrom prop can not be NaN or Infinity.");if(b<0)throw TypeError(`startFrom must be greater than equal to 0 instead got ${b}.`)}if(typeof h<"u"){if(typeof h!=="number")throw TypeError(`type of endAt prop must be a number, instead got type ${typeof h}.`);if(isNaN(h))throw TypeError("endAt prop can not be NaN.");if(h<=0)throw TypeError(`endAt must be a positive number, instead got ${h}.`)}if(h<b)throw TypeError("endAt prop must be greater than startFrom prop.")},wQ=(b,h)=>{if(typeof b<"u"){if(typeof b!=="number")throw TypeError(`type of trimBefore prop must be a number, instead got type ${typeof b}.`);if(isNaN(b)||b===1/0)throw TypeError("trimBefore prop can not be NaN or Infinity.");if(b<0)throw TypeError(`trimBefore must be greater than equal to 0 instead got ${b}.`)}if(typeof h<"u"){if(typeof h!=="number")throw TypeError(`type of trimAfter prop must be a number, instead got type ${typeof h}.`);if(isNaN(h))throw TypeError("trimAfter prop can not be NaN.");if(h<=0)throw TypeError(`trimAfter must be a positive number, instead got ${h}.`)}if(h<=b)throw TypeError("trimAfter prop must be greater than trimBefore prop.")},Ij=({startFrom:b,endAt:h,trimBefore:j,trimAfter:k})=>{if(typeof b<"u"&&typeof j<"u")throw TypeError("Cannot use both startFrom and trimBefore props. Use trimBefore instead as startFrom is deprecated.");if(typeof h<"u"&&typeof k<"u")throw TypeError("Cannot use both endAt and trimAfter props. Use trimAfter instead as endAt is deprecated.");let q=typeof j<"u"||typeof k<"u",w=typeof b<"u"||typeof h<"u";if(q)wQ(j,k);else if(w)qQ(b,h)},Vj=({startFrom:b,endAt:h,trimBefore:j,trimAfter:k})=>{return{trimBeforeValue:j??b??void 0,trimAfterValue:k??h??void 0}},KQ=(b,h)=>{switch(h.type){case"got-duration":{let j=Wb(h.src);if(b[j]===h.durationInSeconds)return b;return{...b,[j]:h.durationInSeconds}}default:return b}},Kq=zQ({durations:{},setDurations:()=>{throw Error("context missing")}}),DB=({children:b})=>{let[h,j]=GQ(KQ,{}),k=BQ(()=>{return{durations:h,setDurations:j}},[h]);return JQ(Kq.Provider,{value:k,children:b})},Mq=({crossOrigin:b,requestsVideoFrame:h,isClientSideRendering:j})=>{if(b!==void 0&&b!==null)return b;if(j)return"anonymous";if(h)return"anonymous";return},Wj=({mediaRef:b,mediaType:h,onAutoPlayError:j,logLevel:k,mountTime:q,reason:w,isPlayer:z})=>{let{current:B}=b;if(!B)return;n({logLevel:k,tag:"play",message:`Attempting to play ${B.src}. Reason: ${w}`,mountTime:q});let G=B.play();if(!G.catch)return;G.catch((J)=>{if(!B)return;if(J.message.includes("request was interrupted by a call to pause"))return;if(J.message.includes("The operation was aborted."))return;if(J.message.includes("The fetching process for the media resource was aborted by the user agent"))return;if(J.message.includes("request was interrupted by a new load request"))return;if(J.message.includes("because the media was removed from the document"))return;if(J.message.includes("user didn't interact with the document")&&B.muted)return;if(console.log(`Could not play ${h} due to following error: `,J),!B.muted){if(j){j();return}if(h==="video"&&z)p.info({logLevel:k,tag:"<"+h+">"},"The video will be muted and we'll retry playing it."),p.info({logLevel:k,tag:"<"+h+">"},"Use onAutoPlayError() to handle this error yourself."),B.muted=!0,B.play()}})},Qq=({audioContext:b,ref:h})=>{let j=null,k=!1;return{attemptToConnect:()=>{if(k)throw Error("SharedElementSourceNode has been disposed");if(!j&&h.current)j=b.createMediaElementSource(h.current)},get:()=>{if(!j)throw Error("Audio element not connected");return j},cleanup:()=>{if(j)j.disconnect(),j=null;k=!0}}},Nw=!1,RQ=(b)=>{if(Nw)return;if(Nw=!0,typeof window<"u")p.warn({logLevel:b,tag:null},"AudioContext is not supported in this browser")},gQ=({logLevel:b,latencyHint:h,audioEnabled:j,sampleRate:k})=>{let q=d(),w=OQ(k);if(k!==w.current)throw Error(`Changing the AudioContext sample rate dynamically is not supported. The sample rate was initialized with ${w.current} Hz, but ${k} Hz was passed later.`);return NQ(()=>{if(q.isRendering)return null;if(!j)return null;if(typeof AudioContext>"u")return RQ(b),null;let B=new AudioContext({latencyHint:h,sampleRate:k}),G=B.createGain();G.connect(B.destination),p.trace({logLevel:b,tag:"audio"},"Creating new audio context"),B.suspend();let J=null;return{audioContext:B,gainNode:G,getState:()=>{let T=B.state;if(J==="running"&&T!=="running")return"suspended-to-running";if(J==="suspended"&&T!=="suspended")return"running-to-suspended";return T},resume:()=>{J="running";let T=B.resume();return T.finally(()=>{if(J==="running")J=null}),T},suspend:()=>{J="suspended";let T=B.suspend();return T.finally(()=>{if(J==="suspended")J=null}),T}}},[b,h,q.isRendering,j,k])},yQ=(b,h)=>{return new Promise((j)=>{let k=b.currentTime,w=b.getOutputTimestamp().performanceTime,z=performance.now(),B=()=>{let{currentTime:G}=b,J=b.getOutputTimestamp(),K=performance.now()-z;if(w!==void 0&&J.performanceTime!==void 0&&J.performanceTime>w&&J.contextTime!==void 0&&J.contextTime>k){p.verbose({logLevel:h,tag:"audio"},`waitUntilActuallyResumed: getOutputTimestamp.performanceTime advanced from ${w.toFixed(6)} to ${J.performanceTime.toFixed(6)} after ${K.toFixed(1)}ms. currentTime=${G.toFixed(6)} (advanced by ${(G-k).toFixed(6)}), getOutputTimestamp.performanceTime=${J.performanceTime?.toFixed(1)??"undefined"}`),j();return}requestAnimationFrame(B)};requestAnimationFrame(B)})},Ow="data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",FQ=(b,h)=>{let j=Object.keys(b).sort(),k=Object.keys(h).sort();if(j.length!==k.length)return!1;for(let q=0;q<j.length;q++){if(j[q]!==k[q])return!1;if(b[j[q]]!==h[k[q]])return!1}return!0},vQ=(b,h,j)=>{if(b==="src"&&!j.startsWith("data:")&&!h.startsWith("data:"))return new URL(j,window.origin).toString()!==new URL(h,window.origin).toString();if(j===h)return!1;return!0},Jh=FB(null),Aj=FB(null),xQ=(b)=>{if(b==="suspended"||b==="running-to-suspended"||b==="interrupted")return!0;if(b==="running"||b==="suspended-to-running")return!1;throw Error(`Unexpected audio context state: ${b}`)},EB=({children:b,audioLatencyHint:h,audioEnabled:j,previewSampleRate:k})=>{let q=Xb(),w=k??48000;LQ(()=>{if(typeof window>"u")return;window.remotion_sampleRate=w},[w]);let z=gQ({logLevel:q,latencyHint:h,audioEnabled:j,sampleRate:w}),B=fb(!1),G=fb(null),J=nb(()=>({value:0}),[]),K=fb([]),Q=nb(()=>{return{dispatch:($)=>{K.current.forEach((Z)=>Z($))},subscribe:($)=>{return K.current.push($),{remove:()=>{K.current=K.current.filter((Z)=>Z!==$)}}}}},[]),M=fb({scheduledEndTime:null,mediaEndTime:null}),T=fb(new Map),U=Rb(($)=>{T.current.delete($)},[]),W=nb(()=>{return({node:$,mediaTimestamp:Z,scheduledTime:N,duration:R,offset:F,originalUnloopedMediaTimestamp:g})=>{if(!z)throw Error("Audio context not found");let v=z.getState();if(v==="closed")return{type:"not-started",reason:"audio context is closed"};let y=xQ(v);if(R>0)if(y)T.current.set($,{scheduledTime:N,offset:F,duration:R});else $.start(N,F,R);let x=N+R/$.playbackRate.value,D=Z+F,C=D+R,c=z.audioContext.baseLatency+z.audioContext.outputLatency,I=N-z.audioContext.currentTime,H=M.current,E=H.scheduledEndTime!==null&&Math.abs(N-H.scheduledEndTime)>0.001,P=H.mediaEndTime!==null&&Math.abs(D-H.mediaEndTime)>0.001;return p.verbose({logLevel:q,tag:"audio-scheduling"},"scheduled %c%s%c %s %c%s%c %s %c%s%c %s %s %s %s %s",E?"color: red; font-weight: bold":"",N.toFixed(4),"",x.toFixed(4),P?"color: red; font-weight: bold":"",D.toFixed(4),"",C.toFixed(4),R<0?"color: red; font-weight: bold":I<0?"color: red; font-weight: bold":"color: blue; font-weight: bold",R<0?"missed "+Math.abs(F).toFixed(2)+"s":Math.abs(I).toFixed(2)+(I<0?" delay":" ahead"),"","current="+z.audioContext.currentTime.toFixed(4),"offset="+F.toFixed(4),"latency="+c.toFixed(4),"state="+z.audioContext.state,g!==D?"original_ts="+g.toFixed(4):"","action="+(y?"schedule":"start"),""),H.scheduledEndTime=x,H.mediaEndTime=C,R>0?{type:"started",scheduledTime:N}:{type:"not-started",reason:"missed "+Math.abs(F).toFixed(2)+"s"}}},[z,q]),Y=Rb(()=>{if(!z)return Promise.resolve();if(B.current)return Promise.resolve();B.current=!0,z.gainNode.gain.cancelScheduledValues(z.audioContext.currentTime),z.gainNode.gain.setValueAtTime(0,z.audioContext.currentTime),z.gainNode.gain.linearRampToValueAtTime(1,z.audioContext.currentTime+0.03),T.current.forEach((Z,N)=>{N.start(Z.scheduledTime,Z.offset,Z.duration)}),T.current.clear();let $=z.resume();return G.current=new Promise((Z)=>{yQ(z.audioContext,q).then(Z),$.catch((N)=>{p.warn({logLevel:q,tag:"audio"},"AudioContext resume rejected, continuing without audio sync",N),Z()})}).finally(()=>{G.current=null}),$.catch(()=>{})},[z,q]),X=Rb(()=>{return G.current},[]),O=Rb(()=>{if(!z)return Promise.resolve();if(!B.current)return Promise.resolve();return B.current=!1,z.suspend()},[z]),L=nb(()=>{return{audioContext:z?.audioContext??null,getAudioContextState:()=>z?.getState()??null,gainNode:z?.gainNode??null,audioSyncAnchor:J,audioSyncAnchorEmitter:Q,scheduleAudioNode:W,resume:Y,suspend:O,getIsResumingAudioContext:X,unscheduleAudioNode:U}},[z,J,Q,W,Y,O,X,U]);return xB(Jh.Provider,{value:L,children:b})},HB=({children:b,numberOfAudioTags:h})=>{let j=fb([]),[k]=vB(h);if(h!==k)throw Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");let q=Xb(),w=Hh(),z=d(),B=vk(Jh),G=B?.audioContext??null,J=B?.resume,K=nb(()=>{return Array(h).fill(!0).map(()=>{let L=$Q();return{id:Math.random(),ref:L,mediaElementSourceNode:G?Qq({audioContext:G,ref:L}):null}})},[G,h]);(Oh.useInsertionEffect??Oh.useLayoutEffect)(()=>{return()=>{requestAnimationFrame(()=>{K.forEach(({mediaElementSourceNode:L})=>{L?.cleanup()})})}},[K]);let M=fb(Array(h).fill(!1)),T=Rb(()=>{K.forEach(({ref:L,id:$})=>{let Z=j.current?.find((R)=>R.id===$),{current:N}=L;if(!N)return;if(Z===void 0){N.src=Ow;return}if(!Z)throw TypeError("Expected audio data to be there");Object.keys(Z.props).forEach((R)=>{if(vQ(R,Z.props[R],N[R]))N[R]=Z.props[R]})})},[K]),U=Rb((L)=>{let{aud:$,audioId:Z,premounting:N,postmounting:R}=L,F=j.current?.find((c)=>c.audioId===Z);if(F)return F;let g=M.current.findIndex((c)=>c===!1);if(g===-1)throw Error(`Tried to simultaneously mount ${h+1} <Html5Audio /> tags at the same time. With the current settings, the maximum amount of <Html5Audio /> tags is limited to ${h} at the same time. Remotion pre-mounts silent audio tags to help avoid browser autoplay restrictions. See https://remotion.dev/docs/player/autoplay#using-the-numberofsharedaudiotags-prop for more information on how to increase this limit.`);let{id:v,ref:y,mediaElementSourceNode:x}=K[g],D=[...M.current];D[g]=v,M.current=D;let C={props:$,id:v,el:y,audioId:Z,mediaElementSourceNode:x,premounting:N,audioMounted:Boolean(y.current),postmounting:R,cleanupOnMediaTagUnmount:()=>{}};return j.current?.push(C),T(),C},[h,K,T]),W=Rb((L)=>{let $=[...M.current],Z=K.findIndex((N)=>N.id===L);if(Z===-1)throw TypeError("Error occured in ");$[Z]=!1,M.current=$,j.current=j.current?.filter((N)=>N.id!==L),T()},[K,T]),Y=Rb(({aud:L,audioId:$,id:Z,premounting:N,postmounting:R})=>{let F=!1;if(j.current=j.current?.map((g)=>{let v=Boolean(g.el.current);if(g.audioMounted!==v)F=!0;if(g.id===Z){if(FQ(L,g.props)&&g.premounting===N&&g.postmounting===R)return g;return F=!0,{...g,props:L,premounting:N,postmounting:R,audioId:$,audioMounted:v}}return g}),F)T()},[T]),X=Rb(()=>{K.forEach((L)=>{if(j.current.find((Z)=>Z.el===L.ref)?.premounting)return;Wj({mediaRef:L.ref,mediaType:"audio",onAutoPlayError:null,logLevel:q,mountTime:w,reason:"playing all audios",isPlayer:z.isPlayer})}),J?.()},[q,w,K,z.isPlayer,J]),O=nb(()=>{return{registerAudio:U,unregisterAudio:W,updateAudio:Y,playAllAudios:X,numberOfAudioTags:h}},[h,X,U,W,Y]);return DQ(Aj.Provider,{value:O,children:[K.map(({id:L,ref:$})=>{return xB("audio",{ref:$,preload:"metadata",src:Ow},L)}),b]})},EQ=({aud:b,audioId:h,premounting:j,postmounting:k})=>{let q=vk(Jh),w=vk(Aj),[z]=vB(()=>{if(w&&w.numberOfAudioTags>0)return w.registerAudio({aud:b,audioId:h,premounting:j,postmounting:k});let G=Oh.createRef(),J=q?.audioContext?Qq({audioContext:q.audioContext,ref:G}):null;return{el:G,id:Math.random(),props:b,audioId:h,mediaElementSourceNode:J,premounting:j,audioMounted:Boolean(G.current),postmounting:k,cleanupOnMediaTagUnmount:()=>{J?.cleanup()}}}),B=Oh.useInsertionEffect??Oh.useLayoutEffect;if(typeof document<"u")B(()=>{if(w&&w.numberOfAudioTags>0)w.updateAudio({id:z.id,aud:b,audioId:h,premounting:j,postmounting:k})},[b,w,z.id,h,j,k]),B(()=>{return()=>{if(w&&w.numberOfAudioTags>0)w.unregisterAudio(z.id)}},[w,z.id]);return z},HQ=0.00001,Xj=(b,h)=>{return Math.abs(b-h)<HQ},PB=(b,h)=>{return Math.round(b/h*100)/100},xk=()=>{if(typeof window>"u")return!1;if(!/AppleWebKit/.test(window.navigator.userAgent))return!1;return!window.navigator.userAgent.includes("Chrome/")},_j=()=>{if(typeof window>"u")return!1;return/iP(ad|od|hone)/i.test(window.navigator.userAgent)&&xk()},PQ=(b)=>{return _j()&&b.startsWith("blob:")},Ek=({actualFrom:b,fps:h})=>{return PB(Math.max(0,-b),h)},Hk=({duration:b,fps:h})=>{return PB(b,h)},CQ=({actualSrc:b,actualFrom:h,duration:j,fps:k})=>{if(PQ(b))return b;if(b.startsWith("data:"))return b;if(Boolean(new URL(b,(typeof window>"u"?null:window.location.href)??"http://localhost:3000").hash))return b;if(!Number.isFinite(h))return b;let w=`${b}#t=${Ek({actualFrom:h,fps:k})}`;if(!Number.isFinite(j))return w;return`${w},${Hk({duration:j,fps:k})}`},SQ=({prevStartFrom:b,newStartFrom:h,prevDuration:j,newDuration:k,fps:q})=>{let w=Ek({actualFrom:b,fps:q}),z=Ek({actualFrom:h,fps:q}),B=Hk({duration:j,fps:q}),G=Hk({duration:k,fps:q});if(z<w)return!1;if(G>B)return!1;return!0},cQ=({actualSrc:b,actualFrom:h,duration:j,fps:k})=>{let q=Kk(h),w=Kk(j),z=Kk(b);if(!SQ({prevStartFrom:q.current,newStartFrom:h,prevDuration:w.current,newDuration:j,fps:k})||b!==z.current)q.current=h,w.current=j,z.current=b;return CQ({actualSrc:z.current,actualFrom:q.current,duration:w.current,fps:k})},Rw=!1,fQ=(b)=>{if(Rw)return;Rw=!0,p.warn({logLevel:b,tag:null},"In Safari, setting a volume and a playback rate at the same time is buggy."),p.warn({logLevel:b,tag:null},"In Desktop Safari, only volumes <= 1 will be applied."),p.warn({logLevel:b,tag:null},b,"In Mobile Safari, the volume will be ignored and set to 1 if a playbackRate is set.")},CB=({mediaRef:b,volume:h,logLevel:j,source:k,shouldUseWebAudioApi:q})=>{let w=Lw(null),z=Lw(h);z.current=h;let B=YQ(Jh);if(!B)throw Error("useAmplification must be used within a SharedAudioContext");let{audioContext:G,gainNode:J}=B;if(typeof window<"u")ZQ(()=>{if(!G)return;if(!b.current)return;if(!q)return;if(b.current.playbackRate!==1&&xk()){fQ(j);return}if(!k)return;if(!J)return;let M=new GainNode(G,{gain:z.current});return k.attemptToConnect(),k.get().connect(M),M.connect(J),w.current={gainNode:M},p.trace({logLevel:j,tag:null},`Starting to amplify ${b.current?.src}. Gain = ${z.current}, playbackRate = ${b.current?.playbackRate}`),()=>{w.current=null,M.disconnect(),k.get().disconnect()}},[j,b,G,k,q,J]);if(w.current){let M=h;if(!Xj(w.current.gainNode.gain.value,M))w.current.gainNode.gain.value=M,p.trace({logLevel:j,tag:null},`Setting gain to ${M} for ${b.current?.src}`)}if((xk()&&b.current&&b.current?.playbackRate!==1||!q)&&b.current&&!Xj(h,b.current?.volume))b.current.volume=Math.min(h,1);return w},Vb=()=>{return VQ(a)?.cumulatedNegativeFrom??0},Kh=(b)=>{let h=_h.useLoop(),j=qb(),k=Vb();if(b==="repeat"||h===null)return j+k;return j+k+h.durationInFrames*h.iteration},cB=(b)=>{if(/data:|blob:/.test(b.substring(0,5)))return"Data URL";let h=b.split("/").map((j)=>j.split("\\")).flat(1);return h[h.length-1]},AQ=({compositionDurationInFrames:b,playbackRate:h,trimBefore:j,trimAfter:k,parentSequenceDurationInFrames:q,loop:w})=>{if(w)return b;let z=Sj({mediaDurationInFrames:b*h+(j??0),playbackRate:h,trimBefore:j,trimAfter:k});if(q!==null){let B=Math.min(q*h,z);return Number(B.toFixed(10))}return z},lb=({frame:b,volume:h,mediaVolume:j=1})=>{if(typeof h==="number")return h*j;if(typeof h>"u")return Number(j);let k=h(b)*j;if(typeof k!=="number")throw TypeError(`You passed in a a function to the volume prop but it did not return a number but a value of type ${typeof k} for frame ${b}`);if(Number.isNaN(k))throw TypeError(`You passed in a function to the volume prop but it returned NaN for frame ${b}.`);if(!Number.isFinite(k))throw TypeError(`You passed in a function to the volume prop but it returned a non-finite number for frame ${b}.`);return Math.max(0,k)},yw={},_Q=(b)=>{if(yw[b])return;console.warn(b),yw[b]=!0},fB=({volume:b,mediaVolume:h,mediaType:j,src:k,displayName:q,trimBefore:w,trimAfter:z,playbackRate:B,sequenceDurationInFrames:G,mediaStartsAt:J,loop:K})=>{if(!k)throw Error("No src passed");let Q=Pk(a),[M]=IQ(()=>b),T=AQ({compositionDurationInFrames:G,playbackRate:B,trimBefore:w,trimAfter:z,parentSequenceDurationInFrames:Q?.durationInFrames??null,loop:K}),U=gw(()=>{if(typeof b==="number")return b;return Array(Math.floor(Math.max(0,T+J))).fill(!0).map(($,Z)=>{return lb({frame:Z+J,volume:b,mediaVolume:h})}).join(",")},[T,J,b,h]);SB(()=>{if(typeof b==="number"&&b!==M)_Q(`Remotion: The ${j} with src ${k} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/audio/volume`)},[M,j,k,b]);let W=typeof b==="function",Y=Zj(),{rootId:X}=Eb(),O=0-J+(w??0);return gw(()=>{return{volumes:U,duration:T,doesVolumeChange:W,nonce:Y,rootId:X,finalDisplayName:q??cB(k),startMediaFrom:O,src:k,playbackRate:B}},[U,T,W,Y,X,q,k,O,B])},Tq=({volume:b,mediaVolume:h,src:j,mediaType:k,playbackRate:q,displayName:w,id:z,getStack:B,showInTimeline:G,premountDisplay:J,postmountDisplay:K,loopDisplay:Q,documentationLink:M,refForOutline:T})=>{let U=Pk(a),W=Vb(),{registerSequence:Y,unregisterSequence:X}=Pk(Gh),{durationInFrames:O}=wb(),L=Vb(),{volumes:$,duration:Z,doesVolumeChange:N,nonce:R,rootId:F,finalDisplayName:g}=fB({volume:b,mediaVolume:h,mediaType:k,src:j,displayName:w,trimAfter:void 0,trimBefore:void 0,playbackRate:q,sequenceDurationInFrames:O,mediaStartsAt:L,loop:!1}),{isStudio:v}=d();SB(()=>{if(!j)throw Error("No src passed");if(!v&&window.process?.env?.NODE_ENV!=="test")return;if(!G)return;return Y({type:k,src:j,id:z,duration:Z,from:0,trimBefore:null,parent:U?.id??null,displayName:g,documentationLink:M,rootId:F,volume:$,showInTimeline:!0,nonce:R.get(),startMediaFrom:0-W,doesVolumeChange:N,loopDisplay:Q,playbackRate:q,getStack:B,premountDisplay:J,postmountDisplay:K,controls:null,effects:[],refForOutline:T,isInsideSeries:!1,frozenFrame:null,frozenMediaFrame:null}),()=>{X(z)}},[Z,z,U,j,Y,X,$,N,R,k,W,q,B,G,J,K,Q,M,F,g,v,T])},hT=(b,h)=>{let[j,k]=Bj([]),[q,w]=Bj([]),[z,B]=Bj([]),J=d().isRendering,K=rQ(!1),Q=Qk((U)=>{if(J)return{unblock:()=>{return}};let W=!1;return k((Y)=>[...Y,U]),{unblock:()=>{if(W)return;W=!0,k((Y)=>{let X=Y.filter((O)=>O!==U);if(X.length===Y.length)return Y;return X})}}},[J]),M=Qk((U)=>{return w((W)=>[...W,U]),{remove:()=>{w((W)=>W.filter((Y)=>Y!==U))}}},[]),T=Qk((U)=>{return B((W)=>[...W,U]),{remove:()=>{B((W)=>W.filter((Y)=>Y!==U))}}},[]);if(IB(()=>{if(J)return;if(j.length>0)q.forEach((U)=>U()),n({logLevel:b,message:"Player is entering buffer state",mountTime:h,tag:"player"})},[j]),typeof window<"u")oQ(()=>{if(J)return;if(j.length===0)z.forEach((U)=>U()),n({logLevel:b,message:"Player is exiting buffer state",mountTime:h,tag:"player"})},[j]);return eQ(()=>{return{addBlock:Q,listenForBuffering:M,listenForResume:T,buffering:K}},[Q,K,M,T])},Mh=nQ.createContext(null),VB=({children:b})=>{let{logLevel:h,mountTime:j}=tQ(Ab),k=hT(h??"info",j);return bT(Mh.Provider,{value:k,children:b})},AB=(b)=>{let[h,j]=Bj(b.buffering.current);return IB(()=>{let k=()=>{j(!0)},q=()=>{j(!1)};return b.listenForBuffering(k),b.listenForResume(q),()=>{b.listenForBuffering(()=>{return}),b.listenForResume(()=>{return})}},[b]),h},lh=()=>{let b=pQ(Mh),h=Xb(),j=b?b.addBlock:null;return aQ(()=>({delayPlayback:()=>{if(!j)throw 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");p.trace({logLevel:h,tag:"[buffer-state]"},"Adding buffer handle",Error().stack);let{unblock:k}=j({id:String(Math.random())}),q=!1;return{unblock:()=>{if(q)return;q=!0,p.trace({logLevel:h,tag:"[buffer-state]"},"Removing buffer handle"),k()}}}}),[j,h])},jT=()=>{return/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent)},kT=({mediaRef:b,mediaType:h,onVariableFpsVideoDetected:j,pauseWhenBuffering:k,logLevel:q,mountTime:w})=>{let z=iQ(!1),{delayPlayback:B}=lh(),G=dQ((J)=>{if(h!=="video")return;if(!k)return;let K=b.current;if(!K)return;if(K.readyState>=K.HAVE_FUTURE_DATA&&!jT()){n({logLevel:q,message:`Not using buffer until first frame, because readyState is ${K.readyState} and is not Safari or Desktop Chrome`,mountTime:w,tag:"buffer"});return}if(!K.requestVideoFrameCallback){n({logLevel:q,message:"Not using buffer until first frame, because requestVideoFrameCallback is not supported",mountTime:w,tag:"buffer"});return}z.current=!0,n({logLevel:q,message:`Buffering ${b.current?.src} until the first frame is received`,mountTime:w,tag:"buffer"});let Q=B(),M=()=>{Q.unblock(),K.removeEventListener("ended",M,{once:!0}),K.removeEventListener("pause",M,{once:!0}),z.current=!1},T=()=>{M()};K.requestVideoFrameCallback((U,W)=>{if(Math.abs(W.mediaTime-J)>0.5)j();M()}),K.addEventListener("ended",T,{once:!0}),K.addEventListener("pause",T,{once:!0}),K.addEventListener("canplay",T,{once:!0})},[B,q,b,h,w,j,k]);return sQ(()=>{return{isBuffering:()=>z.current,bufferUntilFirstFrame:G}},[G])},wT=(b)=>{let h=qT.useRef({time:b.current?.currentTime??0,lastUpdate:performance.now()}),j=b.current?.currentTime??null;if(j!==null){if(h.current.time!==j)h.current.time=j,h.current.lastUpdate=performance.now()}return h},Gj=({mediaRef:b,time:h,logLevel:j,why:k,mountTime:q})=>{let w=_j()?Number(h.toFixed(1)):h;return n({logLevel:j,tag:"seek",message:`Seeking from ${b.currentTime} to ${w}. src= ${b.src} Reason: ${k}`,mountTime:q}),b.currentTime=w,w},GT=({element:b,shouldBuffer:h,isPremounting:j,isPostmounting:k,logLevel:q,mountTime:w,src:z})=>{let B=lh(),[G,J]=BT(!1);return zT(()=>{let K=[],{current:Q}=b;if(!Q)return;if(!h)return;if(j||k){if((j||k)&&Q.readyState<Q.HAVE_FUTURE_DATA){if(!navigator.userAgent.includes("Firefox/")){n({logLevel:q,message:`Calling .load() on ${Q.src} because readyState is ${Q.readyState} and it is not Firefox. Element is premounted ${Q.playbackRate}`,tag:"load",mountTime:w});let W=Q.playbackRate;Q.load(),Q.playbackRate=W}}return}let M=(W)=>{let Y=!1;if(K.forEach((X)=>{X(W),Y=!0}),K=[],J((X)=>{if(X)Y=!0;return!1}),Y)n({logLevel:q,message:`Unmarking as buffering: ${Q.src}. Reason: ${W}`,tag:"buffer",mountTime:w})},T=(W)=>{J(!0),n({logLevel:q,message:`Marking as buffering: ${Q.src}. Reason: ${W}`,tag:"buffer",mountTime:w});let{unblock:Y}=B.delayPlayback(),X=()=>{M('"canplay" was fired'),U()},O=()=>{M('"error" event was occurred'),U()};Q.addEventListener("canplay",X,{once:!0}),K.push(()=>{Q.removeEventListener("canplay",X)}),Q.addEventListener("error",O,{once:!0}),K.push(()=>{Q.removeEventListener("error",O)}),K.push((L)=>{n({logLevel:q,message:`Unblocking ${Q.src} from buffer. Reason: ${L}`,tag:"buffer",mountTime:w}),Y()})},U=()=>{if(Q.readyState<Q.HAVE_FUTURE_DATA){if(T(`readyState is ${Q.readyState}, which is less than HAVE_FUTURE_DATA`),!navigator.userAgent.includes("Firefox/")){n({logLevel:q,message:`Calling .load() on ${z} because readyState is ${Q.readyState} and it is not Firefox. ${Q.playbackRate}`,tag:"load",mountTime:w});let W=Q.playbackRate;Q.load(),Q.playbackRate=W}}else{let W=()=>{T('"waiting" event was fired')};Q.addEventListener("waiting",W),K.push(()=>{Q.removeEventListener("waiting",W)})}};return U(),()=>{M("element was unmounted or prop changed")}},[B,z,b,j,k,q,h,w]),G},MT=({mediaRef:b,mediaType:h,lastSeek:j,onVariableFpsVideoDetected:k})=>{let q=KT(null);return JT(()=>{let{current:w}=b;if(w)q.current={time:w.currentTime,lastUpdate:performance.now()};else{q.current=null;return}if(h!=="video"){q.current=null;return}let z=w;if(!z.requestVideoFrameCallback)return;let B=()=>{return},G=()=>{if(!z)return;let J=z.requestVideoFrameCallback((K,Q)=>{if(q.current!==null){let M=Math.abs(q.current.time-Q.mediaTime),T=Math.abs(j.current===null?1/0:Q.mediaTime-j.current);if(M>0.5&&T>0.5&&Q.mediaTime>q.current.time)k()}q.current={time:Q.mediaTime,lastUpdate:performance.now()},G()});B=()=>{z.cancelVideoFrameCallback(J),B=()=>{return}}};return G(),()=>{B()}},[j,b,h,k]),q},_B=({frame:b,playbackRate:h,startFrom:j})=>{return Sh(b,[-1,j,j+1],[-1,j,j+h])},lB=({fps:b,frame:h,playbackRate:j,startFrom:k})=>{let q=_B({frame:h,playbackRate:j,startFrom:k}),w=1000/b;return q*w/1000},Fw={},QT=(b,h)=>{if(b===null)return;if(b.seekable.length===0)return;if(b.seekable.length>1)return;if(Fw[b.src])return;let j={start:b.seekable.start(0),end:b.seekable.end(0)};if(j.start===0&&j.end===0){let k=[`The media ${b.src} cannot be seeked. This could be one of few reasons:`,"1) The media resource was replaced while the video is playing but it was not loaded yet.","2) The media does not support seeking.","3) The media was loaded with security headers prventing it from being included.","Please see https://remotion.dev/docs/non-seekable-media for assistance."].join(`
|
|
18
|
+
`);if(h==="console-error")console.error(k);else if(h==="console-warning")console.warn(`The media ${b.src} does not support seeking. The video will render fine, but may not play correctly in the Remotion Studio and in the <Player>. See https://remotion.dev/docs/non-seekable-media for an explanation.`);else throw Error(k);Fw[b.src]=!0}},mB=({mediaRef:b,src:h,mediaType:j,playbackRate:k,preservePitch:q=!0,onlyWarnForMediaSeekingError:w,acceptableTimeshift:z,pauseWhenBuffering:B,isPremounting:G,isPostmounting:J,onAutoPlayError:K})=>{let{playbackRate:Q}=tk(),M=qb(),T=Hb(),[U]=Cz(),W=mQ(Mh),{fps:Y}=wb(),X=Vb(),O=Mk(null),L=Mk(null),$=Xb(),Z=Hh();if(!W)throw Error("useMediaPlayback must be used inside a <BufferingContext>");let N=Mk({}),R=lQ(()=>{if(!h)return;if(N.current[h])return;p.verbose({logLevel:$,tag:null},`Detected ${h} as a variable FPS video. Disabling buffering while seeking.`),N.current[h]=!0},[$,h]),F=MT({mediaRef:b,mediaType:j,lastSeek:L,onVariableFpsVideoDetected:R}),g=wT(b),v=lB({frame:M,playbackRate:k,startFrom:-X,fps:Y}),y=GT({element:b,shouldBuffer:B,isPremounting:G,isPostmounting:J,logLevel:$,mountTime:Z,src:h??null}),{bufferUntilFirstFrame:x,isBuffering:D}=kT({mediaRef:b,mediaType:j,onVariableFpsVideoDetected:R,pauseWhenBuffering:B,logLevel:$,mountTime:Z}),C=k*Q,c=(()=>{if(b.current?.duration)return Math.min(b.current.duration,z??0.65);return z??0.65})(),I=AB(W);Dw(()=>{if(b.current?.paused)return;if(!U){n({logLevel:$,tag:"pause",message:`Pausing ${b.current?.src} because ${G?"media is premounting":J?"media is postmounting":"Player is not playing"}`,mountTime:Z}),b.current?.pause();return}let E=y||D();if(W.buffering.current&&!E)n({logLevel:$,tag:"pause",message:`Pausing ${b.current?.src} because player is buffering but media tag is not`,mountTime:Z}),b.current?.pause()},[D,y,W,I,G,$,b,j,Z,U,J]);let H=d();uQ(()=>{let E=Math.max(0,C);if(b.current&&b.current.playbackRate!==E)b.current.playbackRate=E;if(b.current&&b.current.preservesPitch!==q)b.current.preservesPitch=q},[b,C,q]),Dw(()=>{let E=j==="audio"?"<Html5Audio>":"<Html5Video>";if(!b.current)throw Error(`No ${j} ref found`);if(!h)throw Error(`No 'src' attribute was passed to the ${E} element.`);let{duration:P}=b.current,S=!Number.isNaN(P)&&Number.isFinite(P)?Math.min(P,v):v,V=g.current.time,_=F.current?.time??null,l=N.current[h],u=Math.abs(S-V),f=_?Math.abs(S-_):null,s=F.current?.lastUpdate&&F.current.time>g.current.lastUpdate?f:u,i=f&&!l?s:u;if(i>c&&O.current!==S){if(L.current=Gj({mediaRef:b.current,time:S,logLevel:$,why:`because time shift is too big. shouldBeTime = ${S}, isTime = ${V}, requestVideoCallbackTime = ${_}, timeShift = ${i}${l?", isVariableFpsVideo = true":""}, isPremounting = ${G}, isPostmounting = ${J}, pauseWhenBuffering = ${B}`,mountTime:Z}),O.current=L.current,U){if(C>0)x(S);if(b.current.paused)Wj({mediaRef:b,mediaType:j,onAutoPlayError:K,logLevel:$,mountTime:Z,reason:"player is playing but media tag is paused, and just seeked",isPlayer:H.isPlayer})}if(!w)QT(b.current,w?"console-warning":"console-error");return}let zb=U?0.15:0.01,Bb=Math.abs(b.current.currentTime-S)>zb,Gb=y||D(),t=W.buffering.current&&!Gb;if(!U||t){if(Bb)L.current=Gj({mediaRef:b.current,time:S,logLevel:$,why:`not playing or something else is buffering. time offset is over seek threshold (${zb})`,mountTime:Z});return}if(!U||W.buffering.current)return;let jb=b.current.paused&&!b.current.ended;if(jb||T===0){let $b=jb?"media tag is paused":"absolute frame is 0";if(Bb)L.current=Gj({mediaRef:b.current,time:S,logLevel:$,why:`is over timeshift threshold (threshold = ${zb}) and ${$b}`,mountTime:Z});if(Wj({mediaRef:b,mediaType:j,onAutoPlayError:K,logLevel:$,mountTime:Z,reason:`player is playing and ${$b}`,isPlayer:H.isPlayer}),!l&&C>0)x(S)}},[T,c,x,W.buffering,F,$,v,D,y,b,j,w,C,U,h,K,G,J,B,Z,g,H.isPlayer])},uB=({mediaRef:b,id:h,mediaType:j,onAutoPlayError:k,isPremounting:q,isPostmounting:w})=>{let{audioAndVideoTags:z,imperativePlaying:B}=Eb(),G=Xb(),J=Hh(),K=d();TT(()=>{let Q={id:h,play:(M)=>{if(!B.current)return;if(q||w)return;return Wj({mediaRef:b,mediaType:j,onAutoPlayError:k,logLevel:G,mountTime:J,reason:M,isPlayer:K.isPlayer})}};return z.current.push(Q),()=>{z.current=z.current.filter((M)=>M.id!==h)}},[z,h,b,j,k,B,q,w,G,J,K.isPlayer])},Uq=dB({playerMuted:!1,mediaVolume:1}),Wq=dB({setPlayerMuted:()=>{throw Error("default")},setMediaVolume:()=>{throw Error("default")}}),Xq=()=>{let{mediaVolume:b}=Yj(Uq),{setMediaVolume:h}=Yj(Wq);return sB(()=>{return[b,h]},[b,h])},Yq=()=>{let{playerMuted:b}=Yj(Uq),{setPlayerMuted:h}=Yj(Wq);return sB(()=>{return[b,h]},[b,h])},Qh=(b)=>{if(b>=100)throw Error(`Volume was set to ${b}, but regular volume is 1, not 100. Did you forget to divide by 100? Set a volume of less than 100 to dismiss this error.`)},WT=(b,h)=>{let[j]=$w(b.shouldPreMountAudioTags);if(b.shouldPreMountAudioTags!==j)throw Error("Cannot change the behavior for pre-mounting audio tags dynamically.");let k=Xb(),{volume:q,muted:w,playbackRate:z,preservePitch:B,shouldPreMountAudioTags:G,src:J,onDuration:K,acceptableTimeShiftInSeconds:Q,_remotionInternalNeedsDurationCalculation:M,_remotionInternalNativeLoopPassed:T,_remotionInternalStack:U,allowAmplificationDuringRender:W,name:Y,pauseWhenBuffering:X,showInTimeline:O,loopVolumeCurveBehavior:L,stack:$,crossOrigin:Z,delayRenderRetries:N,delayRenderTimeoutInMilliseconds:R,toneFrequency:F,useWebAudioApi:g,onError:v,onNativeError:y,audioStreamIndex:x,...D}=b;if(!1)throw Error("typecheck error");let[c]=Xq(),[I]=Yq(),H=Kh(L??"repeat");if(!J)throw TypeError("No 'src' was passed to <Html5Audio>.");let E=_b(J),P=TQ(a),[S]=$w(()=>String(Math.random())),V=lb({frame:H,volume:q,mediaVolume:c});Qh(V);let _=Mq({crossOrigin:Z,requestsVideoFrame:!1,isClientSideRendering:!1}),l=Zw(()=>{return{muted:w||I||V<=0,src:E,loop:T,crossOrigin:_,...D}},[T,I,w,D,E,V,_]),u=Zw(()=>`audio-${qh(J??"")}-${P?.relativeFrom}-${P?.cumulatedFrom}-${P?.durationInFrames}-muted:${b.muted}-loop:${b.loop}`,[J,P?.relativeFrom,P?.cumulatedFrom,P?.durationInFrames,b.muted,b.loop]),{el:f,mediaElementSourceNode:s,cleanupOnMediaTagUnmount:i}=EQ({aud:l,audioId:u,premounting:Boolean(P?.premounting),postmounting:Boolean(P?.postmounting)}),zb=MQ(()=>{return U??null},[U]);Tq({volume:q,mediaVolume:c,src:J,mediaType:"audio",playbackRate:z??1,displayName:Y??null,id:S,getStack:zb,showInTimeline:O,premountDisplay:P?.premountDisplay??null,postmountDisplay:P?.postmountDisplay??null,loopDisplay:void 0,documentationLink:"https://www.remotion.dev/docs/html5-audio",refForOutline:null}),mB({mediaRef:f,src:J,mediaType:"audio",playbackRate:z??1,preservePitch:B,onlyWarnForMediaSeekingError:!1,acceptableTimeshift:Q??null,isPremounting:Boolean(P?.premounting),isPostmounting:Boolean(P?.postmounting),pauseWhenBuffering:X,onAutoPlayError:null}),uB({id:S,isPostmounting:Boolean(P?.postmounting),isPremounting:Boolean(P?.premounting),mediaRef:f,mediaType:"audio",onAutoPlayError:null}),CB({logLevel:k,mediaRef:f,source:s,volume:V,shouldUseWebAudioApi:g??!1}),(Yw.useInsertionEffect??Yw.useLayoutEffect)(()=>{return()=>{requestAnimationFrame(()=>{i()})}},[i]),WQ(h,()=>{return f.current},[f]);let Gb=XQ(K);if(Gb.current=K,UQ(()=>{let{current:t}=f;if(!t)return;if(t.duration){Gb.current?.(t.src,t.duration);return}let jb=()=>{Gb.current?.(t.src,t.duration)};return t.addEventListener("loadedmetadata",jb),()=>{t.removeEventListener("loadedmetadata",jb)}},[f,J]),j)return null;return UT("audio",{ref:f,preload:"metadata",crossOrigin:_,...l})},iB=QQ(WT),RT=(b,h)=>{let j=NT(null),{volume:k,playbackRate:q,allowAmplificationDuringRender:w,onDuration:z,toneFrequency:B,_remotionInternalNeedsDurationCalculation:G,_remotionInternalNativeLoopPassed:J,acceptableTimeShiftInSeconds:K,name:Q,onNativeError:M,delayRenderRetries:T,delayRenderTimeoutInMilliseconds:U,loopVolumeCurveBehavior:W,pauseWhenBuffering:Y,audioStreamIndex:X,preservePitch:O,...L}=b,$=Hb(),Z=Kh(W??"repeat"),N=qb(),R=vw(a),{registerRenderAsset:F,unregisterRenderAsset:g}=vw(Pb),{delayRender:v,continueRender:y}=Kb(),x=LT(()=>`audio-${qh(b.src??"")}-${R?.relativeFrom}-${R?.cumulatedFrom}-${R?.durationInFrames}`,[b.src,R?.relativeFrom,R?.cumulatedFrom,R?.durationInFrames]),D=lb({volume:k,frame:Z,mediaVolume:1});Qh(D),ZT(h,()=>{return j.current},[]),YT(()=>{if(!b.src)throw Error("No src passed");if(!window.remotion_audioEnabled)return;if(b.muted)return;if(D<=0)return;return F({type:"audio",src:Wb(b.src),id:x,frame:$,volume:D,mediaFrame:N,playbackRate:b.playbackRate??1,toneFrequency:B??1,audioStartFrame:Math.max(0,-(R?.cumulatedNegativeFrom??0)),audioStreamIndex:X??0}),()=>g(x)},[b.muted,b.src,F,$,x,g,D,Z,N,q,b.playbackRate,B,R?.cumulatedNegativeFrom,X]);let{src:C}=b,c=h||G;if($T(()=>{if(window.process?.env?.NODE_ENV==="test")return;if(!c)return;let I=v("Loading <Html5Audio> duration with src="+C,{retries:T??void 0,timeoutInMilliseconds:U??void 0}),{current:H}=j,E=()=>{if(H?.duration)z(H.src,H.duration);y(I)};if(H?.duration)z(H.src,H.duration),y(I);else H?.addEventListener("loadedmetadata",E,{once:!0});return()=>{H?.removeEventListener("loadedmetadata",E),y(I)}},[C,z,c,T,U,y,v]),!c)return null;return OT("audio",{ref:j,...L,onError:M})},gT=XT(RT),yT=(b,h)=>{let j=Tw(Aj),k=b,{startFrom:q,endAt:w,trimBefore:z,trimAfter:B,name:G,stack:J,pauseWhenBuffering:K,showInTimeline:Q,onError:M,freeze:T,...U}=k,{loop:W,freeze:Y,...X}=k,{fps:O}=wb(),L=d();if(L.isClientSideRendering)throw Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");if(typeof T<"u")throw TypeError('The "freeze" prop is not supported on <Html5Audio />. Use <Sequence freeze={...}> to freeze media playback.');let{durations:$,setDurations:Z}=Tw(Kq);if(typeof b.src!=="string")throw TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(b.src)} instead.`);let N=_b(b.src),R=Qw((x)=>{console.log(x.currentTarget.error);let D=`Could not play audio with src ${N}: ${x.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;if(W){if(M){M(Error(D));return}bh(Error(D))}else M?.(Error(D)),console.warn(D)},[W,M,N]),F=Qw((x,D)=>{Z({type:"got-duration",durationInSeconds:D,src:x})},[Z]),g=$[Wb(N)]??$[Wb(b.src)];Ij({startFrom:q,endAt:w,trimBefore:z,trimAfter:B});let{trimBeforeValue:v,trimAfterValue:y}=Vj({startFrom:q,endAt:w,trimBefore:z,trimAfter:B});if(W&&g!==void 0){if(!Number.isFinite(g))return Cb(eb,{...X,ref:h,_remotionInternalNativeLoopPassed:!0});let x=g*O;return Cb(_h,{layout:"none",durationInFrames:Sj({trimAfter:y,mediaDurationInFrames:x,playbackRate:b.playbackRate??1,trimBefore:v}),children:Cb(eb,{...X,ref:h,_remotionInternalNativeLoopPassed:!0})})}if(typeof v<"u"||typeof y<"u")return Cb(hb,{layout:"none",from:0-(v??0),showInTimeline:!1,durationInFrames:y,name:G,children:Cb(eb,{_remotionInternalNeedsDurationCalculation:Boolean(W),pauseWhenBuffering:K??!1,...U,ref:h})});if(fj({playbackRate:b.playbackRate,preservePitch:b.preservePitch,volume:b.volume},"Html5Audio"),L.isRendering)return Cb(gT,{onDuration:F,...b,ref:h,onNativeError:R,_remotionInternalNeedsDurationCalculation:Boolean(W)});return Cb(iB,{_remotionInternalNativeLoopPassed:b._remotionInternalNativeLoopPassed??!1,_remotionInternalStack:J??null,shouldPreMountAudioTags:j!==null&&j.numberOfAudioTags>0,...b,ref:h,onNativeError:R,onDuration:F,pauseWhenBuffering:K??!1,_remotionInternalNeedsDurationCalculation:Boolean(W),showInTimeline:Q??!0})},eb=iM(yT);bb(eb);var DT=eb,CT=(b)=>{if(b===void 0)return 1;if(typeof b!=="number"||!Number.isFinite(b)||b<=0)throw Error(`<Solid>: \`pixelDensity\` must be a positive finite number. Received: ${String(b)}.`);return b},ST={...yb,color:{type:"color",default:"transparent",description:"Color"},width:{type:"number",min:1,step:1,default:1920,description:"Width",hiddenFromList:!1},height:{type:"number",min:1,step:1,default:1080,description:"Height",hiddenFromList:!1},pixelDensity:{type:"number",min:1,max:3,step:0.1,default:1,description:"Pixel density",hiddenFromList:!1},...Yb},cT=({color:b,width:h,height:j,effects:k=[],className:q,style:w,pixelDensity:z,overrideId:B,reference:G})=>{let{delayRender:J,continueRender:K,cancelRender:Q}=Kb(),M=CT(z),T=Math.ceil(h*M),U=Math.ceil(j*M),[W,Y]=PT(null),X=Ih({effects:k,overrideId:B??null}),O=xw(()=>{if(typeof document>"u")return null;let N=document.createElement("canvas");return N.width=1,N.height=1,N},[]),L=Ah(),$=vT((N)=>{if(Y(N),typeof G==="function")G(N);else if(G)G.current=N},[G]);xT(()=>{if(!W||!O)return;let N=J("Solid effect chain");if(!L)return K(N),()=>{K(N)};let R=O.getContext("2d",{colorSpace:"srgb"});if(!R){Q(Error("Failed to acquire 2D context for <Solid> source"));return}if(R.clearRect(0,0,1,1),b!==void 0)R.fillStyle=b,R.fillRect(0,0,1,1);return Vh({state:L.get(T,U),source:O,effects:X,output:W,width:T,height:U}).then((F)=>{if(F)K(N)}).catch((F)=>{Q(F)}),()=>{K(N)}},[b,W,O,L,T,U,J,K,Q,X]);let Z=xw(()=>{return{width:h,height:j,...w??{}}},[j,w,h]);return Ck("canvas",{ref:$,width:T,height:U,className:q,style:Z})},fT=FT(({effects:b=[],controls:h,color:j,height:k,width:q,className:w,durationInFrames:z,style:B,name:G,from:J,trimBefore:K,freeze:Q,hidden:M,showInTimeline:T,pixelDensity:U,...W},Y)=>{let X=fh(b),O=HT(null);return ET(Y,()=>{return O.current},[]),Ck(hb,{layout:"none",from:J,trimBefore:K,freeze:Q,hidden:M,showInTimeline:T,controls:h,_remotionInternalEffects:X,durationInFrames:z,name:G??"<Solid>",outlineRef:O,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/solid",...W,children:Ck(cT,{reference:O,overrideId:h?.overrideId??null,color:j,height:k,width:q,className:w,style:B,effects:b,pixelDensity:U})})}),Zq=Zb({Component:fT,componentName:"<Solid>",componentIdentity:"dev.remotion.remotion.Solid",schema:ST,supportsEffects:!0});Zq.displayName="Solid";bb(Zq);var rh=null,$q=()=>{if(rh!==null)return rh;if(typeof document>"u")return!1;let b=document.createElement("canvas");return rh=typeof b.getContext("2d")?.drawElementImage==="function"&&typeof b.requestPaint==="function"&&typeof b.captureElementImage==="function"&&"transferControlToOffscreen"in HTMLCanvasElement.prototype,rh},aB="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).";function AT(b,h){if(typeof b!=="number"||typeof h!=="number")throw Error(`HtmlInCanvas: \`width\` and \`height\` must be numbers. Received width=${String(b)}, height=${String(h)}.`);if(!Number.isInteger(b)||b<=0)throw Error(`HtmlInCanvas: \`width\` must be a positive integer. Received: ${String(b)}.`);if(!Number.isInteger(h)||h<=0)throw Error(`HtmlInCanvas: \`height\` must be a positive integer. Received: ${String(h)}.`)}function _T(b){if(b===void 0)return 1;if(typeof b!=="number"||!Number.isFinite(b)||b<=0)throw Error(`HtmlInCanvas: \`pixelDensity\` must be a positive finite number. Received: ${String(b)}.`);return b}var bj=(b)=>{return b instanceof DOMException&&b.name==="InvalidStateError"},Hw="HtmlInCanvas: Expected the element to be inside the viewport during rendering, but Chrome had no cached paint record for it.",Pw=({offscreen:b,width:h,height:j})=>{if(b.width!==h)b.width=h;if(b.height!==j)b.height=j},lT=({canvas:b,element:h,elementImage:j})=>{let k=b.getContext("2d");if(!k)throw Error("Failed to acquire 2D context for <HtmlInCanvas> canvas");k.reset();let q=k.drawElementImage(j,0,0);h.style.transform=q.toString()},Cw=IT(!1),nB=pB(({width:b,height:h,effects:j,children:k,onPaint:q,onInit:w,pixelDensity:z,controls:B,style:G},J)=>{let K=VT(Cw);AT(b,h);let Q=_T(z),M=Math.ceil(b*Q),T=Math.ceil(h*Q),{continueRender:U,cancelRender:W}=Kb(),{isRendering:Y}=d();if(!$q())W(Error(aB));let X=Tb(null),O=Tb(null),L=Tb(null),$=`${b}x${h}@${Q}`,Z=Sk((E)=>{if(X.current=E,typeof J==="function")J(E);else if(J)J.current=E},[J]),N=Ah(),R=Ih({effects:j,overrideId:B?.overrideId??null}),F=Tb(R);F.current=R;let g=Tb(q);g.current=q;let v=Tb(w);v.current=w;let y=Tb(!1),x=Tb(null),D=Tb(!1),C=Sk(async()=>{let E=L.current;if(!E)throw Error("Canvas or scene element not found");let P=O.current;if(!P)throw Error("HtmlInCanvas: offscreen canvas not ready (transferControlToOffscreen failed or canvas is remounting)");Pw({offscreen:P,width:M,height:T});try{let S=X.current;if(!S)throw Error("Canvas not found");let V=Rk("onPaint");if(!y.current){let u=null;try{u=S.captureElementImage(E)}catch(f){if(bj(f)&&!Y);else if(bj(f))throw Error(Hw);else throw f}if(u){y.current=!0;let f=v.current;if(f){let s=await f({canvas:P,element:E,elementImage:u,pixelDensity:Q});if(typeof s!=="function")throw Error("HtmlInCanvas: when `onInit` is provided, it must return a cleanup function, or a Promise that resolves to one.");if(D.current)s();else x.current=s}}}let _=g.current??lT,l;try{l=S.captureElementImage(E)}catch(u){if(bj(u)&&!Y){U(V);return}if(bj(u))throw Error(Hw);throw u}await _({canvas:P,element:E,elementImage:l,pixelDensity:Q}),await Vh({state:N.get(M,T),source:P,effects:F.current,output:P,width:M,height:T}),U(V)}catch(S){W(S)}},[T,M,N,U,W,Q,Y]);Tk(()=>{let E=X.current;if(!E)throw Error("Canvas not found");E.layoutSubtree=!0;let P=E.transferControlToOffscreen();return O.current=P,Pw({offscreen:P,width:M,height:T}),y.current=!1,D.current=!1,E.addEventListener("paint",C),()=>{E.removeEventListener("paint",C),O.current=null,y.current=!1,D.current=!0,x.current?.(),x.current=null}},[C,W,M,T]);let c=Tb(!1);Tk(()=>{if(!c.current){c.current=!0;return}let E=X.current;if(!E)return;E.requestPaint?.()},[q,R]),Tk(()=>{let E=X.current;if(!E)return;let P=Rk("waiting for first paint after canvas resize");return E.addEventListener("paint",()=>{U(P)},{once:!0}),()=>{U(P)}},[b,h,U,$]);let I=Ew(()=>{return{width:b,height:h}},[b,h]),H=Ew(()=>{return{width:b,height:h,...G??{}}},[h,G,b]);if(K)throw Error("<HtmlInCanvas> effects cannot be nested together. Chrome will only display the outer effect. Consider merging the effects into one if you can.");return Rh(Cw.Provider,{value:!0,children:Rh("canvas",{ref:Z,width:M,height:T,style:H,children:Rh("div",{ref:L,style:I,children:k})},$)})});nB.displayName="HtmlInCanvasContent";var tB=pB(({width:b,height:h,effects:j=[],children:k,onPaint:q,onInit:w,pixelDensity:z,controls:B,style:G,durationInFrames:J,name:K,...Q},M)=>{let{durationInFrames:T}=wb(),U=J??T,W=fh(j),Y=Tb(null),X=Sk((O)=>{if(Y.current=O,typeof M==="function")M(O);else if(M)M.current=O},[M]);return Rh(hb,{durationInFrames:U,name:K??"<HtmlInCanvas>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/remotion/html-in-canvas",controls:B,_remotionInternalEffects:W,outlineRef:Y,layout:"none",...Q,children:Rh(nB,{ref:X,width:b,height:h,effects:j,onPaint:q,onInit:w,pixelDensity:z,controls:B,style:G,children:k})})});tB.displayName="HtmlInCanvas";var mT={...yb,pixelDensity:{type:"number",min:1,max:3,step:0.1,default:1,description:"Pixel density",hiddenFromList:!1},...Yb},uT=Zb({Component:tB,componentName:"<HtmlInCanvas>",componentIdentity:"dev.remotion.remotion.HtmlInCanvas",schema:mT,supportsEffects:!0}),Lq=Object.assign(uT,{isSupported:$q});Lq.displayName="HtmlInCanvas";bb(Lq);function gb(b){if(b.startsWith("data:")&&b.length>100)return b.slice(0,60)+"...["+b.length+" chars total]";return b}var nT={...yb,fit:{type:"enum",default:"fill",description:"Fit",variants:{fill:{},contain:{},cover:{}}},...Yb},tT=()=>{if(typeof DOMException<"u")return new DOMException("Image loading was aborted","AbortError");let b=Error("Image loading was aborted");return b.name="AbortError",b},oT=({src:b,signal:h})=>{return new Promise((j,k)=>{let q=new Image,w=!1;function z(){q.onload=null,q.onerror=null}function B(J){if(w)return;w=!0,z(),J()}function G(){B(()=>k(tT()))}if(q.onload=()=>{Promise.resolve(q.decode?.()).catch(()=>{return}).then(()=>{let J=q.naturalWidth||q.width,K=q.naturalHeight||q.height;if(J<=0||K<=0){B(()=>k(Error(`Could not determine dimensions for <CanvasImage> with src="${gb(b)}"`)));return}B(()=>j({element:q,width:J,height:K}))})},q.onerror=()=>{B(()=>k(Error(`Could not load <CanvasImage> with src="${gb(b)}"`)))},h.addEventListener("abort",G,{once:!0}),h.aborted){G();return}q.crossOrigin="anonymous",q.src=b})};function eT(b){return 1000*2**(b-1)}var eB=oB(({src:b,width:h,height:j,fit:k="fill",effects:q,controls:w,onError:z,className:B,style:G,id:J,pauseWhenLoading:K,maxRetries:Q=2,delayRenderRetries:M,delayRenderTimeoutInMilliseconds:T,refForOutline:U,...W},Y)=>{let{delayRender:X,continueRender:O,cancelRender:L}=Kb(),{delayPlayback:$}=lh(),[Z,N]=cw(null),[R,F]=cw(null),g=_b(b),v=Ah(),y=Ih({effects:q,overrideId:w?.overrideId??null}),x=sT(a),D=pT(()=>{if(typeof document>"u")return null;return document.createElement("canvas")},[]),C=dT((c)=>{if(N(c),U)U.current=c;if(typeof Y==="function")Y(c);else if(Y)Y.current=c},[Y,U]);return Sw(()=>{let c=Boolean(x?.premounting),I=Boolean(x?.postmounting),H=X(`Rendering <CanvasImage> with src="${gb(g)}"`,{retries:M??void 0,timeoutInMilliseconds:T??void 0}),E=K&&!c&&!I?$().unblock:()=>{return},P=new AbortController,S=!1,V=!1,_=0,l=null;F(null);let u=()=>{if(V)return;V=!0,E(),O(H)},f=()=>{oT({src:g,signal:P.signal}).then((s)=>{if(S)return;F(s)}).then(()=>{if(!S)u()}).catch((s)=>{if(s.name==="AbortError"){u();return}if(_++,_<=Q){let i=eT(_);console.warn(`Could not load <CanvasImage> with src="${gb(g)}", retrying in ${i}ms`),l=setTimeout(()=>{if(!S)f()},i)}else if(z)z(s),u();else L(s)})};return f(),()=>{if(S=!0,l!==null)clearTimeout(l);P.abort(),u()}},[g,L,O,$,X,M,T,Q,z,K,x?.postmounting,x?.premounting]),Sw(()=>{if(!R||!Z||!D)return;let c=X(`Applying effects to <CanvasImage> with src="${gb(g)}"`),I=!1,H=!1,E=()=>{if(H)return;H=!0,O(c)},P=h??R.width,S=j??R.height,V=D.getContext("2d",{colorSpace:"srgb"});if(!V)return L(Error("Could not get 2D context for <CanvasImage> source canvas")),E(),()=>{E()};return D.width=P,D.height=S,Z.width=P,Z.height=S,V.clearRect(0,0,P,S),V.drawImage(R.element,...QB(k,{width:R.width,height:R.height},{width:P,height:S})),Vh({state:v.get(P,S),source:D,effects:y,output:Z,width:P,height:S}).then((_)=>{if(_&&!I)E()}).catch((_)=>{if(I)return;if(z)z(_),E();else L(_)}),()=>{I=!0,E()}},[g,L,v,O,X,k,j,R,y,z,Z,D,h]),ck("canvas",{...W,ref:C,width:h,height:j,className:B,style:G,id:J})});eB.displayName="CanvasImageContent";var rT=oB(({src:b,width:h,height:j,fit:k,effects:q=[],className:w,style:z,id:B,onError:G,pauseWhenLoading:J,maxRetries:K,delayRenderRetries:Q,delayRenderTimeoutInMilliseconds:M,durationInFrames:T,from:U,trimBefore:W,freeze:Y,hidden:X,name:O,showInTimeline:L,stack:$,controls:Z,_remotionInternalDocumentationLink:N,outlineRef:R,...F},g)=>{if(!b)throw Error('No "src" prop was passed to <CanvasImage>.');let v=fh(q),y=aT(null);return iT(g,()=>{return y.current},[]),ck(hb,{layout:"none",from:U??0,trimBefore:W,durationInFrames:T??1/0,freeze:Y,hidden:X,showInTimeline:L??!0,name:O??"<CanvasImage>",_remotionInternalDocumentationLink:N??"https://www.remotion.dev/docs/canvasimage",controls:Z,_remotionInternalEffects:v,_remotionInternalIsMedia:{type:"image",src:b},_remotionInternalStack:$,outlineRef:R??y,children:ck(eB,{ref:y,src:b,width:h,height:j,fit:k,effects:q,controls:Z,className:w,style:z,id:B,onError:G,pauseWhenLoading:J,maxRetries:K,delayRenderRetries:Q,delayRenderTimeoutInMilliseconds:M,refForOutline:R??null,...F})})}),lj=Zb({Component:rT,componentName:"<CanvasImage>",componentIdentity:"dev.remotion.remotion.CanvasImage",schema:nT,supportsEffects:!0});lj.displayName="CanvasImage";bb(lj);var fw=!1,Iw=!1,bU=()=>{if(fw)return;fw=!0,console.warn("Called getStaticFiles() on the server. The API is only available in the browser. An empty array was returned.")},hU=()=>{if(Iw)return;Iw=!0,console.warn("Called getStaticFiles() while using the Remotion Player. The API is only available while using the Remotion Studio. An empty array was returned.")},jU=()=>{if(kq)throw Error("getStaticFiles() has moved into the `@remotion/studio` package. Update your imports.");if(typeof document>"u")return bU(),[];if(window.remotion_isPlayer)return hU(),[];return window.remotion_staticFiles},zU=({onLoad:b,onError:h,delayRenderRetries:j,delayRenderTimeoutInMilliseconds:k,...q},w)=>{let{delayRender:z,continueRender:B}=Kb(),[G]=qU(()=>z(`Loading <IFrame> with source ${q.src}`,{retries:j??void 0,timeoutInMilliseconds:k??void 0})),J=Vw((Q)=>{B(G),b?.(Q)},[G,b,B]),K=Vw((Q)=>{if(B(G),h)h(Q);else console.error("Error loading iframe:",Q,"Handle the event using the onError() prop to make this message disappear.")},[G,h,B]);return wU("iframe",{referrerPolicy:"strict-origin-when-cross-origin",...q,ref:w,onError:K,onLoad:J})},BU=kU(zU);function KU(b){return 1000*2**(b-1)}var MU=({onError:b,maxRetries:h=2,src:j,pauseWhenLoading:k,delayRenderRetries:q,delayRenderTimeoutInMilliseconds:w,onImageFrame:z,crossOrigin:B,decoding:G,ref:J,refForOutline:K,...Q})=>{let M=fk(null),T=fk({}),{delayPlayback:U}=lh(),W=GU(a),Y=!0,X=Uk((y)=>{if(M.current=y,K.current=y,typeof J==="function")J(y);else if(J)J.current=y},[J,K]),O=_b(j),L=Uk((y)=>{if(!M.current)return;let x=M.current.src;setTimeout(()=>{if(!M.current)return;let D=M.current?.src;if(D!==x)return;M.current.removeAttribute("src"),M.current.setAttribute("src",D)},y)},[]),{delayRender:$,continueRender:Z,cancelRender:N}=Kb(),R=Uk((y)=>{if(!T.current)return;if(T.current[M.current?.src]=(T.current[M.current?.src]??0)+1,b&&(T.current[M.current?.src]??0)>h){b(y);return}if((T.current[M.current?.src]??0)<=h){let x=KU(T.current[M.current?.src]??0);console.warn(`Could not load image with source ${gb(M.current?.src)}, retrying again in ${x}ms`),L(x);return}try{N("Error loading image with src: "+gb(M.current?.src))}catch{}},[N,h,b,L]);if(typeof window<"u"){let y=Boolean(W?.premounting),x=Boolean(W?.postmounting);JU(()=>{if(window.process?.env?.NODE_ENV==="test"){if(M.current)M.current.src=O;return}let{current:D}=M;if(!D)return;let C=$("Loading <Img> with src="+gb(O),{retries:q??void 0,timeoutInMilliseconds:w??void 0}),c=k&&!y&&!x?U().unblock:()=>{return},I=!1,H=()=>{if(I){Z(C);return}if((T.current[M.current?.src]??0)>0)delete T.current[M.current?.src],console.info(`Retry successful - ${gb(M.current?.src)} is now loaded`);if(D)z?.(D);c(),Z(C)};if(!M.current){H();return}return D.src=O,D.decode().then(H).catch((E)=>{if(console.warn(E),D.complete&&D.naturalWidth>0&&D.naturalHeight>0)H();else D.addEventListener("load",H)}),()=>{I=!0,D.removeEventListener("load",H),c(),Z(C)}},[O,U,q,w,k,y,x,z,Z,$])}let{isClientSideRendering:F,isRendering:g}=d(),v=Mq({crossOrigin:B,requestsVideoFrame:!1,isClientSideRendering:F});return yh("img",{...Q,ref:X,crossOrigin:v,onError:R,decoding:g?"sync":G})},QU=({hidden:b,name:h,stack:j,showInTimeline:k,src:q,from:w,trimBefore:z,durationInFrames:B,freeze:G,controls:J,outlineRef:K,...Q})=>{if(!q)throw Error('No "src" prop was passed to <Img>.');return yh(hb,{layout:"none",from:w??0,trimBefore:z,durationInFrames:B??1/0,freeze:G,_remotionInternalStack:j,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/img",_remotionInternalIsMedia:{type:"image",src:q},name:h??"<Img>",controls:J,showInTimeline:k??!0,hidden:b,outlineRef:K,children:yh(MU,{src:q,refForOutline:K,...Q})})},TU=lj,UU={...yb,...Yb},WU=new Set(["alt","crossOrigin","decoding","fetchPriority","loading","onError","onImageFrame","onLoad","sizes","srcSet","useMap"]),XU=(b)=>Object.keys(b).filter((h)=>b[h]!==void 0&&WU.has(h)),YU=(b)=>{return b.map((h)=>`"${h}"`).join(", ")},ZU=({props:b,ref:h,width:j,height:k})=>{if(typeof j==="string"||typeof k==="string")throw Error('The "width" and "height" props must be numbers on <Img> when effects are passed, because <Img> renders a <CanvasImage>. Use numeric props or CSS dimensions in "style".');let q=XU(b);if(h!==null&&h!==void 0)q.unshift("ref");if(q.length===0)return;throw Error(`The ${YU(q)} prop${q.length===1?"":"s"} cannot be used on <Img> when effects are passed, because <Img> renders a <canvas> instead of a native <img>. Remove ${q.length===1?"this prop":"these props"}.`)},$U=(b)=>{let h=b?.objectFit;if(h==="fill"||h==="contain"||h==="cover")return h;return},LU=({effects:b=[],ref:h,hidden:j,name:k,stack:q,showInTimeline:w,src:z,from:B,trimBefore:G,durationInFrames:J,freeze:K,controls:Q,width:M,height:T,className:U,style:W,id:Y,pauseWhenLoading:X,maxRetries:O,delayRenderRetries:L,delayRenderTimeoutInMilliseconds:$,...Z})=>{let N=fk(null);if(b.length===0)return yh(QU,{...Z,ref:h,hidden:j,name:k,stack:q,showInTimeline:w,src:z,from:B,trimBefore:G,durationInFrames:J,freeze:K,controls:Q,width:M,height:T,className:U,style:W,id:Y,pauseWhenLoading:X,maxRetries:O,delayRenderRetries:L,delayRenderTimeoutInMilliseconds:$,outlineRef:N});if(!z)throw Error('No "src" prop was passed to <Img>.');ZU({props:Z,ref:h,width:M,height:T});let R=typeof M==="number"?M:void 0,F=typeof T==="number"?T:void 0,g=Z,v=$U(W)??"fill";return yh(TU,{src:z,width:R,height:F,fit:v,effects:b,className:U,style:W,id:Y,pauseWhenLoading:X,maxRetries:O,delayRenderRetries:L,delayRenderTimeoutInMilliseconds:$,from:B,trimBefore:G,durationInFrames:J,freeze:K,hidden:j,name:k??"<Img>",showInTimeline:w,stack:q,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/img",controls:Q,outlineRef:N,...g})},Nq=Zb({Component:LU,componentName:"<Img>",componentIdentity:"dev.remotion.remotion.Img",schema:UU,supportsEffects:!0});bb(Nq);var DU={...yb,...Yb,...ek},FU=(b,h)=>{if(typeof b==="function")b(h);else if(b)b.current=h},A=(b,h)=>{let j=OU((q,w)=>{let{durationInFrames:z,from:B,trimBefore:G,freeze:J,hidden:K,name:Q,showInTimeline:M,stack:T,controls:U,...W}=q,Y=gU(null),X=RU((O)=>{Y.current=O,FU(w,O)},[w]);return yU(hb,{layout:"none",from:B??0,trimBefore:G,durationInFrames:z??1/0,freeze:J,hidden:K,name:Q??h,showInTimeline:M??!0,controls:U,_remotionInternalStack:T,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/interactive",outlineRef:Y,children:NU.createElement(b,{...W,ref:X})})});j.displayName=h;let k=Zb({Component:j,componentName:h,componentIdentity:`dev.remotion.remotion.${h.slice(1,-1)}`,schema:DU,supportsEffects:!1});return k.displayName=h,bb(k),k},vU={baseSchema:yb,transformSchema:Yb,textSchema:ek,premountSchema:Dj,sequenceSchema:hh,withSchema:Zb,A:A("a","<Interactive.A>"),Article:A("article","<Interactive.Article>"),Aside:A("aside","<Interactive.Aside>"),Button:A("button","<Interactive.Button>"),Circle:A("circle","<Interactive.Circle>"),Code:A("code","<Interactive.Code>"),Div:A("div","<Interactive.Div>"),Ellipse:A("ellipse","<Interactive.Ellipse>"),Em:A("em","<Interactive.Em>"),Footer:A("footer","<Interactive.Footer>"),G:A("g","<Interactive.G>"),H1:A("h1","<Interactive.H1>"),H2:A("h2","<Interactive.H2>"),H3:A("h3","<Interactive.H3>"),H4:A("h4","<Interactive.H4>"),H5:A("h5","<Interactive.H5>"),H6:A("h6","<Interactive.H6>"),Header:A("header","<Interactive.Header>"),Label:A("label","<Interactive.Label>"),Li:A("li","<Interactive.Li>"),Line:A("line","<Interactive.Line>"),Main:A("main","<Interactive.Main>"),Nav:A("nav","<Interactive.Nav>"),Ol:A("ol","<Interactive.Ol>"),P:A("p","<Interactive.P>"),Path:A("path","<Interactive.Path>"),Pre:A("pre","<Interactive.Pre>"),Rect:A("rect","<Interactive.Rect>"),Section:A("section","<Interactive.Section>"),Small:A("small","<Interactive.Small>"),Span:A("span","<Interactive.Span>"),Strong:A("strong","<Interactive.Strong>"),Svg:A("svg","<Interactive.Svg>"),Text:A("text","<Interactive.Text>"),Ul:A("ul","<Interactive.Ul>")},rB=EU.createRef(),CU=({children:b,onlyRenderComposition:h,currentCompositionMetadata:j,initialCompositions:k,initialCanvasContent:q})=>{let[w,z]=Wk([]),[B,G]=Wk(q),[J,K]=Wk(k),Q=PU(J),M=Zh((L)=>{K(($)=>{let Z=L($);return Q.current=Z,Z})},[]),T=Zh((L)=>{M(($)=>{if($.find((Z)=>Z.id===L.id))throw Error(`Multiple composition with id ${L.id} are registered.`);return[...$,L]})},[M]),U=Zh((L)=>{K(($)=>{return $.filter((Z)=>Z.id!==L)})},[]),W=Zh((L,$,Z,N)=>{z((R)=>{return[...R,{name:L,parent:$,nonce:Z,stack:N}]})},[]),Y=Zh((L,$)=>{z((Z)=>{return Z.filter((N)=>!(N.name===L&&N.parent===$))})},[]);HU(rB,()=>{return{getCompositions:()=>Q.current}},[]);let X=Aw(()=>{return{registerComposition:T,unregisterComposition:U,registerFolder:W,unregisterFolder:Y,setCanvasContent:G,onlyRenderComposition:h}},[T,W,U,Y,h]),O=Aw(()=>{return{compositions:J,folders:w,currentCompositionMetadata:j,canvasContent:B}},[J,w,j,B]);return _w(jh.Provider,{value:O,children:_w(vh.Provider,{value:X,children:b})})},bG={};kz(bG,{makeDefaultPreviewCSS:()=>cU,injectCSS:()=>SU,OBJECTFIT_CONTAIN_CLASS_NAME:()=>Dh});var hj={},SU=(b)=>{if(typeof document>"u")return()=>{};if(hj[b])return()=>{};let h=document.head||document.getElementsByTagName("head")[0],j=document.createElement("style");return j.appendChild(document.createTextNode(b)),h.prepend(j),hj[b]=j,()=>{let k=hj[b];if(k){if(k.parentNode)k.parentNode.removeChild(k);delete hj[b]}}},Dh="__remotion_objectfitcontain",cU=(b,h)=>{if(!b)return`
|
|
19
|
+
* {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
}
|
|
22
|
+
body {
|
|
23
|
+
margin: 0;
|
|
24
|
+
background-color: ${h};
|
|
25
|
+
}
|
|
26
|
+
.${Dh} {
|
|
27
|
+
object-fit: contain;
|
|
28
|
+
}
|
|
29
|
+
`;return`
|
|
30
|
+
${b} * {
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
}
|
|
33
|
+
${b} *:-webkit-full-screen {
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
}
|
|
37
|
+
${b} .${Dh} {
|
|
38
|
+
object-fit: contain;
|
|
39
|
+
}
|
|
40
|
+
`},hG="__remotion-studio-container",fU=()=>{return document.getElementById(hG)},VU=IU.createContext(null),Fh=null,Jj=[],AU=(b)=>{if(!b)throw Error(`You must pass a React component to registerRoot(), but ${JSON.stringify(b)} was passed.`);if(Fh)throw Error("registerRoot() was called more than once.");Fh=b,Jj.forEach((h)=>{h(b)})},_U=()=>{return Fh},lU=(b)=>{if(Fh)return b(Fh),()=>{return};return Jj.push(b),()=>{Jj=Jj.filter((h)=>h!==b)}},Oq=mU(null),sU=()=>{let b=jG(Oq);if(!b)return window.remotion_videoEnabled;if(b.videoEnabled===null)return window.remotion_videoEnabled;return b.videoEnabled},iU=()=>{let b=jG(Oq);if(!b)return window.remotion_audioEnabled;if(b.audioEnabled===null)return window.remotion_audioEnabled;return b.audioEnabled},pU=({children:b,videoEnabled:h,audioEnabled:j})=>{let k=uU(()=>({videoEnabled:h,audioEnabled:j}),[h,j]);return dU(Oq.Provider,{value:k,children:b})},aU=({children:b,numberOfAudioTags:h,logLevel:j,audioLatencyHint:k,previewSampleRate:q,videoEnabled:w,audioEnabled:z,frameState:B})=>{let G=lw(()=>{let K=0;return{getNonce:()=>K++}},[]),J=lw(()=>{return{logLevel:j,mountTime:Date.now()}},[j]);return Mb(Ab.Provider,{value:J,children:Mb(xh.Provider,{value:G,children:Mb(iJ,{frameState:B,children:Mb(pU,{videoEnabled:w,audioEnabled:z,children:Mb(Xz,{children:Mb(RB,{children:Mb(kK,{children:Mb(DB,{children:Mb(VB,{children:Mb(EB,{audioLatencyHint:k,audioEnabled:z,previewSampleRate:q,children:Mb(HB,{numberOfAudioTags:h,children:b})})})})})})})})})})})},mw=["h264","h265","vp8","vp9","av1","mp3","aac","wav","prores","h264-mkv","h264-ts","gif"];function nU(b,h,j){if(typeof b>"u")return;if(typeof b!=="string")throw TypeError(`The "${j}" prop ${h} must be a string, but you passed a value of type ${typeof b}.`);if(!mw.includes(b))throw Error(`The "${j}" prop ${h} must be one of ${mw.join(", ")}, but you passed ${b}.`)}var uw=({calculated:b,compositionId:h,compositionFps:j,compositionHeight:k,compositionWidth:q,compositionDurationInFrames:w})=>{let z=`calculated by calculateMetadata() for the composition "${h}"`,B=`of the "<Composition />" component with the id "${h}"`,G=b?.width??q??void 0;Qj(G,"width",b?.width?z:B);let J=b?.height??k??void 0;Qj(J,"height",b?.height?z:B);let K=b?.fps??j??null;Nj(K,b?.fps?z:B,!1);let Q=b?.durationInFrames??w??null;Lj(Q,{allowFloats:!1,component:`of the "<Composition />" component with the id "${h}"`});let M=b?.defaultCodec;nU(M,z,"defaultCodec");let T=b?.defaultOutName,U=b?.defaultVideoImageFormat,W=b?.defaultPixelFormat,Y=b?.defaultProResProfile,X=b?.defaultSampleRate;return{width:G,height:J,fps:K,durationInFrames:Q,defaultCodec:M,defaultOutName:T,defaultVideoImageFormat:U,defaultPixelFormat:W,defaultProResProfile:Y,defaultSampleRate:X}},kG=({calculateMetadata:b,signal:h,defaultProps:j,inputProps:k,compositionId:q,compositionDurationInFrames:w,compositionFps:z,compositionHeight:B,compositionWidth:G})=>{let J=b?b({defaultProps:j,props:k,abortSignal:h,compositionId:q,isRendering:o().isRendering}):null;if(J!==null&&typeof J==="object"&&"then"in J)return J.then((Q)=>{let{height:M,width:T,durationInFrames:U,fps:W,defaultCodec:Y,defaultOutName:X,defaultVideoImageFormat:O,defaultPixelFormat:L,defaultProResProfile:$,defaultSampleRate:Z}=uw({calculated:Q,compositionDurationInFrames:w,compositionFps:z,compositionHeight:B,compositionWidth:G,compositionId:q});return{width:T,height:M,fps:W,durationInFrames:U,id:q,defaultProps:cb(j),props:cb(Q.props??k),defaultCodec:Y??null,defaultOutName:X??null,defaultVideoImageFormat:O??null,defaultPixelFormat:L??null,defaultProResProfile:$??null,defaultSampleRate:Z??null}});let K=uw({calculated:J,compositionDurationInFrames:w,compositionFps:z,compositionHeight:B,compositionWidth:G,compositionId:q});if(J===null)return{...K,id:q,defaultProps:cb(j??{}),props:cb(k),defaultCodec:null,defaultOutName:null,defaultVideoImageFormat:null,defaultPixelFormat:null,defaultProResProfile:null,defaultSampleRate:null};return{...K,id:q,defaultProps:cb(j??{}),props:cb(J.props??k),defaultCodec:J.defaultCodec??null,defaultOutName:J.defaultOutName??null,defaultVideoImageFormat:J.defaultVideoImageFormat??null,defaultPixelFormat:J.defaultPixelFormat??null,defaultProResProfile:J.defaultProResProfile??null,defaultSampleRate:J.defaultSampleRate??null}},tU=(b)=>{try{return{type:"success",result:kG(b)}}catch(h){return{type:"error",error:h}}},eU=oU.createContext(()=>{}),rU=()=>{if(o().isRendering){let b=window.remotion_envVariables;if(!b)return{};return{...JSON.parse(b),NODE_ENV:"production"}}return{NODE_ENV:"production"}},bW=()=>{let b=rU();if(!window.process)window.process={};if(!window.process.env)window.process.env={};Object.keys(b).forEach((h)=>{window.process.env[h]=b[h]})},qG=Ik.createContext(null),wG=hW({setSize:()=>{return},size:{size:"auto",translation:{x:0,y:0}}}),zG=({canvasSize:b,compositionHeight:h,compositionWidth:j,previewSize:k})=>{let q=b.height/h,w=b.width/j,z=Math.min(q,w);if(k==="auto"){if(z===0)return 1;return z}return Number(k)},jW=(b)=>{let h=Ik.useContext(qG),j=Ik.useContext(wG),k=Ch(),q=d();if(h===null||k===null||j===null){if(b?.dontThrowIfOutsideOfRemotion)return 1;if(q.isRendering)return 1;throw Error(["useCurrentScale() was called outside of a Remotion context.","This hook can only be called in a component that is being rendered by Remotion.","If you want to this hook to return 1 outside of Remotion, pass {dontThrowIfOutsideOfRemotion: true} as an option.","If you think you called this hook in a Remotion component, make sure all versions of Remotion are aligned."].join(`
|
|
41
|
+
`))}if(h.type==="scale")return h.scale;return zG({canvasSize:h.canvasSize,compositionHeight:k.height,compositionWidth:k.width,previewSize:j.size.size})},BG=kW.createContext(null),qW=()=>{if(typeof window>"u")return 1;return window.devicePixelRatio||1},wW=(b)=>{let h=dw(BG),j=dw(xb);if(h!==null)return h;if(j||b?.dontThrowIfOutsideOfRemotion)return qW();throw Error(["usePixelDensity() was called outside of a Remotion context.","This hook can only be called in a component that is being rendered by Remotion.","If you want this hook to return the browser pixel density outside of Remotion, pass {dontThrowIfOutsideOfRemotion: true} as an option.","If you think you called this hook in a Remotion component, make sure all versions of Remotion are aligned."].join(`
|
|
42
|
+
`))},KW=({src:b,transparent:h,currentTime:j,toneMapped:k})=>{return`http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(Wb(b))}&time=${encodeURIComponent(Math.max(0,j))}&transparent=${String(h)}&toneMapped=${String(k)}`},QW=({onError:b,volume:h,playbackRate:j,src:k,muted:q,allowAmplificationDuringRender:w,transparent:z,toneMapped:B,toneFrequency:G,name:J,loopVolumeCurveBehavior:K,delayRenderRetries:Q,delayRenderTimeoutInMilliseconds:M,onVideoFrame:T,crossOrigin:U,audioStreamIndex:W,preservePitch:Y,...X})=>{let O=Hb(),L=qb(),$=Kh(K),Z=Ch(),N=iw(a),R=Vb(),{registerRenderAsset:F,unregisterRenderAsset:g}=iw(Pb);if(!k)throw TypeError("No `src` was passed to <OffthreadVideo>.");let v=jj(()=>`offthreadvideo-${qh(k)}-${N?.cumulatedFrom}-${N?.relativeFrom}-${N?.durationInFrames}`,[k,N?.cumulatedFrom,N?.relativeFrom,N?.durationInFrames]);if(!Z)throw Error("No video config found");let y=lb({volume:h,frame:$,mediaVolume:1});Qh(y),BW(()=>{if(!k)throw Error("No src passed");if(!window.remotion_audioEnabled)return;if(q)return;if(y<=0)return;return F({type:"video",src:Wb(k),id:v,frame:O,volume:y,mediaFrame:L,playbackRate:j,toneFrequency:G,audioStartFrame:Math.max(0,-(N?.cumulatedNegativeFrom??0)),audioStreamIndex:W}),()=>g(v)},[q,k,F,v,g,y,L,O,j,G,N?.cumulatedNegativeFrom,W]);let x=jj(()=>{return _B({frame:L,playbackRate:j||1,startFrom:-R})/Z.fps},[L,R,j,Z.fps]),D=jj(()=>{return KW({src:k,currentTime:x,transparent:z,toneMapped:B})},[B,x,k,z]),[C,c]=JW(null),{delayRender:I,continueRender:H}=Kb();GW(()=>{if(!window.remotion_videoEnabled)return;let V=[];c(null);let _=new AbortController,l=I(`Fetching ${D} from server`,{retries:Q??void 0,timeoutInMilliseconds:M??void 0});return(async()=>{try{let f=await fetch(D,{signal:_.signal,cache:"no-store"});if(f.status!==200){if(f.status===500){let zb=await f.json();if(zb.error){let Bb=zb.error.replace(/^Error: /,"");throw Error(Bb)}}throw Error(`Server returned status ${f.status} while fetching ${D}`)}let s=await f.blob(),i=URL.createObjectURL(s);V.push(()=>URL.revokeObjectURL(i)),c({src:i,handle:l})}catch(f){if(f.message.includes("aborted")){H(l);return}if(_.signal.aborted){H(l);return}if(f.message.includes("Failed to fetch"))f=Error(`Failed to fetch ${D}. This could be caused by Chrome rejecting the request because the disk space is low. Consider increasing the disk size of your environment.`,{cause:f});if(b)b(f);else bh(f)}})(),V.push(()=>{if(_.signal.aborted)return;_.abort()}),()=>{V.forEach((f)=>f())}},[D,Q,M,b,H,I]);let E=sw(()=>{if(b)b?.(Error("Failed to load image with src "+C));else bh("Failed to load image with src "+C)},[C,b]),P=jj(()=>{return[Dh,X.className].filter(kh).join(" ")},[X.className]),S=sw((V)=>{if(T)T(V)},[T]);if(!C||!window.remotion_videoEnabled)return null;return H(C.handle),MW(Nq,{src:C.src,delayRenderRetries:Q,delayRenderTimeoutInMilliseconds:M,onImageFrame:S,...X,onError:E,className:P})},GG=({ref:b,onVideoFrame:h})=>{XW(()=>{let{current:j}=b;if(!j)return;if(!h)return;let k=0,q=(w,z)=>{if(!b.current)return;h(b.current,w,z),k=b.current.requestVideoFrameCallback(q)};if(h(j),!j.requestVideoFrameCallback)return;return k=j.requestVideoFrameCallback(q),()=>{if(k)j.cancelVideoFrameCallback(k)}},[h,b])};class vb extends Error{src;constructor({message:b,src:h}){super(b);this.name="MediaPlaybackError",this.src=h}}var ZW=(b,h)=>{let j=aw(Jh);if(!j)throw Error("SharedAudioContext not found");let k=tw(null),q=nw(()=>{if(!j.audioContext)return null;return Qq({audioContext:j.audioContext,ref:k})},[j.audioContext]);(pw.useInsertionEffect??pw.useLayoutEffect)(()=>{return()=>{requestAnimationFrame(()=>{q?.cleanup()})}},[q]);let{volume:z,muted:B,playbackRate:G,preservePitch:J,onlyWarnForMediaSeekingError:K,src:Q,onDuration:M,acceptableTimeShift:T,acceptableTimeShiftInSeconds:U,toneFrequency:W,name:Y,_remotionInternalNativeLoopPassed:X,_remotionInternalStack:O,style:L,pauseWhenBuffering:$,showInTimeline:Z,loopVolumeCurveBehavior:N,onError:R,onAutoPlayError:F,onVideoFrame:g,crossOrigin:v,delayRenderRetries:y,delayRenderTimeoutInMilliseconds:x,allowAmplificationDuringRender:D,useWebAudioApi:C,audioStreamIndex:c,...I}=b;if(!1)throw Error("typecheck error");let E=Kh(N??"repeat"),{fps:P,durationInFrames:S}=wb(),V=aw(a),_=Xb(),l=Hh(),[u]=ow(()=>String(Math.random()));if(typeof T<"u")throw Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");let[f]=Xq(),[s]=Yq(),i=lb({frame:E,volume:z,mediaVolume:f});Qh(i);let zb=UW(()=>{return O??null},[O]);Tq({volume:z,mediaVolume:f,mediaType:"video",src:Q,playbackRate:b.playbackRate??1,displayName:Y??null,id:u,getStack:zb,showInTimeline:Z,premountDisplay:V?.premountDisplay??null,postmountDisplay:V?.postmountDisplay??null,loopDisplay:void 0,documentationLink:K?"https://www.remotion.dev/docs/offthreadvideo":"https://www.remotion.dev/docs/html5-video",refForOutline:k}),mB({mediaRef:k,src:Q,mediaType:"video",playbackRate:b.playbackRate??1,preservePitch:J,onlyWarnForMediaSeekingError:K,acceptableTimeshift:U??null,isPremounting:Boolean(V?.premounting),isPostmounting:Boolean(V?.postmounting),pauseWhenBuffering:$,onAutoPlayError:F??null}),uB({id:u,isPostmounting:Boolean(V?.postmounting),isPremounting:Boolean(V?.premounting),mediaRef:k,mediaType:"video",onAutoPlayError:F??null}),CB({logLevel:_,mediaRef:k,volume:i,source:q,shouldUseWebAudioApi:C??!1});let Bb=V?V.relativeFrom:0,Gb=V?Math.min(V.durationInFrames,S):S,t=_b(Q),jb=cQ({actualSrc:t,actualFrom:Bb,duration:Gb,fps:P});WW(h,()=>{return k.current},[]),ow(()=>n({logLevel:_,message:`Mounting video with source = ${jb}, v=${pb}, user agent=${typeof navigator>"u"?"server":navigator.userAgent}`,tag:"video",mountTime:l})),Xk(()=>{let{current:m}=k;if(!m)return;let Db=()=>{if(m.error){if(console.error("Error occurred in video",m?.error),R){let ub=new vb({message:`Code ${m.error.code}: ${m.error.message}`,src:Q});R(ub);return}throw new vb({message:`The browser threw an error while playing the video ${Q}: Code ${m.error.code} - ${m?.error?.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,src:Q})}else{if(R){let ub=new vb({message:`The browser threw an error while playing the video ${Q}`,src:Q});R(ub);return}throw new vb({message:"The browser threw an error while playing the video",src:Q})}};return m.addEventListener("error",Db,{once:!0}),()=>{m.removeEventListener("error",Db)}},[R,Q]);let mb=tw(M);mb.current=M,GG({ref:k,onVideoFrame:g}),Xk(()=>{let{current:m}=k;if(!m)return;if(m.duration){mb.current?.(Q,m.duration);return}let Db=()=>{mb.current?.(Q,m.duration)};return m.addEventListener("loadedmetadata",Db),()=>{m.removeEventListener("loadedmetadata",Db)}},[Q]),Xk(()=>{let{current:m}=k;if(!m)return;if(_j())m.preload="metadata";else m.preload="auto"},[]);let $b=nw(()=>{return{...L}},[L]),Lb=Mq({crossOrigin:v,requestsVideoFrame:Boolean(g),isClientSideRendering:!1});return YW("video",{...I,ref:k,muted:B||s||i<=0,playsInline:!0,src:jb,loop:X,style:$b,disableRemotePlayback:!0,crossOrigin:Lb,controls:!1})},Rq=TW(ZW),gq=(b)=>{let{startFrom:h,endAt:j,trimBefore:k,trimAfter:q,name:w,pauseWhenBuffering:z,stack:B,showInTimeline:G,...J}=b,K=d();if(K.isClientSideRendering)throw Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");let Q=zW(()=>{return},[]);if(typeof b.src!=="string")throw TypeError(`The \`<OffthreadVideo>\` tag requires a string for \`src\`, but got ${JSON.stringify(b.src)} instead.`);Ij({startFrom:h,endAt:j,trimBefore:k,trimAfter:q});let{trimBeforeValue:M,trimAfterValue:T}=Vj({startFrom:h,endAt:j,trimBefore:k,trimAfter:q});if(typeof M<"u"||typeof T<"u")return Nh(hb,{layout:"none",from:0-(M??0),showInTimeline:!1,durationInFrames:T,name:w,children:Nh(gq,{pauseWhenBuffering:z??!1,...J,trimAfter:void 0,name:void 0,showInTimeline:G,trimBefore:void 0,stack:void 0,startFrom:void 0,endAt:void 0})});if(fj(b,"Video"),K.isRendering)return Nh(QW,{pauseWhenBuffering:z??!1,...J,trimAfter:void 0,name:void 0,showInTimeline:G,trimBefore:void 0,stack:void 0,startFrom:void 0,endAt:void 0});let{transparent:U,toneMapped:W,onAutoPlayError:Y,onVideoFrame:X,crossOrigin:O,delayRenderRetries:L,delayRenderTimeoutInMilliseconds:$,...Z}=J;return Nh(Rq,{_remotionInternalStack:B??null,onDuration:Q,onlyWarnForMediaSeekingError:!0,pauseWhenBuffering:z??!1,showInTimeline:G??!0,onAutoPlayError:Y??void 0,onVideoFrame:X??null,crossOrigin:O,...Z,_remotionInternalNativeLoopPassed:!1})},JG=({src:b,acceptableTimeShiftInSeconds:h,allowAmplificationDuringRender:j,audioStreamIndex:k,crossOrigin:q,delayRenderRetries:w,delayRenderTimeoutInMilliseconds:z,loopVolumeCurveBehavior:B,muted:G,name:J,onAutoPlayError:K,onError:Q,onVideoFrame:M,pauseWhenBuffering:T,playbackRate:U,preservePitch:W,showInTimeline:Y,style:X,toneFrequency:O,toneMapped:L,transparent:$,trimAfter:Z,trimBefore:N,useWebAudioApi:R,volume:F,_remotionInternalNativeLoopPassed:g,endAt:v,stack:y,startFrom:x,imageFormat:D,...C})=>{if(D)throw TypeError("The `<OffthreadVideo>` tag does no longer accept `imageFormat`. Use the `transparent` prop if you want to render a transparent video.");return Nh(gq,{acceptableTimeShiftInSeconds:h,allowAmplificationDuringRender:j??!0,audioStreamIndex:k??0,crossOrigin:q,delayRenderRetries:w,delayRenderTimeoutInMilliseconds:z,loopVolumeCurveBehavior:B??"repeat",muted:G??!1,name:J,onAutoPlayError:K??null,onError:Q,onVideoFrame:M,pauseWhenBuffering:T??!0,playbackRate:U??1,preservePitch:W,toneFrequency:O??1,showInTimeline:Y??!0,src:b,stack:y,startFrom:x,_remotionInternalNativeLoopPassed:g??!1,endAt:v,style:X,toneMapped:L??!0,transparent:$??!1,trimAfter:Z,trimBefore:N,useWebAudioApi:R??!1,volume:F,...C})};bb(JG);var Vk="remotion_staticFilesChanged",$W=(b,h)=>{if(kq)throw Error("watchStaticFile() has moved into the `@remotion/studio` package. Update your imports.");if(!o().isStudio)return console.warn("The watchStaticFile() API is only available while using the Remotion Studio."),{cancel:()=>{return}};let j=b.startsWith(window.remotion_staticBase)?b.replace(window.remotion_staticBase,""):b,k=j.startsWith("/")?j.slice(1):j,q=window.remotion_staticFiles.find((B)=>B.name===k),w=(B)=>{let J=B.detail.files.find((K)=>K.name===k);if(!J){if(q!==void 0)h(null);q=void 0;return}if(q===void 0||q.lastModified!==J.lastModified)h(J),q=J};return window.addEventListener(Vk,w),{cancel:()=>{return window.removeEventListener(Vk,w)}}};function NW(){let b=e.useContext(jh),h=e.useContext(zh),j=e.useContext(wh),k=e.useContext(a),q=e.useContext(xh),w=e.useContext(xb),z=e.useContext(cj),B=e.useContext(Oj),G=e.useContext(Pb),J=e.useContext(Gh),K=e.useContext(Fj),Q=e.useContext(xj),M=e.useContext(Mh),T=e.useContext(Ab);return LW(()=>({compositionManagerCtx:b,timelineContext:h,setTimelineContext:j,sequenceContext:k,nonceContext:q,canUseRemotionHooksContext:w,preloadContext:z,resolveCompositionContext:B,renderAssetManagerContext:G,sequenceManagerContext:J,sequenceManagerRefContext:K,visualModePropStatusesRefContext:Q,bufferManagerContext:M,logLevelContext:T}),[b,q,k,j,h,w,z,B,G,J,K,Q,M,T])}var OW=(b)=>{let{children:h,contexts:j}=b;return r(Ab.Provider,{value:j.logLevelContext,children:r(xb.Provider,{value:j.canUseRemotionHooksContext,children:r(xh.Provider,{value:j.nonceContext,children:r(cj.Provider,{value:j.preloadContext,children:r(jh.Provider,{value:j.compositionManagerCtx,children:r(Fj.Provider,{value:j.sequenceManagerRefContext,children:r(Gh.Provider,{value:j.sequenceManagerContext,children:r(xj.Provider,{value:j.visualModePropStatusesRefContext,children:r(Pb.Provider,{value:j.renderAssetManagerContext,children:r(Oj.Provider,{value:j.resolveCompositionContext,children:r(zh.Provider,{value:j.timelineContext,children:r(wh.Provider,{value:j.setTimelineContext,children:r(a.Provider,{value:j.sequenceContext,children:r(Mh.Provider,{value:j.bufferManagerContext,children:h})})})})})})})})})})})})})})},RW=xU(),gW={MaxMediaCacheSizeContext:VU,useUnsafeVideoConfig:Ch,useFrameForVolumeProp:Kh,useTimelinePosition:Hb,useAbsoluteTimelinePosition:Hz,evaluateVolume:lb,getAbsoluteSrc:Wb,getAssetDisplayName:cB,Timeline:gk,validateMediaTrimProps:Ij,validateMediaProps:fj,resolveTrimProps:Vj,VideoForPreview:Rq,CompositionManager:jh,CompositionSetters:vh,VisualModePropStatusesContext:vj,VisualModePropStatusesRefContext:xj,VisualModeDragOverridesContext:Ej,VisualModeSettersContext:Az,SequenceManager:Gh,SequenceManagerRefContext:Fj,SequenceStackTracesUpdateContext:eU,baseSchema:yb,sequenceSchema:hh,SequenceWithoutSchema:KB,sequenceStyleSchema:Sz,sequenceVisualStyleSchema:tJ,sequencePremountSchema:oJ,textSchema:ek,transformSchema:Yb,premountSchema:Dj,flattenActiveSchema:Bq,getFlatSchemaWithAllKeys:Gq,RemotionRootContexts:aU,CompositionManagerProvider:CU,useVideo:gj,getRoot:_U,useMediaVolumeState:Xq,usePlayerMutedState:Yq,useMediaInTimeline:Tq,useLazyComponent:Oz,truthy:kh,SequenceContext:a,PremountContext:Vz,useRemotionContexts:NW,RemotionContextProvider:OW,CSSUtils:bG,setupEnvVariables:bW,MediaVolumeContext:Uq,SetMediaVolumeContext:Wq,getRemotionEnvironment:o,SharedAudioContext:Jh,SharedAudioContextProvider:EB,SharedAudioTagsContext:Aj,SharedAudioTagsContextProvider:HB,invalidCompositionErrorMessage:HJ,invalidFolderNameErrorMessage:SG,calculateMediaDuration:Sj,isCompositionIdValid:gz,isFolderNameValid:Jz,getPreviewDomElement:fU,compositionsRef:rB,portalNode:Nk,waitForRoot:lU,SetTimelineContext:wh,CanUseRemotionHooksProvider:Zk,CanUseRemotionHooks:xb,PrefetchProvider:RB,DurationsContextProvider:DB,IsPlayerContextProvider:lG,useIsPlayer:$j,EditorPropsProvider:Xz,EditorPropsContext:lk,usePreload:_b,NonceContext:xh,resolveVideoConfig:kG,resolveVideoConfigOrCatch:tU,ResolveCompositionContext:Oj,useResolvedVideoConfig:mk,resolveCompositionsRef:GJ,REMOTION_STUDIO_CONTAINER_ELEMENT:hG,RenderAssetManager:Pb,persistCurrentFrame:Dz,usePlaybackRate:tk,useTimelineContext:Eb,useTimelineSetFrame:Pz,isIosSafari:_j,WATCH_REMOTION_STATIC_FILES:Vk,addSequenceStackTraces:bb,useMediaStartsAt:Vb,BufferingProvider:VB,BufferingContextReact:Mh,getComponentsToAddStacksTo:cJ,CurrentScaleContext:qG,PixelDensityContext:BG,PreviewSizeContext:wG,calculateScale:zG,validateRenderAsset:$B,Log:p,LogLevelContext:Ab,useLogLevel:Xb,playbackLogging:n,timeValueRef:qJ,compositionSelectorRef:RW,RemotionEnvironmentContext:Yz,warnAboutTooHighVolume:Qh,AudioForPreview:iB,OBJECTFIT_CONTAIN_CLASS_NAME:Dh,InnerOffthreadVideo:gq,useBasicMediaInTimeline:fB,getInputPropsOverride:Tz,setInputPropsOverride:eG,useVideoEnabled:sU,useAudioEnabled:iU,useIsPlayerBuffering:AB,TimelinePosition:gk,DelayRenderContextType:Nz,TimelineContext:zh,PlaybackRateContext:pk,AbsoluteTimeContext:ak,RenderAssetManagerProvider:sM,getEffectiveVisualModeValue:jB,CompositionRenderErrorContext:wz,useEffectChainState:Ah,createEffectChainState:XB,cleanupEffectChainState:Dk,runEffectChain:Vh,useMemoizedEffects:Ih,useMemoizedEffectDefinitions:fh,createEffect:ZB,createWebGLContextError:YM,createWebGL2ContextError:UB,computeEffectiveSchemaValuesDotNotation:GB,interpolateKeyframedStatus:ch,makeStaticDragOverride:tK,makeKeyframedDragOverride:oK,resolveDragOverrideValue:Pj,getStaticDragOverrideValue:eK,OverrideIdsToNodePathsGettersContext:zq,OverrideIdsToNodePathsSettersContext:iK,findPropsToDelete:zB,makeSequencePropsSubscriptionKey:Ob,getPropStatusesCtx:wB,getEffectPropStatusesCtx:qB,hiddenField:rk,durationInFramesField:hq,freezeField:jq,fromField:fz},KG=(b)=>{return ew.Children.toArray(b).reduce((j,k)=>{if(k.type===ew.Fragment)return j.concat(KG(k.props.children));return j.push(k),j},[])},vW=({children:b},h)=>{return BK(),Kj(zK,{children:b})},MG=DW(vW),xW=KB,EW=(b)=>{let h=FW(()=>{let j=0,k=KG(b.children);return yW.map(k,(q,w)=>{let z=q;if(typeof z==="string"){if(z.trim()==="")return null;throw TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but you passed a string "${z}"`)}if(z.type!==MG)throw TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${z} instead`);let B=`index = ${w}, duration = ${z.props.durationInFrames}`,G=z.props.durationInFrames,{durationInFrames:J,children:K,from:Q,name:M,...T}=z.props;if(w!==k.length-1||G!==1/0)Lj(G,{component:"of a <Series.Sequence /> component",allowFloats:!0});let U=z.props.offset??0;if(Number.isNaN(U))throw TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${B}).`);if(!Number.isFinite(U))throw TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${U} (${B}).`);if(U%1!==0)throw TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${U} (${B}).`);let W=j+U;return j+=G+U,Kj(xW,{ref:z.ref,name:M||"<Series.Sequence>",_remotionInternalDocumentationLink:M?void 0:"https://www.remotion.dev/docs/series",from:W,durationInFrames:G,...T,children:q})})},[b.children]);return Kj(wK,{children:Kj(hb,{layout:"none",name:"<Series>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/series",...b,children:h})})},QG=Object.assign(Zb({Component:EW,componentName:"<Series>",componentIdentity:"dev.remotion.remotion.Series",schema:hK,supportsEffects:!1}),{Sequence:MG});bb(QG);var HW={"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";"},rw={},PW=(b)=>{if(rw[b])return;console.warn(b),rw[b]=!0},CW=(b)=>{for(let h of Object.keys(HW))if(b.includes(h))return{containsHex:!0,hexCode:h};return{containsHex:!1}},Ak=(b)=>{if(b.startsWith("/"))return Ak(b.substring(1));return b},SW=(b)=>{if(typeof window<"u"&&window.remotion_staticBase){if(b.startsWith(window.remotion_staticBase))throw Error(`The value "${b}" is already prefixed with the static base ${window.remotion_staticBase}. You don't need to call staticFile() on it.`);return`${window.remotion_staticBase}/${Ak(b)}`}return`/${Ak(b)}`},cW=(b)=>{return b.split("/").map((q)=>{return encodeURIComponent(q)}).join("/")},fW=(b)=>{if(b===null)throw TypeError("null was passed to staticFile()");if(typeof b>"u")throw TypeError("undefined was passed to staticFile()");if(b.startsWith("http://")||b.startsWith("https://"))throw TypeError(`staticFile() does not support remote URLs - got "${b}". Instead, pass the URL without wrapping it in staticFile(). See: https://remotion.dev/docs/staticfile-remote-urls`);if(b.startsWith("..")||b.startsWith("./"))throw TypeError(`staticFile() does not support relative paths - got "${b}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);if(b.startsWith("/Users")||b.startsWith("/home")||b.startsWith("/tmp")||b.startsWith("/etc")||b.startsWith("/opt")||b.startsWith("/var")||b.startsWith("C:")||b.startsWith("D:")||b.startsWith("E:"))throw TypeError(`staticFile() does not support absolute paths - got "${b}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);if(b.startsWith("public/"))throw TypeError(`Do not include the public/ prefix when using staticFile() - got "${b}". See: https://remotion.dev/docs/staticfile-relative-paths`);let h=CW(b);if(h.containsHex)PW(`WARNING: You seem to pass an already encoded path (path contains ${h.hexCode}). Since Remotion 4.0, the encoding is done by staticFile() itself. You may want to remove a encodeURIComponent() wrapping.`);let j=cW(b),k=SW(j);if(!k.startsWith("/"))return`/${k}`;return k},VW=(b)=>{let h={...b,durationInFrames:1,fps:1};return IW.createElement(sk,h)},jz=(b)=>{return Math.round(b*1e5)/1e5},Yk=({element:b,desiredTime:h,logLevel:j,mountTime:k})=>{if(Xj(b.currentTime,h))return{wait:Promise.resolve(h),cancel:()=>{}};Gj({logLevel:j,mediaRef:b,time:h,why:"Seeking during rendering",mountTime:k});let q,w=null,z=new Promise((G)=>{q=b.requestVideoFrameCallback((J,K)=>{let Q=K.expectedDisplayTime-J;if(Q<=0){G(K.mediaTime);return}setTimeout(()=>{G(K.mediaTime)},Q+150)})}),B=new Promise((G)=>{let J=()=>{G()};b.addEventListener("seeked",J,{once:!0}),w=()=>{b.removeEventListener("seeked",J)}});return{wait:Promise.all([z,B]).then(([G])=>G),cancel:()=>{w?.(),b.cancelVideoFrameCallback(q)}}},pW=({element:b,desiredTime:h,fps:j,logLevel:k,mountTime:q})=>{let w=1/j/2,z=()=>{return};if(Number.isFinite(b.duration)&&b.currentTime>=b.duration&&h>=b.duration)return{prom:Promise.resolve(),cancel:()=>{}};return{prom:new Promise((G,J)=>{let K=Yk({element:b,desiredTime:h+w,logLevel:k,mountTime:q});K.wait.then((Q)=>{if(Math.abs(h-Q)<=w)return G();let T=h>Q?1:-1,U=Yk({element:b,desiredTime:Q+w*T,logLevel:k,mountTime:q});z=U.cancel,U.wait.then((W)=>{let Y=Math.abs(h-W);if(jz(Y)<=jz(w))return G();let X=Yk({element:b,desiredTime:h+w,logLevel:k,mountTime:q});return z=X.cancel,X.wait.then(()=>{G()}).catch((O)=>{J(O)})}).catch((W)=>{J(W)})}),z=K.cancel}),cancel:()=>{z()}}},nW=({onError:b,volume:h,allowAmplificationDuringRender:j,playbackRate:k,onDuration:q,toneFrequency:w,name:z,acceptableTimeShiftInSeconds:B,delayRenderRetries:G,delayRenderTimeoutInMilliseconds:J,loopVolumeCurveBehavior:K,audioStreamIndex:Q,onVideoFrame:M,preservePitch:T,...U},W)=>{let Y=Hb(),X=qb(),O=Kh(K??"repeat"),L=Ch(),$=iW(null),Z=bz(a),N=Vb(),R=d(),F=Xb(),g=Hh(),{delayRender:v,continueRender:y}=Kb(),{registerRenderAsset:x,unregisterRenderAsset:D}=bz(Pb),C=sW(()=>`video-${qh(U.src??"")}-${Z?.cumulatedFrom}-${Z?.relativeFrom}-${Z?.durationInFrames}`,[U.src,Z?.cumulatedFrom,Z?.relativeFrom,Z?.durationInFrames]);if(!L)throw Error("No video config found");let c=lb({volume:h,frame:O,mediaVolume:1});Qh(c),hz(()=>{if(!U.src)throw Error("No src passed");if(U.muted)return;if(c<=0)return;if(!window.remotion_audioEnabled)return;return x({type:"video",src:Wb(U.src),id:C,frame:Y,volume:c,mediaFrame:X,playbackRate:k??1,toneFrequency:w??1,audioStartFrame:Math.max(0,-(Z?.cumulatedNegativeFrom??0)),audioStreamIndex:Q??0}),()=>D(C)},[U.muted,U.src,x,C,D,c,X,Y,k,w,Z?.cumulatedNegativeFrom,Q]),uW(W,()=>{return $.current},[]),GG({ref:$,onVideoFrame:M}),hz(()=>{if(!window.remotion_videoEnabled)return;let{current:H}=$;if(!H)return;let E=lB({frame:X,playbackRate:k||1,startFrom:-N,fps:L.fps}),P=v(`Rendering <Html5Video /> with src="${U.src}" at time ${E}`,{retries:G??void 0,timeoutInMilliseconds:J??void 0});if(window.process?.env?.NODE_ENV==="test"){y(P);return}if(Xj(H.currentTime,E)){if(H.readyState>=2){y(P);return}let l=()=>{y(P)};return H.addEventListener("loadeddata",l,{once:!0}),()=>{H.removeEventListener("loadeddata",l)}}let S=()=>{y(P)},V=pW({element:H,desiredTime:E,fps:L.fps,logLevel:F,mountTime:g});V.prom.then(()=>{y(P)}),H.addEventListener("ended",S,{once:!0});let _=()=>{if(H?.error){if(console.error("Error occurred in video",H?.error),b)return;throw new vb({message:`The browser threw an error while playing the video ${U.src}: Code ${H.error.code} - ${H?.error?.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,src:U.src})}else throw new vb({message:"The browser threw an error",src:U.src})};return H.addEventListener("error",_,{once:!0}),()=>{V.cancel(),H.removeEventListener("ended",S),H.removeEventListener("error",_),y(P)}},[O,U.src,k,L.fps,X,N,b,G,J,F,g,y,v]);let{src:I}=U;if(R.isRendering)dW(()=>{if(window.process?.env?.NODE_ENV==="test")return;let H=v("Loading <Html5Video> duration with src="+I,{retries:G??void 0,timeoutInMilliseconds:J??void 0}),{current:E}=$,P=()=>{if(E?.duration)q(I,E.duration);y(H)};if(E?.duration)q(I,E.duration),y(H);else E?.addEventListener("loadedmetadata",P,{once:!0});return()=>{E?.removeEventListener("loadedmetadata",P),y(H)}},[I,q,G,J,y,v]);return aW("video",{ref:$,disableRemotePlayback:!0,...U})},tW=mW(nW),oW=(b,h)=>{let{startFrom:j,endAt:k,trimBefore:q,trimAfter:w,name:z,pauseWhenBuffering:B,stack:G,_remotionInternalNativeLoopPassed:J,showInTimeline:K,onAutoPlayError:Q,onVideoFrame:M,...T}=b,{loop:U,...W}=b,{fps:Y}=wb(),X=d();if(X.isClientSideRendering)throw Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");let{durations:O,setDurations:L}=lW(Kq);if(typeof h==="string")throw Error("string refs are not supported");if(typeof b.src!=="string")throw TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(b.src)} instead.`);let $=_b(b.src),Z=_W((g,v)=>{L({type:"got-duration",durationInSeconds:v,src:g})},[L]),N=O[Wb($)]??O[Wb(b.src)];Ij({startFrom:j,endAt:k,trimBefore:q,trimAfter:w});let{trimBeforeValue:R,trimAfterValue:F}=Vj({startFrom:j,endAt:k,trimBefore:q,trimAfter:w});if(U&&N!==void 0){if(!Number.isFinite(N))return Sb(rb,{...W,ref:h,stack:G,_remotionInternalNativeLoopPassed:!0});let g=N*Y;return Sb(_h,{durationInFrames:Sj({trimAfter:F,mediaDurationInFrames:g,playbackRate:b.playbackRate??1,trimBefore:R}),layout:"none",name:z,showInTimeline:!1,children:Sb(rb,{...W,ref:h,stack:G,_remotionInternalNativeLoopPassed:!0})})}if(typeof R<"u"||typeof F<"u")return Sb(hb,{layout:"none",from:0-(R??0),showInTimeline:!1,durationInFrames:F===void 0?void 0:F/(b.playbackRate??1),name:z,children:Sb(rb,{pauseWhenBuffering:B??!1,onVideoFrame:M,...T,ref:h,stack:G})});if(fj({playbackRate:b.playbackRate,preservePitch:b.preservePitch,volume:b.volume},"Html5Video"),X.isRendering)return Sb(tW,{onDuration:Z,onVideoFrame:M??null,...T,ref:h});return Sb(Rq,{onlyWarnForMediaSeekingError:!1,...T,ref:h,onVideoFrame:M??null,pauseWhenBuffering:B??!1,onDuration:Z,_remotionInternalStack:G??null,_remotionInternalNativeLoopPassed:J??!1,showInTimeline:K??!0,onAutoPlayError:Q??void 0})},rb=AW(oW);bb(rb);var eW=rb;fJ();var rW={Clipper:NG,Null:IJ,useIsPlayer:$j},bX={},TG=new Proxy(bX,{get(b,h){if(h==="Bundling"||h==="Rendering"||h==="Log"||h==="Puppeteer"||h==="Output")return TG;return()=>{console.warn("⚠️ The CLI configuration has been extracted from Remotion Core."),console.warn("Update the import from the config file:"),console.warn(),console.warn("- Delete:"),console.warn('import {Config} from "remotion";'),console.warn("+ Replace:"),console.warn('import {Config} from "@remotion/cli/config";'),console.warn(),console.warn("For more information, see https://www.remotion.dev/docs/4-0-migration."),process.exit(1)}}});hb.displayName="Sequence";bb(hb);bb(sk);bb(Kz);var{AbsoluteFill:LZ,AnimatedImage:NZ,Artifact:OZ,Audio:RZ,CanvasImage:gZ,Composition:yZ,Config:DZ,Easing:FZ,Experimental:vZ,Folder:xZ,FolderContext:EZ,Freeze:HZ,HTML_IN_CANVAS_UNSUPPORTED_MESSAGE:PZ,Html5Audio:CZ,Html5Video:SZ,HtmlInCanvas:cZ,IFrame:fZ,Img:IZ,Interactive:VZ,Internals:AZ,Loop:_Z,MediaPlaybackError:lZ,OffthreadVideo:mZ,Sequence:uZ,Series:dZ,Solid:sZ,Still:iZ,VERSION:pZ,Video:aZ,assertValidInterpolateEasingOption:nZ,assertValidInterpolatePosterizeOption:tZ,cancelRender:oZ,continueRender:eZ,createEffect:rZ,delayRender:b0,getInputProps:h0,getRemotionEnvironment:j0,getStaticFiles:k0,interpolate:q0,interpolateColors:w0,isHtmlInCanvasSupported:z0,measureSpring:B0,prefetch:G0,random:J0,registerRoot:K0,spring:M0,staticFile:Q0,useBufferState:T0,useCurrentFrame:U0,useCurrentScale:W0,useDelayRender:X0,usePixelDensity:Y0,useRemotionEnvironment:Z0,useVideoConfig:$0,watchStaticFile:L0}=mj;var O0=mj;export{L0 as watchStaticFile,$0 as useVideoConfig,Z0 as useRemotionEnvironment,Y0 as usePixelDensity,X0 as useDelayRender,W0 as useCurrentScale,U0 as useCurrentFrame,T0 as useBufferState,Q0 as staticFile,M0 as spring,K0 as registerRoot,J0 as random,G0 as prefetch,B0 as measureSpring,z0 as isHtmlInCanvasSupported,w0 as interpolateColors,q0 as interpolate,k0 as getStaticFiles,j0 as getRemotionEnvironment,h0 as getInputProps,b0 as delayRender,O0 as default,rZ as createEffect,eZ as continueRender,oZ as cancelRender,tZ as assertValidInterpolatePosterizeOption,nZ as assertValidInterpolateEasingOption,aZ as Video,pZ as VERSION,iZ as Still,sZ as Solid,dZ as Series,uZ as Sequence,mZ as OffthreadVideo,lZ as MediaPlaybackError,_Z as Loop,AZ as Internals,VZ as Interactive,IZ as Img,fZ as IFrame,cZ as HtmlInCanvas,SZ as Html5Video,CZ as Html5Audio,PZ as HTML_IN_CANVAS_UNSUPPORTED_MESSAGE,HZ as Freeze,EZ as FolderContext,xZ as Folder,vZ as Experimental,FZ as Easing,DZ as Config,yZ as Composition,gZ as CanvasImage,RZ as Audio,OZ as Artifact,NZ as AnimatedImage,LZ as AbsoluteFill};
|