var w1=Object.defineProperty;var x1=(Xn,en,he)=>en in Xn?w1(Xn,en,{enumerable:!0,configurable:!0,writable:!0,value:he}):Xn[en]=he;var Pe=(Xn,en,he)=>x1(Xn,typeof en!="symbol"?en+"":en,he);(function(){"use strict";function Xn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var en={exports:{}},he={};var $c;function kp(){if($c)return he;$c=1;var r=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),g=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),C=Symbol.iterator;function T(S){return S===null||typeof S!="object"?null:(S=C&&S[C]||S["@@iterator"],typeof S=="function"?S:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,U={};function V(S,Y,J){this.props=S,this.context=Y,this.refs=U,this.updater=J||N}V.prototype.isReactComponent={},V.prototype.setState=function(S,Y){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,Y,"setState")},V.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function Z(){}Z.prototype=V.prototype;function k(S,Y,J){this.props=S,this.context=Y,this.refs=U,this.updater=J||N}var B=k.prototype=new Z;B.constructor=k,M(B,V.prototype),B.isPureReactComponent=!0;var Q=Array.isArray;function H(){}var G={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function _(S,Y,J){var I=J.ref;return{$$typeof:r,type:S,key:Y,ref:I!==void 0?I:null,props:J}}function ee(S,Y){return _(S.type,Y,S.props)}function oe(S){return typeof S=="object"&&S!==null&&S.$$typeof===r}function le(S){var Y={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(J){return Y[J]})}var fe=/\/+/g;function ve(S,Y){return typeof S=="object"&&S!==null&&S.key!=null?le(""+S.key):Y.toString(36)}function pe(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(H,H):(S.status="pending",S.then(function(Y){S.status==="pending"&&(S.status="fulfilled",S.value=Y)},function(Y){S.status==="pending"&&(S.status="rejected",S.reason=Y)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function R(S,Y,J,I,$){var ie=typeof S;(ie==="undefined"||ie==="boolean")&&(S=null);var ae=!1;if(S===null)ae=!0;else switch(ie){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(S.$$typeof){case r:case o:ae=!0;break;case A:return ae=S._init,R(ae(S._payload),Y,J,I,$)}}if(ae)return $=$(S),ae=I===""?"."+ve(S,0):I,Q($)?(J="",ae!=null&&(J=ae.replace(fe,"$&/")+"/"),R($,Y,J,"",function(Xe){return Xe})):$!=null&&(oe($)&&($=ee($,J+($.key==null||S&&S.key===$.key?"":(""+$.key).replace(fe,"$&/")+"/")+ae)),Y.push($)),1;ae=0;var Re=I===""?".":I+":";if(Q(S))for(var Ce=0;Ce>>1,me=R[te];if(0>>1;ted(J,P))Id($,J)?(R[te]=$,R[I]=P,te=I):(R[te]=J,R[Y]=P,te=Y);else if(Id($,P))R[te]=$,R[I]=P,te=I;else break e}}return q}function d(R,q){var P=R.sortIndex-q.sortIndex;return P!==0?P:R.id-q.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;r.unstable_now=function(){return h.now()}}else{var g=Date,y=g.now();r.unstable_now=function(){return g.now()-y}}var v=[],m=[],A=1,b=null,C=3,T=!1,N=!1,M=!1,U=!1,V=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function B(R){for(var q=s(m);q!==null;){if(q.callback===null)u(m);else if(q.startTime<=R)u(m),q.sortIndex=q.expirationTime,o(v,q);else break;q=s(m)}}function Q(R){if(M=!1,B(R),!N)if(s(v)!==null)N=!0,H||(H=!0,le());else{var q=s(m);q!==null&&pe(Q,q.startTime-R)}}var H=!1,G=-1,W=5,_=-1;function ee(){return U?!0:!(r.unstable_now()-_R&&ee());){var te=b.callback;if(typeof te=="function"){b.callback=null,C=b.priorityLevel;var me=te(b.expirationTime<=R);if(R=r.unstable_now(),typeof me=="function"){b.callback=me,B(R),q=!0;break t}b===s(v)&&u(v),B(R)}else u(v);b=s(v)}if(b!==null)q=!0;else{var S=s(m);S!==null&&pe(Q,S.startTime-R),q=!1}}break e}finally{b=null,C=P,T=!1}q=void 0}}finally{q?le():H=!1}}}var le;if(typeof k=="function")le=function(){k(oe)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,ve=fe.port2;fe.port1.onmessage=oe,le=function(){ve.postMessage(null)}}else le=function(){V(oe,0)};function pe(R,q){G=V(function(){R(r.unstable_now())},q)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(R){R.callback=null},r.unstable_forceFrameRate=function(R){0>R||125te?(R.sortIndex=P,o(m,R),s(v)===null&&R===s(m)&&(M?(Z(G),G=-1):M=!0,pe(Q,P-te))):(R.sortIndex=me,o(v,R),N||T||(N=!0,H||(H=!0,le()))),R},r.unstable_shouldYield=ee,r.unstable_wrapCallback=function(R){var q=C;return function(){var P=C;C=q;try{return R.apply(this,arguments)}finally{C=P}}}})(Lo)),Lo}var nf;function Up(){return nf||(nf=1,Uo.exports=Hp()),Uo.exports}var Go={exports:{}},mt={};var af;function Lp(){if(af)return mt;af=1;var r=ko();function o(v){var m="https://react.dev/errors/"+v;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(o){console.error(o)}}return r(),Go.exports=Lp(),Go.exports}var of;function Gp(){if(of)return Fr;of=1;var r=Up(),o=ko(),s=lf();function u(e){var t="https://react.dev/errors/"+e;if(1me||(e.current=te[me],te[me]=null,me--)}function J(e,t){me++,te[me]=e.current,e.current=t}var I=S(null),$=S(null),ie=S(null),ae=S(null);function Re(e,t){switch(J(ie,t),J($,e),J(I,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?lp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=lp(t),e=ip(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y(I),J(I,e)}function Ce(){Y(I),Y($),Y(ie)}function Xe(e){e.memoizedState!==null&&J(ae,e);var t=I.current,n=ip(t,e.type);t!==n&&(J($,e),J(I,n))}function et(e){$.current===e&&(Y(I),Y($)),ae.current===e&&(Y(ae),Zl._currentValue=P)}var Gt,Rt;function gt(e){if(Gt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Gt=t&&t[1]||"",Rt=-1)":-1l||x[a]!==O[l]){var X=` `+x[a].replace(" at new "," at ");return e.displayName&&X.includes("")&&(X=X.replace("",e.displayName)),X}while(1<=a&&0<=l);break}}}finally{De=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?gt(n):""}function rn(e,t){switch(e.tag){case 26:case 27:case 5:return gt(e.type);case 16:return gt("Lazy");case 13:return e.child!==t&&t!==null?gt("Suspense Fallback"):gt("Suspense");case 19:return gt("SuspenseList");case 0:case 15:return ue(e.type,!1);case 11:return ue(e.type.render,!1);case 1:return ue(e.type,!0);case 31:return gt("Activity");default:return""}}function dn(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,Yt=r.unstable_scheduleCallback,wn=r.unstable_cancelCallback,qt=r.unstable_shouldYield,yt=r.unstable_requestPaint,rt=r.unstable_now,mn=r.unstable_getCurrentPriorityLevel,xn=r.unstable_ImmediatePriority,Jn=r.unstable_UserBlockingPriority,Xt=r.unstable_NormalPriority,Sn=r.unstable_LowPriority,ln=r.unstable_IdlePriority,Pn=r.log,yi=r.unstable_setDisableYieldValue,bt=null,ut=null;function hn(e){if(typeof Pn=="function"&&yi(e),ut&&typeof ut.setStrictMode=="function")try{ut.setStrictMode(bt,e)}catch{}}var vt=Math.clz32?Math.clz32:Gu,bi=Math.log,Lu=Math.LN2;function Gu(e){return e>>>=0,e===0?32:31-(bi(e)/Lu|0)|0}var rr=256,lr=262144,ir=4194304;function En(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 or(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var l=0,i=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var p=a&134217727;return p!==0?(a=p&~i,a!==0?l=En(a):(c&=p,c!==0?l=En(c):n||(n=p&~e,n!==0&&(l=En(n))))):(p=a&~i,p!==0?l=En(p):c!==0?l=En(c):n||(n=a&~e,n!==0&&(l=En(n)))),l===0?0:t!==0&&t!==l&&(t&i)===0&&(i=l&-l,n=t&-t,i>=n||i===32&&(n&4194048)!==0)?t:l}function vn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ur(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 Ai(){var e=ir;return ir<<=1,(ir&62914560)===0&&(ir=4194304),e}function al(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function wi(e,t,n,a,l,i){var c=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 p=e.entanglements,x=e.expirationTimes,O=e.hiddenUpdates;for(n=c&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var vA=/[\n"\\]/g;function Zt(e){return e.replace(vA,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ku(e,t,n,a,l,i,c,p){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Qt(t)):e.value!==""+Qt(t)&&(e.value=""+Qt(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?Ju(e,c,Qt(t)):n!=null?Ju(e,c,Qt(n)):a!=null&&e.removeAttribute("value"),l==null&&i!=null&&(e.defaultChecked=!!i),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+Qt(p):e.removeAttribute("name")}function $d(e,t,n,a,l,i,c,p){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)){Fu(e);return}n=n!=null?""+Qt(n):"",t=t!=null?""+Qt(t):n,p||t===e.value||(e.value=t),e.defaultValue=t}a=a??l,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=p?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),Fu(e)}function Ju(e,t,n){t==="number"&&Ci(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function mr(e,t,n,a){if(e=e.options,t){t={};for(var l=0;l"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$u=!1;if(Rn)try{var sl={};Object.defineProperty(sl,"passive",{get:function(){$u=!0}}),window.addEventListener("test",sl,sl),window.removeEventListener("test",sl,sl)}catch{$u=!1}var Wn=null,es=null,Ri=null;function im(){if(Ri)return Ri;var e,t=es,n=t.length,a,l="value"in Wn?Wn.value:Wn.textContent,i=l.length;for(e=0;e=dl),dm=" ",mm=!1;function hm(e,t){switch(e){case"keyup":return XA.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gr=!1;function ZA(e,t){switch(e){case"compositionend":return vm(t);case"keypress":return t.which!==32?null:(mm=!0,dm);case"textInput":return e=t.data,e===dm&&mm?null:e;default:return null}}function FA(e,t){if(gr)return e==="compositionend"||!ls&&hm(e,t)?(e=im(),Ri=es=Wn=null,gr=!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=Sm(n)}}function Cm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ci(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=Ci(e.document)}return t}function us(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 ew=Rn&&"documentMode"in document&&11>=document.documentMode,yr=null,ss=null,pl=null,cs=!1;function Rm(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cs||yr==null||yr!==Ci(a)||(a=yr,"selectionStart"in a&&us(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}),pl&&vl(pl,a)||(pl=a,a=wo(ss,"onSelect"),0>=c,l-=c,gn=1<<32-vt(t)+l|n<be?(Ee=re,re=null):Ee=re.sibling;var Ne=j(z,re,D[be],F);if(Ne===null){re===null&&(re=Ee);break}e&&re&&Ne.alternate===null&&t(z,re),E=i(Ne,E,be),ze===null?se=Ne:ze.sibling=Ne,ze=Ne,re=Ee}if(be===D.length)return n(z,re),Te&&zn(z,be),se;if(re===null){for(;bebe?(Ee=re,re=null):Ee=re.sibling;var ya=j(z,re,Ne.value,F);if(ya===null){re===null&&(re=Ee);break}e&&re&&ya.alternate===null&&t(z,re),E=i(ya,E,be),ze===null?se=ya:ze.sibling=ya,ze=ya,re=Ee}if(Ne.done)return n(z,re),Te&&zn(z,be),se;if(re===null){for(;!Ne.done;be++,Ne=D.next())Ne=K(z,Ne.value,F),Ne!==null&&(E=i(Ne,E,be),ze===null?se=Ne:ze.sibling=Ne,ze=Ne);return Te&&zn(z,be),se}for(re=a(re);!Ne.done;be++,Ne=D.next())Ne=L(re,z,be,Ne.value,F),Ne!==null&&(e&&Ne.alternate!==null&&re.delete(Ne.key===null?be:Ne.key),E=i(Ne,E,be),ze===null?se=Ne:ze.sibling=Ne,ze=Ne);return e&&re.forEach(function(A1){return t(z,A1)}),Te&&zn(z,be),se}function Ue(z,E,D,F){if(typeof D=="object"&&D!==null&&D.type===M&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case T:e:{for(var se=D.key;E!==null;){if(E.key===se){if(se=D.type,se===M){if(E.tag===7){n(z,E.sibling),F=l(E,D.props.children),F.return=z,z=F;break e}}else if(E.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===W&&Ua(se)===E.type){n(z,E.sibling),F=l(E,D.props),xl(F,D),F.return=z,z=F;break e}n(z,E);break}else t(z,E);E=E.sibling}D.type===M?(F=ja(D.props.children,z.mode,F,D.key),F.return=z,z=F):(F=Hi(D.type,D.key,D.props,null,z.mode,F),xl(F,D),F.return=z,z=F)}return c(z);case N:e:{for(se=D.key;E!==null;){if(E.key===se)if(E.tag===4&&E.stateNode.containerInfo===D.containerInfo&&E.stateNode.implementation===D.implementation){n(z,E.sibling),F=l(E,D.children||[]),F.return=z,z=F;break e}else{n(z,E);break}else t(z,E);E=E.sibling}F=gs(D,z.mode,F),F.return=z,z=F}return c(z);case W:return D=Ua(D),Ue(z,E,D,F)}if(pe(D))return ne(z,E,D,F);if(le(D)){if(se=le(D),typeof se!="function")throw Error(u(150));return D=se.call(D),de(z,E,D,F)}if(typeof D.then=="function")return Ue(z,E,Qi(D),F);if(D.$$typeof===k)return Ue(z,E,Gi(z,D),F);Zi(z,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,E!==null&&E.tag===6?(n(z,E.sibling),F=l(E,D),F.return=z,z=F):(n(z,E),F=ps(D,z.mode,F),F.return=z,z=F),c(z)):n(z,E)}return function(z,E,D,F){try{wl=0;var se=Ue(z,E,D,F);return zr=null,se}catch(re){if(re===Mr||re===qi)throw re;var ze=Nt(29,re,null,z.mode);return ze.lanes=F,ze.return=z,ze}}}var Ga=Wm(!0),Im=Wm(!1),ta=!1;function zs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ns(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,(Oe&2)!==0){var l=a.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),a.pending=t,t=ki(e),Bm(e,null,n),t}return Vi(e,a,t,n),ki(e)}function Sl(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,qu(e,n)}}function Ds(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var c={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};i===null?l=i=c:i=i.next=c,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:a.baseState,firstBaseUpdate:l,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 Os=!1;function El(){if(Os){var e=Rr;if(e!==null)throw e}}function Cl(e,t,n,a){Os=!1;var l=e.updateQueue;ta=!1;var i=l.firstBaseUpdate,c=l.lastBaseUpdate,p=l.shared.pending;if(p!==null){l.shared.pending=null;var x=p,O=x.next;x.next=null,c===null?i=O:c.next=O,c=x;var X=e.alternate;X!==null&&(X=X.updateQueue,p=X.lastBaseUpdate,p!==c&&(p===null?X.firstBaseUpdate=O:p.next=O,X.lastBaseUpdate=x))}if(i!==null){var K=l.baseState;c=0,X=O=x=null,p=i;do{var j=p.lane&-536870913,L=j!==p.lane;if(L?(Se&j)===j:(a&j)===j){j!==0&&j===Tr&&(Os=!0),X!==null&&(X=X.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var ne=e,de=p;j=t;var Ue=n;switch(de.tag){case 1:if(ne=de.payload,typeof ne=="function"){K=ne.call(Ue,K,j);break e}K=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=de.payload,j=typeof ne=="function"?ne.call(Ue,K,j):ne,j==null)break e;K=b({},K,j);break e;case 2:ta=!0}}j=p.callback,j!==null&&(e.flags|=64,L&&(e.flags|=8192),L=l.callbacks,L===null?l.callbacks=[j]:L.push(j))}else L={lane:j,tag:p.tag,payload:p.payload,callback:p.callback,next:null},X===null?(O=X=L,x=K):X=X.next=L,c|=j;if(p=p.next,p===null){if(p=l.shared.pending,p===null)break;L=p,p=L.next,L.next=null,l.lastBaseUpdate=L,l.shared.pending=null}}while(!0);X===null&&(x=K),l.baseState=x,l.firstBaseUpdate=O,l.lastBaseUpdate=X,i===null&&(l.shared.lanes=0),ua|=c,e.lanes=c,e.memoizedState=K}}function _m(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function $m(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ei?i:8;var c=R.T,p={};R.T=p,Is(e,!1,t,n);try{var x=l(),O=R.S;if(O!==null&&O(p,x),x!==null&&typeof x=="object"&&typeof x.then=="function"){var X=sw(x,a);Ml(e,t,X,Vt(e))}else Ml(e,t,a,Vt(e))}catch(K){Ml(e,t,{then:function(){},status:"rejected",reason:K},Vt())}finally{q.p=i,c!==null&&p.types!==null&&(c.types=p.types),R.T=c}}function vw(){}function Ps(e,t,n,a){if(e.tag!==5)throw Error(u(476));var l=Dh(e).queue;Nh(e,l,t,P,n===null?vw:function(){return Oh(e),n(a)})}function Dh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jn,lastRenderedState:P},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Oh(e){var t=Dh(e);t.next===null&&(t=e.alternate.memoizedState),Ml(e,t.next.queue,{},Vt())}function Ws(){return ct(Zl)}function jh(){return Je().memoizedState}function Bh(){return Je().memoizedState}function pw(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Vt();e=na(n);var a=aa(t,e,n);a!==null&&(Ct(a,t,n),Sl(a,t,n)),t={cache:Cs()},e.payload=t;return}t=t.return}}function gw(e,t,n){var a=Vt();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},to(e)?kh(t,n):(n=hs(e,t,n,a),n!==null&&(Ct(n,e,a),Hh(n,t,a)))}function Vh(e,t,n){var a=Vt();Ml(e,t,n,a)}function Ml(e,t,n,a){var l={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(to(e))kh(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var c=t.lastRenderedState,p=i(c,n);if(l.hasEagerState=!0,l.eagerState=p,zt(p,c))return Vi(e,t,l,0),Le===null&&Bi(),!1}catch{}if(n=hs(e,t,l,a),n!==null)return Ct(n,e,a),Hh(n,t,a),!0}return!1}function Is(e,t,n,a){if(a={lane:2,revertLane:zc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},to(e)){if(t)throw Error(u(479))}else t=hs(e,n,a,2),t!==null&&Ct(t,e,2)}function to(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function kh(e,t){Dr=Ji=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Hh(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,qu(e,n)}}var zl={readContext:ct,use:Ii,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useLayoutEffect:Qe,useInsertionEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useSyncExternalStore:Qe,useId:Qe,useHostTransitionStatus:Qe,useFormState:Qe,useActionState:Qe,useOptimistic:Qe,useMemoCache:Qe,useCacheRefresh:Qe};zl.useEffectEvent=Qe;var Uh={readContext:ct,use:Ii,useCallback:function(e,t){return pt().memoizedState=[e,t===void 0?null:t],e},useContext:ct,useEffect:wh,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,$i(4194308,4,Ch.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $i(4194308,4,e,t)},useInsertionEffect:function(e,t){$i(4,2,e,t)},useMemo:function(e,t){var n=pt();t=t===void 0?null:t;var a=e();if(Ya){hn(!0);try{e()}finally{hn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=pt();if(n!==void 0){var l=n(t);if(Ya){hn(!0);try{n(t)}finally{hn(!1)}}}else l=t;return a.memoizedState=a.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},a.queue=e,e=e.dispatch=gw.bind(null,ye,e),[a.memoizedState,e]},useRef:function(e){var t=pt();return e={current:e},t.memoizedState=e},useState:function(e){e=Qs(e);var t=e.queue,n=Vh.bind(null,ye,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ks,useDeferredValue:function(e,t){var n=pt();return Js(n,e,t)},useTransition:function(){var e=Qs(!1);return e=Nh.bind(null,ye,e.queue,!0,!1),pt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=ye,l=pt();if(Te){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),Le===null)throw Error(u(349));(Se&127)!==0||lh(a,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,wh(oh.bind(null,a,i,e),[e]),a.flags|=2048,jr(9,{destroy:void 0},ih.bind(null,a,i,n,t),null),n},useId:function(){var e=pt(),t=Le.identifierPrefix;if(Te){var n=yn,a=gn;n=(a&~(1<<32-vt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Pi++,0<\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?i.multiple=!0:a.size&&(i.size=a.size);break;default:i=typeof a.is=="string"?c.createElement(l,{is:a.is}):c.createElement(l)}}i[je]=t,i[Fe]=a;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)i.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=i;e:switch(dt(i,l,a),l){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Vn(t)}}return Ye(t),fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Vn(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(u(166));if(e=ie.current,Er(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,l=st,l!==null)switch(l.tag){case 27:case 5:a=l.memoizedProps}e[je]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||ap(e.nodeValue,n)),e||$n(t,!0)}else e=xo(e).createTextNode(a),e[je]=t,t.stateNode=e}return Ye(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Er(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[je]=t}else Ba(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ye(t),e=!1}else n=ws(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ot(t),t):(Ot(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Ye(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=Er(t),a!==null&&a.dehydrated!==null){if(e===null){if(!l)throw Error(u(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(u(317));l[je]=t}else Ba(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ye(t),l=!1}else l=ws(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(Ot(t),t):(Ot(t),null)}return Ot(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,l=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(l=a.alternate.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==l&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),io(t,t.updateQueue),Ye(t),null);case 4:return Ce(),e===null&&jc(t.stateNode.containerInfo),Ye(t),null;case 10:return Dn(t.type),Ye(t),null;case 19:if(Y(Ke),a=t.memoizedState,a===null)return Ye(t),null;if(l=(t.flags&128)!==0,i=a.rendering,i===null)if(l)Dl(a,!1);else{if(Ze!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=Ki(e),i!==null){for(t.flags|=128,Dl(a,!1),e=i.updateQueue,t.updateQueue=e,io(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Vm(n,e),n=n.sibling;return J(Ke,Ke.current&1|2),Te&&zn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&rt()>fo&&(t.flags|=128,l=!0,Dl(a,!1),t.lanes=4194304)}else{if(!l)if(e=Ki(i),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,io(t,e),Dl(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!Te)return Ye(t),null}else 2*rt()-a.renderingStartTime>fo&&n!==536870912&&(t.flags|=128,l=!0,Dl(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=rt(),e.sibling=null,n=Ke.current,J(Ke,l?n&1|2:n&1),Te&&zn(t,a.treeForkCount),e):(Ye(t),null);case 22:case 23:return Ot(t),Bs(),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&&(Ye(t),t.subtreeFlags&6&&(t.flags|=8192)):Ye(t),n=t.updateQueue,n!==null&&io(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&&Y(Ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Dn(We),Ye(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function xw(e,t){switch(bs(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Dn(We),Ce(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return et(t),null;case 31:if(t.memoizedState!==null){if(Ot(t),t.alternate===null)throw Error(u(340));Ba()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ot(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Ba()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Y(Ke),null;case 4:return Ce(),null;case 10:return Dn(t.type),null;case 22:case 23:return Ot(t),Bs(),e!==null&&Y(Ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Dn(We),null;case 25:return null;default:return null}}function uv(e,t){switch(bs(t),t.tag){case 3:Dn(We),Ce();break;case 26:case 27:case 5:et(t);break;case 4:Ce();break;case 31:t.memoizedState!==null&&Ot(t);break;case 13:Ot(t);break;case 19:Y(Ke);break;case 10:Dn(t.type);break;case 22:case 23:Ot(t),Bs(),e!==null&&Y(Ha);break;case 24:Dn(We)}}function Ol(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var l=a.next;n=l;do{if((n.tag&e)===e){a=void 0;var i=n.create,c=n.inst;a=i(),c.destroy=a}n=n.next}while(n!==l)}}catch(p){Ve(t,t.return,p)}}function ia(e,t,n){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var i=l.next;a=i;do{if((a.tag&e)===e){var c=a.inst,p=c.destroy;if(p!==void 0){c.destroy=void 0,l=t;var x=n,O=p;try{O()}catch(X){Ve(l,x,X)}}}a=a.next}while(a!==i)}}catch(X){Ve(t,t.return,X)}}function sv(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{$m(t,n)}catch(a){Ve(e,e.return,a)}}}function cv(e,t,n){n.props=qa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Ve(e,t,a)}}function jl(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(l){Ve(e,t,l)}}function bn(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(l){Ve(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(l){Ve(e,t,l)}else n.current=null}function fv(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(l){Ve(e,e.return,l)}}function dc(e,t,n){try{var a=e.stateNode;Qw(a,e.type,n,t),a[Fe]=t}catch(l){Ve(e,e.return,l)}}function dv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ma(e.type)||e.tag===4}function mc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dv(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&&ma(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 hc(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=Tn));else if(a!==4&&(a===27&&ma(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(hc(e,t,n),e=e.sibling;e!==null;)hc(e,t,n),e=e.sibling}function oo(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&&ma(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(oo(e,t,n),e=e.sibling;e!==null;)oo(e,t,n),e=e.sibling}function mv(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);dt(t,a,n),t[je]=e,t[Fe]=n}catch(i){Ve(e,e.return,i)}}var kn=!1,$e=!1,vc=!1,hv=typeof WeakSet=="function"?WeakSet:Set,it=null;function Sw(e,t){if(e=e.containerInfo,kc=zo,e=Tm(e),us(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 l=a.anchorOffset,i=a.focusNode;a=a.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var c=0,p=-1,x=-1,O=0,X=0,K=e,j=null;t:for(;;){for(var L;K!==n||l!==0&&K.nodeType!==3||(p=c+l),K!==i||a!==0&&K.nodeType!==3||(x=c+a),K.nodeType===3&&(c+=K.nodeValue.length),(L=K.firstChild)!==null;)j=K,K=L;for(;;){if(K===e)break t;if(j===n&&++O===l&&(p=c),j===i&&++X===a&&(x=c),(L=K.nextSibling)!==null)break;K=j,j=K.parentNode}K=L}n=p===-1||x===-1?null:{start:p,end:x}}else n=null}n=n||{start:0,end:0}}else n=null;for(Hc={focusedElem:e,selectionRange:n},zo=!1,it=t;it!==null;)if(t=it,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,it=e;else for(;it!==null;){switch(t=it,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[je]=e,lt(i),a=i;break e;case"link":var c=Ap("link","href",l).get(a+(n.href||""));if(c){for(var p=0;pUe&&(c=Ue,Ue=de,de=c);var z=Em(p,de),E=Em(p,Ue);if(z&&E&&(L.rangeCount!==1||L.anchorNode!==z.node||L.anchorOffset!==z.offset||L.focusNode!==E.node||L.focusOffset!==E.offset)){var D=K.createRange();D.setStart(z.node,z.offset),L.removeAllRanges(),de>Ue?(L.addRange(D),L.extend(E.node,E.offset)):(D.setEnd(E.node,E.offset),L.addRange(D))}}}}for(K=[],L=p;L=L.parentNode;)L.nodeType===1&&K.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;pn?32:n,R.T=null,n=xc,xc=null;var i=ca,c=Yn;if(tt=0,Ur=ca=null,Yn=0,(Oe&6)!==0)throw Error(u(331));var p=Oe;if(Oe|=4,Cv(i.current),xv(i,i.current,c,n),Oe=p,Ll(0,!1),ut&&typeof ut.onPostCommitFiberRoot=="function")try{ut.onPostCommitFiberRoot(bt,i)}catch{}return!0}finally{q.p=l,R.T=a,Xv(e,t)}}function Zv(e,t,n){t=Kt(n,t),t=tc(e.stateNode,t,2),e=aa(e,t,2),e!==null&&(pn(e,2),An(e))}function Ve(e,t,n){if(e.tag===3)Zv(e,e,n);else for(;t!==null;){if(t.tag===3){Zv(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(sa===null||!sa.has(a))){e=Kt(n,e),n=Fh(2),a=aa(t,n,2),a!==null&&(Kh(n,a,t,e),pn(a,2),An(a));break}}t=t.return}}function Tc(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new Tw;var l=new Set;a.set(t,l)}else l=a.get(t),l===void 0&&(l=new Set,a.set(t,l));l.has(n)||(yc=!0,l.add(n),e=Dw.bind(null,e,t,n),t.then(e,e))}function Dw(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Le===e&&(Se&n)===n&&(Ze===4||Ze===3&&(Se&62914560)===Se&&300>rt()-co?(Oe&2)===0&&Lr(e,0):bc|=n,Hr===Se&&(Hr=0)),An(e)}function Fv(e,t){t===0&&(t=Ai()),e=Oa(e,t),e!==null&&(pn(e,t),An(e))}function Ow(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Fv(e,n)}function jw(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,l=e.memoizedState;l!==null&&(n=l.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),Fv(e,n)}function Bw(e,t){return Yt(e,t)}var yo=null,Yr=null,Rc=!1,bo=!1,Mc=!1,da=0;function An(e){e!==Yr&&e.next===null&&(Yr===null?yo=Yr=e:Yr=Yr.next=e),bo=!0,Rc||(Rc=!0,kw())}function Ll(e,t){if(!Mc&&bo){Mc=!0;do for(var n=!1,a=yo;a!==null;){if(e!==0){var l=a.pendingLanes;if(l===0)var i=0;else{var c=a.suspendedLanes,p=a.pingedLanes;i=(1<<31-vt(42|e)+1)-1,i&=l&~(c&~p),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(n=!0,Wv(a,i))}else i=Se,i=or(a,a===Le?i:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(i&3)===0||vn(a,i)||(n=!0,Wv(a,i));a=a.next}while(n);Mc=!1}}function Vw(){Kv()}function Kv(){bo=Rc=!1;var e=0;da!==0&&Fw()&&(e=da);for(var t=rt(),n=null,a=yo;a!==null;){var l=a.next,i=Jv(a,t);i===0?(a.next=null,n===null?yo=l:n.next=l,l===null&&(Yr=n)):(n=a,(e!==0||(i&3)!==0)&&(bo=!0)),a=l}tt!==0&&tt!==5||Ll(e),da!==0&&(da=0)}function Jv(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,l=e.expirationTimes,i=e.pendingLanes&-62914561;0p)break;var X=x.transferSize,K=x.initiatorType;X&&rp(K)&&(x=x.responseEnd,c+=X*(x"u"?null:document;function pp(e,t,n){var a=qr;if(a&&typeof t=="string"&&t){var l=Zt(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof n=="string"&&(l+='[crossorigin="'+n+'"]'),vp.has(l)||(vp.add(l),e={rel:e,crossOrigin:n,href:t},a.querySelector(l)===null&&(t=a.createElement("link"),dt(t,"link",e),lt(t),a.head.appendChild(t)))}}function t1(e){qn.D(e),pp("dns-prefetch",e,null)}function n1(e,t){qn.C(e,t),pp("preconnect",e,t)}function a1(e,t,n){qn.L(e,t,n);var a=qr;if(a&&e&&t){var l='link[rel="preload"][as="'+Zt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(l+='[imagesrcset="'+Zt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(l+='[imagesizes="'+Zt(n.imageSizes)+'"]')):l+='[href="'+Zt(e)+'"]';var i=l;switch(t){case"style":i=Xr(e);break;case"script":i=Qr(e)}$t.has(i)||(e=b({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),$t.set(i,e),a.querySelector(l)!==null||t==="style"&&a.querySelector(Xl(i))||t==="script"&&a.querySelector(Ql(i))||(t=a.createElement("link"),dt(t,"link",e),lt(t),a.head.appendChild(t)))}}function r1(e,t){qn.m(e,t);var n=qr;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+Zt(a)+'"][href="'+Zt(e)+'"]',i=l;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Qr(e)}if(!$t.has(i)&&(e=b({rel:"modulepreload",href:e},t),$t.set(i,e),n.querySelector(l)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ql(i)))return}a=n.createElement("link"),dt(a,"link",e),lt(a),n.head.appendChild(a)}}}function l1(e,t,n){qn.S(e,t,n);var a=qr;if(a&&e){var l=fr(a).hoistableStyles,i=Xr(e);t=t||"default";var c=l.get(i);if(!c){var p={loading:0,preload:null};if(c=a.querySelector(Xl(i)))p.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},n),(n=$t.get(i))&&Qc(e,n);var x=c=a.createElement("link");lt(x),dt(x,"link",e),x._p=new Promise(function(O,X){x.onload=O,x.onerror=X}),x.addEventListener("load",function(){p.loading|=1}),x.addEventListener("error",function(){p.loading|=2}),p.loading|=4,Eo(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:p},l.set(i,c)}}}function i1(e,t){qn.X(e,t);var n=qr;if(n&&e){var a=fr(n).hoistableScripts,l=Qr(e),i=a.get(l);i||(i=n.querySelector(Ql(l)),i||(e=b({src:e,async:!0},t),(t=$t.get(l))&&Zc(e,t),i=n.createElement("script"),lt(i),dt(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(l,i))}}function o1(e,t){qn.M(e,t);var n=qr;if(n&&e){var a=fr(n).hoistableScripts,l=Qr(e),i=a.get(l);i||(i=n.querySelector(Ql(l)),i||(e=b({src:e,async:!0,type:"module"},t),(t=$t.get(l))&&Zc(e,t),i=n.createElement("script"),lt(i),dt(i,"link",e),n.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},a.set(l,i))}}function gp(e,t,n,a){var l=(l=ie.current)?So(l):null;if(!l)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Xr(n.href),n=fr(l).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=Xr(n.href);var i=fr(l).hoistableStyles,c=i.get(e);if(c||(l=l.ownerDocument||l,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,c),(i=l.querySelector(Xl(e)))&&!i._p&&(c.instance=i,c.state.loading=5),$t.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},$t.set(e,n),i||u1(l,e,n,c.state))),t&&a===null)throw Error(u(528,""));return c}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=Qr(n),n=fr(l).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 Xr(e){return'href="'+Zt(e)+'"'}function Xl(e){return'link[rel="stylesheet"]['+e+"]"}function yp(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function u1(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),lt(t),e.head.appendChild(t))}function Qr(e){return'[src="'+Zt(e)+'"]'}function Ql(e){return"script[async]"+e}function bp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Zt(n.href)+'"]');if(a)return t.instance=a,lt(a),a;var l=b({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),lt(a),dt(a,"style",l),Eo(a,n.precedence,e),t.instance=a;case"stylesheet":l=Xr(n.href);var i=e.querySelector(Xl(l));if(i)return t.state.loading|=4,t.instance=i,lt(i),i;a=yp(n),(l=$t.get(l))&&Qc(a,l),i=(e.ownerDocument||e).createElement("link"),lt(i);var c=i;return c._p=new Promise(function(p,x){c.onload=p,c.onerror=x}),dt(i,"link",a),t.state.loading|=4,Eo(i,n.precedence,e),t.instance=i;case"script":return i=Qr(n.src),(l=e.querySelector(Ql(i)))?(t.instance=l,lt(l),l):(a=n,(l=$t.get(i))&&(a=b({},n),Zc(a,l)),e=e.ownerDocument||e,l=e.createElement("script"),lt(l),dt(l,"link",a),e.head.appendChild(l),t.instance=l);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,Eo(a,n.precedence,e));return t.instance}function Eo(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=a.length?a[a.length-1]:null,i=l,c=0;c title"):null)}function s1(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 xp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function c1(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 l=Xr(a.href),i=t.querySelector(Xl(l));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=To.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=i,lt(i);return}i=t.ownerDocument||t,a=yp(a),(l=$t.get(l))&&Qc(a,l),i=i.createElement("link"),lt(i);var c=i;c._p=new Promise(function(p,x){c.onload=p,c.onerror=x}),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=To.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Fc=0;function f1(e,t){return e.stylesheets&&e.count===0&&Mo(e,e.stylesheets),0Fc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(l)}}:null}function To(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ro=null;function Mo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ro=new Map,t.forEach(d1,e),Ro=null,To.call(e))}function d1(e,t){if(!(t.state.loading&4)){var n=Ro.get(e);if(n)var a=n.get(null);else{n=new Map,Ro.set(e,n);for(var l=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(r)}catch(o){console.error(o)}}return r(),Ho.exports=Gp(),Ho.exports}var qp=Yp(),Yo={exports:{}},Kr={};var sf;function Xp(){if(sf)return Kr;sf=1;var r=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function s(u,d,h){var g=null;if(h!==void 0&&(g=""+h),d.key!==void 0&&(g=""+d.key),"key"in d){h={};for(var y in d)y!=="key"&&(h[y]=d[y])}else h=d;return d=h.ref,{$$typeof:r,type:u,key:g,ref:d!==void 0?d:null,props:h}}return Kr.Fragment=o,Kr.jsx=s,Kr.jsxs=s,Kr}var cf;function Qp(){return cf||(cf=1,Yo.exports=Xp()),Yo.exports}var w=Qp();const ff=Xn(w);var df=lf(),Zp=Object.defineProperty,mf=(r,o)=>{for(var s in o)Zp(r,s,{get:o[s],enumerable:!0,configurable:!0,set:u=>o[s]=()=>u})};if(typeof f.createContext!="function"){const r=['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(r.join(` `))}function hf(){return["NOD","E_EN","V"].join("")}var vf=()=>["e","nv"].join(""),tn=()=>{const r=typeof window<"u"&&window.remotion_isPlayer,o=typeof window<"u"&&typeof window.process<"u"&&typeof window.process.env<"u"&&(window.process[vf()][hf()]==="test"||window.process[vf()][hf()]==="production"&&typeof window<"u"&&typeof window.remotion_puppeteerTimeout<"u"),s=typeof window<"u"&&window.remotion_isStudio,u=typeof window<"u"&&window.remotion_isReadOnlyStudio;return{isStudio:s,isRendering:o,isPlayer:r,isReadOnlyStudio:u,isClientSideRendering:!1}},Fp=ge.createElement,Kp=ff.jsx,pf=[],gf=r=>new Proxy(r,{apply(o,s,u){if(pf.includes(u[0])){const[d,h,...g]=u,y=h.stack?h:{...h??{},stack:new Error().stack};return Reflect.apply(o,s,[d,y,...g])}return Reflect.apply(o,s,u)}}),yf=()=>{tn().isStudio&&(ge.createElement=gf(Fp),ff.jsx=gf(Kp))},Za=r=>{pf.push(r),yf()},bf=f.createContext(!1),Jp=({children:r})=>w.jsx(bf.Provider,{value:!0,children:r}),qo=()=>f.useContext(bf);function Jr(r){return!!r}var Pr="4.0.427",Pp=()=>{if(typeof globalThis>"u")return;const r=()=>{globalThis.remotion_imported=Pr,typeof window<"u"&&(window.remotion_imported=Pr)},o=globalThis.remotion_imported||typeof window<"u"&&window.remotion_imported;if(o){if(o===Pr)return;if(typeof o=="string"&&o.includes("webcodecs")){r();return}throw new TypeError(`🚨 Multiple versions of Remotion detected: ${[Pr,typeof o=="string"?o:"an older version"].filter(Jr).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.`)}r()},Qn=({className:r,classPrefix:o,type:s})=>{if(!r)return!1;if(s==="exact"){const u=r.split(" ");return o.some(d=>u.some(h=>h.trim()===d||h.trim().endsWith(`:${d}`)||h.trim().endsWith(`!${d}`)))}return o.some(u=>r.startsWith(u)||r.includes(` ${u}`)||r.includes(`!${u}`)||r.includes(`:${u}`))},Wp=(r,o)=>{const{style:s,...u}=r,d=f.useMemo(()=>({position:"absolute",top:Qn({className:u.className,classPrefix:["top-","inset-"],type:"prefix"})?void 0:0,left:Qn({className:u.className,classPrefix:["left-","inset-"],type:"prefix"})?void 0:0,right:Qn({className:u.className,classPrefix:["right-","inset-"],type:"prefix"})?void 0:0,bottom:Qn({className:u.className,classPrefix:["bottom-","inset-"],type:"prefix"})?void 0:0,width:Qn({className:u.className,classPrefix:["w-"],type:"prefix"})?void 0:"100%",height:Qn({className:u.className,classPrefix:["h-"],type:"prefix"})?void 0:"100%",display:Qn({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:Qn({className:u.className,classPrefix:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"],type:"exact"})?void 0:"column",...s}),[u.className,s]);return w.jsx("div",{ref:o,style:d,...u})},Xo=f.forwardRef(Wp),nt=f.createContext(null),Fa=ge.createContext({registerSequence:()=>{throw new Error("SequenceManagerContext not initialized")},unregisterSequence:()=>{throw new Error("SequenceManagerContext not initialized")},sequences:[]}),Wr=ge.createContext({hidden:{},setHidden:()=>{throw new Error("SequenceVisibilityToggle not initialized")}}),Ip=({children:r})=>{const[o,s]=f.useState([]),[u,d]=f.useState({}),h=f.useCallback(m=>{s(A=>[...A,m])},[]),g=f.useCallback(m=>{s(A=>A.filter(b=>b.id!==m))},[]),y=f.useMemo(()=>({registerSequence:h,sequences:o,unregisterSequence:g}),[h,o,g]),v=f.useMemo(()=>({hidden:u,setHidden:d}),[u]);return w.jsx(Fa.Provider,{value:y,children:w.jsx(Wr.Provider,{value:v,children:r})})};function Af(r){let o=r+1831565813;return o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61),((o^o>>>14)>>>0)/4294967296}function _p(r){let o=0,s=0,u=0;for(o=0;o{if(r===null)return Math.random();if(typeof r=="string")return Af(_p(r));if(typeof r=="number")return Af(r*1e10);throw new Error("random() argument must be a number or a string")},Qo={};mf(Qo,{useTimelineSetFrame:()=>Df,useTimelinePosition:()=>Zn,usePlayingState:()=>Of,persistCurrentFrame:()=>Mf,getInitialFrameState:()=>zf,getFrameForComposition:()=>Nf});var wf=ge.createContext(null),at=()=>{const r=f.useContext(wf),[o]=f.useState(()=>tn());return r??o},Ka=f.createContext({compositions:[],folders:[],currentCompositionMetadata:null,canvasContent:null}),Pl=f.createContext({registerComposition:()=>{},unregisterComposition:()=>{},registerFolder:()=>{},unregisterFolder:()=>{},setCanvasContent:()=>{},updateCompositionDefaultProps:()=>{},onlyRenderComposition:null}),Zo=f.createContext({props:{},updateProps:()=>{throw new Error("Not implemented")},resetUnsaved:()=>{throw new Error("Not implemented")}}),xf=ge.createRef(),$p=ge.createRef(),Sf=({children:r})=>{const[o,s]=ge.useState({}),u=f.useCallback(({defaultProps:g,id:y,newProps:v})=>{s(m=>({...m,[y]:typeof v=="function"?v(m[y]??g):v}))},[]),d=f.useCallback(g=>{s(y=>{if(y[g]){const v={...y};return delete v[g],v}return y})},[]);f.useImperativeHandle(xf,()=>({getProps:()=>o,setProps:s}),[o]);const h=f.useMemo(()=>({props:o,updateProps:u,resetUnsaved:d}),[o,d,u]);return w.jsx(Zo.Provider,{value:h,children:r})},Fo=()=>"remotion_inputPropsOverride"+window.location.origin,Ef=()=>{if(typeof localStorage>"u")return null;const r=localStorage.getItem(Fo());return r?JSON.parse(r):null},eg=r=>{if(!(typeof localStorage>"u")){if(r===null){localStorage.removeItem(Fo());return}localStorage.setItem(Fo(),JSON.stringify(r))}},Ko="remotion-date:",Jo="remotion-file:",tg=({data:r,indent:o,staticBase:s})=>{let u=!1,d=!1,h=!1,g=!1;try{return{serializedString:JSON.stringify(r,function(v,m){const A=this[v];return A instanceof Date?(u=!0,`${Ko}${A.toISOString()}`):A instanceof Map?(h=!0,m):A instanceof Set?(g=!0,m):typeof A=="string"&&s!==null&&A.startsWith(s)?(d=!0,`${Jo}${A.replace(s+"/","")}`):m},o),customDateUsed:u,customFileUsed:d,mapUsed:h,setUsed:g}}catch(y){throw new Error("Could not serialize the passed input props to JSON: "+y.message)}},Cf=r=>JSON.parse(r,(o,s)=>typeof s=="string"&&s.startsWith(Ko)?new Date(s.replace(Ko,"")):typeof s=="string"&&s.startsWith(Jo)?`${window.remotion_staticBase}/${s.replace(Jo,"")}`:s),ng=r=>Cf(tg({data:r,indent:2,staticBase:window.remotion_staticBase}).serializedString),Aa=r=>tn().isStudio?ng(r):r,Tf=!1,ag=()=>{Tf||(Tf=!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()"))},rg=()=>{if(typeof window>"u")return ag(),{};if(tn().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 r=Ef();if(r)return r;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 o=window.remotion_inputProps;return o?Cf(o):{}};function Wl(r,o,s){if(typeof r!="number")throw new Error(`The "${o}" prop ${s} must be a number, but you passed a value of type ${typeof r}`);if(isNaN(r))throw new TypeError(`The "${o}" prop ${s} must not be NaN, but is NaN.`);if(!Number.isFinite(r))throw new TypeError(`The "${o}" prop ${s} must be finite, but is ${r}.`);if(r%1!==0)throw new TypeError(`The "${o}" prop ${s} must be an integer, but is ${r}.`);if(r<=0)throw new TypeError(`The "${o}" prop ${s} must be positive, but got ${r}.`)}function Po(r,o){const{allowFloats:s,component:u}=o;if(typeof r>"u")throw new Error(`The "durationInFrames" prop ${u} is missing.`);if(typeof r!="number")throw new Error(`The "durationInFrames" prop ${u} must be a number, but you passed a value of type ${typeof r}`);if(r<=0)throw new TypeError(`The "durationInFrames" prop ${u} must be positive, but got ${r}.`);if(!s&&r%1!==0)throw new TypeError(`The "durationInFrames" prop ${u} must be an integer, but got ${r}.`);if(!Number.isFinite(r))throw new TypeError(`The "durationInFrames" prop ${u} must be finite, but got ${r}.`)}function Il(r,o,s){if(typeof r!="number")throw new Error(`"fps" must be a number, but you passed a value of type ${typeof r} ${o}`);if(!Number.isFinite(r))throw new Error(`"fps" must be a finite, but you passed ${r} ${o}`);if(isNaN(r))throw new Error(`"fps" must not be NaN, but got ${r} ${o}`);if(r<=0)throw new TypeError(`"fps" must be positive, but got ${r} ${o}`)}var _l=f.createContext(null),lg=f.createRef(),ig=r=>!!r.calculateMetadata,Rf="remotion.propsUpdatedExternally",Wo=r=>{const o=f.useContext(_l),{props:s}=f.useContext(Zo),{compositions:u,canvasContent:d,currentCompositionMetadata:h}=f.useContext(Ka),g=d?.type==="composition"?d.compositionId:null,y=r??g,v=u.find(b=>b.id===y),m=f.useMemo(()=>v?s[v.id]??{}:{},[s,v]),A=at();return f.useMemo(()=>v?h?{type:"success",result:{...h,id:v.id,defaultProps:v.defaultProps??{}}}:ig(v)?!o||!o[v.id]?null:o[v.id]:(Po(v.durationInFrames,{allowFloats:!1,component:`in `}),Il(v.fps,`in `),Wl(v.width,"width",`in `),Wl(v.height,"height",`in `),{type:"success",result:{width:v.width,height:v.height,fps:v.fps,id:v.id,durationInFrames:v.durationInFrames,defaultProps:v.defaultProps??{},props:{...v.defaultProps??{},...m??{},...typeof window>"u"||A.isPlayer||!window.remotion_inputProps?{}:rg()??{}},defaultCodec:null,defaultOutName:null,defaultVideoImageFormat:null,defaultPixelFormat:null,defaultProResProfile:null}}):null,[v,o,h,m,A.isPlayer])},$l=()=>{const{canvasContent:r,compositions:o,currentCompositionMetadata:s}=f.useContext(Ka),u=o.find(h=>r?.type==="composition"&&h.id===r.compositionId),d=Wo(u?.id??null);return f.useMemo(()=>!d||d.type==="error"||d.type==="loading"||!u?null:{...d.result,defaultProps:u.defaultProps??{},id:u.id,...s??{},component:u.component},[s,d,u])},Io=()=>"remotion.time-all",Mf=r=>{localStorage.setItem(Io(),JSON.stringify(r))},zf=()=>{const r=localStorage.getItem(Io())??"{}";return JSON.parse(r)},Nf=r=>{const o=localStorage.getItem(Io())??"{}",s=JSON.parse(o);return s[r]!==void 0?Number(s[r]):typeof window>"u"?0:window.remotion_initialFrame??0},Zn=()=>{const r=$l(),o=f.useContext(Ht),s=at();if(!r)return typeof window>"u"?0:window.remotion_initialFrame??0;const u=o.frame[r.id]??(s.isPlayer?0:Nf(r.id));return Math.min(r.durationInFrames-1,u)},Df=()=>{const{setFrame:r}=f.useContext(Pa);return r},Of=()=>{const{playing:r,imperativePlaying:o}=f.useContext(Ht),{setPlaying:s}=f.useContext(Pa);return f.useMemo(()=>[r,s,o],[o,r,s])},jf=r=>{const o=r.stack??"";return o.startsWith("Error:")?o:`${r.message} ${o}`},og=r=>r instanceof Error?!0:!(r===null||typeof r!="object"||!("stack"in r)||typeof r.stack!="string"||!("message"in r)||typeof r.message!="string");function _o(r,o){let s;throw og(o)?(s=o,s.stack||(s.stack=new Error(s.message).stack)):typeof o=="string"?s=Error(o):s=Error("Rendering was cancelled"),r&&(r.remotion_cancelledError=jf(s)),s}function Ja(r){return _o(typeof window<"u"?window:void 0,r)}var ug=["trace","verbose","info","warn","error"],Bf=r=>ug.indexOf(r),ei=(r,o)=>Bf(r)<=Bf(o),Ir=({args:r,logLevel:o,tag:s})=>{const u=[...r];return tn().isRendering&&!tn().isClientSideRendering&&u.unshift(Symbol.for(`__remotion_level_${o}`)),s&&tn().isRendering&&!tn().isClientSideRendering&&u.unshift(Symbol.for(`__remotion_tag_${s}`)),u},sg=(r,...o)=>{if(ei(r.logLevel,"verbose"))return console.debug(...Ir({args:o,logLevel:"verbose",tag:r.tag}))},cg=(r,...o)=>{if(ei(r.logLevel,"trace"))return console.debug(...Ir({args:o,logLevel:"trace",tag:r.tag}))},fg=(r,...o)=>{if(ei(r.logLevel,"info"))return console.log(...Ir({args:o,logLevel:"info",tag:r.tag}))},dg=(r,...o)=>{if(ei(r.logLevel,"warn"))return console.warn(...Ir({args:o,logLevel:"warn",tag:r.tag}))},mg=(r,...o)=>console.error(...Ir({args:o,logLevel:"error",tag:r.tag})),kt={trace:cg,verbose:sg,info:fg,warn:dg,error:mg};typeof window<"u"&&(window.remotion_renderReady=!1,window.remotion_delayRenderTimeouts||(window.remotion_delayRenderTimeouts={}),window.remotion_delayRenderHandles=[]);var hg="The delayRender was called:",vg="Retries left: ",pg="- Rendering the frame will be retried.",gg="handle was cleared after",yg=3e4,bg=({scope:r,environment:o,label:s,options:u})=>{if(typeof s!="string"&&s!==null)throw new Error("The label parameter of delayRender() must be a string or undefined, got: "+JSON.stringify(s));const d=Math.random();r.remotion_delayRenderHandles.push(d);const h=Error().stack?.replace(/^Error/g,"")??"";if(o.isRendering){const g=(u?.timeoutInMilliseconds??r.remotion_puppeteerTimeout??yg)-2e3,y=(u?.retries??0)-(r.remotion_attempt-1);r.remotion_delayRenderTimeouts[d]={label:s??null,startTime:Date.now(),timeout:setTimeout(()=>{const v=["A delayRender()",s?`"${s}"`:null,`was called but not cleared after ${g}ms. See https://remotion.dev/docs/timeout for help.`,y>0?vg+y:null,y>0?pg:null,hg,h].filter(Jr).join(" ");o.isClientSideRendering?r.remotion_cancelledError=jf(Error(v)):_o(r,Error(v))},g)}}return r.remotion_renderReady=!1,d},Ag=({scope:r,handle:o,environment:s,logLevel:u})=>{if(typeof o>"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 o!="number")throw new TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: "+JSON.stringify(o));r.remotion_delayRenderHandles=r.remotion_delayRenderHandles.filter(d=>{if(d===o){if(s.isRendering&&r!==void 0){if(!r.remotion_delayRenderTimeouts[o])return!1;const{label:h,startTime:g,timeout:y}=r.remotion_delayRenderTimeouts[o];clearTimeout(y);const v=[h?`"${h}"`:"A handle",gg,`${Date.now()-g}ms`].filter(Jr).join(" ");kt.verbose({logLevel:u,tag:"delayRender()"},v),delete r.remotion_delayRenderTimeouts[o]}return!1}return!0}),r.remotion_delayRenderHandles.length===0&&(r.remotion_renderReady=!0)},wa=f.createContext({logLevel:"info",mountTime:0}),Fn=()=>{const{logLevel:r}=f.useContext(wa);if(r===null)throw new Error("useLogLevel must be used within a LogLevelProvider");return r},_r=()=>{const{mountTime:r}=f.useContext(wa);if(r===null)throw new Error("useMountTime must be used within a LogLevelProvider");return r},Vf=f.createContext(null),Kn=()=>{const r=at(),o=f.useContext(Vf)??(typeof window<"u"?window:void 0),s=Fn(),u=f.useCallback((g,y)=>o?bg({scope:o,environment:r,label:g??null,options:y??{}}):Math.random(),[r,o]),d=f.useCallback(g=>{o&&Ag({scope:o,handle:g,environment:r,logLevel:s})},[r,s,o]),h=f.useCallback(g=>_o(o??(typeof window<"u"?window:void 0),g),[o]);return{delayRender:u,continueRender:d,cancelRender:h}},Pa=f.createContext({setFrame:()=>{throw new Error("default")},setPlaying:()=>{throw new Error("default")}}),Ht=f.createContext({frame:{},playing:!1,playbackRate:1,rootId:"",imperativePlaying:{current:!1},setPlaybackRate:()=>{throw new Error("default")},audioAndVideoTags:{current:[]}}),wg=({children:r,frameState:o})=>{const[s,u]=f.useState(!1),d=f.useRef(!1),[h,g]=f.useState(1),y=f.useRef([]),[v]=f.useState(()=>String(ba(null))),[m,A]=f.useState(()=>zf()),b=o??m,{delayRender:C,continueRender:T}=Kn();typeof window<"u"&&f.useLayoutEffect(()=>{window.remotion_setFrame=(U,V,Z)=>{window.remotion_attempt=Z;const k=C(`Setting the current frame to ${U}`);let B=!0;A(Q=>(Q[V]??window.remotion_initialFrame)===U?(B=!1,Q):{...Q,[V]:U}),B?requestAnimationFrame(()=>T(k)):T(k)},window.remotion_isPlayer=!1},[T,C]);const N=f.useMemo(()=>({frame:b,playing:s,imperativePlaying:d,rootId:v,playbackRate:h,setPlaybackRate:g,audioAndVideoTags:y}),[b,h,s,v]),M=f.useMemo(()=>({setFrame:A,setPlaying:u}),[]);return w.jsx(Ht.Provider,{value:N,children:w.jsx(Pa.Provider,{value:M,children:r})})},$r=f.createContext({getNonce:()=>0}),$o=()=>{const r=f.useContext($r),[o,s]=f.useState(()=>r.getNonce()),u=f.useRef(r);return f.useEffect(()=>{u.current!==r&&(u.current=r,s(r.getNonce))},[r]),o},xa=f.createContext(!1),eu=({children:r})=>w.jsx(xa.Provider,{value:!0,children:r}),ti=()=>{const r=f.useContext(nt),o=r?.width??null,s=r?.height??null,u=r?.durationInFrames??null,d=$l();return f.useMemo(()=>{if(!d)return null;const{id:h,durationInFrames:g,fps:y,height:v,width:m,defaultProps:A,props:b,defaultCodec:C,defaultOutName:T,defaultVideoImageFormat:N,defaultPixelFormat:M,defaultProResProfile:U}=d;return{id:h,width:o??m,height:s??v,fps:y,durationInFrames:u??g,defaultProps:A,props:b,defaultCodec:C,defaultOutName:T,defaultVideoImageFormat:N,defaultPixelFormat:M,defaultProResProfile:U}},[u,s,o,d])},Ut=()=>{const r=ti(),o=f.useContext(xa),s=qo();if(!r)throw typeof window<"u"&&window.remotion_isPlayer||s?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(!o)throw new Error("Called useVideoConfig() outside a Remotion composition.");return r},nn=()=>{const r=f.useContext(xa),o=at();if(!r)throw o.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 s=Zn(),u=f.useContext(nt),d=u?u.cumulatedFrom+u.relativeFrom:0;return s-d},xg=({frame:r,children:o,active:s=!0})=>{const u=nn(),d=Ut();if(typeof r>"u")throw new Error("The component requires a 'frame' prop, but none was passed.");if(typeof r!="number")throw new Error(`The 'frame' prop of must be a number, but is of type ${typeof r}`);if(Number.isNaN(r))throw new Error("The 'frame' prop of must be a real number, but it is NaN.");if(!Number.isFinite(r))throw new Error(`The 'frame' prop of must be a finite number, but it is ${r}.`);const h=f.useMemo(()=>{if(typeof s=="boolean")return s;if(typeof s=="function")return s(u)},[s,u]),g=f.useContext(Ht),y=f.useContext(nt),v=y?.relativeFrom??0,m=f.useMemo(()=>h?{...g,playing:!1,imperativePlaying:{current:!1},frame:{[d.id]:r+v}}:g,[h,g,d.id,r,v]),A=f.useMemo(()=>y?h?{...y,cumulatedFrom:0}:y:null,[y,h]);return w.jsx(Ht.Provider,{value:m,children:w.jsx(nt.Provider,{value:A,children:o})})},Sg=({from:r=0,durationInFrames:o=1/0,children:s,name:u,height:d,width:h,showInTimeline:g=!0,_remotionInternalLoopDisplay:y,_remotionInternalStack:v,_remotionInternalPremountDisplay:m,_remotionInternalPostmountDisplay:A,...b},C)=>{const{layout:T="absolute-fill"}=b,[N]=f.useState(()=>String(Math.random())),M=f.useContext(nt),{rootId:U}=f.useContext(Ht),V=M?M.cumulatedFrom+M.relativeFrom:0,Z=$o();if(T!=="absolute-fill"&&T!=="none")throw new TypeError(`The layout prop of expects either "absolute-fill" or "none", but you passed: ${T}`);if(T==="none"&&typeof b.style<"u")throw new TypeError('If layout="none", you may not pass a style.');if(typeof o!="number")throw new TypeError(`You passed to durationInFrames an argument of type ${typeof o}, but it must be a number.`);if(o<=0)throw new TypeError(`durationInFrames must be positive, but got ${o}`);if(typeof r!="number")throw new TypeError(`You passed to the "from" props of your an argument of type ${typeof r}, but it must be a number.`);if(!Number.isFinite(r))throw new TypeError(`The "from" prop of a sequence must be finite, but got ${r}.`);const k=Zn(),B=Ut(),Q=M?Math.min(M.durationInFrames-r,o):o,H=Math.max(0,Math.min(B.durationInFrames-r,Q)),{registerSequence:G,unregisterSequence:W}=f.useContext(Fa),{hidden:_}=f.useContext(Wr),ee=f.useMemo(()=>M?.premounting||!!b._remotionInternalIsPremounting,[b._remotionInternalIsPremounting,M?.premounting]),oe=f.useMemo(()=>M?.postmounting||!!b._remotionInternalIsPostmounting,[b._remotionInternalIsPostmounting,M?.postmounting]),le=f.useMemo(()=>({cumulatedFrom:V,relativeFrom:r,durationInFrames:H,parentFrom:M?.relativeFrom??0,id:N,height:d??M?.height??null,width:h??M?.width??null,premounting:ee,postmounting:oe,premountDisplay:m??null,postmountDisplay:A??null}),[V,r,H,M,N,d,h,ee,oe,m,A]),fe=f.useMemo(()=>u??"",[u]),ve=at();f.useEffect(()=>{if(ve.isStudio)return G({from:r,duration:H,id:N,displayName:fe,parent:M?.id??null,type:"sequence",rootId:U,showInTimeline:g,nonce:Z,loopDisplay:y,stack:v??null,premountDisplay:m??null,postmountDisplay:A??null}),()=>{W(N)}},[o,N,u,G,fe,W,M?.id,H,U,r,g,Z,y,v,m,A,ve.isStudio]);const pe=Math.ceil(V+r+o-1),R=kpe?null:s,q=b.layout==="none"?void 0:b.style,P=f.useMemo(()=>({flexDirection:void 0,...h?{width:h}:{},...d?{height:d}:{},...q??{}}),[d,q,h]);if(C!==null&&T==="none")throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to .');return _[N]??!1?null:w.jsx(nt.Provider,{value:le,children:R===null?null:b.layout==="none"?R:w.jsx(Xo,{ref:C,style:P,className:b.className,children:R})})},Eg=f.forwardRef(Sg),Cg=(r,o)=>{const s=nn();if(r.layout==="none")throw new Error('`` with `premountFor` and `postmountFor` props does not support layout="none"');const{style:u,from:d=0,durationInFrames:h=1/0,premountFor:g=0,postmountFor:y=0,styleWhilePremounted:v,styleWhilePostmounted:m,...A}=r,b=Math.ceil(d+h-1),C=s=d-g,T=s>b&&s<=b+y,N=C?d:T?d+h-1:0,M=C||T,U=f.useMemo(()=>({...u,opacity:C||T?0:1,pointerEvents:C||T?"none":u?.pointerEvents??void 0,...C?v:{},...T?m:{}}),[u,C,T,v,m]);return w.jsx(xg,{frame:N,active:M,children:w.jsx(Wa,{ref:o,from:d,durationInFrames:h,style:U,_remotionInternalPremountDisplay:g,_remotionInternalPostmountDisplay:y,_remotionInternalIsPremounting:C,_remotionInternalIsPostmounting:T,...A})})},Tg=f.forwardRef(Cg),Rg=(r,o)=>{const s=at(),{fps:u}=Ut();if(r.layout!=="none"&&!s.isRendering){const d=r.premountFor;if(d||r.postmountFor)return w.jsx(Tg,{ref:o,...r,premountFor:d})}return w.jsx(Eg,{...r,ref:o})},Wa=f.forwardRef(Rg),Mg=(r,o,s)=>{switch(r){case"fill":return[0,0,o.width,o.height,0,0,s.width,s.height];case"contain":{const u=Math.min(s.width/o.width,s.height/o.height),d=(s.width-o.width*u)/2,h=(s.height-o.height*u)/2;return[0,0,o.width,o.height,d,h,o.width*u,o.height*u]}case"cover":{const u=Math.max(s.width/o.width,s.height/o.height),d=(s.width-o.width*u)/2,h=(s.height-o.height*u)/2;return[0,0,o.width,o.height,d,h,o.width*u,o.height*u]}default:throw new Error("Unknown fit: "+r)}},zg=({width:r,height:o,fit:s,className:u,style:d},h)=>{const g=f.useRef(null),y=f.useCallback(v=>{const m=g.current,A=r??v.displayWidth,b=o??v.displayHeight;if(!m)throw new Error("Canvas ref is not set");const C=g.current?.getContext("2d");if(!C)throw new Error("Could not get 2d context");m.width=A,m.height=b,C.drawImage(v,...Mg(s,{height:v.displayHeight,width:v.displayWidth},{width:A,height:b}))},[s,o,r]);return f.useImperativeHandle(h,()=>({draw:y,getCanvas:()=>{if(!g.current)throw new Error("Canvas ref is not set");return g.current},clear:()=>{const v=g.current?.getContext("2d");if(!v)throw new Error("Could not get 2d context");v.clearRect(0,0,g.current.width,g.current.height)}}),[y]),w.jsx("canvas",{ref:g,className:u,style:d})},Ng=ge.forwardRef(zg),Dg=5,kf=({loopBehavior:r,durationFound:o,timeInSec:s})=>r==="loop"?o?s%o:s:Math.min(s,o||1/0),Og=async({resolvedSrc:r,signal:o,currentTime:s,initialLoopBehavior:u})=>{if(typeof ImageDecoder>"u")throw new Error("Your browser does not support the WebCodecs ImageDecoder API.");const d=await fetch(r,{signal:o}),{body:h}=d;if(!h)throw new Error("Got no body");const g=new ImageDecoder({data:h,type:d.headers.get("Content-Type")||"image/gif"});await g.completed;const{selectedTrack:y}=g.tracks;if(!y)throw new Error("No selected track");const v=[];let m=null;const A=async N=>{const M=v.find(V=>V.frameIndex===N);if(M&&M.frame)return M;const U=await g.decode({frameIndex:N,completeFramesOnly:!0});return M?M.frame=U.image:v.push({frame:U.image,frameIndex:N,timeInSeconds:U.image.timestamp/1e6}),{frame:U.image,frameIndex:N,timeInSeconds:U.image.timestamp/1e6}},b=N=>{const U=v.filter(V=>V.frame).sort((V,Z)=>{const k=Math.abs(V.timeInSeconds-N),B=Math.abs(Z.timeInSeconds-N);return k-B});for(let V=0;V{const U=kf({durationFound:m,loopBehavior:M,timeInSec:N}),Z=v.filter(B=>B.timeInSeconds<=U).map(B=>B.frameIndex).reduce((B,Q)=>Math.max(B,Q),0);let k=Z;for(;;){const B=await A(k);if(k++,!B.frame)throw new Error("No frame found");if(!B.frame.duration||(k===y.frameCount&&m===null&&(m=(B.frame.timestamp+B.frame.duration)/1e6),B.timeInSeconds>U||k===y.frameCount))break}y.frameCount-Z<3&&M==="loop"&&await A(0),b(U)};return await C({timeInSec:s,loopBehavior:u}),await C({timeInSec:s,loopBehavior:u}),{getFrame:async(N,M)=>{if(m!==null&&N>m&&M==="clear-after-finish")return null;const U=kf({loopBehavior:M,durationFound:m,timeInSec:N});await C({timeInSec:U,loopBehavior:M});const Z=v.filter(k=>k.frame).reduce((k,B)=>{const Q=Math.abs(k.timeInSeconds-U),H=Math.abs(B.timeInSeconds-U);return Qtypeof window>"u"?r:new URL(r,window.origin).href;f.forwardRef(({src:r,width:o,height:s,onError:u,loopBehavior:d="loop",playbackRate:h=1,fit:g="fill",...y},v)=>{const m=f.useRef({isMounted:!0});f.useEffect(()=>{const{current:H}=m;return H.isMounted=!0,()=>{H.isMounted=!1}},[]);const A=jg(r),[b,C]=f.useState(null),{delayRender:T,continueRender:N}=Kn(),[M]=f.useState(()=>T(`Rendering with src="${A}"`)),U=nn(),{fps:V}=Ut(),Z=U/h/V,k=f.useRef(Z);k.current=Z;const B=f.useRef(null);f.useImperativeHandle(v,()=>{const H=B.current?.getCanvas();if(!H)throw new Error("Canvas ref is not set");return H},[]);const[Q]=f.useState(()=>d);return f.useEffect(()=>{const H=new AbortController;return Og({resolvedSrc:A,signal:H.signal,currentTime:k.current,initialLoopBehavior:Q}).then(G=>{C(G),N(M)}).catch(G=>{if(G.name==="AbortError"){N(M);return}u?(u?.(G),N(M)):Ja(G)}),()=>{H.abort()}},[A,M,u,Q,N]),f.useLayoutEffect(()=>{if(!b)return;const H=T(`Rendering frame at ${Z} of `);b.getFrame(Z,d).then(G=>{m.current.isMounted&&(G===null?B.current?.clear():B.current?.draw(G.frame)),N(H)}).catch(G=>{u?(u(G),N(H)):Ja(G)})},[Z,b,d,u,r,N,T]),w.jsx(Ng,{ref:B,width:o,height:s,fit:g,...y})});var Bg=r=>{if(typeof r!="string")throw new TypeError(`The "filename" must be a string, but you passed a value of type ${typeof r}`);if(r.trim()==="")throw new Error("The `filename` must not be empty");if(!r.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.')},Vg=r=>{if(typeof r!="string"&&!(r instanceof Uint8Array))throw new TypeError(`The "content" must be a string or Uint8Array, but you passed a value of type ${typeof r}`);if(typeof r=="string"&&r.trim()==="")throw new Error("The `content` must not be empty")},Hf=r=>{r.type==="artifact"&&(Bg(r.filename),r.contentType!=="thumbnail"&&Vg(r.content))},Sa=f.createContext({registerRenderAsset:()=>{},unregisterRenderAsset:()=>{},renderAssets:[]}),kg=({children:r,collectAssets:o})=>{const[s,u]=f.useState([]),d=f.useRef([]),h=f.useCallback(v=>{Hf(v),d.current=[...d.current,v],u(d.current)},[]);o&&f.useImperativeHandle(o,()=>({collectAssets:()=>{const v=d.current;return d.current=[],u([]),v}}),[]);const g=f.useCallback(v=>{d.current=d.current.filter(m=>m.id!==v),u(d.current)},[]);f.useLayoutEffect(()=>{typeof window<"u"&&(window.remotion_collectAssets=()=>{const v=d.current;return d.current=[],u([]),v})},[]);const y=f.useMemo(()=>({registerRenderAsset:h,unregisterRenderAsset:g,renderAssets:s}),[s,h,g]);return w.jsx(Sa.Provider,{value:y,children:r})},cn=r=>typeof window>"u"||r.startsWith("http://")||r.startsWith("https://")||r.startsWith("file://")||r.startsWith("blob:")||r.startsWith("data:")?r:new URL(r,window.origin).href,ni=({trimAfter:r,mediaDurationInFrames:o,playbackRate:s,trimBefore:u})=>{let d=o;typeof r<"u"&&(d=r),typeof u<"u"&&(d-=u);const h=d/s;return Math.floor(h)},Uf=f.createContext(null),Hg=()=>ge.useContext(Uf),ai=({durationInFrames:r,times:o=1/0,children:s,name:u,...d})=>{const h=nn(),{durationInFrames:g}=Ut();if(Po(r,{component:"of the component",allowFloats:!0}),typeof o!="number")throw new TypeError(`You passed to "times" an argument of type ${typeof o}, but it must be a number.`);if(o!==1/0&&o%1!==0)throw new TypeError(`The "times" prop of a loop must be an integer, but got ${o}.`);if(o<0)throw new TypeError(`The "times" prop of a loop must be at least 0, but got ${o}`);const y=Math.ceil(g/r),v=Math.min(y,o),m=d.layout==="none"?void 0:d.style,A=r*(v-1),C=Math.floor(h/r)*r,T=Math.min(C,A),N=f.useMemo(()=>({numberOfTimes:Math.min(g/r,o),startOffset:-T,durationInFrames:r}),[g,r,T,o]),M=f.useMemo(()=>({iteration:Math.floor(h/r),durationInFrames:r}),[h,r]);return w.jsx(Uf.Provider,{value:M,children:w.jsx(Wa,{durationInFrames:r,from:T,name:u??"",_remotionInternalLoopDisplay:N,layout:d.layout,style:m,children:s})})};ai.useLoop=Hg;var ht=({logLevel:r,tag:o,message:s,mountTime:u})=>{const d=[u?Date.now()-u+"ms ":null,o].filter(Boolean).join(" ");kt.trace({logLevel:r,tag:null},`[${d}]`,s)},ri=f.createContext({}),Lf={},tu=[],Gf=({children:r})=>{const[o,s]=f.useState(()=>Lf);return f.useEffect(()=>{const u=()=>{s(Lf)};return tu.push(u),()=>{tu=tu.filter(d=>d!==u)}},[]),w.jsx(ri.Provider,{value:o,children:r})},Yf=r=>{const o=r.indexOf("#");return o===-1?null:o},Ug=r=>{const o=Yf(r);return o===null?r:r.slice(0,o)},Ia=r=>{const o=f.useContext(ri),s=Yf(r),u=Ug(r);return o[u]?s!==null?o[u]+r.slice(s):o[u]:r},li=(r,o)=>{if(typeof r.volume!="number"&&typeof r.volume!="function"&&typeof r.volume<"u")throw new TypeError(`You have passed a volume of type ${typeof r.volume} to your <${o} /> component. Volume must be a number or a function with the signature '(frame: number) => number' undefined.`);if(typeof r.volume=="number"&&r.volume<0)throw new TypeError(`You have passed a volume below 0 to your <${o} /> component. Volume must be between 0 and 1`);if(typeof r.playbackRate!="number"&&typeof r.playbackRate<"u")throw new TypeError(`You have passed a playbackRate of type ${typeof r.playbackRate} to your <${o} /> component. Playback rate must a real number or undefined.`);if(typeof r.playbackRate=="number"&&(isNaN(r.playbackRate)||!Number.isFinite(r.playbackRate)||r.playbackRate<=0))throw new TypeError(`You have passed a playbackRate of ${r.playbackRate} to your <${o} /> component. Playback rate must be a real number above 0.`)},Lg=(r,o)=>{if(typeof r<"u"){if(typeof r!="number")throw new TypeError(`type of startFrom prop must be a number, instead got type ${typeof r}.`);if(isNaN(r)||r===1/0)throw new TypeError("startFrom prop can not be NaN or Infinity.");if(r<0)throw new TypeError(`startFrom must be greater than equal to 0 instead got ${r}.`)}if(typeof o<"u"){if(typeof o!="number")throw new TypeError(`type of endAt prop must be a number, instead got type ${typeof o}.`);if(isNaN(o))throw new TypeError("endAt prop can not be NaN.");if(o<=0)throw new TypeError(`endAt must be a positive number, instead got ${o}.`)}if(o{if(typeof r<"u"){if(typeof r!="number")throw new TypeError(`type of trimBefore prop must be a number, instead got type ${typeof r}.`);if(isNaN(r)||r===1/0)throw new TypeError("trimBefore prop can not be NaN or Infinity.");if(r<0)throw new TypeError(`trimBefore must be greater than equal to 0 instead got ${r}.`)}if(typeof o<"u"){if(typeof o!="number")throw new TypeError(`type of trimAfter prop must be a number, instead got type ${typeof o}.`);if(isNaN(o))throw new TypeError("trimAfter prop can not be NaN.");if(o<=0)throw new TypeError(`trimAfter must be a positive number, instead got ${o}.`)}if(o<=r)throw new TypeError("trimAfter prop must be greater than trimBefore prop.")},ii=({startFrom:r,endAt:o,trimBefore:s,trimAfter:u})=>{if(typeof r<"u"&&typeof s<"u")throw new TypeError("Cannot use both startFrom and trimBefore props. Use trimBefore instead as startFrom is deprecated.");if(typeof o<"u"&&typeof u<"u")throw new TypeError("Cannot use both endAt and trimAfter props. Use trimAfter instead as endAt is deprecated.");typeof s<"u"||typeof u<"u"?Gg(s,u):(typeof r<"u"||typeof o<"u")&&Lg(r,o)},oi=({startFrom:r,endAt:o,trimBefore:s,trimAfter:u})=>({trimBeforeValue:s??r??void 0,trimAfterValue:u??o??void 0}),Yg=(r,o)=>{if(o.type==="got-duration"){const s=cn(o.src);return r[s]===o.durationInSeconds?r:{...r,[s]:o.durationInSeconds}}else return r},nu=f.createContext({durations:{},setDurations:()=>{throw new Error("context missing")}}),qf=({children:r})=>{const[o,s]=f.useReducer(Yg,{}),u=f.useMemo(()=>({durations:o,setDurations:s}),[o]);return w.jsx(nu.Provider,{value:u,children:r})},au=({crossOrigin:r,requestsVideoFrame:o,isClientSideRendering:s})=>{if(r!=null)return r;if(s||o)return"anonymous"},ui=({mediaRef:r,mediaType:o,onAutoPlayError:s,logLevel:u,mountTime:d,reason:h,isPlayer:g})=>{const{current:y}=r;if(!y)return;ht({logLevel:u,tag:"play",message:`Attempting to play ${y.src}. Reason: ${h}`,mountTime:d});const v=y.play();v.catch&&v.catch(m=>{if(y&&!m.message.includes("request was interrupted by a call to pause")&&!m.message.includes("The operation was aborted.")&&!m.message.includes("The fetching process for the media resource was aborted by the user agent")&&!m.message.includes("request was interrupted by a new load request")&&!m.message.includes("because the media was removed from the document")&&!(m.message.includes("user didn't interact with the document")&&y.muted)&&(console.log(`Could not play ${o} due to following error: `,m),!y.muted)){if(s){s();return}o==="video"&&g&&(kt.info({logLevel:u,tag:"<"+o+">"},"The video will be muted and we'll retry playing it."),kt.info({logLevel:u,tag:"<"+o+">"},"Use onAutoPlayError() to handle this error yourself."),y.muted=!0,y.play())}})},ru=({audioContext:r,ref:o})=>{let s=null,u=!1;return{attemptToConnect:()=>{if(u)throw new Error("SharedElementSourceNode has been disposed");!s&&o.current&&(s=r.createMediaElementSource(o.current))},get:()=>{if(!s)throw new Error("Audio element not connected");return s},cleanup:()=>{s&&(s.disconnect(),s=null),u=!0}}},Xf=!1,qg=r=>{Xf||(Xf=!0,typeof window<"u"&&kt.warn({logLevel:r,tag:null},"AudioContext is not supported in this browser"))},Xg=({logLevel:r,latencyHint:o,audioEnabled:s})=>{const u=at();return f.useMemo(()=>u.isRendering||!s?null:typeof AudioContext>"u"?(qg(r),null):new AudioContext({latencyHint:o,sampleRate:48e3}),[r,o,u.isRendering,s])},Qf="data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",Qg=(r,o)=>{const s=Object.keys(r).sort(),u=Object.keys(o).sort();if(s.length!==u.length)return!1;for(let d=0;dr==="src"&&!s.startsWith("data:")&&!o.startsWith("data:")?new URL(s,window.origin).toString()!==new URL(o,window.origin).toString():s!==o,_a=f.createContext(null),Zf=({children:r,numberOfAudioTags:o,audioLatencyHint:s,audioEnabled:u})=>{const d=f.useRef([]),[h]=f.useState(o);if(o!==h)throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");const g=Fn(),y=Xg({logLevel:g,latencyHint:s,audioEnabled:u}),v=f.useMemo(()=>new Array(o).fill(!0).map(()=>{const k=f.createRef();return{id:Math.random(),ref:k,mediaElementSourceNode:y?ru({audioContext:y,ref:k}):null}}),[y,o]);(ge.useInsertionEffect??ge.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{v.forEach(({mediaElementSourceNode:k})=>{k?.cleanup()})})},[v]);const A=f.useRef(new Array(o).fill(!1)),b=f.useCallback(()=>{v.forEach(({ref:k,id:B})=>{const Q=d.current?.find(G=>G.id===B),{current:H}=k;if(H){if(Q===void 0){H.src=Qf;return}if(!Q)throw new TypeError("Expected audio data to be there");Object.keys(Q.props).forEach(G=>{Zg(G,Q.props[G],H[G])&&(H[G]=Q.props[G])})}})},[v]),C=f.useCallback(k=>{const{aud:B,audioId:Q,premounting:H,postmounting:G}=k,W=d.current?.find(pe=>pe.audioId===Q);if(W)return W;const _=A.current.findIndex(pe=>pe===!1);if(_===-1)throw new Error(`Tried to simultaneously mount ${o+1} tags at the same time. With the current settings, the maximum amount of tags is limited to ${o} 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:oe,mediaElementSourceNode:le}=v[_],fe=[...A.current];fe[_]=ee,A.current=fe;const ve={props:B,id:ee,el:oe,audioId:Q,mediaElementSourceNode:le,premounting:H,audioMounted:!!oe.current,postmounting:G,cleanupOnMediaTagUnmount:()=>{}};return d.current?.push(ve),b(),ve},[o,v,b]),T=f.useCallback(k=>{const B=[...A.current],Q=v.findIndex(H=>H.id===k);if(Q===-1)throw new TypeError("Error occured in ");B[Q]=!1,A.current=B,d.current=d.current?.filter(H=>H.id!==k),b()},[v,b]),N=f.useCallback(({aud:k,audioId:B,id:Q,premounting:H,postmounting:G})=>{let W=!1;d.current=d.current?.map(_=>{const ee=!!_.el.current;return _.audioMounted!==ee&&(W=!0),_.id===Q?Qg(k,_.props)&&_.premounting===H&&_.postmounting===G?_:(W=!0,{..._,props:k,premounting:H,postmounting:G,audioId:B,audioMounted:ee}):_}),W&&b()},[b]),M=_r(),U=at(),V=f.useCallback(()=>{v.forEach(k=>{d.current.find(Q=>Q.el===k.ref)?.premounting||ui({mediaRef:k.ref,mediaType:"audio",onAutoPlayError:null,logLevel:g,mountTime:M,reason:"playing all audios",isPlayer:U.isPlayer})}),y?.resume()},[y,g,M,v,U.isPlayer]),Z=f.useMemo(()=>({registerAudio:C,unregisterAudio:T,updateAudio:N,playAllAudios:V,numberOfAudioTags:o,audioContext:y}),[o,V,C,T,N,y]);return w.jsxs(_a.Provider,{value:Z,children:[v.map(({id:k,ref:B})=>w.jsx("audio",{ref:B,preload:"metadata",src:Qf},k)),r]})},Fg=({aud:r,audioId:o,premounting:s,postmounting:u})=>{const d=f.useContext(_a),[h]=f.useState(()=>{if(d&&d.numberOfAudioTags>0)return d.registerAudio({aud:r,audioId:o,premounting:s,postmounting:u});const y=ge.createRef(),v=d?.audioContext?ru({audioContext:d.audioContext,ref:y}):null;return{el:y,id:Math.random(),props:r,audioId:o,mediaElementSourceNode:v,premounting:s,audioMounted:!!y.current,postmounting:u,cleanupOnMediaTagUnmount:()=>{v?.cleanup()}}}),g=ge.useInsertionEffect??ge.useLayoutEffect;return typeof document<"u"&&(g(()=>{d&&d.numberOfAudioTags>0&&d.updateAudio({id:h.id,aud:r,audioId:o,premounting:s,postmounting:u})},[r,d,h.id,o,s,u]),g(()=>()=>{d&&d.numberOfAudioTags>0&&d.unregisterAudio(h.id)},[d,h.id])),h},Kg=1e-5,si=(r,o)=>Math.abs(r-o)Math.round(r/o*100)/100,lu=()=>typeof window>"u"||!/AppleWebKit/.test(window.navigator.userAgent)?!1:!window.navigator.userAgent.includes("Chrome/"),ci=()=>typeof window>"u"?!1:/iP(ad|od|hone)/i.test(window.navigator.userAgent)&&lu(),Jg=r=>ci()&&r.startsWith("blob:"),iu=({actualFrom:r,fps:o})=>Ff(Math.max(0,-r),o),ou=({duration:r,fps:o})=>Ff(r,o),Pg=({actualSrc:r,actualFrom:o,duration:s,fps:u})=>{if(Jg(r)||r.startsWith("data:")||!!new URL(r,(typeof window>"u"?null:window.location.href)??"http://localhost:3000").hash||!Number.isFinite(o))return r;const h=`${r}#t=${iu({actualFrom:o,fps:u})}`;return Number.isFinite(s)?`${h},${ou({duration:s,fps:u})}`:h},Wg=({prevStartFrom:r,newStartFrom:o,prevDuration:s,newDuration:u,fps:d})=>{const h=iu({actualFrom:r,fps:d}),g=iu({actualFrom:o,fps:d}),y=ou({duration:s,fps:d}),v=ou({duration:u,fps:d});return!(gy)},Ig=({actualSrc:r,actualFrom:o,duration:s,fps:u})=>{const d=f.useRef(o),h=f.useRef(s),g=f.useRef(r);return(!Wg({prevStartFrom:d.current,newStartFrom:o,prevDuration:h.current,newDuration:s,fps:u})||r!==g.current)&&(d.current=o,h.current=s,g.current=r),Pg({actualSrc:g.current,actualFrom:d.current,duration:h.current,fps:u})},Kf=!1,_g=r=>{Kf||(Kf=!0,kt.warn({logLevel:r,tag:null},"In Safari, setting a volume and a playback rate at the same time is buggy."),kt.warn({logLevel:r,tag:null},"In Desktop Safari, only volumes <= 1 will be applied."),kt.warn({logLevel:r,tag:null},r,"In Mobile Safari, the volume will be ignored and set to 1 if a playbackRate is set."))},Jf=({mediaRef:r,volume:o,logLevel:s,source:u,shouldUseWebAudioApi:d})=>{const h=f.useRef(null),g=f.useRef(o);g.current=o;const y=f.useContext(_a);if(!y)throw new Error("useAmplification must be used within a SharedAudioContext");const{audioContext:v}=y;if(typeof window<"u"&&f.useLayoutEffect(()=>{if(!v||!r.current||!d)return;if(r.current.playbackRate!==1&&lu()){_g(s);return}if(!u)return;const b=new GainNode(v,{gain:g.current});return u.attemptToConnect(),u.get().connect(b),b.connect(v.destination),h.current={gainNode:b},kt.trace({logLevel:s,tag:null},`Starting to amplify ${r.current?.src}. Gain = ${g.current}, playbackRate = ${r.current?.playbackRate}`),()=>{h.current=null,b.disconnect(),u.get().disconnect()}},[s,r,v,u,d]),h.current){const b=o;si(h.current.gainNode.gain.value,b)||(h.current.gainNode.gain.value=b,kt.trace({logLevel:s,tag:null},`Setting gain to ${b} for ${r.current?.src}`))}return(lu()&&r.current&&r.current?.playbackRate!==1||!d)&&r.current&&!si(o,r.current?.volume)&&(r.current.volume=Math.min(o,1)),h},Ea=()=>{const r=f.useContext(nt);return Math.min(0,r?.relativeFrom??0)},$a=r=>{const o=ai.useLoop(),s=nn(),u=Ea();return r==="repeat"||o===null?s+u:s+u+o.durationInFrames*o.iteration},$g=r=>{if(/data:|blob:/.test(r.substring(0,5)))return"Data URL";const o=r.split("/").map(s=>s.split("\\")).flat(1);return o[o.length-1]},Ca=({frame:r,volume:o,mediaVolume:s=1})=>{if(typeof o=="number")return o*s;if(typeof o>"u")return Number(s);const u=o(r)*s;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 ${r}`);if(Number.isNaN(u))throw new TypeError(`You passed in a function to the volume prop but it returned NaN for frame ${r}.`);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 ${r}.`);return Math.max(0,u)},Pf={},ey=r=>{Pf[r]||(console.warn(r),Pf[r]=!0)},Wf=({volume:r,mediaVolume:o,mediaType:s,src:u,displayName:d,trimBefore:h,trimAfter:g,playbackRate:y})=>{if(!u)throw new Error("No src passed");const v=Ea(),m=f.useContext(nt),A=Ut(),[b]=f.useState(()=>r),C=ni({mediaDurationInFrames:A.durationInFrames,playbackRate:y,trimBefore:h,trimAfter:g}),T=m?Math.min(m.durationInFrames,C):C,N=f.useMemo(()=>typeof r=="number"?r:new Array(Math.floor(Math.max(0,T+v))).fill(!0).map((k,B)=>Ca({frame:B+v,volume:r,mediaVolume:o})).join(","),[T,v,r,o]);f.useEffect(()=>{typeof r=="number"&&r!==b&&ey(`Remotion: The ${s} 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`)},[b,s,u,r]);const M=typeof r=="function",U=$o(),{rootId:V}=f.useContext(Ht),Z=at();return{volumes:N,duration:T,doesVolumeChange:M,nonce:U,rootId:V,isStudio:Z.isStudio,finalDisplayName:d??$g(u)}},uu=({volume:r,mediaVolume:o,src:s,mediaType:u,playbackRate:d,displayName:h,id:g,stack:y,showInTimeline:v,premountDisplay:m,postmountDisplay:A,loopDisplay:b})=>{const C=f.useContext(nt),T=Ea(),{registerSequence:N,unregisterSequence:M}=f.useContext(Fa),{volumes:U,duration:V,doesVolumeChange:Z,nonce:k,rootId:B,isStudio:Q,finalDisplayName:H}=Wf({volume:r,mediaVolume:o,mediaType:u,src:s,displayName:h,trimAfter:void 0,trimBefore:void 0,playbackRate:d});f.useEffect(()=>{if(!s)throw new Error("No src passed");if(!(!Q&&window.process?.env?.NODE_ENV!=="test")&&v)return N({type:u,src:s,id:g,duration:V,from:0,parent:C?.id??null,displayName:H,rootId:B,volume:U,showInTimeline:!0,nonce:k,startMediaFrom:0-T,doesVolumeChange:Z,loopDisplay:b,playbackRate:d,stack:y,premountDisplay:m,postmountDisplay:A}),()=>{M(g)}},[V,g,C,s,N,M,U,Z,k,u,T,d,y,v,m,A,Q,b,B,H])},ty=(r,o)=>{const[s,u]=f.useState([]),[d,h]=f.useState([]),[g,y]=f.useState([]),m=at().isRendering,A=f.useRef(!1),b=f.useCallback(N=>m?{unblock:()=>{}}:(u(M=>[...M,N]),{unblock:()=>{u(M=>{const U=M.filter(V=>V!==N);return U.length===M.length?M:U})}}),[m]),C=f.useCallback(N=>(h(M=>[...M,N]),{remove:()=>{h(M=>M.filter(U=>U!==N))}}),[]),T=f.useCallback(N=>(y(M=>[...M,N]),{remove:()=>{y(M=>M.filter(U=>U!==N))}}),[]);return f.useEffect(()=>{m||s.length>0&&(d.forEach(N=>N()),ht({logLevel:r,message:"Player is entering buffer state",mountTime:o,tag:"player"}))},[s]),typeof window<"u"&&f.useLayoutEffect(()=>{m||s.length===0&&(g.forEach(N=>N()),ht({logLevel:r,message:"Player is exiting buffer state",mountTime:o,tag:"player"}))},[s]),f.useMemo(()=>({addBlock:b,listenForBuffering:C,listenForResume:T,buffering:A}),[b,A,C,T])},er=ge.createContext(null),If=({children:r})=>{const{logLevel:o,mountTime:s}=f.useContext(wa),u=ty(o??"info",s);return w.jsx(er.Provider,{value:u,children:r})},_f=r=>{const[o,s]=f.useState(r.buffering.current);return f.useEffect(()=>{const u=()=>{s(!0)},d=()=>{s(!1)};return r.listenForBuffering(u),r.listenForResume(d),()=>{r.listenForBuffering(()=>{}),r.listenForResume(()=>{})}},[r]),o},su=()=>{const r=f.useContext(er),o=r?r.addBlock:null;return f.useMemo(()=>({delayPlayback:()=>{if(!o)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:s}=o({id:String(Math.random())});return{unblock:s}}}),[o])},ny=()=>/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent),ay=({mediaRef:r,mediaType:o,onVariableFpsVideoDetected:s,pauseWhenBuffering:u,logLevel:d,mountTime:h})=>{const g=f.useRef(!1),{delayPlayback:y}=su(),v=f.useCallback(m=>{if(o!=="video"||!u)return;const A=r.current;if(!A)return;if(A.readyState>=A.HAVE_FUTURE_DATA&&!ny()){ht({logLevel:d,message:`Not using buffer until first frame, because readyState is ${A.readyState} and is not Safari or Desktop Chrome`,mountTime:h,tag:"buffer"});return}if(!A.requestVideoFrameCallback){ht({logLevel:d,message:"Not using buffer until first frame, because requestVideoFrameCallback is not supported",mountTime:h,tag:"buffer"});return}g.current=!0,ht({logLevel:d,message:`Buffering ${r.current?.src} until the first frame is received`,mountTime:h,tag:"buffer"});const b=y(),C=()=>{b.unblock(),A.removeEventListener("ended",C,{once:!0}),A.removeEventListener("pause",C,{once:!0}),g.current=!1},T=()=>{C()};A.requestVideoFrameCallback((N,M)=>{Math.abs(M.mediaTime-m)>.5&&s(),C()}),A.addEventListener("ended",T,{once:!0}),A.addEventListener("pause",T,{once:!0}),A.addEventListener("canplay",T,{once:!0})},[y,d,r,o,h,s,u]);return f.useMemo(()=>({isBuffering:()=>g.current,bufferUntilFirstFrame:v}),[v])},ry=r=>{const o=ge.useRef({time:r.current?.currentTime??0,lastUpdate:performance.now()}),s=r.current?.currentTime??null;return s!==null&&o.current.time!==s&&(o.current.time=s,o.current.lastUpdate=performance.now()),o},fi=({mediaRef:r,time:o,logLevel:s,why:u,mountTime:d})=>{const h=ci()?Number(o.toFixed(1)):o;return ht({logLevel:s,tag:"seek",message:`Seeking from ${r.currentTime} to ${h}. src= ${r.src} Reason: ${u}`,mountTime:d}),r.currentTime=h,h},ly=({element:r,shouldBuffer:o,isPremounting:s,isPostmounting:u,logLevel:d,mountTime:h,src:g})=>{const y=su(),[v,m]=f.useState(!1);return f.useEffect(()=>{let A=[];const{current:b}=r;if(!b||!o)return;if(s||u){if((s||u)&&b.readyState{let U=!1;A.forEach(V=>{V(M),U=!0}),A=[],m(V=>(V&&(U=!0),!1)),U&&ht({logLevel:d,message:`Unmarking as buffering: ${b.src}. Reason: ${M}`,tag:"buffer",mountTime:h})},T=M=>{m(!0),ht({logLevel:d,message:`Marking as buffering: ${b.src}. Reason: ${M}`,tag:"buffer",mountTime:h});const{unblock:U}=y.delayPlayback(),V=()=>{C('"canplay" was fired'),N()},Z=()=>{C('"error" event was occurred'),N()};b.addEventListener("canplay",V,{once:!0}),A.push(()=>{b.removeEventListener("canplay",V)}),b.addEventListener("error",Z,{once:!0}),A.push(()=>{b.removeEventListener("error",Z)}),A.push(k=>{ht({logLevel:d,message:`Unblocking ${b.src} from buffer. Reason: ${k}`,tag:"buffer",mountTime:h}),U()})},N=()=>{if(b.readyState{T('"waiting" event was fired')};b.addEventListener("waiting",M),A.push(()=>{b.removeEventListener("waiting",M)})}};return N(),()=>{C("element was unmounted or prop changed")}},[y,g,r,s,u,d,o,h]),v},iy=({mediaRef:r,mediaType:o,lastSeek:s,onVariableFpsVideoDetected:u})=>{const d=f.useRef(null);return f.useEffect(()=>{const{current:h}=r;if(h)d.current={time:h.currentTime,lastUpdate:performance.now()};else{d.current=null;return}if(o!=="video"){d.current=null;return}const g=h;if(!g.requestVideoFrameCallback)return;let y=()=>{};const v=()=>{if(!g)return;const m=g.requestVideoFrameCallback((A,b)=>{if(d.current!==null){const C=Math.abs(d.current.time-b.mediaTime),T=Math.abs(s.current===null?1/0:b.mediaTime-s.current);C>.5&&T>.5&&b.mediaTime>d.current.time&&u()}d.current={time:b.mediaTime,lastUpdate:performance.now()},v()});y=()=>{g.cancelVideoFrameCallback(m),y=()=>{}}};return v(),()=>{y()}},[s,r,o,u]),d};function oy(r,o,s,u){const{extrapolateLeft:d,extrapolateRight:h,easing:g}=u;let y=r;const[v,m]=o,[A,b]=s;if(ym){if(h==="identity")return y;if(h==="clamp")y=m;else if(h==="wrap"){const C=m-v;y=((y-v)%C+C)%C+v}}return A===b?A:(y=(y-v)/(m-v),y=g(y),y=y*(b-A)+A,y)}function uy(r,o){let s;for(s=1;s=r);++s);return s-1}function sy(r){for(let o=1;or[o-1]))throw new Error(`inputRange must be strictly monotonically increasing but got [${r.join(",")}]`)}function $f(r,o){if(o.length<2)throw new Error(r+" must have at least 2 elements");for(const s of o){if(typeof s!="number")throw new Error(`${r} must contain only numbers`);if(!Number.isFinite(s))throw new Error(`${r} must contain only finite numbers, but got [${o.join(",")}]`)}}function an(r,o,s,u){if(typeof r>"u")throw new Error("input can not be undefined");if(typeof o>"u")throw new Error("inputRange can not be undefined");if(typeof s>"u")throw new Error("outputRange can not be undefined");if(o.length!==s.length)throw new Error("inputRange ("+o.length+") and outputRange ("+s.length+") must have the same length");$f("inputRange",o),$f("outputRange",s),sy(o);const d=u?.easing??(v=>v);let h="extend";u?.extrapolateLeft!==void 0&&(h=u.extrapolateLeft);let g="extend";if(u?.extrapolateRight!==void 0&&(g=u.extrapolateRight),typeof r!="number")throw new TypeError("Cannot interpolate an input which is not a number");const y=uy(r,o);return oy(r,[o[y],o[y+1]],[s[y],s[y+1]],{easing:d,extrapolateLeft:h,extrapolateRight:g})}var ed=({frame:r,playbackRate:o,startFrom:s})=>an(r,[-1,s,s+1],[-1,s,s+o]),td=({fps:r,frame:o,playbackRate:s,startFrom:u})=>{const d=ed({frame:o,playbackRate:s,startFrom:u}),h=1e3/r;return d*h/1e3},nd={},cy=(r,o)=>{if(r===null||r.seekable.length===0||r.seekable.length>1||nd[r.src])return;const s={start:r.seekable.start(0),end:r.seekable.end(0)};if(s.start===0&&s.end===0){const u=[`The media ${r.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(o==="console-error")console.error(u);else if(o==="console-warning")console.warn(`The media ${r.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);nd[r.src]=!0}},ad=({mediaRef:r,src:o,mediaType:s,playbackRate:u,onlyWarnForMediaSeekingError:d,acceptableTimeshift:h,pauseWhenBuffering:g,isPremounting:y,isPostmounting:v,onAutoPlayError:m})=>{const{playbackRate:A}=f.useContext(Ht),b=nn(),C=Zn(),[T]=Of(),N=f.useContext(er),{fps:M}=Ut(),U=Ea(),V=f.useRef(null),Z=f.useRef(null),k=Fn(),B=_r();if(!N)throw new Error("useMediaPlayback must be used inside a ");const Q=f.useRef({}),H=f.useCallback(()=>{o&&(Q.current[o]||(kt.verbose({logLevel:k,tag:null},`Detected ${o} as a variable FPS video. Disabling buffering while seeking.`),Q.current[o]=!0))},[k,o]),G=iy({mediaRef:r,mediaType:s,lastSeek:Z,onVariableFpsVideoDetected:H}),W=ry(r),_=td({frame:b,playbackRate:u,startFrom:-U,fps:M}),ee=ly({element:r,shouldBuffer:g,isPremounting:y,isPostmounting:v,logLevel:k,mountTime:B,src:o??null}),{bufferUntilFirstFrame:oe,isBuffering:le}=ay({mediaRef:r,mediaType:s,onVariableFpsVideoDetected:H,pauseWhenBuffering:g,logLevel:k,mountTime:B}),fe=u*A,ve=r.current?.duration?Math.min(r.current.duration,h??.65):h??.65,pe=_f(N);f.useEffect(()=>{if(r.current?.paused)return;if(!T){ht({logLevel:k,tag:"pause",message:`Pausing ${r.current?.src} because ${y?"media is premounting":v?"media is postmounting":"Player is not playing"}`,mountTime:B}),r.current?.pause();return}const q=ee||le();N.buffering.current&&!q&&(ht({logLevel:k,tag:"pause",message:`Pausing ${r.current?.src} because player is buffering but media tag is not`,mountTime:B}),r.current?.pause())},[le,ee,N,pe,y,k,r,s,B,T,v]);const R=at();f.useLayoutEffect(()=>{const q=Math.max(0,fe);r.current&&r.current.playbackRate!==q&&(r.current.playbackRate=q)},[r,fe]),f.useEffect(()=>{const q=s==="audio"?"":"";if(!r.current)throw new Error(`No ${s} ref found`);if(!o)throw new Error(`No 'src' attribute was passed to the ${q} element.`);const{duration:P}=r.current,te=!Number.isNaN(P)&&Number.isFinite(P)?Math.min(P,_):_,me=W.current.time,S=G.current?.time??null,Y=Q.current[o],J=Math.abs(te-me),I=S?Math.abs(te-S):null,$=G.current?.lastUpdate&&G.current.time>W.current.lastUpdate?I:J,ie=I&&!Y?$:J;if(ie>ve&&V.current!==te){Z.current=fi({mediaRef:r.current,time:te,logLevel:k,why:`because time shift is too big. shouldBeTime = ${te}, isTime = ${me}, requestVideoCallbackTime = ${S}, timeShift = ${ie}${Y?", isVariableFpsVideo = true":""}, isPremounting = ${y}, isPostmounting = ${v}, pauseWhenBuffering = ${g}`,mountTime:B}),V.current=Z.current,T&&(fe>0&&oe(te),r.current.paused&&ui({mediaRef:r,mediaType:s,onAutoPlayError:m,logLevel:k,mountTime:B,reason:"player is playing but media tag is paused, and just seeked",isPlayer:R.isPlayer})),d||cy(r.current,d?"console-warning":"console-error");return}const ae=T?.15:.01,Re=Math.abs(r.current.currentTime-te)>ae,Ce=ee||le(),Xe=N.buffering.current&&!Ce;if(!T||Xe){Re&&(Z.current=fi({mediaRef:r.current,time:te,logLevel:k,why:`not playing or something else is buffering. time offset is over seek threshold (${ae})`,mountTime:B}));return}if(!T||N.buffering.current)return;const et=r.current.paused&&!r.current.ended;if(et||C===0){const Rt=et?"media tag is paused":"absolute frame is 0";Re&&(Z.current=fi({mediaRef:r.current,time:te,logLevel:k,why:`is over timeshift threshold (threshold = ${ae}) and ${Rt}`,mountTime:B})),ui({mediaRef:r,mediaType:s,onAutoPlayError:m,logLevel:k,mountTime:B,reason:`player is playing and ${Rt}`,isPlayer:R.isPlayer}),!Y&&fe>0&&oe(te)}},[C,ve,oe,N.buffering,G,k,_,le,ee,r,s,d,fe,T,o,m,y,v,g,B,W,R.isPlayer])},rd=({mediaRef:r,id:o,mediaType:s,onAutoPlayError:u,isPremounting:d,isPostmounting:h})=>{const{audioAndVideoTags:g,imperativePlaying:y}=f.useContext(Ht),v=Fn(),m=_r(),A=at();f.useEffect(()=>{const b={id:o,play:C=>{if(y.current&&!(d||h))return ui({mediaRef:r,mediaType:s,onAutoPlayError:u,logLevel:v,mountTime:m,reason:C,isPlayer:A.isPlayer})}};return g.current.push(b),()=>{g.current=g.current.filter(C=>C.id!==o)}},[g,o,r,s,u,y,d,h,v,m,A.isPlayer])},cu=f.createContext({mediaMuted:!1,mediaVolume:1}),fu=f.createContext({setMediaMuted:()=>{throw new Error("default")},setMediaVolume:()=>{throw new Error("default")}}),du=()=>{const{mediaVolume:r}=f.useContext(cu),{setMediaVolume:o}=f.useContext(fu);return f.useMemo(()=>[r,o],[r,o])},mu=()=>{const{mediaMuted:r}=f.useContext(cu),{setMediaMuted:o}=f.useContext(fu);return f.useMemo(()=>[r,o],[r,o])},tr=r=>{if(r>=100)throw new Error(`Volume was set to ${r}, 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.`)},fy=(r,o)=>{const[s]=f.useState(r.shouldPreMountAudioTags);if(r.shouldPreMountAudioTags!==s)throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");const u=Fn(),{volume:d,muted:h,playbackRate:g,shouldPreMountAudioTags:y,src:v,onDuration:m,acceptableTimeShiftInSeconds:A,_remotionInternalNeedsDurationCalculation:b,_remotionInternalNativeLoopPassed:C,_remotionInternalStack:T,allowAmplificationDuringRender:N,name:M,pauseWhenBuffering:U,showInTimeline:V,loopVolumeCurveBehavior:Z,stack:k,crossOrigin:B,delayRenderRetries:Q,delayRenderTimeoutInMilliseconds:H,toneFrequency:G,useWebAudioApi:W,onError:_,onNativeError:ee,audioStreamIndex:oe,...le}=r,[fe]=du(),[ve]=mu(),pe=$a(Z??"repeat"),{hidden:R}=f.useContext(Wr);if(!v)throw new TypeError("No 'src' was passed to .");const q=Ia(v),P=f.useContext(nt),[te]=f.useState(()=>String(Math.random())),me=R[te]??!1,S=Ca({frame:pe,volume:d,mediaVolume:fe});tr(S);const Y=au({crossOrigin:B,requestsVideoFrame:!1,isClientSideRendering:!1}),J=f.useMemo(()=>({muted:h||ve||me||S<=0,src:q,loop:C,crossOrigin:Y,...le}),[C,me,ve,h,le,q,S,Y]),I=f.useMemo(()=>`audio-${ba(v??"")}-${P?.relativeFrom}-${P?.cumulatedFrom}-${P?.durationInFrames}-muted:${r.muted}-loop:${r.loop}`,[v,P?.relativeFrom,P?.cumulatedFrom,P?.durationInFrames,r.muted,r.loop]),{el:$,mediaElementSourceNode:ie,cleanupOnMediaTagUnmount:ae}=Fg({aud:J,audioId:I,premounting:!!P?.premounting,postmounting:!!P?.postmounting});uu({volume:d,mediaVolume:fe,src:v,mediaType:"audio",playbackRate:g??1,displayName:M??null,id:te,stack:T,showInTimeline:V,premountDisplay:P?.premountDisplay??null,postmountDisplay:P?.postmountDisplay??null,loopDisplay:void 0}),ad({mediaRef:$,src:v,mediaType:"audio",playbackRate:g??1,onlyWarnForMediaSeekingError:!1,acceptableTimeshift:A??null,isPremounting:!!P?.premounting,isPostmounting:!!P?.postmounting,pauseWhenBuffering:U,onAutoPlayError:null}),rd({id:te,isPostmounting:!!P?.postmounting,isPremounting:!!P?.premounting,mediaRef:$,mediaType:"audio",onAutoPlayError:null}),Jf({logLevel:u,mediaRef:$,source:ie,volume:S,shouldUseWebAudioApi:W??!1}),(ge.useInsertionEffect??ge.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{ae()})},[ae]),f.useImperativeHandle(o,()=>$.current,[$]);const Ce=f.useRef(m);return Ce.current=m,f.useEffect(()=>{const{current:Xe}=$;if(!Xe)return;if(Xe.duration){Ce.current?.(Xe.src,Xe.duration);return}const et=()=>{Ce.current?.(Xe.src,Xe.duration)};return Xe.addEventListener("loadedmetadata",et),()=>{Xe.removeEventListener("loadedmetadata",et)}},[$,v]),s?null:w.jsx("audio",{ref:$,preload:"metadata",crossOrigin:Y,...J})},ld=f.forwardRef(fy),dy=(r,o)=>{const s=f.useRef(null),{volume:u,playbackRate:d,allowAmplificationDuringRender:h,onDuration:g,toneFrequency:y,_remotionInternalNeedsDurationCalculation:v,_remotionInternalNativeLoopPassed:m,acceptableTimeShiftInSeconds:A,name:b,onNativeError:C,delayRenderRetries:T,delayRenderTimeoutInMilliseconds:N,loopVolumeCurveBehavior:M,pauseWhenBuffering:U,audioStreamIndex:V,...Z}=r,k=Zn(),B=$a(M??"repeat"),Q=nn(),H=f.useContext(nt),{registerRenderAsset:G,unregisterRenderAsset:W}=f.useContext(Sa),{delayRender:_,continueRender:ee}=Kn(),oe=f.useMemo(()=>`audio-${ba(r.src??"")}-${H?.relativeFrom}-${H?.cumulatedFrom}-${H?.durationInFrames}`,[r.src,H?.relativeFrom,H?.cumulatedFrom,H?.durationInFrames]),le=Ca({volume:u,frame:B,mediaVolume:1});tr(le),f.useImperativeHandle(o,()=>s.current,[]),f.useEffect(()=>{if(!r.src)throw new Error("No src passed");if(window.remotion_audioEnabled&&!r.muted&&!(le<=0))return G({type:"audio",src:cn(r.src),id:oe,frame:k,volume:le,mediaFrame:Q,playbackRate:r.playbackRate??1,toneFrequency:y??1,audioStartFrame:Math.max(0,-(H?.relativeFrom??0)),audioStreamIndex:V??0}),()=>W(oe)},[r.muted,r.src,G,k,oe,W,le,B,Q,d,r.playbackRate,y,H?.relativeFrom,V]);const{src:fe}=r,ve=o||v;return f.useLayoutEffect(()=>{if(window.process?.env?.NODE_ENV==="test"||!ve)return;const pe=_("Loading duration with src="+fe,{retries:T??void 0,timeoutInMilliseconds:N??void 0}),{current:R}=s,q=()=>{R?.duration&&g(R.src,R.duration),ee(pe)};return R?.duration?(g(R.src,R.duration),ee(pe)):R?.addEventListener("loadedmetadata",q,{once:!0}),()=>{R?.removeEventListener("loadedmetadata",q),ee(pe)}},[fe,g,ve,T,N,ee,_]),ve?w.jsx("audio",{ref:s,...Z,onError:C}):null},my=f.forwardRef(dy),hy=(r,o)=>{const s=f.useContext(_a),{startFrom:u,endAt:d,trimBefore:h,trimAfter:g,name:y,stack:v,pauseWhenBuffering:m,showInTimeline:A,onError:b,...C}=r,{loop:T,...N}=r,{fps:M}=Ut(),U=at();if(U.isClientSideRendering)throw new Error(" is not supported in @remotion/web-renderer. Use