>>1;tef(F,W))Jf($,F)?(S[te]=$,S[J]=W,te=J):(S[te]=F,S[U]=W,te=U);else if(Jf($,W))S[te]=$,S[J]=W,te=J;else break e}}return k}function f(S,k){var W=S.sortIndex-k.sortIndex;return W!==0?W:S.id-k.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var g=performance;a.unstable_now=function(){return g.now()}}else{var Q=Date,B=Q.now();a.unstable_now=function(){return Q.now()-B}}var E=[],d=[],v=1,m=null,y=3,b=!1,T=!1,x=!1,O=!1,j=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function X(S){for(var k=o(d);k!==null;){if(k.callback===null)u(d);else if(k.startTime<=S)u(d),k.sortIndex=k.expirationTime,l(E,k);else break;k=o(d)}}function P(S){if(x=!1,X(S),!T)if(o(E)!==null)T=!0,L||(L=!0,re());else{var k=o(d);k!==null&&Ce(P,k.startTime-S)}}var L=!1,R=-1,K=5,_=-1;function ee(){return O?!0:!(a.unstable_now()-_S&&ee());){var te=m.callback;if(typeof te=="function"){m.callback=null,y=m.priorityLevel;var ge=te(m.expirationTime<=S);if(S=a.unstable_now(),typeof ge=="function"){m.callback=ge,X(S),k=!0;break t}m===o(E)&&u(E),X(S)}else u(E);m=o(E)}if(m!==null)k=!0;else{var p=o(d);p!==null&&Ce(P,p.startTime-S),k=!1}}break e}finally{m=null,y=W,b=!1}k=void 0}}finally{k?re():L=!1}}}var re;if(typeof D=="function")re=function(){D(ie)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,Ee=ce.port2;ce.port1.onmessage=ie,re=function(){Ee.postMessage(null)}}else re=function(){j(ie,0)};function Ce(S,k){R=j(function(){S(a.unstable_now())},k)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(S){S.callback=null},a.unstable_forceFrameRate=function(S){0>S||125te?(S.sortIndex=W,l(d,S),o(E)===null&&S===o(d)&&(x?(Z(R),R=-1):x=!0,Ce(P,W-te))):(S.sortIndex=ge,l(E,S),T||b||(T=!0,L||(L=!0,re()))),S},a.unstable_shouldYield=ee,a.unstable_wrapCallback=function(S){var k=y;return function(){var W=y;y=k;try{return S.apply(this,arguments)}finally{y=W}}}})(Pi)),Pi}var lc;function PC(){return lc||(lc=1,qi.exports=qC()),qi.exports}var Zi={exports:{}},Et={};var ic;function ZC(){if(ic)return Et;ic=1;var a=Ui();function l(E){var d="https://react.dev/errors/"+E;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),Zi.exports=ZC(),Zi.exports}var sc;function GC(){if(sc)return Ya;sc=1;var a=PC(),l=Ui(),o=uc();function u(e){var t="https://react.dev/errors/"+e;if(1ge||(e.current=te[ge],te[ge]=null,ge--)}function F(e,t){ge++,te[ge]=e.current,e.current=t}var J=p(null),$=p(null),le=p(null),Ae=p(null);function xe(e,t){switch(F(le,t),F($,e),F(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?cC(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=cC(t),e=fC(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(J),F(J,e)}function be(){U(J),U($),U(le)}function Pe(e){e.memoizedState!==null&&F(Ae,e);var t=J.current,n=fC(t,e.type);t!==n&&(F($,e),F(J,n))}function nt(e){$.current===e&&(U(J),U($)),Ae.current===e&&(U(Ae),Yr._currentValue=W)}var qt,Nt;function vt(e){if(qt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);qt=t&&t[1]||"",Nt=-1)":-1r||I[A]!==M[r]){var q=`
`+I[A].replace(" at new "," at ");return e.displayName&&q.includes("")&&(q=q.replace("",e.displayName)),q}while(1<=A&&0<=r);break}}}finally{Ne=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?vt(n):""}function rn(e,t){switch(e.tag){case 26:case 27:case 5:return vt(e.type);case 16:return vt("Lazy");case 13:return e.child!==t&&t!==null?vt("Suspense Fallback"):vt("Suspense");case 19:return vt("SuspenseList");case 0:case 15:return oe(e.type,!1);case 11:return oe(e.type.render,!1);case 1:return oe(e.type,!0);case 31:return vt("Activity");default:return""}}function fn(e){try{var t="",n=null;do t+=rn(e,n),n=e,e=e.return;while(e);return t}catch(A){return`
Error generating stack: `+A.message+`
`+A.stack}}var Mt=Object.prototype.hasOwnProperty,Pt=a.unstable_scheduleCallback,hn=a.unstable_cancelCallback,Zt=a.unstable_shouldYield,ht=a.unstable_requestPaint,lt=a.unstable_now,gn=a.unstable_getCurrentPriorityLevel,In=a.unstable_ImmediatePriority,Fn=a.unstable_UserBlockingPriority,Gt=a.unstable_NormalPriority,pn=a.unstable_LowPriority,ln=a.unstable_IdlePriority,Wn=a.log,yl=a.unstable_setDisableYieldValue,It=null,st=null;function dn(e){if(typeof Wn=="function"&&yl(e),st&&typeof st.setStrictMode=="function")try{st.setStrictMode(It,e)}catch{}}var Qt=Math.clz32?Math.clz32:Po,bl=Math.log,qo=Math.LN2;function Po(e){return e>>>=0,e===0?32:31-(bl(e)/qo|0)|0}var ra=256,la=262144,ia=4194304;function yn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function oa(e,t,n){var A=e.pendingLanes;if(A===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var C=A&134217727;return C!==0?(A=C&~i,A!==0?r=yn(A):(s&=C,s!==0?r=yn(s):n||(n=C&~e,n!==0&&(r=yn(n))))):(C=A&~i,C!==0?r=yn(C):s!==0?r=yn(s):n||(n=A&~e,n!==0&&(r=yn(n)))),r===0?0:t!==0&&t!==r&&(t&i)===0&&(i=r&-r,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:r}function En(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ua(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wl(){var e=ia;return ia<<=1,(ia&62914560)===0&&(ia=4194304),e}function rr(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Cn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function xl(e,t,n,A,r,i){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var C=e.entanglements,I=e.expirationTimes,M=e.hiddenUpdates;for(n=s&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var wh=/[\n"\\]/g;function Ft(e){return e.replace(wh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Jo(e,t,n,A,r,i,s,C){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Yt(t)):e.value!==""+Yt(t)&&(e.value=""+Yt(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?_o(e,s,Yt(t)):n!=null?_o(e,s,Yt(n)):A!=null&&e.removeAttribute("value"),r==null&&i!=null&&(e.defaultChecked=!!i),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?e.name=""+Yt(C):e.removeAttribute("name")}function rg(e,t,n,A,r,i,s,C){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||n!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){Ko(e);return}n=n!=null?""+Yt(n):"",t=t!=null?""+Yt(t):n,C||t===e.value||(e.value=t),e.defaultValue=t}A=A??r,A=typeof A!="function"&&typeof A!="symbol"&&!!A,e.checked=C?e.checked:!!A,e.defaultChecked=!!A,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),Ko(e)}function _o(e,t,n){t==="number"&&Nl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function da(e,t,n,A){if(e=e.options,t){t={};for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Au=!1;if(xn)try{var cr={};Object.defineProperty(cr,"passive",{get:function(){Au=!0}}),window.addEventListener("test",cr,cr),window.removeEventListener("test",cr,cr)}catch{Au=!1}var Kn=null,au=null,Vl=null;function fg(){if(Vl)return Vl;var e,t=au,n=t.length,A,r="value"in Kn?Kn.value:Kn.textContent,i=r.length;for(e=0;e=dr),Bg=" ",mg=!1;function vg(e,t){switch(e){case"keyup":return eI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ba=!1;function nI(e,t){switch(e){case"compositionend":return hg(t);case"keypress":return t.which!==32?null:(mg=!0,Bg);case"textInput":return e=t.data,e===Bg&&mg?null:e;default:return null}}function AI(e,t){if(Ba)return e==="compositionend"||!uu&&vg(e,t)?(e=fg(),Vl=au=Kn=null,Ba=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=A}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Tg(n)}}function Ng(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ng(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nl(e.document)}return t}function fu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var cI=xn&&"documentMode"in document&&11>=document.documentMode,ma=null,gu=null,Br=null,du=!1;function Vg(e,t,n){var A=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;du||ma==null||ma!==Nl(A)||(A=ma,"selectionStart"in A&&fu(A)?A={start:A.selectionStart,end:A.selectionEnd}:(A=(A.ownerDocument&&A.ownerDocument.defaultView||window).getSelection(),A={anchorNode:A.anchorNode,anchorOffset:A.anchorOffset,focusNode:A.focusNode,focusOffset:A.focusOffset}),Br&&Qr(Br,A)||(Br=A,A=wi(gu,"onSelect"),0>=s,r-=s,Qn=1<<32-Qt(t)+r|n<me?(ye=ae,ae=null):ye=ae.sibling;var ze=V(z,ae,N[me],G);if(ze===null){ae===null&&(ae=ye);break}e&&ae&&ze.alternate===null&&t(z,ae),w=i(ze,w,me),Te===null?ue=ze:Te.sibling=ze,Te=ze,ae=ye}if(me===N.length)return n(z,ae),we&&Tn(z,me),ue;if(ae===null){for(;meme?(ye=ae,ae=null):ye=ae.sibling;var BA=V(z,ae,ze.value,G);if(BA===null){ae===null&&(ae=ye);break}e&&ae&&BA.alternate===null&&t(z,ae),w=i(BA,w,me),Te===null?ue=BA:Te.sibling=BA,Te=BA,ae=ye}if(ze.done)return n(z,ae),we&&Tn(z,me),ue;if(ae===null){for(;!ze.done;me++,ze=N.next())ze=Y(z,ze.value,G),ze!==null&&(w=i(ze,w,me),Te===null?ue=ze:Te.sibling=ze,Te=ze);return we&&Tn(z,me),ue}for(ae=A(ae);!ze.done;me++,ze=N.next())ze=H(ae,z,me,ze.value,G),ze!==null&&(e&&ze.alternate!==null&&ae.delete(ze.key===null?me:ze.key),w=i(ze,w,me),Te===null?ue=ze:Te.sibling=ze,Te=ze);return e&&ae.forEach(function(Np){return t(z,Np)}),we&&Tn(z,me),ue}function Oe(z,w,N,G){if(typeof N=="object"&&N!==null&&N.type===x&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case b:e:{for(var ue=N.key;w!==null;){if(w.key===ue){if(ue=N.type,ue===x){if(w.tag===7){n(z,w.sibling),G=r(w,N.props.children),G.return=z,z=G;break e}}else if(w.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===K&&OA(ue)===w.type){n(z,w.sibling),G=r(w,N.props),yr(G,N),G.return=z,z=G;break e}n(z,w);break}else t(z,w);w=w.sibling}N.type===x?(G=VA(N.props.children,z.mode,G,N.key),G.return=z,z=G):(G=ql(N.type,N.key,N.props,null,z.mode,G),yr(G,N),G.return=z,z=G)}return s(z);case T:e:{for(ue=N.key;w!==null;){if(w.key===ue)if(w.tag===4&&w.stateNode.containerInfo===N.containerInfo&&w.stateNode.implementation===N.implementation){n(z,w.sibling),G=r(w,N.children||[]),G.return=z,z=G;break e}else{n(z,w);break}else t(z,w);w=w.sibling}G=hu(N,z.mode,G),G.return=z,z=G}return s(z);case K:return N=OA(N),Oe(z,w,N,G)}if(Ce(N))return ne(z,w,N,G);if(re(N)){if(ue=re(N),typeof ue!="function")throw Error(u(150));return N=ue.call(N),fe(z,w,N,G)}if(typeof N.then=="function")return Oe(z,w,Kl(N),G);if(N.$$typeof===D)return Oe(z,w,Gl(z,N),G);Jl(z,N)}return typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint"?(N=""+N,w!==null&&w.tag===6?(n(z,w.sibling),G=r(w,N),G.return=z,z=G):(n(z,w),G=vu(N,z.mode,G),G.return=z,z=G),s(z)):n(z,w)}return function(z,w,N,G){try{pr=0;var ue=Oe(z,w,N,G);return za=null,ue}catch(ae){if(ae===Ta||ae===Fl)throw ae;var Te=Xt(29,ae,null,z.mode);return Te.lanes=G,Te.return=z,Te}}}var RA=nd(!0),Ad=nd(!1),tA=!1;function Vu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function nA(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function AA(e,t,n){var A=e.updateQueue;if(A===null)return null;if(A=A.shared,(Me&2)!==0){var r=A.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),A.pending=t,t=kl(e),Rg(e,null,n),t}return Ul(e,A,t,n),kl(e)}function br(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var A=t.lanes;A&=e.pendingLanes,n|=A,t.lanes=n,Go(e,n)}}function ju(e,t){var n=e.updateQueue,A=e.alternate;if(A!==null&&(A=A.updateQueue,n===A)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?r=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?r=i=t:i=i.next=t}else r=i=t;n={baseState:A.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:A.shared,callbacks:A.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Lu=!1;function wr(){if(Lu){var e=Sa;if(e!==null)throw e}}function xr(e,t,n,A){Lu=!1;var r=e.updateQueue;tA=!1;var i=r.firstBaseUpdate,s=r.lastBaseUpdate,C=r.shared.pending;if(C!==null){r.shared.pending=null;var I=C,M=I.next;I.next=null,s===null?i=M:s.next=M,s=I;var q=e.alternate;q!==null&&(q=q.updateQueue,C=q.lastBaseUpdate,C!==s&&(C===null?q.firstBaseUpdate=M:C.next=M,q.lastBaseUpdate=I))}if(i!==null){var Y=r.baseState;s=0,q=M=I=null,C=i;do{var V=C.lane&-536870913,H=V!==C.lane;if(H?(pe&V)===V:(A&V)===V){V!==0&&V===xa&&(Lu=!0),q!==null&&(q=q.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var ne=e,fe=C;V=t;var Oe=n;switch(fe.tag){case 1:if(ne=fe.payload,typeof ne=="function"){Y=ne.call(Oe,Y,V);break e}Y=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=fe.payload,V=typeof ne=="function"?ne.call(Oe,Y,V):ne,V==null)break e;Y=m({},Y,V);break e;case 2:tA=!0}}V=C.callback,V!==null&&(e.flags|=64,H&&(e.flags|=8192),H=r.callbacks,H===null?r.callbacks=[V]:H.push(V))}else H={lane:V,tag:C.tag,payload:C.payload,callback:C.callback,next:null},q===null?(M=q=H,I=Y):q=q.next=H,s|=V;if(C=C.next,C===null){if(C=r.shared.pending,C===null)break;H=C,C=H.next,H.next=null,r.lastBaseUpdate=H,r.shared.pending=null}}while(!0);q===null&&(I=Y),r.baseState=I,r.firstBaseUpdate=M,r.lastBaseUpdate=q,i===null&&(r.shared.lanes=0),oA|=s,e.lanes=s,e.memoizedState=Y}}function ad(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function rd(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ei?i:8;var s=S.T,C={};S.T=C,ts(e,!1,t,n);try{var I=r(),M=S.S;if(M!==null&&M(C,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var q=vI(I,A);zr(e,t,q,Ht(e))}else zr(e,t,A,Ht(e))}catch(Y){zr(e,t,{then:function(){},status:"rejected",reason:Y},Ht())}finally{k.p=i,s!==null&&C.types!==null&&(s.types=C.types),S.T=s}}function wI(){}function $u(e,t,n,A){if(e.tag!==5)throw Error(u(476));var r=Dd(e).queue;Ld(e,r,t,W,n===null?wI:function(){return Od(e),n(A)})}function Dd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:W},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Od(e){var t=Dd(e);t.next===null&&(t=e.alternate.memoizedState),zr(e,t.next.queue,{},Ht())}function es(){return ft(Yr)}function Hd(){return We().memoizedState}function Rd(){return We().memoizedState}function xI(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ht();e=nA(n);var A=AA(t,e,n);A!==null&&(St(A,t,n),br(A,t,n)),t={cache:Tu()},e.payload=t;return}t=t.return}}function SI(e,t,n){var A=Ht();n={lane:A,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ii(e)?kd(t,n):(n=Bu(e,t,n,A),n!==null&&(St(n,e,A),qd(n,t,A)))}function Ud(e,t,n){var A=Ht();zr(e,t,n,A)}function zr(e,t,n,A){var r={lane:A,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ii(e))kd(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,C=i(s,n);if(r.hasEagerState=!0,r.eagerState=C,Vt(C,s))return Ul(e,t,r,0),Re===null&&Rl(),!1}catch{}if(n=Bu(e,t,r,A),n!==null)return St(n,e,A),qd(n,t,A),!0}return!1}function ts(e,t,n,A){if(A={lane:2,revertLane:Vs(),gesture:null,action:A,hasEagerState:!1,eagerState:null,next:null},ii(e)){if(t)throw Error(u(479))}else t=Bu(e,n,A,2),t!==null&&St(t,e,2)}function ii(e){var t=e.alternate;return e===Be||t!==null&&t===Be}function kd(e,t){Ma=ei=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qd(e,t,n){if((n&4194048)!==0){var A=t.lanes;A&=e.pendingLanes,n|=A,t.lanes=n,Go(e,n)}}var Nr={readContext:ft,use:Ai,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useLayoutEffect:Ze,useInsertionEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useSyncExternalStore:Ze,useId:Ze,useHostTransitionStatus:Ze,useFormState:Ze,useActionState:Ze,useOptimistic:Ze,useMemoCache:Ze,useCacheRefresh:Ze};Nr.useEffectEvent=Ze;var Pd={readContext:ft,use:Ai,useCallback:function(e,t){return Bt().memoizedState=[e,t===void 0?null:t],e},useContext:ft,useEffect:xd,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ri(4194308,4,Nd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ri(4194308,4,e,t)},useInsertionEffect:function(e,t){ri(4,2,e,t)},useMemo:function(e,t){var n=Bt();t=t===void 0?null:t;var A=e();if(UA){dn(!0);try{e()}finally{dn(!1)}}return n.memoizedState=[A,t],A},useReducer:function(e,t,n){var A=Bt();if(n!==void 0){var r=n(t);if(UA){dn(!0);try{n(t)}finally{dn(!1)}}}else r=t;return A.memoizedState=A.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},A.queue=e,e=e.dispatch=SI.bind(null,Be,e),[A.memoizedState,e]},useRef:function(e){var t=Bt();return e={current:e},t.memoizedState=e},useState:function(e){e=Fu(e);var t=e.queue,n=Ud.bind(null,Be,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ju,useDeferredValue:function(e,t){var n=Bt();return _u(n,e,t)},useTransition:function(){var e=Fu(!1);return e=Ld.bind(null,Be,e.queue,!0,!1),Bt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var A=Be,r=Bt();if(we){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),Re===null)throw Error(u(349));(pe&127)!==0||cd(A,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,xd(gd.bind(null,A,i,e),[e]),A.flags|=2048,Xa(9,{destroy:void 0},fd.bind(null,A,i,n,t),null),n},useId:function(){var e=Bt(),t=Re.identifierPrefix;if(we){var n=Bn,A=Qn;n=(A&~(1<<32-Qt(A)-1)).toString(32)+n,t="_"+t+"R_"+n,n=ti++,0<\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof A.is=="string"?s.createElement("select",{is:A.is}):s.createElement("select"),A.multiple?i.multiple=!0:A.size&&(i.size=A.size);break;default:i=typeof A.is=="string"?s.createElement(r,{is:A.is}):s.createElement(r)}}i[Ve]=t,i[Ye]=A;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)i.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=i;e:switch(dt(i,r,A),r){case"button":case"input":case"select":case"textarea":A=!!A.autoFocus;break e;case"img":A=!0;break e;default:A=!1}A&&jn(t)}}return ke(t),Es(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==A&&jn(t);else{if(typeof A!="string"&&t.stateNode===null)throw Error(u(166));if(e=le.current,ba(t)){if(e=t.stateNode,n=t.memoizedProps,A=null,r=ct,r!==null)switch(r.tag){case 27:case 5:A=r.memoizedProps}e[Ve]=t,e=!!(e.nodeValue===n||A!==null&&A.suppressHydrationWarning===!0||uC(e.nodeValue,n)),e||$n(t,!0)}else e=xi(e).createTextNode(A),e[Ve]=t,t.stateNode=e}return ke(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(A=ba(t),n!==null){if(e===null){if(!A)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Ve]=t}else XA(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ke(t),e=!1}else n=bu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Lt(t),t):(Lt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return ke(t),null;case 13:if(A=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=ba(t),A!==null&&A.dehydrated!==null){if(e===null){if(!r)throw Error(u(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(u(317));r[Ve]=t}else XA(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ke(t),r=!1}else r=bu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Lt(t),t):(Lt(t),null)}return Lt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=A!==null,e=e!==null&&e.memoizedState!==null,n&&(A=t.child,r=null,A.alternate!==null&&A.alternate.memoizedState!==null&&A.alternate.memoizedState.cachePool!==null&&(r=A.alternate.memoizedState.cachePool.pool),i=null,A.memoizedState!==null&&A.memoizedState.cachePool!==null&&(i=A.memoizedState.cachePool.pool),i!==r&&(A.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),fi(t,t.updateQueue),ke(t),null);case 4:return be(),e===null&&Ds(t.stateNode.containerInfo),ke(t),null;case 10:return Nn(t.type),ke(t),null;case 19:if(U(Fe),A=t.memoizedState,A===null)return ke(t),null;if(r=(t.flags&128)!==0,i=A.rendering,i===null)if(r)Vr(A,!1);else{if(Ge!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=$l(e),i!==null){for(t.flags|=128,Vr(A,!1),e=i.updateQueue,t.updateQueue=e,fi(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ug(n,e),n=n.sibling;return F(Fe,Fe.current&1|2),we&&Tn(t,A.treeForkCount),t.child}e=e.sibling}A.tail!==null&<()>Qi&&(t.flags|=128,r=!0,Vr(A,!1),t.lanes=4194304)}else{if(!r)if(e=$l(i),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,fi(t,e),Vr(A,!0),A.tail===null&&A.tailMode==="hidden"&&!i.alternate&&!we)return ke(t),null}else 2*lt()-A.renderingStartTime>Qi&&n!==536870912&&(t.flags|=128,r=!0,Vr(A,!1),t.lanes=4194304);A.isBackwards?(i.sibling=t.child,t.child=i):(e=A.last,e!==null?e.sibling=i:t.child=i,A.last=i)}return A.tail!==null?(e=A.tail,A.rendering=e,A.tail=e.sibling,A.renderingStartTime=lt(),e.sibling=null,n=Fe.current,F(Fe,r?n&1|2:n&1),we&&Tn(t,A.treeForkCount),e):(ke(t),null);case 22:case 23:return Lt(t),Ou(),A=t.memoizedState!==null,e!==null?e.memoizedState!==null!==A&&(t.flags|=8192):A&&(t.flags|=8192),A?(n&536870912)!==0&&(t.flags&128)===0&&(ke(t),t.subtreeFlags&6&&(t.flags|=8192)):ke(t),n=t.updateQueue,n!==null&&fi(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),A=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(A=t.memoizedState.cachePool.pool),A!==n&&(t.flags|=2048),e!==null&&U(DA),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Nn(_e),ke(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function VI(e,t){switch(pu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Nn(_e),be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return nt(t),null;case 31:if(t.memoizedState!==null){if(Lt(t),t.alternate===null)throw Error(u(340));XA()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Lt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));XA()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(Fe),null;case 4:return be(),null;case 10:return Nn(t.type),null;case 22:case 23:return Lt(t),Ou(),e!==null&&U(DA),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Nn(_e),null;case 25:return null;default:return null}}function dE(e,t){switch(pu(t),t.tag){case 3:Nn(_e),be();break;case 26:case 27:case 5:nt(t);break;case 4:be();break;case 31:t.memoizedState!==null&&Lt(t);break;case 13:Lt(t);break;case 19:U(Fe);break;case 10:Nn(t.type);break;case 22:case 23:Lt(t),Ou(),e!==null&&U(DA);break;case 24:Nn(_e)}}function Xr(e,t){try{var n=t.updateQueue,A=n!==null?n.lastEffect:null;if(A!==null){var r=A.next;n=r;do{if((n.tag&e)===e){A=void 0;var i=n.create,s=n.inst;A=i(),s.destroy=A}n=n.next}while(n!==r)}}catch(C){je(t,t.return,C)}}function lA(e,t,n){try{var A=t.updateQueue,r=A!==null?A.lastEffect:null;if(r!==null){var i=r.next;A=i;do{if((A.tag&e)===e){var s=A.inst,C=s.destroy;if(C!==void 0){s.destroy=void 0,r=t;var I=n,M=C;try{M()}catch(q){je(r,I,q)}}}A=A.next}while(A!==i)}}catch(q){je(t,t.return,q)}}function EE(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{rd(t,n)}catch(A){je(e,e.return,A)}}}function CE(e,t,n){n.props=kA(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(A){je(e,t,A)}}function jr(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var A=e.stateNode;break;case 30:A=e.stateNode;break;default:A=e.stateNode}typeof n=="function"?e.refCleanup=n(A):n.current=A}}catch(r){je(e,t,r)}}function mn(e,t){var n=e.ref,A=e.refCleanup;if(n!==null)if(typeof A=="function")try{A()}catch(r){je(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){je(e,t,r)}else n.current=null}function QE(e){var t=e.type,n=e.memoizedProps,A=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&A.focus();break e;case"img":n.src?A.src=n.src:n.srcSet&&(A.srcset=n.srcSet)}}catch(r){je(e,e.return,r)}}function Cs(e,t,n){try{var A=e.stateNode;tp(A,e.type,n,t),A[Ye]=t}catch(r){je(e,e.return,r)}}function BE(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&gA(e.type)||e.tag===4}function Qs(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||BE(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&gA(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Bs(e,t,n){var A=e.tag;if(A===5||A===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=wn));else if(A!==4&&(A===27&&gA(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Bs(e,t,n),e=e.sibling;e!==null;)Bs(e,t,n),e=e.sibling}function gi(e,t,n){var A=e.tag;if(A===5||A===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(A!==4&&(A===27&&gA(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(gi(e,t,n),e=e.sibling;e!==null;)gi(e,t,n),e=e.sibling}function mE(e){var t=e.stateNode,n=e.memoizedProps;try{for(var A=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);dt(t,A,n),t[Ve]=e,t[Ye]=n}catch(i){je(e,e.return,i)}}var Ln=!1,tt=!1,ms=!1,vE=typeof WeakSet=="function"?WeakSet:Set,ot=null;function XI(e,t){if(e=e.containerInfo,Rs=Xi,e=Mg(e),fu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var A=n.getSelection&&n.getSelection();if(A&&A.rangeCount!==0){n=A.anchorNode;var r=A.anchorOffset,i=A.focusNode;A=A.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,C=-1,I=-1,M=0,q=0,Y=e,V=null;t:for(;;){for(var H;Y!==n||r!==0&&Y.nodeType!==3||(C=s+r),Y!==i||A!==0&&Y.nodeType!==3||(I=s+A),Y.nodeType===3&&(s+=Y.nodeValue.length),(H=Y.firstChild)!==null;)V=Y,Y=H;for(;;){if(Y===e)break t;if(V===n&&++M===r&&(C=s),V===i&&++q===A&&(I=s),(H=Y.nextSibling)!==null)break;Y=V,V=Y.parentNode}Y=H}n=C===-1||I===-1?null:{start:C,end:I}}else n=null}n=n||{start:0,end:0}}else n=null;for(Us={focusedElem:e,selectionRange:n},Xi=!1,ot=t;ot!==null;)if(t=ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ot=e;else for(;ot!==null;){switch(t=ot,i=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),dt(i,A,n),i[Ve]=e,it(i),A=i;break e;case"link":var s=wC("link","href",r).get(A+(n.href||""));if(s){for(var C=0;COe&&(s=Oe,Oe=fe,fe=s);var z=zg(C,fe),w=zg(C,Oe);if(z&&w&&(H.rangeCount!==1||H.anchorNode!==z.node||H.anchorOffset!==z.offset||H.focusNode!==w.node||H.focusOffset!==w.offset)){var N=Y.createRange();N.setStart(z.node,z.offset),H.removeAllRanges(),fe>Oe?(H.addRange(N),H.extend(w.node,w.offset)):(N.setEnd(w.node,w.offset),H.addRange(N))}}}}for(Y=[],H=C;H=H.parentNode;)H.nodeType===1&&Y.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;Cn?32:n,S.T=null,n=ws,ws=null;var i=sA,s=Un;if(At=0,Ha=sA=null,Un=0,(Me&6)!==0)throw Error(u(331));var C=Me;if(Me|=4,NE(i.current),SE(i,i.current,s,n),Me=C,Ur(0,!1),st&&typeof st.onPostCommitFiberRoot=="function")try{st.onPostCommitFiberRoot(It,i)}catch{}return!0}finally{k.p=r,S.T=A,WE(e,t)}}function JE(e,t,n){t=Kt(n,t),t=rs(e.stateNode,t,2),e=AA(e,t,2),e!==null&&(Cn(e,2),vn(e))}function je(e,t,n){if(e.tag===3)JE(e,e,n);else for(;t!==null;){if(t.tag===3){JE(t,e,n);break}else if(t.tag===1){var A=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof A.componentDidCatch=="function"&&(uA===null||!uA.has(A))){e=Kt(n,e),n=_d(2),A=AA(t,n,2),A!==null&&($d(n,A,t,e),Cn(A,2),vn(A));break}}t=t.return}}function zs(e,t,n){var A=e.pingCache;if(A===null){A=e.pingCache=new DI;var r=new Set;A.set(t,r)}else r=A.get(t),r===void 0&&(r=new Set,A.set(t,r));r.has(n)||(Is=!0,r.add(n),e=kI.bind(null,e,t,n),t.then(e,e))}function kI(e,t,n){var A=e.pingCache;A!==null&&A.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Re===e&&(pe&n)===n&&(Ge===4||Ge===3&&(pe&62914560)===pe&&300>lt()-Ci?(Me&2)===0&&Ra(e,0):ps|=n,Oa===pe&&(Oa=0)),vn(e)}function _E(e,t){t===0&&(t=wl()),e=MA(e,t),e!==null&&(Cn(e,t),vn(e))}function qI(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_E(e,n)}function PI(e,t){var n=0;switch(e.tag){case 31:case 13:var A=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:A=e.stateNode;break;case 22:A=e.stateNode._retryCache;break;default:throw Error(u(314))}A!==null&&A.delete(t),_E(e,n)}function ZI(e,t){return Pt(e,t)}var pi=null,ka=null,Ns=!1,yi=!1,Ms=!1,fA=0;function vn(e){e!==ka&&e.next===null&&(ka===null?pi=ka=e:ka=ka.next=e),yi=!0,Ns||(Ns=!0,YI())}function Ur(e,t){if(!Ms&&yi){Ms=!0;do for(var n=!1,A=pi;A!==null;){if(e!==0){var r=A.pendingLanes;if(r===0)var i=0;else{var s=A.suspendedLanes,C=A.pingedLanes;i=(1<<31-Qt(42|e)+1)-1,i&=r&~(s&~C),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,nC(A,i))}else i=pe,i=oa(A,A===Re?i:0,A.cancelPendingCommit!==null||A.timeoutHandle!==-1),(i&3)===0||En(A,i)||(n=!0,nC(A,i));A=A.next}while(n);Ms=!1}}function GI(){$E()}function $E(){yi=Ns=!1;var e=0;fA!==0&&Ap()&&(e=fA);for(var t=lt(),n=null,A=pi;A!==null;){var r=A.next,i=eC(A,t);i===0?(A.next=null,n===null?pi=r:n.next=r,r===null&&(ka=n)):(n=A,(e!==0||(i&3)!==0)&&(yi=!0)),A=r}At!==0&&At!==5||Ur(e),fA!==0&&(fA=0)}function eC(e,t){for(var n=e.suspendedLanes,A=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes&-62914561;0C)break;var q=I.transferSize,Y=I.initiatorType;q&&sC(Y)&&(I=I.responseEnd,s+=q*(I"u"?null:document;function IC(e,t,n){var A=qa;if(A&&typeof t=="string"&&t){var r=Ft(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),hC.has(r)||(hC.add(r),e={rel:e,crossOrigin:n,href:t},A.querySelector(r)===null&&(t=A.createElement("link"),dt(t,"link",e),it(t),A.head.appendChild(t)))}}function fp(e){kn.D(e),IC("dns-prefetch",e,null)}function gp(e,t){kn.C(e,t),IC("preconnect",e,t)}function dp(e,t,n){kn.L(e,t,n);var A=qa;if(A&&e&&t){var r='link[rel="preload"][as="'+Ft(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Ft(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Ft(n.imageSizes)+'"]')):r+='[href="'+Ft(e)+'"]';var i=r;switch(t){case"style":i=Pa(e);break;case"script":i=Za(e)}nn.has(i)||(e=m({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),nn.set(i,e),A.querySelector(r)!==null||t==="style"&&A.querySelector(Zr(i))||t==="script"&&A.querySelector(Gr(i))||(t=A.createElement("link"),dt(t,"link",e),it(t),A.head.appendChild(t)))}}function Ep(e,t){kn.m(e,t);var n=qa;if(n&&e){var A=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Ft(A)+'"][href="'+Ft(e)+'"]',i=r;switch(A){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Za(e)}if(!nn.has(i)&&(e=m({rel:"modulepreload",href:e},t),nn.set(i,e),n.querySelector(r)===null)){switch(A){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Gr(i)))return}A=n.createElement("link"),dt(A,"link",e),it(A),n.head.appendChild(A)}}}function Cp(e,t,n){kn.S(e,t,n);var A=qa;if(A&&e){var r=fa(A).hoistableStyles,i=Pa(e);t=t||"default";var s=r.get(i);if(!s){var C={loading:0,preload:null};if(s=A.querySelector(Zr(i)))C.loading=5;else{e=m({rel:"stylesheet",href:e,"data-precedence":t},n),(n=nn.get(i))&&Fs(e,n);var I=s=A.createElement("link");it(I),dt(I,"link",e),I._p=new Promise(function(M,q){I.onload=M,I.onerror=q}),I.addEventListener("load",function(){C.loading|=1}),I.addEventListener("error",function(){C.loading|=2}),C.loading|=4,Ti(s,t,A)}s={type:"stylesheet",instance:s,count:1,state:C},r.set(i,s)}}}function Qp(e,t){kn.X(e,t);var n=qa;if(n&&e){var A=fa(n).hoistableScripts,r=Za(e),i=A.get(r);i||(i=n.querySelector(Gr(r)),i||(e=m({src:e,async:!0},t),(t=nn.get(r))&&Ws(e,t),i=n.createElement("script"),it(i),dt(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},A.set(r,i))}}function Bp(e,t){kn.M(e,t);var n=qa;if(n&&e){var A=fa(n).hoistableScripts,r=Za(e),i=A.get(r);i||(i=n.querySelector(Gr(r)),i||(e=m({src:e,async:!0,type:"module"},t),(t=nn.get(r))&&Ws(e,t),i=n.createElement("script"),it(i),dt(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},A.set(r,i))}}function pC(e,t,n,A){var r=(r=le.current)?Si(r):null;if(!r)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Pa(n.href),n=fa(r).hoistableStyles,A=n.get(t),A||(A={type:"style",instance:null,count:0,state:null},n.set(t,A)),A):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Pa(n.href);var i=fa(r).hoistableStyles,s=i.get(e);if(s||(r=r.ownerDocument||r,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,s),(i=r.querySelector(Zr(e)))&&!i._p&&(s.instance=i,s.state.loading=5),nn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},nn.set(e,n),i||mp(r,e,n,s.state))),t&&A===null)throw Error(u(528,""));return s}if(t&&A!==null)throw Error(u(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Za(n),n=fa(r).hoistableScripts,A=n.get(t),A||(A={type:"script",instance:null,count:0,state:null},n.set(t,A)),A):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Pa(e){return'href="'+Ft(e)+'"'}function Zr(e){return'link[rel="stylesheet"]['+e+"]"}function yC(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function mp(e,t,n,A){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?A.loading=1:(t=e.createElement("link"),A.preload=t,t.addEventListener("load",function(){return A.loading|=1}),t.addEventListener("error",function(){return A.loading|=2}),dt(t,"link",n),it(t),e.head.appendChild(t))}function Za(e){return'[src="'+Ft(e)+'"]'}function Gr(e){return"script[async]"+e}function bC(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var A=e.querySelector('style[data-href~="'+Ft(n.href)+'"]');if(A)return t.instance=A,it(A),A;var r=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return A=(e.ownerDocument||e).createElement("style"),it(A),dt(A,"style",r),Ti(A,n.precedence,e),t.instance=A;case"stylesheet":r=Pa(n.href);var i=e.querySelector(Zr(r));if(i)return t.state.loading|=4,t.instance=i,it(i),i;A=yC(n),(r=nn.get(r))&&Fs(A,r),i=(e.ownerDocument||e).createElement("link"),it(i);var s=i;return s._p=new Promise(function(C,I){s.onload=C,s.onerror=I}),dt(i,"link",A),t.state.loading|=4,Ti(i,n.precedence,e),t.instance=i;case"script":return i=Za(n.src),(r=e.querySelector(Gr(i)))?(t.instance=r,it(r),r):(A=n,(r=nn.get(i))&&(A=m({},n),Ws(A,r)),e=e.ownerDocument||e,r=e.createElement("script"),it(r),dt(r,"link",A),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(A=t.instance,t.state.loading|=4,Ti(A,n.precedence,e));return t.instance}function Ti(e,t,n){for(var A=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=A.length?A[A.length-1]:null,i=r,s=0;s title"):null)}function vp(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function SC(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function hp(e,t,n,A){if(n.type==="stylesheet"&&(typeof A.media!="string"||matchMedia(A.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=Pa(A.href),i=t.querySelector(Zr(r));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ni.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,it(i);return}i=t.ownerDocument||t,A=yC(A),(r=nn.get(r))&&Fs(A,r),i=i.createElement("link"),it(i);var s=i;s._p=new Promise(function(C,I){s.onload=C,s.onerror=I}),dt(i,"link",A),n.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Ni.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Ks=0;function Ip(e,t){return e.stylesheets&&e.count===0&&Vi(e,e.stylesheets),0Ks?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(A),clearTimeout(r)}}:null}function Ni(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Mi=null;function Vi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Mi=new Map,t.forEach(pp,e),Mi=null,Ni.call(e))}function pp(e,t){if(!(t.state.loading&4)){var n=Mi.get(e);if(n)var A=n.get(null);else{n=new Map,Mi.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),ki.exports=GC(),ki.exports}var FC=YC(),Gi={exports:{}},Fa={};var fc;function WC(){if(fc)return Fa;fc=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function o(u,f,g){var Q=null;if(g!==void 0&&(Q=""+g),f.key!==void 0&&(Q=""+f.key),"key"in f){g={};for(var B in f)B!=="key"&&(g[B]=f[B])}else g=f;return f=g.ref,{$$typeof:a,type:u,key:Q,ref:f!==void 0?f:null,props:g}}return Fa.Fragment=l,Fa.jsx=o,Fa.jsxs=o,Fa}var gc;function KC(){return gc||(gc=1,Gi.exports=WC()),Gi.exports}var h=KC();const dc=qn(h);var Ec=uc(),JC=Object.defineProperty,Cc=(a,l)=>{for(var o in l)JC(a,o,{get:l[o],enumerable:!0,configurable:!0,set:u=>l[o]=()=>u})};if(typeof c.createContext!="function"){const a=['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";'];throw new Error(a.join(`
`))}function Qc(){return["NOD","E_EN","V"].join("")}var Bc=()=>["e","nv"].join(""),an=()=>{const a=typeof window<"u"&&window.remotion_isPlayer,l=typeof window<"u"&&typeof window.process<"u"&&typeof window.process.env<"u"&&(window.process[Bc()][Qc()]==="test"||window.process[Bc()][Qc()]==="production"&&typeof window<"u"&&typeof window.remotion_puppeteerTimeout<"u"),o=typeof window<"u"&&window.remotion_isStudio,u=typeof window<"u"&&window.remotion_isReadOnlyStudio;return{isStudio:o,isRendering:l,isPlayer:a,isReadOnlyStudio:u,isClientSideRendering:!1}},_C=Qe.createElement,$C=dc.jsx,mc=[],vc=a=>new Proxy(a,{apply(l,o,u){if(mc.includes(u[0])){const[f,g,...Q]=u,B=g.stack?g:{...g??{},stack:new Error().stack};return Reflect.apply(l,o,[f,B,...Q])}return Reflect.apply(l,o,u)}}),hc=()=>{an().isStudio&&(Qe.createElement=vc(_C),dc.jsx=vc($C))},ZA=a=>{mc.push(a),hc()},Ic=c.createContext(!1),eQ=({children:a})=>h.jsx(Ic.Provider,{value:!0,children:a}),Yi=()=>c.useContext(Ic);function Wa(a){return!!a}var Ka="4.0.427",tQ=()=>{if(typeof globalThis>"u")return;const a=()=>{globalThis.remotion_imported=Ka,typeof window<"u"&&(window.remotion_imported=Ka)},l=globalThis.remotion_imported||typeof window<"u"&&window.remotion_imported;if(l){if(l===Ka)return;if(typeof l=="string"&&l.includes("webcodecs")){a();return}throw new TypeError(`🚨 Multiple versions of Remotion detected: ${[Ka,typeof l=="string"?l:"an older version"].filter(Wa).join(" and ")}. This will cause things to break in an unexpected way.
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.`)}a()},Pn=({className:a,classPrefix:l,type:o})=>{if(!a)return!1;if(o==="exact"){const u=a.split(" ");return l.some(f=>u.some(g=>g.trim()===f||g.trim().endsWith(`:${f}`)||g.trim().endsWith(`!${f}`)))}return l.some(u=>a.startsWith(u)||a.includes(` ${u}`)||a.includes(`!${u}`)||a.includes(`:${u}`))},nQ=(a,l)=>{const{style:o,...u}=a,f=c.useMemo(()=>({position:"absolute",top:Pn({className:u.className,classPrefix:["top-","inset-"],type:"prefix"})?void 0:0,left:Pn({className:u.className,classPrefix:["left-","inset-"],type:"prefix"})?void 0:0,right:Pn({className:u.className,classPrefix:["right-","inset-"],type:"prefix"})?void 0:0,bottom:Pn({className:u.className,classPrefix:["bottom-","inset-"],type:"prefix"})?void 0:0,width:Pn({className:u.className,classPrefix:["w-"],type:"prefix"})?void 0:"100%",height:Pn({className:u.className,classPrefix:["h-"],type:"prefix"})?void 0:"100%",display:Pn({className:u.className,classPrefix:["block","inline-block","inline","flex","inline-flex","flow-root","grid","inline-grid","contents","list-item","hidden"],type:"exact"})?void 0:"flex",flexDirection:Pn({className:u.className,classPrefix:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"],type:"exact"})?void 0:"column",...o}),[u.className,o]);return h.jsx("div",{ref:l,style:f,...u})},Fi=c.forwardRef(nQ),at=c.createContext(null),GA=Qe.createContext({registerSequence:()=>{throw new Error("SequenceManagerContext not initialized")},unregisterSequence:()=>{throw new Error("SequenceManagerContext not initialized")},sequences:[]}),Ja=Qe.createContext({hidden:{},setHidden:()=>{throw new Error("SequenceVisibilityToggle not initialized")}}),AQ=({children:a})=>{const[l,o]=c.useState([]),[u,f]=c.useState({}),g=c.useCallback(d=>{o(v=>[...v,d])},[]),Q=c.useCallback(d=>{o(v=>v.filter(m=>m.id!==d))},[]),B=c.useMemo(()=>({registerSequence:g,sequences:l,unregisterSequence:Q}),[g,l,Q]),E=c.useMemo(()=>({hidden:u,setHidden:f}),[u]);return h.jsx(GA.Provider,{value:B,children:h.jsx(Ja.Provider,{value:E,children:a})})};function pc(a){let l=a+1831565813;return l=Math.imul(l^l>>>15,l|1),l^=l+Math.imul(l^l>>>7,l|61),((l^l>>>14)>>>0)/4294967296}function aQ(a){let l=0,o=0,u=0;for(l=0;l{if(a===null)return Math.random();if(typeof a=="string")return pc(aQ(a));if(typeof a=="number")return pc(a*1e10);throw new Error("random() argument must be a number or a string")},Wi={};Cc(Wi,{useTimelineSetFrame:()=>Xc,useTimelinePosition:()=>Zn,usePlayingState:()=>jc,persistCurrentFrame:()=>Nc,getInitialFrameState:()=>Mc,getFrameForComposition:()=>Vc});var yc=Qe.createContext(null),rt=()=>{const a=c.useContext(yc),[l]=c.useState(()=>an());return a??l},YA=c.createContext({compositions:[],folders:[],currentCompositionMetadata:null,canvasContent:null}),Jr=c.createContext({registerComposition:()=>{},unregisterComposition:()=>{},registerFolder:()=>{},unregisterFolder:()=>{},setCanvasContent:()=>{},updateCompositionDefaultProps:()=>{},onlyRenderComposition:null}),Ki=c.createContext({props:{},updateProps:()=>{throw new Error("Not implemented")},resetUnsaved:()=>{throw new Error("Not implemented")}}),bc=Qe.createRef(),rQ=Qe.createRef(),wc=({children:a})=>{const[l,o]=Qe.useState({}),u=c.useCallback(({defaultProps:Q,id:B,newProps:E})=>{o(d=>({...d,[B]:typeof E=="function"?E(d[B]??Q):E}))},[]),f=c.useCallback(Q=>{o(B=>{if(B[Q]){const E={...B};return delete E[Q],E}return B})},[]);c.useImperativeHandle(bc,()=>({getProps:()=>l,setProps:o}),[l]);const g=c.useMemo(()=>({props:l,updateProps:u,resetUnsaved:f}),[l,f,u]);return h.jsx(Ki.Provider,{value:g,children:a})},Ji=()=>"remotion_inputPropsOverride"+window.location.origin,xc=()=>{if(typeof localStorage>"u")return null;const a=localStorage.getItem(Ji());return a?JSON.parse(a):null},lQ=a=>{if(!(typeof localStorage>"u")){if(a===null){localStorage.removeItem(Ji());return}localStorage.setItem(Ji(),JSON.stringify(a))}},_i="remotion-date:",$i="remotion-file:",iQ=({data:a,indent:l,staticBase:o})=>{let u=!1,f=!1,g=!1,Q=!1;try{return{serializedString:JSON.stringify(a,function(E,d){const v=this[E];return v instanceof Date?(u=!0,`${_i}${v.toISOString()}`):v instanceof Map?(g=!0,d):v instanceof Set?(Q=!0,d):typeof v=="string"&&o!==null&&v.startsWith(o)?(f=!0,`${$i}${v.replace(o+"/","")}`):d},l),customDateUsed:u,customFileUsed:f,mapUsed:g,setUsed:Q}}catch(B){throw new Error("Could not serialize the passed input props to JSON: "+B.message)}},Sc=a=>JSON.parse(a,(l,o)=>typeof o=="string"&&o.startsWith(_i)?new Date(o.replace(_i,"")):typeof o=="string"&&o.startsWith($i)?`${window.remotion_staticBase}/${o.replace($i,"")}`:o),oQ=a=>Sc(iQ({data:a,indent:2,staticBase:window.remotion_staticBase}).serializedString),vA=a=>an().isStudio?oQ(a):a,Tc=!1,uQ=()=>{Tc||(Tc=!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()"))},sQ=()=>{if(typeof window>"u")return uQ(),{};if(an().isPlayer)throw new Error("You cannot call `getInputProps()` from a . Instead, the props are available as React props from component that you passed as `component` prop.");const a=xc();if(a)return a;if(typeof window>"u"||typeof window.remotion_inputProps>"u")throw new Error("Cannot call `getInputProps()` - window.remotion_inputProps is not set. This API is only available if you are in the Studio, or while you are rendering server-side.");const l=window.remotion_inputProps;return l?Sc(l):{}};function _r(a,l,o){if(typeof a!="number")throw new Error(`The "${l}" prop ${o} must be a number, but you passed a value of type ${typeof a}`);if(isNaN(a))throw new TypeError(`The "${l}" prop ${o} must not be NaN, but is NaN.`);if(!Number.isFinite(a))throw new TypeError(`The "${l}" prop ${o} must be finite, but is ${a}.`);if(a%1!==0)throw new TypeError(`The "${l}" prop ${o} must be an integer, but is ${a}.`);if(a<=0)throw new TypeError(`The "${l}" prop ${o} must be positive, but got ${a}.`)}function eo(a,l){const{allowFloats:o,component:u}=l;if(typeof a>"u")throw new Error(`The "durationInFrames" prop ${u} is missing.`);if(typeof a!="number")throw new Error(`The "durationInFrames" prop ${u} must be a number, but you passed a value of type ${typeof a}`);if(a<=0)throw new TypeError(`The "durationInFrames" prop ${u} must be positive, but got ${a}.`);if(!o&&a%1!==0)throw new TypeError(`The "durationInFrames" prop ${u} must be an integer, but got ${a}.`);if(!Number.isFinite(a))throw new TypeError(`The "durationInFrames" prop ${u} must be finite, but got ${a}.`)}function $r(a,l,o){if(typeof a!="number")throw new Error(`"fps" must be a number, but you passed a value of type ${typeof a} ${l}`);if(!Number.isFinite(a))throw new Error(`"fps" must be a finite, but you passed ${a} ${l}`);if(isNaN(a))throw new Error(`"fps" must not be NaN, but got ${a} ${l}`);if(a<=0)throw new TypeError(`"fps" must be positive, but got ${a} ${l}`)}var el=c.createContext(null),cQ=c.createRef(),fQ=a=>!!a.calculateMetadata,zc="remotion.propsUpdatedExternally",to=a=>{const l=c.useContext(el),{props:o}=c.useContext(Ki),{compositions:u,canvasContent:f,currentCompositionMetadata:g}=c.useContext(YA),Q=f?.type==="composition"?f.compositionId:null,B=a??Q,E=u.find(m=>m.id===B),d=c.useMemo(()=>E?o[E.id]??{}:{},[o,E]),v=rt();return c.useMemo(()=>E?g?{type:"success",result:{...g,id:E.id,defaultProps:E.defaultProps??{}}}:fQ(E)?!l||!l[E.id]?null:l[E.id]:(eo(E.durationInFrames,{allowFloats:!1,component:`in `}),$r(E.fps,`in `),_r(E.width,"width",`in `),_r(E.height,"height",`in `),{type:"success",result:{width:E.width,height:E.height,fps:E.fps,id:E.id,durationInFrames:E.durationInFrames,defaultProps:E.defaultProps??{},props:{...E.defaultProps??{},...d??{},...typeof window>"u"||v.isPlayer||!window.remotion_inputProps?{}:sQ()??{}},defaultCodec:null,defaultOutName:null,defaultVideoImageFormat:null,defaultPixelFormat:null,defaultProResProfile:null}}):null,[E,l,g,d,v.isPlayer])},tl=()=>{const{canvasContent:a,compositions:l,currentCompositionMetadata:o}=c.useContext(YA),u=l.find(g=>a?.type==="composition"&&g.id===a.compositionId),f=to(u?.id??null);return c.useMemo(()=>!f||f.type==="error"||f.type==="loading"||!u?null:{...f.result,defaultProps:u.defaultProps??{},id:u.id,...o??{},component:u.component},[o,f,u])},no=()=>"remotion.time-all",Nc=a=>{localStorage.setItem(no(),JSON.stringify(a))},Mc=()=>{const a=localStorage.getItem(no())??"{}";return JSON.parse(a)},Vc=a=>{const l=localStorage.getItem(no())??"{}",o=JSON.parse(l);return o[a]!==void 0?Number(o[a]):typeof window>"u"?0:window.remotion_initialFrame??0},Zn=()=>{const a=tl(),l=c.useContext(Ut),o=rt();if(!a)return typeof window>"u"?0:window.remotion_initialFrame??0;const u=l.frame[a.id]??(o.isPlayer?0:Vc(a.id));return Math.min(a.durationInFrames-1,u)},Xc=()=>{const{setFrame:a}=c.useContext(WA);return a},jc=()=>{const{playing:a,imperativePlaying:l}=c.useContext(Ut),{setPlaying:o}=c.useContext(WA);return c.useMemo(()=>[a,o,l],[l,a,o])},Lc=a=>{const l=a.stack??"";return l.startsWith("Error:")?l:`${a.message}
${l}`},gQ=a=>a instanceof Error?!0:!(a===null||typeof a!="object"||!("stack"in a)||typeof a.stack!="string"||!("message"in a)||typeof a.message!="string");function Ao(a,l){let o;throw gQ(l)?(o=l,o.stack||(o.stack=new Error(o.message).stack)):typeof l=="string"?o=Error(l):o=Error("Rendering was cancelled"),a&&(a.remotion_cancelledError=Lc(o)),o}function FA(a){return Ao(typeof window<"u"?window:void 0,a)}var dQ=["trace","verbose","info","warn","error"],Dc=a=>dQ.indexOf(a),nl=(a,l)=>Dc(a)<=Dc(l),_a=({args:a,logLevel:l,tag:o})=>{const u=[...a];return an().isRendering&&!an().isClientSideRendering&&u.unshift(Symbol.for(`__remotion_level_${l}`)),o&&an().isRendering&&!an().isClientSideRendering&&u.unshift(Symbol.for(`__remotion_tag_${o}`)),u},EQ=(a,...l)=>{if(nl(a.logLevel,"verbose"))return console.debug(..._a({args:l,logLevel:"verbose",tag:a.tag}))},CQ=(a,...l)=>{if(nl(a.logLevel,"trace"))return console.debug(..._a({args:l,logLevel:"trace",tag:a.tag}))},QQ=(a,...l)=>{if(nl(a.logLevel,"info"))return console.log(..._a({args:l,logLevel:"info",tag:a.tag}))},BQ=(a,...l)=>{if(nl(a.logLevel,"warn"))return console.warn(..._a({args:l,logLevel:"warn",tag:a.tag}))},mQ=(a,...l)=>console.error(..._a({args:l,logLevel:"error",tag:a.tag})),Rt={trace:CQ,verbose:EQ,info:QQ,warn:BQ,error:mQ};typeof window<"u"&&(window.remotion_renderReady=!1,window.remotion_delayRenderTimeouts||(window.remotion_delayRenderTimeouts={}),window.remotion_delayRenderHandles=[]);var vQ="The delayRender was called:",hQ="Retries left: ",IQ="- Rendering the frame will be retried.",pQ="handle was cleared after",yQ=3e4,bQ=({scope:a,environment:l,label:o,options:u})=>{if(typeof o!="string"&&o!==null)throw new Error("The label parameter of delayRender() must be a string or undefined, got: "+JSON.stringify(o));const f=Math.random();a.remotion_delayRenderHandles.push(f);const g=Error().stack?.replace(/^Error/g,"")??"";if(l.isRendering){const Q=(u?.timeoutInMilliseconds??a.remotion_puppeteerTimeout??yQ)-2e3,B=(u?.retries??0)-(a.remotion_attempt-1);a.remotion_delayRenderTimeouts[f]={label:o??null,startTime:Date.now(),timeout:setTimeout(()=>{const E=["A delayRender()",o?`"${o}"`:null,`was called but not cleared after ${Q}ms. See https://remotion.dev/docs/timeout for help.`,B>0?hQ+B:null,B>0?IQ:null,vQ,g].filter(Wa).join(" ");l.isClientSideRendering?a.remotion_cancelledError=Lc(Error(E)):Ao(a,Error(E))},Q)}}return a.remotion_renderReady=!1,f},wQ=({scope:a,handle:l,environment:o,logLevel:u})=>{if(typeof l>"u")throw new TypeError("The continueRender() method must be called with a parameter that is the return value of delayRender(). No value was passed.");if(typeof l!="number")throw new TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: "+JSON.stringify(l));a.remotion_delayRenderHandles=a.remotion_delayRenderHandles.filter(f=>{if(f===l){if(o.isRendering&&a!==void 0){if(!a.remotion_delayRenderTimeouts[l])return!1;const{label:g,startTime:Q,timeout:B}=a.remotion_delayRenderTimeouts[l];clearTimeout(B);const E=[g?`"${g}"`:"A handle",pQ,`${Date.now()-Q}ms`].filter(Wa).join(" ");Rt.verbose({logLevel:u,tag:"delayRender()"},E),delete a.remotion_delayRenderTimeouts[l]}return!1}return!0}),a.remotion_delayRenderHandles.length===0&&(a.remotion_renderReady=!0)},hA=c.createContext({logLevel:"info",mountTime:0}),Gn=()=>{const{logLevel:a}=c.useContext(hA);if(a===null)throw new Error("useLogLevel must be used within a LogLevelProvider");return a},$a=()=>{const{mountTime:a}=c.useContext(hA);if(a===null)throw new Error("useMountTime must be used within a LogLevelProvider");return a},Oc=c.createContext(null),Yn=()=>{const a=rt(),l=c.useContext(Oc)??(typeof window<"u"?window:void 0),o=Gn(),u=c.useCallback((Q,B)=>l?bQ({scope:l,environment:a,label:Q??null,options:B??{}}):Math.random(),[a,l]),f=c.useCallback(Q=>{l&&wQ({scope:l,handle:Q,environment:a,logLevel:o})},[a,o,l]),g=c.useCallback(Q=>Ao(l??(typeof window<"u"?window:void 0),Q),[l]);return{delayRender:u,continueRender:f,cancelRender:g}},WA=c.createContext({setFrame:()=>{throw new Error("default")},setPlaying:()=>{throw new Error("default")}}),Ut=c.createContext({frame:{},playing:!1,playbackRate:1,rootId:"",imperativePlaying:{current:!1},setPlaybackRate:()=>{throw new Error("default")},audioAndVideoTags:{current:[]}}),xQ=({children:a,frameState:l})=>{const[o,u]=c.useState(!1),f=c.useRef(!1),[g,Q]=c.useState(1),B=c.useRef([]),[E]=c.useState(()=>String(mA(null))),[d,v]=c.useState(()=>Mc()),m=l??d,{delayRender:y,continueRender:b}=Yn();typeof window<"u"&&c.useLayoutEffect(()=>{window.remotion_setFrame=(O,j,Z)=>{window.remotion_attempt=Z;const D=y(`Setting the current frame to ${O}`);let X=!0;v(P=>(P[j]??window.remotion_initialFrame)===O?(X=!1,P):{...P,[j]:O}),X?requestAnimationFrame(()=>b(D)):b(D)},window.remotion_isPlayer=!1},[b,y]);const T=c.useMemo(()=>({frame:m,playing:o,imperativePlaying:f,rootId:E,playbackRate:g,setPlaybackRate:Q,audioAndVideoTags:B}),[m,g,o,E]),x=c.useMemo(()=>({setFrame:v,setPlaying:u}),[]);return h.jsx(Ut.Provider,{value:T,children:h.jsx(WA.Provider,{value:x,children:a})})},er=c.createContext({getNonce:()=>0}),ao=()=>{const a=c.useContext(er),[l,o]=c.useState(()=>a.getNonce()),u=c.useRef(a);return c.useEffect(()=>{u.current!==a&&(u.current=a,o(a.getNonce))},[a]),l},IA=c.createContext(!1),ro=({children:a})=>h.jsx(IA.Provider,{value:!0,children:a}),Al=()=>{const a=c.useContext(at),l=a?.width??null,o=a?.height??null,u=a?.durationInFrames??null,f=tl();return c.useMemo(()=>{if(!f)return null;const{id:g,durationInFrames:Q,fps:B,height:E,width:d,defaultProps:v,props:m,defaultCodec:y,defaultOutName:b,defaultVideoImageFormat:T,defaultPixelFormat:x,defaultProResProfile:O}=f;return{id:g,width:l??d,height:o??E,fps:B,durationInFrames:u??Q,defaultProps:v,props:m,defaultCodec:y,defaultOutName:b,defaultVideoImageFormat:T,defaultPixelFormat:x,defaultProResProfile:O}},[u,o,l,f])},kt=()=>{const a=Al(),l=c.useContext(IA),o=Yi();if(!a)throw typeof window<"u"&&window.remotion_isPlayer||o?new Error(["No video config found. Likely reasons:","- You are probably calling useVideoConfig() from outside the component passed to . 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("-")):new Error("No video config found. You are probably calling useVideoConfig() from a component which has not been registered as a . See https://www.remotion.dev/docs/the-fundamentals#defining-compositions for more information.");if(!l)throw new Error("Called useVideoConfig() outside a Remotion composition.");return a},mt=()=>{const a=c.useContext(IA),l=rt();if(!a)throw l.isPlayer?new Error("useCurrentFrame can only be called inside a component that was passed to . See: https://www.remotion.dev/docs/player/examples"):new Error("useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions");const o=Zn(),u=c.useContext(at),f=u?u.cumulatedFrom+u.relativeFrom:0;return o-f},SQ=({frame:a,children:l,active:o=!0})=>{const u=mt(),f=kt();if(typeof a>"u")throw new Error("The component requires a 'frame' prop, but none was passed.");if(typeof a!="number")throw new Error(`The 'frame' prop of must be a number, but is of type ${typeof a}`);if(Number.isNaN(a))throw new Error("The 'frame' prop of must be a real number, but it is NaN.");if(!Number.isFinite(a))throw new Error(`The 'frame' prop of must be a finite number, but it is ${a}.`);const g=c.useMemo(()=>{if(typeof o=="boolean")return o;if(typeof o=="function")return o(u)},[o,u]),Q=c.useContext(Ut),B=c.useContext(at),E=B?.relativeFrom??0,d=c.useMemo(()=>g?{...Q,playing:!1,imperativePlaying:{current:!1},frame:{[f.id]:a+E}}:Q,[g,Q,f.id,a,E]),v=c.useMemo(()=>B?g?{...B,cumulatedFrom:0}:B:null,[B,g]);return h.jsx(Ut.Provider,{value:d,children:h.jsx(at.Provider,{value:v,children:l})})},TQ=({from:a=0,durationInFrames:l=1/0,children:o,name:u,height:f,width:g,showInTimeline:Q=!0,_remotionInternalLoopDisplay:B,_remotionInternalStack:E,_remotionInternalPremountDisplay:d,_remotionInternalPostmountDisplay:v,...m},y)=>{const{layout:b="absolute-fill"}=m,[T]=c.useState(()=>String(Math.random())),x=c.useContext(at),{rootId:O}=c.useContext(Ut),j=x?x.cumulatedFrom+x.relativeFrom:0,Z=ao();if(b!=="absolute-fill"&&b!=="none")throw new TypeError(`The layout prop of expects either "absolute-fill" or "none", but you passed: ${b}`);if(b==="none"&&typeof m.style<"u")throw new TypeError('If layout="none", you may not pass a style.');if(typeof l!="number")throw new TypeError(`You passed to durationInFrames an argument of type ${typeof l}, but it must be a number.`);if(l<=0)throw new TypeError(`durationInFrames must be positive, but got ${l}`);if(typeof a!="number")throw new TypeError(`You passed to the "from" props of your an argument of type ${typeof a}, but it must be a number.`);if(!Number.isFinite(a))throw new TypeError(`The "from" prop of a sequence must be finite, but got ${a}.`);const D=Zn(),X=kt(),P=x?Math.min(x.durationInFrames-a,l):l,L=Math.max(0,Math.min(X.durationInFrames-a,P)),{registerSequence:R,unregisterSequence:K}=c.useContext(GA),{hidden:_}=c.useContext(Ja),ee=c.useMemo(()=>x?.premounting||!!m._remotionInternalIsPremounting,[m._remotionInternalIsPremounting,x?.premounting]),ie=c.useMemo(()=>x?.postmounting||!!m._remotionInternalIsPostmounting,[m._remotionInternalIsPostmounting,x?.postmounting]),re=c.useMemo(()=>({cumulatedFrom:j,relativeFrom:a,durationInFrames:L,parentFrom:x?.relativeFrom??0,id:T,height:f??x?.height??null,width:g??x?.width??null,premounting:ee,postmounting:ie,premountDisplay:d??null,postmountDisplay:v??null}),[j,a,L,x,T,f,g,ee,ie,d,v]),ce=c.useMemo(()=>u??"",[u]),Ee=rt();c.useEffect(()=>{if(Ee.isStudio)return R({from:a,duration:L,id:T,displayName:ce,parent:x?.id??null,type:"sequence",rootId:O,showInTimeline:Q,nonce:Z,loopDisplay:B,stack:E??null,premountDisplay:d??null,postmountDisplay:v??null}),()=>{K(T)}},[l,T,u,R,ce,K,x?.id,L,O,a,Q,Z,B,E,d,v,Ee.isStudio]);const Ce=Math.ceil(j+a+l-1),S=DCe?null:o,k=m.layout==="none"?void 0:m.style,W=c.useMemo(()=>({flexDirection:void 0,...g?{width:g}:{},...f?{height:f}:{},...k??{}}),[f,k,g]);if(y!==null&&b==="none")throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to .');return _[T]??!1?null:h.jsx(at.Provider,{value:re,children:S===null?null:m.layout==="none"?S:h.jsx(Fi,{ref:y,style:W,className:m.className,children:S})})},zQ=c.forwardRef(TQ),NQ=(a,l)=>{const o=mt();if(a.layout==="none")throw new Error('`` with `premountFor` and `postmountFor` props does not support layout="none"');const{style:u,from:f=0,durationInFrames:g=1/0,premountFor:Q=0,postmountFor:B=0,styleWhilePremounted:E,styleWhilePostmounted:d,...v}=a,m=Math.ceil(f+g-1),y=o=f-Q,b=o>m&&o<=m+B,T=y?f:b?f+g-1:0,x=y||b,O=c.useMemo(()=>({...u,opacity:y||b?0:1,pointerEvents:y||b?"none":u?.pointerEvents??void 0,...y?E:{},...b?d:{}}),[u,y,b,E,d]);return h.jsx(SQ,{frame:T,active:x,children:h.jsx(KA,{ref:l,from:f,durationInFrames:g,style:O,_remotionInternalPremountDisplay:Q,_remotionInternalPostmountDisplay:B,_remotionInternalIsPremounting:y,_remotionInternalIsPostmounting:b,...v})})},MQ=c.forwardRef(NQ),VQ=(a,l)=>{const o=rt(),{fps:u}=kt();if(a.layout!=="none"&&!o.isRendering){const f=a.premountFor;if(f||a.postmountFor)return h.jsx(MQ,{ref:l,...a,premountFor:f})}return h.jsx(zQ,{...a,ref:l})},KA=c.forwardRef(VQ),XQ=(a,l,o)=>{switch(a){case"fill":return[0,0,l.width,l.height,0,0,o.width,o.height];case"contain":{const u=Math.min(o.width/l.width,o.height/l.height),f=(o.width-l.width*u)/2,g=(o.height-l.height*u)/2;return[0,0,l.width,l.height,f,g,l.width*u,l.height*u]}case"cover":{const u=Math.max(o.width/l.width,o.height/l.height),f=(o.width-l.width*u)/2,g=(o.height-l.height*u)/2;return[0,0,l.width,l.height,f,g,l.width*u,l.height*u]}default:throw new Error("Unknown fit: "+a)}},jQ=({width:a,height:l,fit:o,className:u,style:f},g)=>{const Q=c.useRef(null),B=c.useCallback(E=>{const d=Q.current,v=a??E.displayWidth,m=l??E.displayHeight;if(!d)throw new Error("Canvas ref is not set");const y=Q.current?.getContext("2d");if(!y)throw new Error("Could not get 2d context");d.width=v,d.height=m,y.drawImage(E,...XQ(o,{height:E.displayHeight,width:E.displayWidth},{width:v,height:m}))},[o,l,a]);return c.useImperativeHandle(g,()=>({draw:B,getCanvas:()=>{if(!Q.current)throw new Error("Canvas ref is not set");return Q.current},clear:()=>{const E=Q.current?.getContext("2d");if(!E)throw new Error("Could not get 2d context");E.clearRect(0,0,Q.current.width,Q.current.height)}}),[B]),h.jsx("canvas",{ref:Q,className:u,style:f})},LQ=Qe.forwardRef(jQ),DQ=5,Hc=({loopBehavior:a,durationFound:l,timeInSec:o})=>a==="loop"?l?o%l:o:Math.min(o,l||1/0),OQ=async({resolvedSrc:a,signal:l,currentTime:o,initialLoopBehavior:u})=>{if(typeof ImageDecoder>"u")throw new Error("Your browser does not support the WebCodecs ImageDecoder API.");const f=await fetch(a,{signal:l}),{body:g}=f;if(!g)throw new Error("Got no body");const Q=new ImageDecoder({data:g,type:f.headers.get("Content-Type")||"image/gif"});await Q.completed;const{selectedTrack:B}=Q.tracks;if(!B)throw new Error("No selected track");const E=[];let d=null;const v=async T=>{const x=E.find(j=>j.frameIndex===T);if(x&&x.frame)return x;const O=await Q.decode({frameIndex:T,completeFramesOnly:!0});return x?x.frame=O.image:E.push({frame:O.image,frameIndex:T,timeInSeconds:O.image.timestamp/1e6}),{frame:O.image,frameIndex:T,timeInSeconds:O.image.timestamp/1e6}},m=T=>{const O=E.filter(j=>j.frame).sort((j,Z)=>{const D=Math.abs(j.timeInSeconds-T),X=Math.abs(Z.timeInSeconds-T);return D-X});for(let j=0;j{const O=Hc({durationFound:d,loopBehavior:x,timeInSec:T}),Z=E.filter(X=>X.timeInSeconds<=O).map(X=>X.frameIndex).reduce((X,P)=>Math.max(X,P),0);let D=Z;for(;;){const X=await v(D);if(D++,!X.frame)throw new Error("No frame found");if(!X.frame.duration||(D===B.frameCount&&d===null&&(d=(X.frame.timestamp+X.frame.duration)/1e6),X.timeInSeconds>O||D===B.frameCount))break}B.frameCount-Z<3&&x==="loop"&&await v(0),m(O)};return await y({timeInSec:o,loopBehavior:u}),await y({timeInSec:o,loopBehavior:u}),{getFrame:async(T,x)=>{if(d!==null&&T>d&&x==="clear-after-finish")return null;const O=Hc({loopBehavior:x,durationFound:d,timeInSec:T});await y({timeInSec:O,loopBehavior:x});const Z=E.filter(D=>D.frame).reduce((D,X)=>{const P=Math.abs(D.timeInSeconds-O),L=Math.abs(X.timeInSeconds-O);return Ptypeof window>"u"?a:new URL(a,window.origin).href;c.forwardRef(({src:a,width:l,height:o,onError:u,loopBehavior:f="loop",playbackRate:g=1,fit:Q="fill",...B},E)=>{const d=c.useRef({isMounted:!0});c.useEffect(()=>{const{current:L}=d;return L.isMounted=!0,()=>{L.isMounted=!1}},[]);const v=HQ(a),[m,y]=c.useState(null),{delayRender:b,continueRender:T}=Yn(),[x]=c.useState(()=>b(`Rendering with src="${v}"`)),O=mt(),{fps:j}=kt(),Z=O/g/j,D=c.useRef(Z);D.current=Z;const X=c.useRef(null);c.useImperativeHandle(E,()=>{const L=X.current?.getCanvas();if(!L)throw new Error("Canvas ref is not set");return L},[]);const[P]=c.useState(()=>f);return c.useEffect(()=>{const L=new AbortController;return OQ({resolvedSrc:v,signal:L.signal,currentTime:D.current,initialLoopBehavior:P}).then(R=>{y(R),T(x)}).catch(R=>{if(R.name==="AbortError"){T(x);return}u?(u?.(R),T(x)):FA(R)}),()=>{L.abort()}},[v,x,u,P,T]),c.useLayoutEffect(()=>{if(!m)return;const L=b(`Rendering frame at ${Z} of `);m.getFrame(Z,f).then(R=>{d.current.isMounted&&(R===null?X.current?.clear():X.current?.draw(R.frame)),T(L)}).catch(R=>{u?(u(R),T(L)):FA(R)})},[Z,m,f,u,a,T,b]),h.jsx(LQ,{ref:X,width:l,height:o,fit:Q,...B})});var RQ=a=>{if(typeof a!="string")throw new TypeError(`The "filename" must be a string, but you passed a value of type ${typeof a}`);if(a.trim()==="")throw new Error("The `filename` must not be empty");if(!a.match(/^([0-9a-zA-Z-!_.*'()/:&$@=;+,?]+)/g))throw new Error('The `filename` must match "/^([0-9a-zA-Z-!_.*\'()/:&$@=;+,?]+)/g". Use forward slashes only, even on Windows.')},UQ=a=>{if(typeof a!="string"&&!(a instanceof Uint8Array))throw new TypeError(`The "content" must be a string or Uint8Array, but you passed a value of type ${typeof a}`);if(typeof a=="string"&&a.trim()==="")throw new Error("The `content` must not be empty")},Rc=a=>{a.type==="artifact"&&(RQ(a.filename),a.contentType!=="thumbnail"&&UQ(a.content))},pA=c.createContext({registerRenderAsset:()=>{},unregisterRenderAsset:()=>{},renderAssets:[]}),kQ=({children:a,collectAssets:l})=>{const[o,u]=c.useState([]),f=c.useRef([]),g=c.useCallback(E=>{Rc(E),f.current=[...f.current,E],u(f.current)},[]);l&&c.useImperativeHandle(l,()=>({collectAssets:()=>{const E=f.current;return f.current=[],u([]),E}}),[]);const Q=c.useCallback(E=>{f.current=f.current.filter(d=>d.id!==E),u(f.current)},[]);c.useLayoutEffect(()=>{typeof window<"u"&&(window.remotion_collectAssets=()=>{const E=f.current;return f.current=[],u([]),E})},[]);const B=c.useMemo(()=>({registerRenderAsset:g,unregisterRenderAsset:Q,renderAssets:o}),[o,g,Q]);return h.jsx(pA.Provider,{value:B,children:a})},cn=a=>typeof window>"u"||a.startsWith("http://")||a.startsWith("https://")||a.startsWith("file://")||a.startsWith("blob:")||a.startsWith("data:")?a:new URL(a,window.origin).href,al=({trimAfter:a,mediaDurationInFrames:l,playbackRate:o,trimBefore:u})=>{let f=l;typeof a<"u"&&(f=a),typeof u<"u"&&(f-=u);const g=f/o;return Math.floor(g)},Uc=c.createContext(null),qQ=()=>Qe.useContext(Uc),rl=({durationInFrames:a,times:l=1/0,children:o,name:u,...f})=>{const g=mt(),{durationInFrames:Q}=kt();if(eo(a,{component:"of the component",allowFloats:!0}),typeof l!="number")throw new TypeError(`You passed to "times" an argument of type ${typeof l}, but it must be a number.`);if(l!==1/0&&l%1!==0)throw new TypeError(`The "times" prop of a loop must be an integer, but got ${l}.`);if(l<0)throw new TypeError(`The "times" prop of a loop must be at least 0, but got ${l}`);const B=Math.ceil(Q/a),E=Math.min(B,l),d=f.layout==="none"?void 0:f.style,v=a*(E-1),y=Math.floor(g/a)*a,b=Math.min(y,v),T=c.useMemo(()=>({numberOfTimes:Math.min(Q/a,l),startOffset:-b,durationInFrames:a}),[Q,a,b,l]),x=c.useMemo(()=>({iteration:Math.floor(g/a),durationInFrames:a}),[g,a]);return h.jsx(Uc.Provider,{value:x,children:h.jsx(KA,{durationInFrames:a,from:b,name:u??"",_remotionInternalLoopDisplay:T,layout:f.layout,style:d,children:o})})};rl.useLoop=qQ;var Ct=({logLevel:a,tag:l,message:o,mountTime:u})=>{const f=[u?Date.now()-u+"ms ":null,l].filter(Boolean).join(" ");Rt.trace({logLevel:a,tag:null},`[${f}]`,o)},ll=c.createContext({}),kc={},lo=[],qc=({children:a})=>{const[l,o]=c.useState(()=>kc);return c.useEffect(()=>{const u=()=>{o(kc)};return lo.push(u),()=>{lo=lo.filter(f=>f!==u)}},[]),h.jsx(ll.Provider,{value:l,children:a})},Pc=a=>{const l=a.indexOf("#");return l===-1?null:l},PQ=a=>{const l=Pc(a);return l===null?a:a.slice(0,l)},JA=a=>{const l=c.useContext(ll),o=Pc(a),u=PQ(a);return l[u]?o!==null?l[u]+a.slice(o):l[u]:a},il=(a,l)=>{if(typeof a.volume!="number"&&typeof a.volume!="function"&&typeof a.volume<"u")throw new TypeError(`You have passed a volume of type ${typeof a.volume} to your <${l} /> component. Volume must be a number or a function with the signature '(frame: number) => number' undefined.`);if(typeof a.volume=="number"&&a.volume<0)throw new TypeError(`You have passed a volume below 0 to your <${l} /> component. Volume must be between 0 and 1`);if(typeof a.playbackRate!="number"&&typeof a.playbackRate<"u")throw new TypeError(`You have passed a playbackRate of type ${typeof a.playbackRate} to your <${l} /> component. Playback rate must a real number or undefined.`);if(typeof a.playbackRate=="number"&&(isNaN(a.playbackRate)||!Number.isFinite(a.playbackRate)||a.playbackRate<=0))throw new TypeError(`You have passed a playbackRate of ${a.playbackRate} to your <${l} /> component. Playback rate must be a real number above 0.`)},ZQ=(a,l)=>{if(typeof a<"u"){if(typeof a!="number")throw new TypeError(`type of startFrom prop must be a number, instead got type ${typeof a}.`);if(isNaN(a)||a===1/0)throw new TypeError("startFrom prop can not be NaN or Infinity.");if(a<0)throw new TypeError(`startFrom must be greater than equal to 0 instead got ${a}.`)}if(typeof l<"u"){if(typeof l!="number")throw new TypeError(`type of endAt prop must be a number, instead got type ${typeof l}.`);if(isNaN(l))throw new TypeError("endAt prop can not be NaN.");if(l<=0)throw new TypeError(`endAt must be a positive number, instead got ${l}.`)}if(l{if(typeof a<"u"){if(typeof a!="number")throw new TypeError(`type of trimBefore prop must be a number, instead got type ${typeof a}.`);if(isNaN(a)||a===1/0)throw new TypeError("trimBefore prop can not be NaN or Infinity.");if(a<0)throw new TypeError(`trimBefore must be greater than equal to 0 instead got ${a}.`)}if(typeof l<"u"){if(typeof l!="number")throw new TypeError(`type of trimAfter prop must be a number, instead got type ${typeof l}.`);if(isNaN(l))throw new TypeError("trimAfter prop can not be NaN.");if(l<=0)throw new TypeError(`trimAfter must be a positive number, instead got ${l}.`)}if(l<=a)throw new TypeError("trimAfter prop must be greater than trimBefore prop.")},ol=({startFrom:a,endAt:l,trimBefore:o,trimAfter:u})=>{if(typeof a<"u"&&typeof o<"u")throw new TypeError("Cannot use both startFrom and trimBefore props. Use trimBefore instead as startFrom is deprecated.");if(typeof l<"u"&&typeof u<"u")throw new TypeError("Cannot use both endAt and trimAfter props. Use trimAfter instead as endAt is deprecated.");typeof o<"u"||typeof u<"u"?GQ(o,u):(typeof a<"u"||typeof l<"u")&&ZQ(a,l)},ul=({startFrom:a,endAt:l,trimBefore:o,trimAfter:u})=>({trimBeforeValue:o??a??void 0,trimAfterValue:u??l??void 0}),YQ=(a,l)=>{if(l.type==="got-duration"){const o=cn(l.src);return a[o]===l.durationInSeconds?a:{...a,[o]:l.durationInSeconds}}else return a},io=c.createContext({durations:{},setDurations:()=>{throw new Error("context missing")}}),Zc=({children:a})=>{const[l,o]=c.useReducer(YQ,{}),u=c.useMemo(()=>({durations:l,setDurations:o}),[l]);return h.jsx(io.Provider,{value:u,children:a})},oo=({crossOrigin:a,requestsVideoFrame:l,isClientSideRendering:o})=>{if(a!=null)return a;if(o||l)return"anonymous"},sl=({mediaRef:a,mediaType:l,onAutoPlayError:o,logLevel:u,mountTime:f,reason:g,isPlayer:Q})=>{const{current:B}=a;if(!B)return;Ct({logLevel:u,tag:"play",message:`Attempting to play ${B.src}. Reason: ${g}`,mountTime:f});const E=B.play();E.catch&&E.catch(d=>{if(B&&!d.message.includes("request was interrupted by a call to pause")&&!d.message.includes("The operation was aborted.")&&!d.message.includes("The fetching process for the media resource was aborted by the user agent")&&!d.message.includes("request was interrupted by a new load request")&&!d.message.includes("because the media was removed from the document")&&!(d.message.includes("user didn't interact with the document")&&B.muted)&&(console.log(`Could not play ${l} due to following error: `,d),!B.muted)){if(o){o();return}l==="video"&&Q&&(Rt.info({logLevel:u,tag:"<"+l+">"},"The video will be muted and we'll retry playing it."),Rt.info({logLevel:u,tag:"<"+l+">"},"Use onAutoPlayError() to handle this error yourself."),B.muted=!0,B.play())}})},uo=({audioContext:a,ref:l})=>{let o=null,u=!1;return{attemptToConnect:()=>{if(u)throw new Error("SharedElementSourceNode has been disposed");!o&&l.current&&(o=a.createMediaElementSource(l.current))},get:()=>{if(!o)throw new Error("Audio element not connected");return o},cleanup:()=>{o&&(o.disconnect(),o=null),u=!0}}},Gc=!1,FQ=a=>{Gc||(Gc=!0,typeof window<"u"&&Rt.warn({logLevel:a,tag:null},"AudioContext is not supported in this browser"))},WQ=({logLevel:a,latencyHint:l,audioEnabled:o})=>{const u=rt();return c.useMemo(()=>u.isRendering||!o?null:typeof AudioContext>"u"?(FQ(a),null):new AudioContext({latencyHint:l,sampleRate:48e3}),[a,l,u.isRendering,o])},Yc="data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",KQ=(a,l)=>{const o=Object.keys(a).sort(),u=Object.keys(l).sort();if(o.length!==u.length)return!1;for(let f=0;fa==="src"&&!o.startsWith("data:")&&!l.startsWith("data:")?new URL(o,window.origin).toString()!==new URL(l,window.origin).toString():o!==l,_A=c.createContext(null),Fc=({children:a,numberOfAudioTags:l,audioLatencyHint:o,audioEnabled:u})=>{const f=c.useRef([]),[g]=c.useState(l);if(l!==g)throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");const Q=Gn(),B=WQ({logLevel:Q,latencyHint:o,audioEnabled:u}),E=c.useMemo(()=>new Array(l).fill(!0).map(()=>{const D=c.createRef();return{id:Math.random(),ref:D,mediaElementSourceNode:B?uo({audioContext:B,ref:D}):null}}),[B,l]);(Qe.useInsertionEffect??Qe.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{E.forEach(({mediaElementSourceNode:D})=>{D?.cleanup()})})},[E]);const v=c.useRef(new Array(l).fill(!1)),m=c.useCallback(()=>{E.forEach(({ref:D,id:X})=>{const P=f.current?.find(R=>R.id===X),{current:L}=D;if(L){if(P===void 0){L.src=Yc;return}if(!P)throw new TypeError("Expected audio data to be there");Object.keys(P.props).forEach(R=>{JQ(R,P.props[R],L[R])&&(L[R]=P.props[R])})}})},[E]),y=c.useCallback(D=>{const{aud:X,audioId:P,premounting:L,postmounting:R}=D,K=f.current?.find(Ce=>Ce.audioId===P);if(K)return K;const _=v.current.findIndex(Ce=>Ce===!1);if(_===-1)throw new Error(`Tried to simultaneously mount ${l+1} tags at the same time. With the current settings, the maximum amount of tags is limited to ${l} 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.`);const{id:ee,ref:ie,mediaElementSourceNode:re}=E[_],ce=[...v.current];ce[_]=ee,v.current=ce;const Ee={props:X,id:ee,el:ie,audioId:P,mediaElementSourceNode:re,premounting:L,audioMounted:!!ie.current,postmounting:R,cleanupOnMediaTagUnmount:()=>{}};return f.current?.push(Ee),m(),Ee},[l,E,m]),b=c.useCallback(D=>{const X=[...v.current],P=E.findIndex(L=>L.id===D);if(P===-1)throw new TypeError("Error occured in ");X[P]=!1,v.current=X,f.current=f.current?.filter(L=>L.id!==D),m()},[E,m]),T=c.useCallback(({aud:D,audioId:X,id:P,premounting:L,postmounting:R})=>{let K=!1;f.current=f.current?.map(_=>{const ee=!!_.el.current;return _.audioMounted!==ee&&(K=!0),_.id===P?KQ(D,_.props)&&_.premounting===L&&_.postmounting===R?_:(K=!0,{..._,props:D,premounting:L,postmounting:R,audioId:X,audioMounted:ee}):_}),K&&m()},[m]),x=$a(),O=rt(),j=c.useCallback(()=>{E.forEach(D=>{f.current.find(P=>P.el===D.ref)?.premounting||sl({mediaRef:D.ref,mediaType:"audio",onAutoPlayError:null,logLevel:Q,mountTime:x,reason:"playing all audios",isPlayer:O.isPlayer})}),B?.resume()},[B,Q,x,E,O.isPlayer]),Z=c.useMemo(()=>({registerAudio:y,unregisterAudio:b,updateAudio:T,playAllAudios:j,numberOfAudioTags:l,audioContext:B}),[l,j,y,b,T,B]);return h.jsxs(_A.Provider,{value:Z,children:[E.map(({id:D,ref:X})=>h.jsx("audio",{ref:X,preload:"metadata",src:Yc},D)),a]})},_Q=({aud:a,audioId:l,premounting:o,postmounting:u})=>{const f=c.useContext(_A),[g]=c.useState(()=>{if(f&&f.numberOfAudioTags>0)return f.registerAudio({aud:a,audioId:l,premounting:o,postmounting:u});const B=Qe.createRef(),E=f?.audioContext?uo({audioContext:f.audioContext,ref:B}):null;return{el:B,id:Math.random(),props:a,audioId:l,mediaElementSourceNode:E,premounting:o,audioMounted:!!B.current,postmounting:u,cleanupOnMediaTagUnmount:()=>{E?.cleanup()}}}),Q=Qe.useInsertionEffect??Qe.useLayoutEffect;return typeof document<"u"&&(Q(()=>{f&&f.numberOfAudioTags>0&&f.updateAudio({id:g.id,aud:a,audioId:l,premounting:o,postmounting:u})},[a,f,g.id,l,o,u]),Q(()=>()=>{f&&f.numberOfAudioTags>0&&f.unregisterAudio(g.id)},[f,g.id])),g},$Q=1e-5,cl=(a,l)=>Math.abs(a-l)<$Q,Wc=(a,l)=>Math.round(a/l*100)/100,so=()=>typeof window>"u"||!/AppleWebKit/.test(window.navigator.userAgent)?!1:!window.navigator.userAgent.includes("Chrome/"),fl=()=>typeof window>"u"?!1:/iP(ad|od|hone)/i.test(window.navigator.userAgent)&&so(),eB=a=>fl()&&a.startsWith("blob:"),co=({actualFrom:a,fps:l})=>Wc(Math.max(0,-a),l),fo=({duration:a,fps:l})=>Wc(a,l),tB=({actualSrc:a,actualFrom:l,duration:o,fps:u})=>{if(eB(a)||a.startsWith("data:")||!!new URL(a,(typeof window>"u"?null:window.location.href)??"http://localhost:3000").hash||!Number.isFinite(l))return a;const g=`${a}#t=${co({actualFrom:l,fps:u})}`;return Number.isFinite(o)?`${g},${fo({duration:o,fps:u})}`:g},nB=({prevStartFrom:a,newStartFrom:l,prevDuration:o,newDuration:u,fps:f})=>{const g=co({actualFrom:a,fps:f}),Q=co({actualFrom:l,fps:f}),B=fo({duration:o,fps:f}),E=fo({duration:u,fps:f});return!(QB)},AB=({actualSrc:a,actualFrom:l,duration:o,fps:u})=>{const f=c.useRef(l),g=c.useRef(o),Q=c.useRef(a);return(!nB({prevStartFrom:f.current,newStartFrom:l,prevDuration:g.current,newDuration:o,fps:u})||a!==Q.current)&&(f.current=l,g.current=o,Q.current=a),tB({actualSrc:Q.current,actualFrom:f.current,duration:g.current,fps:u})},Kc=!1,aB=a=>{Kc||(Kc=!0,Rt.warn({logLevel:a,tag:null},"In Safari, setting a volume and a playback rate at the same time is buggy."),Rt.warn({logLevel:a,tag:null},"In Desktop Safari, only volumes <= 1 will be applied."),Rt.warn({logLevel:a,tag:null},a,"In Mobile Safari, the volume will be ignored and set to 1 if a playbackRate is set."))},Jc=({mediaRef:a,volume:l,logLevel:o,source:u,shouldUseWebAudioApi:f})=>{const g=c.useRef(null),Q=c.useRef(l);Q.current=l;const B=c.useContext(_A);if(!B)throw new Error("useAmplification must be used within a SharedAudioContext");const{audioContext:E}=B;if(typeof window<"u"&&c.useLayoutEffect(()=>{if(!E||!a.current||!f)return;if(a.current.playbackRate!==1&&so()){aB(o);return}if(!u)return;const m=new GainNode(E,{gain:Q.current});return u.attemptToConnect(),u.get().connect(m),m.connect(E.destination),g.current={gainNode:m},Rt.trace({logLevel:o,tag:null},`Starting to amplify ${a.current?.src}. Gain = ${Q.current}, playbackRate = ${a.current?.playbackRate}`),()=>{g.current=null,m.disconnect(),u.get().disconnect()}},[o,a,E,u,f]),g.current){const m=l;cl(g.current.gainNode.gain.value,m)||(g.current.gainNode.gain.value=m,Rt.trace({logLevel:o,tag:null},`Setting gain to ${m} for ${a.current?.src}`))}return(so()&&a.current&&a.current?.playbackRate!==1||!f)&&a.current&&!cl(l,a.current?.volume)&&(a.current.volume=Math.min(l,1)),g},yA=()=>{const a=c.useContext(at);return Math.min(0,a?.relativeFrom??0)},$A=a=>{const l=rl.useLoop(),o=mt(),u=yA();return a==="repeat"||l===null?o+u:o+u+l.durationInFrames*l.iteration},rB=a=>{if(/data:|blob:/.test(a.substring(0,5)))return"Data URL";const l=a.split("/").map(o=>o.split("\\")).flat(1);return l[l.length-1]},bA=({frame:a,volume:l,mediaVolume:o=1})=>{if(typeof l=="number")return l*o;if(typeof l>"u")return Number(o);const u=l(a)*o;if(typeof u!="number")throw new TypeError(`You passed in a a function to the volume prop but it did not return a number but a value of type ${typeof u} for frame ${a}`);if(Number.isNaN(u))throw new TypeError(`You passed in a function to the volume prop but it returned NaN for frame ${a}.`);if(!Number.isFinite(u))throw new TypeError(`You passed in a function to the volume prop but it returned a non-finite number for frame ${a}.`);return Math.max(0,u)},_c={},lB=a=>{_c[a]||(console.warn(a),_c[a]=!0)},$c=({volume:a,mediaVolume:l,mediaType:o,src:u,displayName:f,trimBefore:g,trimAfter:Q,playbackRate:B})=>{if(!u)throw new Error("No src passed");const E=yA(),d=c.useContext(at),v=kt(),[m]=c.useState(()=>a),y=al({mediaDurationInFrames:v.durationInFrames,playbackRate:B,trimBefore:g,trimAfter:Q}),b=d?Math.min(d.durationInFrames,y):y,T=c.useMemo(()=>typeof a=="number"?a:new Array(Math.floor(Math.max(0,b+E))).fill(!0).map((D,X)=>bA({frame:X+E,volume:a,mediaVolume:l})).join(","),[b,E,a,l]);c.useEffect(()=>{typeof a=="number"&&a!==m&&lB(`Remotion: The ${o} with src ${u} 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,o,u,a]);const x=typeof a=="function",O=ao(),{rootId:j}=c.useContext(Ut),Z=rt();return{volumes:T,duration:b,doesVolumeChange:x,nonce:O,rootId:j,isStudio:Z.isStudio,finalDisplayName:f??rB(u)}},go=({volume:a,mediaVolume:l,src:o,mediaType:u,playbackRate:f,displayName:g,id:Q,stack:B,showInTimeline:E,premountDisplay:d,postmountDisplay:v,loopDisplay:m})=>{const y=c.useContext(at),b=yA(),{registerSequence:T,unregisterSequence:x}=c.useContext(GA),{volumes:O,duration:j,doesVolumeChange:Z,nonce:D,rootId:X,isStudio:P,finalDisplayName:L}=$c({volume:a,mediaVolume:l,mediaType:u,src:o,displayName:g,trimAfter:void 0,trimBefore:void 0,playbackRate:f});c.useEffect(()=>{if(!o)throw new Error("No src passed");if(!(!P&&window.process?.env?.NODE_ENV!=="test")&&E)return T({type:u,src:o,id:Q,duration:j,from:0,parent:y?.id??null,displayName:L,rootId:X,volume:O,showInTimeline:!0,nonce:D,startMediaFrom:0-b,doesVolumeChange:Z,loopDisplay:m,playbackRate:f,stack:B,premountDisplay:d,postmountDisplay:v}),()=>{x(Q)}},[j,Q,y,o,T,x,O,Z,D,u,b,f,B,E,d,v,P,m,X,L])},iB=(a,l)=>{const[o,u]=c.useState([]),[f,g]=c.useState([]),[Q,B]=c.useState([]),d=rt().isRendering,v=c.useRef(!1),m=c.useCallback(T=>d?{unblock:()=>{}}:(u(x=>[...x,T]),{unblock:()=>{u(x=>{const O=x.filter(j=>j!==T);return O.length===x.length?x:O})}}),[d]),y=c.useCallback(T=>(g(x=>[...x,T]),{remove:()=>{g(x=>x.filter(O=>O!==T))}}),[]),b=c.useCallback(T=>(B(x=>[...x,T]),{remove:()=>{B(x=>x.filter(O=>O!==T))}}),[]);return c.useEffect(()=>{d||o.length>0&&(f.forEach(T=>T()),Ct({logLevel:a,message:"Player is entering buffer state",mountTime:l,tag:"player"}))},[o]),typeof window<"u"&&c.useLayoutEffect(()=>{d||o.length===0&&(Q.forEach(T=>T()),Ct({logLevel:a,message:"Player is exiting buffer state",mountTime:l,tag:"player"}))},[o]),c.useMemo(()=>({addBlock:m,listenForBuffering:y,listenForResume:b,buffering:v}),[m,v,y,b])},ea=Qe.createContext(null),ef=({children:a})=>{const{logLevel:l,mountTime:o}=c.useContext(hA),u=iB(l??"info",o);return h.jsx(ea.Provider,{value:u,children:a})},tf=a=>{const[l,o]=c.useState(a.buffering.current);return c.useEffect(()=>{const u=()=>{o(!0)},f=()=>{o(!1)};return a.listenForBuffering(u),a.listenForResume(f),()=>{a.listenForBuffering(()=>{}),a.listenForResume(()=>{})}},[a]),l},Eo=()=>{const a=c.useContext(ea),l=a?a.addBlock:null;return c.useMemo(()=>({delayPlayback:()=>{if(!l)throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a . 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");const{unblock:o}=l({id:String(Math.random())});return{unblock:o}}}),[l])},oB=()=>/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent),uB=({mediaRef:a,mediaType:l,onVariableFpsVideoDetected:o,pauseWhenBuffering:u,logLevel:f,mountTime:g})=>{const Q=c.useRef(!1),{delayPlayback:B}=Eo(),E=c.useCallback(d=>{if(l!=="video"||!u)return;const v=a.current;if(!v)return;if(v.readyState>=v.HAVE_FUTURE_DATA&&!oB()){Ct({logLevel:f,message:`Not using buffer until first frame, because readyState is ${v.readyState} and is not Safari or Desktop Chrome`,mountTime:g,tag:"buffer"});return}if(!v.requestVideoFrameCallback){Ct({logLevel:f,message:"Not using buffer until first frame, because requestVideoFrameCallback is not supported",mountTime:g,tag:"buffer"});return}Q.current=!0,Ct({logLevel:f,message:`Buffering ${a.current?.src} until the first frame is received`,mountTime:g,tag:"buffer"});const m=B(),y=()=>{m.unblock(),v.removeEventListener("ended",y,{once:!0}),v.removeEventListener("pause",y,{once:!0}),Q.current=!1},b=()=>{y()};v.requestVideoFrameCallback((T,x)=>{Math.abs(x.mediaTime-d)>.5&&o(),y()}),v.addEventListener("ended",b,{once:!0}),v.addEventListener("pause",b,{once:!0}),v.addEventListener("canplay",b,{once:!0})},[B,f,a,l,g,o,u]);return c.useMemo(()=>({isBuffering:()=>Q.current,bufferUntilFirstFrame:E}),[E])},sB=a=>{const l=Qe.useRef({time:a.current?.currentTime??0,lastUpdate:performance.now()}),o=a.current?.currentTime??null;return o!==null&&l.current.time!==o&&(l.current.time=o,l.current.lastUpdate=performance.now()),l},gl=({mediaRef:a,time:l,logLevel:o,why:u,mountTime:f})=>{const g=fl()?Number(l.toFixed(1)):l;return Ct({logLevel:o,tag:"seek",message:`Seeking from ${a.currentTime} to ${g}. src= ${a.src} Reason: ${u}`,mountTime:f}),a.currentTime=g,g},cB=({element:a,shouldBuffer:l,isPremounting:o,isPostmounting:u,logLevel:f,mountTime:g,src:Q})=>{const B=Eo(),[E,d]=c.useState(!1);return c.useEffect(()=>{let v=[];const{current:m}=a;if(!m||!l)return;if(o||u){if((o||u)&&m.readyState{let O=!1;v.forEach(j=>{j(x),O=!0}),v=[],d(j=>(j&&(O=!0),!1)),O&&Ct({logLevel:f,message:`Unmarking as buffering: ${m.src}. Reason: ${x}`,tag:"buffer",mountTime:g})},b=x=>{d(!0),Ct({logLevel:f,message:`Marking as buffering: ${m.src}. Reason: ${x}`,tag:"buffer",mountTime:g});const{unblock:O}=B.delayPlayback(),j=()=>{y('"canplay" was fired'),T()},Z=()=>{y('"error" event was occurred'),T()};m.addEventListener("canplay",j,{once:!0}),v.push(()=>{m.removeEventListener("canplay",j)}),m.addEventListener("error",Z,{once:!0}),v.push(()=>{m.removeEventListener("error",Z)}),v.push(D=>{Ct({logLevel:f,message:`Unblocking ${m.src} from buffer. Reason: ${D}`,tag:"buffer",mountTime:g}),O()})},T=()=>{if(m.readyState{b('"waiting" event was fired')};m.addEventListener("waiting",x),v.push(()=>{m.removeEventListener("waiting",x)})}};return T(),()=>{y("element was unmounted or prop changed")}},[B,Q,a,o,u,f,l,g]),E},fB=({mediaRef:a,mediaType:l,lastSeek:o,onVariableFpsVideoDetected:u})=>{const f=c.useRef(null);return c.useEffect(()=>{const{current:g}=a;if(g)f.current={time:g.currentTime,lastUpdate:performance.now()};else{f.current=null;return}if(l!=="video"){f.current=null;return}const Q=g;if(!Q.requestVideoFrameCallback)return;let B=()=>{};const E=()=>{if(!Q)return;const d=Q.requestVideoFrameCallback((v,m)=>{if(f.current!==null){const y=Math.abs(f.current.time-m.mediaTime),b=Math.abs(o.current===null?1/0:m.mediaTime-o.current);y>.5&&b>.5&&m.mediaTime>f.current.time&&u()}f.current={time:m.mediaTime,lastUpdate:performance.now()},E()});B=()=>{Q.cancelVideoFrameCallback(d),B=()=>{}}};return E(),()=>{B()}},[o,a,l,u]),f};function gB(a,l,o,u){const{extrapolateLeft:f,extrapolateRight:g,easing:Q}=u;let B=a;const[E,d]=l,[v,m]=o;if(Bd){if(g==="identity")return B;if(g==="clamp")B=d;else if(g==="wrap"){const y=d-E;B=((B-E)%y+y)%y+E}}return v===m?v:(B=(B-E)/(d-E),B=Q(B),B=B*(m-v)+v,B)}function dB(a,l){let o;for(o=1;o=a);++o);return o-1}function EB(a){for(let l=1;la[l-1]))throw new Error(`inputRange must be strictly monotonically increasing but got [${a.join(",")}]`)}function nf(a,l){if(l.length<2)throw new Error(a+" must have at least 2 elements");for(const o of l){if(typeof o!="number")throw new Error(`${a} must contain only numbers`);if(!Number.isFinite(o))throw new Error(`${a} must contain only finite numbers, but got [${l.join(",")}]`)}}function Je(a,l,o,u){if(typeof a>"u")throw new Error("input can not be undefined");if(typeof l>"u")throw new Error("inputRange can not be undefined");if(typeof o>"u")throw new Error("outputRange can not be undefined");if(l.length!==o.length)throw new Error("inputRange ("+l.length+") and outputRange ("+o.length+") must have the same length");nf("inputRange",l),nf("outputRange",o),EB(l);const f=u?.easing??(E=>E);let g="extend";u?.extrapolateLeft!==void 0&&(g=u.extrapolateLeft);let Q="extend";if(u?.extrapolateRight!==void 0&&(Q=u.extrapolateRight),typeof a!="number")throw new TypeError("Cannot interpolate an input which is not a number");const B=dB(a,l);return gB(a,[l[B],l[B+1]],[o[B],o[B+1]],{easing:f,extrapolateLeft:g,extrapolateRight:Q})}var Af=({frame:a,playbackRate:l,startFrom:o})=>Je(a,[-1,o,o+1],[-1,o,o+l]),af=({fps:a,frame:l,playbackRate:o,startFrom:u})=>{const f=Af({frame:l,playbackRate:o,startFrom:u}),g=1e3/a;return f*g/1e3},rf={},CB=(a,l)=>{if(a===null||a.seekable.length===0||a.seekable.length>1||rf[a.src])return;const o={start:a.seekable.start(0),end:a.seekable.end(0)};if(o.start===0&&o.end===0){const u=[`The media ${a.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(`
`);if(l==="console-error")console.error(u);else if(l==="console-warning")console.warn(`The media ${a.src} does not support seeking. The video will render fine, but may not play correctly in the Remotion Studio and in the . See https://remotion.dev/docs/non-seekable-media for an explanation.`);else throw new Error(u);rf[a.src]=!0}},lf=({mediaRef:a,src:l,mediaType:o,playbackRate:u,onlyWarnForMediaSeekingError:f,acceptableTimeshift:g,pauseWhenBuffering:Q,isPremounting:B,isPostmounting:E,onAutoPlayError:d})=>{const{playbackRate:v}=c.useContext(Ut),m=mt(),y=Zn(),[b]=jc(),T=c.useContext(ea),{fps:x}=kt(),O=yA(),j=c.useRef(null),Z=c.useRef(null),D=Gn(),X=$a();if(!T)throw new Error("useMediaPlayback must be used inside a ");const P=c.useRef({}),L=c.useCallback(()=>{l&&(P.current[l]||(Rt.verbose({logLevel:D,tag:null},`Detected ${l} as a variable FPS video. Disabling buffering while seeking.`),P.current[l]=!0))},[D,l]),R=fB({mediaRef:a,mediaType:o,lastSeek:Z,onVariableFpsVideoDetected:L}),K=sB(a),_=af({frame:m,playbackRate:u,startFrom:-O,fps:x}),ee=cB({element:a,shouldBuffer:Q,isPremounting:B,isPostmounting:E,logLevel:D,mountTime:X,src:l??null}),{bufferUntilFirstFrame:ie,isBuffering:re}=uB({mediaRef:a,mediaType:o,onVariableFpsVideoDetected:L,pauseWhenBuffering:Q,logLevel:D,mountTime:X}),ce=u*v,Ee=a.current?.duration?Math.min(a.current.duration,g??.65):g??.65,Ce=tf(T);c.useEffect(()=>{if(a.current?.paused)return;if(!b){Ct({logLevel:D,tag:"pause",message:`Pausing ${a.current?.src} because ${B?"media is premounting":E?"media is postmounting":"Player is not playing"}`,mountTime:X}),a.current?.pause();return}const k=ee||re();T.buffering.current&&!k&&(Ct({logLevel:D,tag:"pause",message:`Pausing ${a.current?.src} because player is buffering but media tag is not`,mountTime:X}),a.current?.pause())},[re,ee,T,Ce,B,D,a,o,X,b,E]);const S=rt();c.useLayoutEffect(()=>{const k=Math.max(0,ce);a.current&&a.current.playbackRate!==k&&(a.current.playbackRate=k)},[a,ce]),c.useEffect(()=>{const k=o==="audio"?"":"";if(!a.current)throw new Error(`No ${o} ref found`);if(!l)throw new Error(`No 'src' attribute was passed to the ${k} element.`);const{duration:W}=a.current,te=!Number.isNaN(W)&&Number.isFinite(W)?Math.min(W,_):_,ge=K.current.time,p=R.current?.time??null,U=P.current[l],F=Math.abs(te-ge),J=p?Math.abs(te-p):null,$=R.current?.lastUpdate&&R.current.time>K.current.lastUpdate?J:F,le=J&&!U?$:F;if(le>Ee&&j.current!==te){Z.current=gl({mediaRef:a.current,time:te,logLevel:D,why:`because time shift is too big. shouldBeTime = ${te}, isTime = ${ge}, requestVideoCallbackTime = ${p}, timeShift = ${le}${U?", isVariableFpsVideo = true":""}, isPremounting = ${B}, isPostmounting = ${E}, pauseWhenBuffering = ${Q}`,mountTime:X}),j.current=Z.current,b&&(ce>0&&ie(te),a.current.paused&&sl({mediaRef:a,mediaType:o,onAutoPlayError:d,logLevel:D,mountTime:X,reason:"player is playing but media tag is paused, and just seeked",isPlayer:S.isPlayer})),f||CB(a.current,f?"console-warning":"console-error");return}const Ae=b?.15:.01,xe=Math.abs(a.current.currentTime-te)>Ae,be=ee||re(),Pe=T.buffering.current&&!be;if(!b||Pe){xe&&(Z.current=gl({mediaRef:a.current,time:te,logLevel:D,why:`not playing or something else is buffering. time offset is over seek threshold (${Ae})`,mountTime:X}));return}if(!b||T.buffering.current)return;const nt=a.current.paused&&!a.current.ended;if(nt||y===0){const Nt=nt?"media tag is paused":"absolute frame is 0";xe&&(Z.current=gl({mediaRef:a.current,time:te,logLevel:D,why:`is over timeshift threshold (threshold = ${Ae}) and ${Nt}`,mountTime:X})),sl({mediaRef:a,mediaType:o,onAutoPlayError:d,logLevel:D,mountTime:X,reason:`player is playing and ${Nt}`,isPlayer:S.isPlayer}),!U&&ce>0&&ie(te)}},[y,Ee,ie,T.buffering,R,D,_,re,ee,a,o,f,ce,b,l,d,B,E,Q,X,K,S.isPlayer])},of=({mediaRef:a,id:l,mediaType:o,onAutoPlayError:u,isPremounting:f,isPostmounting:g})=>{const{audioAndVideoTags:Q,imperativePlaying:B}=c.useContext(Ut),E=Gn(),d=$a(),v=rt();c.useEffect(()=>{const m={id:l,play:y=>{if(B.current&&!(f||g))return sl({mediaRef:a,mediaType:o,onAutoPlayError:u,logLevel:E,mountTime:d,reason:y,isPlayer:v.isPlayer})}};return Q.current.push(m),()=>{Q.current=Q.current.filter(y=>y.id!==l)}},[Q,l,a,o,u,B,f,g,E,d,v.isPlayer])},Co=c.createContext({mediaMuted:!1,mediaVolume:1}),Qo=c.createContext({setMediaMuted:()=>{throw new Error("default")},setMediaVolume:()=>{throw new Error("default")}}),Bo=()=>{const{mediaVolume:a}=c.useContext(Co),{setMediaVolume:l}=c.useContext(Qo);return c.useMemo(()=>[a,l],[a,l])},mo=()=>{const{mediaMuted:a}=c.useContext(Co),{setMediaMuted:l}=c.useContext(Qo);return c.useMemo(()=>[a,l],[a,l])},ta=a=>{if(a>=100)throw new Error(`Volume was set to ${a}, 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.`)},QB=(a,l)=>{const[o]=c.useState(a.shouldPreMountAudioTags);if(a.shouldPreMountAudioTags!==o)throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");const u=Gn(),{volume:f,muted:g,playbackRate:Q,shouldPreMountAudioTags:B,src:E,onDuration:d,acceptableTimeShiftInSeconds:v,_remotionInternalNeedsDurationCalculation:m,_remotionInternalNativeLoopPassed:y,_remotionInternalStack:b,allowAmplificationDuringRender:T,name:x,pauseWhenBuffering:O,showInTimeline:j,loopVolumeCurveBehavior:Z,stack:D,crossOrigin:X,delayRenderRetries:P,delayRenderTimeoutInMilliseconds:L,toneFrequency:R,useWebAudioApi:K,onError:_,onNativeError:ee,audioStreamIndex:ie,...re}=a,[ce]=Bo(),[Ee]=mo(),Ce=$A(Z??"repeat"),{hidden:S}=c.useContext(Ja);if(!E)throw new TypeError("No 'src' was passed to .");const k=JA(E),W=c.useContext(at),[te]=c.useState(()=>String(Math.random())),ge=S[te]??!1,p=bA({frame:Ce,volume:f,mediaVolume:ce});ta(p);const U=oo({crossOrigin:X,requestsVideoFrame:!1,isClientSideRendering:!1}),F=c.useMemo(()=>({muted:g||Ee||ge||p<=0,src:k,loop:y,crossOrigin:U,...re}),[y,ge,Ee,g,re,k,p,U]),J=c.useMemo(()=>`audio-${mA(E??"")}-${W?.relativeFrom}-${W?.cumulatedFrom}-${W?.durationInFrames}-muted:${a.muted}-loop:${a.loop}`,[E,W?.relativeFrom,W?.cumulatedFrom,W?.durationInFrames,a.muted,a.loop]),{el:$,mediaElementSourceNode:le,cleanupOnMediaTagUnmount:Ae}=_Q({aud:F,audioId:J,premounting:!!W?.premounting,postmounting:!!W?.postmounting});go({volume:f,mediaVolume:ce,src:E,mediaType:"audio",playbackRate:Q??1,displayName:x??null,id:te,stack:b,showInTimeline:j,premountDisplay:W?.premountDisplay??null,postmountDisplay:W?.postmountDisplay??null,loopDisplay:void 0}),lf({mediaRef:$,src:E,mediaType:"audio",playbackRate:Q??1,onlyWarnForMediaSeekingError:!1,acceptableTimeshift:v??null,isPremounting:!!W?.premounting,isPostmounting:!!W?.postmounting,pauseWhenBuffering:O,onAutoPlayError:null}),of({id:te,isPostmounting:!!W?.postmounting,isPremounting:!!W?.premounting,mediaRef:$,mediaType:"audio",onAutoPlayError:null}),Jc({logLevel:u,mediaRef:$,source:le,volume:p,shouldUseWebAudioApi:K??!1}),(Qe.useInsertionEffect??Qe.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{Ae()})},[Ae]),c.useImperativeHandle(l,()=>$.current,[$]);const be=c.useRef(d);return be.current=d,c.useEffect(()=>{const{current:Pe}=$;if(!Pe)return;if(Pe.duration){be.current?.(Pe.src,Pe.duration);return}const nt=()=>{be.current?.(Pe.src,Pe.duration)};return Pe.addEventListener("loadedmetadata",nt),()=>{Pe.removeEventListener("loadedmetadata",nt)}},[$,E]),o?null:h.jsx("audio",{ref:$,preload:"metadata",crossOrigin:U,...F})},uf=c.forwardRef(QB),BB=(a,l)=>{const o=c.useRef(null),{volume:u,playbackRate:f,allowAmplificationDuringRender:g,onDuration:Q,toneFrequency:B,_remotionInternalNeedsDurationCalculation:E,_remotionInternalNativeLoopPassed:d,acceptableTimeShiftInSeconds:v,name:m,onNativeError:y,delayRenderRetries:b,delayRenderTimeoutInMilliseconds:T,loopVolumeCurveBehavior:x,pauseWhenBuffering:O,audioStreamIndex:j,...Z}=a,D=Zn(),X=$A(x??"repeat"),P=mt(),L=c.useContext(at),{registerRenderAsset:R,unregisterRenderAsset:K}=c.useContext(pA),{delayRender:_,continueRender:ee}=Yn(),ie=c.useMemo(()=>`audio-${mA(a.src??"")}-${L?.relativeFrom}-${L?.cumulatedFrom}-${L?.durationInFrames}`,[a.src,L?.relativeFrom,L?.cumulatedFrom,L?.durationInFrames]),re=bA({volume:u,frame:X,mediaVolume:1});ta(re),c.useImperativeHandle(l,()=>o.current,[]),c.useEffect(()=>{if(!a.src)throw new Error("No src passed");if(window.remotion_audioEnabled&&!a.muted&&!(re<=0))return R({type:"audio",src:cn(a.src),id:ie,frame:D,volume:re,mediaFrame:P,playbackRate:a.playbackRate??1,toneFrequency:B??1,audioStartFrame:Math.max(0,-(L?.relativeFrom??0)),audioStreamIndex:j??0}),()=>K(ie)},[a.muted,a.src,R,D,ie,K,re,X,P,f,a.playbackRate,B,L?.relativeFrom,j]);const{src:ce}=a,Ee=l||E;return c.useLayoutEffect(()=>{if(window.process?.env?.NODE_ENV==="test"||!Ee)return;const Ce=_("Loading duration with src="+ce,{retries:b??void 0,timeoutInMilliseconds:T??void 0}),{current:S}=o,k=()=>{S?.duration&&Q(S.src,S.duration),ee(Ce)};return S?.duration?(Q(S.src,S.duration),ee(Ce)):S?.addEventListener("loadedmetadata",k,{once:!0}),()=>{S?.removeEventListener("loadedmetadata",k),ee(Ce)}},[ce,Q,Ee,b,T,ee,_]),Ee?h.jsx("audio",{ref:o,...Z,onError:y}):null},mB=c.forwardRef(BB),vB=(a,l)=>{const o=c.useContext(_A),{startFrom:u,endAt:f,trimBefore:g,trimAfter:Q,name:B,stack:E,pauseWhenBuffering:d,showInTimeline:v,onError:m,...y}=a,{loop:b,...T}=a,{fps:x}=kt(),O=rt();if(O.isClientSideRendering)throw new Error(" is not supported in @remotion/web-renderer. Use