var Nx=Object.defineProperty;var Dx=($n,rn,he)=>rn in $n?Nx($n,rn,{enumerable:!0,configurable:!0,writable:!0,value:he}):$n[rn]=he;var Pe=($n,rn,he)=>Dx($n,typeof rn!="symbol"?rn+"":rn,he);(function(){"use strict";function $n(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var rn={exports:{}},he={};var nf;function Fv(){if(nf)return he;nf=1;var r=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),s=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"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),C=Symbol.iterator;function T(E){return E===null||typeof E!="object"?null:(E=C&&E[C]||E["@@iterator"],typeof E=="function"?E:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,U={};function V(E,q,Z){this.props=E,this.context=q,this.refs=U,this.updater=Z||R}V.prototype.isReactComponent={},V.prototype.setState=function(E,q){if(typeof E!="object"&&typeof E!="function"&&E!=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,E,q,"setState")},V.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function $(){}$.prototype=V.prototype;function k(E,q,Z){this.props=E,this.context=q,this.refs=U,this.updater=Z||R}var O=k.prototype=new $;O.constructor=k,A(O,V.prototype),O.isPureReactComponent=!0;var F=Array.isArray;function B(){}var L={H:null,A:null,T:null,S:null},J=Object.prototype.hasOwnProperty;function P(E,q,Z){var I=Z.ref;return{$$typeof:r,type:E,key:q,ref:I!==void 0?I:null,props:Z}}function ee(E,q){return P(E.type,q,E.props)}function oe(E){return typeof E=="object"&&E!==null&&E.$$typeof===r}function ie(E){var q={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(Z){return q[Z]})}var fe=/\/+/g;function pe(E,q){return typeof E=="object"&&E!==null&&E.key!=null?ie(""+E.key):q.toString(36)}function ve(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(B,B):(E.status="pending",E.then(function(q){E.status==="pending"&&(E.status="fulfilled",E.value=q)},function(q){E.status==="pending"&&(E.status="rejected",E.reason=q)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function z(E,q,Z,I,W){var le=typeof E;(le==="undefined"||le==="boolean")&&(E=null);var ae=!1;if(E===null)ae=!0;else switch(le){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(E.$$typeof){case r:case l:ae=!0;break;case w:return ae=E._init,z(ae(E._payload),q,Z,I,W)}}if(ae)return W=W(E),ae=I===""?"."+pe(E,0):I,F(W)?(Z="",ae!=null&&(Z=ae.replace(fe,"$&/")+"/"),z(W,q,Z,"",function(Xe){return Xe})):W!=null&&(oe(W)&&(W=ee(W,Z+(W.key==null||E&&E.key===W.key?"":(""+W.key).replace(fe,"$&/")+"/")+ae)),q.push(W)),1;ae=0;var Me=I===""?".":I+":";if(F(E))for(var Te=0;Te>>1,me=z[te];if(0>>1;ted(Z,K))Id(W,Z)?(z[te]=W,z[I]=K,te=I):(z[te]=Z,z[q]=K,te=q);else if(Id(W,K))z[te]=W,z[I]=K,te=I;else break e}}return Y}function d(z,Y){var K=z.sortIndex-Y.sortIndex;return K!==0?K:z.id-Y.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 p=[],m=[],w=1,b=null,C=3,T=!1,R=!1,A=!1,U=!1,V=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function O(z){for(var Y=u(m);Y!==null;){if(Y.callback===null)s(m);else if(Y.startTime<=z)s(m),Y.sortIndex=Y.expirationTime,l(p,Y);else break;Y=u(m)}}function F(z){if(A=!1,O(z),!R)if(u(p)!==null)R=!0,B||(B=!0,ie());else{var Y=u(m);Y!==null&&ve(F,Y.startTime-z)}}var B=!1,L=-1,J=5,P=-1;function ee(){return U?!0:!(r.unstable_now()-Pz&&ee());){var te=b.callback;if(typeof te=="function"){b.callback=null,C=b.priorityLevel;var me=te(b.expirationTime<=z);if(z=r.unstable_now(),typeof me=="function"){b.callback=me,O(z),Y=!0;break t}b===u(p)&&s(p),O(z)}else s(p);b=u(p)}if(b!==null)Y=!0;else{var E=u(m);E!==null&&ve(F,E.startTime-z),Y=!1}}break e}finally{b=null,C=K,T=!1}Y=void 0}}finally{Y?ie():B=!1}}}var ie;if(typeof k=="function")ie=function(){k(oe)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,pe=fe.port2;fe.port1.onmessage=oe,ie=function(){pe.postMessage(null)}}else ie=function(){V(oe,0)};function ve(z,Y){L=V(function(){z(r.unstable_now())},Y)}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(z){z.callback=null},r.unstable_forceFrameRate=function(z){0>z||125te?(z.sortIndex=K,l(m,z),u(p)===null&&z===u(m)&&(A?($(L),L=-1):A=!0,ve(F,K-te))):(z.sortIndex=me,l(p,z),R||T||(R=!0,B||(B=!0,ie()))),z},r.unstable_shouldYield=ee,r.unstable_wrapCallback=function(z){var Y=C;return function(){var K=C;C=Y;try{return z.apply(this,arguments)}finally{C=K}}}})(Go)),Go}var lf;function Gv(){return lf||(lf=1,Yo.exports=Yv()),Yo.exports}var $o={exports:{}},gt={};var of;function $v(){if(of)return gt;of=1;var r=qo();function l(p){var m="https://react.dev/errors/"+p;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(l){console.error(l)}}return r(),$o.exports=$v(),$o.exports}var cf;function Xv(){if(cf)return Zr;cf=1;var r=Gv(),l=qo(),u=sf();function s(e){var t="https://react.dev/errors/"+e;if(1me||(e.current=te[me],te[me]=null,me--)}function Z(e,t){me++,te[me]=e.current,e.current=t}var I=E(null),W=E(null),le=E(null),ae=E(null);function Me(e,t){switch(Z(le,t),Z(W,e),Z(I,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?fv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=fv(t),e=dv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(I),Z(I,e)}function Te(){q(I),q(W),q(le)}function Xe(e){e.memoizedState!==null&&Z(ae,e);var t=I.current,n=dv(t,e.type);t!==n&&(Z(W,e),Z(I,n))}function at(e){W.current===e&&(q(I),q(W)),ae.current===e&&(q(ae),Zi._currentValue=K)}var Gt,Ot;function Et(e){if(Gt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Gt=t&&t[1]||"",Ot=-1)":-1i||S[a]!==D[i]){var G=` `+S[a].replace(" at new "," at ");return e.displayName&&G.includes("")&&(G=G.replace("",e.displayName)),G}while(1<=a&&0<=i);break}}}finally{De=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Et(n):""}function on(e,t){switch(e.tag){case 26:case 27:case 5:return Et(e.type);case 16:return Et("Lazy");case 13:return e.child!==t&&t!==null?Et("Suspense Fallback"):Et("Suspense");case 19:return Et("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 Et("Activity");default:return""}}function hn(e){try{var t="",n=null;do t+=on(e,n),n=e,e=e.return;while(e);return t}catch(a){return` Error generating stack: `+a.message+` `+a.stack}}var jt=Object.prototype.hasOwnProperty,$t=r.unstable_scheduleCallback,En=r.unstable_cancelCallback,Xt=r.unstable_shouldYield,Ct=r.unstable_requestPaint,ut=r.unstable_now,pn=r.unstable_getCurrentPriorityLevel,Cn=r.unstable_ImmediatePriority,Jn=r.unstable_UserBlockingPriority,Qt=r.unstable_NormalPriority,Tn=r.unstable_LowPriority,un=r.unstable_IdlePriority,In=r.log,El=r.unstable_setDisableYieldValue,Tt=null,dt=null;function vn(e){if(typeof In=="function"&&El(e),dt&&typeof dt.setStrictMode=="function")try{dt.setStrictMode(Tt,e)}catch{}}var bt=Math.clz32?Math.clz32:Yu,Cl=Math.log,Fu=Math.LN2;function Yu(e){return e>>>=0,e===0?32:31-(Cl(e)/Fu|0)|0}var lr=256,or=262144,ur=4194304;function An(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 sr(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var i=0,o=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var v=a&134217727;return v!==0?(a=v&~o,a!==0?i=An(a):(c&=v,c!==0?i=An(c):n||(n=v&~e,n!==0&&(i=An(n))))):(v=a&~o,v!==0?i=An(v):c!==0?i=An(c):n||(n=a&~e,n!==0&&(i=An(n)))),i===0?0:t!==0&&t!==i&&(t&o)===0&&(o=i&-i,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:i}function gn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function cr(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 Tl(){var e=ur;return ur<<=1,(ur&62914560)===0&&(ur=4194304),e}function li(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Al(e,t,n,a,i,o){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 v=e.entanglements,S=e.expirationTimes,D=e.hiddenUpdates;for(n=c&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Tw=/[\n"\\]/g;function Kt(e){return e.replace(Tw,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ju(e,t,n,a,i,o,c,v){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=""+Zt(t)):e.value!==""+Zt(t)&&(e.value=""+Zt(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?Iu(e,c,Zt(t)):n!=null?Iu(e,c,Zt(n)):a!=null&&e.removeAttribute("value"),i==null&&o!=null&&(e.defaultChecked=!!o),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+Zt(v):e.removeAttribute("name")}function im(e,t,n,a,i,o,c,v){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||n!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){Ku(e);return}n=n!=null?""+Zt(n):"",t=t!=null?""+Zt(t):n,v||t===e.value||(e.value=t),e.defaultValue=t}a=a??i,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=v?e.checked:!!a,e.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),Ku(e)}function Iu(e,t,n){t==="number"&&_l(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function pr(e,t,n,a){if(e=e.options,t){t={};for(var i=0;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ns=!1;if(zn)try{var di={};Object.defineProperty(di,"passive",{get:function(){ns=!0}}),window.addEventListener("test",di,di),window.removeEventListener("test",di,di)}catch{ns=!1}var Pn=null,as=null,Dl=null;function dm(){if(Dl)return Dl;var e,t=as,n=t.length,a,i="value"in Pn?Pn.value:Pn.textContent,o=i.length;for(e=0;e=pi),ym=" ",bm=!1;function wm(e,t){switch(e){case"keyup":return Ww.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var br=!1;function t1(e,t){switch(e){case"compositionend":return xm(t);case"keypress":return t.which!==32?null:(bm=!0,ym);case"textInput":return e=t.data,e===ym&&bm?null:e;default:return null}}function n1(e,t){if(br)return e==="compositionend"||!us&&wm(e,t)?(e=dm(),Dl=as=Pn=null,br=!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=zm(n)}}function Nm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=_l(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=_l(e.document)}return t}function fs(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 c1=zn&&"documentMode"in document&&11>=document.documentMode,wr=null,ds=null,bi=null,ms=!1;function Om(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ms||wr==null||wr!==_l(a)||(a=wr,"selectionStart"in a&&fs(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}),bi&&yi(bi,a)||(bi=a,a=Ao(ds,"onSelect"),0>=c,i-=c,bn=1<<32-bt(t)+i|n<be?(Ce=re,re=null):Ce=re.sibling;var Ne=j(_,re,N[be],X);if(Ne===null){re===null&&(re=Ce);break}e&&re&&Ne.alternate===null&&t(_,re),M=o(Ne,M,be),_e===null?se=Ne:_e.sibling=Ne,_e=Ne,re=Ce}if(be===N.length)return n(_,re),Ae&&Nn(_,be),se;if(re===null){for(;bebe?(Ce=re,re=null):Ce=re.sibling;var wa=j(_,re,Ne.value,X);if(wa===null){re===null&&(re=Ce);break}e&&re&&wa.alternate===null&&t(_,re),M=o(wa,M,be),_e===null?se=wa:_e.sibling=wa,_e=wa,re=Ce}if(Ne.done)return n(_,re),Ae&&Nn(_,be),se;if(re===null){for(;!Ne.done;be++,Ne=N.next())Ne=Q(_,Ne.value,X),Ne!==null&&(M=o(Ne,M,be),_e===null?se=Ne:_e.sibling=Ne,_e=Ne);return Ae&&Nn(_,be),se}for(re=a(re);!Ne.done;be++,Ne=N.next())Ne=H(re,_,be,Ne.value,X),Ne!==null&&(e&&Ne.alternate!==null&&re.delete(Ne.key===null?be:Ne.key),M=o(Ne,M,be),_e===null?se=Ne:_e.sibling=Ne,_e=Ne);return e&&re.forEach(function(_x){return t(_,_x)}),Ae&&Nn(_,be),se}function Le(_,M,N,X){if(typeof N=="object"&&N!==null&&N.type===A&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case T:e:{for(var se=N.key;M!==null;){if(M.key===se){if(se=N.type,se===A){if(M.tag===7){n(_,M.sibling),X=i(M,N.props.children),X.return=_,_=X;break e}}else if(M.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===J&&La(se)===M.type){n(_,M.sibling),X=i(M,N.props),Ti(X,N),X.return=_,_=X;break e}n(_,M);break}else t(_,M);M=M.sibling}N.type===A?(X=Va(N.props.children,_.mode,X,N.key),X.return=_,_=X):(X=Fl(N.type,N.key,N.props,null,_.mode,X),Ti(X,N),X.return=_,_=X)}return c(_);case R:e:{for(se=N.key;M!==null;){if(M.key===se)if(M.tag===4&&M.stateNode.containerInfo===N.containerInfo&&M.stateNode.implementation===N.implementation){n(_,M.sibling),X=i(M,N.children||[]),X.return=_,_=X;break e}else{n(_,M);break}else t(_,M);M=M.sibling}X=ws(N,_.mode,X),X.return=_,_=X}return c(_);case J:return N=La(N),Le(_,M,N,X)}if(ve(N))return ne(_,M,N,X);if(ie(N)){if(se=ie(N),typeof se!="function")throw Error(s(150));return N=se.call(N),de(_,M,N,X)}if(typeof N.then=="function")return Le(_,M,Kl(N),X);if(N.$$typeof===k)return Le(_,M,$l(_,N),X);Jl(_,N)}return typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint"?(N=""+N,M!==null&&M.tag===6?(n(_,M.sibling),X=i(M,N),X.return=_,_=X):(n(_,M),X=bs(N,_.mode,X),X.return=_,_=X),c(_)):n(_,M)}return function(_,M,N,X){try{Ci=0;var se=Le(_,M,N,X);return Nr=null,se}catch(re){if(re===_r||re===Ql)throw re;var _e=Ut(29,re,null,_.mode);return _e.lanes=X,_e.return=_,_e}}}var Fa=nh(!0),ah=nh(!1),aa=!1;function Ds(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Os(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 ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ia(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Oe&2)!==0){var i=a.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),a.pending=t,t=ql(e),Lm(e,null,n),t}return Ll(e,a,t,n),ql(e)}function Ai(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,$u(e,n)}}function js(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var c={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};o===null?i=o=c:o=o.next=c,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:a.baseState,firstBaseUpdate:i,lastBaseUpdate:o,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 Vs=!1;function Mi(){if(Vs){var e=zr;if(e!==null)throw e}}function Ri(e,t,n,a){Vs=!1;var i=e.updateQueue;aa=!1;var o=i.firstBaseUpdate,c=i.lastBaseUpdate,v=i.shared.pending;if(v!==null){i.shared.pending=null;var S=v,D=S.next;S.next=null,c===null?o=D:c.next=D,c=S;var G=e.alternate;G!==null&&(G=G.updateQueue,v=G.lastBaseUpdate,v!==c&&(v===null?G.firstBaseUpdate=D:v.next=D,G.lastBaseUpdate=S))}if(o!==null){var Q=i.baseState;c=0,G=D=S=null,v=o;do{var j=v.lane&-536870913,H=j!==v.lane;if(H?(Ee&j)===j:(a&j)===j){j!==0&&j===Rr&&(Vs=!0),G!==null&&(G=G.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var ne=e,de=v;j=t;var Le=n;switch(de.tag){case 1:if(ne=de.payload,typeof ne=="function"){Q=ne.call(Le,Q,j);break e}Q=ne;break e;case 3:ne.flags=ne.flags&-65537|128;case 0:if(ne=de.payload,j=typeof ne=="function"?ne.call(Le,Q,j):ne,j==null)break e;Q=b({},Q,j);break e;case 2:aa=!0}}j=v.callback,j!==null&&(e.flags|=64,H&&(e.flags|=8192),H=i.callbacks,H===null?i.callbacks=[j]:H.push(j))}else H={lane:j,tag:v.tag,payload:v.payload,callback:v.callback,next:null},G===null?(D=G=H,S=Q):G=G.next=H,c|=j;if(v=v.next,v===null){if(v=i.shared.pending,v===null)break;H=v,v=H.next,H.next=null,i.lastBaseUpdate=H,i.shared.pending=null}}while(!0);G===null&&(S=Q),i.baseState=S,i.firstBaseUpdate=D,i.lastBaseUpdate=G,o===null&&(i.shared.lanes=0),ca|=c,e.lanes=c,e.memoizedState=Q}}function rh(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function ih(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;eo?o:8;var c=z.T,v={};z.T=v,ec(e,!1,t,n);try{var S=i(),D=z.S;if(D!==null&&D(v,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var G=b1(S,a);Ni(e,t,G,qt(e))}else Ni(e,t,a,qt(e))}catch(Q){Ni(e,t,{then:function(){},status:"rejected",reason:Q},qt())}finally{Y.p=o,c!==null&&v.types!==null&&(c.types=v.types),z.T=c}}function T1(){}function Ps(e,t,n,a){if(e.tag!==5)throw Error(s(476));var i=kh(e).queue;Uh(e,i,t,K,n===null?T1:function(){return Bh(e),n(a)})}function kh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:K},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Bh(e){var t=kh(e);t.next===null&&(t=e.alternate.memoizedState),Ni(e,t.next.queue,{},qt())}function Ws(){return ht(Zi)}function Hh(){return Ie().memoizedState}function Lh(){return Ie().memoizedState}function A1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=qt();e=ra(n);var a=ia(t,e,n);a!==null&&(Nt(a,t,n),Ai(a,t,n)),t={cache:Rs()},e.payload=t;return}t=t.return}}function M1(e,t,n){var a=qt();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},lo(e)?Fh(t,n):(n=gs(e,t,n,a),n!==null&&(Nt(n,e,a),Yh(n,t,a)))}function qh(e,t,n){var a=qt();Ni(e,t,n,a)}function Ni(e,t,n,a){var i={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(lo(e))Fh(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var c=t.lastRenderedState,v=o(c,n);if(i.hasEagerState=!0,i.eagerState=v,Vt(v,c))return Ll(e,t,i,0),qe===null&&Hl(),!1}catch{}if(n=gs(e,t,i,a),n!==null)return Nt(n,e,a),Yh(n,t,a),!0}return!1}function ec(e,t,n,a){if(a={lane:2,revertLane:Dc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},lo(e)){if(t)throw Error(s(479))}else t=gs(e,n,a,2),t!==null&&Nt(t,e,2)}function lo(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function Fh(e,t){Or=Wl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Yh(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,$u(e,n)}}var Di={readContext:ht,use:no,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};Di.useEffectEvent=Qe;var Gh={readContext:ht,use:no,useCallback:function(e,t){return St().memoizedState=[e,t===void 0?null:t],e},useContext:ht,useEffect:Mh,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ro(4194308,4,Nh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ro(4194308,4,e,t)},useInsertionEffect:function(e,t){ro(4,2,e,t)},useMemo:function(e,t){var n=St();t=t===void 0?null:t;var a=e();if(Ya){vn(!0);try{e()}finally{vn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=St();if(n!==void 0){var i=n(t);if(Ya){vn(!0);try{n(t)}finally{vn(!1)}}}else i=t;return a.memoizedState=a.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},a.queue=e,e=e.dispatch=M1.bind(null,ye,e),[a.memoizedState,e]},useRef:function(e){var t=St();return e={current:e},t.memoizedState=e},useState:function(e){e=Qs(e);var t=e.queue,n=qh.bind(null,ye,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Js,useDeferredValue:function(e,t){var n=St();return Is(n,e,t)},useTransition:function(){var e=Qs(!1);return e=Uh.bind(null,ye,e.queue,!0,!1),St().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=ye,i=St();if(Ae){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),qe===null)throw Error(s(349));(Ee&127)!==0||fh(a,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Mh(mh.bind(null,a,o,e),[e]),a.flags|=2048,Vr(9,{destroy:void 0},dh.bind(null,a,o,n,t),null),n},useId:function(){var e=St(),t=qe.identifierPrefix;if(Ae){var n=wn,a=bn;n=(a&~(1<<32-bt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=eo++,0<\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?o.multiple=!0:a.size&&(o.size=a.size);break;default:o=typeof a.is=="string"?c.createElement(i,{is:a.is}):c.createElement(i)}}o[Ve]=t,o[Ke]=a;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)o.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=o;e:switch(vt(o,i,a),i){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&kn(t)}}return Ge(t),hc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&kn(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(s(166));if(e=le.current,Ar(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,i=mt,i!==null)switch(i.tag){case 27:case 5:a=i.memoizedProps}e[Ve]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||sv(e.nodeValue,n)),e||ta(t,!0)}else e=Mo(e).createTextNode(a),e[Ve]=t,t.stateNode=e}return Ge(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Ar(t),n!==null){if(e===null){if(!a)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[Ve]=t}else Ua(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ge(t),e=!1}else n=Cs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Bt(t),t):(Bt(t),null);if((t.flags&128)!==0)throw Error(s(558))}return Ge(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Ar(t),a!==null&&a.dehydrated!==null){if(e===null){if(!i)throw Error(s(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));i[Ve]=t}else Ua(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ge(t),i=!1}else i=Cs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Bt(t),t):(Bt(t),null)}return Bt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,i=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(i=a.alternate.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==i&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),fo(t,t.updateQueue),Ge(t),null);case 4:return Te(),e===null&&Uc(t.stateNode.containerInfo),Ge(t),null;case 10:return On(t.type),Ge(t),null;case 19:if(q(Je),a=t.memoizedState,a===null)return Ge(t),null;if(i=(t.flags&128)!==0,o=a.rendering,o===null)if(i)ji(a,!1);else{if(Ze!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=Pl(e),o!==null){for(t.flags|=128,ji(a,!1),e=o.updateQueue,t.updateQueue=e,fo(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)qm(n,e),n=n.sibling;return Z(Je,Je.current&1|2),Ae&&Nn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ut()>go&&(t.flags|=128,i=!0,ji(a,!1),t.lanes=4194304)}else{if(!i)if(e=Pl(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,fo(t,e),ji(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Ae)return Ge(t),null}else 2*ut()-a.renderingStartTime>go&&n!==536870912&&(t.flags|=128,i=!0,ji(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(e=a.last,e!==null?e.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ut(),e.sibling=null,n=Je.current,Z(Je,i?n&1|2:n&1),Ae&&Nn(t,a.treeForkCount),e):(Ge(t),null);case 22:case 23:return Bt(t),ks(),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&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),n=t.updateQueue,n!==null&&fo(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&&q(Ha),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),On(We),Ge(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function D1(e,t){switch(Ss(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return On(We),Te(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return at(t),null;case 31:if(t.memoizedState!==null){if(Bt(t),t.alternate===null)throw Error(s(340));Ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Bt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(Je),null;case 4:return Te(),null;case 10:return On(t.type),null;case 22:case 23:return Bt(t),ks(),e!==null&&q(Ha),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return On(We),null;case 25:return null;default:return null}}function hp(e,t){switch(Ss(t),t.tag){case 3:On(We),Te();break;case 26:case 27:case 5:at(t);break;case 4:Te();break;case 31:t.memoizedState!==null&&Bt(t);break;case 13:Bt(t);break;case 19:q(Je);break;case 10:On(t.type);break;case 22:case 23:Bt(t),ks(),e!==null&&q(Ha);break;case 24:On(We)}}function Vi(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var i=a.next;n=i;do{if((n.tag&e)===e){a=void 0;var o=n.create,c=n.inst;a=o(),c.destroy=a}n=n.next}while(n!==i)}}catch(v){ke(t,t.return,v)}}function ua(e,t,n){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var o=i.next;a=o;do{if((a.tag&e)===e){var c=a.inst,v=c.destroy;if(v!==void 0){c.destroy=void 0,i=t;var S=n,D=v;try{D()}catch(G){ke(i,S,G)}}}a=a.next}while(a!==o)}}catch(G){ke(t,t.return,G)}}function pp(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ih(t,n)}catch(a){ke(e,e.return,a)}}}function vp(e,t,n){n.props=Ga(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){ke(e,t,a)}}function Ui(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(i){ke(e,t,i)}}function xn(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(i){ke(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){ke(e,t,i)}else n.current=null}function gp(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(i){ke(e,e.return,i)}}function pc(e,t,n){try{var a=e.stateNode;ex(a,e.type,n,t),a[Ke]=t}catch(i){ke(e,e.return,i)}}function yp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&pa(e.type)||e.tag===4}function vc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yp(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&&pa(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 gc(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=Rn));else if(a!==4&&(a===27&&pa(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(gc(e,t,n),e=e.sibling;e!==null;)gc(e,t,n),e=e.sibling}function mo(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&&pa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(mo(e,t,n),e=e.sibling;e!==null;)mo(e,t,n),e=e.sibling}function bp(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);vt(t,a,n),t[Ve]=e,t[Ke]=n}catch(o){ke(e,e.return,o)}}var Bn=!1,nt=!1,yc=!1,wp=typeof WeakSet=="function"?WeakSet:Set,ct=null;function O1(e,t){if(e=e.containerInfo,Hc=jo,e=Dm(e),fs(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 i=a.anchorOffset,o=a.focusNode;a=a.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var c=0,v=-1,S=-1,D=0,G=0,Q=e,j=null;t:for(;;){for(var H;Q!==n||i!==0&&Q.nodeType!==3||(v=c+i),Q!==o||a!==0&&Q.nodeType!==3||(S=c+a),Q.nodeType===3&&(c+=Q.nodeValue.length),(H=Q.firstChild)!==null;)j=Q,Q=H;for(;;){if(Q===e)break t;if(j===n&&++D===i&&(v=c),j===o&&++G===a&&(S=c),(H=Q.nextSibling)!==null)break;Q=j,j=Q.parentNode}Q=H}n=v===-1||S===-1?null:{start:v,end:S}}else n=null}n=n||{start:0,end:0}}else n=null;for(Lc={focusedElem:e,selectionRange:n},jo=!1,ct=t;ct!==null;)if(t=ct,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ct=e;else for(;ct!==null;){switch(t=ct,o=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"))),vt(o,a,n),o[Ve]=e,st(o),a=o;break e;case"link":var c=Av("link","href",i).get(a+(n.href||""));if(c){for(var v=0;vLe&&(c=Le,Le=de,de=c);var _=_m(v,de),M=_m(v,Le);if(_&&M&&(H.rangeCount!==1||H.anchorNode!==_.node||H.anchorOffset!==_.offset||H.focusNode!==M.node||H.focusOffset!==M.offset)){var N=Q.createRange();N.setStart(_.node,_.offset),H.removeAllRanges(),de>Le?(H.addRange(N),H.extend(M.node,M.offset)):(N.setEnd(M.node,M.offset),H.addRange(N))}}}}for(Q=[],H=v;H=H.parentNode;)H.nodeType===1&&Q.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;vn?32:n,z.T=null,n=Tc,Tc=null;var o=da,c=Yn;if(rt=0,Lr=da=null,Yn=0,(Oe&6)!==0)throw Error(s(331));var v=Oe;if(Oe|=4,Np(o.current),Rp(o,o.current,c,n),Oe=v,Fi(0,!1),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(Tt,o)}catch{}return!0}finally{Y.p=i,z.T=a,Kp(e,t)}}function Ip(e,t,n){t=It(n,t),t=rc(e.stateNode,t,2),e=ia(e,t,2),e!==null&&(yn(e,2),Sn(e))}function ke(e,t,n){if(e.tag===3)Ip(e,e,n);else for(;t!==null;){if(t.tag===3){Ip(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(fa===null||!fa.has(a))){e=It(n,e),n=Ph(2),a=ia(t,n,2),a!==null&&(Wh(n,a,t,e),yn(a,2),Sn(a));break}}t=t.return}}function zc(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new U1;var i=new Set;a.set(t,i)}else i=a.get(t),i===void 0&&(i=new Set,a.set(t,i));i.has(n)||(xc=!0,i.add(n),e=q1.bind(null,e,t,n),t.then(e,e))}function q1(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,qe===e&&(Ee&n)===n&&(Ze===4||Ze===3&&(Ee&62914560)===Ee&&300>ut()-vo?(Oe&2)===0&&qr(e,0):Sc|=n,Hr===Ee&&(Hr=0)),Sn(e)}function Pp(e,t){t===0&&(t=Tl()),e=ja(e,t),e!==null&&(yn(e,t),Sn(e))}function F1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Pp(e,n)}function Y1(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(s(314))}a!==null&&a.delete(t),Pp(e,n)}function G1(e,t){return $t(e,t)}var Eo=null,Yr=null,_c=!1,Co=!1,Nc=!1,ha=0;function Sn(e){e!==Yr&&e.next===null&&(Yr===null?Eo=Yr=e:Yr=Yr.next=e),Co=!0,_c||(_c=!0,X1())}function Fi(e,t){if(!Nc&&Co){Nc=!0;do for(var n=!1,a=Eo;a!==null;){if(e!==0){var i=a.pendingLanes;if(i===0)var o=0;else{var c=a.suspendedLanes,v=a.pingedLanes;o=(1<<31-bt(42|e)+1)-1,o&=i&~(c&~v),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(n=!0,nv(a,o))}else o=Ee,o=sr(a,a===qe?o:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(o&3)===0||gn(a,o)||(n=!0,nv(a,o));a=a.next}while(n);Nc=!1}}function $1(){Wp()}function Wp(){Co=_c=!1;var e=0;ha!==0&&nx()&&(e=ha);for(var t=ut(),n=null,a=Eo;a!==null;){var i=a.next,o=ev(a,t);o===0?(a.next=null,n===null?Eo=i:n.next=i,i===null&&(Yr=n)):(n=a,(e!==0||(o&3)!==0)&&(Co=!0)),a=i}rt!==0&&rt!==5||Fi(e),ha!==0&&(ha=0)}function ev(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes&-62914561;0v)break;var G=S.transferSize,Q=S.initiatorType;G&&cv(Q)&&(S=S.responseEnd,c+=G*(S"u"?null:document;function Sv(e,t,n){var a=Gr;if(a&&typeof t=="string"&&t){var i=Kt(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),xv.has(i)||(xv.add(i),e={rel:e,crossOrigin:n,href:t},a.querySelector(i)===null&&(t=a.createElement("link"),vt(t,"link",e),st(t),a.head.appendChild(t)))}}function fx(e){Gn.D(e),Sv("dns-prefetch",e,null)}function dx(e,t){Gn.C(e,t),Sv("preconnect",e,t)}function mx(e,t,n){Gn.L(e,t,n);var a=Gr;if(a&&e&&t){var i='link[rel="preload"][as="'+Kt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Kt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Kt(n.imageSizes)+'"]')):i+='[href="'+Kt(e)+'"]';var o=i;switch(t){case"style":o=$r(e);break;case"script":o=Xr(e)}an.has(o)||(e=b({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),an.set(o,e),a.querySelector(i)!==null||t==="style"&&a.querySelector(Xi(o))||t==="script"&&a.querySelector(Qi(o))||(t=a.createElement("link"),vt(t,"link",e),st(t),a.head.appendChild(t)))}}function hx(e,t){Gn.m(e,t);var n=Gr;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Kt(a)+'"][href="'+Kt(e)+'"]',o=i;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Xr(e)}if(!an.has(o)&&(e=b({rel:"modulepreload",href:e},t),an.set(o,e),n.querySelector(i)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Qi(o)))return}a=n.createElement("link"),vt(a,"link",e),st(a),n.head.appendChild(a)}}}function px(e,t,n){Gn.S(e,t,n);var a=Gr;if(a&&e){var i=mr(a).hoistableStyles,o=$r(e);t=t||"default";var c=i.get(o);if(!c){var v={loading:0,preload:null};if(c=a.querySelector(Xi(o)))v.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},n),(n=an.get(o))&&Qc(e,n);var S=c=a.createElement("link");st(S),vt(S,"link",e),S._p=new Promise(function(D,G){S.onload=D,S.onerror=G}),S.addEventListener("load",function(){v.loading|=1}),S.addEventListener("error",function(){v.loading|=2}),v.loading|=4,zo(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:v},i.set(o,c)}}}function vx(e,t){Gn.X(e,t);var n=Gr;if(n&&e){var a=mr(n).hoistableScripts,i=Xr(e),o=a.get(i);o||(o=n.querySelector(Qi(i)),o||(e=b({src:e,async:!0},t),(t=an.get(i))&&Zc(e,t),o=n.createElement("script"),st(o),vt(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(i,o))}}function gx(e,t){Gn.M(e,t);var n=Gr;if(n&&e){var a=mr(n).hoistableScripts,i=Xr(e),o=a.get(i);o||(o=n.querySelector(Qi(i)),o||(e=b({src:e,async:!0,type:"module"},t),(t=an.get(i))&&Zc(e,t),o=n.createElement("script"),st(o),vt(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},a.set(i,o))}}function Ev(e,t,n,a){var i=(i=le.current)?Ro(i):null;if(!i)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=$r(n.href),n=mr(i).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=$r(n.href);var o=mr(i).hoistableStyles,c=o.get(e);if(c||(i=i.ownerDocument||i,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,c),(o=i.querySelector(Xi(e)))&&!o._p&&(c.instance=o,c.state.loading=5),an.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},an.set(e,n),o||yx(i,e,n,c.state))),t&&a===null)throw Error(s(528,""));return c}if(t&&a!==null)throw Error(s(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Xr(n),n=mr(i).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(s(444,e))}}function $r(e){return'href="'+Kt(e)+'"'}function Xi(e){return'link[rel="stylesheet"]['+e+"]"}function Cv(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function yx(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}),vt(t,"link",n),st(t),e.head.appendChild(t))}function Xr(e){return'[src="'+Kt(e)+'"]'}function Qi(e){return"script[async]"+e}function Tv(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Kt(n.href)+'"]');if(a)return t.instance=a,st(a),a;var i=b({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),st(a),vt(a,"style",i),zo(a,n.precedence,e),t.instance=a;case"stylesheet":i=$r(n.href);var o=e.querySelector(Xi(i));if(o)return t.state.loading|=4,t.instance=o,st(o),o;a=Cv(n),(i=an.get(i))&&Qc(a,i),o=(e.ownerDocument||e).createElement("link"),st(o);var c=o;return c._p=new Promise(function(v,S){c.onload=v,c.onerror=S}),vt(o,"link",a),t.state.loading|=4,zo(o,n.precedence,e),t.instance=o;case"script":return o=Xr(n.src),(i=e.querySelector(Qi(o)))?(t.instance=i,st(i),i):(a=n,(i=an.get(o))&&(a=b({},n),Zc(a,i)),e=e.ownerDocument||e,i=e.createElement("script"),st(i),vt(i,"link",a),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,zo(a,n.precedence,e));return t.instance}function zo(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=a.length?a[a.length-1]:null,o=i,c=0;c title"):null)}function bx(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 Rv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function wx(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 i=$r(a.href),o=t.querySelector(Xi(i));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=No.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,st(o);return}o=t.ownerDocument||t,a=Cv(a),(i=an.get(i))&&Qc(a,i),o=o.createElement("link"),st(o);var c=o;c._p=new Promise(function(v,S){c.onload=v,c.onerror=S}),vt(o,"link",a),n.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=No.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Kc=0;function xx(e,t){return e.stylesheets&&e.count===0&&Oo(e,e.stylesheets),0Kc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(i)}}:null}function No(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Oo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Do=null;function Oo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Do=new Map,t.forEach(Sx,e),Do=null,No.call(e))}function Sx(e,t){if(!(t.state.loading&4)){var n=Do.get(e);if(n)var a=n.get(null);else{n=new Map,Do.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(l){console.error(l)}}return r(),Fo.exports=Xv(),Fo.exports}var Zv=Qv(),Xo={exports:{}},Kr={};var df;function Kv(){if(df)return Kr;df=1;var r=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function u(s,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:s,key:g,ref:d!==void 0?d:null,props:h}}return Kr.Fragment=l,Kr.jsx=u,Kr.jsxs=u,Kr}var mf;function Jv(){return mf||(mf=1,Xo.exports=Kv()),Xo.exports}var x=Jv();const hf=$n(x);var pf=sf(),Iv=Object.defineProperty,vf=(r,l)=>{for(var u in l)Iv(r,u,{get:l[u],enumerable:!0,configurable:!0,set:s=>l[u]=()=>s})};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 gf(){return["NOD","E_EN","V"].join("")}var yf=()=>["e","nv"].join(""),ln=()=>{const r=typeof window<"u"&&window.remotion_isPlayer,l=typeof window<"u"&&typeof window.process<"u"&&typeof window.process.env<"u"&&(window.process[yf()][gf()]==="test"||window.process[yf()][gf()]==="production"&&typeof window<"u"&&typeof window.remotion_puppeteerTimeout<"u"),u=typeof window<"u"&&window.remotion_isStudio,s=typeof window<"u"&&window.remotion_isReadOnlyStudio;return{isStudio:u,isRendering:l,isPlayer:r,isReadOnlyStudio:s,isClientSideRendering:!1}},Pv=ge.createElement,Wv=hf.jsx,bf=[],wf=r=>new Proxy(r,{apply(l,u,s){if(bf.includes(s[0])){const[d,h,...g]=s,y=h.stack?h:{...h??{},stack:new Error().stack};return Reflect.apply(l,u,[d,y,...g])}return Reflect.apply(l,u,s)}}),xf=()=>{ln().isStudio&&(ge.createElement=wf(Pv),hf.jsx=wf(Wv))},Qa=r=>{bf.push(r),xf()},Sf=f.createContext(!1),eg=({children:r})=>x.jsx(Sf.Provider,{value:!0,children:r}),Qo=()=>f.useContext(Sf);function Jr(r){return!!r}var Ir="4.0.427",tg=()=>{if(typeof globalThis>"u")return;const r=()=>{globalThis.remotion_imported=Ir,typeof window<"u"&&(window.remotion_imported=Ir)},l=globalThis.remotion_imported||typeof window<"u"&&window.remotion_imported;if(l){if(l===Ir)return;if(typeof l=="string"&&l.includes("webcodecs")){r();return}throw new TypeError(`🚨 Multiple versions of Remotion detected: ${[Ir,typeof l=="string"?l:"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()},Xn=({className:r,classPrefix:l,type:u})=>{if(!r)return!1;if(u==="exact"){const s=r.split(" ");return l.some(d=>s.some(h=>h.trim()===d||h.trim().endsWith(`:${d}`)||h.trim().endsWith(`!${d}`)))}return l.some(s=>r.startsWith(s)||r.includes(` ${s}`)||r.includes(`!${s}`)||r.includes(`:${s}`))},ng=(r,l)=>{const{style:u,...s}=r,d=f.useMemo(()=>({position:"absolute",top:Xn({className:s.className,classPrefix:["top-","inset-"],type:"prefix"})?void 0:0,left:Xn({className:s.className,classPrefix:["left-","inset-"],type:"prefix"})?void 0:0,right:Xn({className:s.className,classPrefix:["right-","inset-"],type:"prefix"})?void 0:0,bottom:Xn({className:s.className,classPrefix:["bottom-","inset-"],type:"prefix"})?void 0:0,width:Xn({className:s.className,classPrefix:["w-"],type:"prefix"})?void 0:"100%",height:Xn({className:s.className,classPrefix:["h-"],type:"prefix"})?void 0:"100%",display:Xn({className:s.className,classPrefix:["block","inline-block","inline","flex","inline-flex","flow-root","grid","inline-grid","contents","list-item","hidden"],type:"exact"})?void 0:"flex",flexDirection:Xn({className:s.className,classPrefix:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"],type:"exact"})?void 0:"column",...u}),[s.className,u]);return x.jsx("div",{ref:l,style:d,...s})},Zo=f.forwardRef(ng),it=f.createContext(null),Za=ge.createContext({registerSequence:()=>{throw new Error("SequenceManagerContext not initialized")},unregisterSequence:()=>{throw new Error("SequenceManagerContext not initialized")},sequences:[]}),Pr=ge.createContext({hidden:{},setHidden:()=>{throw new Error("SequenceVisibilityToggle not initialized")}}),ag=({children:r})=>{const[l,u]=f.useState([]),[s,d]=f.useState({}),h=f.useCallback(m=>{u(w=>[...w,m])},[]),g=f.useCallback(m=>{u(w=>w.filter(b=>b.id!==m))},[]),y=f.useMemo(()=>({registerSequence:h,sequences:l,unregisterSequence:g}),[h,l,g]),p=f.useMemo(()=>({hidden:s,setHidden:d}),[s]);return x.jsx(Za.Provider,{value:y,children:x.jsx(Pr.Provider,{value:p,children:r})})};function Ef(r){let l=r+1831565813;return l=Math.imul(l^l>>>15,l|1),l^=l+Math.imul(l^l>>>7,l|61),((l^l>>>14)>>>0)/4294967296}function rg(r){let l=0,u=0,s=0;for(l=0;l{if(r===null)return Math.random();if(typeof r=="string")return Ef(rg(r));if(typeof r=="number")return Ef(r*1e10);throw new Error("random() argument must be a number or a string")},Ko={};vf(Ko,{useTimelineSetFrame:()=>jf,useTimelinePosition:()=>Qn,usePlayingState:()=>Vf,persistCurrentFrame:()=>Nf,getInitialFrameState:()=>Df,getFrameForComposition:()=>Of});var Cf=ge.createContext(null),lt=()=>{const r=f.useContext(Cf),[l]=f.useState(()=>ln());return r??l},Ka=f.createContext({compositions:[],folders:[],currentCompositionMetadata:null,canvasContent:null}),Pi=f.createContext({registerComposition:()=>{},unregisterComposition:()=>{},registerFolder:()=>{},unregisterFolder:()=>{},setCanvasContent:()=>{},updateCompositionDefaultProps:()=>{},onlyRenderComposition:null}),Jo=f.createContext({props:{},updateProps:()=>{throw new Error("Not implemented")},resetUnsaved:()=>{throw new Error("Not implemented")}}),Tf=ge.createRef(),ig=ge.createRef(),Af=({children:r})=>{const[l,u]=ge.useState({}),s=f.useCallback(({defaultProps:g,id:y,newProps:p})=>{u(m=>({...m,[y]:typeof p=="function"?p(m[y]??g):p}))},[]),d=f.useCallback(g=>{u(y=>{if(y[g]){const p={...y};return delete p[g],p}return y})},[]);f.useImperativeHandle(Tf,()=>({getProps:()=>l,setProps:u}),[l]);const h=f.useMemo(()=>({props:l,updateProps:s,resetUnsaved:d}),[l,d,s]);return x.jsx(Jo.Provider,{value:h,children:r})},Io=()=>"remotion_inputPropsOverride"+window.location.origin,Mf=()=>{if(typeof localStorage>"u")return null;const r=localStorage.getItem(Io());return r?JSON.parse(r):null},lg=r=>{if(!(typeof localStorage>"u")){if(r===null){localStorage.removeItem(Io());return}localStorage.setItem(Io(),JSON.stringify(r))}},Po="remotion-date:",Wo="remotion-file:",og=({data:r,indent:l,staticBase:u})=>{let s=!1,d=!1,h=!1,g=!1;try{return{serializedString:JSON.stringify(r,function(p,m){const w=this[p];return w instanceof Date?(s=!0,`${Po}${w.toISOString()}`):w instanceof Map?(h=!0,m):w instanceof Set?(g=!0,m):typeof w=="string"&&u!==null&&w.startsWith(u)?(d=!0,`${Wo}${w.replace(u+"/","")}`):m},l),customDateUsed:s,customFileUsed:d,mapUsed:h,setUsed:g}}catch(y){throw new Error("Could not serialize the passed input props to JSON: "+y.message)}},Rf=r=>JSON.parse(r,(l,u)=>typeof u=="string"&&u.startsWith(Po)?new Date(u.replace(Po,"")):typeof u=="string"&&u.startsWith(Wo)?`${window.remotion_staticBase}/${u.replace(Wo,"")}`:u),ug=r=>Rf(og({data:r,indent:2,staticBase:window.remotion_staticBase}).serializedString),Sa=r=>ln().isStudio?ug(r):r,zf=!1,sg=()=>{zf||(zf=!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()"))},cg=()=>{if(typeof window>"u")return sg(),{};if(ln().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=Mf();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 l=window.remotion_inputProps;return l?Rf(l):{}};function Wi(r,l,u){if(typeof r!="number")throw new Error(`The "${l}" prop ${u} must be a number, but you passed a value of type ${typeof r}`);if(isNaN(r))throw new TypeError(`The "${l}" prop ${u} must not be NaN, but is NaN.`);if(!Number.isFinite(r))throw new TypeError(`The "${l}" prop ${u} must be finite, but is ${r}.`);if(r%1!==0)throw new TypeError(`The "${l}" prop ${u} must be an integer, but is ${r}.`);if(r<=0)throw new TypeError(`The "${l}" prop ${u} must be positive, but got ${r}.`)}function eu(r,l){const{allowFloats:u,component:s}=l;if(typeof r>"u")throw new Error(`The "durationInFrames" prop ${s} is missing.`);if(typeof r!="number")throw new Error(`The "durationInFrames" prop ${s} must be a number, but you passed a value of type ${typeof r}`);if(r<=0)throw new TypeError(`The "durationInFrames" prop ${s} must be positive, but got ${r}.`);if(!u&&r%1!==0)throw new TypeError(`The "durationInFrames" prop ${s} must be an integer, but got ${r}.`);if(!Number.isFinite(r))throw new TypeError(`The "durationInFrames" prop ${s} must be finite, but got ${r}.`)}function el(r,l,u){if(typeof r!="number")throw new Error(`"fps" must be a number, but you passed a value of type ${typeof r} ${l}`);if(!Number.isFinite(r))throw new Error(`"fps" must be a finite, but you passed ${r} ${l}`);if(isNaN(r))throw new Error(`"fps" must not be NaN, but got ${r} ${l}`);if(r<=0)throw new TypeError(`"fps" must be positive, but got ${r} ${l}`)}var tl=f.createContext(null),fg=f.createRef(),dg=r=>!!r.calculateMetadata,_f="remotion.propsUpdatedExternally",tu=r=>{const l=f.useContext(tl),{props:u}=f.useContext(Jo),{compositions:s,canvasContent:d,currentCompositionMetadata:h}=f.useContext(Ka),g=d?.type==="composition"?d.compositionId:null,y=r??g,p=s.find(b=>b.id===y),m=f.useMemo(()=>p?u[p.id]??{}:{},[u,p]),w=lt();return f.useMemo(()=>p?h?{type:"success",result:{...h,id:p.id,defaultProps:p.defaultProps??{}}}:dg(p)?!l||!l[p.id]?null:l[p.id]:(eu(p.durationInFrames,{allowFloats:!1,component:`in `}),el(p.fps,`in `),Wi(p.width,"width",`in `),Wi(p.height,"height",`in `),{type:"success",result:{width:p.width,height:p.height,fps:p.fps,id:p.id,durationInFrames:p.durationInFrames,defaultProps:p.defaultProps??{},props:{...p.defaultProps??{},...m??{},...typeof window>"u"||w.isPlayer||!window.remotion_inputProps?{}:cg()??{}},defaultCodec:null,defaultOutName:null,defaultVideoImageFormat:null,defaultPixelFormat:null,defaultProResProfile:null}}):null,[p,l,h,m,w.isPlayer])},nl=()=>{const{canvasContent:r,compositions:l,currentCompositionMetadata:u}=f.useContext(Ka),s=l.find(h=>r?.type==="composition"&&h.id===r.compositionId),d=tu(s?.id??null);return f.useMemo(()=>!d||d.type==="error"||d.type==="loading"||!s?null:{...d.result,defaultProps:s.defaultProps??{},id:s.id,...u??{},component:s.component},[u,d,s])},nu=()=>"remotion.time-all",Nf=r=>{localStorage.setItem(nu(),JSON.stringify(r))},Df=()=>{const r=localStorage.getItem(nu())??"{}";return JSON.parse(r)},Of=r=>{const l=localStorage.getItem(nu())??"{}",u=JSON.parse(l);return u[r]!==void 0?Number(u[r]):typeof window>"u"?0:window.remotion_initialFrame??0},Qn=()=>{const r=nl(),l=f.useContext(Yt),u=lt();if(!r)return typeof window>"u"?0:window.remotion_initialFrame??0;const s=l.frame[r.id]??(u.isPlayer?0:Of(r.id));return Math.min(r.durationInFrames-1,s)},jf=()=>{const{setFrame:r}=f.useContext(Ia);return r},Vf=()=>{const{playing:r,imperativePlaying:l}=f.useContext(Yt),{setPlaying:u}=f.useContext(Ia);return f.useMemo(()=>[r,u,l],[l,r,u])},Uf=r=>{const l=r.stack??"";return l.startsWith("Error:")?l:`${r.message} ${l}`},mg=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 au(r,l){let u;throw mg(l)?(u=l,u.stack||(u.stack=new Error(u.message).stack)):typeof l=="string"?u=Error(l):u=Error("Rendering was cancelled"),r&&(r.remotion_cancelledError=Uf(u)),u}function Ja(r){return au(typeof window<"u"?window:void 0,r)}var hg=["trace","verbose","info","warn","error"],kf=r=>hg.indexOf(r),al=(r,l)=>kf(r)<=kf(l),Wr=({args:r,logLevel:l,tag:u})=>{const s=[...r];return ln().isRendering&&!ln().isClientSideRendering&&s.unshift(Symbol.for(`__remotion_level_${l}`)),u&&ln().isRendering&&!ln().isClientSideRendering&&s.unshift(Symbol.for(`__remotion_tag_${u}`)),s},pg=(r,...l)=>{if(al(r.logLevel,"verbose"))return console.debug(...Wr({args:l,logLevel:"verbose",tag:r.tag}))},vg=(r,...l)=>{if(al(r.logLevel,"trace"))return console.debug(...Wr({args:l,logLevel:"trace",tag:r.tag}))},gg=(r,...l)=>{if(al(r.logLevel,"info"))return console.log(...Wr({args:l,logLevel:"info",tag:r.tag}))},yg=(r,...l)=>{if(al(r.logLevel,"warn"))return console.warn(...Wr({args:l,logLevel:"warn",tag:r.tag}))},bg=(r,...l)=>console.error(...Wr({args:l,logLevel:"error",tag:r.tag})),Ft={trace:vg,verbose:pg,info:gg,warn:yg,error:bg};typeof window<"u"&&(window.remotion_renderReady=!1,window.remotion_delayRenderTimeouts||(window.remotion_delayRenderTimeouts={}),window.remotion_delayRenderHandles=[]);var wg="The delayRender was called:",xg="Retries left: ",Sg="- Rendering the frame will be retried.",Eg="handle was cleared after",Cg=3e4,Tg=({scope:r,environment:l,label:u,options:s})=>{if(typeof u!="string"&&u!==null)throw new Error("The label parameter of delayRender() must be a string or undefined, got: "+JSON.stringify(u));const d=Math.random();r.remotion_delayRenderHandles.push(d);const h=Error().stack?.replace(/^Error/g,"")??"";if(l.isRendering){const g=(s?.timeoutInMilliseconds??r.remotion_puppeteerTimeout??Cg)-2e3,y=(s?.retries??0)-(r.remotion_attempt-1);r.remotion_delayRenderTimeouts[d]={label:u??null,startTime:Date.now(),timeout:setTimeout(()=>{const p=["A delayRender()",u?`"${u}"`:null,`was called but not cleared after ${g}ms. See https://remotion.dev/docs/timeout for help.`,y>0?xg+y:null,y>0?Sg:null,wg,h].filter(Jr).join(" ");l.isClientSideRendering?r.remotion_cancelledError=Uf(Error(p)):au(r,Error(p))},g)}}return r.remotion_renderReady=!1,d},Ag=({scope:r,handle:l,environment:u,logLevel:s})=>{if(typeof l>"u")throw new TypeError("The continueRender() method must be called with a parameter that is the return value of delayRender(). No value was passed.");if(typeof l!="number")throw new TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: "+JSON.stringify(l));r.remotion_delayRenderHandles=r.remotion_delayRenderHandles.filter(d=>{if(d===l){if(u.isRendering&&r!==void 0){if(!r.remotion_delayRenderTimeouts[l])return!1;const{label:h,startTime:g,timeout:y}=r.remotion_delayRenderTimeouts[l];clearTimeout(y);const p=[h?`"${h}"`:"A handle",Eg,`${Date.now()-g}ms`].filter(Jr).join(" ");Ft.verbose({logLevel:s,tag:"delayRender()"},p),delete r.remotion_delayRenderTimeouts[l]}return!1}return!0}),r.remotion_delayRenderHandles.length===0&&(r.remotion_renderReady=!0)},Ea=f.createContext({logLevel:"info",mountTime:0}),Zn=()=>{const{logLevel:r}=f.useContext(Ea);if(r===null)throw new Error("useLogLevel must be used within a LogLevelProvider");return r},ei=()=>{const{mountTime:r}=f.useContext(Ea);if(r===null)throw new Error("useMountTime must be used within a LogLevelProvider");return r},Bf=f.createContext(null),Kn=()=>{const r=lt(),l=f.useContext(Bf)??(typeof window<"u"?window:void 0),u=Zn(),s=f.useCallback((g,y)=>l?Tg({scope:l,environment:r,label:g??null,options:y??{}}):Math.random(),[r,l]),d=f.useCallback(g=>{l&&Ag({scope:l,handle:g,environment:r,logLevel:u})},[r,u,l]),h=f.useCallback(g=>au(l??(typeof window<"u"?window:void 0),g),[l]);return{delayRender:s,continueRender:d,cancelRender:h}},Ia=f.createContext({setFrame:()=>{throw new Error("default")},setPlaying:()=>{throw new Error("default")}}),Yt=f.createContext({frame:{},playing:!1,playbackRate:1,rootId:"",imperativePlaying:{current:!1},setPlaybackRate:()=>{throw new Error("default")},audioAndVideoTags:{current:[]}}),Mg=({children:r,frameState:l})=>{const[u,s]=f.useState(!1),d=f.useRef(!1),[h,g]=f.useState(1),y=f.useRef([]),[p]=f.useState(()=>String(xa(null))),[m,w]=f.useState(()=>Df()),b=l??m,{delayRender:C,continueRender:T}=Kn();typeof window<"u"&&f.useLayoutEffect(()=>{window.remotion_setFrame=(U,V,$)=>{window.remotion_attempt=$;const k=C(`Setting the current frame to ${U}`);let O=!0;w(F=>(F[V]??window.remotion_initialFrame)===U?(O=!1,F):{...F,[V]:U}),O?requestAnimationFrame(()=>T(k)):T(k)},window.remotion_isPlayer=!1},[T,C]);const R=f.useMemo(()=>({frame:b,playing:u,imperativePlaying:d,rootId:p,playbackRate:h,setPlaybackRate:g,audioAndVideoTags:y}),[b,h,u,p]),A=f.useMemo(()=>({setFrame:w,setPlaying:s}),[]);return x.jsx(Yt.Provider,{value:R,children:x.jsx(Ia.Provider,{value:A,children:r})})},ti=f.createContext({getNonce:()=>0}),ru=()=>{const r=f.useContext(ti),[l,u]=f.useState(()=>r.getNonce()),s=f.useRef(r);return f.useEffect(()=>{s.current!==r&&(s.current=r,u(r.getNonce))},[r]),l},Ca=f.createContext(!1),iu=({children:r})=>x.jsx(Ca.Provider,{value:!0,children:r}),rl=()=>{const r=f.useContext(it),l=r?.width??null,u=r?.height??null,s=r?.durationInFrames??null,d=nl();return f.useMemo(()=>{if(!d)return null;const{id:h,durationInFrames:g,fps:y,height:p,width:m,defaultProps:w,props:b,defaultCodec:C,defaultOutName:T,defaultVideoImageFormat:R,defaultPixelFormat:A,defaultProResProfile:U}=d;return{id:h,width:l??m,height:u??p,fps:y,durationInFrames:s??g,defaultProps:w,props:b,defaultCodec:C,defaultOutName:T,defaultVideoImageFormat:R,defaultPixelFormat:A,defaultProResProfile:U}},[s,u,l,d])},wt=()=>{const r=rl(),l=f.useContext(Ca),u=Qo();if(!r)throw typeof window<"u"&&window.remotion_isPlayer||u?new Error(["No video config found. Likely reasons:","- You are probably calling useVideoConfig() from outside the component passed to . See https://www.remotion.dev/docs/player/examples for how to set up the Player correctly.","- You have multiple versions of Remotion installed which causes the React context to get lost."].join("-")):new Error("No video config found. You are probably calling useVideoConfig() from a component which has not been registered as a . See https://www.remotion.dev/docs/the-fundamentals#defining-compositions for more information.");if(!l)throw new Error("Called useVideoConfig() outside a Remotion composition.");return r},xt=()=>{const r=f.useContext(Ca),l=lt();if(!r)throw l.isPlayer?new Error("useCurrentFrame can only be called inside a component that was passed to . See: https://www.remotion.dev/docs/player/examples"):new Error("useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions");const u=Qn(),s=f.useContext(it),d=s?s.cumulatedFrom+s.relativeFrom:0;return u-d},Rg=({frame:r,children:l,active:u=!0})=>{const s=xt(),d=wt();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 u=="boolean")return u;if(typeof u=="function")return u(s)},[u,s]),g=f.useContext(Yt),y=f.useContext(it),p=y?.relativeFrom??0,m=f.useMemo(()=>h?{...g,playing:!1,imperativePlaying:{current:!1},frame:{[d.id]:r+p}}:g,[h,g,d.id,r,p]),w=f.useMemo(()=>y?h?{...y,cumulatedFrom:0}:y:null,[y,h]);return x.jsx(Yt.Provider,{value:m,children:x.jsx(it.Provider,{value:w,children:l})})},zg=({from:r=0,durationInFrames:l=1/0,children:u,name:s,height:d,width:h,showInTimeline:g=!0,_remotionInternalLoopDisplay:y,_remotionInternalStack:p,_remotionInternalPremountDisplay:m,_remotionInternalPostmountDisplay:w,...b},C)=>{const{layout:T="absolute-fill"}=b,[R]=f.useState(()=>String(Math.random())),A=f.useContext(it),{rootId:U}=f.useContext(Yt),V=A?A.cumulatedFrom+A.relativeFrom:0,$=ru();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 l!="number")throw new TypeError(`You passed to durationInFrames an argument of type ${typeof l}, but it must be a number.`);if(l<=0)throw new TypeError(`durationInFrames must be positive, but got ${l}`);if(typeof 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=Qn(),O=wt(),F=A?Math.min(A.durationInFrames-r,l):l,B=Math.max(0,Math.min(O.durationInFrames-r,F)),{registerSequence:L,unregisterSequence:J}=f.useContext(Za),{hidden:P}=f.useContext(Pr),ee=f.useMemo(()=>A?.premounting||!!b._remotionInternalIsPremounting,[b._remotionInternalIsPremounting,A?.premounting]),oe=f.useMemo(()=>A?.postmounting||!!b._remotionInternalIsPostmounting,[b._remotionInternalIsPostmounting,A?.postmounting]),ie=f.useMemo(()=>({cumulatedFrom:V,relativeFrom:r,durationInFrames:B,parentFrom:A?.relativeFrom??0,id:R,height:d??A?.height??null,width:h??A?.width??null,premounting:ee,postmounting:oe,premountDisplay:m??null,postmountDisplay:w??null}),[V,r,B,A,R,d,h,ee,oe,m,w]),fe=f.useMemo(()=>s??"",[s]),pe=lt();f.useEffect(()=>{if(pe.isStudio)return L({from:r,duration:B,id:R,displayName:fe,parent:A?.id??null,type:"sequence",rootId:U,showInTimeline:g,nonce:$,loopDisplay:y,stack:p??null,premountDisplay:m??null,postmountDisplay:w??null}),()=>{J(R)}},[l,R,s,L,fe,J,A?.id,B,U,r,g,$,y,p,m,w,pe.isStudio]);const ve=Math.ceil(V+r+l-1),z=kve?null:u,Y=b.layout==="none"?void 0:b.style,K=f.useMemo(()=>({flexDirection:void 0,...h?{width:h}:{},...d?{height:d}:{},...Y??{}}),[d,Y,h]);if(C!==null&&T==="none")throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to .');return P[R]??!1?null:x.jsx(it.Provider,{value:ie,children:z===null?null:b.layout==="none"?z:x.jsx(Zo,{ref:C,style:K,className:b.className,children:z})})},_g=f.forwardRef(zg),Ng=(r,l)=>{const u=xt();if(r.layout==="none")throw new Error('`` with `premountFor` and `postmountFor` props does not support layout="none"');const{style:s,from:d=0,durationInFrames:h=1/0,premountFor:g=0,postmountFor:y=0,styleWhilePremounted:p,styleWhilePostmounted:m,...w}=r,b=Math.ceil(d+h-1),C=u=d-g,T=u>b&&u<=b+y,R=C?d:T?d+h-1:0,A=C||T,U=f.useMemo(()=>({...s,opacity:C||T?0:1,pointerEvents:C||T?"none":s?.pointerEvents??void 0,...C?p:{},...T?m:{}}),[s,C,T,p,m]);return x.jsx(Rg,{frame:R,active:A,children:x.jsx(Pa,{ref:l,from:d,durationInFrames:h,style:U,_remotionInternalPremountDisplay:g,_remotionInternalPostmountDisplay:y,_remotionInternalIsPremounting:C,_remotionInternalIsPostmounting:T,...w})})},Dg=f.forwardRef(Ng),Og=(r,l)=>{const u=lt(),{fps:s}=wt();if(r.layout!=="none"&&!u.isRendering){const d=r.premountFor;if(d||r.postmountFor)return x.jsx(Dg,{ref:l,...r,premountFor:d})}return x.jsx(_g,{...r,ref:l})},Pa=f.forwardRef(Og),jg=(r,l,u)=>{switch(r){case"fill":return[0,0,l.width,l.height,0,0,u.width,u.height];case"contain":{const s=Math.min(u.width/l.width,u.height/l.height),d=(u.width-l.width*s)/2,h=(u.height-l.height*s)/2;return[0,0,l.width,l.height,d,h,l.width*s,l.height*s]}case"cover":{const s=Math.max(u.width/l.width,u.height/l.height),d=(u.width-l.width*s)/2,h=(u.height-l.height*s)/2;return[0,0,l.width,l.height,d,h,l.width*s,l.height*s]}default:throw new Error("Unknown fit: "+r)}},Vg=({width:r,height:l,fit:u,className:s,style:d},h)=>{const g=f.useRef(null),y=f.useCallback(p=>{const m=g.current,w=r??p.displayWidth,b=l??p.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=w,m.height=b,C.drawImage(p,...jg(u,{height:p.displayHeight,width:p.displayWidth},{width:w,height:b}))},[u,l,r]);return f.useImperativeHandle(h,()=>({draw:y,getCanvas:()=>{if(!g.current)throw new Error("Canvas ref is not set");return g.current},clear:()=>{const p=g.current?.getContext("2d");if(!p)throw new Error("Could not get 2d context");p.clearRect(0,0,g.current.width,g.current.height)}}),[y]),x.jsx("canvas",{ref:g,className:s,style:d})},Ug=ge.forwardRef(Vg),kg=5,Hf=({loopBehavior:r,durationFound:l,timeInSec:u})=>r==="loop"?l?u%l:u:Math.min(u,l||1/0),Bg=async({resolvedSrc:r,signal:l,currentTime:u,initialLoopBehavior:s})=>{if(typeof ImageDecoder>"u")throw new Error("Your browser does not support the WebCodecs ImageDecoder API.");const d=await fetch(r,{signal:l}),{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 p=[];let m=null;const w=async R=>{const A=p.find(V=>V.frameIndex===R);if(A&&A.frame)return A;const U=await g.decode({frameIndex:R,completeFramesOnly:!0});return A?A.frame=U.image:p.push({frame:U.image,frameIndex:R,timeInSeconds:U.image.timestamp/1e6}),{frame:U.image,frameIndex:R,timeInSeconds:U.image.timestamp/1e6}},b=R=>{const U=p.filter(V=>V.frame).sort((V,$)=>{const k=Math.abs(V.timeInSeconds-R),O=Math.abs($.timeInSeconds-R);return k-O});for(let V=0;V{const U=Hf({durationFound:m,loopBehavior:A,timeInSec:R}),$=p.filter(O=>O.timeInSeconds<=U).map(O=>O.frameIndex).reduce((O,F)=>Math.max(O,F),0);let k=$;for(;;){const O=await w(k);if(k++,!O.frame)throw new Error("No frame found");if(!O.frame.duration||(k===y.frameCount&&m===null&&(m=(O.frame.timestamp+O.frame.duration)/1e6),O.timeInSeconds>U||k===y.frameCount))break}y.frameCount-$<3&&A==="loop"&&await w(0),b(U)};return await C({timeInSec:u,loopBehavior:s}),await C({timeInSec:u,loopBehavior:s}),{getFrame:async(R,A)=>{if(m!==null&&R>m&&A==="clear-after-finish")return null;const U=Hf({loopBehavior:A,durationFound:m,timeInSec:R});await C({timeInSec:U,loopBehavior:A});const $=p.filter(k=>k.frame).reduce((k,O)=>{const F=Math.abs(k.timeInSeconds-U),B=Math.abs(O.timeInSeconds-U);return Ftypeof window>"u"?r:new URL(r,window.origin).href;f.forwardRef(({src:r,width:l,height:u,onError:s,loopBehavior:d="loop",playbackRate:h=1,fit:g="fill",...y},p)=>{const m=f.useRef({isMounted:!0});f.useEffect(()=>{const{current:B}=m;return B.isMounted=!0,()=>{B.isMounted=!1}},[]);const w=Hg(r),[b,C]=f.useState(null),{delayRender:T,continueRender:R}=Kn(),[A]=f.useState(()=>T(`Rendering with src="${w}"`)),U=xt(),{fps:V}=wt(),$=U/h/V,k=f.useRef($);k.current=$;const O=f.useRef(null);f.useImperativeHandle(p,()=>{const B=O.current?.getCanvas();if(!B)throw new Error("Canvas ref is not set");return B},[]);const[F]=f.useState(()=>d);return f.useEffect(()=>{const B=new AbortController;return Bg({resolvedSrc:w,signal:B.signal,currentTime:k.current,initialLoopBehavior:F}).then(L=>{C(L),R(A)}).catch(L=>{if(L.name==="AbortError"){R(A);return}s?(s?.(L),R(A)):Ja(L)}),()=>{B.abort()}},[w,A,s,F,R]),f.useLayoutEffect(()=>{if(!b)return;const B=T(`Rendering frame at ${$} of `);b.getFrame($,d).then(L=>{m.current.isMounted&&(L===null?O.current?.clear():O.current?.draw(L.frame)),R(B)}).catch(L=>{s?(s(L),R(B)):Ja(L)})},[$,b,d,s,r,R,T]),x.jsx(Ug,{ref:O,width:l,height:u,fit:g,...y})});var Lg=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.')},qg=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")},Lf=r=>{r.type==="artifact"&&(Lg(r.filename),r.contentType!=="thumbnail"&&qg(r.content))},Ta=f.createContext({registerRenderAsset:()=>{},unregisterRenderAsset:()=>{},renderAssets:[]}),Fg=({children:r,collectAssets:l})=>{const[u,s]=f.useState([]),d=f.useRef([]),h=f.useCallback(p=>{Lf(p),d.current=[...d.current,p],s(d.current)},[]);l&&f.useImperativeHandle(l,()=>({collectAssets:()=>{const p=d.current;return d.current=[],s([]),p}}),[]);const g=f.useCallback(p=>{d.current=d.current.filter(m=>m.id!==p),s(d.current)},[]);f.useLayoutEffect(()=>{typeof window<"u"&&(window.remotion_collectAssets=()=>{const p=d.current;return d.current=[],s([]),p})},[]);const y=f.useMemo(()=>({registerRenderAsset:h,unregisterRenderAsset:g,renderAssets:u}),[u,h,g]);return x.jsx(Ta.Provider,{value:y,children:r})},dn=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,il=({trimAfter:r,mediaDurationInFrames:l,playbackRate:u,trimBefore:s})=>{let d=l;typeof r<"u"&&(d=r),typeof s<"u"&&(d-=s);const h=d/u;return Math.floor(h)},qf=f.createContext(null),Yg=()=>ge.useContext(qf),ll=({durationInFrames:r,times:l=1/0,children:u,name:s,...d})=>{const h=xt(),{durationInFrames:g}=wt();if(eu(r,{component:"of the component",allowFloats:!0}),typeof l!="number")throw new TypeError(`You passed to "times" an argument of type ${typeof l}, but it must be a number.`);if(l!==1/0&&l%1!==0)throw new TypeError(`The "times" prop of a loop must be an integer, but got ${l}.`);if(l<0)throw new TypeError(`The "times" prop of a loop must be at least 0, but got ${l}`);const y=Math.ceil(g/r),p=Math.min(y,l),m=d.layout==="none"?void 0:d.style,w=r*(p-1),C=Math.floor(h/r)*r,T=Math.min(C,w),R=f.useMemo(()=>({numberOfTimes:Math.min(g/r,l),startOffset:-T,durationInFrames:r}),[g,r,T,l]),A=f.useMemo(()=>({iteration:Math.floor(h/r),durationInFrames:r}),[h,r]);return x.jsx(qf.Provider,{value:A,children:x.jsx(Pa,{durationInFrames:r,from:T,name:s??"",_remotionInternalLoopDisplay:R,layout:d.layout,style:m,children:u})})};ll.useLoop=Yg;var yt=({logLevel:r,tag:l,message:u,mountTime:s})=>{const d=[s?Date.now()-s+"ms ":null,l].filter(Boolean).join(" ");Ft.trace({logLevel:r,tag:null},`[${d}]`,u)},ol=f.createContext({}),Ff={},lu=[],Yf=({children:r})=>{const[l,u]=f.useState(()=>Ff);return f.useEffect(()=>{const s=()=>{u(Ff)};return lu.push(s),()=>{lu=lu.filter(d=>d!==s)}},[]),x.jsx(ol.Provider,{value:l,children:r})},Gf=r=>{const l=r.indexOf("#");return l===-1?null:l},Gg=r=>{const l=Gf(r);return l===null?r:r.slice(0,l)},Wa=r=>{const l=f.useContext(ol),u=Gf(r),s=Gg(r);return l[s]?u!==null?l[s]+r.slice(u):l[s]:r},ul=(r,l)=>{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 <${l} /> 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 <${l} /> 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 <${l} /> 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 <${l} /> component. Playback rate must be a real number above 0.`)},$g=(r,l)=>{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 l<"u"){if(typeof l!="number")throw new TypeError(`type of endAt prop must be a number, instead got type ${typeof l}.`);if(isNaN(l))throw new TypeError("endAt prop can not be NaN.");if(l<=0)throw new TypeError(`endAt must be a positive number, instead got ${l}.`)}if(l{if(typeof 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 l<"u"){if(typeof l!="number")throw new TypeError(`type of trimAfter prop must be a number, instead got type ${typeof l}.`);if(isNaN(l))throw new TypeError("trimAfter prop can not be NaN.");if(l<=0)throw new TypeError(`trimAfter must be a positive number, instead got ${l}.`)}if(l<=r)throw new TypeError("trimAfter prop must be greater than trimBefore prop.")},sl=({startFrom:r,endAt:l,trimBefore:u,trimAfter:s})=>{if(typeof r<"u"&&typeof u<"u")throw new TypeError("Cannot use both startFrom and trimBefore props. Use trimBefore instead as startFrom is deprecated.");if(typeof l<"u"&&typeof s<"u")throw new TypeError("Cannot use both endAt and trimAfter props. Use trimAfter instead as endAt is deprecated.");typeof u<"u"||typeof s<"u"?Xg(u,s):(typeof r<"u"||typeof l<"u")&&$g(r,l)},cl=({startFrom:r,endAt:l,trimBefore:u,trimAfter:s})=>({trimBeforeValue:u??r??void 0,trimAfterValue:s??l??void 0}),Qg=(r,l)=>{if(l.type==="got-duration"){const u=dn(l.src);return r[u]===l.durationInSeconds?r:{...r,[u]:l.durationInSeconds}}else return r},ou=f.createContext({durations:{},setDurations:()=>{throw new Error("context missing")}}),$f=({children:r})=>{const[l,u]=f.useReducer(Qg,{}),s=f.useMemo(()=>({durations:l,setDurations:u}),[l]);return x.jsx(ou.Provider,{value:s,children:r})},uu=({crossOrigin:r,requestsVideoFrame:l,isClientSideRendering:u})=>{if(r!=null)return r;if(u||l)return"anonymous"},fl=({mediaRef:r,mediaType:l,onAutoPlayError:u,logLevel:s,mountTime:d,reason:h,isPlayer:g})=>{const{current:y}=r;if(!y)return;yt({logLevel:s,tag:"play",message:`Attempting to play ${y.src}. Reason: ${h}`,mountTime:d});const p=y.play();p.catch&&p.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 ${l} due to following error: `,m),!y.muted)){if(u){u();return}l==="video"&&g&&(Ft.info({logLevel:s,tag:"<"+l+">"},"The video will be muted and we'll retry playing it."),Ft.info({logLevel:s,tag:"<"+l+">"},"Use onAutoPlayError() to handle this error yourself."),y.muted=!0,y.play())}})},su=({audioContext:r,ref:l})=>{let u=null,s=!1;return{attemptToConnect:()=>{if(s)throw new Error("SharedElementSourceNode has been disposed");!u&&l.current&&(u=r.createMediaElementSource(l.current))},get:()=>{if(!u)throw new Error("Audio element not connected");return u},cleanup:()=>{u&&(u.disconnect(),u=null),s=!0}}},Xf=!1,Zg=r=>{Xf||(Xf=!0,typeof window<"u"&&Ft.warn({logLevel:r,tag:null},"AudioContext is not supported in this browser"))},Kg=({logLevel:r,latencyHint:l,audioEnabled:u})=>{const s=lt();return f.useMemo(()=>s.isRendering||!u?null:typeof AudioContext>"u"?(Zg(r),null):new AudioContext({latencyHint:l,sampleRate:48e3}),[r,l,s.isRendering,u])},Qf="data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",Jg=(r,l)=>{const u=Object.keys(r).sort(),s=Object.keys(l).sort();if(u.length!==s.length)return!1;for(let d=0;dr==="src"&&!u.startsWith("data:")&&!l.startsWith("data:")?new URL(u,window.origin).toString()!==new URL(l,window.origin).toString():u!==l,er=f.createContext(null),Zf=({children:r,numberOfAudioTags:l,audioLatencyHint:u,audioEnabled:s})=>{const d=f.useRef([]),[h]=f.useState(l);if(l!==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=Zn(),y=Kg({logLevel:g,latencyHint:u,audioEnabled:s}),p=f.useMemo(()=>new Array(l).fill(!0).map(()=>{const k=f.createRef();return{id:Math.random(),ref:k,mediaElementSourceNode:y?su({audioContext:y,ref:k}):null}}),[y,l]);(ge.useInsertionEffect??ge.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{p.forEach(({mediaElementSourceNode:k})=>{k?.cleanup()})})},[p]);const w=f.useRef(new Array(l).fill(!1)),b=f.useCallback(()=>{p.forEach(({ref:k,id:O})=>{const F=d.current?.find(L=>L.id===O),{current:B}=k;if(B){if(F===void 0){B.src=Qf;return}if(!F)throw new TypeError("Expected audio data to be there");Object.keys(F.props).forEach(L=>{Ig(L,F.props[L],B[L])&&(B[L]=F.props[L])})}})},[p]),C=f.useCallback(k=>{const{aud:O,audioId:F,premounting:B,postmounting:L}=k,J=d.current?.find(ve=>ve.audioId===F);if(J)return J;const P=w.current.findIndex(ve=>ve===!1);if(P===-1)throw new Error(`Tried to simultaneously mount ${l+1} tags at the same time. With the current settings, the maximum amount of tags is limited to ${l} at the same time. Remotion pre-mounts silent audio tags to help avoid browser autoplay restrictions. See https://remotion.dev/docs/player/autoplay#using-the-numberofsharedaudiotags-prop for more information on how to increase this limit.`);const{id:ee,ref:oe,mediaElementSourceNode:ie}=p[P],fe=[...w.current];fe[P]=ee,w.current=fe;const pe={props:O,id:ee,el:oe,audioId:F,mediaElementSourceNode:ie,premounting:B,audioMounted:!!oe.current,postmounting:L,cleanupOnMediaTagUnmount:()=>{}};return d.current?.push(pe),b(),pe},[l,p,b]),T=f.useCallback(k=>{const O=[...w.current],F=p.findIndex(B=>B.id===k);if(F===-1)throw new TypeError("Error occured in ");O[F]=!1,w.current=O,d.current=d.current?.filter(B=>B.id!==k),b()},[p,b]),R=f.useCallback(({aud:k,audioId:O,id:F,premounting:B,postmounting:L})=>{let J=!1;d.current=d.current?.map(P=>{const ee=!!P.el.current;return P.audioMounted!==ee&&(J=!0),P.id===F?Jg(k,P.props)&&P.premounting===B&&P.postmounting===L?P:(J=!0,{...P,props:k,premounting:B,postmounting:L,audioId:O,audioMounted:ee}):P}),J&&b()},[b]),A=ei(),U=lt(),V=f.useCallback(()=>{p.forEach(k=>{d.current.find(F=>F.el===k.ref)?.premounting||fl({mediaRef:k.ref,mediaType:"audio",onAutoPlayError:null,logLevel:g,mountTime:A,reason:"playing all audios",isPlayer:U.isPlayer})}),y?.resume()},[y,g,A,p,U.isPlayer]),$=f.useMemo(()=>({registerAudio:C,unregisterAudio:T,updateAudio:R,playAllAudios:V,numberOfAudioTags:l,audioContext:y}),[l,V,C,T,R,y]);return x.jsxs(er.Provider,{value:$,children:[p.map(({id:k,ref:O})=>x.jsx("audio",{ref:O,preload:"metadata",src:Qf},k)),r]})},Pg=({aud:r,audioId:l,premounting:u,postmounting:s})=>{const d=f.useContext(er),[h]=f.useState(()=>{if(d&&d.numberOfAudioTags>0)return d.registerAudio({aud:r,audioId:l,premounting:u,postmounting:s});const y=ge.createRef(),p=d?.audioContext?su({audioContext:d.audioContext,ref:y}):null;return{el:y,id:Math.random(),props:r,audioId:l,mediaElementSourceNode:p,premounting:u,audioMounted:!!y.current,postmounting:s,cleanupOnMediaTagUnmount:()=>{p?.cleanup()}}}),g=ge.useInsertionEffect??ge.useLayoutEffect;return typeof document<"u"&&(g(()=>{d&&d.numberOfAudioTags>0&&d.updateAudio({id:h.id,aud:r,audioId:l,premounting:u,postmounting:s})},[r,d,h.id,l,u,s]),g(()=>()=>{d&&d.numberOfAudioTags>0&&d.unregisterAudio(h.id)},[d,h.id])),h},Wg=1e-5,dl=(r,l)=>Math.abs(r-l)Math.round(r/l*100)/100,cu=()=>typeof window>"u"||!/AppleWebKit/.test(window.navigator.userAgent)?!1:!window.navigator.userAgent.includes("Chrome/"),ml=()=>typeof window>"u"?!1:/iP(ad|od|hone)/i.test(window.navigator.userAgent)&&cu(),ey=r=>ml()&&r.startsWith("blob:"),fu=({actualFrom:r,fps:l})=>Kf(Math.max(0,-r),l),du=({duration:r,fps:l})=>Kf(r,l),ty=({actualSrc:r,actualFrom:l,duration:u,fps:s})=>{if(ey(r)||r.startsWith("data:")||!!new URL(r,(typeof window>"u"?null:window.location.href)??"http://localhost:3000").hash||!Number.isFinite(l))return r;const h=`${r}#t=${fu({actualFrom:l,fps:s})}`;return Number.isFinite(u)?`${h},${du({duration:u,fps:s})}`:h},ny=({prevStartFrom:r,newStartFrom:l,prevDuration:u,newDuration:s,fps:d})=>{const h=fu({actualFrom:r,fps:d}),g=fu({actualFrom:l,fps:d}),y=du({duration:u,fps:d}),p=du({duration:s,fps:d});return!(gy)},ay=({actualSrc:r,actualFrom:l,duration:u,fps:s})=>{const d=f.useRef(l),h=f.useRef(u),g=f.useRef(r);return(!ny({prevStartFrom:d.current,newStartFrom:l,prevDuration:h.current,newDuration:u,fps:s})||r!==g.current)&&(d.current=l,h.current=u,g.current=r),ty({actualSrc:g.current,actualFrom:d.current,duration:h.current,fps:s})},Jf=!1,ry=r=>{Jf||(Jf=!0,Ft.warn({logLevel:r,tag:null},"In Safari, setting a volume and a playback rate at the same time is buggy."),Ft.warn({logLevel:r,tag:null},"In Desktop Safari, only volumes <= 1 will be applied."),Ft.warn({logLevel:r,tag:null},r,"In Mobile Safari, the volume will be ignored and set to 1 if a playbackRate is set."))},If=({mediaRef:r,volume:l,logLevel:u,source:s,shouldUseWebAudioApi:d})=>{const h=f.useRef(null),g=f.useRef(l);g.current=l;const y=f.useContext(er);if(!y)throw new Error("useAmplification must be used within a SharedAudioContext");const{audioContext:p}=y;if(typeof window<"u"&&f.useLayoutEffect(()=>{if(!p||!r.current||!d)return;if(r.current.playbackRate!==1&&cu()){ry(u);return}if(!s)return;const b=new GainNode(p,{gain:g.current});return s.attemptToConnect(),s.get().connect(b),b.connect(p.destination),h.current={gainNode:b},Ft.trace({logLevel:u,tag:null},`Starting to amplify ${r.current?.src}. Gain = ${g.current}, playbackRate = ${r.current?.playbackRate}`),()=>{h.current=null,b.disconnect(),s.get().disconnect()}},[u,r,p,s,d]),h.current){const b=l;dl(h.current.gainNode.gain.value,b)||(h.current.gainNode.gain.value=b,Ft.trace({logLevel:u,tag:null},`Setting gain to ${b} for ${r.current?.src}`))}return(cu()&&r.current&&r.current?.playbackRate!==1||!d)&&r.current&&!dl(l,r.current?.volume)&&(r.current.volume=Math.min(l,1)),h},Aa=()=>{const r=f.useContext(it);return Math.min(0,r?.relativeFrom??0)},tr=r=>{const l=ll.useLoop(),u=xt(),s=Aa();return r==="repeat"||l===null?u+s:u+s+l.durationInFrames*l.iteration},iy=r=>{if(/data:|blob:/.test(r.substring(0,5)))return"Data URL";const l=r.split("/").map(u=>u.split("\\")).flat(1);return l[l.length-1]},Ma=({frame:r,volume:l,mediaVolume:u=1})=>{if(typeof l=="number")return l*u;if(typeof l>"u")return Number(u);const s=l(r)*u;if(typeof s!="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 s} for frame ${r}`);if(Number.isNaN(s))throw new TypeError(`You passed in a function to the volume prop but it returned NaN for frame ${r}.`);if(!Number.isFinite(s))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,s)},Pf={},ly=r=>{Pf[r]||(console.warn(r),Pf[r]=!0)},Wf=({volume:r,mediaVolume:l,mediaType:u,src:s,displayName:d,trimBefore:h,trimAfter:g,playbackRate:y})=>{if(!s)throw new Error("No src passed");const p=Aa(),m=f.useContext(it),w=wt(),[b]=f.useState(()=>r),C=il({mediaDurationInFrames:w.durationInFrames,playbackRate:y,trimBefore:h,trimAfter:g}),T=m?Math.min(m.durationInFrames,C):C,R=f.useMemo(()=>typeof r=="number"?r:new Array(Math.floor(Math.max(0,T+p))).fill(!0).map((k,O)=>Ma({frame:O+p,volume:r,mediaVolume:l})).join(","),[T,p,r,l]);f.useEffect(()=>{typeof r=="number"&&r!==b&&ly(`Remotion: The ${u} with src ${s} 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,u,s,r]);const A=typeof r=="function",U=ru(),{rootId:V}=f.useContext(Yt),$=lt();return{volumes:R,duration:T,doesVolumeChange:A,nonce:U,rootId:V,isStudio:$.isStudio,finalDisplayName:d??iy(s)}},mu=({volume:r,mediaVolume:l,src:u,mediaType:s,playbackRate:d,displayName:h,id:g,stack:y,showInTimeline:p,premountDisplay:m,postmountDisplay:w,loopDisplay:b})=>{const C=f.useContext(it),T=Aa(),{registerSequence:R,unregisterSequence:A}=f.useContext(Za),{volumes:U,duration:V,doesVolumeChange:$,nonce:k,rootId:O,isStudio:F,finalDisplayName:B}=Wf({volume:r,mediaVolume:l,mediaType:s,src:u,displayName:h,trimAfter:void 0,trimBefore:void 0,playbackRate:d});f.useEffect(()=>{if(!u)throw new Error("No src passed");if(!(!F&&window.process?.env?.NODE_ENV!=="test")&&p)return R({type:s,src:u,id:g,duration:V,from:0,parent:C?.id??null,displayName:B,rootId:O,volume:U,showInTimeline:!0,nonce:k,startMediaFrom:0-T,doesVolumeChange:$,loopDisplay:b,playbackRate:d,stack:y,premountDisplay:m,postmountDisplay:w}),()=>{A(g)}},[V,g,C,u,R,A,U,$,k,s,T,d,y,p,m,w,F,b,O,B])},oy=(r,l)=>{const[u,s]=f.useState([]),[d,h]=f.useState([]),[g,y]=f.useState([]),m=lt().isRendering,w=f.useRef(!1),b=f.useCallback(R=>m?{unblock:()=>{}}:(s(A=>[...A,R]),{unblock:()=>{s(A=>{const U=A.filter(V=>V!==R);return U.length===A.length?A:U})}}),[m]),C=f.useCallback(R=>(h(A=>[...A,R]),{remove:()=>{h(A=>A.filter(U=>U!==R))}}),[]),T=f.useCallback(R=>(y(A=>[...A,R]),{remove:()=>{y(A=>A.filter(U=>U!==R))}}),[]);return f.useEffect(()=>{m||u.length>0&&(d.forEach(R=>R()),yt({logLevel:r,message:"Player is entering buffer state",mountTime:l,tag:"player"}))},[u]),typeof window<"u"&&f.useLayoutEffect(()=>{m||u.length===0&&(g.forEach(R=>R()),yt({logLevel:r,message:"Player is exiting buffer state",mountTime:l,tag:"player"}))},[u]),f.useMemo(()=>({addBlock:b,listenForBuffering:C,listenForResume:T,buffering:w}),[b,w,C,T])},nr=ge.createContext(null),ed=({children:r})=>{const{logLevel:l,mountTime:u}=f.useContext(Ea),s=oy(l??"info",u);return x.jsx(nr.Provider,{value:s,children:r})},td=r=>{const[l,u]=f.useState(r.buffering.current);return f.useEffect(()=>{const s=()=>{u(!0)},d=()=>{u(!1)};return r.listenForBuffering(s),r.listenForResume(d),()=>{r.listenForBuffering(()=>{}),r.listenForResume(()=>{})}},[r]),l},hu=()=>{const r=f.useContext(nr),l=r?r.addBlock:null;return f.useMemo(()=>({delayPlayback:()=>{if(!l)throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a . Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");const{unblock:u}=l({id:String(Math.random())});return{unblock:u}}}),[l])},uy=()=>/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent),sy=({mediaRef:r,mediaType:l,onVariableFpsVideoDetected:u,pauseWhenBuffering:s,logLevel:d,mountTime:h})=>{const g=f.useRef(!1),{delayPlayback:y}=hu(),p=f.useCallback(m=>{if(l!=="video"||!s)return;const w=r.current;if(!w)return;if(w.readyState>=w.HAVE_FUTURE_DATA&&!uy()){yt({logLevel:d,message:`Not using buffer until first frame, because readyState is ${w.readyState} and is not Safari or Desktop Chrome`,mountTime:h,tag:"buffer"});return}if(!w.requestVideoFrameCallback){yt({logLevel:d,message:"Not using buffer until first frame, because requestVideoFrameCallback is not supported",mountTime:h,tag:"buffer"});return}g.current=!0,yt({logLevel:d,message:`Buffering ${r.current?.src} until the first frame is received`,mountTime:h,tag:"buffer"});const b=y(),C=()=>{b.unblock(),w.removeEventListener("ended",C,{once:!0}),w.removeEventListener("pause",C,{once:!0}),g.current=!1},T=()=>{C()};w.requestVideoFrameCallback((R,A)=>{Math.abs(A.mediaTime-m)>.5&&u(),C()}),w.addEventListener("ended",T,{once:!0}),w.addEventListener("pause",T,{once:!0}),w.addEventListener("canplay",T,{once:!0})},[y,d,r,l,h,u,s]);return f.useMemo(()=>({isBuffering:()=>g.current,bufferUntilFirstFrame:p}),[p])},cy=r=>{const l=ge.useRef({time:r.current?.currentTime??0,lastUpdate:performance.now()}),u=r.current?.currentTime??null;return u!==null&&l.current.time!==u&&(l.current.time=u,l.current.lastUpdate=performance.now()),l},hl=({mediaRef:r,time:l,logLevel:u,why:s,mountTime:d})=>{const h=ml()?Number(l.toFixed(1)):l;return yt({logLevel:u,tag:"seek",message:`Seeking from ${r.currentTime} to ${h}. src= ${r.src} Reason: ${s}`,mountTime:d}),r.currentTime=h,h},fy=({element:r,shouldBuffer:l,isPremounting:u,isPostmounting:s,logLevel:d,mountTime:h,src:g})=>{const y=hu(),[p,m]=f.useState(!1);return f.useEffect(()=>{let w=[];const{current:b}=r;if(!b||!l)return;if(u||s){if((u||s)&&b.readyState{let U=!1;w.forEach(V=>{V(A),U=!0}),w=[],m(V=>(V&&(U=!0),!1)),U&&yt({logLevel:d,message:`Unmarking as buffering: ${b.src}. Reason: ${A}`,tag:"buffer",mountTime:h})},T=A=>{m(!0),yt({logLevel:d,message:`Marking as buffering: ${b.src}. Reason: ${A}`,tag:"buffer",mountTime:h});const{unblock:U}=y.delayPlayback(),V=()=>{C('"canplay" was fired'),R()},$=()=>{C('"error" event was occurred'),R()};b.addEventListener("canplay",V,{once:!0}),w.push(()=>{b.removeEventListener("canplay",V)}),b.addEventListener("error",$,{once:!0}),w.push(()=>{b.removeEventListener("error",$)}),w.push(k=>{yt({logLevel:d,message:`Unblocking ${b.src} from buffer. Reason: ${k}`,tag:"buffer",mountTime:h}),U()})},R=()=>{if(b.readyState{T('"waiting" event was fired')};b.addEventListener("waiting",A),w.push(()=>{b.removeEventListener("waiting",A)})}};return R(),()=>{C("element was unmounted or prop changed")}},[y,g,r,u,s,d,l,h]),p},dy=({mediaRef:r,mediaType:l,lastSeek:u,onVariableFpsVideoDetected:s})=>{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(l!=="video"){d.current=null;return}const g=h;if(!g.requestVideoFrameCallback)return;let y=()=>{};const p=()=>{if(!g)return;const m=g.requestVideoFrameCallback((w,b)=>{if(d.current!==null){const C=Math.abs(d.current.time-b.mediaTime),T=Math.abs(u.current===null?1/0:b.mediaTime-u.current);C>.5&&T>.5&&b.mediaTime>d.current.time&&s()}d.current={time:b.mediaTime,lastUpdate:performance.now()},p()});y=()=>{g.cancelVideoFrameCallback(m),y=()=>{}}};return p(),()=>{y()}},[u,r,l,s]),d};function my(r,l,u,s){const{extrapolateLeft:d,extrapolateRight:h,easing:g}=s;let y=r;const[p,m]=l,[w,b]=u;if(ym){if(h==="identity")return y;if(h==="clamp")y=m;else if(h==="wrap"){const C=m-p;y=((y-p)%C+C)%C+p}}return w===b?w:(y=(y-p)/(m-p),y=g(y),y=y*(b-w)+w,y)}function hy(r,l){let u;for(u=1;u=r);++u);return u-1}function py(r){for(let l=1;lr[l-1]))throw new Error(`inputRange must be strictly monotonically increasing but got [${r.join(",")}]`)}function nd(r,l){if(l.length<2)throw new Error(r+" must have at least 2 elements");for(const u of l){if(typeof u!="number")throw new Error(`${r} must contain only numbers`);if(!Number.isFinite(u))throw new Error(`${r} must contain only finite numbers, but got [${l.join(",")}]`)}}function Fe(r,l,u,s){if(typeof r>"u")throw new Error("input can not be undefined");if(typeof l>"u")throw new Error("inputRange can not be undefined");if(typeof u>"u")throw new Error("outputRange can not be undefined");if(l.length!==u.length)throw new Error("inputRange ("+l.length+") and outputRange ("+u.length+") must have the same length");nd("inputRange",l),nd("outputRange",u),py(l);const d=s?.easing??(p=>p);let h="extend";s?.extrapolateLeft!==void 0&&(h=s.extrapolateLeft);let g="extend";if(s?.extrapolateRight!==void 0&&(g=s.extrapolateRight),typeof r!="number")throw new TypeError("Cannot interpolate an input which is not a number");const y=hy(r,l);return my(r,[l[y],l[y+1]],[u[y],u[y+1]],{easing:d,extrapolateLeft:h,extrapolateRight:g})}var ad=({frame:r,playbackRate:l,startFrom:u})=>Fe(r,[-1,u,u+1],[-1,u,u+l]),rd=({fps:r,frame:l,playbackRate:u,startFrom:s})=>{const d=ad({frame:l,playbackRate:u,startFrom:s}),h=1e3/r;return d*h/1e3},id={},vy=(r,l)=>{if(r===null||r.seekable.length===0||r.seekable.length>1||id[r.src])return;const u={start:r.seekable.start(0),end:r.seekable.end(0)};if(u.start===0&&u.end===0){const s=[`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(l==="console-error")console.error(s);else if(l==="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(s);id[r.src]=!0}},ld=({mediaRef:r,src:l,mediaType:u,playbackRate:s,onlyWarnForMediaSeekingError:d,acceptableTimeshift:h,pauseWhenBuffering:g,isPremounting:y,isPostmounting:p,onAutoPlayError:m})=>{const{playbackRate:w}=f.useContext(Yt),b=xt(),C=Qn(),[T]=Vf(),R=f.useContext(nr),{fps:A}=wt(),U=Aa(),V=f.useRef(null),$=f.useRef(null),k=Zn(),O=ei();if(!R)throw new Error("useMediaPlayback must be used inside a ");const F=f.useRef({}),B=f.useCallback(()=>{l&&(F.current[l]||(Ft.verbose({logLevel:k,tag:null},`Detected ${l} as a variable FPS video. Disabling buffering while seeking.`),F.current[l]=!0))},[k,l]),L=dy({mediaRef:r,mediaType:u,lastSeek:$,onVariableFpsVideoDetected:B}),J=cy(r),P=rd({frame:b,playbackRate:s,startFrom:-U,fps:A}),ee=fy({element:r,shouldBuffer:g,isPremounting:y,isPostmounting:p,logLevel:k,mountTime:O,src:l??null}),{bufferUntilFirstFrame:oe,isBuffering:ie}=sy({mediaRef:r,mediaType:u,onVariableFpsVideoDetected:B,pauseWhenBuffering:g,logLevel:k,mountTime:O}),fe=s*w,pe=r.current?.duration?Math.min(r.current.duration,h??.65):h??.65,ve=td(R);f.useEffect(()=>{if(r.current?.paused)return;if(!T){yt({logLevel:k,tag:"pause",message:`Pausing ${r.current?.src} because ${y?"media is premounting":p?"media is postmounting":"Player is not playing"}`,mountTime:O}),r.current?.pause();return}const Y=ee||ie();R.buffering.current&&!Y&&(yt({logLevel:k,tag:"pause",message:`Pausing ${r.current?.src} because player is buffering but media tag is not`,mountTime:O}),r.current?.pause())},[ie,ee,R,ve,y,k,r,u,O,T,p]);const z=lt();f.useLayoutEffect(()=>{const Y=Math.max(0,fe);r.current&&r.current.playbackRate!==Y&&(r.current.playbackRate=Y)},[r,fe]),f.useEffect(()=>{const Y=u==="audio"?"":"";if(!r.current)throw new Error(`No ${u} ref found`);if(!l)throw new Error(`No 'src' attribute was passed to the ${Y} element.`);const{duration:K}=r.current,te=!Number.isNaN(K)&&Number.isFinite(K)?Math.min(K,P):P,me=J.current.time,E=L.current?.time??null,q=F.current[l],Z=Math.abs(te-me),I=E?Math.abs(te-E):null,W=L.current?.lastUpdate&&L.current.time>J.current.lastUpdate?I:Z,le=I&&!q?W:Z;if(le>pe&&V.current!==te){$.current=hl({mediaRef:r.current,time:te,logLevel:k,why:`because time shift is too big. shouldBeTime = ${te}, isTime = ${me}, requestVideoCallbackTime = ${E}, timeShift = ${le}${q?", isVariableFpsVideo = true":""}, isPremounting = ${y}, isPostmounting = ${p}, pauseWhenBuffering = ${g}`,mountTime:O}),V.current=$.current,T&&(fe>0&&oe(te),r.current.paused&&fl({mediaRef:r,mediaType:u,onAutoPlayError:m,logLevel:k,mountTime:O,reason:"player is playing but media tag is paused, and just seeked",isPlayer:z.isPlayer})),d||vy(r.current,d?"console-warning":"console-error");return}const ae=T?.15:.01,Me=Math.abs(r.current.currentTime-te)>ae,Te=ee||ie(),Xe=R.buffering.current&&!Te;if(!T||Xe){Me&&($.current=hl({mediaRef:r.current,time:te,logLevel:k,why:`not playing or something else is buffering. time offset is over seek threshold (${ae})`,mountTime:O}));return}if(!T||R.buffering.current)return;const at=r.current.paused&&!r.current.ended;if(at||C===0){const Ot=at?"media tag is paused":"absolute frame is 0";Me&&($.current=hl({mediaRef:r.current,time:te,logLevel:k,why:`is over timeshift threshold (threshold = ${ae}) and ${Ot}`,mountTime:O})),fl({mediaRef:r,mediaType:u,onAutoPlayError:m,logLevel:k,mountTime:O,reason:`player is playing and ${Ot}`,isPlayer:z.isPlayer}),!q&&fe>0&&oe(te)}},[C,pe,oe,R.buffering,L,k,P,ie,ee,r,u,d,fe,T,l,m,y,p,g,O,J,z.isPlayer])},od=({mediaRef:r,id:l,mediaType:u,onAutoPlayError:s,isPremounting:d,isPostmounting:h})=>{const{audioAndVideoTags:g,imperativePlaying:y}=f.useContext(Yt),p=Zn(),m=ei(),w=lt();f.useEffect(()=>{const b={id:l,play:C=>{if(y.current&&!(d||h))return fl({mediaRef:r,mediaType:u,onAutoPlayError:s,logLevel:p,mountTime:m,reason:C,isPlayer:w.isPlayer})}};return g.current.push(b),()=>{g.current=g.current.filter(C=>C.id!==l)}},[g,l,r,u,s,y,d,h,p,m,w.isPlayer])},pu=f.createContext({mediaMuted:!1,mediaVolume:1}),vu=f.createContext({setMediaMuted:()=>{throw new Error("default")},setMediaVolume:()=>{throw new Error("default")}}),gu=()=>{const{mediaVolume:r}=f.useContext(pu),{setMediaVolume:l}=f.useContext(vu);return f.useMemo(()=>[r,l],[r,l])},yu=()=>{const{mediaMuted:r}=f.useContext(pu),{setMediaMuted:l}=f.useContext(vu);return f.useMemo(()=>[r,l],[r,l])},ar=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.`)},gy=(r,l)=>{const[u]=f.useState(r.shouldPreMountAudioTags);if(r.shouldPreMountAudioTags!==u)throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");const s=Zn(),{volume:d,muted:h,playbackRate:g,shouldPreMountAudioTags:y,src:p,onDuration:m,acceptableTimeShiftInSeconds:w,_remotionInternalNeedsDurationCalculation:b,_remotionInternalNativeLoopPassed:C,_remotionInternalStack:T,allowAmplificationDuringRender:R,name:A,pauseWhenBuffering:U,showInTimeline:V,loopVolumeCurveBehavior:$,stack:k,crossOrigin:O,delayRenderRetries:F,delayRenderTimeoutInMilliseconds:B,toneFrequency:L,useWebAudioApi:J,onError:P,onNativeError:ee,audioStreamIndex:oe,...ie}=r,[fe]=gu(),[pe]=yu(),ve=tr($??"repeat"),{hidden:z}=f.useContext(Pr);if(!p)throw new TypeError("No 'src' was passed to .");const Y=Wa(p),K=f.useContext(it),[te]=f.useState(()=>String(Math.random())),me=z[te]??!1,E=Ma({frame:ve,volume:d,mediaVolume:fe});ar(E);const q=uu({crossOrigin:O,requestsVideoFrame:!1,isClientSideRendering:!1}),Z=f.useMemo(()=>({muted:h||pe||me||E<=0,src:Y,loop:C,crossOrigin:q,...ie}),[C,me,pe,h,ie,Y,E,q]),I=f.useMemo(()=>`audio-${xa(p??"")}-${K?.relativeFrom}-${K?.cumulatedFrom}-${K?.durationInFrames}-muted:${r.muted}-loop:${r.loop}`,[p,K?.relativeFrom,K?.cumulatedFrom,K?.durationInFrames,r.muted,r.loop]),{el:W,mediaElementSourceNode:le,cleanupOnMediaTagUnmount:ae}=Pg({aud:Z,audioId:I,premounting:!!K?.premounting,postmounting:!!K?.postmounting});mu({volume:d,mediaVolume:fe,src:p,mediaType:"audio",playbackRate:g??1,displayName:A??null,id:te,stack:T,showInTimeline:V,premountDisplay:K?.premountDisplay??null,postmountDisplay:K?.postmountDisplay??null,loopDisplay:void 0}),ld({mediaRef:W,src:p,mediaType:"audio",playbackRate:g??1,onlyWarnForMediaSeekingError:!1,acceptableTimeshift:w??null,isPremounting:!!K?.premounting,isPostmounting:!!K?.postmounting,pauseWhenBuffering:U,onAutoPlayError:null}),od({id:te,isPostmounting:!!K?.postmounting,isPremounting:!!K?.premounting,mediaRef:W,mediaType:"audio",onAutoPlayError:null}),If({logLevel:s,mediaRef:W,source:le,volume:E,shouldUseWebAudioApi:J??!1}),(ge.useInsertionEffect??ge.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{ae()})},[ae]),f.useImperativeHandle(l,()=>W.current,[W]);const Te=f.useRef(m);return Te.current=m,f.useEffect(()=>{const{current:Xe}=W;if(!Xe)return;if(Xe.duration){Te.current?.(Xe.src,Xe.duration);return}const at=()=>{Te.current?.(Xe.src,Xe.duration)};return Xe.addEventListener("loadedmetadata",at),()=>{Xe.removeEventListener("loadedmetadata",at)}},[W,p]),u?null:x.jsx("audio",{ref:W,preload:"metadata",crossOrigin:q,...Z})},ud=f.forwardRef(gy),yy=(r,l)=>{const u=f.useRef(null),{volume:s,playbackRate:d,allowAmplificationDuringRender:h,onDuration:g,toneFrequency:y,_remotionInternalNeedsDurationCalculation:p,_remotionInternalNativeLoopPassed:m,acceptableTimeShiftInSeconds:w,name:b,onNativeError:C,delayRenderRetries:T,delayRenderTimeoutInMilliseconds:R,loopVolumeCurveBehavior:A,pauseWhenBuffering:U,audioStreamIndex:V,...$}=r,k=Qn(),O=tr(A??"repeat"),F=xt(),B=f.useContext(it),{registerRenderAsset:L,unregisterRenderAsset:J}=f.useContext(Ta),{delayRender:P,continueRender:ee}=Kn(),oe=f.useMemo(()=>`audio-${xa(r.src??"")}-${B?.relativeFrom}-${B?.cumulatedFrom}-${B?.durationInFrames}`,[r.src,B?.relativeFrom,B?.cumulatedFrom,B?.durationInFrames]),ie=Ma({volume:s,frame:O,mediaVolume:1});ar(ie),f.useImperativeHandle(l,()=>u.current,[]),f.useEffect(()=>{if(!r.src)throw new Error("No src passed");if(window.remotion_audioEnabled&&!r.muted&&!(ie<=0))return L({type:"audio",src:dn(r.src),id:oe,frame:k,volume:ie,mediaFrame:F,playbackRate:r.playbackRate??1,toneFrequency:y??1,audioStartFrame:Math.max(0,-(B?.relativeFrom??0)),audioStreamIndex:V??0}),()=>J(oe)},[r.muted,r.src,L,k,oe,J,ie,O,F,d,r.playbackRate,y,B?.relativeFrom,V]);const{src:fe}=r,pe=l||p;return f.useLayoutEffect(()=>{if(window.process?.env?.NODE_ENV==="test"||!pe)return;const ve=P("Loading duration with src="+fe,{retries:T??void 0,timeoutInMilliseconds:R??void 0}),{current:z}=u,Y=()=>{z?.duration&&g(z.src,z.duration),ee(ve)};return z?.duration?(g(z.src,z.duration),ee(ve)):z?.addEventListener("loadedmetadata",Y,{once:!0}),()=>{z?.removeEventListener("loadedmetadata",Y),ee(ve)}},[fe,g,pe,T,R,ee,P]),pe?x.jsx("audio",{ref:u,...$,onError:C}):null},by=f.forwardRef(yy),wy=(r,l)=>{const u=f.useContext(er),{startFrom:s,endAt:d,trimBefore:h,trimAfter:g,name:y,stack:p,pauseWhenBuffering:m,showInTimeline:w,onError:b,...C}=r,{loop:T,...R}=r,{fps:A}=wt(),U=lt();if(U.isClientSideRendering)throw new Error(" is not supported in @remotion/web-renderer. Use