ossclip 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/editor-dist/assets/{index-BBVLCP-N.js → index-CKpBGMBB.js} +16 -16
- package/editor-dist/index.html +1 -1
- package/package.json +4 -4
- package/src/interactive/produce-argv.ts +8 -0
- package/src/interactive/produce-wizard.ts +10 -3
- package/src/produce.ts +71 -2
- package/src/program.ts +17 -0
- package/src/replay-argv.ts +15 -0
|
@@ -22,7 +22,7 @@ var Sx=Object.defineProperty;var Ex=(e,t,n)=>t in e?Sx(e,t,{enumerable:!0,config
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(C,
|
|
25
|
+
*/(function(e){function t(C,F){var P=C.length;C.push(F);e:for(;0<P;){var V=P-1>>>1,W=C[V];if(0<o(W,F))C[V]=F,C[P]=W,P=V;else break e}}function n(C){return C.length===0?null:C[0]}function r(C){if(C.length===0)return null;var F=C[0],P=C.pop();if(P!==F){C[0]=P;e:for(var V=0,W=C.length,N=W>>>1;V<N;){var A=2*(V+1)-1,B=C[A],H=A+1,z=C[H];if(0>o(B,P))H<W&&0>o(z,B)?(C[V]=z,C[H]=P,V=H):(C[V]=B,C[A]=P,V=A);else if(H<W&&0>o(z,P))C[V]=z,C[H]=P,V=H;else break e}}return F}function o(C,F){var P=C.sortIndex-F.sortIndex;return P!==0?P:C.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],f=1,p=null,m=3,h=!1,y=!1,g=!1,S=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(C){for(var F=n(u);F!==null;){if(F.callback===null)r(u);else if(F.startTime<=C)r(u),F.sortIndex=F.expirationTime,t(l,F);else break;F=n(u)}}function b(C){if(g=!1,x(C),!y)if(n(l)!==null)y=!0,D(k);else{var F=n(u);F!==null&&R(b,F.startTime-C)}}function k(C,F){y=!1,g&&(g=!1,v(T),T=-1),h=!0;var P=m;try{for(x(F),p=n(l);p!==null&&(!(p.expirationTime>F)||C&&!j());){var V=p.callback;if(typeof V=="function"){p.callback=null,m=p.priorityLevel;var W=V(p.expirationTime<=F);F=e.unstable_now(),typeof W=="function"?p.callback=W:p===n(l)&&r(l),x(F)}else r(l);p=n(l)}if(p!==null)var N=!0;else{var A=n(u);A!==null&&R(b,A.startTime-F),N=!1}return N}finally{p=null,m=P,h=!1}}var E=!1,I=null,T=-1,_=5,$=-1;function j(){return!(e.unstable_now()-$<_)}function L(){if(I!==null){var C=e.unstable_now();$=C;var F=!0;try{F=I(!0,C)}finally{F?M():(E=!1,I=null)}}else E=!1}var M;if(typeof w=="function")M=function(){w(L)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,Z=O.port2;O.port1.onmessage=L,M=function(){Z.postMessage(null)}}else M=function(){S(L,0)};function D(C){I=C,E||(E=!0,M())}function R(C,F){T=S(function(){C(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_continueExecution=function(){y||h||(y=!0,D(k))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(C){switch(m){case 1:case 2:case 3:var F=3;break;default:F=m}var P=m;m=F;try{return C()}finally{m=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,F){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var P=m;m=C;try{return F()}finally{m=P}},e.unstable_scheduleCallback=function(C,F,P){var V=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?V+P:V):P=V,C){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=P+W,C={id:f++,callback:F,priorityLevel:C,startTime:P,expirationTime:W,sortIndex:-1},P>V?(C.sortIndex=P,t(u,C),n(l)===null&&C===n(u)&&(g?(v(T),T=-1):g=!0,R(b,P-V))):(C.sortIndex=W,t(l,C),y||h||(y=!0,D(k))),C},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(C){var F=m;return function(){var P=m;m=F;try{return C.apply(this,arguments)}finally{m=P}}}})(Ig);Cg.exports=Ig;var Zx=Cg.exports;/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -34,11 +34,11 @@ var Sx=Object.defineProperty;var Ex=(e,t,n)=>t in e?Sx(e,t,{enumerable:!0,config
|
|
|
34
34
|
`+au+e}var lu=!1;function uu(e,t){if(!e||lu)return"";lu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
|
|
35
35
|
`),i=r.stack.split(`
|
|
36
36
|
`),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a]){var l=`
|
|
37
|
-
`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{lu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?yi(e):""}function Qx(e){switch(e.tag){case 5:return yi(e.type);case 16:return yi("Lazy");case 13:return yi("Suspense");case 19:return yi("SuspenseList");case 0:case 2:case 15:return e=uu(e.type,!1),e;case 11:return e=uu(e.type.render,!1),e;case 1:return e=uu(e.type,!0),e;default:return""}}function cc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case so:return"Fragment";case io:return"Portal";case ac:return"Profiler";case _d:return"StrictMode";case lc:return"Suspense";case uc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _g:return(e.displayName||"Context")+".Consumer";case Rg:return(e._context.displayName||"Context")+".Provider";case Pd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Fd:return t=e.displayName||null,t!==null?t:cc(e.type)||"Memo";case Xn:t=e._payload,e=e._init;try{return cc(e(t))}catch{}}return null}function Jx(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return cc(t);case 8:return t===_d?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function dr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Fg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function e1(e){var t=Fg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _s(e){e._valueTracker||(e._valueTracker=e1(e))}function jg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Fg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ta(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function dc(e,t){var n=t.checked;return Oe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function gp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=dr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mg(e,t){t=t.checked,t!=null&&Rd(e,"checked",t,!1)}function fc(e,t){Mg(e,t);var n=dr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?pc(e,t.type,n):t.hasOwnProperty("defaultValue")&&pc(e,t.type,dr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vp(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function pc(e,t,n){(t!=="number"||Ta(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wi=Array.isArray;function bo(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+dr(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function mc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(X(91));return Oe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function yp(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(X(92));if(wi(n)){if(1<n.length)throw Error(X(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:dr(n)}}function $g(e,t){var n=dr(t.value),r=dr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function wp(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ag(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function hc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ag(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ps,Ng=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ps=Ps||document.createElement("div"),Ps.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ps.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Li(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ki={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},t1=["Webkit","ms","Moz","O"];Object.keys(ki).forEach(function(e){t1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ki[t]=ki[e]})});function Lg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ki.hasOwnProperty(e)&&ki[e]?(""+t).trim():t+"px"}function zg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Lg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var n1=Oe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function gc(e,t){if(t){if(n1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(X(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(X(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(X(61))}if(t.style!=null&&typeof t.style!="object")throw Error(X(62))}}function vc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yc=null;function jd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wc=null,So=null,Eo=null;function xp(e){if(e=as(e)){if(typeof wc!="function")throw Error(X(280));var t=e.stateNode;t&&(t=hl(t),wc(e.stateNode,e.type,t))}}function Dg(e){So?Eo?Eo.push(e):Eo=[e]:So=e}function Og(){if(So){var e=So,t=Eo;if(Eo=So=null,xp(e),t)for(e=0;e<t.length;e++)xp(t[e])}}function Vg(e,t){return e(t)}function Bg(){}var cu=!1;function Wg(e,t,n){if(cu)return e(t,n);cu=!0;try{return Vg(e,t,n)}finally{cu=!1,(So!==null||Eo!==null)&&(Bg(),Og())}}function zi(e,t){var n=e.stateNode;if(n===null)return null;var r=hl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(X(231,t,typeof n));return n}var xc=!1;if(Nn)try{var ni={};Object.defineProperty(ni,"passive",{get:function(){xc=!0}}),window.addEventListener("test",ni,ni),window.removeEventListener("test",ni,ni)}catch{xc=!1}function r1(e,t,n,r,o,i,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(f){this.onError(f)}}var Ci=!1,Ra=null,_a=!1,bc=null,o1={onError:function(e){Ci=!0,Ra=e}};function i1(e,t,n,r,o,i,s,a,l){Ci=!1,Ra=null,r1.apply(o1,arguments)}function s1(e,t,n,r,o,i,s,a,l){if(i1.apply(this,arguments),Ci){if(Ci){var u=Ra;Ci=!1,Ra=null}else throw Error(X(198));_a||(_a=!0,bc=u)}}function Br(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Ug(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function bp(e){if(Br(e)!==e)throw Error(X(188))}function a1(e){var t=e.alternate;if(!t){if(t=Br(e),t===null)throw Error(X(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return bp(o),e;if(i===r)return bp(o),t;i=i.sibling}throw Error(X(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(X(189))}}if(n.alternate!==r)throw Error(X(190))}if(n.tag!==3)throw Error(X(188));return n.stateNode.current===n?e:t}function Hg(e){return e=a1(e),e!==null?Zg(e):null}function Zg(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Zg(e);if(t!==null)return t;e=e.sibling}return null}var Yg=Bt.unstable_scheduleCallback,Sp=Bt.unstable_cancelCallback,l1=Bt.unstable_shouldYield,u1=Bt.unstable_requestPaint,He=Bt.unstable_now,c1=Bt.unstable_getCurrentPriorityLevel,Md=Bt.unstable_ImmediatePriority,Kg=Bt.unstable_UserBlockingPriority,Pa=Bt.unstable_NormalPriority,d1=Bt.unstable_LowPriority,Xg=Bt.unstable_IdlePriority,dl=null,Sn=null;function f1(e){if(Sn&&typeof Sn.onCommitFiberRoot=="function")try{Sn.onCommitFiberRoot(dl,e,void 0,(e.current.flags&128)===128)}catch{}}var un=Math.clz32?Math.clz32:h1,p1=Math.log,m1=Math.LN2;function h1(e){return e>>>=0,e===0?32:31-(p1(e)/m1|0)|0}var Fs=64,js=4194304;function xi(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fa(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=xi(a):(i&=s,i!==0&&(r=xi(i)))}else s=n&~o,s!==0?r=xi(s):i!==0&&(r=xi(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-un(t),o=1<<n,r|=e[n],t&=~o;return r}function g1(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function v1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-un(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=g1(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Sc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Gg(){var e=Fs;return Fs<<=1,!(Fs&4194240)&&(Fs=64),e}function du(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function is(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-un(t),e[t]=n}function y1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-un(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function $d(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-un(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ke=0;function qg(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Qg,Ad,Jg,ev,tv,Ec=!1,Ms=[],nr=null,rr=null,or=null,Di=new Map,Oi=new Map,qn=[],w1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ep(e,t){switch(e){case"focusin":case"focusout":nr=null;break;case"dragenter":case"dragleave":rr=null;break;case"mouseover":case"mouseout":or=null;break;case"pointerover":case"pointerout":Di.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oi.delete(t.pointerId)}}function ri(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=as(t),t!==null&&Ad(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function x1(e,t,n,r,o){switch(t){case"focusin":return nr=ri(nr,e,t,n,r,o),!0;case"dragenter":return rr=ri(rr,e,t,n,r,o),!0;case"mouseover":return or=ri(or,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Di.set(i,ri(Di.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Oi.set(i,ri(Oi.get(i)||null,e,t,n,r,o)),!0}return!1}function nv(e){var t=Ir(e.target);if(t!==null){var n=Br(t);if(n!==null){if(t=n.tag,t===13){if(t=Ug(n),t!==null){e.blockedOn=t,tv(e.priority,function(){Jg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function pa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=kc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);yc=r,n.target.dispatchEvent(r),yc=null}else return t=as(n),t!==null&&Ad(t),e.blockedOn=n,!1;t.shift()}return!0}function kp(e,t,n){pa(e)&&n.delete(t)}function b1(){Ec=!1,nr!==null&&pa(nr)&&(nr=null),rr!==null&&pa(rr)&&(rr=null),or!==null&&pa(or)&&(or=null),Di.forEach(kp),Oi.forEach(kp)}function oi(e,t){e.blockedOn===t&&(e.blockedOn=null,Ec||(Ec=!0,Bt.unstable_scheduleCallback(Bt.unstable_NormalPriority,b1)))}function Vi(e){function t(o){return oi(o,e)}if(0<Ms.length){oi(Ms[0],e);for(var n=1;n<Ms.length;n++){var r=Ms[n];r.blockedOn===e&&(r.blockedOn=null)}}for(nr!==null&&oi(nr,e),rr!==null&&oi(rr,e),or!==null&&oi(or,e),Di.forEach(t),Oi.forEach(t),n=0;n<qn.length;n++)r=qn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<qn.length&&(n=qn[0],n.blockedOn===null);)nv(n),n.blockedOn===null&&qn.shift()}var ko=Vn.ReactCurrentBatchConfig,ja=!0;function S1(e,t,n,r){var o=ke,i=ko.transition;ko.transition=null;try{ke=1,Nd(e,t,n,r)}finally{ke=o,ko.transition=i}}function E1(e,t,n,r){var o=ke,i=ko.transition;ko.transition=null;try{ke=4,Nd(e,t,n,r)}finally{ke=o,ko.transition=i}}function Nd(e,t,n,r){if(ja){var o=kc(e,t,n,r);if(o===null)bu(e,t,r,Ma,n),Ep(e,r);else if(x1(o,e,t,n,r))r.stopPropagation();else if(Ep(e,r),t&4&&-1<w1.indexOf(e)){for(;o!==null;){var i=as(o);if(i!==null&&Qg(i),i=kc(e,t,n,r),i===null&&bu(e,t,r,Ma,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else bu(e,t,r,null,n)}}var Ma=null;function kc(e,t,n,r){if(Ma=null,e=jd(r),e=Ir(e),e!==null)if(t=Br(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ug(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ma=e,null}function rv(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(c1()){case Md:return 1;case Kg:return 4;case Pa:case d1:return 16;case Xg:return 536870912;default:return 16}default:return 16}}var er=null,Ld=null,ma=null;function ov(){if(ma)return ma;var e,t=Ld,n=t.length,r,o="value"in er?er.value:er.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return ma=o.slice(e,1<r?1-r:void 0)}function ha(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function $s(){return!0}function Cp(){return!1}function Ut(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?$s:Cp,this.isPropagationStopped=Cp,this}return Oe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=$s)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=$s)},persist:function(){},isPersistent:$s}),t}var Oo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zd=Ut(Oo),ss=Oe({},Oo,{view:0,detail:0}),k1=Ut(ss),fu,pu,ii,fl=Oe({},ss,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dd,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ii&&(ii&&e.type==="mousemove"?(fu=e.screenX-ii.screenX,pu=e.screenY-ii.screenY):pu=fu=0,ii=e),fu)},movementY:function(e){return"movementY"in e?e.movementY:pu}}),Ip=Ut(fl),C1=Oe({},fl,{dataTransfer:0}),I1=Ut(C1),T1=Oe({},ss,{relatedTarget:0}),mu=Ut(T1),R1=Oe({},Oo,{animationName:0,elapsedTime:0,pseudoElement:0}),_1=Ut(R1),P1=Oe({},Oo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),F1=Ut(P1),j1=Oe({},Oo,{data:0}),Tp=Ut(j1),M1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$1={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},A1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function N1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=A1[e])?!!t[e]:!1}function Dd(){return N1}var L1=Oe({},ss,{key:function(e){if(e.key){var t=M1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ha(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dd,charCode:function(e){return e.type==="keypress"?ha(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ha(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),z1=Ut(L1),D1=Oe({},fl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rp=Ut(D1),O1=Oe({},ss,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dd}),V1=Ut(O1),B1=Oe({},Oo,{propertyName:0,elapsedTime:0,pseudoElement:0}),W1=Ut(B1),U1=Oe({},fl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),H1=Ut(U1),Z1=[9,13,27,32],Od=Nn&&"CompositionEvent"in window,Ii=null;Nn&&"documentMode"in document&&(Ii=document.documentMode);var Y1=Nn&&"TextEvent"in window&&!Ii,iv=Nn&&(!Od||Ii&&8<Ii&&11>=Ii),_p=" ",Pp=!1;function sv(e,t){switch(e){case"keyup":return Z1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function av(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ao=!1;function K1(e,t){switch(e){case"compositionend":return av(t);case"keypress":return t.which!==32?null:(Pp=!0,_p);case"textInput":return e=t.data,e===_p&&Pp?null:e;default:return null}}function X1(e,t){if(ao)return e==="compositionend"||!Od&&sv(e,t)?(e=ov(),ma=Ld=er=null,ao=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return iv&&t.locale!=="ko"?null:t.data;default:return null}}var G1={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Fp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!G1[e.type]:t==="textarea"}function lv(e,t,n,r){Dg(r),t=$a(t,"onChange"),0<t.length&&(n=new zd("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ti=null,Bi=null;function q1(e){wv(e,0)}function pl(e){var t=co(e);if(jg(t))return e}function Q1(e,t){if(e==="change")return t}var uv=!1;if(Nn){var hu;if(Nn){var gu="oninput"in document;if(!gu){var jp=document.createElement("div");jp.setAttribute("oninput","return;"),gu=typeof jp.oninput=="function"}hu=gu}else hu=!1;uv=hu&&(!document.documentMode||9<document.documentMode)}function Mp(){Ti&&(Ti.detachEvent("onpropertychange",cv),Bi=Ti=null)}function cv(e){if(e.propertyName==="value"&&pl(Bi)){var t=[];lv(t,Bi,e,jd(e)),Wg(q1,t)}}function J1(e,t,n){e==="focusin"?(Mp(),Ti=t,Bi=n,Ti.attachEvent("onpropertychange",cv)):e==="focusout"&&Mp()}function eb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return pl(Bi)}function tb(e,t){if(e==="click")return pl(t)}function nb(e,t){if(e==="input"||e==="change")return pl(t)}function rb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dn=typeof Object.is=="function"?Object.is:rb;function Wi(e,t){if(dn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!sc.call(t,o)||!dn(e[o],t[o]))return!1}return!0}function $p(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ap(e,t){var n=$p(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$p(n)}}function dv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?dv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fv(){for(var e=window,t=Ta();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ta(e.document)}return t}function Vd(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")}function ob(e){var t=fv(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dv(n.ownerDocument.documentElement,n)){if(r!==null&&Vd(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Ap(n,i);var s=Ap(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ib=Nn&&"documentMode"in document&&11>=document.documentMode,lo=null,Cc=null,Ri=null,Ic=!1;function Np(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ic||lo==null||lo!==Ta(r)||(r=lo,"selectionStart"in r&&Vd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ri&&Wi(Ri,r)||(Ri=r,r=$a(Cc,"onSelect"),0<r.length&&(t=new zd("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=lo)))}function As(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var uo={animationend:As("Animation","AnimationEnd"),animationiteration:As("Animation","AnimationIteration"),animationstart:As("Animation","AnimationStart"),transitionend:As("Transition","TransitionEnd")},vu={},pv={};Nn&&(pv=document.createElement("div").style,"AnimationEvent"in window||(delete uo.animationend.animation,delete uo.animationiteration.animation,delete uo.animationstart.animation),"TransitionEvent"in window||delete uo.transitionend.transition);function ml(e){if(vu[e])return vu[e];if(!uo[e])return e;var t=uo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in pv)return vu[e]=t[n];return e}var mv=ml("animationend"),hv=ml("animationiteration"),gv=ml("animationstart"),vv=ml("transitionend"),yv=new Map,Lp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function gr(e,t){yv.set(e,t),Vr(t,[e])}for(var yu=0;yu<Lp.length;yu++){var wu=Lp[yu],sb=wu.toLowerCase(),ab=wu[0].toUpperCase()+wu.slice(1);gr(sb,"on"+ab)}gr(mv,"onAnimationEnd");gr(hv,"onAnimationIteration");gr(gv,"onAnimationStart");gr("dblclick","onDoubleClick");gr("focusin","onFocus");gr("focusout","onBlur");gr(vv,"onTransitionEnd");Po("onMouseEnter",["mouseout","mouseover"]);Po("onMouseLeave",["mouseout","mouseover"]);Po("onPointerEnter",["pointerout","pointerover"]);Po("onPointerLeave",["pointerout","pointerover"]);Vr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Vr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Vr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Vr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Vr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Vr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),lb=new Set("cancel close invalid load scroll toggle".split(" ").concat(bi));function zp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,s1(r,t,void 0,e),e.currentTarget=null}function wv(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;zp(o,a,u),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;zp(o,a,u),i=l}}}if(_a)throw e=bc,_a=!1,bc=null,e}function Fe(e,t){var n=t[Fc];n===void 0&&(n=t[Fc]=new Set);var r=e+"__bubble";n.has(r)||(xv(t,e,2,!1),n.add(r))}function xu(e,t,n){var r=0;t&&(r|=4),xv(n,e,r,t)}var Ns="_reactListening"+Math.random().toString(36).slice(2);function Ui(e){if(!e[Ns]){e[Ns]=!0,Tg.forEach(function(n){n!=="selectionchange"&&(lb.has(n)||xu(n,!1,e),xu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ns]||(t[Ns]=!0,xu("selectionchange",!1,t))}}function xv(e,t,n,r){switch(rv(t)){case 1:var o=S1;break;case 4:o=E1;break;default:o=Nd}n=o.bind(null,t,n,e),o=void 0,!xc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function bu(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=Ir(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}Wg(function(){var u=i,f=jd(n),p=[];e:{var m=yv.get(e);if(m!==void 0){var h=zd,w=e;switch(e){case"keypress":if(ha(n)===0)break e;case"keydown":case"keyup":h=z1;break;case"focusin":w="focus",h=mu;break;case"focusout":w="blur",h=mu;break;case"beforeblur":case"afterblur":h=mu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Ip;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=I1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=V1;break;case mv:case hv:case gv:h=_1;break;case vv:h=W1;break;case"scroll":h=k1;break;case"wheel":h=H1;break;case"copy":case"cut":case"paste":h=F1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Rp}var v=(t&4)!==0,S=!v&&e==="scroll",g=v?m!==null?m+"Capture":null:m;v=[];for(var y=u,x;y!==null;){x=y;var b=x.stateNode;if(x.tag===5&&b!==null&&(x=b,g!==null&&(b=zi(y,g),b!=null&&v.push(Hi(y,b,x)))),S)break;y=y.return}0<v.length&&(m=new h(m,w,null,n,f),p.push({event:m,listeners:v}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",m&&n!==yc&&(w=n.relatedTarget||n.fromElement)&&(Ir(w)||w[Ln]))break e;if((h||m)&&(m=f.window===f?f:(m=f.ownerDocument)?m.defaultView||m.parentWindow:window,h?(w=n.relatedTarget||n.toElement,h=u,w=w?Ir(w):null,w!==null&&(S=Br(w),w!==S||w.tag!==5&&w.tag!==6)&&(w=null)):(h=null,w=u),h!==w)){if(v=Ip,b="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(v=Rp,b="onPointerLeave",g="onPointerEnter",y="pointer"),S=h==null?m:co(h),x=w==null?m:co(w),m=new v(b,y+"leave",h,n,f),m.target=S,m.relatedTarget=x,b=null,Ir(f)===u&&(v=new v(g,y+"enter",w,n,f),v.target=x,v.relatedTarget=S,b=v),S=b,h&&w)t:{for(v=h,g=w,y=0,x=v;x;x=qr(x))y++;for(x=0,b=g;b;b=qr(b))x++;for(;0<y-x;)v=qr(v),y--;for(;0<x-y;)g=qr(g),x--;for(;y--;){if(v===g||g!==null&&v===g.alternate)break t;v=qr(v),g=qr(g)}v=null}else v=null;h!==null&&Dp(p,m,h,v,!1),w!==null&&S!==null&&Dp(p,S,w,v,!0)}}e:{if(m=u?co(u):window,h=m.nodeName&&m.nodeName.toLowerCase(),h==="select"||h==="input"&&m.type==="file")var k=Q1;else if(Fp(m))if(uv)k=nb;else{k=eb;var E=J1}else(h=m.nodeName)&&h.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(k=tb);if(k&&(k=k(e,u))){lv(p,k,n,f);break e}E&&E(e,m,u),e==="focusout"&&(E=m._wrapperState)&&E.controlled&&m.type==="number"&&pc(m,"number",m.value)}switch(E=u?co(u):window,e){case"focusin":(Fp(E)||E.contentEditable==="true")&&(lo=E,Cc=u,Ri=null);break;case"focusout":Ri=Cc=lo=null;break;case"mousedown":Ic=!0;break;case"contextmenu":case"mouseup":case"dragend":Ic=!1,Np(p,n,f);break;case"selectionchange":if(ib)break;case"keydown":case"keyup":Np(p,n,f)}var I;if(Od)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else ao?sv(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(iv&&n.locale!=="ko"&&(ao||T!=="onCompositionStart"?T==="onCompositionEnd"&&ao&&(I=ov()):(er=f,Ld="value"in er?er.value:er.textContent,ao=!0)),E=$a(u,T),0<E.length&&(T=new Tp(T,e,null,n,f),p.push({event:T,listeners:E}),I?T.data=I:(I=av(n),I!==null&&(T.data=I)))),(I=Y1?K1(e,n):X1(e,n))&&(u=$a(u,"onBeforeInput"),0<u.length&&(f=new Tp("onBeforeInput","beforeinput",null,n,f),p.push({event:f,listeners:u}),f.data=I))}wv(p,t)})}function Hi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $a(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=zi(e,n),i!=null&&r.unshift(Hi(e,i,o)),i=zi(e,t),i!=null&&r.push(Hi(e,i,o))),e=e.return}return r}function qr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Dp(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,o?(l=zi(n,i),l!=null&&s.unshift(Hi(n,l,a))):o||(l=zi(n,i),l!=null&&s.push(Hi(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var ub=/\r\n?/g,cb=/\u0000|\uFFFD/g;function Op(e){return(typeof e=="string"?e:""+e).replace(ub,`
|
|
38
|
-
`).replace(cb,"")}function Ls(e,t,n){if(t=Op(t),Op(e)!==t&&n)throw Error(X(425))}function Aa(){}var Tc=null,Rc=null;function _c(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pc=typeof setTimeout=="function"?setTimeout:void 0,db=typeof clearTimeout=="function"?clearTimeout:void 0,Vp=typeof Promise=="function"?Promise:void 0,fb=typeof queueMicrotask=="function"?queueMicrotask:typeof Vp<"u"?function(e){return Vp.resolve(null).then(e).catch(pb)}:Pc;function pb(e){setTimeout(function(){throw e})}function Su(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Vi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Vi(t)}function ir(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Bp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Vo=Math.random().toString(36).slice(2),wn="__reactFiber$"+Vo,Zi="__reactProps$"+Vo,Ln="__reactContainer$"+Vo,Fc="__reactEvents$"+Vo,mb="__reactListeners$"+Vo,hb="__reactHandles$"+Vo;function Ir(e){var t=e[wn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ln]||n[wn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Bp(e);e!==null;){if(n=e[wn])return n;e=Bp(e)}return t}e=n,n=e.parentNode}return null}function as(e){return e=e[wn]||e[Ln],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function co(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(X(33))}function hl(e){return e[Zi]||null}var jc=[],fo=-1;function vr(e){return{current:e}}function je(e){0>fo||(e.current=jc[fo],jc[fo]=null,fo--)}function _e(e,t){fo++,jc[fo]=e.current,e.current=t}var fr={},vt=vr(fr),Pt=vr(!1),Mr=fr;function Fo(e,t){var n=e.type.contextTypes;if(!n)return fr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ft(e){return e=e.childContextTypes,e!=null}function Na(){je(Pt),je(vt)}function Wp(e,t,n){if(vt.current!==fr)throw Error(X(168));_e(vt,t),_e(Pt,n)}function bv(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(X(108,Jx(e)||"Unknown",o));return Oe({},n,r)}function La(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fr,Mr=vt.current,_e(vt,e),_e(Pt,Pt.current),!0}function Up(e,t,n){var r=e.stateNode;if(!r)throw Error(X(169));n?(e=bv(e,t,Mr),r.__reactInternalMemoizedMergedChildContext=e,je(Pt),je(vt),_e(vt,e)):je(Pt),_e(Pt,n)}var Pn=null,gl=!1,Eu=!1;function Sv(e){Pn===null?Pn=[e]:Pn.push(e)}function gb(e){gl=!0,Sv(e)}function yr(){if(!Eu&&Pn!==null){Eu=!0;var e=0,t=ke;try{var n=Pn;for(ke=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Pn=null,gl=!1}catch(o){throw Pn!==null&&(Pn=Pn.slice(e+1)),Yg(Md,yr),o}finally{ke=t,Eu=!1}}return null}var po=[],mo=0,za=null,Da=0,Kt=[],Xt=0,$r=null,jn=1,Mn="";function kr(e,t){po[mo++]=Da,po[mo++]=za,za=e,Da=t}function Ev(e,t,n){Kt[Xt++]=jn,Kt[Xt++]=Mn,Kt[Xt++]=$r,$r=e;var r=jn;e=Mn;var o=32-un(r)-1;r&=~(1<<o),n+=1;var i=32-un(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,jn=1<<32-un(t)+o|n<<o|r,Mn=i+e}else jn=1<<i|n<<o|r,Mn=e}function Bd(e){e.return!==null&&(kr(e,1),Ev(e,1,0))}function Wd(e){for(;e===za;)za=po[--mo],po[mo]=null,Da=po[--mo],po[mo]=null;for(;e===$r;)$r=Kt[--Xt],Kt[Xt]=null,Mn=Kt[--Xt],Kt[Xt]=null,jn=Kt[--Xt],Kt[Xt]=null}var Vt=null,Ot=null,$e=!1,ln=null;function kv(e,t){var n=qt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Hp(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Vt=e,Ot=ir(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Vt=e,Ot=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=$r!==null?{id:jn,overflow:Mn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=qt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Vt=e,Ot=null,!0):!1;default:return!1}}function Mc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function $c(e){if($e){var t=Ot;if(t){var n=t;if(!Hp(e,t)){if(Mc(e))throw Error(X(418));t=ir(n.nextSibling);var r=Vt;t&&Hp(e,t)?kv(r,n):(e.flags=e.flags&-4097|2,$e=!1,Vt=e)}}else{if(Mc(e))throw Error(X(418));e.flags=e.flags&-4097|2,$e=!1,Vt=e}}}function Zp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Vt=e}function zs(e){if(e!==Vt)return!1;if(!$e)return Zp(e),$e=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!_c(e.type,e.memoizedProps)),t&&(t=Ot)){if(Mc(e))throw Cv(),Error(X(418));for(;t;)kv(e,t),t=ir(t.nextSibling)}if(Zp(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(X(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ot=ir(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ot=null}}else Ot=Vt?ir(e.stateNode.nextSibling):null;return!0}function Cv(){for(var e=Ot;e;)e=ir(e.nextSibling)}function jo(){Ot=Vt=null,$e=!1}function Ud(e){ln===null?ln=[e]:ln.push(e)}var vb=Vn.ReactCurrentBatchConfig;function si(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(X(309));var r=n.stateNode}if(!r)throw Error(X(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(X(284));if(!n._owner)throw Error(X(290,e))}return e}function Ds(e,t){throw e=Object.prototype.toString.call(t),Error(X(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Yp(e){var t=e._init;return t(e._payload)}function Iv(e){function t(g,y){if(e){var x=g.deletions;x===null?(g.deletions=[y],g.flags|=16):x.push(y)}}function n(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function r(g,y){for(g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function o(g,y){return g=ur(g,y),g.index=0,g.sibling=null,g}function i(g,y,x){return g.index=x,e?(x=g.alternate,x!==null?(x=x.index,x<y?(g.flags|=2,y):x):(g.flags|=2,y)):(g.flags|=1048576,y)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,y,x,b){return y===null||y.tag!==6?(y=Pu(x,g.mode,b),y.return=g,y):(y=o(y,x),y.return=g,y)}function l(g,y,x,b){var k=x.type;return k===so?f(g,y,x.props.children,b,x.key):y!==null&&(y.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Xn&&Yp(k)===y.type)?(b=o(y,x.props),b.ref=si(g,y,x),b.return=g,b):(b=Sa(x.type,x.key,x.props,null,g.mode,b),b.ref=si(g,y,x),b.return=g,b)}function u(g,y,x,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==x.containerInfo||y.stateNode.implementation!==x.implementation?(y=Fu(x,g.mode,b),y.return=g,y):(y=o(y,x.children||[]),y.return=g,y)}function f(g,y,x,b,k){return y===null||y.tag!==7?(y=jr(x,g.mode,b,k),y.return=g,y):(y=o(y,x),y.return=g,y)}function p(g,y,x){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Pu(""+y,g.mode,x),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Rs:return x=Sa(y.type,y.key,y.props,null,g.mode,x),x.ref=si(g,null,y),x.return=g,x;case io:return y=Fu(y,g.mode,x),y.return=g,y;case Xn:var b=y._init;return p(g,b(y._payload),x)}if(wi(y)||ti(y))return y=jr(y,g.mode,x,null),y.return=g,y;Ds(g,y)}return null}function m(g,y,x,b){var k=y!==null?y.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return k!==null?null:a(g,y,""+x,b);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Rs:return x.key===k?l(g,y,x,b):null;case io:return x.key===k?u(g,y,x,b):null;case Xn:return k=x._init,m(g,y,k(x._payload),b)}if(wi(x)||ti(x))return k!==null?null:f(g,y,x,b,null);Ds(g,x)}return null}function h(g,y,x,b,k){if(typeof b=="string"&&b!==""||typeof b=="number")return g=g.get(x)||null,a(y,g,""+b,k);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Rs:return g=g.get(b.key===null?x:b.key)||null,l(y,g,b,k);case io:return g=g.get(b.key===null?x:b.key)||null,u(y,g,b,k);case Xn:var E=b._init;return h(g,y,x,E(b._payload),k)}if(wi(b)||ti(b))return g=g.get(x)||null,f(y,g,b,k,null);Ds(y,b)}return null}function w(g,y,x,b){for(var k=null,E=null,I=y,T=y=0,_=null;I!==null&&T<x.length;T++){I.index>T?(_=I,I=null):_=I.sibling;var $=m(g,I,x[T],b);if($===null){I===null&&(I=_);break}e&&I&&$.alternate===null&&t(g,I),y=i($,y,T),E===null?k=$:E.sibling=$,E=$,I=_}if(T===x.length)return n(g,I),$e&&kr(g,T),k;if(I===null){for(;T<x.length;T++)I=p(g,x[T],b),I!==null&&(y=i(I,y,T),E===null?k=I:E.sibling=I,E=I);return $e&&kr(g,T),k}for(I=r(g,I);T<x.length;T++)_=h(I,g,T,x[T],b),_!==null&&(e&&_.alternate!==null&&I.delete(_.key===null?T:_.key),y=i(_,y,T),E===null?k=_:E.sibling=_,E=_);return e&&I.forEach(function(M){return t(g,M)}),$e&&kr(g,T),k}function v(g,y,x,b){var k=ti(x);if(typeof k!="function")throw Error(X(150));if(x=k.call(x),x==null)throw Error(X(151));for(var E=k=null,I=y,T=y=0,_=null,$=x.next();I!==null&&!$.done;T++,$=x.next()){I.index>T?(_=I,I=null):_=I.sibling;var M=m(g,I,$.value,b);if(M===null){I===null&&(I=_);break}e&&I&&M.alternate===null&&t(g,I),y=i(M,y,T),E===null?k=M:E.sibling=M,E=M,I=_}if($.done)return n(g,I),$e&&kr(g,T),k;if(I===null){for(;!$.done;T++,$=x.next())$=p(g,$.value,b),$!==null&&(y=i($,y,T),E===null?k=$:E.sibling=$,E=$);return $e&&kr(g,T),k}for(I=r(g,I);!$.done;T++,$=x.next())$=h(I,g,T,$.value,b),$!==null&&(e&&$.alternate!==null&&I.delete($.key===null?T:$.key),y=i($,y,T),E===null?k=$:E.sibling=$,E=$);return e&&I.forEach(function(P){return t(g,P)}),$e&&kr(g,T),k}function S(g,y,x,b){if(typeof x=="object"&&x!==null&&x.type===so&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Rs:e:{for(var k=x.key,E=y;E!==null;){if(E.key===k){if(k=x.type,k===so){if(E.tag===7){n(g,E.sibling),y=o(E,x.props.children),y.return=g,g=y;break e}}else if(E.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Xn&&Yp(k)===E.type){n(g,E.sibling),y=o(E,x.props),y.ref=si(g,E,x),y.return=g,g=y;break e}n(g,E);break}else t(g,E);E=E.sibling}x.type===so?(y=jr(x.props.children,g.mode,b,x.key),y.return=g,g=y):(b=Sa(x.type,x.key,x.props,null,g.mode,b),b.ref=si(g,y,x),b.return=g,g=b)}return s(g);case io:e:{for(E=x.key;y!==null;){if(y.key===E)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(g,y.sibling),y=o(y,x.children||[]),y.return=g,g=y;break e}else{n(g,y);break}else t(g,y);y=y.sibling}y=Fu(x,g.mode,b),y.return=g,g=y}return s(g);case Xn:return E=x._init,S(g,y,E(x._payload),b)}if(wi(x))return w(g,y,x,b);if(ti(x))return v(g,y,x,b);Ds(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(n(g,y.sibling),y=o(y,x),y.return=g,g=y):(n(g,y),y=Pu(x,g.mode,b),y.return=g,g=y),s(g)):n(g,y)}return S}var Mo=Iv(!0),Tv=Iv(!1),Oa=vr(null),Va=null,ho=null,Hd=null;function Zd(){Hd=ho=Va=null}function Yd(e){var t=Oa.current;je(Oa),e._currentValue=t}function Ac(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Co(e,t){Va=e,Hd=ho=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(_t=!0),e.firstContext=null)}function Jt(e){var t=e._currentValue;if(Hd!==e)if(e={context:e,memoizedValue:t,next:null},ho===null){if(Va===null)throw Error(X(308));ho=e,Va.dependencies={lanes:0,firstContext:e}}else ho=ho.next=e;return t}var Tr=null;function Kd(e){Tr===null?Tr=[e]:Tr.push(e)}function Rv(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Kd(t)):(n.next=o.next,o.next=n),t.interleaved=n,zn(e,r)}function zn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Gn=!1;function Xd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _v(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function An(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function sr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ge&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,zn(e,n)}return o=r.interleaved,o===null?(t.next=t,Kd(r)):(t.next=o.next,o.next=t),r.interleaved=t,zn(e,n)}function ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$d(e,n)}}function Kp(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ba(e,t,n,r){var o=e.updateQueue;Gn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==s&&(a===null?f.firstBaseUpdate=u:a.next=u,f.lastBaseUpdate=l))}if(i!==null){var p=o.baseState;s=0,f=u=l=null,a=i;do{var m=a.lane,h=a.eventTime;if((r&m)===m){f!==null&&(f=f.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var w=e,v=a;switch(m=t,h=n,v.tag){case 1:if(w=v.payload,typeof w=="function"){p=w.call(h,p,m);break e}p=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,m=typeof w=="function"?w.call(h,p,m):w,m==null)break e;p=Oe({},p,m);break e;case 2:Gn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,m=o.effects,m===null?o.effects=[a]:m.push(a))}else h={eventTime:h,lane:m,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(u=f=h,l=p):f=f.next=h,s|=m;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;m=a,a=m.next,m.next=null,o.lastBaseUpdate=m,o.shared.pending=null}}while(!0);if(f===null&&(l=p),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=f,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Nr|=s,e.lanes=s,e.memoizedState=p}}function Xp(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(X(191,o));o.call(r)}}}var ls={},En=vr(ls),Yi=vr(ls),Ki=vr(ls);function Rr(e){if(e===ls)throw Error(X(174));return e}function Gd(e,t){switch(_e(Ki,t),_e(Yi,e),_e(En,ls),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:hc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=hc(t,e)}je(En),_e(En,t)}function $o(){je(En),je(Yi),je(Ki)}function Pv(e){Rr(Ki.current);var t=Rr(En.current),n=hc(t,e.type);t!==n&&(_e(Yi,e),_e(En,n))}function qd(e){Yi.current===e&&(je(En),je(Yi))}var ze=vr(0);function Wa(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ku=[];function Qd(){for(var e=0;e<ku.length;e++)ku[e]._workInProgressVersionPrimary=null;ku.length=0}var va=Vn.ReactCurrentDispatcher,Cu=Vn.ReactCurrentBatchConfig,Ar=0,De=null,qe=null,tt=null,Ua=!1,_i=!1,Xi=0,yb=0;function ft(){throw Error(X(321))}function Jd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!dn(e[n],t[n]))return!1;return!0}function ef(e,t,n,r,o,i){if(Ar=i,De=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,va.current=e===null||e.memoizedState===null?Sb:Eb,e=n(r,o),_i){i=0;do{if(_i=!1,Xi=0,25<=i)throw Error(X(301));i+=1,tt=qe=null,t.updateQueue=null,va.current=kb,e=n(r,o)}while(_i)}if(va.current=Ha,t=qe!==null&&qe.next!==null,Ar=0,tt=qe=De=null,Ua=!1,t)throw Error(X(300));return e}function tf(){var e=Xi!==0;return Xi=0,e}function vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?De.memoizedState=tt=e:tt=tt.next=e,tt}function en(){if(qe===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=tt===null?De.memoizedState:tt.next;if(t!==null)tt=t,qe=e;else{if(e===null)throw Error(X(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},tt===null?De.memoizedState=tt=e:tt=tt.next=e}return tt}function Gi(e,t){return typeof t=="function"?t(e):t}function Iu(e){var t=en(),n=t.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=e;var r=qe,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,u=i;do{var f=u.lane;if((Ar&f)===f)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var p={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=p,s=r):l=l.next=p,De.lanes|=f,Nr|=f}u=u.next}while(u!==null&&u!==i);l===null?s=r:l.next=a,dn(r,t.memoizedState)||(_t=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,De.lanes|=i,Nr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Tu(e){var t=en(),n=t.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);dn(i,t.memoizedState)||(_t=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Fv(){}function jv(e,t){var n=De,r=en(),o=t(),i=!dn(r.memoizedState,o);if(i&&(r.memoizedState=o,_t=!0),r=r.queue,nf(Av.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||tt!==null&&tt.memoizedState.tag&1){if(n.flags|=2048,qi(9,$v.bind(null,n,r,o,t),void 0,null),nt===null)throw Error(X(349));Ar&30||Mv(n,t,o)}return o}function Mv(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function $v(e,t,n,r){t.value=n,t.getSnapshot=r,Nv(t)&&Lv(e)}function Av(e,t,n){return n(function(){Nv(t)&&Lv(e)})}function Nv(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!dn(e,n)}catch{return!0}}function Lv(e){var t=zn(e,1);t!==null&&cn(t,e,1,-1)}function Gp(e){var t=vn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Gi,lastRenderedState:e},t.queue=e,e=e.dispatch=bb.bind(null,De,e),[t.memoizedState,e]}function qi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function zv(){return en().memoizedState}function ya(e,t,n,r){var o=vn();De.flags|=e,o.memoizedState=qi(1|t,n,void 0,r===void 0?null:r)}function vl(e,t,n,r){var o=en();r=r===void 0?null:r;var i=void 0;if(qe!==null){var s=qe.memoizedState;if(i=s.destroy,r!==null&&Jd(r,s.deps)){o.memoizedState=qi(t,n,i,r);return}}De.flags|=e,o.memoizedState=qi(1|t,n,i,r)}function qp(e,t){return ya(8390656,8,e,t)}function nf(e,t){return vl(2048,8,e,t)}function Dv(e,t){return vl(4,2,e,t)}function Ov(e,t){return vl(4,4,e,t)}function Vv(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Bv(e,t,n){return n=n!=null?n.concat([e]):null,vl(4,4,Vv.bind(null,t,e),n)}function rf(){}function Wv(e,t){var n=en();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Jd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Uv(e,t){var n=en();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Jd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Hv(e,t,n){return Ar&21?(dn(n,t)||(n=Gg(),De.lanes|=n,Nr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,_t=!0),e.memoizedState=n)}function wb(e,t){var n=ke;ke=n!==0&&4>n?n:4,e(!0);var r=Cu.transition;Cu.transition={};try{e(!1),t()}finally{ke=n,Cu.transition=r}}function Zv(){return en().memoizedState}function xb(e,t,n){var r=lr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Yv(e))Kv(t,n);else if(n=Rv(e,t,n,r),n!==null){var o=wt();cn(n,e,r,o),Xv(n,t,r)}}function bb(e,t,n){var r=lr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Yv(e))Kv(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,dn(a,s)){var l=t.interleaved;l===null?(o.next=o,Kd(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=Rv(e,t,o,r),n!==null&&(o=wt(),cn(n,e,r,o),Xv(n,t,r))}}function Yv(e){var t=e.alternate;return e===De||t!==null&&t===De}function Kv(e,t){_i=Ua=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Xv(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$d(e,n)}}var Ha={readContext:Jt,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useInsertionEffect:ft,useLayoutEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useMutableSource:ft,useSyncExternalStore:ft,useId:ft,unstable_isNewReconciler:!1},Sb={readContext:Jt,useCallback:function(e,t){return vn().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:qp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ya(4194308,4,Vv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ya(4194308,4,e,t)},useInsertionEffect:function(e,t){return ya(4,2,e,t)},useMemo:function(e,t){var n=vn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=vn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=xb.bind(null,De,e),[r.memoizedState,e]},useRef:function(e){var t=vn();return e={current:e},t.memoizedState=e},useState:Gp,useDebugValue:rf,useDeferredValue:function(e){return vn().memoizedState=e},useTransition:function(){var e=Gp(!1),t=e[0];return e=wb.bind(null,e[1]),vn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=De,o=vn();if($e){if(n===void 0)throw Error(X(407));n=n()}else{if(n=t(),nt===null)throw Error(X(349));Ar&30||Mv(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,qp(Av.bind(null,r,i,e),[e]),r.flags|=2048,qi(9,$v.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=vn(),t=nt.identifierPrefix;if($e){var n=Mn,r=jn;n=(r&~(1<<32-un(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Xi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=yb++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Eb={readContext:Jt,useCallback:Wv,useContext:Jt,useEffect:nf,useImperativeHandle:Bv,useInsertionEffect:Dv,useLayoutEffect:Ov,useMemo:Uv,useReducer:Iu,useRef:zv,useState:function(){return Iu(Gi)},useDebugValue:rf,useDeferredValue:function(e){var t=en();return Hv(t,qe.memoizedState,e)},useTransition:function(){var e=Iu(Gi)[0],t=en().memoizedState;return[e,t]},useMutableSource:Fv,useSyncExternalStore:jv,useId:Zv,unstable_isNewReconciler:!1},kb={readContext:Jt,useCallback:Wv,useContext:Jt,useEffect:nf,useImperativeHandle:Bv,useInsertionEffect:Dv,useLayoutEffect:Ov,useMemo:Uv,useReducer:Tu,useRef:zv,useState:function(){return Tu(Gi)},useDebugValue:rf,useDeferredValue:function(e){var t=en();return qe===null?t.memoizedState=e:Hv(t,qe.memoizedState,e)},useTransition:function(){var e=Tu(Gi)[0],t=en().memoizedState;return[e,t]},useMutableSource:Fv,useSyncExternalStore:jv,useId:Zv,unstable_isNewReconciler:!1};function sn(e,t){if(e&&e.defaultProps){t=Oe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Nc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Oe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var yl={isMounted:function(e){return(e=e._reactInternals)?Br(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=wt(),o=lr(e),i=An(r,o);i.payload=t,n!=null&&(i.callback=n),t=sr(e,i,o),t!==null&&(cn(t,e,o,r),ga(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=wt(),o=lr(e),i=An(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=sr(e,i,o),t!==null&&(cn(t,e,o,r),ga(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wt(),r=lr(e),o=An(n,r);o.tag=2,t!=null&&(o.callback=t),t=sr(e,o,r),t!==null&&(cn(t,e,r,n),ga(t,e,r))}};function Qp(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Wi(n,r)||!Wi(o,i):!0}function Gv(e,t,n){var r=!1,o=fr,i=t.contextType;return typeof i=="object"&&i!==null?i=Jt(i):(o=Ft(t)?Mr:vt.current,r=t.contextTypes,i=(r=r!=null)?Fo(e,o):fr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=yl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Jp(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&yl.enqueueReplaceState(t,t.state,null)}function Lc(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Xd(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Jt(i):(i=Ft(t)?Mr:vt.current,o.context=Fo(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Nc(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&yl.enqueueReplaceState(o,o.state,null),Ba(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ao(e,t){try{var n="",r=t;do n+=Qx(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
37
|
+
`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{lu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?yi(e):""}function Qx(e){switch(e.tag){case 5:return yi(e.type);case 16:return yi("Lazy");case 13:return yi("Suspense");case 19:return yi("SuspenseList");case 0:case 2:case 15:return e=uu(e.type,!1),e;case 11:return e=uu(e.type.render,!1),e;case 1:return e=uu(e.type,!0),e;default:return""}}function cc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case so:return"Fragment";case io:return"Portal";case ac:return"Profiler";case _d:return"StrictMode";case lc:return"Suspense";case uc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _g:return(e.displayName||"Context")+".Consumer";case Rg:return(e._context.displayName||"Context")+".Provider";case Pd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Fd:return t=e.displayName||null,t!==null?t:cc(e.type)||"Memo";case Xn:t=e._payload,e=e._init;try{return cc(e(t))}catch{}}return null}function Jx(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return cc(t);case 8:return t===_d?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function dr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Fg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function e1(e){var t=Fg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function _s(e){e._valueTracker||(e._valueTracker=e1(e))}function jg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Fg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ta(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function dc(e,t){var n=t.checked;return Oe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function gp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=dr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mg(e,t){t=t.checked,t!=null&&Rd(e,"checked",t,!1)}function fc(e,t){Mg(e,t);var n=dr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?pc(e,t.type,n):t.hasOwnProperty("defaultValue")&&pc(e,t.type,dr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vp(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function pc(e,t,n){(t!=="number"||Ta(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wi=Array.isArray;function bo(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+dr(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function mc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(X(91));return Oe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function yp(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(X(92));if(wi(n)){if(1<n.length)throw Error(X(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:dr(n)}}function $g(e,t){var n=dr(t.value),r=dr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function wp(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ag(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function hc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ag(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ps,Ng=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ps=Ps||document.createElement("div"),Ps.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ps.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Li(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ki={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},t1=["Webkit","ms","Moz","O"];Object.keys(ki).forEach(function(e){t1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ki[t]=ki[e]})});function Lg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ki.hasOwnProperty(e)&&ki[e]?(""+t).trim():t+"px"}function zg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Lg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var n1=Oe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function gc(e,t){if(t){if(n1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(X(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(X(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(X(61))}if(t.style!=null&&typeof t.style!="object")throw Error(X(62))}}function vc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var yc=null;function jd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wc=null,So=null,Eo=null;function xp(e){if(e=as(e)){if(typeof wc!="function")throw Error(X(280));var t=e.stateNode;t&&(t=hl(t),wc(e.stateNode,e.type,t))}}function Dg(e){So?Eo?Eo.push(e):Eo=[e]:So=e}function Og(){if(So){var e=So,t=Eo;if(Eo=So=null,xp(e),t)for(e=0;e<t.length;e++)xp(t[e])}}function Vg(e,t){return e(t)}function Bg(){}var cu=!1;function Wg(e,t,n){if(cu)return e(t,n);cu=!0;try{return Vg(e,t,n)}finally{cu=!1,(So!==null||Eo!==null)&&(Bg(),Og())}}function zi(e,t){var n=e.stateNode;if(n===null)return null;var r=hl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(X(231,t,typeof n));return n}var xc=!1;if(Nn)try{var ni={};Object.defineProperty(ni,"passive",{get:function(){xc=!0}}),window.addEventListener("test",ni,ni),window.removeEventListener("test",ni,ni)}catch{xc=!1}function r1(e,t,n,r,o,i,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(f){this.onError(f)}}var Ci=!1,Ra=null,_a=!1,bc=null,o1={onError:function(e){Ci=!0,Ra=e}};function i1(e,t,n,r,o,i,s,a,l){Ci=!1,Ra=null,r1.apply(o1,arguments)}function s1(e,t,n,r,o,i,s,a,l){if(i1.apply(this,arguments),Ci){if(Ci){var u=Ra;Ci=!1,Ra=null}else throw Error(X(198));_a||(_a=!0,bc=u)}}function Br(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Ug(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function bp(e){if(Br(e)!==e)throw Error(X(188))}function a1(e){var t=e.alternate;if(!t){if(t=Br(e),t===null)throw Error(X(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return bp(o),e;if(i===r)return bp(o),t;i=i.sibling}throw Error(X(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(X(189))}}if(n.alternate!==r)throw Error(X(190))}if(n.tag!==3)throw Error(X(188));return n.stateNode.current===n?e:t}function Hg(e){return e=a1(e),e!==null?Zg(e):null}function Zg(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Zg(e);if(t!==null)return t;e=e.sibling}return null}var Yg=Bt.unstable_scheduleCallback,Sp=Bt.unstable_cancelCallback,l1=Bt.unstable_shouldYield,u1=Bt.unstable_requestPaint,He=Bt.unstable_now,c1=Bt.unstable_getCurrentPriorityLevel,Md=Bt.unstable_ImmediatePriority,Kg=Bt.unstable_UserBlockingPriority,Pa=Bt.unstable_NormalPriority,d1=Bt.unstable_LowPriority,Xg=Bt.unstable_IdlePriority,dl=null,En=null;function f1(e){if(En&&typeof En.onCommitFiberRoot=="function")try{En.onCommitFiberRoot(dl,e,void 0,(e.current.flags&128)===128)}catch{}}var un=Math.clz32?Math.clz32:h1,p1=Math.log,m1=Math.LN2;function h1(e){return e>>>=0,e===0?32:31-(p1(e)/m1|0)|0}var Fs=64,js=4194304;function xi(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fa(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=xi(a):(i&=s,i!==0&&(r=xi(i)))}else s=n&~o,s!==0?r=xi(s):i!==0&&(r=xi(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-un(t),o=1<<n,r|=e[n],t&=~o;return r}function g1(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function v1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-un(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=g1(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Sc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Gg(){var e=Fs;return Fs<<=1,!(Fs&4194240)&&(Fs=64),e}function du(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function is(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-un(t),e[t]=n}function y1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-un(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function $d(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-un(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ke=0;function qg(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Qg,Ad,Jg,ev,tv,Ec=!1,Ms=[],nr=null,rr=null,or=null,Di=new Map,Oi=new Map,qn=[],w1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ep(e,t){switch(e){case"focusin":case"focusout":nr=null;break;case"dragenter":case"dragleave":rr=null;break;case"mouseover":case"mouseout":or=null;break;case"pointerover":case"pointerout":Di.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oi.delete(t.pointerId)}}function ri(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=as(t),t!==null&&Ad(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function x1(e,t,n,r,o){switch(t){case"focusin":return nr=ri(nr,e,t,n,r,o),!0;case"dragenter":return rr=ri(rr,e,t,n,r,o),!0;case"mouseover":return or=ri(or,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Di.set(i,ri(Di.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Oi.set(i,ri(Oi.get(i)||null,e,t,n,r,o)),!0}return!1}function nv(e){var t=Ir(e.target);if(t!==null){var n=Br(t);if(n!==null){if(t=n.tag,t===13){if(t=Ug(n),t!==null){e.blockedOn=t,tv(e.priority,function(){Jg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function pa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=kc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);yc=r,n.target.dispatchEvent(r),yc=null}else return t=as(n),t!==null&&Ad(t),e.blockedOn=n,!1;t.shift()}return!0}function kp(e,t,n){pa(e)&&n.delete(t)}function b1(){Ec=!1,nr!==null&&pa(nr)&&(nr=null),rr!==null&&pa(rr)&&(rr=null),or!==null&&pa(or)&&(or=null),Di.forEach(kp),Oi.forEach(kp)}function oi(e,t){e.blockedOn===t&&(e.blockedOn=null,Ec||(Ec=!0,Bt.unstable_scheduleCallback(Bt.unstable_NormalPriority,b1)))}function Vi(e){function t(o){return oi(o,e)}if(0<Ms.length){oi(Ms[0],e);for(var n=1;n<Ms.length;n++){var r=Ms[n];r.blockedOn===e&&(r.blockedOn=null)}}for(nr!==null&&oi(nr,e),rr!==null&&oi(rr,e),or!==null&&oi(or,e),Di.forEach(t),Oi.forEach(t),n=0;n<qn.length;n++)r=qn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<qn.length&&(n=qn[0],n.blockedOn===null);)nv(n),n.blockedOn===null&&qn.shift()}var ko=Vn.ReactCurrentBatchConfig,ja=!0;function S1(e,t,n,r){var o=ke,i=ko.transition;ko.transition=null;try{ke=1,Nd(e,t,n,r)}finally{ke=o,ko.transition=i}}function E1(e,t,n,r){var o=ke,i=ko.transition;ko.transition=null;try{ke=4,Nd(e,t,n,r)}finally{ke=o,ko.transition=i}}function Nd(e,t,n,r){if(ja){var o=kc(e,t,n,r);if(o===null)bu(e,t,r,Ma,n),Ep(e,r);else if(x1(o,e,t,n,r))r.stopPropagation();else if(Ep(e,r),t&4&&-1<w1.indexOf(e)){for(;o!==null;){var i=as(o);if(i!==null&&Qg(i),i=kc(e,t,n,r),i===null&&bu(e,t,r,Ma,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else bu(e,t,r,null,n)}}var Ma=null;function kc(e,t,n,r){if(Ma=null,e=jd(r),e=Ir(e),e!==null)if(t=Br(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ug(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ma=e,null}function rv(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(c1()){case Md:return 1;case Kg:return 4;case Pa:case d1:return 16;case Xg:return 536870912;default:return 16}default:return 16}}var er=null,Ld=null,ma=null;function ov(){if(ma)return ma;var e,t=Ld,n=t.length,r,o="value"in er?er.value:er.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return ma=o.slice(e,1<r?1-r:void 0)}function ha(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function $s(){return!0}function Cp(){return!1}function Ut(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?$s:Cp,this.isPropagationStopped=Cp,this}return Oe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=$s)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=$s)},persist:function(){},isPersistent:$s}),t}var Oo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zd=Ut(Oo),ss=Oe({},Oo,{view:0,detail:0}),k1=Ut(ss),fu,pu,ii,fl=Oe({},ss,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dd,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ii&&(ii&&e.type==="mousemove"?(fu=e.screenX-ii.screenX,pu=e.screenY-ii.screenY):pu=fu=0,ii=e),fu)},movementY:function(e){return"movementY"in e?e.movementY:pu}}),Ip=Ut(fl),C1=Oe({},fl,{dataTransfer:0}),I1=Ut(C1),T1=Oe({},ss,{relatedTarget:0}),mu=Ut(T1),R1=Oe({},Oo,{animationName:0,elapsedTime:0,pseudoElement:0}),_1=Ut(R1),P1=Oe({},Oo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),F1=Ut(P1),j1=Oe({},Oo,{data:0}),Tp=Ut(j1),M1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$1={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},A1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function N1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=A1[e])?!!t[e]:!1}function Dd(){return N1}var L1=Oe({},ss,{key:function(e){if(e.key){var t=M1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ha(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?$1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dd,charCode:function(e){return e.type==="keypress"?ha(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ha(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),z1=Ut(L1),D1=Oe({},fl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rp=Ut(D1),O1=Oe({},ss,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dd}),V1=Ut(O1),B1=Oe({},Oo,{propertyName:0,elapsedTime:0,pseudoElement:0}),W1=Ut(B1),U1=Oe({},fl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),H1=Ut(U1),Z1=[9,13,27,32],Od=Nn&&"CompositionEvent"in window,Ii=null;Nn&&"documentMode"in document&&(Ii=document.documentMode);var Y1=Nn&&"TextEvent"in window&&!Ii,iv=Nn&&(!Od||Ii&&8<Ii&&11>=Ii),_p=" ",Pp=!1;function sv(e,t){switch(e){case"keyup":return Z1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function av(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ao=!1;function K1(e,t){switch(e){case"compositionend":return av(t);case"keypress":return t.which!==32?null:(Pp=!0,_p);case"textInput":return e=t.data,e===_p&&Pp?null:e;default:return null}}function X1(e,t){if(ao)return e==="compositionend"||!Od&&sv(e,t)?(e=ov(),ma=Ld=er=null,ao=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return iv&&t.locale!=="ko"?null:t.data;default:return null}}var G1={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Fp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!G1[e.type]:t==="textarea"}function lv(e,t,n,r){Dg(r),t=$a(t,"onChange"),0<t.length&&(n=new zd("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ti=null,Bi=null;function q1(e){wv(e,0)}function pl(e){var t=co(e);if(jg(t))return e}function Q1(e,t){if(e==="change")return t}var uv=!1;if(Nn){var hu;if(Nn){var gu="oninput"in document;if(!gu){var jp=document.createElement("div");jp.setAttribute("oninput","return;"),gu=typeof jp.oninput=="function"}hu=gu}else hu=!1;uv=hu&&(!document.documentMode||9<document.documentMode)}function Mp(){Ti&&(Ti.detachEvent("onpropertychange",cv),Bi=Ti=null)}function cv(e){if(e.propertyName==="value"&&pl(Bi)){var t=[];lv(t,Bi,e,jd(e)),Wg(q1,t)}}function J1(e,t,n){e==="focusin"?(Mp(),Ti=t,Bi=n,Ti.attachEvent("onpropertychange",cv)):e==="focusout"&&Mp()}function eb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return pl(Bi)}function tb(e,t){if(e==="click")return pl(t)}function nb(e,t){if(e==="input"||e==="change")return pl(t)}function rb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fn=typeof Object.is=="function"?Object.is:rb;function Wi(e,t){if(fn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!sc.call(t,o)||!fn(e[o],t[o]))return!1}return!0}function $p(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ap(e,t){var n=$p(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$p(n)}}function dv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?dv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fv(){for(var e=window,t=Ta();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ta(e.document)}return t}function Vd(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")}function ob(e){var t=fv(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dv(n.ownerDocument.documentElement,n)){if(r!==null&&Vd(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Ap(n,i);var s=Ap(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ib=Nn&&"documentMode"in document&&11>=document.documentMode,lo=null,Cc=null,Ri=null,Ic=!1;function Np(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ic||lo==null||lo!==Ta(r)||(r=lo,"selectionStart"in r&&Vd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ri&&Wi(Ri,r)||(Ri=r,r=$a(Cc,"onSelect"),0<r.length&&(t=new zd("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=lo)))}function As(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var uo={animationend:As("Animation","AnimationEnd"),animationiteration:As("Animation","AnimationIteration"),animationstart:As("Animation","AnimationStart"),transitionend:As("Transition","TransitionEnd")},vu={},pv={};Nn&&(pv=document.createElement("div").style,"AnimationEvent"in window||(delete uo.animationend.animation,delete uo.animationiteration.animation,delete uo.animationstart.animation),"TransitionEvent"in window||delete uo.transitionend.transition);function ml(e){if(vu[e])return vu[e];if(!uo[e])return e;var t=uo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in pv)return vu[e]=t[n];return e}var mv=ml("animationend"),hv=ml("animationiteration"),gv=ml("animationstart"),vv=ml("transitionend"),yv=new Map,Lp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function gr(e,t){yv.set(e,t),Vr(t,[e])}for(var yu=0;yu<Lp.length;yu++){var wu=Lp[yu],sb=wu.toLowerCase(),ab=wu[0].toUpperCase()+wu.slice(1);gr(sb,"on"+ab)}gr(mv,"onAnimationEnd");gr(hv,"onAnimationIteration");gr(gv,"onAnimationStart");gr("dblclick","onDoubleClick");gr("focusin","onFocus");gr("focusout","onBlur");gr(vv,"onTransitionEnd");Po("onMouseEnter",["mouseout","mouseover"]);Po("onMouseLeave",["mouseout","mouseover"]);Po("onPointerEnter",["pointerout","pointerover"]);Po("onPointerLeave",["pointerout","pointerover"]);Vr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Vr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Vr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Vr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Vr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Vr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),lb=new Set("cancel close invalid load scroll toggle".split(" ").concat(bi));function zp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,s1(r,t,void 0,e),e.currentTarget=null}function wv(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;zp(o,a,u),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;zp(o,a,u),i=l}}}if(_a)throw e=bc,_a=!1,bc=null,e}function Fe(e,t){var n=t[Fc];n===void 0&&(n=t[Fc]=new Set);var r=e+"__bubble";n.has(r)||(xv(t,e,2,!1),n.add(r))}function xu(e,t,n){var r=0;t&&(r|=4),xv(n,e,r,t)}var Ns="_reactListening"+Math.random().toString(36).slice(2);function Ui(e){if(!e[Ns]){e[Ns]=!0,Tg.forEach(function(n){n!=="selectionchange"&&(lb.has(n)||xu(n,!1,e),xu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ns]||(t[Ns]=!0,xu("selectionchange",!1,t))}}function xv(e,t,n,r){switch(rv(t)){case 1:var o=S1;break;case 4:o=E1;break;default:o=Nd}n=o.bind(null,t,n,e),o=void 0,!xc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function bu(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=Ir(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}Wg(function(){var u=i,f=jd(n),p=[];e:{var m=yv.get(e);if(m!==void 0){var h=zd,y=e;switch(e){case"keypress":if(ha(n)===0)break e;case"keydown":case"keyup":h=z1;break;case"focusin":y="focus",h=mu;break;case"focusout":y="blur",h=mu;break;case"beforeblur":case"afterblur":h=mu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Ip;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=I1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=V1;break;case mv:case hv:case gv:h=_1;break;case vv:h=W1;break;case"scroll":h=k1;break;case"wheel":h=H1;break;case"copy":case"cut":case"paste":h=F1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Rp}var g=(t&4)!==0,S=!g&&e==="scroll",v=g?m!==null?m+"Capture":null:m;g=[];for(var w=u,x;w!==null;){x=w;var b=x.stateNode;if(x.tag===5&&b!==null&&(x=b,v!==null&&(b=zi(w,v),b!=null&&g.push(Hi(w,b,x)))),S)break;w=w.return}0<g.length&&(m=new h(m,y,null,n,f),p.push({event:m,listeners:g}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",m&&n!==yc&&(y=n.relatedTarget||n.fromElement)&&(Ir(y)||y[Ln]))break e;if((h||m)&&(m=f.window===f?f:(m=f.ownerDocument)?m.defaultView||m.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=u,y=y?Ir(y):null,y!==null&&(S=Br(y),y!==S||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=u),h!==y)){if(g=Ip,b="onMouseLeave",v="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(g=Rp,b="onPointerLeave",v="onPointerEnter",w="pointer"),S=h==null?m:co(h),x=y==null?m:co(y),m=new g(b,w+"leave",h,n,f),m.target=S,m.relatedTarget=x,b=null,Ir(f)===u&&(g=new g(v,w+"enter",y,n,f),g.target=x,g.relatedTarget=S,b=g),S=b,h&&y)t:{for(g=h,v=y,w=0,x=g;x;x=qr(x))w++;for(x=0,b=v;b;b=qr(b))x++;for(;0<w-x;)g=qr(g),w--;for(;0<x-w;)v=qr(v),x--;for(;w--;){if(g===v||v!==null&&g===v.alternate)break t;g=qr(g),v=qr(v)}g=null}else g=null;h!==null&&Dp(p,m,h,g,!1),y!==null&&S!==null&&Dp(p,S,y,g,!0)}}e:{if(m=u?co(u):window,h=m.nodeName&&m.nodeName.toLowerCase(),h==="select"||h==="input"&&m.type==="file")var k=Q1;else if(Fp(m))if(uv)k=nb;else{k=eb;var E=J1}else(h=m.nodeName)&&h.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(k=tb);if(k&&(k=k(e,u))){lv(p,k,n,f);break e}E&&E(e,m,u),e==="focusout"&&(E=m._wrapperState)&&E.controlled&&m.type==="number"&&pc(m,"number",m.value)}switch(E=u?co(u):window,e){case"focusin":(Fp(E)||E.contentEditable==="true")&&(lo=E,Cc=u,Ri=null);break;case"focusout":Ri=Cc=lo=null;break;case"mousedown":Ic=!0;break;case"contextmenu":case"mouseup":case"dragend":Ic=!1,Np(p,n,f);break;case"selectionchange":if(ib)break;case"keydown":case"keyup":Np(p,n,f)}var I;if(Od)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else ao?sv(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(iv&&n.locale!=="ko"&&(ao||T!=="onCompositionStart"?T==="onCompositionEnd"&&ao&&(I=ov()):(er=f,Ld="value"in er?er.value:er.textContent,ao=!0)),E=$a(u,T),0<E.length&&(T=new Tp(T,e,null,n,f),p.push({event:T,listeners:E}),I?T.data=I:(I=av(n),I!==null&&(T.data=I)))),(I=Y1?K1(e,n):X1(e,n))&&(u=$a(u,"onBeforeInput"),0<u.length&&(f=new Tp("onBeforeInput","beforeinput",null,n,f),p.push({event:f,listeners:u}),f.data=I))}wv(p,t)})}function Hi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $a(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=zi(e,n),i!=null&&r.unshift(Hi(e,i,o)),i=zi(e,t),i!=null&&r.push(Hi(e,i,o))),e=e.return}return r}function qr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Dp(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,o?(l=zi(n,i),l!=null&&s.unshift(Hi(n,l,a))):o||(l=zi(n,i),l!=null&&s.push(Hi(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var ub=/\r\n?/g,cb=/\u0000|\uFFFD/g;function Op(e){return(typeof e=="string"?e:""+e).replace(ub,`
|
|
38
|
+
`).replace(cb,"")}function Ls(e,t,n){if(t=Op(t),Op(e)!==t&&n)throw Error(X(425))}function Aa(){}var Tc=null,Rc=null;function _c(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pc=typeof setTimeout=="function"?setTimeout:void 0,db=typeof clearTimeout=="function"?clearTimeout:void 0,Vp=typeof Promise=="function"?Promise:void 0,fb=typeof queueMicrotask=="function"?queueMicrotask:typeof Vp<"u"?function(e){return Vp.resolve(null).then(e).catch(pb)}:Pc;function pb(e){setTimeout(function(){throw e})}function Su(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Vi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Vi(t)}function ir(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Bp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Vo=Math.random().toString(36).slice(2),xn="__reactFiber$"+Vo,Zi="__reactProps$"+Vo,Ln="__reactContainer$"+Vo,Fc="__reactEvents$"+Vo,mb="__reactListeners$"+Vo,hb="__reactHandles$"+Vo;function Ir(e){var t=e[xn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ln]||n[xn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Bp(e);e!==null;){if(n=e[xn])return n;e=Bp(e)}return t}e=n,n=e.parentNode}return null}function as(e){return e=e[xn]||e[Ln],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function co(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(X(33))}function hl(e){return e[Zi]||null}var jc=[],fo=-1;function vr(e){return{current:e}}function je(e){0>fo||(e.current=jc[fo],jc[fo]=null,fo--)}function _e(e,t){fo++,jc[fo]=e.current,e.current=t}var fr={},vt=vr(fr),Pt=vr(!1),Mr=fr;function Fo(e,t){var n=e.type.contextTypes;if(!n)return fr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ft(e){return e=e.childContextTypes,e!=null}function Na(){je(Pt),je(vt)}function Wp(e,t,n){if(vt.current!==fr)throw Error(X(168));_e(vt,t),_e(Pt,n)}function bv(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(X(108,Jx(e)||"Unknown",o));return Oe({},n,r)}function La(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fr,Mr=vt.current,_e(vt,e),_e(Pt,Pt.current),!0}function Up(e,t,n){var r=e.stateNode;if(!r)throw Error(X(169));n?(e=bv(e,t,Mr),r.__reactInternalMemoizedMergedChildContext=e,je(Pt),je(vt),_e(vt,e)):je(Pt),_e(Pt,n)}var Pn=null,gl=!1,Eu=!1;function Sv(e){Pn===null?Pn=[e]:Pn.push(e)}function gb(e){gl=!0,Sv(e)}function yr(){if(!Eu&&Pn!==null){Eu=!0;var e=0,t=ke;try{var n=Pn;for(ke=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Pn=null,gl=!1}catch(o){throw Pn!==null&&(Pn=Pn.slice(e+1)),Yg(Md,yr),o}finally{ke=t,Eu=!1}}return null}var po=[],mo=0,za=null,Da=0,Kt=[],Xt=0,$r=null,jn=1,Mn="";function kr(e,t){po[mo++]=Da,po[mo++]=za,za=e,Da=t}function Ev(e,t,n){Kt[Xt++]=jn,Kt[Xt++]=Mn,Kt[Xt++]=$r,$r=e;var r=jn;e=Mn;var o=32-un(r)-1;r&=~(1<<o),n+=1;var i=32-un(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,jn=1<<32-un(t)+o|n<<o|r,Mn=i+e}else jn=1<<i|n<<o|r,Mn=e}function Bd(e){e.return!==null&&(kr(e,1),Ev(e,1,0))}function Wd(e){for(;e===za;)za=po[--mo],po[mo]=null,Da=po[--mo],po[mo]=null;for(;e===$r;)$r=Kt[--Xt],Kt[Xt]=null,Mn=Kt[--Xt],Kt[Xt]=null,jn=Kt[--Xt],Kt[Xt]=null}var Vt=null,Ot=null,Ae=!1,ln=null;function kv(e,t){var n=qt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Hp(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Vt=e,Ot=ir(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Vt=e,Ot=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=$r!==null?{id:jn,overflow:Mn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=qt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Vt=e,Ot=null,!0):!1;default:return!1}}function Mc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function $c(e){if(Ae){var t=Ot;if(t){var n=t;if(!Hp(e,t)){if(Mc(e))throw Error(X(418));t=ir(n.nextSibling);var r=Vt;t&&Hp(e,t)?kv(r,n):(e.flags=e.flags&-4097|2,Ae=!1,Vt=e)}}else{if(Mc(e))throw Error(X(418));e.flags=e.flags&-4097|2,Ae=!1,Vt=e}}}function Zp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Vt=e}function zs(e){if(e!==Vt)return!1;if(!Ae)return Zp(e),Ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!_c(e.type,e.memoizedProps)),t&&(t=Ot)){if(Mc(e))throw Cv(),Error(X(418));for(;t;)kv(e,t),t=ir(t.nextSibling)}if(Zp(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(X(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ot=ir(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ot=null}}else Ot=Vt?ir(e.stateNode.nextSibling):null;return!0}function Cv(){for(var e=Ot;e;)e=ir(e.nextSibling)}function jo(){Ot=Vt=null,Ae=!1}function Ud(e){ln===null?ln=[e]:ln.push(e)}var vb=Vn.ReactCurrentBatchConfig;function si(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(X(309));var r=n.stateNode}if(!r)throw Error(X(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(X(284));if(!n._owner)throw Error(X(290,e))}return e}function Ds(e,t){throw e=Object.prototype.toString.call(t),Error(X(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Yp(e){var t=e._init;return t(e._payload)}function Iv(e){function t(v,w){if(e){var x=v.deletions;x===null?(v.deletions=[w],v.flags|=16):x.push(w)}}function n(v,w){if(!e)return null;for(;w!==null;)t(v,w),w=w.sibling;return null}function r(v,w){for(v=new Map;w!==null;)w.key!==null?v.set(w.key,w):v.set(w.index,w),w=w.sibling;return v}function o(v,w){return v=ur(v,w),v.index=0,v.sibling=null,v}function i(v,w,x){return v.index=x,e?(x=v.alternate,x!==null?(x=x.index,x<w?(v.flags|=2,w):x):(v.flags|=2,w)):(v.flags|=1048576,w)}function s(v){return e&&v.alternate===null&&(v.flags|=2),v}function a(v,w,x,b){return w===null||w.tag!==6?(w=Pu(x,v.mode,b),w.return=v,w):(w=o(w,x),w.return=v,w)}function l(v,w,x,b){var k=x.type;return k===so?f(v,w,x.props.children,b,x.key):w!==null&&(w.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Xn&&Yp(k)===w.type)?(b=o(w,x.props),b.ref=si(v,w,x),b.return=v,b):(b=Sa(x.type,x.key,x.props,null,v.mode,b),b.ref=si(v,w,x),b.return=v,b)}function u(v,w,x,b){return w===null||w.tag!==4||w.stateNode.containerInfo!==x.containerInfo||w.stateNode.implementation!==x.implementation?(w=Fu(x,v.mode,b),w.return=v,w):(w=o(w,x.children||[]),w.return=v,w)}function f(v,w,x,b,k){return w===null||w.tag!==7?(w=jr(x,v.mode,b,k),w.return=v,w):(w=o(w,x),w.return=v,w)}function p(v,w,x){if(typeof w=="string"&&w!==""||typeof w=="number")return w=Pu(""+w,v.mode,x),w.return=v,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Rs:return x=Sa(w.type,w.key,w.props,null,v.mode,x),x.ref=si(v,null,w),x.return=v,x;case io:return w=Fu(w,v.mode,x),w.return=v,w;case Xn:var b=w._init;return p(v,b(w._payload),x)}if(wi(w)||ti(w))return w=jr(w,v.mode,x,null),w.return=v,w;Ds(v,w)}return null}function m(v,w,x,b){var k=w!==null?w.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return k!==null?null:a(v,w,""+x,b);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Rs:return x.key===k?l(v,w,x,b):null;case io:return x.key===k?u(v,w,x,b):null;case Xn:return k=x._init,m(v,w,k(x._payload),b)}if(wi(x)||ti(x))return k!==null?null:f(v,w,x,b,null);Ds(v,x)}return null}function h(v,w,x,b,k){if(typeof b=="string"&&b!==""||typeof b=="number")return v=v.get(x)||null,a(w,v,""+b,k);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Rs:return v=v.get(b.key===null?x:b.key)||null,l(w,v,b,k);case io:return v=v.get(b.key===null?x:b.key)||null,u(w,v,b,k);case Xn:var E=b._init;return h(v,w,x,E(b._payload),k)}if(wi(b)||ti(b))return v=v.get(x)||null,f(w,v,b,k,null);Ds(w,b)}return null}function y(v,w,x,b){for(var k=null,E=null,I=w,T=w=0,_=null;I!==null&&T<x.length;T++){I.index>T?(_=I,I=null):_=I.sibling;var $=m(v,I,x[T],b);if($===null){I===null&&(I=_);break}e&&I&&$.alternate===null&&t(v,I),w=i($,w,T),E===null?k=$:E.sibling=$,E=$,I=_}if(T===x.length)return n(v,I),Ae&&kr(v,T),k;if(I===null){for(;T<x.length;T++)I=p(v,x[T],b),I!==null&&(w=i(I,w,T),E===null?k=I:E.sibling=I,E=I);return Ae&&kr(v,T),k}for(I=r(v,I);T<x.length;T++)_=h(I,v,T,x[T],b),_!==null&&(e&&_.alternate!==null&&I.delete(_.key===null?T:_.key),w=i(_,w,T),E===null?k=_:E.sibling=_,E=_);return e&&I.forEach(function(j){return t(v,j)}),Ae&&kr(v,T),k}function g(v,w,x,b){var k=ti(x);if(typeof k!="function")throw Error(X(150));if(x=k.call(x),x==null)throw Error(X(151));for(var E=k=null,I=w,T=w=0,_=null,$=x.next();I!==null&&!$.done;T++,$=x.next()){I.index>T?(_=I,I=null):_=I.sibling;var j=m(v,I,$.value,b);if(j===null){I===null&&(I=_);break}e&&I&&j.alternate===null&&t(v,I),w=i(j,w,T),E===null?k=j:E.sibling=j,E=j,I=_}if($.done)return n(v,I),Ae&&kr(v,T),k;if(I===null){for(;!$.done;T++,$=x.next())$=p(v,$.value,b),$!==null&&(w=i($,w,T),E===null?k=$:E.sibling=$,E=$);return Ae&&kr(v,T),k}for(I=r(v,I);!$.done;T++,$=x.next())$=h(I,v,T,$.value,b),$!==null&&(e&&$.alternate!==null&&I.delete($.key===null?T:$.key),w=i($,w,T),E===null?k=$:E.sibling=$,E=$);return e&&I.forEach(function(L){return t(v,L)}),Ae&&kr(v,T),k}function S(v,w,x,b){if(typeof x=="object"&&x!==null&&x.type===so&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Rs:e:{for(var k=x.key,E=w;E!==null;){if(E.key===k){if(k=x.type,k===so){if(E.tag===7){n(v,E.sibling),w=o(E,x.props.children),w.return=v,v=w;break e}}else if(E.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Xn&&Yp(k)===E.type){n(v,E.sibling),w=o(E,x.props),w.ref=si(v,E,x),w.return=v,v=w;break e}n(v,E);break}else t(v,E);E=E.sibling}x.type===so?(w=jr(x.props.children,v.mode,b,x.key),w.return=v,v=w):(b=Sa(x.type,x.key,x.props,null,v.mode,b),b.ref=si(v,w,x),b.return=v,v=b)}return s(v);case io:e:{for(E=x.key;w!==null;){if(w.key===E)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(v,w.sibling),w=o(w,x.children||[]),w.return=v,v=w;break e}else{n(v,w);break}else t(v,w);w=w.sibling}w=Fu(x,v.mode,b),w.return=v,v=w}return s(v);case Xn:return E=x._init,S(v,w,E(x._payload),b)}if(wi(x))return y(v,w,x,b);if(ti(x))return g(v,w,x,b);Ds(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,w!==null&&w.tag===6?(n(v,w.sibling),w=o(w,x),w.return=v,v=w):(n(v,w),w=Pu(x,v.mode,b),w.return=v,v=w),s(v)):n(v,w)}return S}var Mo=Iv(!0),Tv=Iv(!1),Oa=vr(null),Va=null,ho=null,Hd=null;function Zd(){Hd=ho=Va=null}function Yd(e){var t=Oa.current;je(Oa),e._currentValue=t}function Ac(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Co(e,t){Va=e,Hd=ho=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(_t=!0),e.firstContext=null)}function Jt(e){var t=e._currentValue;if(Hd!==e)if(e={context:e,memoizedValue:t,next:null},ho===null){if(Va===null)throw Error(X(308));ho=e,Va.dependencies={lanes:0,firstContext:e}}else ho=ho.next=e;return t}var Tr=null;function Kd(e){Tr===null?Tr=[e]:Tr.push(e)}function Rv(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Kd(t)):(n.next=o.next,o.next=n),t.interleaved=n,zn(e,r)}function zn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Gn=!1;function Xd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _v(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function An(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function sr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ge&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,zn(e,n)}return o=r.interleaved,o===null?(t.next=t,Kd(r)):(t.next=o.next,o.next=t),r.interleaved=t,zn(e,n)}function ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$d(e,n)}}function Kp(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ba(e,t,n,r){var o=e.updateQueue;Gn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==s&&(a===null?f.firstBaseUpdate=u:a.next=u,f.lastBaseUpdate=l))}if(i!==null){var p=o.baseState;s=0,f=u=l=null,a=i;do{var m=a.lane,h=a.eventTime;if((r&m)===m){f!==null&&(f=f.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,g=a;switch(m=t,h=n,g.tag){case 1:if(y=g.payload,typeof y=="function"){p=y.call(h,p,m);break e}p=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=g.payload,m=typeof y=="function"?y.call(h,p,m):y,m==null)break e;p=Oe({},p,m);break e;case 2:Gn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,m=o.effects,m===null?o.effects=[a]:m.push(a))}else h={eventTime:h,lane:m,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(u=f=h,l=p):f=f.next=h,s|=m;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;m=a,a=m.next,m.next=null,o.lastBaseUpdate=m,o.shared.pending=null}}while(!0);if(f===null&&(l=p),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=f,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Nr|=s,e.lanes=s,e.memoizedState=p}}function Xp(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(X(191,o));o.call(r)}}}var ls={},kn=vr(ls),Yi=vr(ls),Ki=vr(ls);function Rr(e){if(e===ls)throw Error(X(174));return e}function Gd(e,t){switch(_e(Ki,t),_e(Yi,e),_e(kn,ls),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:hc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=hc(t,e)}je(kn),_e(kn,t)}function $o(){je(kn),je(Yi),je(Ki)}function Pv(e){Rr(Ki.current);var t=Rr(kn.current),n=hc(t,e.type);t!==n&&(_e(Yi,e),_e(kn,n))}function qd(e){Yi.current===e&&(je(kn),je(Yi))}var ze=vr(0);function Wa(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ku=[];function Qd(){for(var e=0;e<ku.length;e++)ku[e]._workInProgressVersionPrimary=null;ku.length=0}var va=Vn.ReactCurrentDispatcher,Cu=Vn.ReactCurrentBatchConfig,Ar=0,De=null,qe=null,tt=null,Ua=!1,_i=!1,Xi=0,yb=0;function ft(){throw Error(X(321))}function Jd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!fn(e[n],t[n]))return!1;return!0}function ef(e,t,n,r,o,i){if(Ar=i,De=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,va.current=e===null||e.memoizedState===null?Sb:Eb,e=n(r,o),_i){i=0;do{if(_i=!1,Xi=0,25<=i)throw Error(X(301));i+=1,tt=qe=null,t.updateQueue=null,va.current=kb,e=n(r,o)}while(_i)}if(va.current=Ha,t=qe!==null&&qe.next!==null,Ar=0,tt=qe=De=null,Ua=!1,t)throw Error(X(300));return e}function tf(){var e=Xi!==0;return Xi=0,e}function yn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?De.memoizedState=tt=e:tt=tt.next=e,tt}function en(){if(qe===null){var e=De.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=tt===null?De.memoizedState:tt.next;if(t!==null)tt=t,qe=e;else{if(e===null)throw Error(X(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},tt===null?De.memoizedState=tt=e:tt=tt.next=e}return tt}function Gi(e,t){return typeof t=="function"?t(e):t}function Iu(e){var t=en(),n=t.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=e;var r=qe,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,u=i;do{var f=u.lane;if((Ar&f)===f)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var p={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=p,s=r):l=l.next=p,De.lanes|=f,Nr|=f}u=u.next}while(u!==null&&u!==i);l===null?s=r:l.next=a,fn(r,t.memoizedState)||(_t=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,De.lanes|=i,Nr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Tu(e){var t=en(),n=t.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);fn(i,t.memoizedState)||(_t=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Fv(){}function jv(e,t){var n=De,r=en(),o=t(),i=!fn(r.memoizedState,o);if(i&&(r.memoizedState=o,_t=!0),r=r.queue,nf(Av.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||tt!==null&&tt.memoizedState.tag&1){if(n.flags|=2048,qi(9,$v.bind(null,n,r,o,t),void 0,null),nt===null)throw Error(X(349));Ar&30||Mv(n,t,o)}return o}function Mv(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function $v(e,t,n,r){t.value=n,t.getSnapshot=r,Nv(t)&&Lv(e)}function Av(e,t,n){return n(function(){Nv(t)&&Lv(e)})}function Nv(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!fn(e,n)}catch{return!0}}function Lv(e){var t=zn(e,1);t!==null&&cn(t,e,1,-1)}function Gp(e){var t=yn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Gi,lastRenderedState:e},t.queue=e,e=e.dispatch=bb.bind(null,De,e),[t.memoizedState,e]}function qi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=De.updateQueue,t===null?(t={lastEffect:null,stores:null},De.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function zv(){return en().memoizedState}function ya(e,t,n,r){var o=yn();De.flags|=e,o.memoizedState=qi(1|t,n,void 0,r===void 0?null:r)}function vl(e,t,n,r){var o=en();r=r===void 0?null:r;var i=void 0;if(qe!==null){var s=qe.memoizedState;if(i=s.destroy,r!==null&&Jd(r,s.deps)){o.memoizedState=qi(t,n,i,r);return}}De.flags|=e,o.memoizedState=qi(1|t,n,i,r)}function qp(e,t){return ya(8390656,8,e,t)}function nf(e,t){return vl(2048,8,e,t)}function Dv(e,t){return vl(4,2,e,t)}function Ov(e,t){return vl(4,4,e,t)}function Vv(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Bv(e,t,n){return n=n!=null?n.concat([e]):null,vl(4,4,Vv.bind(null,t,e),n)}function rf(){}function Wv(e,t){var n=en();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Jd(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Uv(e,t){var n=en();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Jd(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Hv(e,t,n){return Ar&21?(fn(n,t)||(n=Gg(),De.lanes|=n,Nr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,_t=!0),e.memoizedState=n)}function wb(e,t){var n=ke;ke=n!==0&&4>n?n:4,e(!0);var r=Cu.transition;Cu.transition={};try{e(!1),t()}finally{ke=n,Cu.transition=r}}function Zv(){return en().memoizedState}function xb(e,t,n){var r=lr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Yv(e))Kv(t,n);else if(n=Rv(e,t,n,r),n!==null){var o=wt();cn(n,e,r,o),Xv(n,t,r)}}function bb(e,t,n){var r=lr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Yv(e))Kv(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,fn(a,s)){var l=t.interleaved;l===null?(o.next=o,Kd(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=Rv(e,t,o,r),n!==null&&(o=wt(),cn(n,e,r,o),Xv(n,t,r))}}function Yv(e){var t=e.alternate;return e===De||t!==null&&t===De}function Kv(e,t){_i=Ua=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Xv(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$d(e,n)}}var Ha={readContext:Jt,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useInsertionEffect:ft,useLayoutEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useMutableSource:ft,useSyncExternalStore:ft,useId:ft,unstable_isNewReconciler:!1},Sb={readContext:Jt,useCallback:function(e,t){return yn().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:qp,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ya(4194308,4,Vv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ya(4194308,4,e,t)},useInsertionEffect:function(e,t){return ya(4,2,e,t)},useMemo:function(e,t){var n=yn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=yn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=xb.bind(null,De,e),[r.memoizedState,e]},useRef:function(e){var t=yn();return e={current:e},t.memoizedState=e},useState:Gp,useDebugValue:rf,useDeferredValue:function(e){return yn().memoizedState=e},useTransition:function(){var e=Gp(!1),t=e[0];return e=wb.bind(null,e[1]),yn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=De,o=yn();if(Ae){if(n===void 0)throw Error(X(407));n=n()}else{if(n=t(),nt===null)throw Error(X(349));Ar&30||Mv(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,qp(Av.bind(null,r,i,e),[e]),r.flags|=2048,qi(9,$v.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=yn(),t=nt.identifierPrefix;if(Ae){var n=Mn,r=jn;n=(r&~(1<<32-un(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Xi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=yb++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Eb={readContext:Jt,useCallback:Wv,useContext:Jt,useEffect:nf,useImperativeHandle:Bv,useInsertionEffect:Dv,useLayoutEffect:Ov,useMemo:Uv,useReducer:Iu,useRef:zv,useState:function(){return Iu(Gi)},useDebugValue:rf,useDeferredValue:function(e){var t=en();return Hv(t,qe.memoizedState,e)},useTransition:function(){var e=Iu(Gi)[0],t=en().memoizedState;return[e,t]},useMutableSource:Fv,useSyncExternalStore:jv,useId:Zv,unstable_isNewReconciler:!1},kb={readContext:Jt,useCallback:Wv,useContext:Jt,useEffect:nf,useImperativeHandle:Bv,useInsertionEffect:Dv,useLayoutEffect:Ov,useMemo:Uv,useReducer:Tu,useRef:zv,useState:function(){return Tu(Gi)},useDebugValue:rf,useDeferredValue:function(e){var t=en();return qe===null?t.memoizedState=e:Hv(t,qe.memoizedState,e)},useTransition:function(){var e=Tu(Gi)[0],t=en().memoizedState;return[e,t]},useMutableSource:Fv,useSyncExternalStore:jv,useId:Zv,unstable_isNewReconciler:!1};function sn(e,t){if(e&&e.defaultProps){t=Oe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Nc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Oe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var yl={isMounted:function(e){return(e=e._reactInternals)?Br(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=wt(),o=lr(e),i=An(r,o);i.payload=t,n!=null&&(i.callback=n),t=sr(e,i,o),t!==null&&(cn(t,e,o,r),ga(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=wt(),o=lr(e),i=An(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=sr(e,i,o),t!==null&&(cn(t,e,o,r),ga(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wt(),r=lr(e),o=An(n,r);o.tag=2,t!=null&&(o.callback=t),t=sr(e,o,r),t!==null&&(cn(t,e,r,n),ga(t,e,r))}};function Qp(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Wi(n,r)||!Wi(o,i):!0}function Gv(e,t,n){var r=!1,o=fr,i=t.contextType;return typeof i=="object"&&i!==null?i=Jt(i):(o=Ft(t)?Mr:vt.current,r=t.contextTypes,i=(r=r!=null)?Fo(e,o):fr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=yl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Jp(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&yl.enqueueReplaceState(t,t.state,null)}function Lc(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Xd(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Jt(i):(i=Ft(t)?Mr:vt.current,o.context=Fo(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Nc(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&yl.enqueueReplaceState(o,o.state,null),Ba(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ao(e,t){try{var n="",r=t;do n+=Qx(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
39
39
|
Error generating stack: `+i.message+`
|
|
40
|
-
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function Ru(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function zc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Cb=typeof WeakMap=="function"?WeakMap:Map;function qv(e,t,n){n=An(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ya||(Ya=!0,Kc=r),zc(e,t)},n}function Qv(e,t,n){n=An(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){zc(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){zc(e,t),typeof r!="function"&&(ar===null?ar=new Set([this]):ar.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function em(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Cb;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Db.bind(null,e,t,n),t.then(e,e))}function tm(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function nm(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=An(-1,1),t.tag=2,sr(n,t,1))),n.lanes|=1),e)}var Ib=Vn.ReactCurrentOwner,_t=!1;function yt(e,t,n,r){t.child=e===null?Tv(t,null,n,r):Mo(t,e.child,n,r)}function rm(e,t,n,r,o){n=n.render;var i=t.ref;return Co(t,o),r=ef(e,t,n,r,i,o),n=tf(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Dn(e,t,o)):($e&&n&&Bd(t),t.flags|=1,yt(e,t,r,o),t.child)}function om(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!ff(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Jv(e,t,i,r,o)):(e=Sa(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Wi,n(s,r)&&e.ref===t.ref)return Dn(e,t,o)}return t.flags|=1,e=ur(i,r),e.ref=t.ref,e.return=t,t.child=e}function Jv(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Wi(i,r)&&e.ref===t.ref)if(_t=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(_t=!0);else return t.lanes=e.lanes,Dn(e,t,o)}return Dc(e,t,n,r,o)}function ey(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},_e(vo,Dt),Dt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,_e(vo,Dt),Dt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,_e(vo,Dt),Dt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,_e(vo,Dt),Dt|=r;return yt(e,t,o,n),t.child}function ty(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Dc(e,t,n,r,o){var i=Ft(n)?Mr:vt.current;return i=Fo(t,i),Co(t,o),n=ef(e,t,n,r,i,o),r=tf(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Dn(e,t,o)):($e&&r&&Bd(t),t.flags|=1,yt(e,t,n,o),t.child)}function im(e,t,n,r,o){if(Ft(n)){var i=!0;La(t)}else i=!1;if(Co(t,o),t.stateNode===null)wa(e,t),Gv(t,n,r),Lc(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Jt(u):(u=Ft(n)?Mr:vt.current,u=Fo(t,u));var f=n.getDerivedStateFromProps,p=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";p||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&Jp(t,s,r,u),Gn=!1;var m=t.memoizedState;s.state=m,Ba(t,r,s,o),l=t.memoizedState,a!==r||m!==l||Pt.current||Gn?(typeof f=="function"&&(Nc(t,n,f,r),l=t.memoizedState),(a=Gn||Qp(t,n,a,r,m,l,u))?(p||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,_v(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:sn(t.type,a),s.props=u,p=t.pendingProps,m=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Jt(l):(l=Ft(n)?Mr:vt.current,l=Fo(t,l));var h=n.getDerivedStateFromProps;(f=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==p||m!==l)&&Jp(t,s,r,l),Gn=!1,m=t.memoizedState,s.state=m,Ba(t,r,s,o);var w=t.memoizedState;a!==p||m!==w||Pt.current||Gn?(typeof h=="function"&&(Nc(t,n,h,r),w=t.memoizedState),(u=Gn||Qp(t,n,u,r,m,w,l)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,w,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,w,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=w),s.props=r,s.state=w,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return Oc(e,t,n,r,i,o)}function Oc(e,t,n,r,o,i){ty(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Up(t,n,!1),Dn(e,t,i);r=t.stateNode,Ib.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Mo(t,e.child,null,i),t.child=Mo(t,null,a,i)):yt(e,t,a,i),t.memoizedState=r.state,o&&Up(t,n,!0),t.child}function ny(e){var t=e.stateNode;t.pendingContext?Wp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Wp(e,t.context,!1),Gd(e,t.containerInfo)}function sm(e,t,n,r,o){return jo(),Ud(o),t.flags|=256,yt(e,t,n,r),t.child}var Vc={dehydrated:null,treeContext:null,retryLane:0};function Bc(e){return{baseLanes:e,cachePool:null,transitions:null}}function ry(e,t,n){var r=t.pendingProps,o=ze.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),_e(ze,o&1),e===null)return $c(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=bl(s,r,0,null),e=jr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Bc(n),t.memoizedState=Vc,e):of(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return Tb(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=ur(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=ur(a,i):(i=jr(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?Bc(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Vc,r}return i=e.child,e=i.sibling,r=ur(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function of(e,t){return t=bl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Os(e,t,n,r){return r!==null&&Ud(r),Mo(t,e.child,null,n),e=of(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tb(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=Ru(Error(X(422))),Os(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=bl({mode:"visible",children:r.children},o,0,null),i=jr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Mo(t,e.child,null,s),t.child.memoizedState=Bc(s),t.memoizedState=Vc,i);if(!(t.mode&1))return Os(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(X(419)),r=Ru(i,r,void 0),Os(e,t,s,r)}if(a=(s&e.childLanes)!==0,_t||a){if(r=nt,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,zn(e,o),cn(r,e,o,-1))}return df(),r=Ru(Error(X(421))),Os(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Ob.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Ot=ir(o.nextSibling),Vt=t,$e=!0,ln=null,e!==null&&(Kt[Xt++]=jn,Kt[Xt++]=Mn,Kt[Xt++]=$r,jn=e.id,Mn=e.overflow,$r=t),t=of(t,r.children),t.flags|=4096,t)}function am(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ac(e.return,t,n)}function _u(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function oy(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(yt(e,t,r.children,n),r=ze.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&am(e,n,t);else if(e.tag===19)am(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(_e(ze,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Wa(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),_u(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Wa(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}_u(t,!0,n,null,i);break;case"together":_u(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function wa(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Dn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Nr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(X(153));if(t.child!==null){for(e=t.child,n=ur(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ur(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Rb(e,t,n){switch(t.tag){case 3:ny(t),jo();break;case 5:Pv(t);break;case 1:Ft(t.type)&&La(t);break;case 4:Gd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;_e(Oa,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(_e(ze,ze.current&1),t.flags|=128,null):n&t.child.childLanes?ry(e,t,n):(_e(ze,ze.current&1),e=Dn(e,t,n),e!==null?e.sibling:null);_e(ze,ze.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return oy(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),_e(ze,ze.current),r)break;return null;case 22:case 23:return t.lanes=0,ey(e,t,n)}return Dn(e,t,n)}var iy,Wc,sy,ay;iy=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Wc=function(){};sy=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Rr(En.current);var i=null;switch(n){case"input":o=dc(e,o),r=dc(e,r),i=[];break;case"select":o=Oe({},o,{value:void 0}),r=Oe({},r,{value:void 0}),i=[];break;case"textarea":o=mc(e,o),r=mc(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Aa)}gc(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var a=o[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ni.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(a=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ni.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Fe("scroll",e),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};ay=function(e,t,n,r){n!==r&&(t.flags|=4)};function ai(e,t){if(!$e)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function pt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _b(e,t,n){var r=t.pendingProps;switch(Wd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pt(t),null;case 1:return Ft(t.type)&&Na(),pt(t),null;case 3:return r=t.stateNode,$o(),je(Pt),je(vt),Qd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(zs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ln!==null&&(qc(ln),ln=null))),Wc(e,t),pt(t),null;case 5:qd(t);var o=Rr(Ki.current);if(n=t.type,e!==null&&t.stateNode!=null)sy(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(X(166));return pt(t),null}if(e=Rr(En.current),zs(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[wn]=t,r[Zi]=i,e=(t.mode&1)!==0,n){case"dialog":Fe("cancel",r),Fe("close",r);break;case"iframe":case"object":case"embed":Fe("load",r);break;case"video":case"audio":for(o=0;o<bi.length;o++)Fe(bi[o],r);break;case"source":Fe("error",r);break;case"img":case"image":case"link":Fe("error",r),Fe("load",r);break;case"details":Fe("toggle",r);break;case"input":gp(r,i),Fe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Fe("invalid",r);break;case"textarea":yp(r,i),Fe("invalid",r)}gc(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Ls(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Ls(r.textContent,a,e),o=["children",""+a]):Ni.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Fe("scroll",r)}switch(n){case"input":_s(r),vp(r,i,!0);break;case"textarea":_s(r),wp(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Aa)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ag(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[wn]=t,e[Zi]=r,iy(e,t,!1,!1),t.stateNode=e;e:{switch(s=vc(n,r),n){case"dialog":Fe("cancel",e),Fe("close",e),o=r;break;case"iframe":case"object":case"embed":Fe("load",e),o=r;break;case"video":case"audio":for(o=0;o<bi.length;o++)Fe(bi[o],e);o=r;break;case"source":Fe("error",e),o=r;break;case"img":case"image":case"link":Fe("error",e),Fe("load",e),o=r;break;case"details":Fe("toggle",e),o=r;break;case"input":gp(e,r),o=dc(e,r),Fe("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Oe({},r,{value:void 0}),Fe("invalid",e);break;case"textarea":yp(e,r),o=mc(e,r),Fe("invalid",e);break;default:o=r}gc(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?zg(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Ng(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Li(e,l):typeof l=="number"&&Li(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ni.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Fe("scroll",e):l!=null&&Rd(e,i,l,s))}switch(n){case"input":_s(e),vp(e,r,!1);break;case"textarea":_s(e),wp(e);break;case"option":r.value!=null&&e.setAttribute("value",""+dr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?bo(e,!!r.multiple,i,!1):r.defaultValue!=null&&bo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Aa)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return pt(t),null;case 6:if(e&&t.stateNode!=null)ay(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(X(166));if(n=Rr(Ki.current),Rr(En.current),zs(t)){if(r=t.stateNode,n=t.memoizedProps,r[wn]=t,(i=r.nodeValue!==n)&&(e=Vt,e!==null))switch(e.tag){case 3:Ls(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ls(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[wn]=t,t.stateNode=r}return pt(t),null;case 13:if(je(ze),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if($e&&Ot!==null&&t.mode&1&&!(t.flags&128))Cv(),jo(),t.flags|=98560,i=!1;else if(i=zs(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(X(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(X(317));i[wn]=t}else jo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pt(t),i=!1}else ln!==null&&(qc(ln),ln=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ze.current&1?Qe===0&&(Qe=3):df())),t.updateQueue!==null&&(t.flags|=4),pt(t),null);case 4:return $o(),Wc(e,t),e===null&&Ui(t.stateNode.containerInfo),pt(t),null;case 10:return Yd(t.type._context),pt(t),null;case 17:return Ft(t.type)&&Na(),pt(t),null;case 19:if(je(ze),i=t.memoizedState,i===null)return pt(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)ai(i,!1);else{if(Qe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Wa(e),s!==null){for(t.flags|=128,ai(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return _e(ze,ze.current&1|2),t.child}e=e.sibling}i.tail!==null&&He()>No&&(t.flags|=128,r=!0,ai(i,!1),t.lanes=4194304)}else{if(!r)if(e=Wa(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ai(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!$e)return pt(t),null}else 2*He()-i.renderingStartTime>No&&n!==1073741824&&(t.flags|=128,r=!0,ai(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=He(),t.sibling=null,n=ze.current,_e(ze,r?n&1|2:n&1),t):(pt(t),null);case 22:case 23:return cf(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Dt&1073741824&&(pt(t),t.subtreeFlags&6&&(t.flags|=8192)):pt(t),null;case 24:return null;case 25:return null}throw Error(X(156,t.tag))}function Pb(e,t){switch(Wd(t),t.tag){case 1:return Ft(t.type)&&Na(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $o(),je(Pt),je(vt),Qd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qd(t),null;case 13:if(je(ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(X(340));jo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return je(ze),null;case 4:return $o(),null;case 10:return Yd(t.type._context),null;case 22:case 23:return cf(),null;case 24:return null;default:return null}}var Vs=!1,ht=!1,Fb=typeof WeakSet=="function"?WeakSet:Set,ne=null;function go(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){We(e,t,r)}else n.current=null}function Uc(e,t,n){try{n()}catch(r){We(e,t,r)}}var lm=!1;function jb(e,t){if(Tc=ja,e=fv(),Vd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,f=0,p=e,m=null;t:for(;;){for(var h;p!==n||o!==0&&p.nodeType!==3||(a=s+o),p!==i||r!==0&&p.nodeType!==3||(l=s+r),p.nodeType===3&&(s+=p.nodeValue.length),(h=p.firstChild)!==null;)m=p,p=h;for(;;){if(p===e)break t;if(m===n&&++u===o&&(a=s),m===i&&++f===r&&(l=s),(h=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Rc={focusedElem:e,selectionRange:n},ja=!1,ne=t;ne!==null;)if(t=ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ne=e;else for(;ne!==null;){t=ne;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var v=w.memoizedProps,S=w.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:sn(t.type,v),S);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(X(163))}}catch(b){We(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,ne=e;break}ne=t.return}return w=lm,lm=!1,w}function Pi(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Uc(t,n,i)}o=o.next}while(o!==r)}}function wl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Hc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ly(e){var t=e.alternate;t!==null&&(e.alternate=null,ly(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[wn],delete t[Zi],delete t[Fc],delete t[mb],delete t[hb])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function uy(e){return e.tag===5||e.tag===3||e.tag===4}function um(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||uy(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.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 Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Aa));else if(r!==4&&(e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}var st=null,an=!1;function Hn(e,t,n){for(n=n.child;n!==null;)cy(e,t,n),n=n.sibling}function cy(e,t,n){if(Sn&&typeof Sn.onCommitFiberUnmount=="function")try{Sn.onCommitFiberUnmount(dl,n)}catch{}switch(n.tag){case 5:ht||go(n,t);case 6:var r=st,o=an;st=null,Hn(e,t,n),st=r,an=o,st!==null&&(an?(e=st,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):st.removeChild(n.stateNode));break;case 18:st!==null&&(an?(e=st,n=n.stateNode,e.nodeType===8?Su(e.parentNode,n):e.nodeType===1&&Su(e,n),Vi(e)):Su(st,n.stateNode));break;case 4:r=st,o=an,st=n.stateNode.containerInfo,an=!0,Hn(e,t,n),st=r,an=o;break;case 0:case 11:case 14:case 15:if(!ht&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Uc(n,t,s),o=o.next}while(o!==r)}Hn(e,t,n);break;case 1:if(!ht&&(go(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){We(n,t,a)}Hn(e,t,n);break;case 21:Hn(e,t,n);break;case 22:n.mode&1?(ht=(r=ht)||n.memoizedState!==null,Hn(e,t,n),ht=r):Hn(e,t,n);break;default:Hn(e,t,n)}}function cm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Fb),t.forEach(function(r){var o=Vb.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function nn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:st=a.stateNode,an=!1;break e;case 3:st=a.stateNode.containerInfo,an=!0;break e;case 4:st=a.stateNode.containerInfo,an=!0;break e}a=a.return}if(st===null)throw Error(X(160));cy(i,s,o),st=null,an=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){We(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)dy(t,e),t=t.sibling}function dy(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(nn(t,e),hn(e),r&4){try{Pi(3,e,e.return),wl(3,e)}catch(v){We(e,e.return,v)}try{Pi(5,e,e.return)}catch(v){We(e,e.return,v)}}break;case 1:nn(t,e),hn(e),r&512&&n!==null&&go(n,n.return);break;case 5:if(nn(t,e),hn(e),r&512&&n!==null&&go(n,n.return),e.flags&32){var o=e.stateNode;try{Li(o,"")}catch(v){We(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Mg(o,i),vc(a,s);var u=vc(a,i);for(s=0;s<l.length;s+=2){var f=l[s],p=l[s+1];f==="style"?zg(o,p):f==="dangerouslySetInnerHTML"?Ng(o,p):f==="children"?Li(o,p):Rd(o,f,p,u)}switch(a){case"input":fc(o,i);break;case"textarea":$g(o,i);break;case"select":var m=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?bo(o,!!i.multiple,h,!1):m!==!!i.multiple&&(i.defaultValue!=null?bo(o,!!i.multiple,i.defaultValue,!0):bo(o,!!i.multiple,i.multiple?[]:"",!1))}o[Zi]=i}catch(v){We(e,e.return,v)}}break;case 6:if(nn(t,e),hn(e),r&4){if(e.stateNode===null)throw Error(X(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){We(e,e.return,v)}}break;case 3:if(nn(t,e),hn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Vi(t.containerInfo)}catch(v){We(e,e.return,v)}break;case 4:nn(t,e),hn(e);break;case 13:nn(t,e),hn(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(lf=He())),r&4&&cm(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(ht=(u=ht)||f,nn(t,e),ht=u):nn(t,e),hn(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(ne=e,f=e.child;f!==null;){for(p=ne=f;ne!==null;){switch(m=ne,h=m.child,m.tag){case 0:case 11:case 14:case 15:Pi(4,m,m.return);break;case 1:go(m,m.return);var w=m.stateNode;if(typeof w.componentWillUnmount=="function"){r=m,n=m.return;try{t=r,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(v){We(r,n,v)}}break;case 5:go(m,m.return);break;case 22:if(m.memoizedState!==null){fm(p);continue}}h!==null?(h.return=m,ne=h):fm(p)}f=f.sibling}e:for(f=null,p=e;;){if(p.tag===5){if(f===null){f=p;try{o=p.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=p.stateNode,l=p.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Lg("display",s))}catch(v){We(e,e.return,v)}}}else if(p.tag===6){if(f===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(v){We(e,e.return,v)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;f===p&&(f=null),p=p.return}f===p&&(f=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:nn(t,e),hn(e),r&4&&cm(e);break;case 21:break;default:nn(t,e),hn(e)}}function hn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(uy(n)){var r=n;break e}n=n.return}throw Error(X(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Li(o,""),r.flags&=-33);var i=um(e);Yc(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=um(e);Zc(e,a,s);break;default:throw Error(X(161))}}catch(l){We(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mb(e,t,n){ne=e,fy(e)}function fy(e,t,n){for(var r=(e.mode&1)!==0;ne!==null;){var o=ne,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Vs;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||ht;a=Vs;var u=ht;if(Vs=s,(ht=l)&&!u)for(ne=o;ne!==null;)s=ne,l=s.child,s.tag===22&&s.memoizedState!==null?pm(o):l!==null?(l.return=s,ne=l):pm(o);for(;i!==null;)ne=i,fy(i),i=i.sibling;ne=o,Vs=a,ht=u}dm(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,ne=i):dm(e)}}function dm(e){for(;ne!==null;){var t=ne;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ht||wl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ht)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:sn(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Xp(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Xp(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var f=u.memoizedState;if(f!==null){var p=f.dehydrated;p!==null&&Vi(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(X(163))}ht||t.flags&512&&Hc(t)}catch(m){We(t,t.return,m)}}if(t===e){ne=null;break}if(n=t.sibling,n!==null){n.return=t.return,ne=n;break}ne=t.return}}function fm(e){for(;ne!==null;){var t=ne;if(t===e){ne=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ne=n;break}ne=t.return}}function pm(e){for(;ne!==null;){var t=ne;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{wl(4,t)}catch(l){We(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){We(t,o,l)}}var i=t.return;try{Hc(t)}catch(l){We(t,i,l)}break;case 5:var s=t.return;try{Hc(t)}catch(l){We(t,s,l)}}}catch(l){We(t,t.return,l)}if(t===e){ne=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ne=a;break}ne=t.return}}var $b=Math.ceil,Za=Vn.ReactCurrentDispatcher,sf=Vn.ReactCurrentOwner,Qt=Vn.ReactCurrentBatchConfig,ge=0,nt=null,Ke=null,at=0,Dt=0,vo=vr(0),Qe=0,Qi=null,Nr=0,xl=0,af=0,Fi=null,Rt=null,lf=0,No=1/0,_n=null,Ya=!1,Kc=null,ar=null,Bs=!1,tr=null,Ka=0,ji=0,Xc=null,xa=-1,ba=0;function wt(){return ge&6?He():xa!==-1?xa:xa=He()}function lr(e){return e.mode&1?ge&2&&at!==0?at&-at:vb.transition!==null?(ba===0&&(ba=Gg()),ba):(e=ke,e!==0||(e=window.event,e=e===void 0?16:rv(e.type)),e):1}function cn(e,t,n,r){if(50<ji)throw ji=0,Xc=null,Error(X(185));is(e,n,r),(!(ge&2)||e!==nt)&&(e===nt&&(!(ge&2)&&(xl|=n),Qe===4&&Qn(e,at)),jt(e,r),n===1&&ge===0&&!(t.mode&1)&&(No=He()+500,gl&&yr()))}function jt(e,t){var n=e.callbackNode;v1(e,t);var r=Fa(e,e===nt?at:0);if(r===0)n!==null&&Sp(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Sp(n),t===1)e.tag===0?gb(mm.bind(null,e)):Sv(mm.bind(null,e)),fb(function(){!(ge&6)&&yr()}),n=null;else{switch(qg(r)){case 1:n=Md;break;case 4:n=Kg;break;case 16:n=Pa;break;case 536870912:n=Xg;break;default:n=Pa}n=xy(n,py.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function py(e,t){if(xa=-1,ba=0,ge&6)throw Error(X(327));var n=e.callbackNode;if(Io()&&e.callbackNode!==n)return null;var r=Fa(e,e===nt?at:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Xa(e,r);else{t=r;var o=ge;ge|=2;var i=hy();(nt!==e||at!==t)&&(_n=null,No=He()+500,Fr(e,t));do try{Lb();break}catch(a){my(e,a)}while(!0);Zd(),Za.current=i,ge=o,Ke!==null?t=0:(nt=null,at=0,t=Qe)}if(t!==0){if(t===2&&(o=Sc(e),o!==0&&(r=o,t=Gc(e,o))),t===1)throw n=Qi,Fr(e,0),Qn(e,r),jt(e,He()),n;if(t===6)Qn(e,r);else{if(o=e.current.alternate,!(r&30)&&!Ab(o)&&(t=Xa(e,r),t===2&&(i=Sc(e),i!==0&&(r=i,t=Gc(e,i))),t===1))throw n=Qi,Fr(e,0),Qn(e,r),jt(e,He()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(X(345));case 2:Cr(e,Rt,_n);break;case 3:if(Qn(e,r),(r&130023424)===r&&(t=lf+500-He(),10<t)){if(Fa(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){wt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Pc(Cr.bind(null,e,Rt,_n),t);break}Cr(e,Rt,_n);break;case 4:if(Qn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-un(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=He()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*$b(r/1960))-r,10<r){e.timeoutHandle=Pc(Cr.bind(null,e,Rt,_n),r);break}Cr(e,Rt,_n);break;case 5:Cr(e,Rt,_n);break;default:throw Error(X(329))}}}return jt(e,He()),e.callbackNode===n?py.bind(null,e):null}function Gc(e,t){var n=Fi;return e.current.memoizedState.isDehydrated&&(Fr(e,t).flags|=256),e=Xa(e,t),e!==2&&(t=Rt,Rt=n,t!==null&&qc(t)),e}function qc(e){Rt===null?Rt=e:Rt.push.apply(Rt,e)}function Ab(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!dn(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Qn(e,t){for(t&=~af,t&=~xl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-un(t),r=1<<n;e[n]=-1,t&=~r}}function mm(e){if(ge&6)throw Error(X(327));Io();var t=Fa(e,0);if(!(t&1))return jt(e,He()),null;var n=Xa(e,t);if(e.tag!==0&&n===2){var r=Sc(e);r!==0&&(t=r,n=Gc(e,r))}if(n===1)throw n=Qi,Fr(e,0),Qn(e,t),jt(e,He()),n;if(n===6)throw Error(X(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Cr(e,Rt,_n),jt(e,He()),null}function uf(e,t){var n=ge;ge|=1;try{return e(t)}finally{ge=n,ge===0&&(No=He()+500,gl&&yr())}}function Lr(e){tr!==null&&tr.tag===0&&!(ge&6)&&Io();var t=ge;ge|=1;var n=Qt.transition,r=ke;try{if(Qt.transition=null,ke=1,e)return e()}finally{ke=r,Qt.transition=n,ge=t,!(ge&6)&&yr()}}function cf(){Dt=vo.current,je(vo)}function Fr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,db(n)),Ke!==null)for(n=Ke.return;n!==null;){var r=n;switch(Wd(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Na();break;case 3:$o(),je(Pt),je(vt),Qd();break;case 5:qd(r);break;case 4:$o();break;case 13:je(ze);break;case 19:je(ze);break;case 10:Yd(r.type._context);break;case 22:case 23:cf()}n=n.return}if(nt=e,Ke=e=ur(e.current,null),at=Dt=t,Qe=0,Qi=null,af=xl=Nr=0,Rt=Fi=null,Tr!==null){for(t=0;t<Tr.length;t++)if(n=Tr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}Tr=null}return e}function my(e,t){do{var n=Ke;try{if(Zd(),va.current=Ha,Ua){for(var r=De.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Ua=!1}if(Ar=0,tt=qe=De=null,_i=!1,Xi=0,sf.current=null,n===null||n.return===null){Qe=1,Qi=t,Ke=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=at,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,f=a,p=f.tag;if(!(f.mode&1)&&(p===0||p===11||p===15)){var m=f.alternate;m?(f.updateQueue=m.updateQueue,f.memoizedState=m.memoizedState,f.lanes=m.lanes):(f.updateQueue=null,f.memoizedState=null)}var h=tm(s);if(h!==null){h.flags&=-257,nm(h,s,a,i,t),h.mode&1&&em(i,u,t),t=h,l=u;var w=t.updateQueue;if(w===null){var v=new Set;v.add(l),t.updateQueue=v}else w.add(l);break e}else{if(!(t&1)){em(i,u,t),df();break e}l=Error(X(426))}}else if($e&&a.mode&1){var S=tm(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),nm(S,s,a,i,t),Ud(Ao(l,a));break e}}i=l=Ao(l,a),Qe!==4&&(Qe=2),Fi===null?Fi=[i]:Fi.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=qv(i,l,t);Kp(i,g);break e;case 1:a=l;var y=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ar===null||!ar.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=Qv(i,a,t);Kp(i,b);break e}}i=i.return}while(i!==null)}vy(n)}catch(k){t=k,Ke===n&&n!==null&&(Ke=n=n.return);continue}break}while(!0)}function hy(){var e=Za.current;return Za.current=Ha,e===null?Ha:e}function df(){(Qe===0||Qe===3||Qe===2)&&(Qe=4),nt===null||!(Nr&268435455)&&!(xl&268435455)||Qn(nt,at)}function Xa(e,t){var n=ge;ge|=2;var r=hy();(nt!==e||at!==t)&&(_n=null,Fr(e,t));do try{Nb();break}catch(o){my(e,o)}while(!0);if(Zd(),ge=n,Za.current=r,Ke!==null)throw Error(X(261));return nt=null,at=0,Qe}function Nb(){for(;Ke!==null;)gy(Ke)}function Lb(){for(;Ke!==null&&!l1();)gy(Ke)}function gy(e){var t=wy(e.alternate,e,Dt);e.memoizedProps=e.pendingProps,t===null?vy(e):Ke=t,sf.current=null}function vy(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Pb(n,t),n!==null){n.flags&=32767,Ke=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Qe=6,Ke=null;return}}else if(n=_b(n,t,Dt),n!==null){Ke=n;return}if(t=t.sibling,t!==null){Ke=t;return}Ke=t=e}while(t!==null);Qe===0&&(Qe=5)}function Cr(e,t,n){var r=ke,o=Qt.transition;try{Qt.transition=null,ke=1,zb(e,t,n,r)}finally{Qt.transition=o,ke=r}return null}function zb(e,t,n,r){do Io();while(tr!==null);if(ge&6)throw Error(X(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(X(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(y1(e,i),e===nt&&(Ke=nt=null,at=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Bs||(Bs=!0,xy(Pa,function(){return Io(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Qt.transition,Qt.transition=null;var s=ke;ke=1;var a=ge;ge|=4,sf.current=null,jb(e,n),dy(n,e),ob(Rc),ja=!!Tc,Rc=Tc=null,e.current=n,Mb(n),u1(),ge=a,ke=s,Qt.transition=i}else e.current=n;if(Bs&&(Bs=!1,tr=e,Ka=o),i=e.pendingLanes,i===0&&(ar=null),f1(n.stateNode),jt(e,He()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Ya)throw Ya=!1,e=Kc,Kc=null,e;return Ka&1&&e.tag!==0&&Io(),i=e.pendingLanes,i&1?e===Xc?ji++:(ji=0,Xc=e):ji=0,yr(),null}function Io(){if(tr!==null){var e=qg(Ka),t=Qt.transition,n=ke;try{if(Qt.transition=null,ke=16>e?16:e,tr===null)var r=!1;else{if(e=tr,tr=null,Ka=0,ge&6)throw Error(X(331));var o=ge;for(ge|=4,ne=e.current;ne!==null;){var i=ne,s=i.child;if(ne.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(ne=u;ne!==null;){var f=ne;switch(f.tag){case 0:case 11:case 15:Pi(8,f,i)}var p=f.child;if(p!==null)p.return=f,ne=p;else for(;ne!==null;){f=ne;var m=f.sibling,h=f.return;if(ly(f),f===u){ne=null;break}if(m!==null){m.return=h,ne=m;break}ne=h}}}var w=i.alternate;if(w!==null){var v=w.child;if(v!==null){w.child=null;do{var S=v.sibling;v.sibling=null,v=S}while(v!==null)}}ne=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,ne=s;else e:for(;ne!==null;){if(i=ne,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Pi(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,ne=g;break e}ne=i.return}}var y=e.current;for(ne=y;ne!==null;){s=ne;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,ne=x;else e:for(s=y;ne!==null;){if(a=ne,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:wl(9,a)}}catch(k){We(a,a.return,k)}if(a===s){ne=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,ne=b;break e}ne=a.return}}if(ge=o,yr(),Sn&&typeof Sn.onPostCommitFiberRoot=="function")try{Sn.onPostCommitFiberRoot(dl,e)}catch{}r=!0}return r}finally{ke=n,Qt.transition=t}}return!1}function hm(e,t,n){t=Ao(n,t),t=qv(e,t,1),e=sr(e,t,1),t=wt(),e!==null&&(is(e,1,t),jt(e,t))}function We(e,t,n){if(e.tag===3)hm(e,e,n);else for(;t!==null;){if(t.tag===3){hm(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ar===null||!ar.has(r))){e=Ao(n,e),e=Qv(t,e,1),t=sr(t,e,1),e=wt(),t!==null&&(is(t,1,e),jt(t,e));break}}t=t.return}}function Db(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=wt(),e.pingedLanes|=e.suspendedLanes&n,nt===e&&(at&n)===n&&(Qe===4||Qe===3&&(at&130023424)===at&&500>He()-lf?Fr(e,0):af|=n),jt(e,t)}function yy(e,t){t===0&&(e.mode&1?(t=js,js<<=1,!(js&130023424)&&(js=4194304)):t=1);var n=wt();e=zn(e,t),e!==null&&(is(e,t,n),jt(e,n))}function Ob(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),yy(e,n)}function Vb(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(X(314))}r!==null&&r.delete(t),yy(e,n)}var wy;wy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Pt.current)_t=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return _t=!1,Rb(e,t,n);_t=!!(e.flags&131072)}else _t=!1,$e&&t.flags&1048576&&Ev(t,Da,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;wa(e,t),e=t.pendingProps;var o=Fo(t,vt.current);Co(t,n),o=ef(null,t,r,e,o,n);var i=tf();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ft(r)?(i=!0,La(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Xd(t),o.updater=yl,t.stateNode=o,o._reactInternals=t,Lc(t,r,e,n),t=Oc(null,t,r,!0,i,n)):(t.tag=0,$e&&i&&Bd(t),yt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(wa(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Wb(r),e=sn(r,e),o){case 0:t=Dc(null,t,r,e,n);break e;case 1:t=im(null,t,r,e,n);break e;case 11:t=rm(null,t,r,e,n);break e;case 14:t=om(null,t,r,sn(r.type,e),n);break e}throw Error(X(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),Dc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),im(e,t,r,o,n);case 3:e:{if(ny(t),e===null)throw Error(X(387));r=t.pendingProps,i=t.memoizedState,o=i.element,_v(e,t),Ba(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Ao(Error(X(423)),t),t=sm(e,t,r,n,o);break e}else if(r!==o){o=Ao(Error(X(424)),t),t=sm(e,t,r,n,o);break e}else for(Ot=ir(t.stateNode.containerInfo.firstChild),Vt=t,$e=!0,ln=null,n=Tv(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(jo(),r===o){t=Dn(e,t,n);break e}yt(e,t,r,n)}t=t.child}return t;case 5:return Pv(t),e===null&&$c(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,_c(r,o)?s=null:i!==null&&_c(r,i)&&(t.flags|=32),ty(e,t),yt(e,t,s,n),t.child;case 6:return e===null&&$c(t),null;case 13:return ry(e,t,n);case 4:return Gd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Mo(t,null,r,n):yt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),rm(e,t,r,o,n);case 7:return yt(e,t,t.pendingProps,n),t.child;case 8:return yt(e,t,t.pendingProps.children,n),t.child;case 12:return yt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,_e(Oa,r._currentValue),r._currentValue=s,i!==null)if(dn(i.value,s)){if(i.children===o.children&&!Pt.current){t=Dn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=An(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Ac(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(X(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Ac(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}yt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Co(t,n),o=Jt(o),r=r(o),t.flags|=1,yt(e,t,r,n),t.child;case 14:return r=t.type,o=sn(r,t.pendingProps),o=sn(r.type,o),om(e,t,r,o,n);case 15:return Jv(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),wa(e,t),t.tag=1,Ft(r)?(e=!0,La(t)):e=!1,Co(t,n),Gv(t,r,o),Lc(t,r,o,n),Oc(null,t,r,!0,e,n);case 19:return oy(e,t,n);case 22:return ey(e,t,n)}throw Error(X(156,t.tag))};function xy(e,t){return Yg(e,t)}function Bb(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qt(e,t,n,r){return new Bb(e,t,n,r)}function ff(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wb(e){if(typeof e=="function")return ff(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Pd)return 11;if(e===Fd)return 14}return 2}function ur(e,t){var n=e.alternate;return n===null?(n=qt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Sa(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")ff(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case so:return jr(n.children,o,i,t);case _d:s=8,o|=8;break;case ac:return e=qt(12,n,t,o|2),e.elementType=ac,e.lanes=i,e;case lc:return e=qt(13,n,t,o),e.elementType=lc,e.lanes=i,e;case uc:return e=qt(19,n,t,o),e.elementType=uc,e.lanes=i,e;case Pg:return bl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Rg:s=10;break e;case _g:s=9;break e;case Pd:s=11;break e;case Fd:s=14;break e;case Xn:s=16,r=null;break e}throw Error(X(130,e==null?e:typeof e,""))}return t=qt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function jr(e,t,n,r){return e=qt(7,e,r,t),e.lanes=n,e}function bl(e,t,n,r){return e=qt(22,e,r,t),e.elementType=Pg,e.lanes=n,e.stateNode={isHidden:!1},e}function Pu(e,t,n){return e=qt(6,e,null,t),e.lanes=n,e}function Fu(e,t,n){return t=qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ub(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=du(0),this.expirationTimes=du(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=du(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function pf(e,t,n,r,o,i,s,a,l){return e=new Ub(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=qt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xd(i),e}function Hb(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:io,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function by(e){if(!e)return fr;e=e._reactInternals;e:{if(Br(e)!==e||e.tag!==1)throw Error(X(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ft(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(X(171))}if(e.tag===1){var n=e.type;if(Ft(n))return bv(e,n,t)}return t}function Sy(e,t,n,r,o,i,s,a,l){return e=pf(n,r,!0,e,o,i,s,a,l),e.context=by(null),n=e.current,r=wt(),o=lr(n),i=An(r,o),i.callback=t??null,sr(n,i,o),e.current.lanes=o,is(e,o,r),jt(e,r),e}function Sl(e,t,n,r){var o=t.current,i=wt(),s=lr(o);return n=by(n),t.context===null?t.context=n:t.pendingContext=n,t=An(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=sr(o,t,s),e!==null&&(cn(e,o,s,i),ga(e,o,s)),s}function Ga(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function gm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mf(e,t){gm(e,t),(e=e.alternate)&&gm(e,t)}function Zb(){return null}var Ey=typeof reportError=="function"?reportError:function(e){console.error(e)};function hf(e){this._internalRoot=e}El.prototype.render=hf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(X(409));Sl(e,t,null,null)};El.prototype.unmount=hf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Lr(function(){Sl(null,e,null,null)}),t[Ln]=null}};function El(e){this._internalRoot=e}El.prototype.unstable_scheduleHydration=function(e){if(e){var t=ev();e={blockedOn:null,target:e,priority:t};for(var n=0;n<qn.length&&t!==0&&t<qn[n].priority;n++);qn.splice(n,0,e),n===0&&nv(e)}};function gf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function kl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function vm(){}function Yb(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=Ga(s);i.call(u)}}var s=Sy(t,r,e,0,null,!1,!1,"",vm);return e._reactRootContainer=s,e[Ln]=s.current,Ui(e.nodeType===8?e.parentNode:e),Lr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var u=Ga(l);a.call(u)}}var l=pf(e,0,!1,null,null,!1,!1,"",vm);return e._reactRootContainer=l,e[Ln]=l.current,Ui(e.nodeType===8?e.parentNode:e),Lr(function(){Sl(t,l,n,r)}),l}function Cl(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=Ga(s);a.call(l)}}Sl(t,s,e,o)}else s=Yb(n,t,e,o,r);return Ga(s)}Qg=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=xi(t.pendingLanes);n!==0&&($d(t,n|1),jt(t,He()),!(ge&6)&&(No=He()+500,yr()))}break;case 13:Lr(function(){var r=zn(e,1);if(r!==null){var o=wt();cn(r,e,1,o)}}),mf(e,1)}};Ad=function(e){if(e.tag===13){var t=zn(e,134217728);if(t!==null){var n=wt();cn(t,e,134217728,n)}mf(e,134217728)}};Jg=function(e){if(e.tag===13){var t=lr(e),n=zn(e,t);if(n!==null){var r=wt();cn(n,e,t,r)}mf(e,t)}};ev=function(){return ke};tv=function(e,t){var n=ke;try{return ke=e,t()}finally{ke=n}};wc=function(e,t,n){switch(t){case"input":if(fc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=hl(r);if(!o)throw Error(X(90));jg(r),fc(r,o)}}}break;case"textarea":$g(e,n);break;case"select":t=n.value,t!=null&&bo(e,!!n.multiple,t,!1)}};Vg=uf;Bg=Lr;var Kb={usingClientEntryPoint:!1,Events:[as,co,hl,Dg,Og,uf]},li={findFiberByHostInstance:Ir,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Xb={bundleType:li.bundleType,version:li.version,rendererPackageName:li.rendererPackageName,rendererConfig:li.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Vn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Hg(e),e===null?null:e.stateNode},findFiberByHostInstance:li.findFiberByHostInstance||Zb,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ws=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ws.isDisabled&&Ws.supportsFiber)try{dl=Ws.inject(Xb),Sn=Ws}catch{}}Wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Kb;Wt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!gf(t))throw Error(X(200));return Hb(e,t,null,n)};Wt.createRoot=function(e,t){if(!gf(e))throw Error(X(299));var n=!1,r="",o=Ey;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=pf(e,1,!1,null,null,n,!1,r,o),e[Ln]=t.current,Ui(e.nodeType===8?e.parentNode:e),new hf(t)};Wt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(X(188)):(e=Object.keys(e).join(","),Error(X(268,e)));return e=Hg(t),e=e===null?null:e.stateNode,e};Wt.flushSync=function(e){return Lr(e)};Wt.hydrate=function(e,t,n){if(!kl(t))throw Error(X(200));return Cl(null,e,t,!0,n)};Wt.hydrateRoot=function(e,t,n){if(!gf(e))throw Error(X(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=Ey;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Sy(t,null,e,1,n??null,o,!1,i,s),e[Ln]=t.current,Ui(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new El(t)};Wt.render=function(e,t,n){if(!kl(t))throw Error(X(200));return Cl(null,e,t,!1,n)};Wt.unmountComponentAtNode=function(e){if(!kl(e))throw Error(X(40));return e._reactRootContainer?(Lr(function(){Cl(null,null,e,!1,function(){e._reactRootContainer=null,e[Ln]=null})}),!0):!1};Wt.unstable_batchedUpdates=uf;Wt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!kl(n))throw Error(X(200));if(e==null||e._reactInternals===void 0)throw Error(X(38));return Cl(e,t,n,!1,r)};Wt.version="18.3.1-next-f1338f8080-20240426";function ky(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ky)}catch(e){console.error(e)}}ky(),kg.exports=Wt;var Qc=kg.exports,ym=Qc;ic.createRoot=ym.createRoot,ic.hydrateRoot=ym.hydrateRoot;var Gb=Object.defineProperty,Cy=(e,t)=>{for(var n in t)Gb(e,n,{get:t[n],enumerable:!0,configurable:!0,set:r=>t[n]=()=>r})};if(typeof c.createContext!="function"){const e=['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(e.join(`
|
|
41
|
-
`))}var Wr=c.createContext(!1),Jc=({children:e})=>d.jsx(Wr.Provider,{value:!0,children:e}),Iy=c.createContext({setError:()=>{},clearError:()=>{}}),wm=()=>{try{return typeof __webpack_module__>"u"?null:__webpack_module__.hot??null}catch{return null}};class qb extends J.Component{constructor(){super(...arguments);Ie(this,"state",{hasError:!1});Ie(this,"hmrStatusHandler",null)}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){this.props.onError(n),this.subscribeToHmrReset()}componentDidMount(){this.state.hasError||this.props.onClear()}componentDidUpdate(n,r){r.hasError&&!this.state.hasError&&this.props.onClear()}componentWillUnmount(){this.unsubscribeFromHmrReset()}subscribeToHmrReset(){if(this.hmrStatusHandler)return;const n=wm();if(!n)return;const r=o=>{o==="idle"&&(this.unsubscribeFromHmrReset(),this.setState({hasError:!1}))};this.hmrStatusHandler=r,n.addStatusHandler(r)}unsubscribeFromHmrReset(){const n=this.hmrStatusHandler;if(!n)return;this.hmrStatusHandler=null;const r=wm();r&&r.removeStatusHandler(n)}render(){return this.state.hasError?null:this.props.children}}var Bo=c.createContext({compositions:[],folders:[],currentCompositionMetadata:null,canvasContent:null}),us=c.createContext({registerComposition:()=>{},unregisterComposition:()=>{},registerFolder:()=>{},unregisterFolder:()=>{},setCanvasContent:()=>{},onlyRenderComposition:null}),cs=c.createContext({getNonce:()=>0}),Ea=0;try{typeof __webpack_module__<"u"&&__webpack_module__.hot&&__webpack_module__.hot.addStatusHandler(e=>{e==="idle"&&Ea++})}catch{}var Il=()=>{const t=c.useContext(cs).getNonce(),n=c.useRef(t);n.current=t;const r=c.useRef([[Ea,t]]),o=c.useCallback(()=>(Ea!==r.current[r.current.length-1][0]&&(r.current=[...r.current,[Ea,n.current]]),r.current),[r]);return c.useMemo(()=>({get:o}),[o])};function Wo(e){return!!e}var Ty=()=>/^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g,Ry=e=>e.match(Ty()),Qb=e=>{if(e==null)throw new TypeError("You must pass a name to a <Folder />.");if(typeof e!="string")throw new TypeError(`The "name" you pass into <Folder /> must be a string. Got: ${typeof e}`);if(!Ry(e))throw new Error(`Folder name can only contain a-z, A-Z, 0-9 and -. You passed ${e}`)},Jb=`Folder name must match ${String(Ty())}`,ed=c.createContext({folderName:null,parentName:null}),eS=e=>{const{name:t,children:n}=e,r=c.useContext(ed),{registerFolder:o,unregisterFolder:i}=c.useContext(us),s=Il(),a=e.stack??null;Qb(t);const l=[r.parentName,r.folderName].filter(Wo),u=l.length===0?null:l.join("/"),f=c.useMemo(()=>({folderName:t,parentName:u}),[t,u]);return c.useEffect(()=>(o(t,u,s.get(),a),()=>{i(t,u)}),[t,r.folderName,u,o,i,s,a]),d.jsx(ed.Provider,{value:f,children:n})};function xm(){return["NOD","E_EN","V"].join("")}var bm=()=>["e","nv"].join(""),
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function Ru(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function zc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Cb=typeof WeakMap=="function"?WeakMap:Map;function qv(e,t,n){n=An(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ya||(Ya=!0,Kc=r),zc(e,t)},n}function Qv(e,t,n){n=An(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){zc(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){zc(e,t),typeof r!="function"&&(ar===null?ar=new Set([this]):ar.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function em(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Cb;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Db.bind(null,e,t,n),t.then(e,e))}function tm(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function nm(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=An(-1,1),t.tag=2,sr(n,t,1))),n.lanes|=1),e)}var Ib=Vn.ReactCurrentOwner,_t=!1;function yt(e,t,n,r){t.child=e===null?Tv(t,null,n,r):Mo(t,e.child,n,r)}function rm(e,t,n,r,o){n=n.render;var i=t.ref;return Co(t,o),r=ef(e,t,n,r,i,o),n=tf(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Dn(e,t,o)):(Ae&&n&&Bd(t),t.flags|=1,yt(e,t,r,o),t.child)}function om(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!ff(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Jv(e,t,i,r,o)):(e=Sa(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Wi,n(s,r)&&e.ref===t.ref)return Dn(e,t,o)}return t.flags|=1,e=ur(i,r),e.ref=t.ref,e.return=t,t.child=e}function Jv(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Wi(i,r)&&e.ref===t.ref)if(_t=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(_t=!0);else return t.lanes=e.lanes,Dn(e,t,o)}return Dc(e,t,n,r,o)}function ey(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},_e(vo,Dt),Dt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,_e(vo,Dt),Dt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,_e(vo,Dt),Dt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,_e(vo,Dt),Dt|=r;return yt(e,t,o,n),t.child}function ty(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Dc(e,t,n,r,o){var i=Ft(n)?Mr:vt.current;return i=Fo(t,i),Co(t,o),n=ef(e,t,n,r,i,o),r=tf(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Dn(e,t,o)):(Ae&&r&&Bd(t),t.flags|=1,yt(e,t,n,o),t.child)}function im(e,t,n,r,o){if(Ft(n)){var i=!0;La(t)}else i=!1;if(Co(t,o),t.stateNode===null)wa(e,t),Gv(t,n,r),Lc(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Jt(u):(u=Ft(n)?Mr:vt.current,u=Fo(t,u));var f=n.getDerivedStateFromProps,p=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";p||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&Jp(t,s,r,u),Gn=!1;var m=t.memoizedState;s.state=m,Ba(t,r,s,o),l=t.memoizedState,a!==r||m!==l||Pt.current||Gn?(typeof f=="function"&&(Nc(t,n,f,r),l=t.memoizedState),(a=Gn||Qp(t,n,a,r,m,l,u))?(p||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,_v(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:sn(t.type,a),s.props=u,p=t.pendingProps,m=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Jt(l):(l=Ft(n)?Mr:vt.current,l=Fo(t,l));var h=n.getDerivedStateFromProps;(f=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==p||m!==l)&&Jp(t,s,r,l),Gn=!1,m=t.memoizedState,s.state=m,Ba(t,r,s,o);var y=t.memoizedState;a!==p||m!==y||Pt.current||Gn?(typeof h=="function"&&(Nc(t,n,h,r),y=t.memoizedState),(u=Gn||Qp(t,n,u,r,m,y,l)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return Oc(e,t,n,r,i,o)}function Oc(e,t,n,r,o,i){ty(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Up(t,n,!1),Dn(e,t,i);r=t.stateNode,Ib.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Mo(t,e.child,null,i),t.child=Mo(t,null,a,i)):yt(e,t,a,i),t.memoizedState=r.state,o&&Up(t,n,!0),t.child}function ny(e){var t=e.stateNode;t.pendingContext?Wp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Wp(e,t.context,!1),Gd(e,t.containerInfo)}function sm(e,t,n,r,o){return jo(),Ud(o),t.flags|=256,yt(e,t,n,r),t.child}var Vc={dehydrated:null,treeContext:null,retryLane:0};function Bc(e){return{baseLanes:e,cachePool:null,transitions:null}}function ry(e,t,n){var r=t.pendingProps,o=ze.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),_e(ze,o&1),e===null)return $c(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=bl(s,r,0,null),e=jr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Bc(n),t.memoizedState=Vc,e):of(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return Tb(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=ur(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=ur(a,i):(i=jr(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?Bc(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Vc,r}return i=e.child,e=i.sibling,r=ur(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function of(e,t){return t=bl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Os(e,t,n,r){return r!==null&&Ud(r),Mo(t,e.child,null,n),e=of(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tb(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=Ru(Error(X(422))),Os(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=bl({mode:"visible",children:r.children},o,0,null),i=jr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Mo(t,e.child,null,s),t.child.memoizedState=Bc(s),t.memoizedState=Vc,i);if(!(t.mode&1))return Os(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(X(419)),r=Ru(i,r,void 0),Os(e,t,s,r)}if(a=(s&e.childLanes)!==0,_t||a){if(r=nt,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,zn(e,o),cn(r,e,o,-1))}return df(),r=Ru(Error(X(421))),Os(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Ob.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Ot=ir(o.nextSibling),Vt=t,Ae=!0,ln=null,e!==null&&(Kt[Xt++]=jn,Kt[Xt++]=Mn,Kt[Xt++]=$r,jn=e.id,Mn=e.overflow,$r=t),t=of(t,r.children),t.flags|=4096,t)}function am(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ac(e.return,t,n)}function _u(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function oy(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(yt(e,t,r.children,n),r=ze.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&am(e,n,t);else if(e.tag===19)am(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(_e(ze,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Wa(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),_u(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Wa(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}_u(t,!0,n,null,i);break;case"together":_u(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function wa(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Dn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Nr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(X(153));if(t.child!==null){for(e=t.child,n=ur(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ur(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Rb(e,t,n){switch(t.tag){case 3:ny(t),jo();break;case 5:Pv(t);break;case 1:Ft(t.type)&&La(t);break;case 4:Gd(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;_e(Oa,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(_e(ze,ze.current&1),t.flags|=128,null):n&t.child.childLanes?ry(e,t,n):(_e(ze,ze.current&1),e=Dn(e,t,n),e!==null?e.sibling:null);_e(ze,ze.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return oy(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),_e(ze,ze.current),r)break;return null;case 22:case 23:return t.lanes=0,ey(e,t,n)}return Dn(e,t,n)}var iy,Wc,sy,ay;iy=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Wc=function(){};sy=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Rr(kn.current);var i=null;switch(n){case"input":o=dc(e,o),r=dc(e,r),i=[];break;case"select":o=Oe({},o,{value:void 0}),r=Oe({},r,{value:void 0}),i=[];break;case"textarea":o=mc(e,o),r=mc(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Aa)}gc(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var a=o[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ni.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(a=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ni.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Fe("scroll",e),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};ay=function(e,t,n,r){n!==r&&(t.flags|=4)};function ai(e,t){if(!Ae)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function pt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _b(e,t,n){var r=t.pendingProps;switch(Wd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pt(t),null;case 1:return Ft(t.type)&&Na(),pt(t),null;case 3:return r=t.stateNode,$o(),je(Pt),je(vt),Qd(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(zs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ln!==null&&(qc(ln),ln=null))),Wc(e,t),pt(t),null;case 5:qd(t);var o=Rr(Ki.current);if(n=t.type,e!==null&&t.stateNode!=null)sy(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(X(166));return pt(t),null}if(e=Rr(kn.current),zs(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[xn]=t,r[Zi]=i,e=(t.mode&1)!==0,n){case"dialog":Fe("cancel",r),Fe("close",r);break;case"iframe":case"object":case"embed":Fe("load",r);break;case"video":case"audio":for(o=0;o<bi.length;o++)Fe(bi[o],r);break;case"source":Fe("error",r);break;case"img":case"image":case"link":Fe("error",r),Fe("load",r);break;case"details":Fe("toggle",r);break;case"input":gp(r,i),Fe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Fe("invalid",r);break;case"textarea":yp(r,i),Fe("invalid",r)}gc(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Ls(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Ls(r.textContent,a,e),o=["children",""+a]):Ni.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Fe("scroll",r)}switch(n){case"input":_s(r),vp(r,i,!0);break;case"textarea":_s(r),wp(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Aa)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ag(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[xn]=t,e[Zi]=r,iy(e,t,!1,!1),t.stateNode=e;e:{switch(s=vc(n,r),n){case"dialog":Fe("cancel",e),Fe("close",e),o=r;break;case"iframe":case"object":case"embed":Fe("load",e),o=r;break;case"video":case"audio":for(o=0;o<bi.length;o++)Fe(bi[o],e);o=r;break;case"source":Fe("error",e),o=r;break;case"img":case"image":case"link":Fe("error",e),Fe("load",e),o=r;break;case"details":Fe("toggle",e),o=r;break;case"input":gp(e,r),o=dc(e,r),Fe("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Oe({},r,{value:void 0}),Fe("invalid",e);break;case"textarea":yp(e,r),o=mc(e,r),Fe("invalid",e);break;default:o=r}gc(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?zg(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Ng(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Li(e,l):typeof l=="number"&&Li(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ni.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Fe("scroll",e):l!=null&&Rd(e,i,l,s))}switch(n){case"input":_s(e),vp(e,r,!1);break;case"textarea":_s(e),wp(e);break;case"option":r.value!=null&&e.setAttribute("value",""+dr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?bo(e,!!r.multiple,i,!1):r.defaultValue!=null&&bo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Aa)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return pt(t),null;case 6:if(e&&t.stateNode!=null)ay(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(X(166));if(n=Rr(Ki.current),Rr(kn.current),zs(t)){if(r=t.stateNode,n=t.memoizedProps,r[xn]=t,(i=r.nodeValue!==n)&&(e=Vt,e!==null))switch(e.tag){case 3:Ls(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ls(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[xn]=t,t.stateNode=r}return pt(t),null;case 13:if(je(ze),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ae&&Ot!==null&&t.mode&1&&!(t.flags&128))Cv(),jo(),t.flags|=98560,i=!1;else if(i=zs(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(X(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(X(317));i[xn]=t}else jo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pt(t),i=!1}else ln!==null&&(qc(ln),ln=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ze.current&1?Qe===0&&(Qe=3):df())),t.updateQueue!==null&&(t.flags|=4),pt(t),null);case 4:return $o(),Wc(e,t),e===null&&Ui(t.stateNode.containerInfo),pt(t),null;case 10:return Yd(t.type._context),pt(t),null;case 17:return Ft(t.type)&&Na(),pt(t),null;case 19:if(je(ze),i=t.memoizedState,i===null)return pt(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)ai(i,!1);else{if(Qe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Wa(e),s!==null){for(t.flags|=128,ai(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return _e(ze,ze.current&1|2),t.child}e=e.sibling}i.tail!==null&&He()>No&&(t.flags|=128,r=!0,ai(i,!1),t.lanes=4194304)}else{if(!r)if(e=Wa(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ai(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Ae)return pt(t),null}else 2*He()-i.renderingStartTime>No&&n!==1073741824&&(t.flags|=128,r=!0,ai(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=He(),t.sibling=null,n=ze.current,_e(ze,r?n&1|2:n&1),t):(pt(t),null);case 22:case 23:return cf(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Dt&1073741824&&(pt(t),t.subtreeFlags&6&&(t.flags|=8192)):pt(t),null;case 24:return null;case 25:return null}throw Error(X(156,t.tag))}function Pb(e,t){switch(Wd(t),t.tag){case 1:return Ft(t.type)&&Na(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $o(),je(Pt),je(vt),Qd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qd(t),null;case 13:if(je(ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(X(340));jo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return je(ze),null;case 4:return $o(),null;case 10:return Yd(t.type._context),null;case 22:case 23:return cf(),null;case 24:return null;default:return null}}var Vs=!1,ht=!1,Fb=typeof WeakSet=="function"?WeakSet:Set,ne=null;function go(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ue(e,t,r)}else n.current=null}function Uc(e,t,n){try{n()}catch(r){Ue(e,t,r)}}var lm=!1;function jb(e,t){if(Tc=ja,e=fv(),Vd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,f=0,p=e,m=null;t:for(;;){for(var h;p!==n||o!==0&&p.nodeType!==3||(a=s+o),p!==i||r!==0&&p.nodeType!==3||(l=s+r),p.nodeType===3&&(s+=p.nodeValue.length),(h=p.firstChild)!==null;)m=p,p=h;for(;;){if(p===e)break t;if(m===n&&++u===o&&(a=s),m===i&&++f===r&&(l=s),(h=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Rc={focusedElem:e,selectionRange:n},ja=!1,ne=t;ne!==null;)if(t=ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ne=e;else for(;ne!==null;){t=ne;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var g=y.memoizedProps,S=y.memoizedState,v=t.stateNode,w=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:sn(t.type,g),S);v.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(X(163))}}catch(b){Ue(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,ne=e;break}ne=t.return}return y=lm,lm=!1,y}function Pi(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Uc(t,n,i)}o=o.next}while(o!==r)}}function wl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Hc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function ly(e){var t=e.alternate;t!==null&&(e.alternate=null,ly(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xn],delete t[Zi],delete t[Fc],delete t[mb],delete t[hb])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function uy(e){return e.tag===5||e.tag===3||e.tag===4}function um(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||uy(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.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 Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Aa));else if(r!==4&&(e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}var st=null,an=!1;function Hn(e,t,n){for(n=n.child;n!==null;)cy(e,t,n),n=n.sibling}function cy(e,t,n){if(En&&typeof En.onCommitFiberUnmount=="function")try{En.onCommitFiberUnmount(dl,n)}catch{}switch(n.tag){case 5:ht||go(n,t);case 6:var r=st,o=an;st=null,Hn(e,t,n),st=r,an=o,st!==null&&(an?(e=st,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):st.removeChild(n.stateNode));break;case 18:st!==null&&(an?(e=st,n=n.stateNode,e.nodeType===8?Su(e.parentNode,n):e.nodeType===1&&Su(e,n),Vi(e)):Su(st,n.stateNode));break;case 4:r=st,o=an,st=n.stateNode.containerInfo,an=!0,Hn(e,t,n),st=r,an=o;break;case 0:case 11:case 14:case 15:if(!ht&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Uc(n,t,s),o=o.next}while(o!==r)}Hn(e,t,n);break;case 1:if(!ht&&(go(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ue(n,t,a)}Hn(e,t,n);break;case 21:Hn(e,t,n);break;case 22:n.mode&1?(ht=(r=ht)||n.memoizedState!==null,Hn(e,t,n),ht=r):Hn(e,t,n);break;default:Hn(e,t,n)}}function cm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Fb),t.forEach(function(r){var o=Vb.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function nn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:st=a.stateNode,an=!1;break e;case 3:st=a.stateNode.containerInfo,an=!0;break e;case 4:st=a.stateNode.containerInfo,an=!0;break e}a=a.return}if(st===null)throw Error(X(160));cy(i,s,o),st=null,an=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Ue(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)dy(t,e),t=t.sibling}function dy(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(nn(t,e),gn(e),r&4){try{Pi(3,e,e.return),wl(3,e)}catch(g){Ue(e,e.return,g)}try{Pi(5,e,e.return)}catch(g){Ue(e,e.return,g)}}break;case 1:nn(t,e),gn(e),r&512&&n!==null&&go(n,n.return);break;case 5:if(nn(t,e),gn(e),r&512&&n!==null&&go(n,n.return),e.flags&32){var o=e.stateNode;try{Li(o,"")}catch(g){Ue(e,e.return,g)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Mg(o,i),vc(a,s);var u=vc(a,i);for(s=0;s<l.length;s+=2){var f=l[s],p=l[s+1];f==="style"?zg(o,p):f==="dangerouslySetInnerHTML"?Ng(o,p):f==="children"?Li(o,p):Rd(o,f,p,u)}switch(a){case"input":fc(o,i);break;case"textarea":$g(o,i);break;case"select":var m=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?bo(o,!!i.multiple,h,!1):m!==!!i.multiple&&(i.defaultValue!=null?bo(o,!!i.multiple,i.defaultValue,!0):bo(o,!!i.multiple,i.multiple?[]:"",!1))}o[Zi]=i}catch(g){Ue(e,e.return,g)}}break;case 6:if(nn(t,e),gn(e),r&4){if(e.stateNode===null)throw Error(X(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(g){Ue(e,e.return,g)}}break;case 3:if(nn(t,e),gn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Vi(t.containerInfo)}catch(g){Ue(e,e.return,g)}break;case 4:nn(t,e),gn(e);break;case 13:nn(t,e),gn(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(lf=He())),r&4&&cm(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(ht=(u=ht)||f,nn(t,e),ht=u):nn(t,e),gn(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(ne=e,f=e.child;f!==null;){for(p=ne=f;ne!==null;){switch(m=ne,h=m.child,m.tag){case 0:case 11:case 14:case 15:Pi(4,m,m.return);break;case 1:go(m,m.return);var y=m.stateNode;if(typeof y.componentWillUnmount=="function"){r=m,n=m.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(g){Ue(r,n,g)}}break;case 5:go(m,m.return);break;case 22:if(m.memoizedState!==null){fm(p);continue}}h!==null?(h.return=m,ne=h):fm(p)}f=f.sibling}e:for(f=null,p=e;;){if(p.tag===5){if(f===null){f=p;try{o=p.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=p.stateNode,l=p.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Lg("display",s))}catch(g){Ue(e,e.return,g)}}}else if(p.tag===6){if(f===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(g){Ue(e,e.return,g)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;f===p&&(f=null),p=p.return}f===p&&(f=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:nn(t,e),gn(e),r&4&&cm(e);break;case 21:break;default:nn(t,e),gn(e)}}function gn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(uy(n)){var r=n;break e}n=n.return}throw Error(X(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Li(o,""),r.flags&=-33);var i=um(e);Yc(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=um(e);Zc(e,a,s);break;default:throw Error(X(161))}}catch(l){Ue(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mb(e,t,n){ne=e,fy(e)}function fy(e,t,n){for(var r=(e.mode&1)!==0;ne!==null;){var o=ne,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Vs;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||ht;a=Vs;var u=ht;if(Vs=s,(ht=l)&&!u)for(ne=o;ne!==null;)s=ne,l=s.child,s.tag===22&&s.memoizedState!==null?pm(o):l!==null?(l.return=s,ne=l):pm(o);for(;i!==null;)ne=i,fy(i),i=i.sibling;ne=o,Vs=a,ht=u}dm(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,ne=i):dm(e)}}function dm(e){for(;ne!==null;){var t=ne;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ht||wl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ht)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:sn(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Xp(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Xp(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var f=u.memoizedState;if(f!==null){var p=f.dehydrated;p!==null&&Vi(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(X(163))}ht||t.flags&512&&Hc(t)}catch(m){Ue(t,t.return,m)}}if(t===e){ne=null;break}if(n=t.sibling,n!==null){n.return=t.return,ne=n;break}ne=t.return}}function fm(e){for(;ne!==null;){var t=ne;if(t===e){ne=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ne=n;break}ne=t.return}}function pm(e){for(;ne!==null;){var t=ne;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{wl(4,t)}catch(l){Ue(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Ue(t,o,l)}}var i=t.return;try{Hc(t)}catch(l){Ue(t,i,l)}break;case 5:var s=t.return;try{Hc(t)}catch(l){Ue(t,s,l)}}}catch(l){Ue(t,t.return,l)}if(t===e){ne=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ne=a;break}ne=t.return}}var $b=Math.ceil,Za=Vn.ReactCurrentDispatcher,sf=Vn.ReactCurrentOwner,Qt=Vn.ReactCurrentBatchConfig,ge=0,nt=null,Ke=null,at=0,Dt=0,vo=vr(0),Qe=0,Qi=null,Nr=0,xl=0,af=0,Fi=null,Rt=null,lf=0,No=1/0,_n=null,Ya=!1,Kc=null,ar=null,Bs=!1,tr=null,Ka=0,ji=0,Xc=null,xa=-1,ba=0;function wt(){return ge&6?He():xa!==-1?xa:xa=He()}function lr(e){return e.mode&1?ge&2&&at!==0?at&-at:vb.transition!==null?(ba===0&&(ba=Gg()),ba):(e=ke,e!==0||(e=window.event,e=e===void 0?16:rv(e.type)),e):1}function cn(e,t,n,r){if(50<ji)throw ji=0,Xc=null,Error(X(185));is(e,n,r),(!(ge&2)||e!==nt)&&(e===nt&&(!(ge&2)&&(xl|=n),Qe===4&&Qn(e,at)),jt(e,r),n===1&&ge===0&&!(t.mode&1)&&(No=He()+500,gl&&yr()))}function jt(e,t){var n=e.callbackNode;v1(e,t);var r=Fa(e,e===nt?at:0);if(r===0)n!==null&&Sp(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Sp(n),t===1)e.tag===0?gb(mm.bind(null,e)):Sv(mm.bind(null,e)),fb(function(){!(ge&6)&&yr()}),n=null;else{switch(qg(r)){case 1:n=Md;break;case 4:n=Kg;break;case 16:n=Pa;break;case 536870912:n=Xg;break;default:n=Pa}n=xy(n,py.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function py(e,t){if(xa=-1,ba=0,ge&6)throw Error(X(327));var n=e.callbackNode;if(Io()&&e.callbackNode!==n)return null;var r=Fa(e,e===nt?at:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Xa(e,r);else{t=r;var o=ge;ge|=2;var i=hy();(nt!==e||at!==t)&&(_n=null,No=He()+500,Fr(e,t));do try{Lb();break}catch(a){my(e,a)}while(!0);Zd(),Za.current=i,ge=o,Ke!==null?t=0:(nt=null,at=0,t=Qe)}if(t!==0){if(t===2&&(o=Sc(e),o!==0&&(r=o,t=Gc(e,o))),t===1)throw n=Qi,Fr(e,0),Qn(e,r),jt(e,He()),n;if(t===6)Qn(e,r);else{if(o=e.current.alternate,!(r&30)&&!Ab(o)&&(t=Xa(e,r),t===2&&(i=Sc(e),i!==0&&(r=i,t=Gc(e,i))),t===1))throw n=Qi,Fr(e,0),Qn(e,r),jt(e,He()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(X(345));case 2:Cr(e,Rt,_n);break;case 3:if(Qn(e,r),(r&130023424)===r&&(t=lf+500-He(),10<t)){if(Fa(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){wt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Pc(Cr.bind(null,e,Rt,_n),t);break}Cr(e,Rt,_n);break;case 4:if(Qn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-un(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=He()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*$b(r/1960))-r,10<r){e.timeoutHandle=Pc(Cr.bind(null,e,Rt,_n),r);break}Cr(e,Rt,_n);break;case 5:Cr(e,Rt,_n);break;default:throw Error(X(329))}}}return jt(e,He()),e.callbackNode===n?py.bind(null,e):null}function Gc(e,t){var n=Fi;return e.current.memoizedState.isDehydrated&&(Fr(e,t).flags|=256),e=Xa(e,t),e!==2&&(t=Rt,Rt=n,t!==null&&qc(t)),e}function qc(e){Rt===null?Rt=e:Rt.push.apply(Rt,e)}function Ab(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!fn(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Qn(e,t){for(t&=~af,t&=~xl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-un(t),r=1<<n;e[n]=-1,t&=~r}}function mm(e){if(ge&6)throw Error(X(327));Io();var t=Fa(e,0);if(!(t&1))return jt(e,He()),null;var n=Xa(e,t);if(e.tag!==0&&n===2){var r=Sc(e);r!==0&&(t=r,n=Gc(e,r))}if(n===1)throw n=Qi,Fr(e,0),Qn(e,t),jt(e,He()),n;if(n===6)throw Error(X(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Cr(e,Rt,_n),jt(e,He()),null}function uf(e,t){var n=ge;ge|=1;try{return e(t)}finally{ge=n,ge===0&&(No=He()+500,gl&&yr())}}function Lr(e){tr!==null&&tr.tag===0&&!(ge&6)&&Io();var t=ge;ge|=1;var n=Qt.transition,r=ke;try{if(Qt.transition=null,ke=1,e)return e()}finally{ke=r,Qt.transition=n,ge=t,!(ge&6)&&yr()}}function cf(){Dt=vo.current,je(vo)}function Fr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,db(n)),Ke!==null)for(n=Ke.return;n!==null;){var r=n;switch(Wd(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Na();break;case 3:$o(),je(Pt),je(vt),Qd();break;case 5:qd(r);break;case 4:$o();break;case 13:je(ze);break;case 19:je(ze);break;case 10:Yd(r.type._context);break;case 22:case 23:cf()}n=n.return}if(nt=e,Ke=e=ur(e.current,null),at=Dt=t,Qe=0,Qi=null,af=xl=Nr=0,Rt=Fi=null,Tr!==null){for(t=0;t<Tr.length;t++)if(n=Tr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}Tr=null}return e}function my(e,t){do{var n=Ke;try{if(Zd(),va.current=Ha,Ua){for(var r=De.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Ua=!1}if(Ar=0,tt=qe=De=null,_i=!1,Xi=0,sf.current=null,n===null||n.return===null){Qe=1,Qi=t,Ke=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=at,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,f=a,p=f.tag;if(!(f.mode&1)&&(p===0||p===11||p===15)){var m=f.alternate;m?(f.updateQueue=m.updateQueue,f.memoizedState=m.memoizedState,f.lanes=m.lanes):(f.updateQueue=null,f.memoizedState=null)}var h=tm(s);if(h!==null){h.flags&=-257,nm(h,s,a,i,t),h.mode&1&&em(i,u,t),t=h,l=u;var y=t.updateQueue;if(y===null){var g=new Set;g.add(l),t.updateQueue=g}else y.add(l);break e}else{if(!(t&1)){em(i,u,t),df();break e}l=Error(X(426))}}else if(Ae&&a.mode&1){var S=tm(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),nm(S,s,a,i,t),Ud(Ao(l,a));break e}}i=l=Ao(l,a),Qe!==4&&(Qe=2),Fi===null?Fi=[i]:Fi.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var v=qv(i,l,t);Kp(i,v);break e;case 1:a=l;var w=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof w.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ar===null||!ar.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=Qv(i,a,t);Kp(i,b);break e}}i=i.return}while(i!==null)}vy(n)}catch(k){t=k,Ke===n&&n!==null&&(Ke=n=n.return);continue}break}while(!0)}function hy(){var e=Za.current;return Za.current=Ha,e===null?Ha:e}function df(){(Qe===0||Qe===3||Qe===2)&&(Qe=4),nt===null||!(Nr&268435455)&&!(xl&268435455)||Qn(nt,at)}function Xa(e,t){var n=ge;ge|=2;var r=hy();(nt!==e||at!==t)&&(_n=null,Fr(e,t));do try{Nb();break}catch(o){my(e,o)}while(!0);if(Zd(),ge=n,Za.current=r,Ke!==null)throw Error(X(261));return nt=null,at=0,Qe}function Nb(){for(;Ke!==null;)gy(Ke)}function Lb(){for(;Ke!==null&&!l1();)gy(Ke)}function gy(e){var t=wy(e.alternate,e,Dt);e.memoizedProps=e.pendingProps,t===null?vy(e):Ke=t,sf.current=null}function vy(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Pb(n,t),n!==null){n.flags&=32767,Ke=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Qe=6,Ke=null;return}}else if(n=_b(n,t,Dt),n!==null){Ke=n;return}if(t=t.sibling,t!==null){Ke=t;return}Ke=t=e}while(t!==null);Qe===0&&(Qe=5)}function Cr(e,t,n){var r=ke,o=Qt.transition;try{Qt.transition=null,ke=1,zb(e,t,n,r)}finally{Qt.transition=o,ke=r}return null}function zb(e,t,n,r){do Io();while(tr!==null);if(ge&6)throw Error(X(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(X(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(y1(e,i),e===nt&&(Ke=nt=null,at=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Bs||(Bs=!0,xy(Pa,function(){return Io(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Qt.transition,Qt.transition=null;var s=ke;ke=1;var a=ge;ge|=4,sf.current=null,jb(e,n),dy(n,e),ob(Rc),ja=!!Tc,Rc=Tc=null,e.current=n,Mb(n),u1(),ge=a,ke=s,Qt.transition=i}else e.current=n;if(Bs&&(Bs=!1,tr=e,Ka=o),i=e.pendingLanes,i===0&&(ar=null),f1(n.stateNode),jt(e,He()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Ya)throw Ya=!1,e=Kc,Kc=null,e;return Ka&1&&e.tag!==0&&Io(),i=e.pendingLanes,i&1?e===Xc?ji++:(ji=0,Xc=e):ji=0,yr(),null}function Io(){if(tr!==null){var e=qg(Ka),t=Qt.transition,n=ke;try{if(Qt.transition=null,ke=16>e?16:e,tr===null)var r=!1;else{if(e=tr,tr=null,Ka=0,ge&6)throw Error(X(331));var o=ge;for(ge|=4,ne=e.current;ne!==null;){var i=ne,s=i.child;if(ne.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(ne=u;ne!==null;){var f=ne;switch(f.tag){case 0:case 11:case 15:Pi(8,f,i)}var p=f.child;if(p!==null)p.return=f,ne=p;else for(;ne!==null;){f=ne;var m=f.sibling,h=f.return;if(ly(f),f===u){ne=null;break}if(m!==null){m.return=h,ne=m;break}ne=h}}}var y=i.alternate;if(y!==null){var g=y.child;if(g!==null){y.child=null;do{var S=g.sibling;g.sibling=null,g=S}while(g!==null)}}ne=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,ne=s;else e:for(;ne!==null;){if(i=ne,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Pi(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,ne=v;break e}ne=i.return}}var w=e.current;for(ne=w;ne!==null;){s=ne;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,ne=x;else e:for(s=w;ne!==null;){if(a=ne,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:wl(9,a)}}catch(k){Ue(a,a.return,k)}if(a===s){ne=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,ne=b;break e}ne=a.return}}if(ge=o,yr(),En&&typeof En.onPostCommitFiberRoot=="function")try{En.onPostCommitFiberRoot(dl,e)}catch{}r=!0}return r}finally{ke=n,Qt.transition=t}}return!1}function hm(e,t,n){t=Ao(n,t),t=qv(e,t,1),e=sr(e,t,1),t=wt(),e!==null&&(is(e,1,t),jt(e,t))}function Ue(e,t,n){if(e.tag===3)hm(e,e,n);else for(;t!==null;){if(t.tag===3){hm(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ar===null||!ar.has(r))){e=Ao(n,e),e=Qv(t,e,1),t=sr(t,e,1),e=wt(),t!==null&&(is(t,1,e),jt(t,e));break}}t=t.return}}function Db(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=wt(),e.pingedLanes|=e.suspendedLanes&n,nt===e&&(at&n)===n&&(Qe===4||Qe===3&&(at&130023424)===at&&500>He()-lf?Fr(e,0):af|=n),jt(e,t)}function yy(e,t){t===0&&(e.mode&1?(t=js,js<<=1,!(js&130023424)&&(js=4194304)):t=1);var n=wt();e=zn(e,t),e!==null&&(is(e,t,n),jt(e,n))}function Ob(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),yy(e,n)}function Vb(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(X(314))}r!==null&&r.delete(t),yy(e,n)}var wy;wy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Pt.current)_t=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return _t=!1,Rb(e,t,n);_t=!!(e.flags&131072)}else _t=!1,Ae&&t.flags&1048576&&Ev(t,Da,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;wa(e,t),e=t.pendingProps;var o=Fo(t,vt.current);Co(t,n),o=ef(null,t,r,e,o,n);var i=tf();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ft(r)?(i=!0,La(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Xd(t),o.updater=yl,t.stateNode=o,o._reactInternals=t,Lc(t,r,e,n),t=Oc(null,t,r,!0,i,n)):(t.tag=0,Ae&&i&&Bd(t),yt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(wa(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Wb(r),e=sn(r,e),o){case 0:t=Dc(null,t,r,e,n);break e;case 1:t=im(null,t,r,e,n);break e;case 11:t=rm(null,t,r,e,n);break e;case 14:t=om(null,t,r,sn(r.type,e),n);break e}throw Error(X(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),Dc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),im(e,t,r,o,n);case 3:e:{if(ny(t),e===null)throw Error(X(387));r=t.pendingProps,i=t.memoizedState,o=i.element,_v(e,t),Ba(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Ao(Error(X(423)),t),t=sm(e,t,r,n,o);break e}else if(r!==o){o=Ao(Error(X(424)),t),t=sm(e,t,r,n,o);break e}else for(Ot=ir(t.stateNode.containerInfo.firstChild),Vt=t,Ae=!0,ln=null,n=Tv(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(jo(),r===o){t=Dn(e,t,n);break e}yt(e,t,r,n)}t=t.child}return t;case 5:return Pv(t),e===null&&$c(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,_c(r,o)?s=null:i!==null&&_c(r,i)&&(t.flags|=32),ty(e,t),yt(e,t,s,n),t.child;case 6:return e===null&&$c(t),null;case 13:return ry(e,t,n);case 4:return Gd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Mo(t,null,r,n):yt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),rm(e,t,r,o,n);case 7:return yt(e,t,t.pendingProps,n),t.child;case 8:return yt(e,t,t.pendingProps.children,n),t.child;case 12:return yt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,_e(Oa,r._currentValue),r._currentValue=s,i!==null)if(fn(i.value,s)){if(i.children===o.children&&!Pt.current){t=Dn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=An(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Ac(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(X(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Ac(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}yt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Co(t,n),o=Jt(o),r=r(o),t.flags|=1,yt(e,t,r,n),t.child;case 14:return r=t.type,o=sn(r,t.pendingProps),o=sn(r.type,o),om(e,t,r,o,n);case 15:return Jv(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),wa(e,t),t.tag=1,Ft(r)?(e=!0,La(t)):e=!1,Co(t,n),Gv(t,r,o),Lc(t,r,o,n),Oc(null,t,r,!0,e,n);case 19:return oy(e,t,n);case 22:return ey(e,t,n)}throw Error(X(156,t.tag))};function xy(e,t){return Yg(e,t)}function Bb(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qt(e,t,n,r){return new Bb(e,t,n,r)}function ff(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wb(e){if(typeof e=="function")return ff(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Pd)return 11;if(e===Fd)return 14}return 2}function ur(e,t){var n=e.alternate;return n===null?(n=qt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Sa(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")ff(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case so:return jr(n.children,o,i,t);case _d:s=8,o|=8;break;case ac:return e=qt(12,n,t,o|2),e.elementType=ac,e.lanes=i,e;case lc:return e=qt(13,n,t,o),e.elementType=lc,e.lanes=i,e;case uc:return e=qt(19,n,t,o),e.elementType=uc,e.lanes=i,e;case Pg:return bl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Rg:s=10;break e;case _g:s=9;break e;case Pd:s=11;break e;case Fd:s=14;break e;case Xn:s=16,r=null;break e}throw Error(X(130,e==null?e:typeof e,""))}return t=qt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function jr(e,t,n,r){return e=qt(7,e,r,t),e.lanes=n,e}function bl(e,t,n,r){return e=qt(22,e,r,t),e.elementType=Pg,e.lanes=n,e.stateNode={isHidden:!1},e}function Pu(e,t,n){return e=qt(6,e,null,t),e.lanes=n,e}function Fu(e,t,n){return t=qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ub(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=du(0),this.expirationTimes=du(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=du(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function pf(e,t,n,r,o,i,s,a,l){return e=new Ub(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=qt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xd(i),e}function Hb(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:io,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function by(e){if(!e)return fr;e=e._reactInternals;e:{if(Br(e)!==e||e.tag!==1)throw Error(X(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ft(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(X(171))}if(e.tag===1){var n=e.type;if(Ft(n))return bv(e,n,t)}return t}function Sy(e,t,n,r,o,i,s,a,l){return e=pf(n,r,!0,e,o,i,s,a,l),e.context=by(null),n=e.current,r=wt(),o=lr(n),i=An(r,o),i.callback=t??null,sr(n,i,o),e.current.lanes=o,is(e,o,r),jt(e,r),e}function Sl(e,t,n,r){var o=t.current,i=wt(),s=lr(o);return n=by(n),t.context===null?t.context=n:t.pendingContext=n,t=An(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=sr(o,t,s),e!==null&&(cn(e,o,s,i),ga(e,o,s)),s}function Ga(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function gm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mf(e,t){gm(e,t),(e=e.alternate)&&gm(e,t)}function Zb(){return null}var Ey=typeof reportError=="function"?reportError:function(e){console.error(e)};function hf(e){this._internalRoot=e}El.prototype.render=hf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(X(409));Sl(e,t,null,null)};El.prototype.unmount=hf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Lr(function(){Sl(null,e,null,null)}),t[Ln]=null}};function El(e){this._internalRoot=e}El.prototype.unstable_scheduleHydration=function(e){if(e){var t=ev();e={blockedOn:null,target:e,priority:t};for(var n=0;n<qn.length&&t!==0&&t<qn[n].priority;n++);qn.splice(n,0,e),n===0&&nv(e)}};function gf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function kl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function vm(){}function Yb(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=Ga(s);i.call(u)}}var s=Sy(t,r,e,0,null,!1,!1,"",vm);return e._reactRootContainer=s,e[Ln]=s.current,Ui(e.nodeType===8?e.parentNode:e),Lr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var u=Ga(l);a.call(u)}}var l=pf(e,0,!1,null,null,!1,!1,"",vm);return e._reactRootContainer=l,e[Ln]=l.current,Ui(e.nodeType===8?e.parentNode:e),Lr(function(){Sl(t,l,n,r)}),l}function Cl(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=Ga(s);a.call(l)}}Sl(t,s,e,o)}else s=Yb(n,t,e,o,r);return Ga(s)}Qg=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=xi(t.pendingLanes);n!==0&&($d(t,n|1),jt(t,He()),!(ge&6)&&(No=He()+500,yr()))}break;case 13:Lr(function(){var r=zn(e,1);if(r!==null){var o=wt();cn(r,e,1,o)}}),mf(e,1)}};Ad=function(e){if(e.tag===13){var t=zn(e,134217728);if(t!==null){var n=wt();cn(t,e,134217728,n)}mf(e,134217728)}};Jg=function(e){if(e.tag===13){var t=lr(e),n=zn(e,t);if(n!==null){var r=wt();cn(n,e,t,r)}mf(e,t)}};ev=function(){return ke};tv=function(e,t){var n=ke;try{return ke=e,t()}finally{ke=n}};wc=function(e,t,n){switch(t){case"input":if(fc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=hl(r);if(!o)throw Error(X(90));jg(r),fc(r,o)}}}break;case"textarea":$g(e,n);break;case"select":t=n.value,t!=null&&bo(e,!!n.multiple,t,!1)}};Vg=uf;Bg=Lr;var Kb={usingClientEntryPoint:!1,Events:[as,co,hl,Dg,Og,uf]},li={findFiberByHostInstance:Ir,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Xb={bundleType:li.bundleType,version:li.version,rendererPackageName:li.rendererPackageName,rendererConfig:li.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Vn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Hg(e),e===null?null:e.stateNode},findFiberByHostInstance:li.findFiberByHostInstance||Zb,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ws=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ws.isDisabled&&Ws.supportsFiber)try{dl=Ws.inject(Xb),En=Ws}catch{}}Wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Kb;Wt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!gf(t))throw Error(X(200));return Hb(e,t,null,n)};Wt.createRoot=function(e,t){if(!gf(e))throw Error(X(299));var n=!1,r="",o=Ey;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=pf(e,1,!1,null,null,n,!1,r,o),e[Ln]=t.current,Ui(e.nodeType===8?e.parentNode:e),new hf(t)};Wt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(X(188)):(e=Object.keys(e).join(","),Error(X(268,e)));return e=Hg(t),e=e===null?null:e.stateNode,e};Wt.flushSync=function(e){return Lr(e)};Wt.hydrate=function(e,t,n){if(!kl(t))throw Error(X(200));return Cl(null,e,t,!0,n)};Wt.hydrateRoot=function(e,t,n){if(!gf(e))throw Error(X(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=Ey;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Sy(t,null,e,1,n??null,o,!1,i,s),e[Ln]=t.current,Ui(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new El(t)};Wt.render=function(e,t,n){if(!kl(t))throw Error(X(200));return Cl(null,e,t,!1,n)};Wt.unmountComponentAtNode=function(e){if(!kl(e))throw Error(X(40));return e._reactRootContainer?(Lr(function(){Cl(null,null,e,!1,function(){e._reactRootContainer=null,e[Ln]=null})}),!0):!1};Wt.unstable_batchedUpdates=uf;Wt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!kl(n))throw Error(X(200));if(e==null||e._reactInternals===void 0)throw Error(X(38));return Cl(e,t,n,!1,r)};Wt.version="18.3.1-next-f1338f8080-20240426";function ky(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ky)}catch(e){console.error(e)}}ky(),kg.exports=Wt;var Qc=kg.exports,ym=Qc;ic.createRoot=ym.createRoot,ic.hydrateRoot=ym.hydrateRoot;var Gb=Object.defineProperty,Cy=(e,t)=>{for(var n in t)Gb(e,n,{get:t[n],enumerable:!0,configurable:!0,set:r=>t[n]=()=>r})};if(typeof c.createContext!="function"){const e=['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(e.join(`
|
|
41
|
+
`))}var Wr=c.createContext(!1),Jc=({children:e})=>d.jsx(Wr.Provider,{value:!0,children:e}),Iy=c.createContext({setError:()=>{},clearError:()=>{}}),wm=()=>{try{return typeof __webpack_module__>"u"?null:__webpack_module__.hot??null}catch{return null}};class qb extends J.Component{constructor(){super(...arguments);Ie(this,"state",{hasError:!1});Ie(this,"hmrStatusHandler",null)}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){this.props.onError(n),this.subscribeToHmrReset()}componentDidMount(){this.state.hasError||this.props.onClear()}componentDidUpdate(n,r){r.hasError&&!this.state.hasError&&this.props.onClear()}componentWillUnmount(){this.unsubscribeFromHmrReset()}subscribeToHmrReset(){if(this.hmrStatusHandler)return;const n=wm();if(!n)return;const r=o=>{o==="idle"&&(this.unsubscribeFromHmrReset(),this.setState({hasError:!1}))};this.hmrStatusHandler=r,n.addStatusHandler(r)}unsubscribeFromHmrReset(){const n=this.hmrStatusHandler;if(!n)return;this.hmrStatusHandler=null;const r=wm();r&&r.removeStatusHandler(n)}render(){return this.state.hasError?null:this.props.children}}var Bo=c.createContext({compositions:[],folders:[],currentCompositionMetadata:null,canvasContent:null}),us=c.createContext({registerComposition:()=>{},unregisterComposition:()=>{},registerFolder:()=>{},unregisterFolder:()=>{},setCanvasContent:()=>{},onlyRenderComposition:null}),cs=c.createContext({getNonce:()=>0}),Ea=0;try{typeof __webpack_module__<"u"&&__webpack_module__.hot&&__webpack_module__.hot.addStatusHandler(e=>{e==="idle"&&Ea++})}catch{}var Il=()=>{const t=c.useContext(cs).getNonce(),n=c.useRef(t);n.current=t;const r=c.useRef([[Ea,t]]),o=c.useCallback(()=>(Ea!==r.current[r.current.length-1][0]&&(r.current=[...r.current,[Ea,n.current]]),r.current),[r]);return c.useMemo(()=>({get:o}),[o])};function Wo(e){return!!e}var Ty=()=>/^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g,Ry=e=>e.match(Ty()),Qb=e=>{if(e==null)throw new TypeError("You must pass a name to a <Folder />.");if(typeof e!="string")throw new TypeError(`The "name" you pass into <Folder /> must be a string. Got: ${typeof e}`);if(!Ry(e))throw new Error(`Folder name can only contain a-z, A-Z, 0-9 and -. You passed ${e}`)},Jb=`Folder name must match ${String(Ty())}`,ed=c.createContext({folderName:null,parentName:null}),eS=e=>{const{name:t,children:n}=e,r=c.useContext(ed),{registerFolder:o,unregisterFolder:i}=c.useContext(us),s=Il(),a=e.stack??null;Qb(t);const l=[r.parentName,r.folderName].filter(Wo),u=l.length===0?null:l.join("/"),f=c.useMemo(()=>({folderName:t,parentName:u}),[t,u]);return c.useEffect(()=>(o(t,u,s.get(),a),()=>{i(t,u)}),[t,r.folderName,u,o,i,s,a]),d.jsx(ed.Provider,{value:f,children:n})};function xm(){return["NOD","E_EN","V"].join("")}var bm=()=>["e","nv"].join(""),bn=()=>{const e=typeof window<"u"&&window.remotion_isPlayer,t=typeof window<"u"&&typeof window.process<"u"&&typeof window.process.env<"u"&&(window.process[bm()][xm()]==="test"||window.process[bm()][xm()]==="production"&&typeof window<"u"&&typeof window.remotion_puppeteerTimeout<"u"),n=typeof window<"u"&&window.remotion_isStudio,r=typeof window<"u"&&window.remotion_isReadOnlyStudio;return{isStudio:n,isRendering:t,isPlayer:e,isReadOnlyStudio:r,isClientSideRendering:!1}},td="remotion-date:",Ji="remotion-file:",tS=({data:e,indent:t,staticBase:n})=>{let r=!1,o=!1,i=!1,s=!1;try{return{serializedString:JSON.stringify(e,function(l,u){const f=this[l];return f instanceof Date?(r=!0,`${td}${f.toISOString()}`):f instanceof Map?(i=!0,u):f instanceof Set?(s=!0,u):typeof f=="string"&&n!==null&&f.startsWith(n)?(o=!0,`${Ji}${f.replace(n+"/","")}`):u},t),customDateUsed:r,customFileUsed:o,mapUsed:i,setUsed:s}}catch(a){throw new Error("Could not serialize the passed input props to JSON: "+a.message)}},_y=e=>JSON.parse(e,(t,n)=>typeof n=="string"&&n.startsWith(td)?new Date(n.replace(td,"")):typeof n=="string"&&n.startsWith(Ji)?`${window.remotion_staticBase}/${n.replace(Ji,"")}`:n),nS=e=>_y(tS({data:e,indent:2,staticBase:window.remotion_staticBase}).serializedString),nd=e=>bn().isStudio?nS(e):e,Py=c.createContext(!1),rS=({children:e})=>d.jsx(Py.Provider,{value:!0,children:e}),vf=()=>c.useContext(Py),Zn=({className:e,classPrefix:t,type:n})=>{if(!e)return!1;if(n==="exact"){const r=e.split(" ");return t.some(o=>r.some(i=>i.trim()===o||i.trim().endsWith(`:${o}`)||i.trim().endsWith(`!${o}`)))}return t.some(r=>e.startsWith(r)||e.includes(` ${r}`)||e.includes(`!${r}`)||e.includes(`:${r}`))},oS=(e,t)=>{const{style:n,...r}=e,o=c.useMemo(()=>({position:"absolute",top:Zn({className:r.className,classPrefix:["top-","inset-"],type:"prefix"})?void 0:0,left:Zn({className:r.className,classPrefix:["left-","inset-"],type:"prefix"})?void 0:0,right:Zn({className:r.className,classPrefix:["right-","inset-"],type:"prefix"})?void 0:0,bottom:Zn({className:r.className,classPrefix:["bottom-","inset-"],type:"prefix"})?void 0:0,width:Zn({className:r.className,classPrefix:["w-"],type:"prefix"})?void 0:"100%",height:Zn({className:r.className,classPrefix:["h-"],type:"prefix"})?void 0:"100%",display:Zn({className:r.className,classPrefix:["block","inline-block","inline","flex","inline-flex","flow-root","grid","inline-grid","contents","list-item","hidden"],type:"exact"})?void 0:"flex",flexDirection:Zn({className:r.className,classPrefix:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"],type:"exact"})?void 0:"column",...n}),[r.className,n]);return d.jsx("div",{ref:t,style:o,...r})},pn=c.forwardRef(oS),iS={transform:"rotate(90deg)"},Sm=40,sS={color:"white",fontSize:14,fontFamily:"sans-serif"},aS={justifyContent:"center",alignItems:"center"},lS=()=>d.jsxs(pn,{style:aS,id:"remotion-comp-loading",children:[d.jsx("style",{type:"text/css",children:`
|
|
42
42
|
@keyframes anim {
|
|
43
43
|
from {
|
|
44
44
|
opacity: 0
|
|
@@ -51,10 +51,10 @@ Error generating stack: `+i.message+`
|
|
|
51
51
|
animation: anim 2s;
|
|
52
52
|
animation-fill-mode: forwards;
|
|
53
53
|
}
|
|
54
|
-
`}),d.jsx("svg",{width:Sm,height:Sm,viewBox:"-100 -100 400 400",style:iS,children:d.jsx("path",{fill:"#555",stroke:"#555",strokeWidth:"100",strokeLinejoin:"round",d:"M 2 172 a 196 100 0 0 0 195 5 A 196 240 0 0 0 100 2.259 A 196 240 0 0 0 2 172 z"})}),d.jsxs("p",{style:sS,children:["Resolving ","<Suspense>","..."]})]}),Nt=null,rd=()=>{if(!Nt){if(typeof document>"u")throw new Error("Tried to call an API that only works in the browser from outside the browser");Nt=document.createElement("div"),Nt.style.position="absolute",Nt.style.top="0px",Nt.style.left="0px",Nt.style.right="0px",Nt.style.bottom="0px",Nt.style.width="100%",Nt.style.height="100%",Nt.style.display="flex",Nt.style.flexDirection="column";const e=document.createElement("div");e.style.position="fixed",e.style.top="-999999px",e.appendChild(Nt),document.body.appendChild(e)}return Nt},od=()=>"remotion_inputPropsOverride"+window.location.origin,Fy=()=>{if(typeof localStorage>"u")return null;const e=localStorage.getItem(od());return e?JSON.parse(e):null},uS=e=>{if(!(typeof localStorage>"u")){if(e===null){localStorage.removeItem(od());return}localStorage.setItem(od(),JSON.stringify(e))}},Em=!1,cS=()=>{Em||(Em=!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()"))},dS=()=>{if(typeof window>"u")return cS(),{};if(
|
|
55
|
-
${t}`},hS=e=>e instanceof Error?!0:!(e===null||typeof e!="object"||!("stack"in e)||typeof e.stack!="string"||!("message"in e)||typeof e.message!="string");function xf(e,t){let n;throw hS(t)?(n=t,n.stack||(n.stack=new Error(n.message).stack)):typeof t=="string"?n=Error(t):n=Error("Rendering was cancelled"),e&&(e.remotion_cancelledError=$y(n)),n}function es(e){return xf(typeof window<"u"?window:void 0,e)}var gS=["trace","verbose","info","warn","error"],km=e=>gS.indexOf(e),Pl=(e,t)=>km(e)<=km(t),ds=({args:e,logLevel:t,tag:n})=>{const r=[...e];return
|
|
56
|
-
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.`)}e()},et=c.createContext(null),id={};Cy(id,{useTimelineSetFrame:()=>Yy,useTimelinePosition:()=>xr,useTimelineContext:()=>wr,usePlayingState:()=>Ky,usePlaybackRate:()=>kf,useAbsoluteTimelinePosition:()=>Zy,persistCurrentFrame:()=>Vy,getInitialFrameState:()=>By,getFrameForComposition:()=>Wy,clampFrameToCompositionRange:()=>Uy});function Cm(e){let t=e+1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function DS(e){let t=0,n=0,r=0;for(t=0;t<e.length;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r|=0;return r}var Hr=(e,t)=>{if(e===null)return Math.random();if(typeof e=="string")return Cm(DS(e));if(typeof e=="number")return Cm(e*1e10);throw new Error("random() argument must be a number or a string")},Uo=c.createContext({setFrame:()=>{throw new Error("default")},setPlaying:()=>{throw new Error("default")}}),Ho=c.createContext(null),bf=c.createContext(null),Sf=c.createContext(null),OS=({children:e,frameState:t})=>{const[n,r]=c.useState(!1),o=c.useRef(!1),[i,s]=c.useState(1),a=c.useRef([]),[l]=c.useState(()=>String(Hr(null))),[u,f]=c.useState(()=>By()),p=t??u,{delayRender:m,continueRender:h}=pn();typeof window<"u"&&c.useLayoutEffect(()=>{window.remotion_setFrame=(g,y,x)=>{window.remotion_attempt=x;const b=m(`Setting the current frame to ${g}`);let k=!0;f(E=>(E[y]??window.remotion_initialFrame)===g?(k=!1,E):{...E,[y]:g}),k?requestAnimationFrame(()=>h(b)):h(b)},window.remotion_isPlayer=!1},[h,m]);const w=c.useMemo(()=>({frame:p,playing:n,imperativePlaying:o,rootId:l,audioAndVideoTags:a}),[p,n,l]),v=c.useMemo(()=>({playbackRate:i,setPlaybackRate:s}),[i]),S=c.useMemo(()=>({setFrame:f,setPlaying:r}),[]);return d.jsx(Sf.Provider,{value:w,children:d.jsx(bf.Provider,{value:v,children:d.jsx(Ho.Provider,{value:w,children:d.jsx(Uo.Provider,{value:S,children:e})})})})},Ef=()=>"remotion.time-all",Vy=e=>{localStorage.setItem(Ef(),JSON.stringify(e))},By=()=>{const e=localStorage.getItem(Ef())??"{}";return JSON.parse(e)},Wy=e=>{const t=localStorage.getItem(Ef())??"{}",n=JSON.parse(t);return n[e]!==void 0?Number(n[e]):typeof window>"u"?0:window.remotion_initialFrame??0},Uy=(e,t)=>Math.max(0,Math.min(Math.max(0,t-1),e)),Hy=e=>{const t=Fl(),n=Ze();if(!t)return typeof window>"u"?0:window.remotion_initialFrame??0;const r=e.frame[t.id]??(n.isPlayer?0:Wy(t.id));return Uy(r,t.durationInFrames)},wr=()=>{const e=c.useContext(Ho);if(e===null)throw new Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return e},kf=()=>{const e=c.useContext(bf);if(e===null)throw new Error("PlaybackRateContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return e},xr=()=>{const e=wr();return Hy(e)},Zy=()=>{const e=c.useContext(Sf);if(e===null)throw new Error("AbsoluteTimeContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return Hy(e)},Yy=()=>{const{setFrame:e}=c.useContext(Uo);return e},Ky=()=>{const{playing:e,imperativePlaying:t}=wr(),{setPlaying:n}=c.useContext(Uo);return c.useMemo(()=>[e,n,t],[t,e,n])},ct=()=>{const e=c.useContext(Wr),t=Ze();if(!e)throw t.isPlayer?new Error("useCurrentFrame can only be called inside a component that was passed to <Player>. 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 n=xr(),r=c.useContext(et),o=r?r.cumulatedFrom+r.relativeFrom:0;return n-o},jl=()=>{const e=c.useContext(et),t=(e==null?void 0:e.width)??null,n=(e==null?void 0:e.height)??null,r=(e==null?void 0:e.durationInFrames)??null,o=Fl();return c.useMemo(()=>{if(!o)return null;const{id:i,durationInFrames:s,fps:a,height:l,width:u,defaultProps:f,props:p,defaultCodec:m,defaultOutName:h,defaultVideoImageFormat:w,defaultPixelFormat:v,defaultProResProfile:S,defaultSampleRate:g}=o;return{id:i,width:t??u,height:n??l,fps:a,durationInFrames:r??s,defaultProps:f,props:p,defaultCodec:m,defaultOutName:h,defaultVideoImageFormat:w,defaultPixelFormat:v,defaultProResProfile:S,defaultSampleRate:g}},[r,n,t,o])},Xe=()=>{const e=jl(),t=c.useContext(Wr),n=vf();if(!e)throw typeof window<"u"&&window.remotion_isPlayer||n?new Error(["No video config found. Likely reasons:","- You are probably calling useVideoConfig() from outside the component passed to <Player />. See https://www.remotion.dev/docs/player/examples for how to set up the Player correctly.","- You have multiple versions of Remotion installed which causes the React context to get lost."].join("-")):new Error("No video config found. You are probably calling useVideoConfig() from a component which has not been registered as a <Composition />. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions for more information.");if(!t)throw new Error("Called useVideoConfig() outside a Remotion composition.");return e},ps=({frame:e,children:t,active:n=!0})=>{const r=ct(),o=Xe();if(typeof e>"u")throw new Error("The <Freeze /> component requires a 'frame' prop, but none was passed.");if(typeof e!="number")throw new Error(`The 'frame' prop of <Freeze /> must be a number, but is of type ${typeof e}`);if(Number.isNaN(e))throw new Error("The 'frame' prop of <Freeze /> must be a real number, but it is NaN.");if(!Number.isFinite(e))throw new Error(`The 'frame' prop of <Freeze /> must be a finite number, but it is ${e}.`);const i=c.useMemo(()=>{if(typeof n=="boolean")return n;if(typeof n=="function")return n(r)},[n,r]),s=wr(),a=c.useContext(et),l=(a==null?void 0:a.relativeFrom)??0,u=c.useMemo(()=>i?{...s,playing:!1,imperativePlaying:{current:!1},frame:{[o.id]:e+l}}:s,[i,s,o.id,e,l]),f=c.useMemo(()=>a?i?{...a,cumulatedFrom:0}:a:null,[a,i]);return d.jsx(Ho.Provider,{value:u,children:d.jsx(et.Provider,{value:f,children:t})})},Tn={"style.transformOrigin":{type:"transform-origin",step:1,default:"50% 50%",description:"Transform origin"},"style.translate":{type:"translate",step:1,default:"0px 0px",description:"Offset"},"style.scale":{type:"scale",max:100,step:.01,default:1,description:"Scale",defaultKeyframeOutput:"perceptual-scale"},"style.rotate":{type:"rotation-css",step:1,default:"0deg",description:"Rotation"},"style.opacity":{type:"number",min:0,max:1,step:.01,default:1,description:"Opacity",hiddenFromList:!1}},VS=Tn,Ml={"style.color":{type:"color",default:void 0,description:"Color"},"style.fontFamily":{type:"font-family",default:void 0,description:"Font family",keyframable:!1},"style.fontSize":{type:"number",default:void 0,min:0,step:1,description:"Font size",hiddenFromList:!1},"style.lineHeight":{type:"number",default:void 0,min:0,step:.05,description:"Line height",hiddenFromList:!1},"style.fontWeight":{type:"enum",default:"400",description:"Font weight",variants:{100:{},200:{},300:{},400:{},500:{},600:{},700:{},800:{},900:{},normal:{},bold:{}}},"style.fontStyle":{type:"enum",default:"normal",description:"Font style",variants:{normal:{},italic:{},oblique:{}}},"style.textAlign":{type:"enum",default:"left",description:"Text align",variants:{left:{},center:{},right:{},justify:{},start:{},end:{}}},"style.letterSpacing":{type:"number",default:void 0,step:.1,description:"Letter spacing",hiddenFromList:!1}},br={"style.borderWidth":{type:"number",default:void 0,min:0,step:1,description:"Border width",hiddenFromList:!1},"style.borderStyle":{type:"enum",default:"none",description:"Border style",variants:{none:{},hidden:{},solid:{},dashed:{},dotted:{},double:{},groove:{},ridge:{},inset:{},outset:{}}},"style.borderColor":{type:"color",default:void 0,description:"Border color"}},Sr={"style.backgroundColor":{type:"color",default:"transparent",description:"Color"}},Xy={children:{type:"text-content",default:"",description:"Text",keyframable:!1}},Zo={premountFor:{type:"number",default:0,description:"Premount For",min:0,step:1,hiddenFromList:!1,keyframable:!1},postmountFor:{type:"number",default:0,min:0,step:1,hiddenFromList:!0,keyframable:!1}},Gy={...Zo},qy={...Tn,...Sr,...br,...Gy},Cf={type:"boolean",default:!1,description:"Hidden"},Qy={type:"hidden"},If={type:"hidden"},BS=e=>({name:If,...e}),Tf={type:"number",default:void 0,min:1,step:1,hiddenFromList:!0},Jy={type:"number",default:0,step:1,hiddenFromList:!0},e0={type:"number",default:0,min:0,step:1,hiddenFromList:!0},Rf={type:"number",default:null,step:1,hiddenFromList:!0},Bn={durationInFrames:Tf,from:Jy,trimBefore:e0,freeze:Rf,hidden:Cf,name:If,showInTimeline:Qy},Lo={...Bn,layout:{type:"enum",default:"absolute-fill",description:"Layout",variants:{"absolute-fill":qy,none:{}}}},WS={durationInFrames:Tf,trimBefore:e0,freeze:Rf,hidden:Cf,name:If,showInTimeline:Qy},US={...WS,layout:Lo.layout},HS={...Lo,layout:{...Lo.layout,default:"none"}},Yo=J.createContext({registerSequence:()=>{throw new Error("SequenceManagerContext not initialized")},unregisterSequence:()=>{throw new Error("SequenceManagerContext not initialized")},sequences:[]}),$l=J.createContext({current:[]}),Fn=e=>`${e.absolutePath}\0${e.nodePath.join(".")}\0${e.sequenceKeys.join(".")}\0${e.effectKeys.map(t=>t.join(".")).join(".")}`,Al=J.createContext({propStatuses:{}}),Nl=J.createContext({current:{}}),Ll=J.createContext({getDragOverrides:()=>{throw new Error("VisualModeDragOverridesContext not initialized")},getEffectDragOverrides:()=>{throw new Error("VisualModeDragOverridesContext not initialized")}}),t0=J.createContext({setDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},clearDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},setEffectDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},clearEffectDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},setPropStatuses:()=>{throw new Error("VisualModeSettersContext not initialized")}}),ju=(e,t)=>`${Fn(e)}.effects.${t}`,ZS=({children:e})=>{const[t,n]=c.useState([]),r=c.useRef(t);r.current=t;const[o,i]=c.useState({}),s=c.useRef(o);s.current=o;const[a,l]=c.useState({}),[u,f]=c.useState({}),p=c.useRef(u);p.current=u;const m=c.useCallback((_,$,M)=>{i(P=>({...P,[Fn(_)]:{...P[Fn(_)],[$]:M}}))},[]),h=c.useCallback(_=>{i($=>{const M=Fn(_);if(!$[M])return $;const P={...$};return delete P[M],P})},[]),w=c.useCallback((_,$,M,P)=>{l(D=>{const O=ju(_,$);return{...D,[O]:{...D[O],[M]:P}}})},[]),v=c.useCallback((_,$)=>{l(M=>{const P=ju(_,$);if(!M[P])return M;const D={...M};return delete D[P],D})},[]),S=c.useCallback((_,$)=>{f(M=>{const P=Fn(_),D=M[P],O=$(D);return D===O?M:{...M,[P]:O}})},[]),g=c.useCallback(_=>{n($=>[...$,_])},[]),y=c.useCallback(_=>{n($=>$.filter(M=>M.id!==_))},[]),x=c.useMemo(()=>({registerSequence:g,sequences:t,unregisterSequence:y}),[g,t,y]),b=c.useCallback(_=>o[Fn(_)]??{},[o]),k=c.useCallback((_,$)=>a[ju(_,$)]??{},[a]),E=c.useMemo(()=>({propStatuses:u}),[u]),I=c.useMemo(()=>({getDragOverrides:b,getEffectDragOverrides:k}),[b,k]),T=c.useMemo(()=>({setDragOverrides:m,clearDragOverrides:h,setEffectDragOverrides:w,clearEffectDragOverrides:v,setPropStatuses:S}),[m,h,w,v,S]);return d.jsx($l.Provider,{value:r,children:d.jsx(Yo.Provider,{value:x,children:d.jsx(Nl.Provider,{value:p,children:d.jsx(Al.Provider,{value:E,children:d.jsx(Ll.Provider,{value:I,children:d.jsx(t0.Provider,{value:T,children:e})})})})})})},zl=c.createContext(!1),YS=({children:e})=>d.jsx(zl.Provider,{value:!0,children:e}),n0=({children:e})=>d.jsx(zl.Provider,{value:!1,children:e}),KS=()=>{if(!J.useContext(zl))throw new Error("This component must be inside a <Series /> component.")},r0=c.createContext({premountFramesRemaining:0}),XS=!1,ms=e=>e??XS,hs=({from:e,durationInFrames:t,premountFor:n,postmountFor:r,style:o,styleWhilePremounted:i,styleWhilePostmounted:s,hideWhilePremounted:a})=>{const l=c.useContext(r0),u=ct()-l.premountFramesRemaining,f=Ze(),{fps:p}=Xe(),m=n??0,h=r??0,w=Math.ceil(e+t-1),v=!f.isRendering&&u<e&&u>=e-m,S=!f.isRendering&&u>w&&u<=w+h,g=v||S,y=v?e:S?e+t-1:0,x=c.useMemo(()=>g?{...o,...a==="opacity"?{opacity:0}:{display:"none"},pointerEvents:"none",...v?i:{},...S?s:{}}:o,[g,a,S,v,o,s,i]);return{effectivePremountFor:m,effectivePostmountFor:h,premountingActive:v,postmountingActive:S,isPremountingOrPostmounting:g,freezeFrame:y,premountingStyle:x}},GS=(e,t)=>{for(const n of t){const r=n.split("."),o=[e];let i=e;for(let s=0;s<r.length-1;s++){const a=r[s],l=i[a];if(l==null){i=null;break}i=l,o.push(i)}if(i!==null){delete i[r[r.length-1]];for(let s=o.length-1;s>0;s--){const a=o[s];if(Object.keys(a).length===0){const l=r[s-1];delete o[s-1][l]}else break}}}return e},qS=4,QS=.001,JS=1e-7,eE=10,Ei=11,Us=1/(Ei-1),tE=typeof Float32Array=="function";function o0(e,t){return 1-3*t+3*e}function i0(e,t){return 3*t-6*e}function s0(e){return 3*e}function Ja(e,t,n){return((o0(t,n)*e+i0(t,n))*e+s0(t))*e}function a0(e,t,n){return 3*o0(t,n)*e*e+2*i0(t,n)*e+s0(t)}function nE({aX:e,_aA:t,_aB:n,mX1:r,mX2:o}){let i,s,a=0,l=t,u=n;do s=l+(u-l)/2,i=Ja(s,r,o)-e,i>0?u=s:l=s;while(Math.abs(i)>JS&&++a<eE);return s}function rE(e,t,n,r){let o=t;for(let i=0;i<qS;++i){const s=a0(o,n,r);if(s===0)return o;const a=Ja(o,n,r)-e;o-=a/s}return o}function l0(e,t,n,r){if(!(e>=0&&e<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");const o=tE?new Float32Array(Ei):new Array(Ei);if(e!==t||n!==r)for(let s=0;s<Ei;++s)o[s]=Ja(s*Us,e,n);function i(s){let a=0,l=1;const u=Ei-1;for(;l!==u&&o[l]<=s;++l)a+=Us;--l;const f=(s-o[l])/(o[l+1]-o[l]),p=a+f*Us,m=a0(p,e,n);return m>=QS?rE(s,p,e,n):m===0?p:nE({aX:s,_aA:a,_aB:a+Us,mX1:e,mX2:n})}return function(s){const a=Math.min(1,Math.max(0,s));return e===t&&n===r?a:a===0?0:a===1?1:Ja(i(a),t,r)}}var oE=e=>Math.round(e*1e6)/1e6,iE=new Set(["deg","rad","grad","turn"]),u0=new Set(["%","cap","ch","cm","cqb","cqh","cqi","cqmax","cqmin","cqw","dvh","dvw","em","ex","ic","in","lh","lvh","lvw","mm","pc","pt","px","q","rem","rlh","svh","svw","vb","vh","vi","vmax","vmin","vw"]),c0=/^([+-]?(?:\d+\.?\d*|\.\d+))([a-zA-Z%]+)?$/,d0=new Set(["left","center","right","top","bottom"]),yo=e=>e==="left"?[{axis:"x",value:{value:0,unit:"%"}}]:e==="right"?[{axis:"x",value:{value:100,unit:"%"}}]:e==="top"?[{axis:"y",value:{value:0,unit:"%"}}]:e==="bottom"?[{axis:"y",value:{value:100,unit:"%"}}]:[{axis:"x",value:{value:50,unit:"%"}},{axis:"y",value:{value:50,unit:"%"}}],ui={value:50,unit:"%"},Im=e=>String(oE(e)),sE=(e,t)=>{const n=c0.exec(e);if(n===null)throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not a supported scale, translate, or rotate value`);const r=n[2]??null,o=Number(n[1]);if(!Number.isFinite(o))throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not finite`);if(r===null)return{kind:"scale",value:o,unit:null};if(iE.has(r))return{kind:"rotate",value:o,unit:r};if(u0.has(r))return{kind:"translate",value:o,unit:r};throw new TypeError(`Cannot interpolate "${t}" because "${r}" is not a supported translate or rotate unit`)},f0=({component:e,value:t,allowPercentage:n})=>{const r=c0.exec(e);if(r===null)throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not a supported transform-origin ${n?"length-percentage":"z length"}`);const o=r[2]??null,i=Number(r[1]);if(!Number.isFinite(i))throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not finite`);if(o===null||!u0.has(o)||!n&&o==="%")throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not a supported transform-origin ${n?"length-percentage":"z length"}`);return{value:i,unit:o}},Mu=(e,t)=>{const n=e.toLowerCase();return d0.has(n)?{type:"keyword",keyword:n}:{type:"length-percentage",parsed:f0({component:e,value:t,allowPercentage:!0})}},aE=(e,t,n)=>{const r=[];for(const o of yo(e))for(const i of yo(t))o.axis!==i.axis&&r.push(o.axis==="x"?[o.value,i.value]:[i.value,o.value]);if(r.length===0)throw new TypeError(`Cannot interpolate "${n}" because "${e} ${t}" is not a valid transform-origin keyword pair`);return r[0]},lE=(e,t)=>{if(e.length===1){const a=Mu(e[0],t);return a.type==="length-percentage"?[a.parsed,ui]:a.keyword==="top"||a.keyword==="bottom"?[ui,yo(a.keyword)[0].value]:[yo(a.keyword)[0].value,ui]}const n=Mu(e[0],t),r=Mu(e[1],t);if(n.type==="length-percentage"&&r.type==="length-percentage")return[n.parsed,r.parsed];if(n.type==="keyword"&&r.type==="keyword")return aE(n.keyword,r.keyword,t);const o=n.type==="keyword"?n:r.type==="keyword"?r:null,i=n.type==="length-percentage"?n.parsed:r.type==="length-percentage"?r.parsed:null;if(o===null||i===null)throw new Error("Expected a keyword and a length-percentage value");const s=n.type==="keyword";if(o.keyword==="left"||o.keyword==="right"){if(!s)throw new TypeError(`Cannot interpolate "${t}" because horizontal transform-origin keywords must come before a length-percentage value`);return[yo(o.keyword)[0].value,i]}return o.keyword==="top"||o.keyword==="bottom"?[i,yo(o.keyword)[0].value]:s?[ui,i]:[i,ui]},uE=(e,t)=>{const[n,r]=lE(t.slice(0,2),e),o=t[2]===void 0?{value:0,unit:null}:f0({component:t[2],value:e,allowPercentage:!1});return{kind:"translate",values:[n.value,r.value,o.value],units:[n.unit,r.unit,o.unit],dimensions:t[2]===void 0?2:3}},cE=e=>{var o,i,s,a,l,u;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`outputRange must contain only finite numbers, but got [${e}]`);return{kind:"scale",values:[e,e,1],units:[null,null,null],dimensions:1}}const t=e.trim().split(/\s+/);if(t.length<1||t.length>3||t[0]==="")throw new TypeError(`String outputRange values must contain 1 to 3 components, but got "${e}"`);if(t.some(f=>d0.has(f.toLowerCase())))return uE(e,t);const n=t.map(f=>sE(f,e)),[{kind:r}]=n;for(const f of n)if(f.kind!==r)throw new TypeError(`Cannot interpolate "${e}" because it mixes ${r} and ${f.kind} values`);if(r==="scale"){const f=n[0].value,p=((o=n[1])==null?void 0:o.value)??f,m=((i=n[2])==null?void 0:i.value)??1;return{kind:r,values:[f,p,m],units:[null,null,null],dimensions:n.length}}return{kind:r,values:[n[0].value,((s=n[1])==null?void 0:s.value)??0,((a=n[2])==null?void 0:a.value)??0],units:[n[0].unit,((l=n[1])==null?void 0:l.unit)??null,((u=n[2])==null?void 0:u.unit)??null],dimensions:n.length}},dE=({kind:e,values:t,units:n,dimensions:r})=>e==="scale"?t.slice(0,r).map(o=>Im(o)).join(" "):t.slice(0,r).map((o,i)=>`${Im(o)}${n[i]}`).join(" "),Tm=e=>e===0?0:Math.sign(e)*e*e,fE=e=>e===0?0:Math.sign(e)*Math.sqrt(Math.abs(e));function pE(e,t,n,r){const{extrapolateLeft:o,extrapolateRight:i,easing:s,output:a}=r;let l=e;const[u,f]=t,[p,m]=n;if(l<u){if(o==="identity")return l;if(o==="clamp")l=u;else if(o==="wrap"){const h=f-u;l=((l-u)%h+h)%h+u}}if(l>f){if(i==="identity")return l;if(i==="clamp")l=f;else if(i==="wrap"){const h=f-u;l=((l-u)%h+h)%h+u}}if(p===m)return p;if(l=(l-u)/(f-u),l=s(l),a==="perceptual-scale"){const h=Tm(p),w=Tm(m);l=fE(l*(w-h)+h)}else l=l*(m-p)+p;return l}function mE(e,t){let n;for(n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var hE=e=>e,gE=e=>e??"linear",p0=e=>e.remotionShouldExtendRight===!0,Rm=({easing:e,segmentIndex:t})=>e===void 0?hE:typeof e=="function"?e:e[t],_m=({input:e,inputRange:t,outputRange:n,easing:r,extrapolateLeft:o,extrapolateRight:i,output:s})=>pE(e,t,n,{easing:r,extrapolateLeft:o,extrapolateRight:e>t[1]&&i==="clamp"&&p0(r)?"extend":i,output:s}),_f=({input:e,inputRange:t,outputRange:n,options:r})=>{const o=gE(r==null?void 0:r.output);if(t.length===1)return n[0];const i=r==null?void 0:r.easing;let s="extend";(r==null?void 0:r.extrapolateLeft)!==void 0&&(s=r.extrapolateLeft);let a="extend";(r==null?void 0:r.extrapolateRight)!==void 0&&(a=r.extrapolateRight);const l=(r==null?void 0:r.posterize)===void 0?e:Math.floor(e/r.posterize)*r.posterize,u=mE(l,t),f=Rm({easing:i,segmentIndex:u});let p=_m({input:l,inputRange:[t[u],t[u+1]],outputRange:[n[u],n[u+1]],easing:f,extrapolateLeft:s,extrapolateRight:a,output:o});for(let m=0;m<u;m++){const h=Rm({easing:i,segmentIndex:m});if(!p0(h))continue;const w=t[m+1];if(l<=w)continue;const v=_m({input:l,inputRange:[t[m],w],outputRange:[n[m],n[m+1]],easing:h,extrapolateLeft:s,extrapolateRight:"extend",output:o});p+=v-n[m+1]}return p},vE=({input:e,inputRange:t,outputRange:n,options:r})=>{var u;const o=n.map(cE),i=(u=o[0])==null?void 0:u.kind;if(i===void 0)throw new Error("outputRange must have at least 1 element");for(const f of o)if(f.kind!==i)throw new TypeError(`Cannot interpolate ${i} values with ${f.kind} values`);const s=Math.max(...o.map(f=>f.dimensions)),a=[null,null,null];if(i!=="scale")for(let f=0;f<s;f++){for(const p of o){const m=p.units[f];if(m!==null){if(a[f]===null){a[f]=m;continue}if(a[f]!==m)throw new TypeError(`Cannot interpolate ${i} values with different units on axis ${f+1}: ${a[f]} and ${m}`)}}if(a[f]===null)throw new TypeError(`Cannot interpolate ${i} values because axis ${f+1} has no unit`)}const l=[0,0,0];for(let f=0;f<s;f++)l[f]=_f({input:e,inputRange:t,outputRange:o.map(p=>p.values[f]),options:r});return dE({kind:i,values:l,units:a,dimensions:s})},yE=e=>{var n;const t=(n=e[0])==null?void 0:n.length;if(t===void 0)throw new Error("outputRange must have at least 1 element");if(t===0)throw new TypeError("outputRange tuples must contain at least 1 number");for(const r of e){if(r.length!==t)throw new TypeError(`outputRange tuples must all have the same length, but got ${t} and ${r.length}`);for(const o of r)if(typeof o!="number"||!Number.isFinite(o))throw new TypeError(`outputRange tuples must contain only finite numbers, but got [${r.join(",")}]`)}return t},wE=({input:e,inputRange:t,outputRange:n,options:r})=>{const o=yE(n);return new Array(o).fill(!0).map((i,s)=>_f({input:e,inputRange:t,outputRange:n.map(a=>a[s]),options:r}))};function xE(e){for(let t=1;t<e.length;++t)if(!(e[t]>e[t-1]))throw new Error(`inputRange must be strictly monotonically increasing but got [${e.join(",")}]`)}function Pm(e,t){if(t.length<1)throw new Error(e+" must have at least 1 element");for(const n of t){if(typeof n!="number")throw new Error(`${e} must contain only numbers`);if(!Number.isFinite(n))throw new Error(`${e} must contain only finite numbers, but got [${t.join(",")}]`)}}function bE(e,t){if(e===void 0||typeof e=="function")return;const n=t-1;if(e.length!==n)throw new Error(`When easing is an array, it must have one entry per segment between keyframes (length inputRange.length - 1 = ${n}), but got length ${e.length}`);for(let r=0;r<e.length;r++)if(typeof e[r]!="function")throw new Error(`easing[${r}] must be a function`)}function SE(e){if(e!==void 0&&(typeof e!="number"||!Number.isFinite(e)||e<=0))throw new Error(`posterize must be a positive finite number, but got ${e}`)}function EE(e){if(!(e===void 0||e==="linear"||e==="perceptual-scale"))throw new Error(`output must be "linear" or "perceptual-scale", but got ${String(e)}`)}function Ko(e,t,n,r){if(typeof e>"u")throw new Error("input can not be undefined");if(typeof t>"u")throw new Error("inputRange can not be undefined");if(typeof n>"u")throw new Error("outputRange can not be undefined");if(t.length!==n.length)throw new Error("inputRange ("+t.length+") and outputRange ("+n.length+") must have the same length");if(Pm("inputRange",t),xE(t),bE(r==null?void 0:r.easing,t.length),SE(r==null?void 0:r.posterize),EE(r==null?void 0:r.output),typeof e!="number")throw new TypeError("Cannot interpolate an input which is not a number");if(!Array.isArray(n))throw new Error("outputRange must contain only numbers");if(n.some(i=>typeof i=="string")){if(!n.every(i=>typeof i=="string"||typeof i=="number"))throw new TypeError("outputRange must contain only numbers, or supported scale, translate, and rotate strings");return vE({input:e,inputRange:t,outputRange:n,options:r})}if(n.every(i=>Array.isArray(i)))return wE({input:e,inputRange:t,outputRange:n,options:r});if(!n.every(i=>typeof i=="number"))throw new TypeError("outputRange must contain only numbers, numeric tuples, or supported scale, translate, and rotate strings");return Pm("outputRange",n),_f({input:e,inputRange:t,outputRange:n,options:r})}var kE=({allowFloats:e,durationInFrames:t,frame:n})=>{if(typeof n>"u")throw new TypeError('Argument missing for parameter "frame"');if(typeof n!="number")throw new TypeError(`Argument passed for "frame" is not a number: ${n}`);if(!Number.isFinite(n))throw new RangeError(`Frame ${n} is not finite`);if(n<0&&n<-t)throw new RangeError(`Cannot use frame ${n}: Duration of composition is ${t}, therefore the lowest frame that can be rendered is ${-t}`);if(n>t-1)throw new RangeError(`Cannot use frame ${n}: Duration of composition is ${t}, therefore the highest frame that can be rendered is ${t-1}`)},CE=e=>{if(!(typeof e>"u")){if(typeof e!="number")throw new TypeError(`A "duration" of a spring must be a "number" but is "${typeof e}"`);if(Number.isNaN(e))throw new TypeError('A "duration" of a spring is NaN, which it must not be');if(!Number.isFinite(e))throw new TypeError('A "duration" of a spring must be finite, but is '+e);if(e<=0)throw new TypeError('A "duration" of a spring must be positive, but is '+e)}},IE={damping:10,mass:1,stiffness:100,overshootClamping:!1},$u={};function TE({animation:e,now:t,config:n}){const{toValue:r,lastTimestamp:o,current:i,velocity:s}=e,a=Math.min(t-o,64);if(n.damping<=0)throw new Error("Spring damping must be greater than 0, otherwise the spring() animation will never end, causing an infinite loop.");const l=n.damping,u=n.mass,f=n.stiffness,p=[r,o,i,s,l,u,f,t].join("-");if($u[p])return $u[p];const m=-s,h=r-i,w=l/(2*Math.sqrt(f*u)),v=Math.sqrt(f/u),S=v*Math.sqrt(1-w**2),g=a/1e3,y=Math.sin(S*g),x=Math.cos(S*g),b=Math.exp(-w*v*g),k=b*(y*((m+w*v*h)/S)+h*x),E=r-k,I=w*v*k-b*(x*(m+w*v*h)-S*h*y),T=Math.exp(-v*g),_=r-T*(h+(m+v*h)*g),$=T*(m*(g*v-1)+g*h*v*v),M={toValue:r,prevPosition:i,lastTimestamp:t,current:w<1?E:_,velocity:w<1?I:$};return $u[p]=M,M}var Au={};function m0({frame:e,fps:t,config:n={}}){const i=[e,t,n.damping,n.mass,n.overshootClamping,n.stiffness].join("-");if(Au[i])return Au[i];let s={lastTimestamp:0,current:0,toValue:1,velocity:0,prevPosition:0};const a=Math.max(0,e),l=a%1;for(let u=0;u<=Math.floor(a);u++){u===Math.floor(a)&&(u+=l);const f=u/t*1e3;s=TE({animation:s,now:f,config:{...IE,...n}})}return Au[i]=s,s}var Nu=new Map;function h0({fps:e,config:t={},threshold:n=.005}){if(typeof n!="number")throw new TypeError(`threshold must be a number, got ${n} of type ${typeof n}`);if(n===0)return 1/0;if(n===1)return 0;if(isNaN(n))throw new TypeError("Threshold is NaN");if(!Number.isFinite(n))throw new TypeError("Threshold is not finite");if(n<0)throw new TypeError("Threshold is below 0");const r=[e,t.damping,t.mass,t.overshootClamping,t.stiffness,n].join("-");if(Nu.has(r))return Nu.get(r);Rl(e,"to the measureSpring() function");let o=0,i=0;const s=()=>m0({fps:e,frame:o,config:t});let a=s();const l=()=>Math.abs(a.current-a.toValue);let u=l();for(;u>=n;)o++,a=s(),u=l();i=o;for(let f=0;f<20;f++)o++,a=s(),u=l(),u>=n&&(f=0,i=o+1);return Nu.set(r,i),i}function sd({frame:e,fps:t,config:n={},from:r=0,to:o=1,durationInFrames:i,durationRestThreshold:s,delay:a=0,reverse:l=!1}){CE(i),kE({frame:e,durationInFrames:1/0,allowFloats:!0}),Rl(t,"to spring()");const u=l||typeof i<"u",f=u?h0({fps:t,config:n,threshold:s}):void 0,p=u?{get:()=>f}:{get:()=>{throw new Error("did not calculate natural duration, this is an error with Remotion. Please report")}},h=(l?(i??p.get())-e:e)+(l?a:-a),w=i===void 0?h:h/(i/p.get());if(i&&h>i)return o;const v=m0({fps:t,frame:w,config:n}),S=n.overshootClamping?o>=r?Math.min(v.current,o):Math.max(v.current,o):v.current;return r===0&&o===1?S:Ko(S,[0,1],[r,o])}var Fm=e=>Math.min(1,Math.max(0,e)),ci=30;class el{static step0(t){return t>0?1:0}static step1(t){return t>=1?1:0}static linear(t){return t}static ease(t){return el.bezier(.42,0,1,1)(t)}static quad(t){return t*t}static cubic(t){return t*t*t}static poly(t){return n=>n**t}static sin(t){return 1-Math.cos(t*Math.PI/2)}static circle(t){const n=Fm(t);return 1-Math.sqrt(1-n*n)}static exp(t){return 2**(10*(t-1))}static elastic(t=1){const n=t*Math.PI;return r=>1-Math.cos(r*Math.PI/2)**3*Math.cos(r*n)}static back(t=1.70158){return n=>n*n*((t+1)*n-t)}static spring({allowTail:t=!1,durationRestThreshold:n,...r}={}){return Object.assign(i=>i<=0?0:!t&&i>=1?1:sd(t?{fps:ci,frame:i*h0({fps:ci,config:r,threshold:n}),config:r}:{fps:ci,frame:i*ci,config:r,durationInFrames:ci,durationRestThreshold:n}),{remotionShouldExtendRight:t})}static bounce(t){const n=Fm(t);if(n<1/2.75)return 7.5625*n*n;if(n<2/2.75){const o=n-.5454545454545454;return 7.5625*o*o+.75}if(n<2.5/2.75){const o=n-.8181818181818182;return 7.5625*o*o+.9375}const r=n-2.625/2.75;return 7.5625*r*r+.984375}static bezier(t,n,r,o){return l0(t,n,r,o)}static in(t){return t}static out(t){return n=>1-t(1-n)}static inOut(t){return n=>n<.5?t(n*2)/2:1-t((1-n)*2)/2}}var rn="[-+]?\\d*\\.?\\d+",Hs=rn+"%";function Zs(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Ys="(?:none|[-+]?\\d*\\.?\\d+(?:%|deg|rad|grad|turn)?)";function di(e){return new RegExp(e+"\\(\\s*("+Ys+")\\s+("+Ys+")\\s+("+Ys+")(?:\\s*\\/\\s*("+Ys+"))?\\s*\\)")}function RE(){const e={rgb:void 0,rgba:void 0,hsl:void 0,hsla:void 0,hex3:void 0,hex4:void 0,hex5:void 0,hex6:void 0,hex8:void 0,oklch:void 0,oklab:void 0,lab:void 0,lch:void 0,hwb:void 0};return e.rgb===void 0&&(e.rgb=new RegExp("rgb"+Zs(rn,rn,rn)),e.rgba=new RegExp("rgba"+Zs(rn,rn,rn,rn)),e.hsl=new RegExp("hsl"+Zs(rn,Hs,Hs)),e.hsla=new RegExp("hsla"+Zs(rn,Hs,Hs,rn)),e.hex3=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,e.hex4=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,e.hex6=/^#([0-9a-fA-F]{6})$/,e.hex8=/^#([0-9a-fA-F]{8})$/,e.oklch=di("oklch"),e.oklab=di("oklab"),e.lab=di("lab"),e.lch=di("lch"),e.hwb=di("hwb")),e}function To(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function jm(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=To(o,r,e+1/3),s=To(o,r,e),a=To(o,r,e-1/3);return Math.round(i*255)<<24|Math.round(s*255)<<16|Math.round(a*255)<<8}function Qr(e){const t=Number.parseInt(e,10);return t<0?0:t>255?255:t}function Mm(e){return(Number.parseFloat(e)%360+360)%360/360}function $m(e){const t=Number.parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Ks(e){const t=Number.parseFloat(e);return t<0?0:t>100?1:t/100}function Zt(e,t){return e==="none"?0:e.endsWith("%")?Number.parseFloat(e)/100*t:Number.parseFloat(e)}function Lu(e){return e==="none"?0:e.endsWith("rad")?Number.parseFloat(e)*180/Math.PI:e.endsWith("grad")?Number.parseFloat(e)*.9:e.endsWith("turn")?Number.parseFloat(e)*360:Number.parseFloat(e)}function fi(e){return e===void 0||e==="none"?1:e.endsWith("%")?Math.max(0,Math.min(1,Number.parseFloat(e)/100)):Math.max(0,Math.min(1,Number.parseFloat(e)))}function Ro(e){return e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055}function Xs(e){return Math.max(0,Math.min(1,e))}function pi(e,t,n,r){const o=Math.round(Xs(e)*255),i=Math.round(Xs(t)*255),s=Math.round(Xs(n)*255),a=Math.round(Xs(r)*255);return(o<<24|i<<16|s<<8|a)>>>0}function Am(e,t,n){const r=e+.3963377774*t+.2158037573*n,o=e-.1055613458*t-.0638541728*n,i=e-.0894841775*t-1.291485548*n,s=r*r*r,a=o*o*o,l=i*i*i,u=4.0767416621*s-3.3077115913*a+.2309699292*l,f=-1.2684380046*s+2.6097574011*a-.3413193965*l,p=-.0041960863*s-.7034186147*a+1.707614701*l;return[Ro(u),Ro(f),Ro(p)]}function Nm(e,t,n){const r=.008856451679035631,o=24389/27,i=.95047,s=1,a=1.08883,l=(e+16)/116,u=t/500+l,f=l-n/200,p=u*u*u,m=f*f*f,h=p>r?p:(116*u-16)/o,w=e>o*r?((e+16)/116)**3:e/o,v=m>r?m:(116*f-16)/o,S=h*i,g=w*s,y=v*a,x=3.2404542*S-1.5371385*g-.4985314*y,b=-.969266*S+1.8760108*g+.041556*y,k=.0556434*S-.2040259*g+1.0572252*y;return[Ro(x),Ro(b),Ro(k)]}function _E(e,t,n){if(t+n>=1){const u=t/(t+n);return[u,u,u]}const r=1,o=0,i=To(o,r,e+1/3),s=To(o,r,e),a=To(o,r,e-1/3),l=1-t-n;return[i*l+t,s*l+t,a*l+t]}var Lm={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199};function PE(e){const t=RE();let n;if(t.hex6&&(n=t.hex6.exec(e)))return Number.parseInt(n[1]+"ff",16)>>>0;if(Lm[e]!==void 0)return Lm[e];if(t.rgb&&(n=t.rgb.exec(e)))return(Qr(n[1])<<24|Qr(n[2])<<16|Qr(n[3])<<8|255)>>>0;if(t.rgba&&(n=t.rgba.exec(e)))return(Qr(n[1])<<24|Qr(n[2])<<16|Qr(n[3])<<8|$m(n[4]))>>>0;if(t.hex3&&(n=t.hex3.exec(e)))return Number.parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0;if(t.hex8&&(n=t.hex8.exec(e)))return Number.parseInt(n[1],16)>>>0;if(t.hex4&&(n=t.hex4.exec(e)))return Number.parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0;if(t.hsl&&(n=t.hsl.exec(e)))return(jm(Mm(n[1]),Ks(n[2]),Ks(n[3]))|255)>>>0;if(t.hsla&&(n=t.hsla.exec(e)))return(jm(Mm(n[1]),Ks(n[2]),Ks(n[3]))|$m(n[4]))>>>0;if(t.oklch&&(n=t.oklch.exec(e))){const r=Zt(n[1],1),o=Zt(n[2],.4),i=Lu(n[3]),s=fi(n[4]),a=i*Math.PI/180,[l,u,f]=Am(r,o*Math.cos(a),o*Math.sin(a));return pi(l,u,f,s)}if(t.oklab&&(n=t.oklab.exec(e))){const r=Zt(n[1],1),o=Zt(n[2],.4),i=Zt(n[3],.4),s=fi(n[4]),[a,l,u]=Am(r,o,i);return pi(a,l,u,s)}if(t.lab&&(n=t.lab.exec(e))){const r=Zt(n[1],100),o=Zt(n[2],125),i=Zt(n[3],125),s=fi(n[4]),[a,l,u]=Nm(r,o,i);return pi(a,l,u,s)}if(t.lch&&(n=t.lch.exec(e))){const r=Zt(n[1],100),o=Zt(n[2],150),i=Lu(n[3]),s=fi(n[4]),a=i*Math.PI/180,[l,u,f]=Nm(r,o*Math.cos(a),o*Math.sin(a));return pi(l,u,f,s)}if(t.hwb&&(n=t.hwb.exec(e))){const r=Lu(n[1]),o=Zt(n[2],1),i=Zt(n[3],1),s=fi(n[4]),[a,l,u]=_E(r/360,o,i);return pi(a,l,u,s)}throw new Error(`invalid color string ${e} provided`)}var zm=e=>(e>>24&255)/255,FE=e=>e>>16&255,jE=e=>e>>8&255,ME=e=>e&255,$E=(e,t,n,r)=>`rgba(${e}, ${t}, ${n}, ${r})`;function AE(e){const t=PE(e);return(t<<24|t>>>8)>>>0}var NE=(e,t,n,r)=>{const[o,i,s,a]=[FE,jE,ME,zm].map(l=>{const u=Ko(e,t,n.map(f=>l(f)),{easing:r==null?void 0:r.easing,extrapolateLeft:"clamp",extrapolateRight:"clamp",posterize:r==null?void 0:r.posterize});return l===zm?Number(u.toFixed(3)):Math.round(u)});return $E(o,i,s,a)},LE=(e,t,n,r)=>{if(typeof e>"u")throw new TypeError("input can not be undefined");if(typeof t>"u")throw new TypeError("inputRange can not be undefined");if(typeof n>"u")throw new TypeError("outputRange can not be undefined");if(t.length!==n.length)throw new TypeError("inputRange ("+t.length+" values provided) and outputRange ("+n.length+" values provided) must have the same length");const o=n.map(i=>AE(i));return NE(e,t,o,r)},Dm=({easing:e,forceSpringAllowTail:t})=>{switch(e.type){case"linear":return el.linear;case"spring":return el.spring({allowTail:t??e.allowTail??void 0,damping:e.damping,durationRestThreshold:e.durationRestThreshold??void 0,mass:e.mass,overshootClamping:e.overshootClamping,stiffness:e.stiffness});case"bezier":return l0(e.x1,e.y1,e.x2,e.y2);default:throw new TypeError(`Unsupported easing: ${JSON.stringify(e)}`)}},gs=({frame:e,forceSpringAllowTail:t,status:n})=>{const{keyframes:r,easing:o,clamping:i,interpolationFunction:s}=n;if(r.length===0)return null;const a=[...r].sort((f,p)=>f.frame-p.frame),l=a.map(f=>f.frame),u=a.map(f=>f.value);if(s==="interpolateColors"){if(!u.every(f=>typeof f=="string"))return null;if(r.length===1)return u[0];try{return LE(e,l,u,{easing:o.map(f=>Dm({easing:f,forceSpringAllowTail:t})),posterize:n.posterize})}catch{return null}}if(s!=="interpolate")return null;try{return Ko(e,l,u,{easing:o.map(f=>Dm({easing:f,forceSpringAllowTail:t})),extrapolateLeft:i.left,extrapolateRight:i.right,output:n.output,posterize:n.posterize})}catch{return null}},Dl=({dragOverrideValue:e,frame:t})=>{if(e===void 0)return{type:"none"};if(e.type==="static")return{type:"resolved",value:e.value};if(t===null)return{type:"none"};const n=gs({forceSpringAllowTail:null,frame:t,status:e.status});return n===null?{type:"none"}:{type:"resolved",value:n}},g0=({propStatus:e,dragOverrideValue:t,defaultValue:n,frame:r=null,shouldResortToDefaultValueIfUndefined:o=!1})=>{const i=Dl({dragOverrideValue:t,frame:r});return i.type==="resolved"&&i.value!==void 0?i.value:e.status==="keyframed"?r!==null?gs({forceSpringAllowTail:null,frame:r,status:e}):o?n:void 0:e.codeValue===void 0&&o?n:e.codeValue},Pf=c.createContext({overrideIdToNodePathMappings:{}}),zE=c.createContext({setOverrideIdToNodePath:()=>{throw new Error("OverrideIdsToNodePathsSettersContext not initialized")}}),DE=({descriptor:e,propStatusOverrides:t,dragOverrides:n,frame:r})=>{if(!t&&!n)return{params:e.params,effectKey:e.effectKey};const o={...e.params};if(t)for(const[i,s]of Object.entries(t))s!==void 0&&(o[i]=s);if(n)for(const[i,s]of Object.entries(n)){const a=Dl({dragOverrideValue:s,frame:r});a.type==="resolved"&&(o[i]=a.value)}return{params:o,effectKey:e.definition.calculateKey(o)}},OE=(e,t)=>{if(!e)return null;const n={};let r=!1;for(const[o,i]of Object.entries(e)){if(i.status==="static"){n[o]=i.codeValue,r=!0;continue}if(i.status==="keyframed"){const s=gs({forceSpringAllowTail:null,frame:t,status:i});s!==null&&(n[o]=s,r=!0)}}return r?n:null},vs=e=>{const t=c.useRef(null),n=e.map(i=>i.definition),r=t.current;return r!==null&&r.length===n.length&&r.every((i,s)=>i===n[s])?r:(t.current=n,n)},v0=({propStatuses:e,nodePath:t,effectIndex:n})=>{const r=e[Fn(t)];if(!r)return{type:"cannot-update-sequence",reason:"not-found"};if(!r.canUpdate)return{type:"cannot-update-sequence",reason:r.reason};const o=r.effects.find(i=>i.effectIndex===n);return o?o.canUpdate?{type:"can-update-effect",props:o.props}:{type:"cannot-update-effect",reason:o.reason}:{type:"cannot-update-effect",reason:"not-found"}},y0=(e,t)=>{const n=e[Fn(t)];if(n&&n.canUpdate)return n.props},ys=({effects:e,overrideId:t})=>{const n=c.useRef(null),{propStatuses:r}=c.useContext(Al),{getEffectDragOverrides:o}=c.useContext(Ll),i=ct(),{overrideIdToNodePathMappings:s}=c.useContext(Pf),a=n.current,l=t?s[t]??null:null,u=e.map((m,h)=>{if(l===null)return{descriptor:m,params:m.params,effectKey:m.effectKey};const w=v0({propStatuses:r,nodePath:l,effectIndex:h}),v=w.type==="can-update-effect"?OE(w.props,i):null,S=o(l,h),g=Object.keys(S).length===0?null:S,{params:y,effectKey:x}=DE({descriptor:m,propStatusOverrides:v,dragOverrides:g,frame:i});return{descriptor:m,params:y,effectKey:x}});if(a!==null&&a.length===u.length&&a.every((m,h)=>m.definition===u[h].descriptor.definition&&m.effectKey===u[h].effectKey))return a;const p=u.map(({descriptor:m,params:h,effectKey:w})=>({definition:m.definition,effectKey:w,params:h,memoized:!0}));return n.current=p,p},Ff=(e,t)=>{const n={};for(const r of Object.keys(e)){const o=e[r];if(o.type!=="hidden")if(o.type==="enum"){n[r]=o;const i=t(r)??o.default,s=o.variants[i];s&&Object.assign(n,Ff(s,t))}else n[r]=o}return n},jf=e=>{const t={},n=(r,o)=>{r in t||(t[r]=o)};for(const r of Object.keys(e)){const o=e[r];if(n(r,o),o.type==="enum")for(const i of Object.values(o.variants)){const s=jf(i);for(const a of Object.keys(s))n(a,s[a])}}return t},w0=({schema:e,key:t,value:n})=>{const r=e[t];if(!r)throw new Error("Key "+JSON.stringify(t)+" not found in schema");if(typeof n!="string")throw new Error("Value must be a string, but is "+JSON.stringify(n));if(r.type!=="enum")throw new Error("Key "+JSON.stringify(t)+" is not an enum");if(!r.variants[n])throw new Error("Value for "+JSON.stringify(t)+" must be one of "+Object.keys(r.variants).map(a=>JSON.stringify(a)).join(", ")+", got "+JSON.stringify(n));const i=Object.keys(r.variants).filter(a=>a!==n),s=new Set;for(const a of i){const l=r.variants[a],u=Object.keys(l);for(const f of u)s.add(f)}return[...s]},Om={type:"linear"},VE=({insertedKeyframeIndex:e,easingLength:t,keyframeCount:n})=>!(e>0&&e<n-1)||t===0?null:Math.min(e-1,t-1),BE=e=>({type:"static",value:e}),WE=({status:e,frame:t,value:n})=>{const r=e.keyframes.findIndex(s=>s.frame===t),o=r===-1?[...e.keyframes,{frame:t,value:n}].sort((s,a)=>s.frame-a.frame):e.keyframes.map((s,a)=>a===r?{frame:t,value:n}:s),i=[...e.easing];if(r===-1){const s=o.findIndex(u=>u.frame===t),a=VE({insertedKeyframeIndex:s,easingLength:i.length,keyframeCount:o.length}),l=a===null?Om:i[a];i.splice(s,0,l)}for(;i.length<o.length-1;)i.push(Om);return i.length>o.length-1&&(i.length=o.length-1),{type:"keyframed",status:{...e,keyframes:o,easing:i}}},UE=e=>{if((e==null?void 0:e.type)==="static")return e.value},HE=e=>e!==null&&e.status==="keyframed",x0=(e,t)=>{if(t in e)return e[t];for(const n of Object.values(e))if(n.type==="enum")for(const r of Object.values(n.variants)){const o=x0(r,t);if(o)return o}},b0=({schema:e,currentValue:t,overrideValues:n,propStatus:r,frame:o})=>{var a;const i={},s=new Set;for(const l of Object.keys(t)){const u=(r==null?void 0:r[l])??null,f=x0(e,l);if((f==null?void 0:f.type)==="hidden")continue;let p;if(u===null)p=t[l];else if(HE(u))if((f==null?void 0:f.type)==="array"||(f==null?void 0:f.keyframable)===!1)p=t[l];else{const m=Dl({dragOverrideValue:n[l],frame:o});m.type==="resolved"?p=m.value:o!==null?p=gs({forceSpringAllowTail:null,frame:o,status:u})??t[l]:p=t[l]}else u.status==="computed"?p=t[l]:p=g0({propStatus:u,dragOverrideValue:n[l],defaultValue:f==null?void 0:f.default,frame:o,shouldResortToDefaultValueIfUndefined:!1});(f==null?void 0:f.type)==="asset"&&typeof p=="string"&&p.startsWith(Ji)&&(p=`${window.remotion_staticBase}/${p.slice(Ji.length)}`),p===void 0&&s.add(l),i[l]=p}for(const l of Object.keys(n))if(((a=e[l])==null?void 0:a.type)==="enum"){const u=w0({schema:e,key:l,value:i[l]});for(const f of u)s.add(f)}return{merged:i,propsToDelete:s}},S0=(e,t)=>{const n=t.split(".");let r=e;for(const o of n){if(r==null||typeof r!="object")return;r=r[o]}return r},E0=({flatSchema:e,key:t,props:n})=>{var o;const r=S0(n,t);if(!(((o=e[t])==null?void 0:o.type)==="text-content"&&typeof r!="string"))return r},ZE=(e,t,n)=>{const r={};for(const o of t)r[o]=n?E0({flatSchema:n,key:o,props:e}):S0(e,o);return r},YE=(e,t)=>Object.keys(Ff(e,n=>t[n])),KE=({flatSchema:e,props:t,valuesDotNotation:n,schemaKeys:r,propsToDelete:o})=>{var a;const i={...t};for(const l of r){const u=n[l];if(((a=e[l])==null?void 0:a.type)==="text-content"&&u===void 0)continue;const f=l.split(".");if(f.length===1){i[l]=u;continue}let p=i;for(let m=0;m<f.length-1;m++){const h=f[m];typeof p[h]=="object"&&p[h]!==null?p[h]={...p[h]}:p[h]={},p=p[h]}p[f[f.length-1]]=u}const s=new Set([...o].filter(l=>{var u;return!(((u=e[l])==null?void 0:u.type)==="text-content"&&n[l]===void 0)}));return GS(i,s),i},Vm={},Wn=({Component:e,componentName:t,componentIdentity:n,schema:r,supportsEffects:o})=>{const i=BS(r),s=jf(i),a=Object.keys(s),l=c.forwardRef((u,f)=>{const p=Ze();if(!p.isStudio||p.isReadOnlyStudio||p.isRendering)return J.createElement(e,{...u,controls:null,ref:f});const{propStatuses:m}=c.useContext(Al),{getDragOverrides:h}=c.useContext(Ll),w=c.useContext(Pf),v=ct();if(u.controls)return J.createElement(e,{...u,ref:f});const[S]=c.useState(()=>{const{stack:_}=u;if(!_)return String(Math.random());const $=Vm[_];if($)return $;const M=String(Math.random());return Vm[_]=M,M}),g=w.overrideIdToNodePathMappings[S]??null,y=a.map(_=>E0({flatSchema:s,key:_,props:u})),x=c.useMemo(()=>ZE(u,a,s),y),b=c.useMemo(()=>({schema:i,currentRuntimeValueDotNotation:x,overrideId:S,supportsEffects:o,componentIdentity:n,componentName:t}),[x,S]),{merged:k,propsToDelete:E}=c.useMemo(()=>b0({schema:i,currentValue:x,overrideValues:g===null?{}:h(g),propStatus:g===null?void 0:y0(m,g),frame:v}),[x,h,g,m,v]),I=YE(i,k),T=KE({flatSchema:s,props:u,valuesDotNotation:k,schemaKeys:I,propsToDelete:E});return J.createElement(e,{...T,controls:b,ref:f})});return l.displayName=`withInteractivitySchema(${e.displayName||e.name||"Component"})`,l},zu=[],XE=({from:e=0,trimBefore:t=0,freeze:n,durationInFrames:r=1/0,children:o,name:i,height:s,width:a,showInTimeline:l=!0,hidden:u=!1,controls:f,_remotionInternalEffects:p,_remotionInternalLoopDisplay:m,_remotionInternalStack:h,_remotionInternalDocumentationLink:w,_remotionInternalSingleChildComponent:v,_remotionInternalPremountDisplay:S,_remotionInternalPostmountDisplay:g,_remotionInternalIsMedia:y,outlineRef:x,...b},k)=>{const{layout:E="absolute-fill"}=b,[I]=c.useState(()=>String(Math.random())),T=c.useContext(et),{rootId:_}=wr(),$=T?T.cumulatedFrom+T.relativeFrom:0,M=Il();if(E!=="absolute-fill"&&E!=="none")throw new TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${E}`);if(E==="none"&&typeof b.style<"u")throw new TypeError('If layout="none", you may not pass a style. Passed: '+JSON.stringify(b.style));if(typeof r!="number")throw new TypeError(`You passed to durationInFrames an argument of type ${typeof r}, but it must be a number.`);if(r<=0)throw new TypeError(`durationInFrames must be positive, but got ${r}`);if(typeof e!="number")throw new TypeError(`You passed to the "from" props of your <Sequence> an argument of type ${typeof e}, but it must be a number.`);if(!Number.isFinite(e))throw new TypeError(`The "from" prop of a sequence must be finite, but got ${e}.`);if(typeof t!="number")throw new TypeError(`You passed to the "trimBefore" prop of your <Sequence> an argument of type ${typeof t}, but it must be a number.`);if(t<0)throw new TypeError(`The "trimBefore" prop of <Sequence /> must be greater than or equal to 0, but got ${t}.`);if(Number.isNaN(t))throw new TypeError('The "trimBefore" prop of <Sequence /> must be a real number, but it is NaN.');if(!Number.isFinite(t))throw new TypeError(`The "trimBefore" prop of <Sequence /> must be finite, but it is ${t}.`);if(typeof n<"u"&&n!==null){if(typeof n!="number")throw new TypeError(`The "freeze" prop of <Sequence /> must be a number, but is of type ${typeof n}.`);if(Number.isNaN(n))throw new TypeError('The "freeze" prop of <Sequence /> must be a real number, but it is NaN.');if(!Number.isFinite(n))throw new TypeError(`The "freeze" prop of <Sequence /> must be finite, but it is ${n}.`)}const P=xr(),D=Xe(),O=e-t,A=((T==null?void 0:T.absoluteFrom)??0)+O,Z=T?Math.min(T.durationInFrames-O,r):r,R=Math.max(0,Math.min(D.durationInFrames-e,Z)),{registerSequence:C,unregisterSequence:j}=c.useContext(Yo),F=c.useRef(null),V=b.layout==="none"?x??null:x??F,W=c.useMemo(()=>(T==null?void 0:T.premounting)||!!b._remotionInternalIsPremounting,[b._remotionInternalIsPremounting,T==null?void 0:T.premounting]),N=c.useMemo(()=>(T==null?void 0:T.postmounting)||!!b._remotionInternalIsPostmounting,[b._remotionInternalIsPostmounting,T==null?void 0:T.postmounting]),L=$+O,B=T?T.cumulatedFrom+T.relativeFrom:0,H=T?B-T.cumulatedNegativeFrom:0,z=Math.max(0,H,L),Y=L-z,oe=c.useMemo(()=>({absoluteFrom:A,cumulatedFrom:$,relativeFrom:O,cumulatedNegativeFrom:Y,durationInFrames:R,parentFrom:(T==null?void 0:T.relativeFrom)??0,id:I,height:s??(T==null?void 0:T.height)??null,width:a??(T==null?void 0:T.width)??null,premounting:W,postmounting:N,premountDisplay:S??null,postmountDisplay:g??null}),[$,A,O,R,T,I,s,a,W,N,S,g,Y]),ae=c.useMemo(()=>i??"",[i]),ce=w??"https://www.remotion.dev/docs/sequence",se=Ze(),G=c.useContext(zl),ee=(b==null?void 0:b.stack)??null,Q=c.useRef(null);Q.current=h??ee;const q=typeof n=="number"?n:null,he=t===0?null:t,Ce=(T==null?void 0:T.cumulatedNegativeFrom)??0,ve=y&&y.type!=="image"?y.data.startMediaFrom+Ce-Y:null,pe=y&&y.type!=="image"?y.data.startMediaFrom+Ce:null,Re=y&&y.type!=="image"&&pe!==null?q===null?null:pe+(m?q%m.durationInFrames:q)*y.data.playbackRate:null;c.useEffect(()=>{if(se.isStudio)return y?(y.type==="image"?C({type:"image",controls:f??null,effects:p??zu,displayName:ae,documentationLink:ce,duration:R,from:e,trimBefore:he,id:I,loopDisplay:m,nonce:M.get(),parent:(T==null?void 0:T.id)??null,postmountDisplay:g??null,premountDisplay:S??null,rootId:_,showInTimeline:l,src:y.src,getStack:()=>Q.current,refForOutline:V??null,isInsideSeries:G,frozenFrame:q,singleChildComponent:v??null}):C({type:y.type,controls:f??null,effects:p??zu,displayName:ae,documentationLink:ce,doesVolumeChange:y.data.doesVolumeChange,duration:R,from:e,trimBefore:he,id:I,loopDisplay:m,nonce:M.get(),parent:(T==null?void 0:T.id)??null,playbackRate:y.data.playbackRate,postmountDisplay:g??null,premountDisplay:S??null,rootId:_,showInTimeline:l,src:y.data.src,getStack:()=>Q.current,startMediaFrom:ve??y.data.startMediaFrom,mediaFrameAtSequenceZero:pe,volume:y.data.volumes,refForOutline:V??null,isInsideSeries:G,frozenFrame:q,frozenMediaFrame:Re,singleChildComponent:v??null}),()=>{j(I)}):(C({from:e,trimBefore:he,duration:R,id:I,displayName:ae,documentationLink:ce,parent:(T==null?void 0:T.id)??null,type:"sequence",rootId:_,showInTimeline:l,nonce:M.get(),loopDisplay:m,getStack:()=>Q.current,premountDisplay:S??null,postmountDisplay:g??null,controls:f??null,effects:p??zu,refForOutline:V??null,isInsideSeries:G,frozenFrame:q,singleChildComponent:v??null}),()=>{j(I)})},[r,I,i,C,ae,j,T==null?void 0:T.id,R,_,e,t,he,l,M,m,S,g,se.isStudio,f,p,y,ce,V,G,q,ve,pe,Re,v]);const be=Math.ceil($+e+r-1),we=P<$+e||P>be?null:o,Pe=we===null||typeof n>"u"||n===null?we:d.jsx(ps,{frame:n,children:we}),ue=b.layout==="none"?void 0:b.style,Ge=c.useCallback(At=>{F.current=At,typeof k=="function"?k(At):k&&(k.current=At)},[k]),Et=c.useMemo(()=>({flexDirection:void 0,...a?{width:a}:{},...s?{height:s}:{},...ue??{}}),[s,ue,a]);if(k!==null&&E==="none")throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');return u?null:d.jsx(et.Provider,{value:oe,children:Pe===null?null:b.layout==="none"?Pe:d.jsx(fn,{ref:Ge,style:Et,className:b.className,children:Pe})})},GE=c.forwardRef(XE),qE=(e,t)=>{if(e.layout==="none")throw new Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');const{style:n,from:r=0,durationInFrames:o=1/0,premountFor:i=0,postmountFor:s=0,styleWhilePremounted:a,styleWhilePostmounted:l,...u}=e,{freezeFrame:f,isPremountingOrPostmounting:p,postmountingActive:m,premountingActive:h,premountingStyle:w}=hs({from:r,durationInFrames:o,premountFor:i,postmountFor:s,style:n??null,styleWhilePremounted:a??null,styleWhilePostmounted:l??null,hideWhilePremounted:"opacity"});return d.jsx(ps,{frame:f,active:p,children:d.jsx(Ol,{ref:t,from:r,durationInFrames:o,style:w??void 0,_remotionInternalPremountDisplay:i,_remotionInternalPostmountDisplay:s,_remotionInternalIsPremounting:h,_remotionInternalIsPostmounting:m,...u})})},QE=c.forwardRef(qE),JE=(e,t)=>{const n=Ze(),{fps:r}=Xe();if(e.layout!=="none"&&!n.isRendering){const o=e.premountFor;if(o||e.postmountFor)return d.jsx(QE,{ref:t,...e,premountFor:o})}return d.jsx(GE,{...e,ref:t})},Ol=c.forwardRef(JE),k0=Ol,dt=Wn({Component:Ol,componentName:"<Sequence>",componentIdentity:"dev.remotion.remotion.Sequence",schema:Lo,supportsEffects:!1});Wn({Component:Ol,componentName:"<Sequence>",componentIdentity:null,schema:US,supportsEffects:!1});var C0=(e,t,n)=>{switch(e){case"fill":return[0,0,t.width,t.height,0,0,n.width,n.height];case"contain":{const r=Math.min(n.width/t.width,n.height/t.height),o=(n.width-t.width*r)/2,i=(n.height-t.height*r)/2;return[0,0,t.width,t.height,o,i,t.width*r,t.height*r]}case"cover":{const r=Math.max(n.width/t.width,n.height/t.height),o=(n.width-t.width*r)/2,i=(n.height-t.height*r)/2;return[0,0,t.width,t.height,o,i,t.width*r,t.height*r]}default:throw new Error("Unknown fit: "+e)}},ek="https://remotion.dev/docs/troubleshooting/webgl2-context",I0=(e,t)=>`Failed to acquire ${e} context for ${t}. Pass --gl=angle when using the CLI, set chromiumOptions: { gl: "angle" } when using SSR APIs, or set "OpenGL render backend" to "angle" in the Advanced section when rendering in the Studio. See ${ek}`,tk=e=>new Error(I0("WebGL",e)),T0=e=>new Error(I0("WebGL2",e));class nk{constructor(t,n){Ie(this,"width");Ie(this,"height");Ie(this,"pairs",new Map);Ie(this,"lostContexts",new Set);this.width=t,this.height=n}getPair(t){const n=this.pairs.get(t);if(n)return n;const r=[this.allocateCanvas(t),this.allocateCanvas(t)];return this.pairs.set(t,r),r}assertContextNotLost(t){if(this.lostContexts.has(t))throw new Error("WebGL context was lost during canvas effect rendering. This typically happens in headless or memory-constrained environments (e.g. Remotion Lambda). Try reducing concurrency or increasing the Lambda function memory.")}allocateCanvas(t){const n=document.createElement("canvas");switch(n.width=this.width,n.height=this.height,t){case"2d":{if(!n.getContext("2d",{colorSpace:"srgb"}))throw new Error("Failed to acquire 2D context for canvas effect");return n}case"webgl2":{const r=n.getContext("webgl2",{premultipliedAlpha:!0,alpha:!0,preserveDrawingBuffer:!0});if(!r)throw T0("canvas effect");return n.addEventListener("webglcontextlost",o=>{o.preventDefault(),this.lostContexts.add(n)}),n.addEventListener("webglcontextrestored",()=>{this.lostContexts.delete(n)}),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),n}case"webgpu":{if(typeof navigator>"u"||!("gpu"in navigator))throw new Error("WebGPU is not available in this environment for canvas effect");return n}default:{const r=t;throw new Error(`Unknown effect backend: ${r}`)}}}}var rk=e=>{const t=[];let n=[],r=null;for(const o of e){const{backend:i}=o.definition;r===null||i===r?(n.push(o),r=i):(t.push({backend:r,effects:n}),n=[o],r=i)}return r!==null&&n.length>0&&t.push({backend:r,effects:n}),t},Gs=null,ok=()=>Gs||(Gs=(async()=>{if(typeof navigator>"u"||!("gpu"in navigator))throw new Error("WebGPU is not available in this environment");const{gpu:e}=navigator,t=await e.requestAdapter();if(!t)throw new Error("No WebGPU adapter available");return t.requestDevice()})(),Gs),R0=(e,t)=>({pool:new nk(e,t),setupCache:new WeakMap,cleanupRegistry:[],currentRunId:0}),ad=e=>{e.currentRunId++;for(const t of e.cleanupRegistry)t.definition.cleanup(t.state)},ik=(e,t,n)=>{const r=t;let o=e.setupCache.get(r);if(o||(o=new WeakMap,e.setupCache.set(r,o)),o.has(n))return o.get(n);const i=t.setup(n);return o.set(n,i),e.cleanupRegistry.push({definition:r,state:i}),i},ws=async({state:e,source:t,effects:n,output:r,width:o,height:i})=>{const s=++e.currentRunId,a=()=>e.currentRunId!==s,l=n.filter(S=>!S.params.disabled),u=rk(l);let f=t,p=null;if(u.length===0){if(t===r)return!0;const S=r.getContext("2d");if(!S)throw new Error("Failed to acquire 2D context for output canvas");return S.clearRect(0,0,o,i),S.drawImage(f,0,0,o,i),!0}let m=!1;for(const S of u)if(S.backend==="webgpu"){m=!0;break}const h=m?await ok():null;if(a())return!1;let w=!0;for(let S=0;S<u.length;S++){const g=u[S],[y,x]=e.pool.getPair(g.backend);let b=y;for(const E of g.effects){const I=E.definition,T=ik(e,I,b);I.apply({source:f,target:b,state:T,params:E.params,width:o,height:i,gpuDevice:h,flipSourceY:g.backend==="webgl2"?w:!1}),g.backend==="webgl2"&&(w=!0,e.pool.assertContextNotLost(b)),f=b,b=b===y?x:y}p=f??p;const k=u[S+1];if(k&&k.backend!==g.backend&&p)if(g.backend==="2d"&&k.backend==="webgl2")f=p,w=!0;else{const E=await createImageBitmap(p);if(a())return E.close(),!1;f=E,k.backend==="webgl2"&&(w=!1)}}if(!p)return!0;const v=r.getContext("2d");if(!v)throw new Error("Failed to acquire 2D context for output canvas");return v.clearRect(0,0,o,i),v.drawImage(p,0,0,o,i),!0},xs=()=>{const e=c.useRef(null),t=c.useRef(null);return c.useEffect(()=>()=>{e.current&&ad(e.current)},[]),c.useMemo(()=>({get:(n,r)=>((!t.current||t.current.width!==n||t.current.height!==r)&&(e.current&&ad(e.current),e.current=R0(n,r),t.current={width:n,height:r}),e.current)}),[])},sk=({width:e,height:t,fit:n,className:r,style:o,effects:i,...s},a)=>{const l=c.useRef(null),u=xs(),f=c.useMemo(()=>typeof document>"u"?null:document.createElement("canvas"),[]),p=c.useCallback(m=>{const h=l.current,w=e??m.displayWidth,v=t??m.displayHeight;if(!h)throw new Error("Canvas ref is not set");if(!f)throw new Error("Source canvas is not available");f.width=w,f.height=v;const S=f.getContext("2d");if(!S)throw new Error("Could not get 2d context for source canvas");return S.drawImage(m,...C0(n,{height:m.displayHeight,width:m.displayWidth},{width:w,height:v})),h.width=w,h.height=v,ws({state:u.get(w,v),source:f,effects:i,output:h,width:w,height:v})},[u,i,n,t,f,e]);return c.useImperativeHandle(a,()=>({draw:p,getCanvas:()=>{if(!l.current)throw new Error("Canvas ref is not set");return l.current},clear:()=>{var h;const m=(h=l.current)==null?void 0:h.getContext("2d");if(!m)throw new Error("Could not get 2d context");m.clearRect(0,0,l.current.width,l.current.height)}}),[p]),d.jsx("canvas",{ref:l,className:r,style:o,...s})},ak=J.forwardRef(sk),_0=async({resolvedSrc:e,signal:t,requestInit:n,contentType:r})=>{if(typeof ImageDecoder>"u")throw new Error("Your browser does not support the WebCodecs ImageDecoder API.");const o=await fetch(e,{...n,signal:t}),{body:i}=o;if(!i)throw new Error("Got no body");const s=new ImageDecoder({data:i,type:r??o.headers.get("Content-Type")??"image/gif"});await Promise.all([s.completed,s.tracks.ready]);const{selectedTrack:a}=s.tracks;if(!a)throw s.close(),new Error("No selected track");return{decoder:s,selectedTrack:a}},lk=5,Bm=({loopBehavior:e,durationFound:t,timeInSec:n})=>e==="loop"?t?n%t:n:Math.min(n,t||1/0),uk=async({resolvedSrc:e,signal:t,requestInit:n,currentTime:r,initialLoopBehavior:o})=>{const{decoder:i,selectedTrack:s}=await _0({resolvedSrc:e,signal:t,requestInit:n,contentType:null}),a=[];let l=null;const u=async h=>{const w=a.find(S=>S.frameIndex===h);if(w&&w.frame)return w;const v=await i.decode({frameIndex:h,completeFramesOnly:!0});return w?w.frame=v.image:a.push({frame:v.image,frameIndex:h,timeInSeconds:v.image.timestamp/1e6}),{frame:v.image,frameIndex:h,timeInSeconds:v.image.timestamp/1e6}},f=h=>{const v=a.filter(S=>S.frame).sort((S,g)=>{const y=Math.abs(S.timeInSeconds-h),x=Math.abs(g.timeInSeconds-h);return y-x});for(let S=0;S<v.length;S++){if(S<lk)continue;const g=v[S];g.frame=null}},p=async({timeInSec:h,loopBehavior:w})=>{const v=Bm({durationFound:l,loopBehavior:w,timeInSec:h}),g=a.filter(x=>x.timeInSeconds<=v).map(x=>x.frameIndex).reduce((x,b)=>Math.max(x,b),0);let y=g;for(;;){const x=await u(y);if(y++,!x.frame)throw new Error("No frame found");if(!x.frame.duration||(y===s.frameCount&&l===null&&(l=(x.frame.timestamp+x.frame.duration)/1e6),x.timeInSeconds>v||y===s.frameCount))break}s.frameCount-g<3&&w==="loop"&&await u(0),f(v)};return await p({timeInSec:r,loopBehavior:o}),await p({timeInSec:r,loopBehavior:o}),{close:()=>{var h;for(const w of a)(h=w.frame)==null||h.close(),w.frame=null;i.close()},getFrame:async(h,w)=>{if(l!==null&&h>l&&w==="clear-after-finish")return null;const v=Bm({loopBehavior:w,durationFound:l,timeInSec:h});await p({timeInSec:v,loopBehavior:w});const g=a.filter(y=>y.frame).reduce((y,x)=>{const b=Math.abs(y.timeInSeconds-v),k=Math.abs(x.timeInSeconds-v);return b<k?y:x});if(!g.frame)throw new Error("No frame found");return g},frameCount:s.frameCount}},ck=({frame:e,playbackRate:t,fps:n})=>e*t/n,dk=e=>{if(!e)return null;const t={...e};delete t.signal;const{headers:n,...r}=t;return JSON.stringify({...r,headers:n?Array.from(new Headers(n).entries()):null})},fk=e=>typeof window>"u"?e:new URL(e,window.origin).href,pk={src:{type:"asset",default:void 0,description:"Source",keyframable:!1},...Bn,...Zo,playbackRate:{type:"number",min:0,max:10,step:.1,default:1,description:"Playback rate",hiddenFromList:!1,keyframable:!1},...Tn,...Sr,...br},mk=e=>{const t={},n=t;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(r.startsWith("data-")||r.startsWith("aria-"))&&(n[r]=e[r]);return t},P0=c.forwardRef(({src:e,width:t,height:n,onError:r,loopBehavior:o="loop",playbackRate:i=1,fit:s="fill",requestInit:a,effects:l,controls:u,...f},p)=>{const m=fk(e),[h,w]=c.useState(null),{delayRender:v,continueRender:S}=pn(),[g]=c.useState(()=>v(`Rendering <AnimatedImage/> with src="${m}"`)),y=ct(),{fps:x}=Xe(),b=ck({frame:y,playbackRate:i,fps:x}),k=c.useRef(b);k.current=b;const E=dk(a),I=c.useRef(a);I.current=a;const T=c.useRef(null),_=ys({effects:l,overrideId:(u==null?void 0:u.overrideId)??null});c.useImperativeHandle(p,()=>{var P;const M=(P=T.current)==null?void 0:P.getCanvas();if(!M)throw new Error("Canvas ref is not set");return M},[]);const[$]=c.useState(()=>o);return c.useEffect(()=>{const M=new AbortController;let P=!1,D=!1;const O=()=>{D||(D=!0,S(g))};return uk({resolvedSrc:m,signal:M.signal,requestInit:I.current,currentTime:k.current,initialLoopBehavior:$}).then(A=>{if(P){A.close();return}w(A),O()}).catch(A=>{if(!P){if(A.name==="AbortError"){O();return}r?(r==null||r(A),O()):es(A)}}),()=>{P=!0,M.abort(),O()}},[m,g,r,E,$,S]),c.useEffect(()=>()=>{h==null||h.close()},[h]),c.useLayoutEffect(()=>{if(!h)return;const M=v(`Rendering frame at ${b} of <AnimatedImage src="${e}"/>`);let P=!1;return h.getFrame(b,o).then(async D=>{var A,Z;if(P)return;if(D===null){(A=T.current)==null||A.clear(),S(M);return}await((Z=T.current)==null?void 0:Z.draw(D.frame))&&!P&&S(M)}).catch(D=>{P||(r?(r(D),S(M)):es(D))}),()=>{P=!0,S(M)}},[b,h,o,r,e,S,v,_,s,t,n]),d.jsx(ak,{ref:T,width:t,height:n,fit:s,effects:_,...f})});P0.displayName="AnimatedImageContent";var hk=({src:e,width:t,height:n,onError:r,fit:o,playbackRate:i,loopBehavior:s,id:a,className:l,style:u,durationInFrames:f,from:p,premountFor:m,postmountFor:h,styleWhilePremounted:w,styleWhilePostmounted:v,requestInit:S,effects:g=[],controls:y,ref:x,...b})=>{const k=c.useRef(null),E=vs(g);c.useImperativeHandle(x,()=>k.current,[]);const{effectivePostmountFor:I,effectivePremountFor:T,freezeFrame:_,isPremountingOrPostmounting:$,postmountingActive:M,premountingActive:P,premountingStyle:D}=hs({from:p??0,durationInFrames:f??1/0,premountFor:m??null,postmountFor:h??null,style:u??null,styleWhilePremounted:w??null,styleWhilePostmounted:v??null,hideWhilePremounted:"display-none"}),O=mk(b),A={src:e,width:t,height:n,onError:r,fit:o,playbackRate:i,loopBehavior:s,id:a,className:l,style:D??void 0,requestInit:S,...O};return d.jsx(ps,{frame:_,active:$,children:d.jsx(dt,{layout:"none",from:p??0,durationInFrames:f??1/0,name:"<AnimatedImage>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/animatedimage",controls:y,_remotionInternalEffects:E,_remotionInternalPremountDisplay:T||null,_remotionInternalPostmountDisplay:I||null,_remotionInternalIsPremounting:P,_remotionInternalIsPostmounting:M,...b,outlineRef:k,children:d.jsx(P0,{...A,ref:k,effects:g,controls:y})})})},F0=Wn({Component:hk,componentName:"<AnimatedImage>",componentIdentity:"dev.remotion.remotion.AnimatedImage",schema:pk,supportsEffects:!0});F0.displayName="AnimatedImage";St(F0);var gk={type:"boolean",default:!1,description:"Disabled"},vk=e=>{const{calculateKey:t,validateParams:n}=e,r={...e,documentationLink:e.documentationLink??null,calculateKey:i=>{const s=i.disabled??!1;return`${t(i)}-disabled-${s}`},schema:{disabled:gk,...e.schema}};return(i={})=>(n(i),{definition:r,params:i,effectKey:r.calculateKey(i),memoized:!1})},yk=e=>{if(typeof e!="string")throw new TypeError(`The "filename" must be a string, but you passed a value of type ${typeof e}`);if(e.trim()==="")throw new Error("The `filename` must not be empty");if(!e.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.')},wk=e=>{if(typeof e!="string"&&!(e instanceof Uint8Array))throw new TypeError(`The "content" must be a string or Uint8Array, but you passed a value of type ${typeof e}`);if(typeof e=="string"&&e.trim()==="")throw new Error("The `content` must not be empty")},j0=e=>{e.type==="artifact"&&(yk(e.filename),e.contentType!=="thumbnail"&&wk(e.content))},Zr=c.createContext({registerRenderAsset:()=>{},unregisterRenderAsset:()=>{},renderAssets:[]}),xk=({children:e,collectAssets:t})=>{const[n,r]=c.useState([]),o=c.useRef([]),i=c.useCallback(l=>{j0(l),o.current=[...o.current,l],r(o.current)},[]);t&&c.useImperativeHandle(t,()=>({collectAssets:()=>{const l=o.current;return o.current=[],r([]),l}}),[]);const s=c.useCallback(l=>{o.current=o.current.filter(u=>u.id!==l),r(o.current)},[]);c.useLayoutEffect(()=>{typeof window<"u"&&(window.remotion_collectAssets=()=>{const l=o.current;return o.current=[],r([]),l})},[]);const a=c.useMemo(()=>({registerRenderAsset:i,unregisterRenderAsset:s,renderAssets:n}),[n,i,s]);return d.jsx(Zr.Provider,{value:a,children:e})},Cn=e=>typeof window>"u"||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("file://")||e.startsWith("blob:")||e.startsWith("data:")?e:new URL(e,window.origin).href,Vl=({trimAfter:e,mediaDurationInFrames:t,playbackRate:n,trimBefore:r})=>{let o=t;typeof e<"u"&&(o=e),typeof r<"u"&&(o-=r);const i=o/n;return Number(i.toFixed(10))},M0=c.createContext(null),bk=()=>J.useContext(M0),Bl=({durationInFrames:e,times:t=1/0,children:n,name:r,showInTimeline:o,...i})=>{const s=ct(),{durationInFrames:a}=Xe();if(Tl(e,{component:"of the <Loop /> component",allowFloats:!0}),typeof t!="number")throw new TypeError(`You passed to "times" an argument of type ${typeof t}, but it must be a number.`);if(t!==1/0&&t%1!==0)throw new TypeError(`The "times" prop of a loop must be an integer, but got ${t}.`);if(t<0)throw new TypeError(`The "times" prop of a loop must be at least 0, but got ${t}`);const l=Math.ceil(a/e),u=Math.min(l,t),f=i.layout==="none"?void 0:i.style,p=e*(u-1),h=Math.floor(s/e)*e,w=Math.min(h,p),v=c.useMemo(()=>({numberOfTimes:Math.min(a/e,t),startOffset:-w,durationInFrames:e}),[a,e,w,t]),S=c.useMemo(()=>({iteration:Math.floor(s/e),durationInFrames:e}),[s,e]);return d.jsx(M0.Provider,{value:S,children:d.jsx(dt,{durationInFrames:e,from:w,name:r??"<Loop>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/loop",_remotionInternalLoopDisplay:v,layout:i.layout,style:f,showInTimeline:o,children:n})})};Bl.useLoop=bk;var gt=({logLevel:e,tag:t,message:n,mountTime:r})=>{const o=[r?Date.now()-r+"ms ":null,t].filter(Boolean).join(" ");rt.trace({logLevel:e,tag:null},`[${o}]`,n)},Wl=c.createContext({}),Wm={},Du=[],$0=({children:e})=>{const[t,n]=c.useState(()=>Wm);return c.useEffect(()=>{const r=()=>{n(Wm)};return Du.push(r),()=>{Du=Du.filter(o=>o!==r)}},[]),d.jsx(Wl.Provider,{value:t,children:e})},A0=e=>{const t=e.indexOf("#");return t===-1?null:t},Sk=e=>{const t=A0(e);return t===null?e:e.slice(0,t)},Yr=e=>{const t=c.useContext(Wl),n=A0(e),r=Sk(e);return t[r]?n!==null?t[r]+e.slice(n):t[r]:e},Ul=(e,t)=>{if(typeof e.volume!="number"&&typeof e.volume!="function"&&typeof e.volume<"u")throw new TypeError(`You have passed a volume of type ${typeof e.volume} to your <${t} /> component. Volume must be a number or a function with the signature '(frame: number) => number' undefined.`);if(typeof e.volume=="number"&&e.volume<0)throw new TypeError(`You have passed a volume below 0 to your <${t} /> component. Volume must be between 0 and 1`);if(typeof e.playbackRate!="number"&&typeof e.playbackRate<"u")throw new TypeError(`You have passed a playbackRate of type ${typeof e.playbackRate} to your <${t} /> component. Playback rate must a real number or undefined.`);if(typeof e.playbackRate=="number"&&(isNaN(e.playbackRate)||!Number.isFinite(e.playbackRate)||e.playbackRate<=0))throw new TypeError(`You have passed a playbackRate of ${e.playbackRate} to your <${t} /> component. Playback rate must be a real number above 0.`);if(typeof e.preservePitch!="boolean"&&typeof e.preservePitch<"u")throw new TypeError(`'preservePitch' must be a boolean or undefined but got '${typeof e.preservePitch}' instead`)},Ek=(e,t)=>{if(typeof e<"u"){if(typeof e!="number")throw new TypeError(`type of startFrom prop must be a number, instead got type ${typeof e}.`);if(isNaN(e)||e===1/0)throw new TypeError("startFrom prop can not be NaN or Infinity.");if(e<0)throw new TypeError(`startFrom must be greater than equal to 0 instead got ${e}.`)}if(typeof t<"u"){if(typeof t!="number")throw new TypeError(`type of endAt prop must be a number, instead got type ${typeof t}.`);if(isNaN(t))throw new TypeError("endAt prop can not be NaN.");if(t<=0)throw new TypeError(`endAt must be a positive number, instead got ${t}.`)}if(t<e)throw new TypeError("endAt prop must be greater than startFrom prop.")},kk=(e,t)=>{if(typeof e<"u"){if(typeof e!="number")throw new TypeError(`type of trimBefore prop must be a number, instead got type ${typeof e}.`);if(isNaN(e)||e===1/0)throw new TypeError("trimBefore prop can not be NaN or Infinity.");if(e<0)throw new TypeError(`trimBefore must be greater than equal to 0 instead got ${e}.`)}if(typeof t<"u"){if(typeof t!="number")throw new TypeError(`type of trimAfter prop must be a number, instead got type ${typeof t}.`);if(isNaN(t))throw new TypeError("trimAfter prop can not be NaN.");if(t<=0)throw new TypeError(`trimAfter must be a positive number, instead got ${t}.`)}if(t<=e)throw new TypeError("trimAfter prop must be greater than trimBefore prop.")},Hl=({startFrom:e,endAt:t,trimBefore:n,trimAfter:r})=>{if(typeof e<"u"&&typeof n<"u")throw new TypeError("Cannot use both startFrom and trimBefore props. Use trimBefore instead as startFrom is deprecated.");if(typeof t<"u"&&typeof r<"u")throw new TypeError("Cannot use both endAt and trimAfter props. Use trimAfter instead as endAt is deprecated.");typeof n<"u"||typeof r<"u"?kk(n,r):(typeof e<"u"||typeof t<"u")&&Ek(e,t)},Zl=({startFrom:e,endAt:t,trimBefore:n,trimAfter:r})=>({trimBeforeValue:n??e??void 0,trimAfterValue:r??t??void 0}),Ck=(e,t)=>{switch(t.type){case"got-duration":{const n=Cn(t.src);return e[n]===t.durationInSeconds?e:{...e,[n]:t.durationInSeconds}}default:return e}},Mf=c.createContext({durations:{},setDurations:()=>{throw new Error("context missing")}}),N0=({children:e})=>{const[t,n]=c.useReducer(Ck,{}),r=c.useMemo(()=>({durations:t,setDurations:n}),[t]);return d.jsx(Mf.Provider,{value:r,children:e})},$f=({crossOrigin:e,requestsVideoFrame:t,isClientSideRendering:n})=>{if(e!=null)return e;if(n||t)return"anonymous"},tl=({mediaRef:e,mediaType:t,onAutoPlayError:n,logLevel:r,mountTime:o,reason:i,isPlayer:s})=>{const{current:a}=e;if(!a)return;gt({logLevel:r,tag:"play",message:`Attempting to play ${a.src}. Reason: ${i}`,mountTime:o});const l=a.play();l.catch&&l.catch(u=>{if(a&&!u.message.includes("request was interrupted by a call to pause")&&!u.message.includes("The operation was aborted.")&&!u.message.includes("The fetching process for the media resource was aborted by the user agent")&&!u.message.includes("request was interrupted by a new load request")&&!u.message.includes("because the media was removed from the document")&&!(u.message.includes("user didn't interact with the document")&&a.muted)&&(console.log(`Could not play ${t} due to following error: `,u),!a.muted)){if(n){n();return}t==="video"&&s&&(rt.info({logLevel:r,tag:"<"+t+">"},"The video will be muted and we'll retry playing it."),rt.info({logLevel:r,tag:"<"+t+">"},"Use onAutoPlayError() to handle this error yourself."),a.muted=!0,a.play())}})},Af=({audioContext:e,ref:t})=>{let n=null,r=!1,o=e;return{setAudioContext:i=>{o=i},attemptToConnect:()=>{if(r)throw new Error("SharedElementSourceNode has been disposed");!n&&t.current&&o&&(n=o.createMediaElementSource(t.current))},get:()=>{if(!n)throw new Error("Audio element not connected");return n},cleanup:()=>{n&&(n.disconnect(),n=null),r=!0}}},Um=!1,Ik=e=>{Um||(Um=!0,typeof window<"u"&&rt.warn({logLevel:e,tag:null},"AudioContext is not supported in this browser"))},Tk=({logLevel:e,latencyHint:t,audioEnabled:n,sampleRate:r})=>{const o=Ze(),i=c.useRef(r);if(r!==i.current)throw new Error(`Changing the AudioContext sample rate dynamically is not supported. The sample rate was initialized with ${i.current} Hz, but ${r} Hz was passed later.`);return c.useMemo(()=>{if(o.isRendering||!n)return null;if(typeof AudioContext>"u")return Ik(e),null;const a=new AudioContext({latencyHint:t,sampleRate:r}),l=a.createGain();l.connect(a.destination),rt.trace({logLevel:e,tag:"audio"},"Creating new audio context"),a.suspend();let u=null;return{audioContext:a,gainNode:l,getState:()=>{const h=a.state;return u==="running"&&h!=="running"?"suspended-to-running":u==="suspended"&&h!=="suspended"?"running-to-suspended":h},resume:()=>{u="running";const h=a.resume();return h.finally(()=>{u==="running"&&(u=null)}),h},suspend:()=>{u="suspended";const h=a.suspend();return h.finally(()=>{u==="suspended"&&(u=null)}),h}}},[e,t,o.isRendering,n,r])},Rk=(e,t)=>new Promise(n=>{const r=e.currentTime,i=e.getOutputTimestamp().performanceTime,s=performance.now(),a=()=>{var p;const{currentTime:l}=e,u=e.getOutputTimestamp(),f=performance.now()-s;if(i!==void 0&&u.performanceTime!==void 0&&u.performanceTime>i&&u.contextTime!==void 0&&u.contextTime>r){rt.verbose({logLevel:t,tag:"audio"},`waitUntilActuallyResumed: getOutputTimestamp.performanceTime advanced from ${i.toFixed(6)} to ${u.performanceTime.toFixed(6)} after ${f.toFixed(1)}ms. currentTime=${l.toFixed(6)} (advanced by ${(l-r).toFixed(6)}), getOutputTimestamp.performanceTime=${((p=u.performanceTime)==null?void 0:p.toFixed(1))??"undefined"}`),n();return}requestAnimationFrame(a)};requestAnimationFrame(a)}),Ou="data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",_k=(e,t)=>{const n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(n[o]!==r[o]||e[n[o]]!==t[r[o]])return!1;return!0},Pk=(e,t,n)=>e==="src"&&!n.startsWith("data:")&&!t.startsWith("data:")?new URL(n,window.origin).toString()!==new URL(t,window.origin).toString():n!==t,Xo=c.createContext(null),Yl=c.createContext(null),Fk=e=>{if(e==="suspended"||e==="running-to-suspended"||e==="interrupted")return!0;if(e==="running"||e==="suspended-to-running")return!1;throw new Error(`Unexpected audio context state: ${e}`)},L0=({children:e,audioLatencyHint:t,audioEnabled:n,previewSampleRate:r})=>{const o=In(),i=r??48e3;c.useEffect(()=>{typeof window>"u"||(window.remotion_sampleRate=i)},[i]);const s=Tk({logLevel:o,latencyHint:t,audioEnabled:n,sampleRate:i}),a=c.useRef(!1),l=c.useRef(null),u=c.useMemo(()=>({value:0}),[]),f=c.useRef([]),p=c.useMemo(()=>({dispatch:b=>{f.current.forEach(k=>k(b))},subscribe:b=>(f.current.push(b),{remove:()=>{f.current=f.current.filter(k=>k!==b)}})}),[]),m=c.useRef({scheduledEndTime:null,mediaEndTime:null}),h=c.useRef(new Map),w=c.useCallback(b=>{h.current.delete(b)},[]),v=c.useMemo(()=>({node:b,mediaTimestamp:k,sourceOffset:E,scheduledTime:I,duration:T,offset:_,originalUnloopedMediaTimestamp:$})=>{if(!s)throw new Error("Audio context not found");const M=s.getState();if(M==="closed")return{type:"not-started",reason:"audio context is closed"};const P=Fk(M);T>0&&(P?h.current.set(b,{scheduledTime:I,offset:_,duration:T}):b.start(I,_,T));const D=I+T/b.playbackRate.value,O=k+_-E,A=O+T,Z=s.audioContext.baseLatency+s.audioContext.outputLatency,R=I-s.audioContext.currentTime,C=m.current,j=C.scheduledEndTime!==null&&Math.abs(I-C.scheduledEndTime)>.001,F=C.mediaEndTime!==null&&Math.abs(O-C.mediaEndTime)>.001;return rt.verbose({logLevel:o,tag:"audio-scheduling"},"scheduled %c%s%c %s %c%s%c %s %c%s%c %s %s %s %s %s",j?"color: red; font-weight: bold":"",I.toFixed(4),"",D.toFixed(4),F?"color: red; font-weight: bold":"",O.toFixed(4),"",A.toFixed(4),T<0||R<0?"color: red; font-weight: bold":"color: blue; font-weight: bold",T<0?"missed "+Math.abs(_).toFixed(2)+"s":Math.abs(R).toFixed(2)+(R<0?" delay":" ahead"),"","current="+s.audioContext.currentTime.toFixed(4),"offset="+_.toFixed(4),"latency="+Z.toFixed(4),"state="+s.audioContext.state,$!==O?"original_ts="+$.toFixed(4):"","action="+(P?"schedule":"start"),""),C.scheduledEndTime=D,C.mediaEndTime=A,T>0?{type:"started",scheduledTime:I}:{type:"not-started",reason:"missed "+Math.abs(_).toFixed(2)+"s"}},[s,o]),S=c.useCallback(()=>{if(!s||a.current)return Promise.resolve();a.current=!0,s.gainNode.gain.cancelScheduledValues(s.audioContext.currentTime),s.gainNode.gain.setValueAtTime(0,s.audioContext.currentTime),s.gainNode.gain.linearRampToValueAtTime(1,s.audioContext.currentTime+.03),h.current.forEach((k,E)=>{E.start(k.scheduledTime,k.offset,k.duration)}),h.current.clear();const b=s.resume();return l.current=new Promise(k=>{Rk(s.audioContext,o).then(k),b.catch(E=>{rt.warn({logLevel:o,tag:"audio"},"AudioContext resume rejected, continuing without audio sync",E),k()})}).finally(()=>{l.current=null}),b.catch(()=>{})},[s,o]),g=c.useCallback(()=>l.current,[]),y=c.useCallback(()=>!s||!a.current?Promise.resolve():(a.current=!1,s.suspend()),[s]),x=c.useMemo(()=>({audioContext:(s==null?void 0:s.audioContext)??null,getAudioContextState:()=>(s==null?void 0:s.getState())??null,gainNode:(s==null?void 0:s.gainNode)??null,audioSyncAnchor:u,audioSyncAnchorEmitter:p,scheduleAudioNode:v,resume:S,suspend:y,getIsResumingAudioContext:g,unscheduleAudioNode:w}),[s,u,p,v,S,y,g,w]);return d.jsx(Xo.Provider,{value:x,children:e})},z0=({children:e,numberOfAudioTags:t})=>{const n=c.useRef([]),[r]=c.useState(t);if(t!==r)throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");const o=In(),i=fs(),s=Ze(),a=c.useContext(Xo),l=(a==null?void 0:a.audioContext)??null,u=a==null?void 0:a.resume,[f]=c.useState(()=>new Array(t).fill(!0).map(()=>{const b=c.createRef();return{id:Math.random(),ref:b,mediaElementSourceNode:Af({audioContext:l,ref:b})}}));for(const{mediaElementSourceNode:b}of f)b==null||b.setAudioContext(l);(J.useInsertionEffect??J.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{f.forEach(({mediaElementSourceNode:b})=>{b==null||b.cleanup()})})},[f]);const m=c.useRef(new Array(t).fill(!1)),h=c.useCallback(()=>{f.forEach(({ref:b,id:k})=>{var T;const E=(T=n.current)==null?void 0:T.find(_=>_.id===k),{current:I}=b;if(I){if(E===void 0){I.src!==Ou&&(I.src=Ou);return}if(!E)throw new TypeError("Expected audio data to be there");Object.keys(E.props).forEach(_=>{Pk(_,E.props[_],I[_])&&(I[_]=E.props[_])})}})},[f]),w=c.useCallback(b=>{var Z,R;const{aud:k,audioId:E,premounting:I,postmounting:T}=b,_=(Z=n.current)==null?void 0:Z.find(C=>C.audioId===E);if(_)return _;const $=m.current.findIndex(C=>C===!1);if($===-1)throw new Error(`Tried to simultaneously mount ${t+1} <Html5Audio /> tags at the same time. With the current settings, the maximum amount of <Html5Audio /> tags is limited to ${t} 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:M,ref:P,mediaElementSourceNode:D}=f[$],O=[...m.current];O[$]=M,m.current=O;const A={props:k,id:M,el:P,audioId:E,mediaElementSourceNode:D,premounting:I,audioMounted:!!P.current,postmounting:T,cleanupOnMediaTagUnmount:()=>{}};return(R=n.current)==null||R.push(A),h(),A},[t,f,h]),v=c.useCallback(b=>{var I;const k=[...m.current],E=f.findIndex(T=>T.id===b);if(E===-1)throw new TypeError(`Unknown audio ref ${b}; refs: ${f.map(T=>T.id).join(", ")}`);k[E]=!1,m.current=k,n.current=(I=n.current)==null?void 0:I.filter(T=>T.id!==b),h()},[f,h]),S=c.useCallback(({aud:b,audioId:k,id:E,premounting:I,postmounting:T})=>{var $;let _=!1;n.current=($=n.current)==null?void 0:$.map(M=>{const P=!!M.el.current;return M.audioMounted!==P&&(_=!0),M.id===E?_k(b,M.props)&&M.premounting===I&&M.postmounting===T?M.audioMounted===P?M:{...M,audioMounted:P}:(_=!0,{...M,props:b,premounting:I,postmounting:T,audioId:k,audioMounted:P}):M.audioMounted===P?M:{...M,audioMounted:P}}),_&&h()},[h]),g=c.useCallback(()=>{f.forEach(b=>{const k=n.current.find(E=>E.el===b.ref);k!=null&&k.premounting||tl({mediaRef:b.ref,mediaType:"audio",onAutoPlayError:null,logLevel:o,mountTime:i,reason:"playing all audios",isPlayer:s.isPlayer})}),u==null||u()},[o,i,f,s.isPlayer,u]),y=c.useMemo(()=>({registerAudio:w,unregisterAudio:v,updateAudio:S,playAllAudios:g,numberOfAudioTags:t}),[t,g,w,v,S]),x=c.useMemo(()=>f.map(({id:b,ref:k})=>d.jsx("audio",{ref:k,preload:"metadata",src:Ou},b)),[f]);return d.jsxs(Yl.Provider,{value:y,children:[x,e]})},jk=({aud:e,audioId:t,premounting:n,postmounting:r})=>{var l;const o=c.useContext(Xo),i=c.useContext(Yl),[s]=c.useState(()=>{if(i&&i.numberOfAudioTags>0)return i.registerAudio({aud:e,audioId:t,premounting:n,postmounting:r});const u=J.createRef(),f=Af({audioContext:(o==null?void 0:o.audioContext)??null,ref:u});return{el:u,id:Math.random(),props:e,audioId:t,mediaElementSourceNode:f,premounting:n,audioMounted:!!u.current,postmounting:r,cleanupOnMediaTagUnmount:()=>{f==null||f.cleanup()}}});(l=s.mediaElementSourceNode)==null||l.setAudioContext((o==null?void 0:o.audioContext)??null);const a=J.useInsertionEffect??J.useLayoutEffect;return typeof document<"u"&&(a(()=>{i&&i.numberOfAudioTags>0&&i.updateAudio({id:s.id,aud:e,audioId:t,premounting:n,postmounting:r})},[e,i,s.id,t,n,r]),a(()=>()=>{i&&i.numberOfAudioTags>0&&i.unregisterAudio(s.id)},[i,s.id])),s},Mk=1e-5,nl=(e,t)=>Math.abs(e-t)<Mk,D0=(e,t)=>Math.round(e/t*100)/100,ld=()=>typeof window>"u"||!/AppleWebKit/.test(window.navigator.userAgent)?!1:!window.navigator.userAgent.includes("Chrome/"),Kl=()=>typeof window>"u"?!1:/iP(ad|od|hone)/i.test(window.navigator.userAgent)&&ld(),$k=e=>Kl()&&e.startsWith("blob:"),ud=({actualFrom:e,fps:t})=>D0(Math.max(0,-e),t),cd=({duration:e,fps:t})=>D0(e,t),Ak=({actualSrc:e,actualFrom:t,duration:n,fps:r})=>{if($k(e)||e.startsWith("data:")||!!new URL(e,(typeof window>"u"?null:window.location.href)??"http://localhost:3000").hash||!Number.isFinite(t))return e;const i=`${e}#t=${ud({actualFrom:t,fps:r})}`;return Number.isFinite(n)?`${i},${cd({duration:n,fps:r})}`:i},Nk=({prevStartFrom:e,newStartFrom:t,prevDuration:n,newDuration:r,fps:o})=>{const i=ud({actualFrom:e,fps:o}),s=ud({actualFrom:t,fps:o}),a=cd({duration:n,fps:o}),l=cd({duration:r,fps:o});return!(s<i||l>a)},Lk=({actualSrc:e,actualFrom:t,duration:n,fps:r})=>{const o=c.useRef(t),i=c.useRef(n),s=c.useRef(e);return(!Nk({prevStartFrom:o.current,newStartFrom:t,prevDuration:i.current,newDuration:n,fps:r})||e!==s.current)&&(o.current=t,i.current=n,s.current=e),Ak({actualSrc:s.current,actualFrom:o.current,duration:i.current,fps:r})},Hm=!1,zk=e=>{Hm||(Hm=!0,rt.warn({logLevel:e,tag:null},"In Safari, setting a volume and a playback rate at the same time is buggy."),rt.warn({logLevel:e,tag:null},"In Desktop Safari, only volumes <= 1 will be applied."),rt.warn({logLevel:e,tag:null},e,"In Mobile Safari, the volume will be ignored and set to 1 if a playbackRate is set."))},O0=({mediaRef:e,volume:t,logLevel:n,source:r,shouldUseWebAudioApi:o})=>{var m,h,w;const i=c.useRef(null),s=c.useRef(t);s.current=t;const a=c.useContext(Xo);if(!a)throw new Error("useAmplification must be used within a SharedAudioContext");const{audioContext:l,gainNode:u}=a;if(typeof window<"u"&&c.useLayoutEffect(()=>{var S,g;if(!l||!e.current||!o)return;if(e.current.playbackRate!==1&&ld()){zk(n);return}if(!r||!u)return;const v=new GainNode(l,{gain:s.current});return r.attemptToConnect(),r.get().connect(v),v.connect(u),i.current={gainNode:v},rt.trace({logLevel:n,tag:null},`Starting to amplify ${(S=e.current)==null?void 0:S.src}. Gain = ${s.current}, playbackRate = ${(g=e.current)==null?void 0:g.playbackRate}`),()=>{i.current=null,v.disconnect(),r.get().disconnect()}},[n,e,l,r,o,u]),i.current){const v=t;nl(i.current.gainNode.gain.value,v)||(i.current.gainNode.gain.value=v,rt.trace({logLevel:n,tag:null},`Setting gain to ${v} for ${(m=e.current)==null?void 0:m.src}`))}return(ld()&&e.current&&((h=e.current)==null?void 0:h.playbackRate)!==1||!o)&&e.current&&!nl(t,(w=e.current)==null?void 0:w.volume)&&(e.current.volume=Math.min(t,1)),i},zr=()=>{const e=c.useContext(et);return(e==null?void 0:e.cumulatedNegativeFrom)??0},Go=e=>{const t=Bl.useLoop(),n=ct(),r=zr();return e==="repeat"||t===null?n+r:n+r+t.durationInFrames*t.iteration},V0=e=>{if(/data:|blob:/.test(e.substring(0,5)))return"Data URL";const t=e.split("/").map(n=>n.split("\\")).flat(1);return t[t.length-1]},Dk=({compositionDurationInFrames:e,playbackRate:t,trimBefore:n,trimAfter:r,parentSequenceDurationInFrames:o,loop:i})=>{if(i)return e;const s=Vl({mediaDurationInFrames:e*t+(n??0),playbackRate:t,trimBefore:n,trimAfter:r});if(o!==null){const a=Math.min(o,s);return Number(a.toFixed(10))}return s},Kr=({frame:e,volume:t,mediaVolume:n=1})=>{if(typeof t=="number")return t*n;if(typeof t>"u")return Number(n);const r=t(e)*n;if(typeof r!="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 r} for frame ${e}`);if(Number.isNaN(r))throw new TypeError(`You passed in a function to the volume prop but it returned NaN for frame ${e}.`);if(!Number.isFinite(r))throw new TypeError(`You passed in a function to the volume prop but it returned a non-finite number for frame ${e}.`);return Math.max(0,r)},Zm={},Ok=e=>{Zm[e]||(console.warn(e),Zm[e]=!0)},B0=({volume:e,mediaVolume:t,mediaType:n,src:r,displayName:o,trimBefore:i,trimAfter:s,playbackRate:a,sequenceDurationInFrames:l,mediaStartsAt:u,loop:f})=>{if(!r)throw new Error("No src passed");const p=c.useContext(et),[m]=c.useState(()=>e),h=Dk({compositionDurationInFrames:l,playbackRate:a,trimBefore:i,trimAfter:s,parentSequenceDurationInFrames:(p==null?void 0:p.durationInFrames)??null,loop:f}),w=c.useMemo(()=>typeof e=="number"?e:new Array(Math.floor(Math.max(0,h+u))).fill(!0).map((b,k)=>Kr({frame:k+u,volume:e,mediaVolume:t})).join(","),[h,u,e,t]);c.useEffect(()=>{typeof e=="number"&&e!==m&&Ok(`Remotion: The ${n} with src ${r} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/audio/volume`)},[m,n,r,e]);const v=typeof e=="function",S=Il(),{rootId:g}=wr(),y=0-u+(i??0);return c.useMemo(()=>({volumes:w,duration:h,doesVolumeChange:v,nonce:S,rootId:g,finalDisplayName:o??V0(r),startMediaFrom:y,src:r,playbackRate:a}),[w,h,v,S,g,o,r,y,a])},Nf=({volume:e,mediaVolume:t,src:n,mediaType:r,playbackRate:o,displayName:i,id:s,getStack:a,showInTimeline:l,premountDisplay:u,postmountDisplay:f,loopDisplay:p,documentationLink:m,refForOutline:h})=>{const w=c.useContext(et),v=zr(),{registerSequence:S,unregisterSequence:g}=c.useContext(Yo),{durationInFrames:y}=Xe(),x=zr(),{volumes:b,duration:k,doesVolumeChange:E,nonce:I,rootId:T,finalDisplayName:_}=B0({volume:e,mediaVolume:t,mediaType:r,src:n,displayName:i,trimAfter:void 0,trimBefore:void 0,playbackRate:o,sequenceDurationInFrames:y,mediaStartsAt:x,loop:!1}),{isStudio:$}=Ze();c.useEffect(()=>{var M,P;if(!n)throw new Error("No src passed");if(!(!$&&((P=(M=window.process)==null?void 0:M.env)==null?void 0:P.NODE_ENV)!=="test")&&l)return S({type:r,src:n,id:s,duration:k,from:0,trimBefore:null,parent:(w==null?void 0:w.id)??null,displayName:_,documentationLink:m,rootId:T,volume:b,showInTimeline:!0,nonce:I.get(),startMediaFrom:0-v,mediaFrameAtSequenceZero:null,doesVolumeChange:E,loopDisplay:p,playbackRate:o,getStack:a,premountDisplay:u,postmountDisplay:f,controls:null,effects:[],refForOutline:h,isInsideSeries:!1,frozenFrame:null,frozenMediaFrame:null}),()=>{g(s)}},[k,s,w,n,S,g,b,E,I,r,v,o,a,l,u,f,p,m,T,_,$,h])},Vk=(e,t)=>{const[n,r]=c.useState([]),[o,i]=c.useState([]),[s,a]=c.useState([]),u=Ze().isRendering,f=c.useRef(!1),p=c.useCallback(w=>{if(u)return{unblock:()=>{}};let v=!1;return r(S=>[...S,w]),{unblock:()=>{v||(v=!0,r(S=>{const g=S.filter(y=>y!==w);return g.length===S.length?S:g}))}}},[u]),m=c.useCallback(w=>(i(v=>[...v,w]),{remove:()=>{i(v=>v.filter(S=>S!==w))}}),[]),h=c.useCallback(w=>(a(v=>[...v,w]),{remove:()=>{a(v=>v.filter(S=>S!==w))}}),[]);return c.useEffect(()=>{u||n.length>0&&!f.current&&(f.current=!0,o.forEach(w=>w()),gt({logLevel:e,message:"Player is entering buffer state",mountTime:t,tag:"player"}))},[n]),typeof window<"u"&&c.useLayoutEffect(()=>{u||n.length===0&&f.current&&(f.current=!1,s.forEach(w=>w()),gt({logLevel:e,message:"Player is exiting buffer state",mountTime:t,tag:"player"}))},[n]),c.useMemo(()=>({addBlock:p,listenForBuffering:m,listenForResume:h,buffering:f}),[p,f,m,h])},qo=J.createContext(null),W0=({children:e})=>{const{logLevel:t,mountTime:n}=c.useContext(Ur),r=Vk(t??"info",n);return d.jsx(qo.Provider,{value:r,children:e})},U0=e=>{const[t,n]=c.useState(e.buffering.current);return c.useEffect(()=>{const r=()=>{n(!0)},o=()=>{n(!1)},i=e.listenForBuffering(r),s=e.listenForResume(o);return()=>{i.remove(),s.remove()}},[e]),t},Xl=()=>{const e=c.useContext(qo),t=In(),n=e?e.addBlock:null;return c.useMemo(()=>({delayPlayback:()=>{if(!n)throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a <Composition>. Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");rt.trace({logLevel:t,tag:"[buffer-state]"},"Adding buffer handle",new Error().stack);const{unblock:r}=n({id:String(Math.random())});let o=!1;return{unblock:()=>{o||(o=!0,rt.trace({logLevel:t,tag:"[buffer-state]"},"Removing buffer handle"),r())}}}}),[n,t])},Bk=()=>/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent),Wk=({mediaRef:e,mediaType:t,onVariableFpsVideoDetected:n,pauseWhenBuffering:r,logLevel:o,mountTime:i})=>{const s=c.useRef(!1),{delayPlayback:a}=Xl(),l=c.useCallback(u=>{var w;if(t!=="video"||!r)return;const f=e.current;if(!f)return;if(f.readyState>=f.HAVE_FUTURE_DATA&&!Bk()){gt({logLevel:o,message:`Not using buffer until first frame, because readyState is ${f.readyState} and is not Safari or Desktop Chrome`,mountTime:i,tag:"buffer"});return}if(!f.requestVideoFrameCallback){gt({logLevel:o,message:"Not using buffer until first frame, because requestVideoFrameCallback is not supported",mountTime:i,tag:"buffer"});return}s.current=!0,gt({logLevel:o,message:`Buffering ${(w=e.current)==null?void 0:w.src} until the first frame is received`,mountTime:i,tag:"buffer"});const p=a(),m=()=>{p.unblock(),f.removeEventListener("ended",m,{once:!0}),f.removeEventListener("pause",m,{once:!0}),s.current=!1},h=()=>{m()};f.requestVideoFrameCallback((v,S)=>{Math.abs(S.mediaTime-u)>.5&&n(),m()}),f.addEventListener("ended",h,{once:!0}),f.addEventListener("pause",h,{once:!0}),f.addEventListener("canplay",h,{once:!0})},[a,o,e,t,i,n,r]);return c.useMemo(()=>({isBuffering:()=>s.current,bufferUntilFirstFrame:l}),[l])},Uk=e=>{const{duration:t,currentTime:n,paused:r,ended:o,desiredUnclampedTime:i,mediaTagTime:s,mediaTagLastUpdate:a,rvcTime:l,rvcLastUpdate:u,isVariableFpsVideo:f,acceptableTimeShift:p,lastSeekDueToShift:m,playing:h,playbackRate:w,mediaTagBufferingOrStalled:v,playerBuffering:S,absoluteFrame:g,onlyWarnForMediaSeekingError:y,isPremounting:x,isPostmounting:b,pauseWhenBuffering:k}=e,E=!Number.isNaN(t)&&Number.isFinite(t)?Math.min(t,i):i,I=Math.abs(E-s),T=l?Math.abs(E-l):null,_=u&&l>a?T:I,$=T&&!f?_:I;if($>p&&m!==E)return{type:"seek-due-to-shift",shouldBeTime:E,why:`because time shift is too big. shouldBeTime = ${E}, isTime = ${s}, requestVideoCallbackTime = ${l}, timeShift = ${$}${f?", isVariableFpsVideo = true":""}, isPremounting = ${x}, isPostmounting = ${b}, pauseWhenBuffering = ${k}`,bufferUntilFirstFrame:h&&w>0,playReason:h&&r?"player is playing but media tag is paused, and just seeked":null,warnAboutNonSeekable:!y};const M=h?.15:.01,P=Math.abs(n-E)>M;if(!h||S&&!v)return{type:"seek-if-not-playing",shouldBeTime:E,why:P?`not playing or something else is buffering. time offset is over seek threshold (${M})`:null};if(!h||S)return{type:"none"};const O=r&&!o;if(O||g===0){const Z=O?"media tag is paused":"absolute frame is 0";return{type:"play-and-seek",shouldBeTime:E,why:P?`is over timeshift threshold (threshold = ${M}) and ${Z}`:null,playReason:`player is playing and ${Z}`,bufferUntilFirstFrame:!f&&w>0}}return{type:"none"}},Hk=e=>{var r,o;const t=J.useRef({time:((r=e.current)==null?void 0:r.currentTime)??0,lastUpdate:performance.now()}),n=((o=e.current)==null?void 0:o.currentTime)??null;return n!==null&&t.current.time!==n&&(t.current.time=n,t.current.lastUpdate=performance.now()),t},ka=({mediaRef:e,time:t,logLevel:n,why:r,mountTime:o})=>{const i=Kl()?Number(t.toFixed(1)):t;return gt({logLevel:n,tag:"seek",message:`Seeking from ${e.currentTime} to ${i}. src= ${e.src} Reason: ${r}`,mountTime:o}),e.currentTime=i,i},Zk=({element:e,shouldBuffer:t,isPremounting:n,isPostmounting:r,logLevel:o,mountTime:i,src:s})=>{const a=Xl(),[l,u]=c.useState(!1);return c.useEffect(()=>{let f=[];const{current:p}=e;if(!p||!t)return;if(n||r){if((n||r)&&p.readyState<p.HAVE_FUTURE_DATA&&!navigator.userAgent.includes("Firefox/")){gt({logLevel:o,message:`Calling .load() on ${p.src} because readyState is ${p.readyState} and it is not Firefox. Element is premounted ${p.playbackRate}`,tag:"load",mountTime:i});const v=p.playbackRate;p.load(),p.playbackRate=v}return}const m=v=>{let S=!1;f.forEach(g=>{g(v),S=!0}),f=[],u(g=>(g&&(S=!0),!1)),S&>({logLevel:o,message:`Unmarking as buffering: ${p.src}. Reason: ${v}`,tag:"buffer",mountTime:i})},h=v=>{u(!0),gt({logLevel:o,message:`Marking as buffering: ${p.src}. Reason: ${v}`,tag:"buffer",mountTime:i});const{unblock:S}=a.delayPlayback(),g=()=>{m('"canplay" was fired'),w()},y=()=>{m('"error" event was occurred'),w()};p.addEventListener("canplay",g,{once:!0}),f.push(()=>{p.removeEventListener("canplay",g)}),p.addEventListener("error",y,{once:!0}),f.push(()=>{p.removeEventListener("error",y)}),f.push(x=>{gt({logLevel:o,message:`Unblocking ${p.src} from buffer. Reason: ${x}`,tag:"buffer",mountTime:i}),S()})},w=()=>{if(p.readyState<p.HAVE_FUTURE_DATA){if(h(`readyState is ${p.readyState}, which is less than HAVE_FUTURE_DATA`),!navigator.userAgent.includes("Firefox/")){gt({logLevel:o,message:`Calling .load() on ${s} because readyState is ${p.readyState} and it is not Firefox. ${p.playbackRate}`,tag:"load",mountTime:i});const v=p.playbackRate;p.load(),p.playbackRate=v}}else{const v=()=>{h('"waiting" event was fired')};p.addEventListener("waiting",v),f.push(()=>{p.removeEventListener("waiting",v)})}};return w(),()=>{m("element was unmounted or prop changed")}},[a,s,e,n,r,o,t,i]),l},Yk=({mediaRef:e,mediaType:t,lastSeek:n,onVariableFpsVideoDetected:r})=>{const o=c.useRef(null);return c.useEffect(()=>{const{current:i}=e;if(i)o.current={time:i.currentTime,lastUpdate:performance.now()};else{o.current=null;return}if(t!=="video"){o.current=null;return}const s=i;if(!s.requestVideoFrameCallback)return;let a=()=>{};const l=()=>{if(!s)return;const u=s.requestVideoFrameCallback((f,p)=>{if(o.current!==null){const m=Math.abs(o.current.time-p.mediaTime),h=Math.abs(n.current===null?1/0:p.mediaTime-n.current);m>.5&&h>.5&&p.mediaTime>o.current.time&&r()}o.current={time:p.mediaTime,lastUpdate:performance.now()},l()});a=()=>{s.cancelVideoFrameCallback(u),a=()=>{}}};return l(),()=>{a()}},[n,e,t,r]),o},H0=({frame:e,playbackRate:t,startFrom:n})=>Ko(e,[-1,n,n+1],[-1,n,n+t]),Z0=({fps:e,frame:t,playbackRate:n,startFrom:r})=>{const o=H0({frame:t,playbackRate:n,startFrom:r}),i=1e3/e;return o*i/1e3},Ym={},Kk=(e,t)=>{if(e===null||e.seekable.length===0||e.seekable.length>1||Ym[e.src])return;const n={start:e.seekable.start(0),end:e.seekable.end(0)};if(n.start===0&&n.end===0){const r=[`The media ${e.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(`
|
|
57
|
-
`);console.error(r),Ym[e.src]=!0}},Y0=({mediaRef:e,src:t,mediaType:n,playbackRate:r,preservePitch:o=!0,onlyWarnForMediaSeekingError:i,acceptableTimeshift:s,pauseWhenBuffering:a,isPremounting:l,isPostmounting:u,onAutoPlayError:f})=>{const{playbackRate:p}=kf(),m=ct(),h=xr(),[w]=Ky(),v=c.useContext(qo),{fps:S}=Xe(),g=zr(),y=c.useRef(null),x=c.useRef(null),b=In(),k=fs();if(!v)throw new Error("useMediaPlayback must be used inside a <BufferingContext>");const E=c.useRef({}),I=c.useCallback(()=>{t&&(E.current[t]||(rt.verbose({logLevel:b,tag:null},`Detected ${t} as a variable FPS video. Disabling buffering while seeking.`),E.current[t]=!0))},[b,t]),T=Yk({mediaRef:e,mediaType:n,lastSeek:x,onVariableFpsVideoDetected:I}),_=Hk(e),$=Z0({frame:m,playbackRate:r,startFrom:-g,fps:S}),M=Zk({element:e,shouldBuffer:a,isPremounting:l,isPostmounting:u,logLevel:b,mountTime:k,src:t??null}),{bufferUntilFirstFrame:P,isBuffering:D}=Wk({mediaRef:e,mediaType:n,onVariableFpsVideoDetected:I,pauseWhenBuffering:a,logLevel:b,mountTime:k}),O=r*p,A=(()=>{var V;return(V=e.current)!=null&&V.duration?Math.min(e.current.duration,s??.65):s??.65})(),Z=U0(v);c.useEffect(()=>{var F,V,W,N,L;if((F=e.current)!=null&&F.paused)return;if(!w){gt({logLevel:b,tag:"pause",message:`Pausing ${(V=e.current)==null?void 0:V.src} because ${l?"media is premounting":u?"media is postmounting":"Player is not playing"}`,mountTime:k}),(W=e.current)==null||W.pause();return}const C=M||D();v.buffering.current&&!C&&(gt({logLevel:b,tag:"pause",message:`Pausing ${(N=e.current)==null?void 0:N.src} because player is buffering but media tag is not`,mountTime:k}),(L=e.current)==null||L.pause())},[D,M,v,Z,l,b,e,n,k,w,u]);const R=Ze();c.useLayoutEffect(()=>{const C=Math.max(0,O);e.current&&e.current.playbackRate!==C&&(e.current.playbackRate=C),e.current&&e.current.preservesPitch!==o&&(e.current.preservesPitch=o)},[e,O,o]),c.useEffect(()=>{var V,W;const C=n==="audio"?"<Html5Audio>":"<Html5Video>";if(!e.current)throw new Error(`No ${n} ref found`);if(!t)throw new Error(`No 'src' attribute was passed to the ${C} element.`);const{current:j}=e,F=Uk({duration:j.duration,currentTime:j.currentTime,paused:j.paused,ended:j.ended,desiredUnclampedTime:$,mediaTagTime:_.current.time,mediaTagLastUpdate:_.current.lastUpdate,rvcTime:((V=T.current)==null?void 0:V.time)??null,rvcLastUpdate:((W=T.current)==null?void 0:W.lastUpdate)??null,isVariableFpsVideo:!!E.current[t],acceptableTimeShift:A,lastSeekDueToShift:y.current,playing:w,playbackRate:O,mediaTagBufferingOrStalled:M||D(),playerBuffering:v.buffering.current,absoluteFrame:h,onlyWarnForMediaSeekingError:i,isPremounting:l,isPostmounting:u,pauseWhenBuffering:a});if(F.type!=="none"){if(F.type==="seek-due-to-shift"){x.current=ka({mediaRef:j,time:F.shouldBeTime,logLevel:b,why:F.why,mountTime:k}),y.current=x.current,F.bufferUntilFirstFrame&&P(F.shouldBeTime),F.playReason!==null&&tl({mediaRef:e,mediaType:n,onAutoPlayError:f,logLevel:b,mountTime:k,reason:F.playReason,isPlayer:R.isPlayer}),F.warnAboutNonSeekable&&Kk(j);return}if(F.type==="seek-if-not-playing"){F.why!==null&&(x.current=ka({mediaRef:j,time:F.shouldBeTime,logLevel:b,why:F.why,mountTime:k}));return}F.why!==null&&(x.current=ka({mediaRef:j,time:F.shouldBeTime,logLevel:b,why:F.why,mountTime:k})),tl({mediaRef:e,mediaType:n,onAutoPlayError:f,logLevel:b,mountTime:k,reason:F.playReason,isPlayer:R.isPlayer}),F.bufferUntilFirstFrame&&P(F.shouldBeTime)}},[h,A,P,v.buffering,T,b,$,D,M,e,n,i,O,w,t,f,l,u,a,k,_,R.isPlayer])},K0=({mediaRef:e,id:t,mediaType:n,onAutoPlayError:r,isPremounting:o,isPostmounting:i})=>{const{audioAndVideoTags:s,imperativePlaying:a}=wr(),l=In(),u=fs(),f=Ze();c.useEffect(()=>{const p={id:t,play:m=>{if(a.current&&!(o||i))return tl({mediaRef:e,mediaType:n,onAutoPlayError:r,logLevel:l,mountTime:u,reason:m,isPlayer:f.isPlayer})}};return s.current.push(p),()=>{s.current=s.current.filter(m=>m.id!==t)}},[s,t,e,n,r,a,o,i,l,u,f.isPlayer])},Lf=c.createContext({playerMuted:!1,mediaVolume:1}),zf=c.createContext({setPlayerMuted:()=>{throw new Error("default")},setMediaVolume:()=>{throw new Error("default")}}),Df=()=>{const{mediaVolume:e}=c.useContext(Lf),{setMediaVolume:t}=c.useContext(zf);return c.useMemo(()=>[e,t],[e,t])},Of=()=>{const{playerMuted:e}=c.useContext(Lf),{setPlayerMuted:t}=c.useContext(zf);return c.useMemo(()=>[e,t],[e,t])},Qo=e=>{if(e>=100)throw new Error(`Volume was set to ${e}, 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.`)},Xk=(e,t)=>{const[n]=c.useState(e.shouldPreMountAudioTags);if(e.shouldPreMountAudioTags!==n)throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");const r=In(),{volume:o,muted:i,playbackRate:s,preservePitch:a,shouldPreMountAudioTags:l,src:u,onDuration:f,acceptableTimeShiftInSeconds:p,_remotionInternalNeedsDurationCalculation:m,_remotionInternalNativeLoopPassed:h,_remotionInternalStack:w,allowAmplificationDuringRender:v,name:S,pauseWhenBuffering:g,showInTimeline:y,loopVolumeCurveBehavior:x,stack:b,crossOrigin:k,delayRenderRetries:E,delayRenderTimeoutInMilliseconds:I,toneFrequency:T,useWebAudioApi:_,onError:$,onNativeError:M,audioStreamIndex:P,...D}=e,[O]=Df(),[A]=Of(),Z=Go(x??"repeat");if(!u)throw new TypeError("No 'src' was passed to <Html5Audio>.");const R=Yr(u),C=c.useContext(et),[j]=c.useState(()=>String(Math.random())),F=Kr({frame:Z,volume:o,mediaVolume:O});Qo(F);const V=$f({crossOrigin:k,requestsVideoFrame:!1,isClientSideRendering:!1}),W=c.useMemo(()=>({muted:i||A||F<=0,src:R,loop:h,crossOrigin:V,...D}),[h,A,i,D,R,F,V]),N=c.useMemo(()=>`audio-${Hr(u??"")}-${C==null?void 0:C.relativeFrom}-${C==null?void 0:C.cumulatedFrom}-${C==null?void 0:C.durationInFrames}-muted:${e.muted}-loop:${e.loop}`,[u,C==null?void 0:C.relativeFrom,C==null?void 0:C.cumulatedFrom,C==null?void 0:C.durationInFrames,e.muted,e.loop]),{el:L,mediaElementSourceNode:B,cleanupOnMediaTagUnmount:H}=jk({aud:W,audioId:N,premounting:!!(C!=null&&C.premounting),postmounting:!!(C!=null&&C.postmounting)}),z=c.useCallback(()=>w??null,[w]);Nf({volume:o,mediaVolume:O,src:u,mediaType:"audio",playbackRate:s??1,displayName:S??null,id:j,getStack:z,showInTimeline:y,premountDisplay:(C==null?void 0:C.premountDisplay)??null,postmountDisplay:(C==null?void 0:C.postmountDisplay)??null,loopDisplay:void 0,documentationLink:"https://www.remotion.dev/docs/html5-audio",refForOutline:null}),Y0({mediaRef:L,src:u,mediaType:"audio",playbackRate:s??1,preservePitch:a,onlyWarnForMediaSeekingError:!1,acceptableTimeshift:p??null,isPremounting:!!(C!=null&&C.premounting),isPostmounting:!!(C!=null&&C.postmounting),pauseWhenBuffering:g,onAutoPlayError:null}),K0({id:j,isPostmounting:!!(C!=null&&C.postmounting),isPremounting:!!(C!=null&&C.premounting),mediaRef:L,mediaType:"audio",onAutoPlayError:null}),O0({logLevel:r,mediaRef:L,source:B,volume:F,shouldUseWebAudioApi:_??!1}),(J.useInsertionEffect??J.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{H()})},[H]),c.useImperativeHandle(t,()=>L.current,[L]);const oe=c.useRef(f);return oe.current=f,c.useEffect(()=>{var se;const{current:ae}=L;if(!ae)return;if(ae.duration){(se=oe.current)==null||se.call(oe,ae.src,ae.duration);return}const ce=()=>{var G;(G=oe.current)==null||G.call(oe,ae.src,ae.duration)};return ae.addEventListener("loadedmetadata",ce),()=>{ae.removeEventListener("loadedmetadata",ce)}},[L,u]),n?null:d.jsx("audio",{ref:L,preload:"metadata",crossOrigin:V,...W})},X0=c.forwardRef(Xk),Gk=(e,t)=>{const n=c.useRef(null),{volume:r,playbackRate:o,allowAmplificationDuringRender:i,onDuration:s,toneFrequency:a,_remotionInternalNeedsDurationCalculation:l,_remotionInternalNativeLoopPassed:u,acceptableTimeShiftInSeconds:f,name:p,onNativeError:m,delayRenderRetries:h,delayRenderTimeoutInMilliseconds:w,loopVolumeCurveBehavior:v,pauseWhenBuffering:S,audioStreamIndex:g,preservePitch:y,...x}=e,b=xr(),k=Go(v??"repeat"),E=ct(),I=c.useContext(et),{registerRenderAsset:T,unregisterRenderAsset:_}=c.useContext(Zr),{delayRender:$,continueRender:M}=pn(),P=c.useMemo(()=>`audio-${Hr(e.src??"")}-${I==null?void 0:I.relativeFrom}-${I==null?void 0:I.cumulatedFrom}-${I==null?void 0:I.durationInFrames}`,[e.src,I==null?void 0:I.relativeFrom,I==null?void 0:I.cumulatedFrom,I==null?void 0:I.durationInFrames]),D=Kr({volume:r,frame:k,mediaVolume:1});Qo(D),c.useImperativeHandle(t,()=>n.current,[]),c.useEffect(()=>{if(!e.src)throw new Error("No src passed");if(window.remotion_audioEnabled&&!e.muted&&!(D<=0))return T({type:"audio",src:Cn(e.src),id:P,frame:b,volume:D,mediaFrame:E,playbackRate:e.playbackRate??1,toneFrequency:a??1,audioStartFrame:Math.max(0,-((I==null?void 0:I.cumulatedNegativeFrom)??0)),audioStreamIndex:g??0}),()=>_(P)},[e.muted,e.src,T,b,P,_,D,k,E,o,e.playbackRate,a,I==null?void 0:I.cumulatedNegativeFrom,g]);const{src:O}=e,A=t||l;return c.useLayoutEffect(()=>{var j,F;if(((F=(j=window.process)==null?void 0:j.env)==null?void 0:F.NODE_ENV)==="test"||!A)return;const Z=$("Loading <Html5Audio> duration with src="+O,{retries:h??void 0,timeoutInMilliseconds:w??void 0}),{current:R}=n,C=()=>{R!=null&&R.duration&&s(R.src,R.duration),M(Z)};return R!=null&&R.duration?(s(R.src,R.duration),M(Z)):R==null||R.addEventListener("loadedmetadata",C,{once:!0}),()=>{R==null||R.removeEventListener("loadedmetadata",C),M(Z)}},[O,s,A,h,w,M,$]),A?d.jsx("audio",{ref:n,...x,onError:m}):null},qk=c.forwardRef(Gk),Qk=(e,t)=>{const n=c.useContext(Yl),r=e,{startFrom:o,endAt:i,trimBefore:s,trimAfter:a,name:l,stack:u,pauseWhenBuffering:f,showInTimeline:p,onError:m,freeze:h,...w}=r,{loop:v,freeze:S,...g}=r,{fps:y}=Xe(),x=Ze(),b=ms(f);if(x.isClientSideRendering)throw new Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");if(typeof h<"u")throw new TypeError('The "freeze" prop is not supported on <Html5Audio />. Use <Sequence freeze={...}> to freeze media playback.');const{durations:k,setDurations:E}=c.useContext(Mf);if(typeof e.src!="string")throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);const I=Yr(e.src),T=c.useCallback(D=>{console.log(D.currentTarget.error);const O=`Could not play audio with src ${I}: ${D.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;if(v){if(m){m(new Error(O));return}es(new Error(O))}else m==null||m(new Error(O)),console.warn(O)},[v,m,I]),_=c.useCallback((D,O)=>{E({type:"got-duration",durationInSeconds:O,src:D})},[E]),$=k[Cn(I)]??k[Cn(e.src)];Hl({startFrom:o,endAt:i,trimBefore:s,trimAfter:a});const{trimBeforeValue:M,trimAfterValue:P}=Zl({startFrom:o,endAt:i,trimBefore:s,trimAfter:a});if(v&&$!==void 0){if(!Number.isFinite($))return d.jsx(Ca,{...g,ref:t,_remotionInternalNativeLoopPassed:!0});const D=$*y;return d.jsx(Bl,{layout:"none",durationInFrames:Vl({trimAfter:P,mediaDurationInFrames:D,playbackRate:e.playbackRate??1,trimBefore:M}),children:d.jsx(Ca,{...g,ref:t,_remotionInternalNativeLoopPassed:!0})})}return typeof M<"u"||typeof P<"u"?d.jsx(dt,{layout:"none",from:0-(M??0),showInTimeline:!1,durationInFrames:P,name:l,children:d.jsx(Ca,{_remotionInternalNeedsDurationCalculation:!!v,pauseWhenBuffering:b,...w,ref:t})}):(Ul({playbackRate:e.playbackRate,preservePitch:e.preservePitch,volume:e.volume},"Html5Audio"),x.isRendering?d.jsx(qk,{onDuration:_,...e,ref:t,onNativeError:T,_remotionInternalNeedsDurationCalculation:!!v}):d.jsx(X0,{_remotionInternalNativeLoopPassed:e._remotionInternalNativeLoopPassed??!1,_remotionInternalStack:u??null,shouldPreMountAudioTags:n!==null&&n.numberOfAudioTags>0,...e,ref:t,onNativeError:T,onDuration:_,pauseWhenBuffering:b,_remotionInternalNeedsDurationCalculation:!!v,showInTimeline:p??!0}))},Ca=c.forwardRef(Qk);St(Ca);var Jk=e=>{if(e===void 0)return 1;if(typeof e!="number"||!Number.isFinite(e)||e<=0)throw new Error(`<Solid>: \`pixelDensity\` must be a positive finite number. Received: ${String(e)}.`);return e},eC={...Bn,color:{type:"color",default:"transparent",description:"Color"},width:{type:"number",min:1,step:1,default:1920,description:"Width",hiddenFromList:!1},height:{type:"number",min:1,step:1,default:1080,description:"Height",hiddenFromList:!1},pixelDensity:{type:"number",min:1,max:3,step:.1,default:1,description:"Pixel density",hiddenFromList:!1},...Tn,...Sr,...br},tC=({color:e,width:t,height:n,effects:r=[],className:o,style:i,pixelDensity:s,overrideId:a,reference:l})=>{const{delayRender:u,continueRender:f,cancelRender:p}=pn(),m=Jk(s),h=Math.ceil(t*m),w=Math.ceil(n*m),[v,S]=c.useState(null),g=ys({effects:r,overrideId:a??null}),y=c.useMemo(()=>{if(typeof document>"u")return null;const E=document.createElement("canvas");return E.width=1,E.height=1,E},[]),x=xs(),b=c.useCallback(E=>{S(E),typeof l=="function"?l(E):l&&(l.current=E)},[l]);c.useEffect(()=>{if(!v||!y)return;const E=u("Solid effect chain");if(!x)return f(E),()=>{f(E)};const I=y.getContext("2d",{colorSpace:"srgb"});if(!I){p(new Error("Failed to acquire 2D context for <Solid> source"));return}return I.clearRect(0,0,1,1),e!==void 0&&(I.fillStyle=e,I.fillRect(0,0,1,1)),ws({state:x.get(h,w),source:y,effects:g,output:v,width:h,height:w}).then(T=>{T&&f(E)}).catch(T=>{p(T)}),()=>{f(E)}},[e,v,y,x,h,w,u,f,p,g]);const k=c.useMemo(()=>({width:t,height:n,...i??{}}),[n,i,t]);return d.jsx("canvas",{ref:b,width:h,height:w,className:o,style:k})},nC=c.forwardRef(({effects:e=[],controls:t,color:n,height:r,width:o,className:i,durationInFrames:s,style:a,name:l,from:u,trimBefore:f,freeze:p,hidden:m,showInTimeline:h,pixelDensity:w,...v},S)=>{const g=vs(e),y=c.useRef(null);return c.useImperativeHandle(S,()=>y.current,[]),d.jsx(dt,{layout:"none",from:u,trimBefore:f,freeze:p,hidden:m,showInTimeline:h,controls:t,_remotionInternalEffects:g,durationInFrames:s,name:l??"<Solid>",outlineRef:y,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/solid",...v,children:d.jsx(tC,{reference:y,overrideId:(t==null?void 0:t.overrideId)??null,color:n,height:r,width:o,className:i,style:a,effects:e,pixelDensity:w})})}),G0=Wn({Component:nC,componentName:"<Solid>",componentIdentity:"dev.remotion.remotion.Solid",schema:eC,supportsEffects:!0});G0.displayName="Solid";St(G0);var qs=null,q0=()=>{if(qs!==null)return qs;if(typeof document>"u")return!1;const e=document.createElement("canvas"),t=e.getContext("2d");return qs=typeof(t==null?void 0:t.drawElementImage)=="function"&&typeof e.requestPaint=="function"&&typeof e.captureElementImage=="function"&&"transferControlToOffscreen"in HTMLCanvasElement.prototype,qs},rC="HTML in Canvas is not supported. Two common causes: Chrome is older than version 148 (update Chrome), or the HTML-in-Canvas flag is disabled at chrome://flags/#canvas-draw-element (enable it and restart Chrome).";function oC(e,t){if(typeof e!="number"||typeof t!="number")throw new Error(`HtmlInCanvas: \`width\` and \`height\` must be numbers. Received width=${String(e)}, height=${String(t)}.`);if(!Number.isInteger(e)||e<=0)throw new Error(`HtmlInCanvas: \`width\` must be a positive integer. Received: ${String(e)}.`);if(!Number.isInteger(t)||t<=0)throw new Error(`HtmlInCanvas: \`height\` must be a positive integer. Received: ${String(t)}.`)}function iC(e){if(e===void 0)return 1;if(typeof e!="number"||!Number.isFinite(e)||e<=0)throw new Error(`HtmlInCanvas: \`pixelDensity\` must be a positive finite number. Received: ${String(e)}.`);return e}var Qs=e=>e instanceof DOMException&&e.name==="InvalidStateError",Km="HtmlInCanvas: Expected the element to be inside the viewport during rendering, but Chrome had no cached paint record for it.",Xm=({target:e,width:t,height:n})=>{e.width!==t&&(e.width=t),e.height!==n&&(e.height=n)},sC=({canvas:e,element:t,elementImage:n})=>{const r=e.getContext("2d");if(!r)throw new Error("Failed to acquire 2D context for <HtmlInCanvas> canvas");r.reset();const o=r.drawElementImage(n,0,0);t.style.transform=o.toString()},Gm=c.createContext(null),Q0=c.forwardRef(({width:e,height:t,effects:n,children:r,onPaint:o,onInit:i,pixelDensity:s,controls:a,style:l},u)=>{const f=c.useContext(Gm);oC(e,t);const p=iC(s),m=Math.ceil(e*p),h=Math.ceil(t*p),{delayRender:w,continueRender:v,cancelRender:S}=pn(),{isClientSideRendering:g,isRendering:y}=Ze(),x=!y||g,b=o===void 0&&i===void 0;q0()||S(new Error(rC));const k=c.useRef(null),E=c.useRef(null),I=c.useRef(null),T=`${e}x${t}@${p}-${b?"direct":"offscreen"}`,_=c.useCallback(L=>{k.current=L,typeof u=="function"?u(L):u&&(u.current=L)},[u]),$=xs(),M=ys({effects:n,overrideId:(a==null?void 0:a.overrideId)??null}),P=c.useRef(M);P.current=M;const D=c.useRef(o);D.current=o;const O=c.useRef(i);O.current=i;const A=c.useRef(!1),Z=c.useRef(null),R=c.useRef(!1),C=c.useRef(f);C.current=f;const j=c.useCallback(async()=>{var H;const L=I.current;if(!L)throw new Error("Canvas or scene element not found");const B=E.current;if(!B)throw new Error("HtmlInCanvas: paint target is not ready because the canvas is remounting");Xm({target:B,width:m,height:h});try{const z=k.current;if(!z)throw new Error("Canvas not found");const Y=w("onPaint");if(!A.current){const ae=O.current;if(!ae)A.current=!0;else{let ce;try{ce=z.captureElementImage(L)}catch(se){if(Qs(se)&&x){v(Y);return}throw Qs(se)?new Error(Km):se}A.current=!0;try{if(B instanceof HTMLCanvasElement)throw new Error("HtmlInCanvas: onInit requires an OffscreenCanvas paint target");const se=await ae({canvas:B,element:L,elementImage:ce,pixelDensity:p});if(typeof se!="function")throw new Error("HtmlInCanvas: when `onInit` is provided, it must return a cleanup function, or a Promise that resolves to one.");R.current?se():Z.current=se}finally{ce.close()}}}let oe;try{oe=z.captureElementImage(L)}catch(ae){if(Qs(ae)&&x){v(Y);return}throw Qs(ae)?new Error(Km):ae}try{const ae=D.current;if(ae){if(B instanceof HTMLCanvasElement)throw new Error("HtmlInCanvas: onPaint requires an OffscreenCanvas paint target");const ce=ae({canvas:B,element:L,elementImage:oe,pixelDensity:p});ce&&await ce}else sC({canvas:B,element:L,elementImage:oe,pixelDensity:p});await ws({state:$.get(m,h),source:B,effects:P.current,output:B,width:m,height:h})}finally{oe.close()}(H=C.current)==null||H.requestParentPaint(),v(Y)}catch(z){S(z)}},[h,m,$,v,S,w,p,x]);c.useLayoutEffect(()=>{const L=k.current;if(!L)throw new Error("Canvas not found");L.layoutSubtree=!0;const B=b?L:L.transferControlToOffscreen();return E.current=B,Xm({target:B,width:m,height:h}),A.current=!1,R.current=!1,L.addEventListener("paint",j),()=>{var H;L.removeEventListener("paint",j),E.current=null,A.current=!1,R.current=!0,(H=Z.current)==null||H.call(Z),Z.current=null}},[j,S,m,h,b]);const F=c.useRef(!1);c.useLayoutEffect(()=>{var B;if(!F.current){F.current=!0;return}const L=k.current;L&&((B=L.requestPaint)==null||B.call(L))},[o,M]),c.useLayoutEffect(()=>{const L=k.current;if(!L)return;const B=w("waiting for first paint after canvas resize");return L.addEventListener("paint",()=>{v(B)},{once:!0}),()=>{v(B)}},[e,t,v,w,T]);const V=c.useMemo(()=>({width:e,height:t}),[e,t]),W=c.useMemo(()=>({width:e,height:t,...l??{}}),[t,l,e]),N=c.useMemo(()=>({requestParentPaint:()=>{var L,B;(B=(L=k.current)==null?void 0:L.requestPaint)==null||B.call(L)}}),[]);return d.jsx(Gm.Provider,{value:N,children:d.jsx("canvas",{ref:_,width:m,height:h,style:W,children:d.jsx("div",{ref:I,style:V,children:r})},T)})});Q0.displayName="HtmlInCanvasContent";var J0=c.forwardRef(({width:e,height:t,effects:n=[],children:r,onPaint:o,onInit:i,pixelDensity:s,controls:a,style:l,durationInFrames:u,name:f,...p},m)=>{const h=vs(n),w=c.useRef(null),v=c.useCallback(S=>{w.current=S,typeof m=="function"?m(S):m&&(m.current=S)},[m]);return d.jsx(dt,{durationInFrames:u,name:f??"<HtmlInCanvas>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/remotion/html-in-canvas",controls:a,_remotionInternalEffects:h,outlineRef:w,layout:"none",...p,children:d.jsx(Q0,{ref:v,width:e,height:t,effects:n,onPaint:o,onInit:i,pixelDensity:s,controls:a,style:l,children:r})})});J0.displayName="HtmlInCanvas";var aC={...Bn,pixelDensity:{type:"number",min:1,max:3,step:.1,default:1,description:"Pixel density",hiddenFromList:!1},...Tn,...Sr,...br},lC=Wn({Component:J0,componentName:"<HtmlInCanvas>",componentIdentity:"dev.remotion.remotion.HtmlInCanvas",schema:aC,supportsEffects:!0}),ew=Object.assign(lC,{isSupported:q0});ew.displayName="HtmlInCanvas";St(ew);function $n(e){return e.startsWith("data:")&&e.length>100?e.slice(0,60)+"...["+e.length+" chars total]":e}var uC={...Bn,...Zo,fit:{type:"enum",default:"fill",description:"Fit",variants:{fill:{},contain:{},cover:{}}},...Tn,...Sr,...br},cC=()=>{if(typeof DOMException<"u")return new DOMException("Image loading was aborted","AbortError");const e=new Error("Image loading was aborted");return e.name="AbortError",e},dC=({src:e,signal:t})=>new Promise((n,r)=>{const o=new Image;let i=!1;function s(){o.onload=null,o.onerror=null}function a(u){i||(i=!0,s(),u())}function l(){a(()=>r(cC()))}if(o.onload=()=>{var u;Promise.resolve((u=o.decode)==null?void 0:u.call(o)).catch(()=>{}).then(()=>{const f=o.naturalWidth||o.width,p=o.naturalHeight||o.height;if(f<=0||p<=0){a(()=>r(new Error(`Could not determine dimensions for <CanvasImage> with src="${$n(e)}"`)));return}a(()=>n({element:o,width:f,height:p}))})},o.onerror=()=>{a(()=>r(new Error(`Could not load <CanvasImage> with src="${$n(e)}"`)))},t.addEventListener("abort",l,{once:!0}),t.aborted){l();return}o.crossOrigin="anonymous",o.src=e});function fC(e){return 1e3*2**(e-1)}var pC=({onFrame:e})=>{if(typeof requestAnimationFrame>"u")return e(),()=>{};const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)},tw=c.forwardRef(({src:e,width:t,height:n,fit:r="fill",effects:o,controls:i,onError:s,className:a,style:l,id:u,pauseWhenLoading:f,maxRetries:p=2,delayRenderRetries:m,delayRenderTimeoutInMilliseconds:h,refForOutline:w,...v},S)=>{const{delayRender:g,continueRender:y,cancelRender:x}=pn(),{delayPlayback:b}=Xl(),[k,E]=c.useState(null),[I,T]=c.useState(null),_=Yr(e),$=xs(),M=ys({effects:o,overrideId:(i==null?void 0:i.overrideId)??null}),P=c.useContext(et),D=c.useRef(null),[O,A]=c.useState(!1),Z=!!(P!=null&&P.premounting),R=!!(P!=null&&P.postmounting),C=c.useCallback(({markAsReady:V})=>{const W=D.current;!W||W.continued||(W.continued=!0,V&&A(!1),y(W.handle),D.current=null)},[y]),j=c.useMemo(()=>typeof document>"u"?null:document.createElement("canvas"),[]),F=c.useCallback(V=>{E(V),w&&(w.current=V),typeof S=="function"?S(V):S&&(S.current=V)},[S,w]);return c.useLayoutEffect(()=>{if(!(!f||!O||Z||R))return b().unblock},[b,O,R,Z,f]),c.useLayoutEffect(()=>{const V=g(`Rendering <CanvasImage> with src="${$n(_)}"`,{retries:m??void 0,timeoutInMilliseconds:h??void 0}),W=new AbortController;let N=!1,L=0,B=null;T(null),A(!0),D.current={handle:V,continued:!1};const H=()=>{dC({src:_,signal:W.signal}).then(z=>{N||T(z)}).catch(z=>{if(z.name==="AbortError"){C({markAsReady:!1});return}if(L++,L<=p){const Y=fC(L);console.warn(`Could not load <CanvasImage> with src="${$n(_)}", retrying in ${Y}ms`),B=setTimeout(()=>{N||H()},Y)}else s?(s(z),C({markAsReady:!0})):x(z)})};return H(),()=>{N=!0,B!==null&&clearTimeout(B),W.abort(),C({markAsReady:!1})}},[_,x,C,g,m,h,p,s]),c.useLayoutEffect(()=>{if(!I||!k||!j)return;const V=g(`Applying effects to <CanvasImage> with src="${$n(_)}"`);let W=!1,N=!1,L=()=>{};const B=()=>{N||(N=!0,y(V))},H=t??I.width,z=n??I.height,Y=j.getContext("2d",{colorSpace:"srgb"});return Y?(j.width=H,j.height=z,k.width=H,k.height=z,Y.clearRect(0,0,H,z),Y.drawImage(I.element,...C0(r,{width:I.width,height:I.height},{width:H,height:z})),ws({state:$.get(H,z),source:j,effects:M,output:k,width:H,height:z}).then(oe=>{oe&&!W&&(L=pC({onFrame:()=>{W||(B(),C({markAsReady:!0}))}}))}).catch(oe=>{W||(s?(s(oe),B(),C({markAsReady:!0})):x(oe))}),()=>{W=!0,L(),B()}):(x(new Error("Could not get 2D context for <CanvasImage> source canvas")),B(),()=>{B()})},[_,x,$,y,C,g,r,n,I,M,s,k,j,t]),d.jsx("canvas",{...v,ref:F,width:t,height:n,className:a,style:l,id:u})});tw.displayName="CanvasImageContent";var mC=c.forwardRef(({src:e,width:t,height:n,fit:r,effects:o=[],className:i,style:s,id:a,onError:l,pauseWhenLoading:u,maxRetries:f,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,durationInFrames:h,from:w,trimBefore:v,freeze:S,premountFor:g,postmountFor:y,styleWhilePremounted:x,styleWhilePostmounted:b,hidden:k,name:E,showInTimeline:I,stack:T,controls:_,_remotionInternalDocumentationLink:$,outlineRef:M,...P},D)=>{if(!e)throw new Error('No "src" prop was passed to <CanvasImage>.');const O=vs(o),A=c.useRef(null);c.useImperativeHandle(D,()=>A.current,[]);const{effectivePostmountFor:Z,effectivePremountFor:R,freezeFrame:C,isPremountingOrPostmounting:j,postmountingActive:F,premountingActive:V,premountingStyle:W}=hs({from:w??0,durationInFrames:h??1/0,premountFor:g??null,postmountFor:y??null,style:s??null,styleWhilePremounted:x??null,styleWhilePostmounted:b??null,hideWhilePremounted:"display-none"});return d.jsx(ps,{frame:C,active:j,children:d.jsx(dt,{layout:"none",from:w??0,trimBefore:v,durationInFrames:h??1/0,freeze:S,hidden:k,showInTimeline:I??!0,name:E??"<CanvasImage>",_remotionInternalDocumentationLink:$??"https://www.remotion.dev/docs/canvasimage",controls:_,_remotionInternalEffects:O,_remotionInternalIsMedia:{type:"image",src:e},_remotionInternalStack:T,_remotionInternalPremountDisplay:R||null,_remotionInternalPostmountDisplay:Z||null,_remotionInternalIsPremounting:V,_remotionInternalIsPostmounting:F,outlineRef:M??A,children:d.jsx(tw,{ref:A,src:e,width:t,height:n,fit:r,effects:o,controls:_,className:i,style:W??void 0,id:a,onError:l,pauseWhenLoading:u,maxRetries:f,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,refForOutline:M??null,...P})})})}),Vf=Wn({Component:mC,componentName:"<CanvasImage>",componentIdentity:"dev.remotion.remotion.CanvasImage",schema:uC,supportsEffects:!0});Vf.displayName="CanvasImage";St(Vf);var hC=({onLoad:e,onError:t,delayRenderRetries:n,delayRenderTimeoutInMilliseconds:r,...o},i)=>{const{delayRender:s,continueRender:a}=pn(),[l]=c.useState(()=>s(`Loading <IFrame> with source ${o.src}`,{retries:n??void 0,timeoutInMilliseconds:r??void 0})),u=c.useCallback(p=>{a(l),e==null||e(p)},[l,e,a]),f=c.useCallback(p=>{a(l),t?t(p):console.error("Error loading iframe:",p,"Handle the event using the onError() prop to make this message disappear.")},[l,t,a]);return d.jsx("iframe",{referrerPolicy:"strict-origin-when-cross-origin",...o,ref:i,onError:f,onLoad:u})};c.forwardRef(hC);function gC(e){return 1e3*2**(e-1)}var vC=({onError:e,maxRetries:t=2,src:n,pauseWhenLoading:r,delayRenderRetries:o,delayRenderTimeoutInMilliseconds:i,onImageFrame:s,crossOrigin:a,decoding:l,ref:u,refForOutline:f,...p})=>{const m=c.useRef(null),h=c.useRef({}),{delayPlayback:w}=Xl(),v=c.useContext(et),[S,g]=c.useState(!1),y=c.useCallback(O=>{m.current=O,f.current=O,typeof u=="function"?u(O):u&&(u.current=O)},[u,f]),x=Yr(n),b=c.useCallback(O=>{if(!m.current)return;const A=m.current.src;setTimeout(()=>{var R;if(!m.current)return;const Z=(R=m.current)==null?void 0:R.src;Z===A&&(m.current.removeAttribute("src"),m.current.setAttribute("src",Z))},O)},[]),{delayRender:k,continueRender:E,cancelRender:I}=pn(),T=!!(v!=null&&v.premounting),_=!!(v!=null&&v.postmounting),$=c.useCallback(O=>{var A,Z,R,C,j,F,V;if(h.current){if(h.current[(A=m.current)==null?void 0:A.src]=(h.current[(Z=m.current)==null?void 0:Z.src]??0)+1,e&&(h.current[(R=m.current)==null?void 0:R.src]??0)>t){e(O);return}if((h.current[(C=m.current)==null?void 0:C.src]??0)<=t){const W=gC(h.current[(j=m.current)==null?void 0:j.src]??0);console.warn(`Could not load image with source ${$n((F=m.current)==null?void 0:F.src)}, retrying again in ${W}ms`),b(W);return}try{I("Error loading image with src: "+$n((V=m.current)==null?void 0:V.src))}catch{}}},[I,t,e,b]);typeof window<"u"&&(c.useLayoutEffect(()=>{if(!(!r||!S||T||_))return w().unblock},[w,S,_,T,r]),c.useLayoutEffect(()=>{var C,j;if(((j=(C=window.process)==null?void 0:C.env)==null?void 0:j.NODE_ENV)==="test"){m.current&&(m.current.src=x);return}const{current:O}=m;if(!O)return;g(!0);const A=k("Loading <Img> with src="+$n(x),{retries:o??void 0,timeoutInMilliseconds:i??void 0});let Z=!1;const R=()=>{var F,V,W;if(Z){E(A);return}(h.current[(F=m.current)==null?void 0:F.src]??0)>0&&(delete h.current[(V=m.current)==null?void 0:V.src],console.info(`Retry successful - ${$n((W=m.current)==null?void 0:W.src)} is now loaded`)),O&&(s==null||s(O)),g(!1),E(A)};if(!m.current){R();return}return O.src=x,O.decode().then(R).catch(F=>{console.warn(F),O.complete&&O.naturalWidth>0&&O.naturalHeight>0?R():O.addEventListener("load",R)}),()=>{Z=!0,O.removeEventListener("load",R),E(A)}},[x,o,i,s,E,k]));const{isClientSideRendering:M,isRendering:P}=Ze(),D=$f({crossOrigin:a,requestsVideoFrame:!1,isClientSideRendering:M});return d.jsx("img",{...p,ref:y,crossOrigin:D,onError:$,decoding:P?"sync":l})},yC=({hidden:e,name:t,stack:n,showInTimeline:r,src:o,from:i,trimBefore:s,durationInFrames:a,freeze:l,premountFor:u,postmountFor:f,style:p,styleWhilePremounted:m,styleWhilePostmounted:h,controls:w,outlineRef:v,...S})=>{if(!o)throw new Error('No "src" prop was passed to <Img>.');const{effectivePostmountFor:g,effectivePremountFor:y,freezeFrame:x,isPremountingOrPostmounting:b,postmountingActive:k,premountingActive:E,premountingStyle:I}=hs({from:i??0,durationInFrames:a??1/0,premountFor:u??null,postmountFor:f??null,style:p??null,styleWhilePremounted:m??null,styleWhilePostmounted:h??null,hideWhilePremounted:"display-none"});return d.jsx(ps,{frame:x,active:b,children:d.jsx(dt,{layout:"none",from:i??0,trimBefore:s,durationInFrames:a??1/0,freeze:l,_remotionInternalStack:n,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/img",_remotionInternalIsMedia:{type:"image",src:o},_remotionInternalPremountDisplay:y||null,_remotionInternalPostmountDisplay:g||null,_remotionInternalIsPremounting:E,_remotionInternalIsPostmounting:k,name:t??"<Img>",controls:w,showInTimeline:r??!0,hidden:e,outlineRef:v,children:d.jsx(vC,{src:o,refForOutline:v,style:I??void 0,...S})})})},wC=Vf,xC={src:{type:"asset",default:void 0,description:"Source",keyframable:!1},...Bn,...Zo,...Tn,...Sr,...br},bC=new Set(["alt","crossOrigin","decoding","fetchPriority","loading","onError","onImageFrame","onLoad","sizes","srcSet","useMap"]),SC=e=>Object.keys(e).filter(t=>e[t]!==void 0&&bC.has(t)),EC=e=>e.map(t=>`"${t}"`).join(", "),kC=({props:e,ref:t,width:n,height:r})=>{if(typeof n=="string"||typeof r=="string")throw new Error('The "width" and "height" props must be numbers on <Img> when effects are passed, because <Img> renders a <CanvasImage>. Use numeric props or CSS dimensions in "style".');const o=SC(e);if(t!=null&&o.unshift("ref"),o.length!==0)throw new Error(`The ${EC(o)} prop${o.length===1?"":"s"} cannot be used on <Img> when effects are passed, because <Img> renders a <canvas> instead of a native <img>. Remove ${o.length===1?"this prop":"these props"}.`)},CC=e=>{const t=e==null?void 0:e.objectFit;if(t==="fill"||t==="contain"||t==="cover")return t},IC=({effects:e=[],ref:t,hidden:n,name:r,stack:o,showInTimeline:i,src:s,from:a,trimBefore:l,durationInFrames:u,freeze:f,premountFor:p,postmountFor:m,styleWhilePremounted:h,styleWhilePostmounted:w,controls:v,width:S,height:g,className:y,style:x,id:b,pauseWhenLoading:k,maxRetries:E,delayRenderRetries:I,delayRenderTimeoutInMilliseconds:T,..._})=>{const $=c.useRef(null),M=ms(k);if(e.length===0)return d.jsx(yC,{..._,ref:t,hidden:n,name:r,stack:o,showInTimeline:i,src:s,from:a,trimBefore:l,durationInFrames:u,freeze:f,premountFor:p,postmountFor:m,styleWhilePremounted:h,styleWhilePostmounted:w,controls:v,width:S,height:g,className:y,style:x,id:b,pauseWhenLoading:M,maxRetries:E,delayRenderRetries:I,delayRenderTimeoutInMilliseconds:T,outlineRef:$});if(!s)throw new Error('No "src" prop was passed to <Img>.');kC({props:_,ref:t,width:S,height:g});const P=typeof S=="number"?S:void 0,D=typeof g=="number"?g:void 0,O=_,A=CC(x)??"fill";return d.jsx(wC,{src:s,width:P,height:D,fit:A,effects:e,className:y,style:x,id:b,pauseWhenLoading:M,maxRetries:E,delayRenderRetries:I,delayRenderTimeoutInMilliseconds:T,from:a,trimBefore:l,durationInFrames:u,freeze:f,premountFor:p,postmountFor:m,styleWhilePremounted:h,styleWhilePostmounted:w,hidden:n,name:r??"<Img>",showInTimeline:i,stack:o,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/img",controls:v,outlineRef:$,...O})},Bf=Wn({Component:IC,componentName:"<Img>",componentIdentity:"dev.remotion.remotion.Img",schema:xC,supportsEffects:!0});St(Bf);var TC=e=>{if(e==="remotion")return"dev.remotion.remotion";if(e.startsWith("@remotion/"))return`dev.remotion.${e.slice(10).replace(/-([a-z])/g,(n,r)=>r.toUpperCase())}`;throw new Error(`Unsupported Remotion package name: ${e}`)},nw=({packageName:e,componentName:t})=>`${TC(e)}.${t}`,Wf={...Bn,...Tn},RC={...Wf,...Sr},rw={...RC,...br},_C={...rw,...Ml,...Xy},PC={...Wf,...Ml,...Xy},FC=(e,t)=>{typeof e=="function"?e(t):e&&(e.current=t)},ow=e=>{const t=Wn(e);return St(t),t},rl=(e,t,n)=>{const r=c.forwardRef((i,s)=>{const{durationInFrames:a,from:l,trimBefore:u,freeze:f,hidden:p,name:m,showInTimeline:h,stack:w,controls:v,...S}=i,g=c.useRef(null),y=c.useCallback(x=>{g.current=x,FC(s,x)},[s]);return d.jsx(dt,{layout:"none",from:l??0,trimBefore:u,durationInFrames:a??1/0,freeze:f,hidden:p,name:m??t,showInTimeline:h??!0,controls:v,_remotionInternalStack:w,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/interactive",outlineRef:g,children:J.createElement(e,{...S,ref:y})})});r.displayName=t;const o=ow({Component:r,componentName:t,componentIdentity:nw({packageName:"remotion",componentName:t.slice(1,-1)}),schema:n,supportsEffects:!1});return o.displayName=t,o},Te=(e,t)=>rl(e,t,_C),Jr=(e,t)=>rl(e,t,Wf),Kn={baseSchema:Bn,transformSchema:Tn,textSchema:Ml,backgroundSchema:Sr,borderSchema:br,premountSchema:Zo,sequenceSchema:Lo,withSchema:ow,_internalMakeRemotionComponentIdentity:nw,A:Te("a","<Interactive.A>"),Article:Te("article","<Interactive.Article>"),Aside:Te("aside","<Interactive.Aside>"),Button:Te("button","<Interactive.Button>"),Circle:Jr("circle","<Interactive.Circle>"),Code:Te("code","<Interactive.Code>"),Div:Te("div","<Interactive.Div>"),Ellipse:Jr("ellipse","<Interactive.Ellipse>"),Em:Te("em","<Interactive.Em>"),Footer:Te("footer","<Interactive.Footer>"),G:Jr("g","<Interactive.G>"),H1:Te("h1","<Interactive.H1>"),H2:Te("h2","<Interactive.H2>"),H3:Te("h3","<Interactive.H3>"),H4:Te("h4","<Interactive.H4>"),H5:Te("h5","<Interactive.H5>"),H6:Te("h6","<Interactive.H6>"),Header:Te("header","<Interactive.Header>"),Label:Te("label","<Interactive.Label>"),Li:Te("li","<Interactive.Li>"),Line:Jr("line","<Interactive.Line>"),Main:Te("main","<Interactive.Main>"),Nav:Te("nav","<Interactive.Nav>"),Ol:Te("ol","<Interactive.Ol>"),P:Te("p","<Interactive.P>"),Path:Jr("path","<Interactive.Path>"),Pre:Te("pre","<Interactive.Pre>"),Rect:Jr("rect","<Interactive.Rect>"),Section:Te("section","<Interactive.Section>"),Small:Te("small","<Interactive.Small>"),Span:Te("span","<Interactive.Span>"),Strong:Te("strong","<Interactive.Strong>"),Svg:rl("svg","<Interactive.Svg>",rw),Text:rl("text","<Interactive.Text>",PC),Ul:Te("ul","<Interactive.Ul>")},jC=async({resolvedSrc:e,signal:t,requestInit:n,contentType:r})=>{const{decoder:o,selectedTrack:i}=await _0({resolvedSrc:e,signal:t,requestInit:n,contentType:r});try{const{image:s}=await o.decode({frameIndex:i.frameCount-1,completeFramesOnly:!0});try{if(s.duration===null)throw new Error("Could not determine animated image duration");return(s.timestamp+s.duration)/1e6}finally{s.close()}}finally{o.close()}},iw=J.createRef(),MC=({children:e,onlyRenderComposition:t,currentCompositionMetadata:n,initialCompositions:r,initialCanvasContent:o})=>{const[i,s]=c.useState([]),[a,l]=c.useState(o),[u,f]=c.useState(r),p=c.useRef(u),m=c.useCallback(x=>{f(b=>{const k=x(b);return p.current=k,k})},[]),h=c.useCallback(x=>{m(b=>{if(b.find(k=>k.id===x.id))throw new Error(`Multiple composition with id ${x.id} are registered.`);return[...b,x]})},[m]),w=c.useCallback(x=>{f(b=>b.filter(k=>k.id!==x))},[]),v=c.useCallback((x,b,k,E)=>{s(I=>[...I,{name:x,parent:b,nonce:k,stack:E}])},[]),S=c.useCallback((x,b)=>{s(k=>k.filter(E=>!(E.name===x&&E.parent===b)))},[]);c.useImperativeHandle(iw,()=>({getCompositions:()=>p.current}),[]);const g=c.useMemo(()=>({registerComposition:h,unregisterComposition:w,registerFolder:v,unregisterFolder:S,setCanvasContent:l,onlyRenderComposition:t}),[h,v,w,S,t]),y=c.useMemo(()=>({compositions:u,folders:i,currentCompositionMetadata:n,canvasContent:a}),[u,i,n,a]);return d.jsx(Bo.Provider,{value:y,children:d.jsx(us.Provider,{value:g,children:e})})},sw={};Cy(sw,{makeDefaultPreviewCSS:()=>AC,injectCSS:()=>$C,OBJECTFIT_CONTAIN_CLASS_NAME:()=>ts});var Js={},$C=e=>{if(typeof document>"u")return()=>{};if(Js[e])return()=>{};const t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");return n.appendChild(document.createTextNode(e)),t.prepend(n),Js[e]=n,()=>{const r=Js[e];r&&(r.parentNode&&r.parentNode.removeChild(r),delete Js[e])}},ts="__remotion_objectfitcontain",AC=(e,t)=>e?`
|
|
54
|
+
`}),d.jsx("svg",{width:Sm,height:Sm,viewBox:"-100 -100 400 400",style:iS,children:d.jsx("path",{fill:"#555",stroke:"#555",strokeWidth:"100",strokeLinejoin:"round",d:"M 2 172 a 196 100 0 0 0 195 5 A 196 240 0 0 0 100 2.259 A 196 240 0 0 0 2 172 z"})}),d.jsxs("p",{style:sS,children:["Resolving ","<Suspense>","..."]})]}),Nt=null,rd=()=>{if(!Nt){if(typeof document>"u")throw new Error("Tried to call an API that only works in the browser from outside the browser");Nt=document.createElement("div"),Nt.style.position="absolute",Nt.style.top="0px",Nt.style.left="0px",Nt.style.right="0px",Nt.style.bottom="0px",Nt.style.width="100%",Nt.style.height="100%",Nt.style.display="flex",Nt.style.flexDirection="column";const e=document.createElement("div");e.style.position="fixed",e.style.top="-999999px",e.appendChild(Nt),document.body.appendChild(e)}return Nt},od=()=>"remotion_inputPropsOverride"+window.location.origin,Fy=()=>{if(typeof localStorage>"u")return null;const e=localStorage.getItem(od());return e?JSON.parse(e):null},uS=e=>{if(!(typeof localStorage>"u")){if(e===null){localStorage.removeItem(od());return}localStorage.setItem(od(),JSON.stringify(e))}},Em=!1,cS=()=>{Em||(Em=!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()"))},dS=()=>{if(typeof window>"u")return cS(),{};if(bn().isPlayer)throw new Error("You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.");const e=Fy();if(e)return e;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 t=window.remotion_inputProps;return t?_y(t):{}},yf=c.createContext({props:{},updateProps:()=>{throw new Error("Not implemented")}}),fS=J.createRef(),jy=({children:e})=>{const[t,n]=J.useState({}),r=c.useCallback(({defaultProps:i,id:s,newProps:a})=>{n(l=>({...l,[s]:typeof a=="function"?a(l[s]??i):a}))},[]),o=c.useMemo(()=>({props:t,updateProps:r}),[t,r]);return d.jsx(yf.Provider,{value:o,children:e})},My=J.createContext(null),Ze=()=>{const e=c.useContext(My),[t]=c.useState(()=>bn());return e??t};function qa(e,t,n){if(typeof e!="number")throw new Error(`The "${t}" prop ${n} must be a number, but you passed a value of type ${typeof e}`);if(isNaN(e))throw new TypeError(`The "${t}" prop ${n} must not be NaN, but is NaN.`);if(!Number.isFinite(e))throw new TypeError(`The "${t}" prop ${n} must be finite, but is ${e}.`);if(e%1!==0)throw new TypeError(`The "${t}" prop ${n} must be an integer, but is ${e}.`);if(e<=0)throw new TypeError(`The "${t}" prop ${n} must be positive, but got ${e}.`)}function Tl(e,t){const{allowFloats:n,component:r}=t;if(typeof e>"u")throw new Error(`The "durationInFrames" prop ${r} is missing.`);if(typeof e!="number")throw new Error(`The "durationInFrames" prop ${r} must be a number, but you passed a value of type ${typeof e}`);if(e<=0)throw new TypeError(`The "durationInFrames" prop ${r} must be positive, but got ${e}.`);if(!n&&e%1!==0)throw new TypeError(`The "durationInFrames" prop ${r} must be an integer, but got ${e}.`);if(!Number.isFinite(e))throw new TypeError(`The "durationInFrames" prop ${r} must be finite, but got ${e}.`)}function Rl(e,t,n){if(typeof e!="number")throw new Error(`"fps" must be a number, but you passed a value of type ${typeof e} ${t}`);if(!Number.isFinite(e))throw new Error(`"fps" must be a finite, but you passed ${e} ${t}`);if(isNaN(e))throw new Error(`"fps" must not be NaN, but got ${e} ${t}`);if(e<=0)throw new TypeError(`"fps" must be positive, but got ${e} ${t}`)}var _l=c.createContext(null),pS=c.createRef(),mS=e=>!!e.calculateMetadata,wf=e=>{const t=c.useContext(_l),{props:n}=c.useContext(yf),{compositions:r,canvasContent:o,currentCompositionMetadata:i}=c.useContext(Bo),s=(o==null?void 0:o.type)==="composition"?o.compositionId:null,a=e??s,l=r.find(p=>p.id===a),u=c.useMemo(()=>l?n[l.id]??{}:{},[n,l]),f=Ze();return c.useMemo(()=>l?i?{type:"success",metadataSource:null,result:{...i,id:l.id,defaultProps:l.defaultProps??{}}}:mS(l)?!t||!t[l.id]?null:t[l.id]:(Tl(l.durationInFrames,{allowFloats:!1,component:`in <Composition id="${l.id}">`}),Rl(l.fps,`in <Composition id="${l.id}">`),qa(l.width,"width",`in <Composition id="${l.id}">`),qa(l.height,"height",`in <Composition id="${l.id}">`),{type:"success",metadataSource:null,result:{width:l.width,height:l.height,fps:l.fps,id:l.id,durationInFrames:l.durationInFrames,defaultProps:l.defaultProps??{},props:{...l.defaultProps??{},...u??{},...typeof window>"u"||f.isPlayer||!window.remotion_inputProps?{}:dS()??{}},defaultCodec:null,defaultOutName:null,defaultVideoImageFormat:null,defaultPixelFormat:null,defaultProResProfile:null,defaultSampleRate:null}}):null,[l,t,i,u,f.isPlayer])},$y=e=>{const t=e.stack??"";return t.startsWith("Error:")?t:`${e.message}
|
|
55
|
+
${t}`},hS=e=>e instanceof Error?!0:!(e===null||typeof e!="object"||!("stack"in e)||typeof e.stack!="string"||!("message"in e)||typeof e.message!="string");function xf(e,t){let n;throw hS(t)?(n=t,n.stack||(n.stack=new Error(n.message).stack)):typeof t=="string"?n=Error(t):n=Error("Rendering was cancelled"),e&&(e.remotion_cancelledError=$y(n)),n}function es(e){return xf(typeof window<"u"?window:void 0,e)}var gS=["trace","verbose","info","warn","error"],km=e=>gS.indexOf(e),Pl=(e,t)=>km(e)<=km(t),ds=({args:e,logLevel:t,tag:n})=>{const r=[...e];return bn().isRendering&&!bn().isClientSideRendering&&r.unshift(Symbol.for(`__remotion_level_${t}`)),n&&bn().isRendering&&!bn().isClientSideRendering&&r.unshift(Symbol.for(`__remotion_tag_${n}`)),r},vS=(e,...t)=>{if(Pl(e.logLevel,"verbose"))return console.debug(...ds({args:t,logLevel:"verbose",tag:e.tag}))},yS=(e,...t)=>{if(Pl(e.logLevel,"trace"))return console.debug(...ds({args:t,logLevel:"trace",tag:e.tag}))},wS=(e,...t)=>{if(Pl(e.logLevel,"info"))return console.log(...ds({args:t,logLevel:"info",tag:e.tag}))},xS=(e,...t)=>{if(Pl(e.logLevel,"warn"))return console.warn(...ds({args:t,logLevel:"warn",tag:e.tag}))},bS=(e,...t)=>console.error(...ds({args:t,logLevel:"error",tag:e.tag})),rt={trace:yS,verbose:vS,info:wS,warn:xS,error:bS};typeof window<"u"&&(window.remotion_renderReady=!1,window.remotion_delayRenderTimeouts||(window.remotion_delayRenderTimeouts={}),window.remotion_delayRenderHandles=[]);var SS="The delayRender was called:",ES="Retries left: ",kS="- Rendering the frame will be retried.",CS="handle was cleared after",IS=3e4,TS=({scope:e,environment:t,label:n,options:r})=>{var s;if(typeof n!="string"&&n!==null)throw new Error("The label parameter of delayRender() must be a string or undefined, got: "+JSON.stringify(n));const o=Math.random();e.remotion_delayRenderHandles.push(o);const i=((s=Error().stack)==null?void 0:s.replace(/^Error/g,""))??"";if(t.isRendering){const a=((r==null?void 0:r.timeoutInMilliseconds)??e.remotion_puppeteerTimeout??IS)-2e3,l=((r==null?void 0:r.retries)??0)-(e.remotion_attempt-1);e.remotion_delayRenderTimeouts[o]={label:n??null,startTime:Date.now(),timeout:setTimeout(()=>{const u=["A delayRender()",n?`"${n}"`:null,`was called but not cleared after ${a}ms. See https://remotion.dev/docs/timeout for help.`,l>0?ES+l:null,l>0?kS:null,SS,i].filter(Wo).join(" ");t.isClientSideRendering?e.remotion_cancelledError=$y(Error(u)):xf(e,Error(u))},a)}}return e.remotion_renderReady=!1,o},RS=({scope:e,handle:t,environment:n,logLevel:r})=>{if(typeof t>"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 t!="number")throw new TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: "+JSON.stringify(t));const o=e.remotion_delayRenderHandles.includes(t),i=e.remotion_delayRenderTimeouts[t];if(o&&n.isRendering&&i){const{label:s,startTime:a,timeout:l}=i;clearTimeout(l);const u=[s?`"${s}"`:"A handle",CS,`${Date.now()-a}ms`].filter(Wo).join(" ");rt.verbose({logLevel:r,tag:"delayRender()"},u),delete e.remotion_delayRenderTimeouts[t]}e.remotion_delayRenderHandles=e.remotion_delayRenderHandles.filter(s=>s!==t),e.remotion_delayRenderHandles.length===0&&(e.remotion_renderReady=!0)},Ur=c.createContext({logLevel:"info",mountTime:0}),In=()=>{const{logLevel:e}=c.useContext(Ur);if(e===null)throw new Error("useLogLevel must be used within a LogLevelProvider");return e},fs=()=>{const{mountTime:e}=c.useContext(Ur);if(e===null)throw new Error("useMountTime must be used within a LogLevelProvider");return e},Ay=c.createContext(null),mn=()=>{const e=Ze(),t=c.useContext(Ay)??(typeof window<"u"?window:void 0),n=In(),r=c.useCallback((s,a)=>t?TS({scope:t,environment:e,label:s??null,options:a??{}}):Math.random(),[e,t]),o=c.useCallback(s=>{t&&RS({scope:t,handle:s,environment:e,logLevel:n})},[e,n,t]),i=c.useCallback(s=>xf(t??(typeof window<"u"?window:void 0),s),[t]);return{delayRender:r,continueRender:o,cancelRender:i}},Ny=({compProps:e,componentName:t,noSuspense:n})=>{const r=c.useRef(null);return"component"in e&&(r.current=e.component),c.useMemo(()=>{if("component"in e){if(typeof document>"u"||n)return e.component;if(typeof e.component>"u")throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${t}/> component.`);return s=>{const a=r.current;return J.createElement(a,s)}}if("lazyComponent"in e&&typeof e.lazyComponent<"u"){if(typeof e.lazyComponent>"u")throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${t}/> component.`);return J.lazy(e.lazyComponent)}throw new Error("You must pass either 'component' or 'lazyComponent'")},[e.lazyComponent])},Fl=()=>{const{canvasContent:e,compositions:t,currentCompositionMetadata:n}=c.useContext(Bo),r=t.find(i=>(e==null?void 0:e.type)==="composition"&&i.id===e.compositionId),o=wf((r==null?void 0:r.id)??null);return c.useMemo(()=>!o||o.type==="error"||o.type==="loading"||!r?null:{...o.result,defaultProps:r.defaultProps??{},id:r.id,...n??{},component:r.component},[n,o,r])},Ly=()=>/^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g,zy=e=>e.match(Ly()),_S=e=>{if(!zy(e))throw new Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${e}`)},PS=`Composition ID must match ${String(Ly())}`,FS=(e,t,n)=>{if(e){if(typeof e!="object")throw new Error(`"${t}" must be an object, but you passed a value of type ${typeof e}`);if(Array.isArray(e))throw new Error(`"${t}" must be an object, an array was passed ${n?`for composition "${n}"`:""}`)}},jS=()=>{const{continueRender:e,delayRender:t}=mn();return c.useEffect(()=>{const n=t("Waiting for Root component to unsuspend");return()=>e(n)},[e,t]),null},MS=({width:e,height:t,fps:n,durationInFrames:r,id:o,defaultProps:i,schema:s,...a})=>{const l=c.useContext(us),{registerComposition:u,unregisterComposition:f}=l,p=Fl(),m=Ny({compProps:a,componentName:"Composition",noSuspense:!1}),h=Il(),y=vf(),g=Ze(),S=c.useContext(Wr);if(typeof window<"u"&&(window.remotion_seenCompositionIds=Array.from(new Set([...window.remotion_seenCompositionIds??[],o]))),S)throw y?new Error("<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help."):new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");const{folderName:v,parentName:w}=c.useContext(ed),x=a.stack??null,b="component"in a?a.component:null;c.useEffect(()=>{if(!o)throw new Error("No id for composition passed.");return _S(o),FS(i,"defaultProps",o),u({durationInFrames:r??void 0,fps:n??void 0,height:t??void 0,width:e??void 0,id:o,folderName:v,component:m,defaultProps:nd(i??{}),nonce:h.get(),parentFolderName:w,componentFromProps:b,schema:s??null,calculateMetadata:a.calculateMetadata??null,stack:x}),()=>{f(o)}},[r,n,t,m,o,v,i,e,h,w,b,s,a.calculateMetadata,x,u,f]);const k=wf(o),{setError:E,clearError:I}=c.useContext(Iy),T=c.useCallback($=>{E($)},[E]),_=c.useCallback(()=>{I()},[I]);if(g.isStudio&&p&&p.component===m&&p.id===o){const $=m;return k===null||k.type!=="success"&&k.type!=="success-and-refreshing"?null:Qc.createPortal(d.jsx(Jc,{children:d.jsx(qb,{onError:T,onClear:_,children:d.jsx(c.Suspense,{fallback:d.jsx(lS,{}),children:d.jsx($,{...k.result.props??{}})})})}),rd())}if(g.isRendering&&p&&p.component===m&&p.id===o){const $=m;return k===null||k.type!=="success"&&k.type!=="success-and-refreshing"?null:Qc.createPortal(d.jsx(Jc,{children:d.jsx(c.Suspense,{fallback:d.jsx(jS,{}),children:d.jsx($,{...k.result.props??{}})})}),rd())}return null},Qa=e=>{const{onlyRenderComposition:t}=c.useContext(us);return t&&t!==e.id?null:d.jsx(MS,{...e})},Dy=[],Oy=null,$S=()=>Dy,St=e=>{Dy.push(e)},AS=e=>{Oy=e},NS=()=>Oy,LS=e=>{const t=J.Children.toArray(e);if(t.length!==1)return null;const n=t[0];return!J.isValidElement(n)||typeof n.type!="function"&&typeof n.type!="object"?null:n.type},Si="4.0.499",zS=()=>{if(typeof globalThis>"u")return;const e=()=>{globalThis.remotion_imported=Si,typeof window<"u"&&(window.remotion_imported=Si)},t=globalThis.remotion_imported||typeof window<"u"&&window.remotion_imported;if(t){if(t===Si)return;if(typeof t=="string"&&t.includes("webcodecs")){e();return}throw new TypeError(`🚨 Multiple versions of Remotion detected: ${[Si,typeof t=="string"?t:"an older version"].filter(Wo).join(" and ")}. This will cause things to break in an unexpected way.
|
|
56
|
+
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.`)}e()},et=c.createContext(null),id={};Cy(id,{useTimelineSetFrame:()=>Yy,useTimelinePosition:()=>xr,useTimelineContext:()=>wr,usePlayingState:()=>Ky,usePlaybackRate:()=>kf,useAbsoluteTimelinePosition:()=>Zy,persistCurrentFrame:()=>Vy,getInitialFrameState:()=>By,getFrameForComposition:()=>Wy,clampFrameToCompositionRange:()=>Uy});function Cm(e){let t=e+1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function DS(e){let t=0,n=0,r=0;for(t=0;t<e.length;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r|=0;return r}var Hr=(e,t)=>{if(e===null)return Math.random();if(typeof e=="string")return Cm(DS(e));if(typeof e=="number")return Cm(e*1e10);throw new Error("random() argument must be a number or a string")},Uo=c.createContext({setFrame:()=>{throw new Error("default")},setPlaying:()=>{throw new Error("default")}}),Ho=c.createContext(null),bf=c.createContext(null),Sf=c.createContext(null),OS=({children:e,frameState:t})=>{const[n,r]=c.useState(!1),o=c.useRef(!1),[i,s]=c.useState(1),a=c.useRef([]),[l]=c.useState(()=>String(Hr(null))),[u,f]=c.useState(()=>By()),p=t??u,{delayRender:m,continueRender:h}=mn();typeof window<"u"&&c.useLayoutEffect(()=>{window.remotion_setFrame=(v,w,x)=>{window.remotion_attempt=x;const b=m(`Setting the current frame to ${v}`);let k=!0;f(E=>(E[w]??window.remotion_initialFrame)===v?(k=!1,E):{...E,[w]:v}),k?requestAnimationFrame(()=>h(b)):h(b)},window.remotion_isPlayer=!1},[h,m]);const y=c.useMemo(()=>({frame:p,playing:n,imperativePlaying:o,rootId:l,audioAndVideoTags:a}),[p,n,l]),g=c.useMemo(()=>({playbackRate:i,setPlaybackRate:s}),[i]),S=c.useMemo(()=>({setFrame:f,setPlaying:r}),[]);return d.jsx(Sf.Provider,{value:y,children:d.jsx(bf.Provider,{value:g,children:d.jsx(Ho.Provider,{value:y,children:d.jsx(Uo.Provider,{value:S,children:e})})})})},Ef=()=>"remotion.time-all",Vy=e=>{localStorage.setItem(Ef(),JSON.stringify(e))},By=()=>{const e=localStorage.getItem(Ef())??"{}";return JSON.parse(e)},Wy=e=>{const t=localStorage.getItem(Ef())??"{}",n=JSON.parse(t);return n[e]!==void 0?Number(n[e]):typeof window>"u"?0:window.remotion_initialFrame??0},Uy=(e,t)=>Math.max(0,Math.min(Math.max(0,t-1),e)),Hy=e=>{const t=Fl(),n=Ze();if(!t)return typeof window>"u"?0:window.remotion_initialFrame??0;const r=e.frame[t.id]??(n.isPlayer?0:Wy(t.id));return Uy(r,t.durationInFrames)},wr=()=>{const e=c.useContext(Ho);if(e===null)throw new Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return e},kf=()=>{const e=c.useContext(bf);if(e===null)throw new Error("PlaybackRateContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return e},xr=()=>{const e=wr();return Hy(e)},Zy=()=>{const e=c.useContext(Sf);if(e===null)throw new Error("AbsoluteTimeContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return Hy(e)},Yy=()=>{const{setFrame:e}=c.useContext(Uo);return e},Ky=()=>{const{playing:e,imperativePlaying:t}=wr(),{setPlaying:n}=c.useContext(Uo);return c.useMemo(()=>[e,n,t],[t,e,n])},ct=()=>{const e=c.useContext(Wr),t=Ze();if(!e)throw t.isPlayer?new Error("useCurrentFrame can only be called inside a component that was passed to <Player>. 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 n=xr(),r=c.useContext(et),o=r?r.cumulatedFrom+r.relativeFrom:0;return n-o},jl=()=>{const e=c.useContext(et),t=(e==null?void 0:e.width)??null,n=(e==null?void 0:e.height)??null,r=(e==null?void 0:e.durationInFrames)??null,o=Fl();return c.useMemo(()=>{if(!o)return null;const{id:i,durationInFrames:s,fps:a,height:l,width:u,defaultProps:f,props:p,defaultCodec:m,defaultOutName:h,defaultVideoImageFormat:y,defaultPixelFormat:g,defaultProResProfile:S,defaultSampleRate:v}=o;return{id:i,width:t??u,height:n??l,fps:a,durationInFrames:r??s,defaultProps:f,props:p,defaultCodec:m,defaultOutName:h,defaultVideoImageFormat:y,defaultPixelFormat:g,defaultProResProfile:S,defaultSampleRate:v}},[r,n,t,o])},Xe=()=>{const e=jl(),t=c.useContext(Wr),n=vf();if(!e)throw typeof window<"u"&&window.remotion_isPlayer||n?new Error(["No video config found. Likely reasons:","- You are probably calling useVideoConfig() from outside the component passed to <Player />. See https://www.remotion.dev/docs/player/examples for how to set up the Player correctly.","- You have multiple versions of Remotion installed which causes the React context to get lost."].join("-")):new Error("No video config found. You are probably calling useVideoConfig() from a component which has not been registered as a <Composition />. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions for more information.");if(!t)throw new Error("Called useVideoConfig() outside a Remotion composition.");return e},ps=({frame:e,children:t,active:n=!0})=>{const r=ct(),o=Xe();if(typeof e>"u")throw new Error("The <Freeze /> component requires a 'frame' prop, but none was passed.");if(typeof e!="number")throw new Error(`The 'frame' prop of <Freeze /> must be a number, but is of type ${typeof e}`);if(Number.isNaN(e))throw new Error("The 'frame' prop of <Freeze /> must be a real number, but it is NaN.");if(!Number.isFinite(e))throw new Error(`The 'frame' prop of <Freeze /> must be a finite number, but it is ${e}.`);const i=c.useMemo(()=>{if(typeof n=="boolean")return n;if(typeof n=="function")return n(r)},[n,r]),s=wr(),a=c.useContext(et),l=(a==null?void 0:a.relativeFrom)??0,u=c.useMemo(()=>i?{...s,playing:!1,imperativePlaying:{current:!1},frame:{[o.id]:e+l}}:s,[i,s,o.id,e,l]),f=c.useMemo(()=>a?i?{...a,cumulatedFrom:0}:a:null,[a,i]);return d.jsx(Ho.Provider,{value:u,children:d.jsx(et.Provider,{value:f,children:t})})},Tn={"style.transformOrigin":{type:"transform-origin",step:1,default:"50% 50%",description:"Transform origin"},"style.translate":{type:"translate",step:1,default:"0px 0px",description:"Offset"},"style.scale":{type:"scale",max:100,step:.01,default:1,description:"Scale",defaultKeyframeOutput:"perceptual-scale"},"style.rotate":{type:"rotation-css",step:1,default:"0deg",description:"Rotation"},"style.opacity":{type:"number",min:0,max:1,step:.01,default:1,description:"Opacity",hiddenFromList:!1}},VS=Tn,Ml={"style.color":{type:"color",default:void 0,description:"Color"},"style.fontFamily":{type:"font-family",default:void 0,description:"Font family",keyframable:!1},"style.fontSize":{type:"number",default:void 0,min:0,step:1,description:"Font size",hiddenFromList:!1},"style.lineHeight":{type:"number",default:void 0,min:0,step:.05,description:"Line height",hiddenFromList:!1},"style.fontWeight":{type:"enum",default:"400",description:"Font weight",variants:{100:{},200:{},300:{},400:{},500:{},600:{},700:{},800:{},900:{},normal:{},bold:{}}},"style.fontStyle":{type:"enum",default:"normal",description:"Font style",variants:{normal:{},italic:{},oblique:{}}},"style.textAlign":{type:"enum",default:"left",description:"Text align",variants:{left:{},center:{},right:{},justify:{},start:{},end:{}}},"style.letterSpacing":{type:"number",default:void 0,step:.1,description:"Letter spacing",hiddenFromList:!1}},br={"style.borderWidth":{type:"number",default:void 0,min:0,step:1,description:"Border width",hiddenFromList:!1},"style.borderStyle":{type:"enum",default:"none",description:"Border style",variants:{none:{},hidden:{},solid:{},dashed:{},dotted:{},double:{},groove:{},ridge:{},inset:{},outset:{}}},"style.borderColor":{type:"color",default:void 0,description:"Border color"}},Sr={"style.backgroundColor":{type:"color",default:"transparent",description:"Color"}},Xy={children:{type:"text-content",default:"",description:"Text",keyframable:!1}},Zo={premountFor:{type:"number",default:0,description:"Premount For",min:0,step:1,hiddenFromList:!1,keyframable:!1},postmountFor:{type:"number",default:0,min:0,step:1,hiddenFromList:!0,keyframable:!1}},Gy={...Zo},qy={...Tn,...Sr,...br,...Gy},Cf={type:"boolean",default:!1,description:"Hidden"},Qy={type:"hidden"},If={type:"hidden"},BS=e=>({name:If,...e}),Tf={type:"number",default:void 0,min:1,step:1,hiddenFromList:!0},Jy={type:"number",default:0,step:1,hiddenFromList:!0},e0={type:"number",default:0,min:0,step:1,hiddenFromList:!0},Rf={type:"number",default:null,step:1,hiddenFromList:!0},Bn={durationInFrames:Tf,from:Jy,trimBefore:e0,freeze:Rf,hidden:Cf,name:If,showInTimeline:Qy},Lo={...Bn,layout:{type:"enum",default:"absolute-fill",description:"Layout",variants:{"absolute-fill":qy,none:{}}}},WS={durationInFrames:Tf,trimBefore:e0,freeze:Rf,hidden:Cf,name:If,showInTimeline:Qy},US={...WS,layout:Lo.layout},HS={...Lo,layout:{...Lo.layout,default:"none"}},Yo=J.createContext({registerSequence:()=>{throw new Error("SequenceManagerContext not initialized")},unregisterSequence:()=>{throw new Error("SequenceManagerContext not initialized")},sequences:[]}),$l=J.createContext({current:[]}),Fn=e=>`${e.absolutePath}\0${e.nodePath.join(".")}\0${e.sequenceKeys.join(".")}\0${e.effectKeys.map(t=>t.join(".")).join(".")}`,Al=J.createContext({propStatuses:{}}),Nl=J.createContext({current:{}}),Ll=J.createContext({getDragOverrides:()=>{throw new Error("VisualModeDragOverridesContext not initialized")},getEffectDragOverrides:()=>{throw new Error("VisualModeDragOverridesContext not initialized")}}),t0=J.createContext({setDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},clearDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},setEffectDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},clearEffectDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},setPropStatuses:()=>{throw new Error("VisualModeSettersContext not initialized")}}),ju=(e,t)=>`${Fn(e)}.effects.${t}`,ZS=({children:e})=>{const[t,n]=c.useState([]),r=c.useRef(t);r.current=t;const[o,i]=c.useState({}),s=c.useRef(o);s.current=o;const[a,l]=c.useState({}),[u,f]=c.useState({}),p=c.useRef(u);p.current=u;const m=c.useCallback((_,$,j)=>{i(L=>({...L,[Fn(_)]:{...L[Fn(_)],[$]:j}}))},[]),h=c.useCallback(_=>{i($=>{const j=Fn(_);if(!$[j])return $;const L={...$};return delete L[j],L})},[]),y=c.useCallback((_,$,j,L)=>{l(M=>{const O=ju(_,$);return{...M,[O]:{...M[O],[j]:L}}})},[]),g=c.useCallback((_,$)=>{l(j=>{const L=ju(_,$);if(!j[L])return j;const M={...j};return delete M[L],M})},[]),S=c.useCallback((_,$)=>{f(j=>{const L=Fn(_),M=j[L],O=$(M);return M===O?j:{...j,[L]:O}})},[]),v=c.useCallback(_=>{n($=>[...$,_])},[]),w=c.useCallback(_=>{n($=>$.filter(j=>j.id!==_))},[]),x=c.useMemo(()=>({registerSequence:v,sequences:t,unregisterSequence:w}),[v,t,w]),b=c.useCallback(_=>o[Fn(_)]??{},[o]),k=c.useCallback((_,$)=>a[ju(_,$)]??{},[a]),E=c.useMemo(()=>({propStatuses:u}),[u]),I=c.useMemo(()=>({getDragOverrides:b,getEffectDragOverrides:k}),[b,k]),T=c.useMemo(()=>({setDragOverrides:m,clearDragOverrides:h,setEffectDragOverrides:y,clearEffectDragOverrides:g,setPropStatuses:S}),[m,h,y,g,S]);return d.jsx($l.Provider,{value:r,children:d.jsx(Yo.Provider,{value:x,children:d.jsx(Nl.Provider,{value:p,children:d.jsx(Al.Provider,{value:E,children:d.jsx(Ll.Provider,{value:I,children:d.jsx(t0.Provider,{value:T,children:e})})})})})})},zl=c.createContext(!1),YS=({children:e})=>d.jsx(zl.Provider,{value:!0,children:e}),n0=({children:e})=>d.jsx(zl.Provider,{value:!1,children:e}),KS=()=>{if(!J.useContext(zl))throw new Error("This component must be inside a <Series /> component.")},r0=c.createContext({premountFramesRemaining:0}),XS=!1,ms=e=>e??XS,hs=({from:e,durationInFrames:t,premountFor:n,postmountFor:r,style:o,styleWhilePremounted:i,styleWhilePostmounted:s,hideWhilePremounted:a})=>{const l=c.useContext(r0),u=ct()-l.premountFramesRemaining,f=Ze(),{fps:p}=Xe(),m=n??0,h=r??0,y=Math.ceil(e+t-1),g=!f.isRendering&&u<e&&u>=e-m,S=!f.isRendering&&u>y&&u<=y+h,v=g||S,w=g?e:S?e+t-1:0,x=c.useMemo(()=>v?{...o,...a==="opacity"?{opacity:0}:{display:"none"},pointerEvents:"none",...g?i:{},...S?s:{}}:o,[v,a,S,g,o,s,i]);return{effectivePremountFor:m,effectivePostmountFor:h,premountingActive:g,postmountingActive:S,isPremountingOrPostmounting:v,freezeFrame:w,premountingStyle:x}},GS=(e,t)=>{for(const n of t){const r=n.split("."),o=[e];let i=e;for(let s=0;s<r.length-1;s++){const a=r[s],l=i[a];if(l==null){i=null;break}i=l,o.push(i)}if(i!==null){delete i[r[r.length-1]];for(let s=o.length-1;s>0;s--){const a=o[s];if(Object.keys(a).length===0){const l=r[s-1];delete o[s-1][l]}else break}}}return e},qS=4,QS=.001,JS=1e-7,eE=10,Ei=11,Us=1/(Ei-1),tE=typeof Float32Array=="function";function o0(e,t){return 1-3*t+3*e}function i0(e,t){return 3*t-6*e}function s0(e){return 3*e}function Ja(e,t,n){return((o0(t,n)*e+i0(t,n))*e+s0(t))*e}function a0(e,t,n){return 3*o0(t,n)*e*e+2*i0(t,n)*e+s0(t)}function nE({aX:e,_aA:t,_aB:n,mX1:r,mX2:o}){let i,s,a=0,l=t,u=n;do s=l+(u-l)/2,i=Ja(s,r,o)-e,i>0?u=s:l=s;while(Math.abs(i)>JS&&++a<eE);return s}function rE(e,t,n,r){let o=t;for(let i=0;i<qS;++i){const s=a0(o,n,r);if(s===0)return o;const a=Ja(o,n,r)-e;o-=a/s}return o}function l0(e,t,n,r){if(!(e>=0&&e<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");const o=tE?new Float32Array(Ei):new Array(Ei);if(e!==t||n!==r)for(let s=0;s<Ei;++s)o[s]=Ja(s*Us,e,n);function i(s){let a=0,l=1;const u=Ei-1;for(;l!==u&&o[l]<=s;++l)a+=Us;--l;const f=(s-o[l])/(o[l+1]-o[l]),p=a+f*Us,m=a0(p,e,n);return m>=QS?rE(s,p,e,n):m===0?p:nE({aX:s,_aA:a,_aB:a+Us,mX1:e,mX2:n})}return function(s){const a=Math.min(1,Math.max(0,s));return e===t&&n===r?a:a===0?0:a===1?1:Ja(i(a),t,r)}}var oE=e=>Math.round(e*1e6)/1e6,iE=new Set(["deg","rad","grad","turn"]),u0=new Set(["%","cap","ch","cm","cqb","cqh","cqi","cqmax","cqmin","cqw","dvh","dvw","em","ex","ic","in","lh","lvh","lvw","mm","pc","pt","px","q","rem","rlh","svh","svw","vb","vh","vi","vmax","vmin","vw"]),c0=/^([+-]?(?:\d+\.?\d*|\.\d+))([a-zA-Z%]+)?$/,d0=new Set(["left","center","right","top","bottom"]),yo=e=>e==="left"?[{axis:"x",value:{value:0,unit:"%"}}]:e==="right"?[{axis:"x",value:{value:100,unit:"%"}}]:e==="top"?[{axis:"y",value:{value:0,unit:"%"}}]:e==="bottom"?[{axis:"y",value:{value:100,unit:"%"}}]:[{axis:"x",value:{value:50,unit:"%"}},{axis:"y",value:{value:50,unit:"%"}}],ui={value:50,unit:"%"},Im=e=>String(oE(e)),sE=(e,t)=>{const n=c0.exec(e);if(n===null)throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not a supported scale, translate, or rotate value`);const r=n[2]??null,o=Number(n[1]);if(!Number.isFinite(o))throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not finite`);if(r===null)return{kind:"scale",value:o,unit:null};if(iE.has(r))return{kind:"rotate",value:o,unit:r};if(u0.has(r))return{kind:"translate",value:o,unit:r};throw new TypeError(`Cannot interpolate "${t}" because "${r}" is not a supported translate or rotate unit`)},f0=({component:e,value:t,allowPercentage:n})=>{const r=c0.exec(e);if(r===null)throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not a supported transform-origin ${n?"length-percentage":"z length"}`);const o=r[2]??null,i=Number(r[1]);if(!Number.isFinite(i))throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not finite`);if(o===null||!u0.has(o)||!n&&o==="%")throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not a supported transform-origin ${n?"length-percentage":"z length"}`);return{value:i,unit:o}},Mu=(e,t)=>{const n=e.toLowerCase();return d0.has(n)?{type:"keyword",keyword:n}:{type:"length-percentage",parsed:f0({component:e,value:t,allowPercentage:!0})}},aE=(e,t,n)=>{const r=[];for(const o of yo(e))for(const i of yo(t))o.axis!==i.axis&&r.push(o.axis==="x"?[o.value,i.value]:[i.value,o.value]);if(r.length===0)throw new TypeError(`Cannot interpolate "${n}" because "${e} ${t}" is not a valid transform-origin keyword pair`);return r[0]},lE=(e,t)=>{if(e.length===1){const a=Mu(e[0],t);return a.type==="length-percentage"?[a.parsed,ui]:a.keyword==="top"||a.keyword==="bottom"?[ui,yo(a.keyword)[0].value]:[yo(a.keyword)[0].value,ui]}const n=Mu(e[0],t),r=Mu(e[1],t);if(n.type==="length-percentage"&&r.type==="length-percentage")return[n.parsed,r.parsed];if(n.type==="keyword"&&r.type==="keyword")return aE(n.keyword,r.keyword,t);const o=n.type==="keyword"?n:r.type==="keyword"?r:null,i=n.type==="length-percentage"?n.parsed:r.type==="length-percentage"?r.parsed:null;if(o===null||i===null)throw new Error("Expected a keyword and a length-percentage value");const s=n.type==="keyword";if(o.keyword==="left"||o.keyword==="right"){if(!s)throw new TypeError(`Cannot interpolate "${t}" because horizontal transform-origin keywords must come before a length-percentage value`);return[yo(o.keyword)[0].value,i]}return o.keyword==="top"||o.keyword==="bottom"?[i,yo(o.keyword)[0].value]:s?[ui,i]:[i,ui]},uE=(e,t)=>{const[n,r]=lE(t.slice(0,2),e),o=t[2]===void 0?{value:0,unit:null}:f0({component:t[2],value:e,allowPercentage:!1});return{kind:"translate",values:[n.value,r.value,o.value],units:[n.unit,r.unit,o.unit],dimensions:t[2]===void 0?2:3}},cE=e=>{var o,i,s,a,l,u;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`outputRange must contain only finite numbers, but got [${e}]`);return{kind:"scale",values:[e,e,1],units:[null,null,null],dimensions:1}}const t=e.trim().split(/\s+/);if(t.length<1||t.length>3||t[0]==="")throw new TypeError(`String outputRange values must contain 1 to 3 components, but got "${e}"`);if(t.some(f=>d0.has(f.toLowerCase())))return uE(e,t);const n=t.map(f=>sE(f,e)),[{kind:r}]=n;for(const f of n)if(f.kind!==r)throw new TypeError(`Cannot interpolate "${e}" because it mixes ${r} and ${f.kind} values`);if(r==="scale"){const f=n[0].value,p=((o=n[1])==null?void 0:o.value)??f,m=((i=n[2])==null?void 0:i.value)??1;return{kind:r,values:[f,p,m],units:[null,null,null],dimensions:n.length}}return{kind:r,values:[n[0].value,((s=n[1])==null?void 0:s.value)??0,((a=n[2])==null?void 0:a.value)??0],units:[n[0].unit,((l=n[1])==null?void 0:l.unit)??null,((u=n[2])==null?void 0:u.unit)??null],dimensions:n.length}},dE=({kind:e,values:t,units:n,dimensions:r})=>e==="scale"?t.slice(0,r).map(o=>Im(o)).join(" "):t.slice(0,r).map((o,i)=>`${Im(o)}${n[i]}`).join(" "),Tm=e=>e===0?0:Math.sign(e)*e*e,fE=e=>e===0?0:Math.sign(e)*Math.sqrt(Math.abs(e));function pE(e,t,n,r){const{extrapolateLeft:o,extrapolateRight:i,easing:s,output:a}=r;let l=e;const[u,f]=t,[p,m]=n;if(l<u){if(o==="identity")return l;if(o==="clamp")l=u;else if(o==="wrap"){const h=f-u;l=((l-u)%h+h)%h+u}}if(l>f){if(i==="identity")return l;if(i==="clamp")l=f;else if(i==="wrap"){const h=f-u;l=((l-u)%h+h)%h+u}}if(p===m)return p;if(l=(l-u)/(f-u),l=s(l),a==="perceptual-scale"){const h=Tm(p),y=Tm(m);l=fE(l*(y-h)+h)}else l=l*(m-p)+p;return l}function mE(e,t){let n;for(n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var hE=e=>e,gE=e=>e??"linear",p0=e=>e.remotionShouldExtendRight===!0,Rm=({easing:e,segmentIndex:t})=>e===void 0?hE:typeof e=="function"?e:e[t],_m=({input:e,inputRange:t,outputRange:n,easing:r,extrapolateLeft:o,extrapolateRight:i,output:s})=>pE(e,t,n,{easing:r,extrapolateLeft:o,extrapolateRight:e>t[1]&&i==="clamp"&&p0(r)?"extend":i,output:s}),_f=({input:e,inputRange:t,outputRange:n,options:r})=>{const o=gE(r==null?void 0:r.output);if(t.length===1)return n[0];const i=r==null?void 0:r.easing;let s="extend";(r==null?void 0:r.extrapolateLeft)!==void 0&&(s=r.extrapolateLeft);let a="extend";(r==null?void 0:r.extrapolateRight)!==void 0&&(a=r.extrapolateRight);const l=(r==null?void 0:r.posterize)===void 0?e:Math.floor(e/r.posterize)*r.posterize,u=mE(l,t),f=Rm({easing:i,segmentIndex:u});let p=_m({input:l,inputRange:[t[u],t[u+1]],outputRange:[n[u],n[u+1]],easing:f,extrapolateLeft:s,extrapolateRight:a,output:o});for(let m=0;m<u;m++){const h=Rm({easing:i,segmentIndex:m});if(!p0(h))continue;const y=t[m+1];if(l<=y)continue;const g=_m({input:l,inputRange:[t[m],y],outputRange:[n[m],n[m+1]],easing:h,extrapolateLeft:s,extrapolateRight:"extend",output:o});p+=g-n[m+1]}return p},vE=({input:e,inputRange:t,outputRange:n,options:r})=>{var u;const o=n.map(cE),i=(u=o[0])==null?void 0:u.kind;if(i===void 0)throw new Error("outputRange must have at least 1 element");for(const f of o)if(f.kind!==i)throw new TypeError(`Cannot interpolate ${i} values with ${f.kind} values`);const s=Math.max(...o.map(f=>f.dimensions)),a=[null,null,null];if(i!=="scale")for(let f=0;f<s;f++){for(const p of o){const m=p.units[f];if(m!==null){if(a[f]===null){a[f]=m;continue}if(a[f]!==m)throw new TypeError(`Cannot interpolate ${i} values with different units on axis ${f+1}: ${a[f]} and ${m}`)}}if(a[f]===null)throw new TypeError(`Cannot interpolate ${i} values because axis ${f+1} has no unit`)}const l=[0,0,0];for(let f=0;f<s;f++)l[f]=_f({input:e,inputRange:t,outputRange:o.map(p=>p.values[f]),options:r});return dE({kind:i,values:l,units:a,dimensions:s})},yE=e=>{var n;const t=(n=e[0])==null?void 0:n.length;if(t===void 0)throw new Error("outputRange must have at least 1 element");if(t===0)throw new TypeError("outputRange tuples must contain at least 1 number");for(const r of e){if(r.length!==t)throw new TypeError(`outputRange tuples must all have the same length, but got ${t} and ${r.length}`);for(const o of r)if(typeof o!="number"||!Number.isFinite(o))throw new TypeError(`outputRange tuples must contain only finite numbers, but got [${r.join(",")}]`)}return t},wE=({input:e,inputRange:t,outputRange:n,options:r})=>{const o=yE(n);return new Array(o).fill(!0).map((i,s)=>_f({input:e,inputRange:t,outputRange:n.map(a=>a[s]),options:r}))};function xE(e){for(let t=1;t<e.length;++t)if(!(e[t]>e[t-1]))throw new Error(`inputRange must be strictly monotonically increasing but got [${e.join(",")}]`)}function Pm(e,t){if(t.length<1)throw new Error(e+" must have at least 1 element");for(const n of t){if(typeof n!="number")throw new Error(`${e} must contain only numbers`);if(!Number.isFinite(n))throw new Error(`${e} must contain only finite numbers, but got [${t.join(",")}]`)}}function bE(e,t){if(e===void 0||typeof e=="function")return;const n=t-1;if(e.length!==n)throw new Error(`When easing is an array, it must have one entry per segment between keyframes (length inputRange.length - 1 = ${n}), but got length ${e.length}`);for(let r=0;r<e.length;r++)if(typeof e[r]!="function")throw new Error(`easing[${r}] must be a function`)}function SE(e){if(e!==void 0&&(typeof e!="number"||!Number.isFinite(e)||e<=0))throw new Error(`posterize must be a positive finite number, but got ${e}`)}function EE(e){if(!(e===void 0||e==="linear"||e==="perceptual-scale"))throw new Error(`output must be "linear" or "perceptual-scale", but got ${String(e)}`)}function Ko(e,t,n,r){if(typeof e>"u")throw new Error("input can not be undefined");if(typeof t>"u")throw new Error("inputRange can not be undefined");if(typeof n>"u")throw new Error("outputRange can not be undefined");if(t.length!==n.length)throw new Error("inputRange ("+t.length+") and outputRange ("+n.length+") must have the same length");if(Pm("inputRange",t),xE(t),bE(r==null?void 0:r.easing,t.length),SE(r==null?void 0:r.posterize),EE(r==null?void 0:r.output),typeof e!="number")throw new TypeError("Cannot interpolate an input which is not a number");if(!Array.isArray(n))throw new Error("outputRange must contain only numbers");if(n.some(i=>typeof i=="string")){if(!n.every(i=>typeof i=="string"||typeof i=="number"))throw new TypeError("outputRange must contain only numbers, or supported scale, translate, and rotate strings");return vE({input:e,inputRange:t,outputRange:n,options:r})}if(n.every(i=>Array.isArray(i)))return wE({input:e,inputRange:t,outputRange:n,options:r});if(!n.every(i=>typeof i=="number"))throw new TypeError("outputRange must contain only numbers, numeric tuples, or supported scale, translate, and rotate strings");return Pm("outputRange",n),_f({input:e,inputRange:t,outputRange:n,options:r})}var kE=({allowFloats:e,durationInFrames:t,frame:n})=>{if(typeof n>"u")throw new TypeError('Argument missing for parameter "frame"');if(typeof n!="number")throw new TypeError(`Argument passed for "frame" is not a number: ${n}`);if(!Number.isFinite(n))throw new RangeError(`Frame ${n} is not finite`);if(n<0&&n<-t)throw new RangeError(`Cannot use frame ${n}: Duration of composition is ${t}, therefore the lowest frame that can be rendered is ${-t}`);if(n>t-1)throw new RangeError(`Cannot use frame ${n}: Duration of composition is ${t}, therefore the highest frame that can be rendered is ${t-1}`)},CE=e=>{if(!(typeof e>"u")){if(typeof e!="number")throw new TypeError(`A "duration" of a spring must be a "number" but is "${typeof e}"`);if(Number.isNaN(e))throw new TypeError('A "duration" of a spring is NaN, which it must not be');if(!Number.isFinite(e))throw new TypeError('A "duration" of a spring must be finite, but is '+e);if(e<=0)throw new TypeError('A "duration" of a spring must be positive, but is '+e)}},IE={damping:10,mass:1,stiffness:100,overshootClamping:!1},$u={};function TE({animation:e,now:t,config:n}){const{toValue:r,lastTimestamp:o,current:i,velocity:s}=e,a=Math.min(t-o,64);if(n.damping<=0)throw new Error("Spring damping must be greater than 0, otherwise the spring() animation will never end, causing an infinite loop.");const l=n.damping,u=n.mass,f=n.stiffness,p=[r,o,i,s,l,u,f,t].join("-");if($u[p])return $u[p];const m=-s,h=r-i,y=l/(2*Math.sqrt(f*u)),g=Math.sqrt(f/u),S=g*Math.sqrt(1-y**2),v=a/1e3,w=Math.sin(S*v),x=Math.cos(S*v),b=Math.exp(-y*g*v),k=b*(w*((m+y*g*h)/S)+h*x),E=r-k,I=y*g*k-b*(x*(m+y*g*h)-S*h*w),T=Math.exp(-g*v),_=r-T*(h+(m+g*h)*v),$=T*(m*(v*g-1)+v*h*g*g),j={toValue:r,prevPosition:i,lastTimestamp:t,current:y<1?E:_,velocity:y<1?I:$};return $u[p]=j,j}var Au={};function m0({frame:e,fps:t,config:n={}}){const i=[e,t,n.damping,n.mass,n.overshootClamping,n.stiffness].join("-");if(Au[i])return Au[i];let s={lastTimestamp:0,current:0,toValue:1,velocity:0,prevPosition:0};const a=Math.max(0,e),l=a%1;for(let u=0;u<=Math.floor(a);u++){u===Math.floor(a)&&(u+=l);const f=u/t*1e3;s=TE({animation:s,now:f,config:{...IE,...n}})}return Au[i]=s,s}var Nu=new Map;function h0({fps:e,config:t={},threshold:n=.005}){if(typeof n!="number")throw new TypeError(`threshold must be a number, got ${n} of type ${typeof n}`);if(n===0)return 1/0;if(n===1)return 0;if(isNaN(n))throw new TypeError("Threshold is NaN");if(!Number.isFinite(n))throw new TypeError("Threshold is not finite");if(n<0)throw new TypeError("Threshold is below 0");const r=[e,t.damping,t.mass,t.overshootClamping,t.stiffness,n].join("-");if(Nu.has(r))return Nu.get(r);Rl(e,"to the measureSpring() function");let o=0,i=0;const s=()=>m0({fps:e,frame:o,config:t});let a=s();const l=()=>Math.abs(a.current-a.toValue);let u=l();for(;u>=n;)o++,a=s(),u=l();i=o;for(let f=0;f<20;f++)o++,a=s(),u=l(),u>=n&&(f=0,i=o+1);return Nu.set(r,i),i}function sd({frame:e,fps:t,config:n={},from:r=0,to:o=1,durationInFrames:i,durationRestThreshold:s,delay:a=0,reverse:l=!1}){CE(i),kE({frame:e,durationInFrames:1/0,allowFloats:!0}),Rl(t,"to spring()");const u=l||typeof i<"u",f=u?h0({fps:t,config:n,threshold:s}):void 0,p=u?{get:()=>f}:{get:()=>{throw new Error("did not calculate natural duration, this is an error with Remotion. Please report")}},h=(l?(i??p.get())-e:e)+(l?a:-a),y=i===void 0?h:h/(i/p.get());if(i&&h>i)return o;const g=m0({fps:t,frame:y,config:n}),S=n.overshootClamping?o>=r?Math.min(g.current,o):Math.max(g.current,o):g.current;return r===0&&o===1?S:Ko(S,[0,1],[r,o])}var Fm=e=>Math.min(1,Math.max(0,e)),ci=30;class el{static step0(t){return t>0?1:0}static step1(t){return t>=1?1:0}static linear(t){return t}static ease(t){return el.bezier(.42,0,1,1)(t)}static quad(t){return t*t}static cubic(t){return t*t*t}static poly(t){return n=>n**t}static sin(t){return 1-Math.cos(t*Math.PI/2)}static circle(t){const n=Fm(t);return 1-Math.sqrt(1-n*n)}static exp(t){return 2**(10*(t-1))}static elastic(t=1){const n=t*Math.PI;return r=>1-Math.cos(r*Math.PI/2)**3*Math.cos(r*n)}static back(t=1.70158){return n=>n*n*((t+1)*n-t)}static spring({allowTail:t=!1,durationRestThreshold:n,...r}={}){return Object.assign(i=>i<=0?0:!t&&i>=1?1:sd(t?{fps:ci,frame:i*h0({fps:ci,config:r,threshold:n}),config:r}:{fps:ci,frame:i*ci,config:r,durationInFrames:ci,durationRestThreshold:n}),{remotionShouldExtendRight:t})}static bounce(t){const n=Fm(t);if(n<1/2.75)return 7.5625*n*n;if(n<2/2.75){const o=n-.5454545454545454;return 7.5625*o*o+.75}if(n<2.5/2.75){const o=n-.8181818181818182;return 7.5625*o*o+.9375}const r=n-2.625/2.75;return 7.5625*r*r+.984375}static bezier(t,n,r,o){return l0(t,n,r,o)}static in(t){return t}static out(t){return n=>1-t(1-n)}static inOut(t){return n=>n<.5?t(n*2)/2:1-t((1-n)*2)/2}}var rn="[-+]?\\d*\\.?\\d+",Hs=rn+"%";function Zs(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Ys="(?:none|[-+]?\\d*\\.?\\d+(?:%|deg|rad|grad|turn)?)";function di(e){return new RegExp(e+"\\(\\s*("+Ys+")\\s+("+Ys+")\\s+("+Ys+")(?:\\s*\\/\\s*("+Ys+"))?\\s*\\)")}function RE(){const e={rgb:void 0,rgba:void 0,hsl:void 0,hsla:void 0,hex3:void 0,hex4:void 0,hex5:void 0,hex6:void 0,hex8:void 0,oklch:void 0,oklab:void 0,lab:void 0,lch:void 0,hwb:void 0};return e.rgb===void 0&&(e.rgb=new RegExp("rgb"+Zs(rn,rn,rn)),e.rgba=new RegExp("rgba"+Zs(rn,rn,rn,rn)),e.hsl=new RegExp("hsl"+Zs(rn,Hs,Hs)),e.hsla=new RegExp("hsla"+Zs(rn,Hs,Hs,rn)),e.hex3=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,e.hex4=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,e.hex6=/^#([0-9a-fA-F]{6})$/,e.hex8=/^#([0-9a-fA-F]{8})$/,e.oklch=di("oklch"),e.oklab=di("oklab"),e.lab=di("lab"),e.lch=di("lch"),e.hwb=di("hwb")),e}function To(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function jm(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=To(o,r,e+1/3),s=To(o,r,e),a=To(o,r,e-1/3);return Math.round(i*255)<<24|Math.round(s*255)<<16|Math.round(a*255)<<8}function Qr(e){const t=Number.parseInt(e,10);return t<0?0:t>255?255:t}function Mm(e){return(Number.parseFloat(e)%360+360)%360/360}function $m(e){const t=Number.parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Ks(e){const t=Number.parseFloat(e);return t<0?0:t>100?1:t/100}function Zt(e,t){return e==="none"?0:e.endsWith("%")?Number.parseFloat(e)/100*t:Number.parseFloat(e)}function Lu(e){return e==="none"?0:e.endsWith("rad")?Number.parseFloat(e)*180/Math.PI:e.endsWith("grad")?Number.parseFloat(e)*.9:e.endsWith("turn")?Number.parseFloat(e)*360:Number.parseFloat(e)}function fi(e){return e===void 0||e==="none"?1:e.endsWith("%")?Math.max(0,Math.min(1,Number.parseFloat(e)/100)):Math.max(0,Math.min(1,Number.parseFloat(e)))}function Ro(e){return e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055}function Xs(e){return Math.max(0,Math.min(1,e))}function pi(e,t,n,r){const o=Math.round(Xs(e)*255),i=Math.round(Xs(t)*255),s=Math.round(Xs(n)*255),a=Math.round(Xs(r)*255);return(o<<24|i<<16|s<<8|a)>>>0}function Am(e,t,n){const r=e+.3963377774*t+.2158037573*n,o=e-.1055613458*t-.0638541728*n,i=e-.0894841775*t-1.291485548*n,s=r*r*r,a=o*o*o,l=i*i*i,u=4.0767416621*s-3.3077115913*a+.2309699292*l,f=-1.2684380046*s+2.6097574011*a-.3413193965*l,p=-.0041960863*s-.7034186147*a+1.707614701*l;return[Ro(u),Ro(f),Ro(p)]}function Nm(e,t,n){const r=.008856451679035631,o=24389/27,i=.95047,s=1,a=1.08883,l=(e+16)/116,u=t/500+l,f=l-n/200,p=u*u*u,m=f*f*f,h=p>r?p:(116*u-16)/o,y=e>o*r?((e+16)/116)**3:e/o,g=m>r?m:(116*f-16)/o,S=h*i,v=y*s,w=g*a,x=3.2404542*S-1.5371385*v-.4985314*w,b=-.969266*S+1.8760108*v+.041556*w,k=.0556434*S-.2040259*v+1.0572252*w;return[Ro(x),Ro(b),Ro(k)]}function _E(e,t,n){if(t+n>=1){const u=t/(t+n);return[u,u,u]}const r=1,o=0,i=To(o,r,e+1/3),s=To(o,r,e),a=To(o,r,e-1/3),l=1-t-n;return[i*l+t,s*l+t,a*l+t]}var Lm={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199};function PE(e){const t=RE();let n;if(t.hex6&&(n=t.hex6.exec(e)))return Number.parseInt(n[1]+"ff",16)>>>0;if(Lm[e]!==void 0)return Lm[e];if(t.rgb&&(n=t.rgb.exec(e)))return(Qr(n[1])<<24|Qr(n[2])<<16|Qr(n[3])<<8|255)>>>0;if(t.rgba&&(n=t.rgba.exec(e)))return(Qr(n[1])<<24|Qr(n[2])<<16|Qr(n[3])<<8|$m(n[4]))>>>0;if(t.hex3&&(n=t.hex3.exec(e)))return Number.parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0;if(t.hex8&&(n=t.hex8.exec(e)))return Number.parseInt(n[1],16)>>>0;if(t.hex4&&(n=t.hex4.exec(e)))return Number.parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0;if(t.hsl&&(n=t.hsl.exec(e)))return(jm(Mm(n[1]),Ks(n[2]),Ks(n[3]))|255)>>>0;if(t.hsla&&(n=t.hsla.exec(e)))return(jm(Mm(n[1]),Ks(n[2]),Ks(n[3]))|$m(n[4]))>>>0;if(t.oklch&&(n=t.oklch.exec(e))){const r=Zt(n[1],1),o=Zt(n[2],.4),i=Lu(n[3]),s=fi(n[4]),a=i*Math.PI/180,[l,u,f]=Am(r,o*Math.cos(a),o*Math.sin(a));return pi(l,u,f,s)}if(t.oklab&&(n=t.oklab.exec(e))){const r=Zt(n[1],1),o=Zt(n[2],.4),i=Zt(n[3],.4),s=fi(n[4]),[a,l,u]=Am(r,o,i);return pi(a,l,u,s)}if(t.lab&&(n=t.lab.exec(e))){const r=Zt(n[1],100),o=Zt(n[2],125),i=Zt(n[3],125),s=fi(n[4]),[a,l,u]=Nm(r,o,i);return pi(a,l,u,s)}if(t.lch&&(n=t.lch.exec(e))){const r=Zt(n[1],100),o=Zt(n[2],150),i=Lu(n[3]),s=fi(n[4]),a=i*Math.PI/180,[l,u,f]=Nm(r,o*Math.cos(a),o*Math.sin(a));return pi(l,u,f,s)}if(t.hwb&&(n=t.hwb.exec(e))){const r=Lu(n[1]),o=Zt(n[2],1),i=Zt(n[3],1),s=fi(n[4]),[a,l,u]=_E(r/360,o,i);return pi(a,l,u,s)}throw new Error(`invalid color string ${e} provided`)}var zm=e=>(e>>24&255)/255,FE=e=>e>>16&255,jE=e=>e>>8&255,ME=e=>e&255,$E=(e,t,n,r)=>`rgba(${e}, ${t}, ${n}, ${r})`;function AE(e){const t=PE(e);return(t<<24|t>>>8)>>>0}var NE=(e,t,n,r)=>{const[o,i,s,a]=[FE,jE,ME,zm].map(l=>{const u=Ko(e,t,n.map(f=>l(f)),{easing:r==null?void 0:r.easing,extrapolateLeft:"clamp",extrapolateRight:"clamp",posterize:r==null?void 0:r.posterize});return l===zm?Number(u.toFixed(3)):Math.round(u)});return $E(o,i,s,a)},LE=(e,t,n,r)=>{if(typeof e>"u")throw new TypeError("input can not be undefined");if(typeof t>"u")throw new TypeError("inputRange can not be undefined");if(typeof n>"u")throw new TypeError("outputRange can not be undefined");if(t.length!==n.length)throw new TypeError("inputRange ("+t.length+" values provided) and outputRange ("+n.length+" values provided) must have the same length");const o=n.map(i=>AE(i));return NE(e,t,o,r)},Dm=({easing:e,forceSpringAllowTail:t})=>{switch(e.type){case"linear":return el.linear;case"spring":return el.spring({allowTail:t??e.allowTail??void 0,damping:e.damping,durationRestThreshold:e.durationRestThreshold??void 0,mass:e.mass,overshootClamping:e.overshootClamping,stiffness:e.stiffness});case"bezier":return l0(e.x1,e.y1,e.x2,e.y2);default:throw new TypeError(`Unsupported easing: ${JSON.stringify(e)}`)}},gs=({frame:e,forceSpringAllowTail:t,status:n})=>{const{keyframes:r,easing:o,clamping:i,interpolationFunction:s}=n;if(r.length===0)return null;const a=[...r].sort((f,p)=>f.frame-p.frame),l=a.map(f=>f.frame),u=a.map(f=>f.value);if(s==="interpolateColors"){if(!u.every(f=>typeof f=="string"))return null;if(r.length===1)return u[0];try{return LE(e,l,u,{easing:o.map(f=>Dm({easing:f,forceSpringAllowTail:t})),posterize:n.posterize})}catch{return null}}if(s!=="interpolate")return null;try{return Ko(e,l,u,{easing:o.map(f=>Dm({easing:f,forceSpringAllowTail:t})),extrapolateLeft:i.left,extrapolateRight:i.right,output:n.output,posterize:n.posterize})}catch{return null}},Dl=({dragOverrideValue:e,frame:t})=>{if(e===void 0)return{type:"none"};if(e.type==="static")return{type:"resolved",value:e.value};if(t===null)return{type:"none"};const n=gs({forceSpringAllowTail:null,frame:t,status:e.status});return n===null?{type:"none"}:{type:"resolved",value:n}},g0=({propStatus:e,dragOverrideValue:t,defaultValue:n,frame:r=null,shouldResortToDefaultValueIfUndefined:o=!1})=>{const i=Dl({dragOverrideValue:t,frame:r});return i.type==="resolved"&&i.value!==void 0?i.value:e.status==="keyframed"?r!==null?gs({forceSpringAllowTail:null,frame:r,status:e}):o?n:void 0:e.codeValue===void 0&&o?n:e.codeValue},Pf=c.createContext({overrideIdToNodePathMappings:{}}),zE=c.createContext({setOverrideIdToNodePath:()=>{throw new Error("OverrideIdsToNodePathsSettersContext not initialized")}}),DE=({descriptor:e,propStatusOverrides:t,dragOverrides:n,frame:r})=>{if(!t&&!n)return{params:e.params,effectKey:e.effectKey};const o={...e.params};if(t)for(const[i,s]of Object.entries(t))s!==void 0&&(o[i]=s);if(n)for(const[i,s]of Object.entries(n)){const a=Dl({dragOverrideValue:s,frame:r});a.type==="resolved"&&(o[i]=a.value)}return{params:o,effectKey:e.definition.calculateKey(o)}},OE=(e,t)=>{if(!e)return null;const n={};let r=!1;for(const[o,i]of Object.entries(e)){if(i.status==="static"){n[o]=i.codeValue,r=!0;continue}if(i.status==="keyframed"){const s=gs({forceSpringAllowTail:null,frame:t,status:i});s!==null&&(n[o]=s,r=!0)}}return r?n:null},vs=e=>{const t=c.useRef(null),n=e.map(i=>i.definition),r=t.current;return r!==null&&r.length===n.length&&r.every((i,s)=>i===n[s])?r:(t.current=n,n)},v0=({propStatuses:e,nodePath:t,effectIndex:n})=>{const r=e[Fn(t)];if(!r)return{type:"cannot-update-sequence",reason:"not-found"};if(!r.canUpdate)return{type:"cannot-update-sequence",reason:r.reason};const o=r.effects.find(i=>i.effectIndex===n);return o?o.canUpdate?{type:"can-update-effect",props:o.props}:{type:"cannot-update-effect",reason:o.reason}:{type:"cannot-update-effect",reason:"not-found"}},y0=(e,t)=>{const n=e[Fn(t)];if(n&&n.canUpdate)return n.props},ys=({effects:e,overrideId:t})=>{const n=c.useRef(null),{propStatuses:r}=c.useContext(Al),{getEffectDragOverrides:o}=c.useContext(Ll),i=ct(),{overrideIdToNodePathMappings:s}=c.useContext(Pf),a=n.current,l=t?s[t]??null:null,u=e.map((m,h)=>{if(l===null)return{descriptor:m,params:m.params,effectKey:m.effectKey};const y=v0({propStatuses:r,nodePath:l,effectIndex:h}),g=y.type==="can-update-effect"?OE(y.props,i):null,S=o(l,h),v=Object.keys(S).length===0?null:S,{params:w,effectKey:x}=DE({descriptor:m,propStatusOverrides:g,dragOverrides:v,frame:i});return{descriptor:m,params:w,effectKey:x}});if(a!==null&&a.length===u.length&&a.every((m,h)=>m.definition===u[h].descriptor.definition&&m.effectKey===u[h].effectKey))return a;const p=u.map(({descriptor:m,params:h,effectKey:y})=>({definition:m.definition,effectKey:y,params:h,memoized:!0}));return n.current=p,p},Ff=(e,t)=>{const n={};for(const r of Object.keys(e)){const o=e[r];if(o.type!=="hidden")if(o.type==="enum"){n[r]=o;const i=t(r)??o.default,s=o.variants[i];s&&Object.assign(n,Ff(s,t))}else n[r]=o}return n},jf=e=>{const t={},n=(r,o)=>{r in t||(t[r]=o)};for(const r of Object.keys(e)){const o=e[r];if(n(r,o),o.type==="enum")for(const i of Object.values(o.variants)){const s=jf(i);for(const a of Object.keys(s))n(a,s[a])}}return t},w0=({schema:e,key:t,value:n})=>{const r=e[t];if(!r)throw new Error("Key "+JSON.stringify(t)+" not found in schema");if(typeof n!="string")throw new Error("Value must be a string, but is "+JSON.stringify(n));if(r.type!=="enum")throw new Error("Key "+JSON.stringify(t)+" is not an enum");if(!r.variants[n])throw new Error("Value for "+JSON.stringify(t)+" must be one of "+Object.keys(r.variants).map(a=>JSON.stringify(a)).join(", ")+", got "+JSON.stringify(n));const i=Object.keys(r.variants).filter(a=>a!==n),s=new Set;for(const a of i){const l=r.variants[a],u=Object.keys(l);for(const f of u)s.add(f)}return[...s]},Om={type:"linear"},VE=({insertedKeyframeIndex:e,easingLength:t,keyframeCount:n})=>!(e>0&&e<n-1)||t===0?null:Math.min(e-1,t-1),BE=e=>({type:"static",value:e}),WE=({status:e,frame:t,value:n})=>{const r=e.keyframes.findIndex(s=>s.frame===t),o=r===-1?[...e.keyframes,{frame:t,value:n}].sort((s,a)=>s.frame-a.frame):e.keyframes.map((s,a)=>a===r?{frame:t,value:n}:s),i=[...e.easing];if(r===-1){const s=o.findIndex(u=>u.frame===t),a=VE({insertedKeyframeIndex:s,easingLength:i.length,keyframeCount:o.length}),l=a===null?Om:i[a];i.splice(s,0,l)}for(;i.length<o.length-1;)i.push(Om);return i.length>o.length-1&&(i.length=o.length-1),{type:"keyframed",status:{...e,keyframes:o,easing:i}}},UE=e=>{if((e==null?void 0:e.type)==="static")return e.value},HE=e=>e!==null&&e.status==="keyframed",x0=(e,t)=>{if(t in e)return e[t];for(const n of Object.values(e))if(n.type==="enum")for(const r of Object.values(n.variants)){const o=x0(r,t);if(o)return o}},b0=({schema:e,currentValue:t,overrideValues:n,propStatus:r,frame:o})=>{var a;const i={},s=new Set;for(const l of Object.keys(t)){const u=(r==null?void 0:r[l])??null,f=x0(e,l);if((f==null?void 0:f.type)==="hidden")continue;let p;if(u===null)p=t[l];else if(HE(u))if((f==null?void 0:f.type)==="array"||(f==null?void 0:f.keyframable)===!1)p=t[l];else{const m=Dl({dragOverrideValue:n[l],frame:o});m.type==="resolved"?p=m.value:o!==null?p=gs({forceSpringAllowTail:null,frame:o,status:u})??t[l]:p=t[l]}else u.status==="computed"?p=t[l]:p=g0({propStatus:u,dragOverrideValue:n[l],defaultValue:f==null?void 0:f.default,frame:o,shouldResortToDefaultValueIfUndefined:!1});(f==null?void 0:f.type)==="asset"&&typeof p=="string"&&p.startsWith(Ji)&&(p=`${window.remotion_staticBase}/${p.slice(Ji.length)}`),p===void 0&&s.add(l),i[l]=p}for(const l of Object.keys(n))if(((a=e[l])==null?void 0:a.type)==="enum"){const u=w0({schema:e,key:l,value:i[l]});for(const f of u)s.add(f)}return{merged:i,propsToDelete:s}},S0=(e,t)=>{const n=t.split(".");let r=e;for(const o of n){if(r==null||typeof r!="object")return;r=r[o]}return r},E0=({flatSchema:e,key:t,props:n})=>{var o;const r=S0(n,t);if(!(((o=e[t])==null?void 0:o.type)==="text-content"&&typeof r!="string"))return r},ZE=(e,t,n)=>{const r={};for(const o of t)r[o]=n?E0({flatSchema:n,key:o,props:e}):S0(e,o);return r},YE=(e,t)=>Object.keys(Ff(e,n=>t[n])),KE=({flatSchema:e,props:t,valuesDotNotation:n,schemaKeys:r,propsToDelete:o})=>{var a;const i={...t};for(const l of r){const u=n[l];if(((a=e[l])==null?void 0:a.type)==="text-content"&&u===void 0)continue;const f=l.split(".");if(f.length===1){i[l]=u;continue}let p=i;for(let m=0;m<f.length-1;m++){const h=f[m];typeof p[h]=="object"&&p[h]!==null?p[h]={...p[h]}:p[h]={},p=p[h]}p[f[f.length-1]]=u}const s=new Set([...o].filter(l=>{var u;return!(((u=e[l])==null?void 0:u.type)==="text-content"&&n[l]===void 0)}));return GS(i,s),i},Vm={},Wn=({Component:e,componentName:t,componentIdentity:n,schema:r,supportsEffects:o})=>{const i=BS(r),s=jf(i),a=Object.keys(s),l=c.forwardRef((u,f)=>{const p=Ze();if(!p.isStudio||p.isReadOnlyStudio||p.isRendering)return J.createElement(e,{...u,controls:null,ref:f});const{propStatuses:m}=c.useContext(Al),{getDragOverrides:h}=c.useContext(Ll),y=c.useContext(Pf),g=ct();if(u.controls)return J.createElement(e,{...u,ref:f});const[S]=c.useState(()=>{const{stack:_}=u;if(!_)return String(Math.random());const $=Vm[_];if($)return $;const j=String(Math.random());return Vm[_]=j,j}),v=y.overrideIdToNodePathMappings[S]??null,w=a.map(_=>E0({flatSchema:s,key:_,props:u})),x=c.useMemo(()=>ZE(u,a,s),w),b=c.useMemo(()=>({schema:i,currentRuntimeValueDotNotation:x,overrideId:S,supportsEffects:o,componentIdentity:n,componentName:t}),[x,S]),{merged:k,propsToDelete:E}=c.useMemo(()=>b0({schema:i,currentValue:x,overrideValues:v===null?{}:h(v),propStatus:v===null?void 0:y0(m,v),frame:g}),[x,h,v,m,g]),I=YE(i,k),T=KE({flatSchema:s,props:u,valuesDotNotation:k,schemaKeys:I,propsToDelete:E});return J.createElement(e,{...T,controls:b,ref:f})});return l.displayName=`withInteractivitySchema(${e.displayName||e.name||"Component"})`,l},zu=[],XE=({from:e=0,trimBefore:t=0,freeze:n,durationInFrames:r=1/0,children:o,name:i,height:s,width:a,showInTimeline:l=!0,hidden:u=!1,controls:f,_remotionInternalEffects:p,_remotionInternalLoopDisplay:m,_remotionInternalStack:h,_remotionInternalDocumentationLink:y,_remotionInternalSingleChildComponent:g,_remotionInternalPremountDisplay:S,_remotionInternalPostmountDisplay:v,_remotionInternalIsMedia:w,outlineRef:x,...b},k)=>{const{layout:E="absolute-fill"}=b,[I]=c.useState(()=>String(Math.random())),T=c.useContext(et),{rootId:_}=wr(),$=T?T.cumulatedFrom+T.relativeFrom:0,j=Il();if(E!=="absolute-fill"&&E!=="none")throw new TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${E}`);if(E==="none"&&typeof b.style<"u")throw new TypeError('If layout="none", you may not pass a style. Passed: '+JSON.stringify(b.style));if(typeof r!="number")throw new TypeError(`You passed to durationInFrames an argument of type ${typeof r}, but it must be a number.`);if(r<=0)throw new TypeError(`durationInFrames must be positive, but got ${r}`);if(typeof e!="number")throw new TypeError(`You passed to the "from" props of your <Sequence> an argument of type ${typeof e}, but it must be a number.`);if(!Number.isFinite(e))throw new TypeError(`The "from" prop of a sequence must be finite, but got ${e}.`);if(typeof t!="number")throw new TypeError(`You passed to the "trimBefore" prop of your <Sequence> an argument of type ${typeof t}, but it must be a number.`);if(t<0)throw new TypeError(`The "trimBefore" prop of <Sequence /> must be greater than or equal to 0, but got ${t}.`);if(Number.isNaN(t))throw new TypeError('The "trimBefore" prop of <Sequence /> must be a real number, but it is NaN.');if(!Number.isFinite(t))throw new TypeError(`The "trimBefore" prop of <Sequence /> must be finite, but it is ${t}.`);if(typeof n<"u"&&n!==null){if(typeof n!="number")throw new TypeError(`The "freeze" prop of <Sequence /> must be a number, but is of type ${typeof n}.`);if(Number.isNaN(n))throw new TypeError('The "freeze" prop of <Sequence /> must be a real number, but it is NaN.');if(!Number.isFinite(n))throw new TypeError(`The "freeze" prop of <Sequence /> must be finite, but it is ${n}.`)}const L=xr(),M=Xe(),O=e-t,Z=((T==null?void 0:T.absoluteFrom)??0)+O,D=T?Math.min(T.durationInFrames-O,r):r,R=Math.max(0,Math.min(M.durationInFrames-e,D)),{registerSequence:C,unregisterSequence:F}=c.useContext(Yo),P=c.useRef(null),V=b.layout==="none"?x??null:x??P,W=c.useMemo(()=>(T==null?void 0:T.premounting)||!!b._remotionInternalIsPremounting,[b._remotionInternalIsPremounting,T==null?void 0:T.premounting]),N=c.useMemo(()=>(T==null?void 0:T.postmounting)||!!b._remotionInternalIsPostmounting,[b._remotionInternalIsPostmounting,T==null?void 0:T.postmounting]),A=$+O,B=T?T.cumulatedFrom+T.relativeFrom:0,H=T?B-T.cumulatedNegativeFrom:0,z=Math.max(0,H,A),Y=A-z,oe=c.useMemo(()=>({absoluteFrom:Z,cumulatedFrom:$,relativeFrom:O,cumulatedNegativeFrom:Y,durationInFrames:R,parentFrom:(T==null?void 0:T.relativeFrom)??0,id:I,height:s??(T==null?void 0:T.height)??null,width:a??(T==null?void 0:T.width)??null,premounting:W,postmounting:N,premountDisplay:S??null,postmountDisplay:v??null}),[$,Z,O,R,T,I,s,a,W,N,S,v,Y]),ae=c.useMemo(()=>i??"",[i]),ce=y??"https://www.remotion.dev/docs/sequence",se=Ze(),G=c.useContext(zl),ee=(b==null?void 0:b.stack)??null,Q=c.useRef(null);Q.current=h??ee;const q=typeof n=="number"?n:null,he=t===0?null:t,Ce=(T==null?void 0:T.cumulatedNegativeFrom)??0,ve=w&&w.type!=="image"?w.data.startMediaFrom+Ce-Y:null,pe=w&&w.type!=="image"?w.data.startMediaFrom+Ce:null,Re=w&&w.type!=="image"&&pe!==null?q===null?null:pe+(m?q%m.durationInFrames:q)*w.data.playbackRate:null;c.useEffect(()=>{if(se.isStudio)return w?(w.type==="image"?C({type:"image",controls:f??null,effects:p??zu,displayName:ae,documentationLink:ce,duration:R,from:e,trimBefore:he,id:I,loopDisplay:m,nonce:j.get(),parent:(T==null?void 0:T.id)??null,postmountDisplay:v??null,premountDisplay:S??null,rootId:_,showInTimeline:l,src:w.src,getStack:()=>Q.current,refForOutline:V??null,isInsideSeries:G,frozenFrame:q,singleChildComponent:g??null}):C({type:w.type,controls:f??null,effects:p??zu,displayName:ae,documentationLink:ce,doesVolumeChange:w.data.doesVolumeChange,duration:R,from:e,trimBefore:he,id:I,loopDisplay:m,nonce:j.get(),parent:(T==null?void 0:T.id)??null,playbackRate:w.data.playbackRate,postmountDisplay:v??null,premountDisplay:S??null,rootId:_,showInTimeline:l,src:w.data.src,getStack:()=>Q.current,startMediaFrom:ve??w.data.startMediaFrom,mediaFrameAtSequenceZero:pe,volume:w.data.volumes,refForOutline:V??null,isInsideSeries:G,frozenFrame:q,frozenMediaFrame:Re,singleChildComponent:g??null}),()=>{F(I)}):(C({from:e,trimBefore:he,duration:R,id:I,displayName:ae,documentationLink:ce,parent:(T==null?void 0:T.id)??null,type:"sequence",rootId:_,showInTimeline:l,nonce:j.get(),loopDisplay:m,getStack:()=>Q.current,premountDisplay:S??null,postmountDisplay:v??null,controls:f??null,effects:p??zu,refForOutline:V??null,isInsideSeries:G,frozenFrame:q,singleChildComponent:g??null}),()=>{F(I)})},[r,I,i,C,ae,F,T==null?void 0:T.id,R,_,e,t,he,l,j,m,S,v,se.isStudio,f,p,w,ce,V,G,q,ve,pe,Re,g]);const be=Math.ceil($+e+r-1),we=L<$+e||L>be?null:o,Pe=we===null||typeof n>"u"||n===null?we:d.jsx(ps,{frame:n,children:we}),ue=b.layout==="none"?void 0:b.style,Ge=c.useCallback(At=>{P.current=At,typeof k=="function"?k(At):k&&(k.current=At)},[k]),Et=c.useMemo(()=>({flexDirection:void 0,...a?{width:a}:{},...s?{height:s}:{},...ue??{}}),[s,ue,a]);if(k!==null&&E==="none")throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');return u?null:d.jsx(et.Provider,{value:oe,children:Pe===null?null:b.layout==="none"?Pe:d.jsx(pn,{ref:Ge,style:Et,className:b.className,children:Pe})})},GE=c.forwardRef(XE),qE=(e,t)=>{if(e.layout==="none")throw new Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');const{style:n,from:r=0,durationInFrames:o=1/0,premountFor:i=0,postmountFor:s=0,styleWhilePremounted:a,styleWhilePostmounted:l,...u}=e,{freezeFrame:f,isPremountingOrPostmounting:p,postmountingActive:m,premountingActive:h,premountingStyle:y}=hs({from:r,durationInFrames:o,premountFor:i,postmountFor:s,style:n??null,styleWhilePremounted:a??null,styleWhilePostmounted:l??null,hideWhilePremounted:"opacity"});return d.jsx(ps,{frame:f,active:p,children:d.jsx(Ol,{ref:t,from:r,durationInFrames:o,style:y??void 0,_remotionInternalPremountDisplay:i,_remotionInternalPostmountDisplay:s,_remotionInternalIsPremounting:h,_remotionInternalIsPostmounting:m,...u})})},QE=c.forwardRef(qE),JE=(e,t)=>{const n=Ze(),{fps:r}=Xe();if(e.layout!=="none"&&!n.isRendering){const o=e.premountFor;if(o||e.postmountFor)return d.jsx(QE,{ref:t,...e,premountFor:o})}return d.jsx(GE,{...e,ref:t})},Ol=c.forwardRef(JE),k0=Ol,dt=Wn({Component:Ol,componentName:"<Sequence>",componentIdentity:"dev.remotion.remotion.Sequence",schema:Lo,supportsEffects:!1});Wn({Component:Ol,componentName:"<Sequence>",componentIdentity:null,schema:US,supportsEffects:!1});var C0=(e,t,n)=>{switch(e){case"fill":return[0,0,t.width,t.height,0,0,n.width,n.height];case"contain":{const r=Math.min(n.width/t.width,n.height/t.height),o=(n.width-t.width*r)/2,i=(n.height-t.height*r)/2;return[0,0,t.width,t.height,o,i,t.width*r,t.height*r]}case"cover":{const r=Math.max(n.width/t.width,n.height/t.height),o=(n.width-t.width*r)/2,i=(n.height-t.height*r)/2;return[0,0,t.width,t.height,o,i,t.width*r,t.height*r]}default:throw new Error("Unknown fit: "+e)}},ek="https://remotion.dev/docs/troubleshooting/webgl2-context",I0=(e,t)=>`Failed to acquire ${e} context for ${t}. Pass --gl=angle when using the CLI, set chromiumOptions: { gl: "angle" } when using SSR APIs, or set "OpenGL render backend" to "angle" in the Advanced section when rendering in the Studio. See ${ek}`,tk=e=>new Error(I0("WebGL",e)),T0=e=>new Error(I0("WebGL2",e));class nk{constructor(t,n){Ie(this,"width");Ie(this,"height");Ie(this,"pairs",new Map);Ie(this,"lostContexts",new Set);this.width=t,this.height=n}getPair(t){const n=this.pairs.get(t);if(n)return n;const r=[this.allocateCanvas(t),this.allocateCanvas(t)];return this.pairs.set(t,r),r}assertContextNotLost(t){if(this.lostContexts.has(t))throw new Error("WebGL context was lost during canvas effect rendering. This typically happens in headless or memory-constrained environments (e.g. Remotion Lambda). Try reducing concurrency or increasing the Lambda function memory.")}allocateCanvas(t){const n=document.createElement("canvas");switch(n.width=this.width,n.height=this.height,t){case"2d":{if(!n.getContext("2d",{colorSpace:"srgb"}))throw new Error("Failed to acquire 2D context for canvas effect");return n}case"webgl2":{const r=n.getContext("webgl2",{premultipliedAlpha:!0,alpha:!0,preserveDrawingBuffer:!0});if(!r)throw T0("canvas effect");return n.addEventListener("webglcontextlost",o=>{o.preventDefault(),this.lostContexts.add(n)}),n.addEventListener("webglcontextrestored",()=>{this.lostContexts.delete(n)}),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),n}case"webgpu":{if(typeof navigator>"u"||!("gpu"in navigator))throw new Error("WebGPU is not available in this environment for canvas effect");return n}default:{const r=t;throw new Error(`Unknown effect backend: ${r}`)}}}}var rk=e=>{const t=[];let n=[],r=null;for(const o of e){const{backend:i}=o.definition;r===null||i===r?(n.push(o),r=i):(t.push({backend:r,effects:n}),n=[o],r=i)}return r!==null&&n.length>0&&t.push({backend:r,effects:n}),t},Gs=null,ok=()=>Gs||(Gs=(async()=>{if(typeof navigator>"u"||!("gpu"in navigator))throw new Error("WebGPU is not available in this environment");const{gpu:e}=navigator,t=await e.requestAdapter();if(!t)throw new Error("No WebGPU adapter available");return t.requestDevice()})(),Gs),R0=(e,t)=>({pool:new nk(e,t),setupCache:new WeakMap,cleanupRegistry:[],currentRunId:0}),ad=e=>{e.currentRunId++;for(const t of e.cleanupRegistry)t.definition.cleanup(t.state)},ik=(e,t,n)=>{const r=t;let o=e.setupCache.get(r);if(o||(o=new WeakMap,e.setupCache.set(r,o)),o.has(n))return o.get(n);const i=t.setup(n);return o.set(n,i),e.cleanupRegistry.push({definition:r,state:i}),i},ws=async({state:e,source:t,effects:n,output:r,width:o,height:i})=>{const s=++e.currentRunId,a=()=>e.currentRunId!==s,l=n.filter(S=>!S.params.disabled),u=rk(l);let f=t,p=null;if(u.length===0){if(t===r)return!0;const S=r.getContext("2d");if(!S)throw new Error("Failed to acquire 2D context for output canvas");return S.clearRect(0,0,o,i),S.drawImage(f,0,0,o,i),!0}let m=!1;for(const S of u)if(S.backend==="webgpu"){m=!0;break}const h=m?await ok():null;if(a())return!1;let y=!0;for(let S=0;S<u.length;S++){const v=u[S],[w,x]=e.pool.getPair(v.backend);let b=w;for(const E of v.effects){const I=E.definition,T=ik(e,I,b);I.apply({source:f,target:b,state:T,params:E.params,width:o,height:i,gpuDevice:h,flipSourceY:v.backend==="webgl2"?y:!1}),v.backend==="webgl2"&&(y=!0,e.pool.assertContextNotLost(b)),f=b,b=b===w?x:w}p=f??p;const k=u[S+1];if(k&&k.backend!==v.backend&&p)if(v.backend==="2d"&&k.backend==="webgl2")f=p,y=!0;else{const E=await createImageBitmap(p);if(a())return E.close(),!1;f=E,k.backend==="webgl2"&&(y=!1)}}if(!p)return!0;const g=r.getContext("2d");if(!g)throw new Error("Failed to acquire 2D context for output canvas");return g.clearRect(0,0,o,i),g.drawImage(p,0,0,o,i),!0},xs=()=>{const e=c.useRef(null),t=c.useRef(null);return c.useEffect(()=>()=>{e.current&&ad(e.current)},[]),c.useMemo(()=>({get:(n,r)=>((!t.current||t.current.width!==n||t.current.height!==r)&&(e.current&&ad(e.current),e.current=R0(n,r),t.current={width:n,height:r}),e.current)}),[])},sk=({width:e,height:t,fit:n,className:r,style:o,effects:i,...s},a)=>{const l=c.useRef(null),u=xs(),f=c.useMemo(()=>typeof document>"u"?null:document.createElement("canvas"),[]),p=c.useCallback(m=>{const h=l.current,y=e??m.displayWidth,g=t??m.displayHeight;if(!h)throw new Error("Canvas ref is not set");if(!f)throw new Error("Source canvas is not available");f.width=y,f.height=g;const S=f.getContext("2d");if(!S)throw new Error("Could not get 2d context for source canvas");return S.drawImage(m,...C0(n,{height:m.displayHeight,width:m.displayWidth},{width:y,height:g})),h.width=y,h.height=g,ws({state:u.get(y,g),source:f,effects:i,output:h,width:y,height:g})},[u,i,n,t,f,e]);return c.useImperativeHandle(a,()=>({draw:p,getCanvas:()=>{if(!l.current)throw new Error("Canvas ref is not set");return l.current},clear:()=>{var h;const m=(h=l.current)==null?void 0:h.getContext("2d");if(!m)throw new Error("Could not get 2d context");m.clearRect(0,0,l.current.width,l.current.height)}}),[p]),d.jsx("canvas",{ref:l,className:r,style:o,...s})},ak=J.forwardRef(sk),_0=async({resolvedSrc:e,signal:t,requestInit:n,contentType:r})=>{if(typeof ImageDecoder>"u")throw new Error("Your browser does not support the WebCodecs ImageDecoder API.");const o=await fetch(e,{...n,signal:t}),{body:i}=o;if(!i)throw new Error("Got no body");const s=new ImageDecoder({data:i,type:r??o.headers.get("Content-Type")??"image/gif"});await Promise.all([s.completed,s.tracks.ready]);const{selectedTrack:a}=s.tracks;if(!a)throw s.close(),new Error("No selected track");return{decoder:s,selectedTrack:a}},lk=5,Bm=({loopBehavior:e,durationFound:t,timeInSec:n})=>e==="loop"?t?n%t:n:Math.min(n,t||1/0),uk=async({resolvedSrc:e,signal:t,requestInit:n,currentTime:r,initialLoopBehavior:o})=>{const{decoder:i,selectedTrack:s}=await _0({resolvedSrc:e,signal:t,requestInit:n,contentType:null}),a=[];let l=null;const u=async h=>{const y=a.find(S=>S.frameIndex===h);if(y&&y.frame)return y;const g=await i.decode({frameIndex:h,completeFramesOnly:!0});return y?y.frame=g.image:a.push({frame:g.image,frameIndex:h,timeInSeconds:g.image.timestamp/1e6}),{frame:g.image,frameIndex:h,timeInSeconds:g.image.timestamp/1e6}},f=h=>{const g=a.filter(S=>S.frame).sort((S,v)=>{const w=Math.abs(S.timeInSeconds-h),x=Math.abs(v.timeInSeconds-h);return w-x});for(let S=0;S<g.length;S++){if(S<lk)continue;const v=g[S];v.frame=null}},p=async({timeInSec:h,loopBehavior:y})=>{const g=Bm({durationFound:l,loopBehavior:y,timeInSec:h}),v=a.filter(x=>x.timeInSeconds<=g).map(x=>x.frameIndex).reduce((x,b)=>Math.max(x,b),0);let w=v;for(;;){const x=await u(w);if(w++,!x.frame)throw new Error("No frame found");if(!x.frame.duration||(w===s.frameCount&&l===null&&(l=(x.frame.timestamp+x.frame.duration)/1e6),x.timeInSeconds>g||w===s.frameCount))break}s.frameCount-v<3&&y==="loop"&&await u(0),f(g)};return await p({timeInSec:r,loopBehavior:o}),await p({timeInSec:r,loopBehavior:o}),{close:()=>{var h;for(const y of a)(h=y.frame)==null||h.close(),y.frame=null;i.close()},getFrame:async(h,y)=>{if(l!==null&&h>l&&y==="clear-after-finish")return null;const g=Bm({loopBehavior:y,durationFound:l,timeInSec:h});await p({timeInSec:g,loopBehavior:y});const v=a.filter(w=>w.frame).reduce((w,x)=>{const b=Math.abs(w.timeInSeconds-g),k=Math.abs(x.timeInSeconds-g);return b<k?w:x});if(!v.frame)throw new Error("No frame found");return v},frameCount:s.frameCount}},ck=({frame:e,playbackRate:t,fps:n})=>e*t/n,dk=e=>{if(!e)return null;const t={...e};delete t.signal;const{headers:n,...r}=t;return JSON.stringify({...r,headers:n?Array.from(new Headers(n).entries()):null})},fk=e=>typeof window>"u"?e:new URL(e,window.origin).href,pk={src:{type:"asset",default:void 0,description:"Source",keyframable:!1},...Bn,...Zo,playbackRate:{type:"number",min:0,max:10,step:.1,default:1,description:"Playback rate",hiddenFromList:!1,keyframable:!1},...Tn,...Sr,...br},mk=e=>{const t={},n=t;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(r.startsWith("data-")||r.startsWith("aria-"))&&(n[r]=e[r]);return t},P0=c.forwardRef(({src:e,width:t,height:n,onError:r,loopBehavior:o="loop",playbackRate:i=1,fit:s="fill",requestInit:a,effects:l,controls:u,...f},p)=>{const m=fk(e),[h,y]=c.useState(null),{delayRender:g,continueRender:S}=mn(),[v]=c.useState(()=>g(`Rendering <AnimatedImage/> with src="${m}"`)),w=ct(),{fps:x}=Xe(),b=ck({frame:w,playbackRate:i,fps:x}),k=c.useRef(b);k.current=b;const E=dk(a),I=c.useRef(a);I.current=a;const T=c.useRef(null),_=ys({effects:l,overrideId:(u==null?void 0:u.overrideId)??null});c.useImperativeHandle(p,()=>{var L;const j=(L=T.current)==null?void 0:L.getCanvas();if(!j)throw new Error("Canvas ref is not set");return j},[]);const[$]=c.useState(()=>o);return c.useEffect(()=>{const j=new AbortController;let L=!1,M=!1;const O=()=>{M||(M=!0,S(v))};return uk({resolvedSrc:m,signal:j.signal,requestInit:I.current,currentTime:k.current,initialLoopBehavior:$}).then(Z=>{if(L){Z.close();return}y(Z),O()}).catch(Z=>{if(!L){if(Z.name==="AbortError"){O();return}r?(r==null||r(Z),O()):es(Z)}}),()=>{L=!0,j.abort(),O()}},[m,v,r,E,$,S]),c.useEffect(()=>()=>{h==null||h.close()},[h]),c.useLayoutEffect(()=>{if(!h)return;const j=g(`Rendering frame at ${b} of <AnimatedImage src="${e}"/>`);let L=!1;return h.getFrame(b,o).then(async M=>{var Z,D;if(L)return;if(M===null){(Z=T.current)==null||Z.clear(),S(j);return}await((D=T.current)==null?void 0:D.draw(M.frame))&&!L&&S(j)}).catch(M=>{L||(r?(r(M),S(j)):es(M))}),()=>{L=!0,S(j)}},[b,h,o,r,e,S,g,_,s,t,n]),d.jsx(ak,{ref:T,width:t,height:n,fit:s,effects:_,...f})});P0.displayName="AnimatedImageContent";var hk=({src:e,width:t,height:n,onError:r,fit:o,playbackRate:i,loopBehavior:s,id:a,className:l,style:u,durationInFrames:f,from:p,premountFor:m,postmountFor:h,styleWhilePremounted:y,styleWhilePostmounted:g,requestInit:S,effects:v=[],controls:w,ref:x,...b})=>{const k=c.useRef(null),E=vs(v);c.useImperativeHandle(x,()=>k.current,[]);const{effectivePostmountFor:I,effectivePremountFor:T,freezeFrame:_,isPremountingOrPostmounting:$,postmountingActive:j,premountingActive:L,premountingStyle:M}=hs({from:p??0,durationInFrames:f??1/0,premountFor:m??null,postmountFor:h??null,style:u??null,styleWhilePremounted:y??null,styleWhilePostmounted:g??null,hideWhilePremounted:"display-none"}),O=mk(b),Z={src:e,width:t,height:n,onError:r,fit:o,playbackRate:i,loopBehavior:s,id:a,className:l,style:M??void 0,requestInit:S,...O};return d.jsx(ps,{frame:_,active:$,children:d.jsx(dt,{layout:"none",from:p??0,durationInFrames:f??1/0,name:"<AnimatedImage>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/animatedimage",controls:w,_remotionInternalEffects:E,_remotionInternalPremountDisplay:T||null,_remotionInternalPostmountDisplay:I||null,_remotionInternalIsPremounting:L,_remotionInternalIsPostmounting:j,...b,outlineRef:k,children:d.jsx(P0,{...Z,ref:k,effects:v,controls:w})})})},F0=Wn({Component:hk,componentName:"<AnimatedImage>",componentIdentity:"dev.remotion.remotion.AnimatedImage",schema:pk,supportsEffects:!0});F0.displayName="AnimatedImage";St(F0);var gk={type:"boolean",default:!1,description:"Disabled"},vk=e=>{const{calculateKey:t,validateParams:n}=e,r={...e,documentationLink:e.documentationLink??null,calculateKey:i=>{const s=i.disabled??!1;return`${t(i)}-disabled-${s}`},schema:{disabled:gk,...e.schema}};return(i={})=>(n(i),{definition:r,params:i,effectKey:r.calculateKey(i),memoized:!1})},yk=e=>{if(typeof e!="string")throw new TypeError(`The "filename" must be a string, but you passed a value of type ${typeof e}`);if(e.trim()==="")throw new Error("The `filename` must not be empty");if(!e.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.')},wk=e=>{if(typeof e!="string"&&!(e instanceof Uint8Array))throw new TypeError(`The "content" must be a string or Uint8Array, but you passed a value of type ${typeof e}`);if(typeof e=="string"&&e.trim()==="")throw new Error("The `content` must not be empty")},j0=e=>{e.type==="artifact"&&(yk(e.filename),e.contentType!=="thumbnail"&&wk(e.content))},Zr=c.createContext({registerRenderAsset:()=>{},unregisterRenderAsset:()=>{},renderAssets:[]}),xk=({children:e,collectAssets:t})=>{const[n,r]=c.useState([]),o=c.useRef([]),i=c.useCallback(l=>{j0(l),o.current=[...o.current,l],r(o.current)},[]);t&&c.useImperativeHandle(t,()=>({collectAssets:()=>{const l=o.current;return o.current=[],r([]),l}}),[]);const s=c.useCallback(l=>{o.current=o.current.filter(u=>u.id!==l),r(o.current)},[]);c.useLayoutEffect(()=>{typeof window<"u"&&(window.remotion_collectAssets=()=>{const l=o.current;return o.current=[],r([]),l})},[]);const a=c.useMemo(()=>({registerRenderAsset:i,unregisterRenderAsset:s,renderAssets:n}),[n,i,s]);return d.jsx(Zr.Provider,{value:a,children:e})},Cn=e=>typeof window>"u"||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("file://")||e.startsWith("blob:")||e.startsWith("data:")?e:new URL(e,window.origin).href,Vl=({trimAfter:e,mediaDurationInFrames:t,playbackRate:n,trimBefore:r})=>{let o=t;typeof e<"u"&&(o=e),typeof r<"u"&&(o-=r);const i=o/n;return Number(i.toFixed(10))},M0=c.createContext(null),bk=()=>J.useContext(M0),Bl=({durationInFrames:e,times:t=1/0,children:n,name:r,showInTimeline:o,...i})=>{const s=ct(),{durationInFrames:a}=Xe();if(Tl(e,{component:"of the <Loop /> component",allowFloats:!0}),typeof t!="number")throw new TypeError(`You passed to "times" an argument of type ${typeof t}, but it must be a number.`);if(t!==1/0&&t%1!==0)throw new TypeError(`The "times" prop of a loop must be an integer, but got ${t}.`);if(t<0)throw new TypeError(`The "times" prop of a loop must be at least 0, but got ${t}`);const l=Math.ceil(a/e),u=Math.min(l,t),f=i.layout==="none"?void 0:i.style,p=e*(u-1),h=Math.floor(s/e)*e,y=Math.min(h,p),g=c.useMemo(()=>({numberOfTimes:Math.min(a/e,t),startOffset:-y,durationInFrames:e}),[a,e,y,t]),S=c.useMemo(()=>({iteration:Math.floor(s/e),durationInFrames:e}),[s,e]);return d.jsx(M0.Provider,{value:S,children:d.jsx(dt,{durationInFrames:e,from:y,name:r??"<Loop>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/loop",_remotionInternalLoopDisplay:g,layout:i.layout,style:f,showInTimeline:o,children:n})})};Bl.useLoop=bk;var gt=({logLevel:e,tag:t,message:n,mountTime:r})=>{const o=[r?Date.now()-r+"ms ":null,t].filter(Boolean).join(" ");rt.trace({logLevel:e,tag:null},`[${o}]`,n)},Wl=c.createContext({}),Wm={},Du=[],$0=({children:e})=>{const[t,n]=c.useState(()=>Wm);return c.useEffect(()=>{const r=()=>{n(Wm)};return Du.push(r),()=>{Du=Du.filter(o=>o!==r)}},[]),d.jsx(Wl.Provider,{value:t,children:e})},A0=e=>{const t=e.indexOf("#");return t===-1?null:t},Sk=e=>{const t=A0(e);return t===null?e:e.slice(0,t)},Yr=e=>{const t=c.useContext(Wl),n=A0(e),r=Sk(e);return t[r]?n!==null?t[r]+e.slice(n):t[r]:e},Ul=(e,t)=>{if(typeof e.volume!="number"&&typeof e.volume!="function"&&typeof e.volume<"u")throw new TypeError(`You have passed a volume of type ${typeof e.volume} to your <${t} /> component. Volume must be a number or a function with the signature '(frame: number) => number' undefined.`);if(typeof e.volume=="number"&&e.volume<0)throw new TypeError(`You have passed a volume below 0 to your <${t} /> component. Volume must be between 0 and 1`);if(typeof e.playbackRate!="number"&&typeof e.playbackRate<"u")throw new TypeError(`You have passed a playbackRate of type ${typeof e.playbackRate} to your <${t} /> component. Playback rate must a real number or undefined.`);if(typeof e.playbackRate=="number"&&(isNaN(e.playbackRate)||!Number.isFinite(e.playbackRate)||e.playbackRate<=0))throw new TypeError(`You have passed a playbackRate of ${e.playbackRate} to your <${t} /> component. Playback rate must be a real number above 0.`);if(typeof e.preservePitch!="boolean"&&typeof e.preservePitch<"u")throw new TypeError(`'preservePitch' must be a boolean or undefined but got '${typeof e.preservePitch}' instead`)},Ek=(e,t)=>{if(typeof e<"u"){if(typeof e!="number")throw new TypeError(`type of startFrom prop must be a number, instead got type ${typeof e}.`);if(isNaN(e)||e===1/0)throw new TypeError("startFrom prop can not be NaN or Infinity.");if(e<0)throw new TypeError(`startFrom must be greater than equal to 0 instead got ${e}.`)}if(typeof t<"u"){if(typeof t!="number")throw new TypeError(`type of endAt prop must be a number, instead got type ${typeof t}.`);if(isNaN(t))throw new TypeError("endAt prop can not be NaN.");if(t<=0)throw new TypeError(`endAt must be a positive number, instead got ${t}.`)}if(t<e)throw new TypeError("endAt prop must be greater than startFrom prop.")},kk=(e,t)=>{if(typeof e<"u"){if(typeof e!="number")throw new TypeError(`type of trimBefore prop must be a number, instead got type ${typeof e}.`);if(isNaN(e)||e===1/0)throw new TypeError("trimBefore prop can not be NaN or Infinity.");if(e<0)throw new TypeError(`trimBefore must be greater than equal to 0 instead got ${e}.`)}if(typeof t<"u"){if(typeof t!="number")throw new TypeError(`type of trimAfter prop must be a number, instead got type ${typeof t}.`);if(isNaN(t))throw new TypeError("trimAfter prop can not be NaN.");if(t<=0)throw new TypeError(`trimAfter must be a positive number, instead got ${t}.`)}if(t<=e)throw new TypeError("trimAfter prop must be greater than trimBefore prop.")},Hl=({startFrom:e,endAt:t,trimBefore:n,trimAfter:r})=>{if(typeof e<"u"&&typeof n<"u")throw new TypeError("Cannot use both startFrom and trimBefore props. Use trimBefore instead as startFrom is deprecated.");if(typeof t<"u"&&typeof r<"u")throw new TypeError("Cannot use both endAt and trimAfter props. Use trimAfter instead as endAt is deprecated.");typeof n<"u"||typeof r<"u"?kk(n,r):(typeof e<"u"||typeof t<"u")&&Ek(e,t)},Zl=({startFrom:e,endAt:t,trimBefore:n,trimAfter:r})=>({trimBeforeValue:n??e??void 0,trimAfterValue:r??t??void 0}),Ck=(e,t)=>{switch(t.type){case"got-duration":{const n=Cn(t.src);return e[n]===t.durationInSeconds?e:{...e,[n]:t.durationInSeconds}}default:return e}},Mf=c.createContext({durations:{},setDurations:()=>{throw new Error("context missing")}}),N0=({children:e})=>{const[t,n]=c.useReducer(Ck,{}),r=c.useMemo(()=>({durations:t,setDurations:n}),[t]);return d.jsx(Mf.Provider,{value:r,children:e})},$f=({crossOrigin:e,requestsVideoFrame:t,isClientSideRendering:n})=>{if(e!=null)return e;if(n||t)return"anonymous"},tl=({mediaRef:e,mediaType:t,onAutoPlayError:n,logLevel:r,mountTime:o,reason:i,isPlayer:s})=>{const{current:a}=e;if(!a)return;gt({logLevel:r,tag:"play",message:`Attempting to play ${a.src}. Reason: ${i}`,mountTime:o});const l=a.play();l.catch&&l.catch(u=>{if(a&&!u.message.includes("request was interrupted by a call to pause")&&!u.message.includes("The operation was aborted.")&&!u.message.includes("The fetching process for the media resource was aborted by the user agent")&&!u.message.includes("request was interrupted by a new load request")&&!u.message.includes("because the media was removed from the document")&&!(u.message.includes("user didn't interact with the document")&&a.muted)&&(console.log(`Could not play ${t} due to following error: `,u),!a.muted)){if(n){n();return}t==="video"&&s&&(rt.info({logLevel:r,tag:"<"+t+">"},"The video will be muted and we'll retry playing it."),rt.info({logLevel:r,tag:"<"+t+">"},"Use onAutoPlayError() to handle this error yourself."),a.muted=!0,a.play())}})},Af=({audioContext:e,ref:t})=>{let n=null,r=!1,o=e;return{setAudioContext:i=>{o=i},attemptToConnect:()=>{if(r)throw new Error("SharedElementSourceNode has been disposed");!n&&t.current&&o&&(n=o.createMediaElementSource(t.current))},get:()=>{if(!n)throw new Error("Audio element not connected");return n},cleanup:()=>{n&&(n.disconnect(),n=null),r=!0}}},Um=!1,Ik=e=>{Um||(Um=!0,typeof window<"u"&&rt.warn({logLevel:e,tag:null},"AudioContext is not supported in this browser"))},Tk=({logLevel:e,latencyHint:t,audioEnabled:n,sampleRate:r})=>{const o=Ze(),i=c.useRef(r);if(r!==i.current)throw new Error(`Changing the AudioContext sample rate dynamically is not supported. The sample rate was initialized with ${i.current} Hz, but ${r} Hz was passed later.`);return c.useMemo(()=>{if(o.isRendering||!n)return null;if(typeof AudioContext>"u")return Ik(e),null;const a=new AudioContext({latencyHint:t,sampleRate:r}),l=a.createGain();l.connect(a.destination),rt.trace({logLevel:e,tag:"audio"},"Creating new audio context"),a.suspend();let u=null;return{audioContext:a,gainNode:l,getState:()=>{const h=a.state;return u==="running"&&h!=="running"?"suspended-to-running":u==="suspended"&&h!=="suspended"?"running-to-suspended":h},resume:()=>{u="running";const h=a.resume();return h.finally(()=>{u==="running"&&(u=null)}),h},suspend:()=>{u="suspended";const h=a.suspend();return h.finally(()=>{u==="suspended"&&(u=null)}),h}}},[e,t,o.isRendering,n,r])},Rk=(e,t)=>new Promise(n=>{const r=e.currentTime,i=e.getOutputTimestamp().performanceTime,s=performance.now(),a=()=>{var p;const{currentTime:l}=e,u=e.getOutputTimestamp(),f=performance.now()-s;if(i!==void 0&&u.performanceTime!==void 0&&u.performanceTime>i&&u.contextTime!==void 0&&u.contextTime>r){rt.verbose({logLevel:t,tag:"audio"},`waitUntilActuallyResumed: getOutputTimestamp.performanceTime advanced from ${i.toFixed(6)} to ${u.performanceTime.toFixed(6)} after ${f.toFixed(1)}ms. currentTime=${l.toFixed(6)} (advanced by ${(l-r).toFixed(6)}), getOutputTimestamp.performanceTime=${((p=u.performanceTime)==null?void 0:p.toFixed(1))??"undefined"}`),n();return}requestAnimationFrame(a)};requestAnimationFrame(a)}),Ou="data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",_k=(e,t)=>{const n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(n[o]!==r[o]||e[n[o]]!==t[r[o]])return!1;return!0},Pk=(e,t,n)=>e==="src"&&!n.startsWith("data:")&&!t.startsWith("data:")?new URL(n,window.origin).toString()!==new URL(t,window.origin).toString():n!==t,Xo=c.createContext(null),Yl=c.createContext(null),Fk=e=>{if(e==="suspended"||e==="running-to-suspended"||e==="interrupted")return!0;if(e==="running"||e==="suspended-to-running")return!1;throw new Error(`Unexpected audio context state: ${e}`)},L0=({children:e,audioLatencyHint:t,audioEnabled:n,previewSampleRate:r})=>{const o=In(),i=r??48e3;c.useEffect(()=>{typeof window>"u"||(window.remotion_sampleRate=i)},[i]);const s=Tk({logLevel:o,latencyHint:t,audioEnabled:n,sampleRate:i}),a=c.useRef(!1),l=c.useRef(null),u=c.useMemo(()=>({value:0}),[]),f=c.useRef([]),p=c.useMemo(()=>({dispatch:b=>{f.current.forEach(k=>k(b))},subscribe:b=>(f.current.push(b),{remove:()=>{f.current=f.current.filter(k=>k!==b)}})}),[]),m=c.useRef({scheduledEndTime:null,mediaEndTime:null}),h=c.useRef(new Map),y=c.useCallback(b=>{h.current.delete(b)},[]),g=c.useMemo(()=>({node:b,mediaTimestamp:k,sourceOffset:E,scheduledTime:I,duration:T,offset:_,originalUnloopedMediaTimestamp:$})=>{if(!s)throw new Error("Audio context not found");const j=s.getState();if(j==="closed")return{type:"not-started",reason:"audio context is closed"};const L=Fk(j);T>0&&(L?h.current.set(b,{scheduledTime:I,offset:_,duration:T}):b.start(I,_,T));const M=I+T/b.playbackRate.value,O=k+_-E,Z=O+T,D=s.audioContext.baseLatency+s.audioContext.outputLatency,R=I-s.audioContext.currentTime,C=m.current,F=C.scheduledEndTime!==null&&Math.abs(I-C.scheduledEndTime)>.001,P=C.mediaEndTime!==null&&Math.abs(O-C.mediaEndTime)>.001;return rt.verbose({logLevel:o,tag:"audio-scheduling"},"scheduled %c%s%c %s %c%s%c %s %c%s%c %s %s %s %s %s",F?"color: red; font-weight: bold":"",I.toFixed(4),"",M.toFixed(4),P?"color: red; font-weight: bold":"",O.toFixed(4),"",Z.toFixed(4),T<0||R<0?"color: red; font-weight: bold":"color: blue; font-weight: bold",T<0?"missed "+Math.abs(_).toFixed(2)+"s":Math.abs(R).toFixed(2)+(R<0?" delay":" ahead"),"","current="+s.audioContext.currentTime.toFixed(4),"offset="+_.toFixed(4),"latency="+D.toFixed(4),"state="+s.audioContext.state,$!==O?"original_ts="+$.toFixed(4):"","action="+(L?"schedule":"start"),""),C.scheduledEndTime=M,C.mediaEndTime=Z,T>0?{type:"started",scheduledTime:I}:{type:"not-started",reason:"missed "+Math.abs(_).toFixed(2)+"s"}},[s,o]),S=c.useCallback(()=>{if(!s||a.current)return Promise.resolve();a.current=!0,s.gainNode.gain.cancelScheduledValues(s.audioContext.currentTime),s.gainNode.gain.setValueAtTime(0,s.audioContext.currentTime),s.gainNode.gain.linearRampToValueAtTime(1,s.audioContext.currentTime+.03),h.current.forEach((k,E)=>{E.start(k.scheduledTime,k.offset,k.duration)}),h.current.clear();const b=s.resume();return l.current=new Promise(k=>{Rk(s.audioContext,o).then(k),b.catch(E=>{rt.warn({logLevel:o,tag:"audio"},"AudioContext resume rejected, continuing without audio sync",E),k()})}).finally(()=>{l.current=null}),b.catch(()=>{})},[s,o]),v=c.useCallback(()=>l.current,[]),w=c.useCallback(()=>!s||!a.current?Promise.resolve():(a.current=!1,s.suspend()),[s]),x=c.useMemo(()=>({audioContext:(s==null?void 0:s.audioContext)??null,getAudioContextState:()=>(s==null?void 0:s.getState())??null,gainNode:(s==null?void 0:s.gainNode)??null,audioSyncAnchor:u,audioSyncAnchorEmitter:p,scheduleAudioNode:g,resume:S,suspend:w,getIsResumingAudioContext:v,unscheduleAudioNode:y}),[s,u,p,g,S,w,v,y]);return d.jsx(Xo.Provider,{value:x,children:e})},z0=({children:e,numberOfAudioTags:t})=>{const n=c.useRef([]),[r]=c.useState(t);if(t!==r)throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");const o=In(),i=fs(),s=Ze(),a=c.useContext(Xo),l=(a==null?void 0:a.audioContext)??null,u=a==null?void 0:a.resume,[f]=c.useState(()=>new Array(t).fill(!0).map(()=>{const b=c.createRef();return{id:Math.random(),ref:b,mediaElementSourceNode:Af({audioContext:l,ref:b})}}));for(const{mediaElementSourceNode:b}of f)b==null||b.setAudioContext(l);(J.useInsertionEffect??J.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{f.forEach(({mediaElementSourceNode:b})=>{b==null||b.cleanup()})})},[f]);const m=c.useRef(new Array(t).fill(!1)),h=c.useCallback(()=>{f.forEach(({ref:b,id:k})=>{var T;const E=(T=n.current)==null?void 0:T.find(_=>_.id===k),{current:I}=b;if(I){if(E===void 0){I.src!==Ou&&(I.src=Ou);return}if(!E)throw new TypeError("Expected audio data to be there");Object.keys(E.props).forEach(_=>{Pk(_,E.props[_],I[_])&&(I[_]=E.props[_])})}})},[f]),y=c.useCallback(b=>{var D,R;const{aud:k,audioId:E,premounting:I,postmounting:T}=b,_=(D=n.current)==null?void 0:D.find(C=>C.audioId===E);if(_)return _;const $=m.current.findIndex(C=>C===!1);if($===-1)throw new Error(`Tried to simultaneously mount ${t+1} <Html5Audio /> tags at the same time. With the current settings, the maximum amount of <Html5Audio /> tags is limited to ${t} 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:j,ref:L,mediaElementSourceNode:M}=f[$],O=[...m.current];O[$]=j,m.current=O;const Z={props:k,id:j,el:L,audioId:E,mediaElementSourceNode:M,premounting:I,audioMounted:!!L.current,postmounting:T,cleanupOnMediaTagUnmount:()=>{}};return(R=n.current)==null||R.push(Z),h(),Z},[t,f,h]),g=c.useCallback(b=>{var I;const k=[...m.current],E=f.findIndex(T=>T.id===b);if(E===-1)throw new TypeError(`Unknown audio ref ${b}; refs: ${f.map(T=>T.id).join(", ")}`);k[E]=!1,m.current=k,n.current=(I=n.current)==null?void 0:I.filter(T=>T.id!==b),h()},[f,h]),S=c.useCallback(({aud:b,audioId:k,id:E,premounting:I,postmounting:T})=>{var $;let _=!1;n.current=($=n.current)==null?void 0:$.map(j=>{const L=!!j.el.current;return j.audioMounted!==L&&(_=!0),j.id===E?_k(b,j.props)&&j.premounting===I&&j.postmounting===T?j.audioMounted===L?j:{...j,audioMounted:L}:(_=!0,{...j,props:b,premounting:I,postmounting:T,audioId:k,audioMounted:L}):j.audioMounted===L?j:{...j,audioMounted:L}}),_&&h()},[h]),v=c.useCallback(()=>{f.forEach(b=>{const k=n.current.find(E=>E.el===b.ref);k!=null&&k.premounting||tl({mediaRef:b.ref,mediaType:"audio",onAutoPlayError:null,logLevel:o,mountTime:i,reason:"playing all audios",isPlayer:s.isPlayer})}),u==null||u()},[o,i,f,s.isPlayer,u]),w=c.useMemo(()=>({registerAudio:y,unregisterAudio:g,updateAudio:S,playAllAudios:v,numberOfAudioTags:t}),[t,v,y,g,S]),x=c.useMemo(()=>f.map(({id:b,ref:k})=>d.jsx("audio",{ref:k,preload:"metadata",src:Ou},b)),[f]);return d.jsxs(Yl.Provider,{value:w,children:[x,e]})},jk=({aud:e,audioId:t,premounting:n,postmounting:r})=>{var l;const o=c.useContext(Xo),i=c.useContext(Yl),[s]=c.useState(()=>{if(i&&i.numberOfAudioTags>0)return i.registerAudio({aud:e,audioId:t,premounting:n,postmounting:r});const u=J.createRef(),f=Af({audioContext:(o==null?void 0:o.audioContext)??null,ref:u});return{el:u,id:Math.random(),props:e,audioId:t,mediaElementSourceNode:f,premounting:n,audioMounted:!!u.current,postmounting:r,cleanupOnMediaTagUnmount:()=>{f==null||f.cleanup()}}});(l=s.mediaElementSourceNode)==null||l.setAudioContext((o==null?void 0:o.audioContext)??null);const a=J.useInsertionEffect??J.useLayoutEffect;return typeof document<"u"&&(a(()=>{i&&i.numberOfAudioTags>0&&i.updateAudio({id:s.id,aud:e,audioId:t,premounting:n,postmounting:r})},[e,i,s.id,t,n,r]),a(()=>()=>{i&&i.numberOfAudioTags>0&&i.unregisterAudio(s.id)},[i,s.id])),s},Mk=1e-5,nl=(e,t)=>Math.abs(e-t)<Mk,D0=(e,t)=>Math.round(e/t*100)/100,ld=()=>typeof window>"u"||!/AppleWebKit/.test(window.navigator.userAgent)?!1:!window.navigator.userAgent.includes("Chrome/"),Kl=()=>typeof window>"u"?!1:/iP(ad|od|hone)/i.test(window.navigator.userAgent)&&ld(),$k=e=>Kl()&&e.startsWith("blob:"),ud=({actualFrom:e,fps:t})=>D0(Math.max(0,-e),t),cd=({duration:e,fps:t})=>D0(e,t),Ak=({actualSrc:e,actualFrom:t,duration:n,fps:r})=>{if($k(e)||e.startsWith("data:")||!!new URL(e,(typeof window>"u"?null:window.location.href)??"http://localhost:3000").hash||!Number.isFinite(t))return e;const i=`${e}#t=${ud({actualFrom:t,fps:r})}`;return Number.isFinite(n)?`${i},${cd({duration:n,fps:r})}`:i},Nk=({prevStartFrom:e,newStartFrom:t,prevDuration:n,newDuration:r,fps:o})=>{const i=ud({actualFrom:e,fps:o}),s=ud({actualFrom:t,fps:o}),a=cd({duration:n,fps:o}),l=cd({duration:r,fps:o});return!(s<i||l>a)},Lk=({actualSrc:e,actualFrom:t,duration:n,fps:r})=>{const o=c.useRef(t),i=c.useRef(n),s=c.useRef(e);return(!Nk({prevStartFrom:o.current,newStartFrom:t,prevDuration:i.current,newDuration:n,fps:r})||e!==s.current)&&(o.current=t,i.current=n,s.current=e),Ak({actualSrc:s.current,actualFrom:o.current,duration:i.current,fps:r})},Hm=!1,zk=e=>{Hm||(Hm=!0,rt.warn({logLevel:e,tag:null},"In Safari, setting a volume and a playback rate at the same time is buggy."),rt.warn({logLevel:e,tag:null},"In Desktop Safari, only volumes <= 1 will be applied."),rt.warn({logLevel:e,tag:null},e,"In Mobile Safari, the volume will be ignored and set to 1 if a playbackRate is set."))},O0=({mediaRef:e,volume:t,logLevel:n,source:r,shouldUseWebAudioApi:o})=>{var m,h,y;const i=c.useRef(null),s=c.useRef(t);s.current=t;const a=c.useContext(Xo);if(!a)throw new Error("useAmplification must be used within a SharedAudioContext");const{audioContext:l,gainNode:u}=a;if(typeof window<"u"&&c.useLayoutEffect(()=>{var S,v;if(!l||!e.current||!o)return;if(e.current.playbackRate!==1&&ld()){zk(n);return}if(!r||!u)return;const g=new GainNode(l,{gain:s.current});return r.attemptToConnect(),r.get().connect(g),g.connect(u),i.current={gainNode:g},rt.trace({logLevel:n,tag:null},`Starting to amplify ${(S=e.current)==null?void 0:S.src}. Gain = ${s.current}, playbackRate = ${(v=e.current)==null?void 0:v.playbackRate}`),()=>{i.current=null,g.disconnect(),r.get().disconnect()}},[n,e,l,r,o,u]),i.current){const g=t;nl(i.current.gainNode.gain.value,g)||(i.current.gainNode.gain.value=g,rt.trace({logLevel:n,tag:null},`Setting gain to ${g} for ${(m=e.current)==null?void 0:m.src}`))}return(ld()&&e.current&&((h=e.current)==null?void 0:h.playbackRate)!==1||!o)&&e.current&&!nl(t,(y=e.current)==null?void 0:y.volume)&&(e.current.volume=Math.min(t,1)),i},zr=()=>{const e=c.useContext(et);return(e==null?void 0:e.cumulatedNegativeFrom)??0},Go=e=>{const t=Bl.useLoop(),n=ct(),r=zr();return e==="repeat"||t===null?n+r:n+r+t.durationInFrames*t.iteration},V0=e=>{if(/data:|blob:/.test(e.substring(0,5)))return"Data URL";const t=e.split("/").map(n=>n.split("\\")).flat(1);return t[t.length-1]},Dk=({compositionDurationInFrames:e,playbackRate:t,trimBefore:n,trimAfter:r,parentSequenceDurationInFrames:o,loop:i})=>{if(i)return e;const s=Vl({mediaDurationInFrames:e*t+(n??0),playbackRate:t,trimBefore:n,trimAfter:r});if(o!==null){const a=Math.min(o,s);return Number(a.toFixed(10))}return s},Kr=({frame:e,volume:t,mediaVolume:n=1})=>{if(typeof t=="number")return t*n;if(typeof t>"u")return Number(n);const r=t(e)*n;if(typeof r!="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 r} for frame ${e}`);if(Number.isNaN(r))throw new TypeError(`You passed in a function to the volume prop but it returned NaN for frame ${e}.`);if(!Number.isFinite(r))throw new TypeError(`You passed in a function to the volume prop but it returned a non-finite number for frame ${e}.`);return Math.max(0,r)},Zm={},Ok=e=>{Zm[e]||(console.warn(e),Zm[e]=!0)},B0=({volume:e,mediaVolume:t,mediaType:n,src:r,displayName:o,trimBefore:i,trimAfter:s,playbackRate:a,sequenceDurationInFrames:l,mediaStartsAt:u,loop:f})=>{if(!r)throw new Error("No src passed");const p=c.useContext(et),[m]=c.useState(()=>e),h=Dk({compositionDurationInFrames:l,playbackRate:a,trimBefore:i,trimAfter:s,parentSequenceDurationInFrames:(p==null?void 0:p.durationInFrames)??null,loop:f}),y=c.useMemo(()=>typeof e=="number"?e:new Array(Math.floor(Math.max(0,h+u))).fill(!0).map((b,k)=>Kr({frame:k+u,volume:e,mediaVolume:t})).join(","),[h,u,e,t]);c.useEffect(()=>{typeof e=="number"&&e!==m&&Ok(`Remotion: The ${n} with src ${r} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/audio/volume`)},[m,n,r,e]);const g=typeof e=="function",S=Il(),{rootId:v}=wr(),w=0-u+(i??0);return c.useMemo(()=>({volumes:y,duration:h,doesVolumeChange:g,nonce:S,rootId:v,finalDisplayName:o??V0(r),startMediaFrom:w,src:r,playbackRate:a}),[y,h,g,S,v,o,r,w,a])},Nf=({volume:e,mediaVolume:t,src:n,mediaType:r,playbackRate:o,displayName:i,id:s,getStack:a,showInTimeline:l,premountDisplay:u,postmountDisplay:f,loopDisplay:p,documentationLink:m,refForOutline:h})=>{const y=c.useContext(et),g=zr(),{registerSequence:S,unregisterSequence:v}=c.useContext(Yo),{durationInFrames:w}=Xe(),x=zr(),{volumes:b,duration:k,doesVolumeChange:E,nonce:I,rootId:T,finalDisplayName:_}=B0({volume:e,mediaVolume:t,mediaType:r,src:n,displayName:i,trimAfter:void 0,trimBefore:void 0,playbackRate:o,sequenceDurationInFrames:w,mediaStartsAt:x,loop:!1}),{isStudio:$}=Ze();c.useEffect(()=>{var j,L;if(!n)throw new Error("No src passed");if(!(!$&&((L=(j=window.process)==null?void 0:j.env)==null?void 0:L.NODE_ENV)!=="test")&&l)return S({type:r,src:n,id:s,duration:k,from:0,trimBefore:null,parent:(y==null?void 0:y.id)??null,displayName:_,documentationLink:m,rootId:T,volume:b,showInTimeline:!0,nonce:I.get(),startMediaFrom:0-g,mediaFrameAtSequenceZero:null,doesVolumeChange:E,loopDisplay:p,playbackRate:o,getStack:a,premountDisplay:u,postmountDisplay:f,controls:null,effects:[],refForOutline:h,isInsideSeries:!1,frozenFrame:null,frozenMediaFrame:null}),()=>{v(s)}},[k,s,y,n,S,v,b,E,I,r,g,o,a,l,u,f,p,m,T,_,$,h])},Vk=(e,t)=>{const[n,r]=c.useState([]),[o,i]=c.useState([]),[s,a]=c.useState([]),u=Ze().isRendering,f=c.useRef(!1),p=c.useCallback(y=>{if(u)return{unblock:()=>{}};let g=!1;return r(S=>[...S,y]),{unblock:()=>{g||(g=!0,r(S=>{const v=S.filter(w=>w!==y);return v.length===S.length?S:v}))}}},[u]),m=c.useCallback(y=>(i(g=>[...g,y]),{remove:()=>{i(g=>g.filter(S=>S!==y))}}),[]),h=c.useCallback(y=>(a(g=>[...g,y]),{remove:()=>{a(g=>g.filter(S=>S!==y))}}),[]);return c.useEffect(()=>{u||n.length>0&&!f.current&&(f.current=!0,o.forEach(y=>y()),gt({logLevel:e,message:"Player is entering buffer state",mountTime:t,tag:"player"}))},[n]),typeof window<"u"&&c.useLayoutEffect(()=>{u||n.length===0&&f.current&&(f.current=!1,s.forEach(y=>y()),gt({logLevel:e,message:"Player is exiting buffer state",mountTime:t,tag:"player"}))},[n]),c.useMemo(()=>({addBlock:p,listenForBuffering:m,listenForResume:h,buffering:f}),[p,f,m,h])},qo=J.createContext(null),W0=({children:e})=>{const{logLevel:t,mountTime:n}=c.useContext(Ur),r=Vk(t??"info",n);return d.jsx(qo.Provider,{value:r,children:e})},U0=e=>{const[t,n]=c.useState(e.buffering.current);return c.useEffect(()=>{const r=()=>{n(!0)},o=()=>{n(!1)},i=e.listenForBuffering(r),s=e.listenForResume(o);return()=>{i.remove(),s.remove()}},[e]),t},Xl=()=>{const e=c.useContext(qo),t=In(),n=e?e.addBlock:null;return c.useMemo(()=>({delayPlayback:()=>{if(!n)throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a <Composition>. Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");rt.trace({logLevel:t,tag:"[buffer-state]"},"Adding buffer handle",new Error().stack);const{unblock:r}=n({id:String(Math.random())});let o=!1;return{unblock:()=>{o||(o=!0,rt.trace({logLevel:t,tag:"[buffer-state]"},"Removing buffer handle"),r())}}}}),[n,t])},Bk=()=>/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent),Wk=({mediaRef:e,mediaType:t,onVariableFpsVideoDetected:n,pauseWhenBuffering:r,logLevel:o,mountTime:i})=>{const s=c.useRef(!1),{delayPlayback:a}=Xl(),l=c.useCallback(u=>{var y;if(t!=="video"||!r)return;const f=e.current;if(!f)return;if(f.readyState>=f.HAVE_FUTURE_DATA&&!Bk()){gt({logLevel:o,message:`Not using buffer until first frame, because readyState is ${f.readyState} and is not Safari or Desktop Chrome`,mountTime:i,tag:"buffer"});return}if(!f.requestVideoFrameCallback){gt({logLevel:o,message:"Not using buffer until first frame, because requestVideoFrameCallback is not supported",mountTime:i,tag:"buffer"});return}s.current=!0,gt({logLevel:o,message:`Buffering ${(y=e.current)==null?void 0:y.src} until the first frame is received`,mountTime:i,tag:"buffer"});const p=a(),m=()=>{p.unblock(),f.removeEventListener("ended",m,{once:!0}),f.removeEventListener("pause",m,{once:!0}),s.current=!1},h=()=>{m()};f.requestVideoFrameCallback((g,S)=>{Math.abs(S.mediaTime-u)>.5&&n(),m()}),f.addEventListener("ended",h,{once:!0}),f.addEventListener("pause",h,{once:!0}),f.addEventListener("canplay",h,{once:!0})},[a,o,e,t,i,n,r]);return c.useMemo(()=>({isBuffering:()=>s.current,bufferUntilFirstFrame:l}),[l])},Uk=e=>{const{duration:t,currentTime:n,paused:r,ended:o,desiredUnclampedTime:i,mediaTagTime:s,mediaTagLastUpdate:a,rvcTime:l,rvcLastUpdate:u,isVariableFpsVideo:f,acceptableTimeShift:p,lastSeekDueToShift:m,playing:h,playbackRate:y,mediaTagBufferingOrStalled:g,playerBuffering:S,absoluteFrame:v,onlyWarnForMediaSeekingError:w,isPremounting:x,isPostmounting:b,pauseWhenBuffering:k}=e,E=!Number.isNaN(t)&&Number.isFinite(t)?Math.min(t,i):i,I=Math.abs(E-s),T=l?Math.abs(E-l):null,_=u&&l>a?T:I,$=T&&!f?_:I;if($>p&&m!==E)return{type:"seek-due-to-shift",shouldBeTime:E,why:`because time shift is too big. shouldBeTime = ${E}, isTime = ${s}, requestVideoCallbackTime = ${l}, timeShift = ${$}${f?", isVariableFpsVideo = true":""}, isPremounting = ${x}, isPostmounting = ${b}, pauseWhenBuffering = ${k}`,bufferUntilFirstFrame:h&&y>0,playReason:h&&r?"player is playing but media tag is paused, and just seeked":null,warnAboutNonSeekable:!w};const j=h?.15:.01,L=Math.abs(n-E)>j;if(!h||S&&!g)return{type:"seek-if-not-playing",shouldBeTime:E,why:L?`not playing or something else is buffering. time offset is over seek threshold (${j})`:null};if(!h||S)return{type:"none"};const O=r&&!o;if(O||v===0){const D=O?"media tag is paused":"absolute frame is 0";return{type:"play-and-seek",shouldBeTime:E,why:L?`is over timeshift threshold (threshold = ${j}) and ${D}`:null,playReason:`player is playing and ${D}`,bufferUntilFirstFrame:!f&&y>0}}return{type:"none"}},Hk=e=>{var r,o;const t=J.useRef({time:((r=e.current)==null?void 0:r.currentTime)??0,lastUpdate:performance.now()}),n=((o=e.current)==null?void 0:o.currentTime)??null;return n!==null&&t.current.time!==n&&(t.current.time=n,t.current.lastUpdate=performance.now()),t},ka=({mediaRef:e,time:t,logLevel:n,why:r,mountTime:o})=>{const i=Kl()?Number(t.toFixed(1)):t;return gt({logLevel:n,tag:"seek",message:`Seeking from ${e.currentTime} to ${i}. src= ${e.src} Reason: ${r}`,mountTime:o}),e.currentTime=i,i},Zk=({element:e,shouldBuffer:t,isPremounting:n,isPostmounting:r,logLevel:o,mountTime:i,src:s})=>{const a=Xl(),[l,u]=c.useState(!1);return c.useEffect(()=>{let f=[];const{current:p}=e;if(!p||!t)return;if(n||r){if((n||r)&&p.readyState<p.HAVE_FUTURE_DATA&&!navigator.userAgent.includes("Firefox/")){gt({logLevel:o,message:`Calling .load() on ${p.src} because readyState is ${p.readyState} and it is not Firefox. Element is premounted ${p.playbackRate}`,tag:"load",mountTime:i});const g=p.playbackRate;p.load(),p.playbackRate=g}return}const m=g=>{let S=!1;f.forEach(v=>{v(g),S=!0}),f=[],u(v=>(v&&(S=!0),!1)),S&>({logLevel:o,message:`Unmarking as buffering: ${p.src}. Reason: ${g}`,tag:"buffer",mountTime:i})},h=g=>{u(!0),gt({logLevel:o,message:`Marking as buffering: ${p.src}. Reason: ${g}`,tag:"buffer",mountTime:i});const{unblock:S}=a.delayPlayback(),v=()=>{m('"canplay" was fired'),y()},w=()=>{m('"error" event was occurred'),y()};p.addEventListener("canplay",v,{once:!0}),f.push(()=>{p.removeEventListener("canplay",v)}),p.addEventListener("error",w,{once:!0}),f.push(()=>{p.removeEventListener("error",w)}),f.push(x=>{gt({logLevel:o,message:`Unblocking ${p.src} from buffer. Reason: ${x}`,tag:"buffer",mountTime:i}),S()})},y=()=>{if(p.readyState<p.HAVE_FUTURE_DATA){if(h(`readyState is ${p.readyState}, which is less than HAVE_FUTURE_DATA`),!navigator.userAgent.includes("Firefox/")){gt({logLevel:o,message:`Calling .load() on ${s} because readyState is ${p.readyState} and it is not Firefox. ${p.playbackRate}`,tag:"load",mountTime:i});const g=p.playbackRate;p.load(),p.playbackRate=g}}else{const g=()=>{h('"waiting" event was fired')};p.addEventListener("waiting",g),f.push(()=>{p.removeEventListener("waiting",g)})}};return y(),()=>{m("element was unmounted or prop changed")}},[a,s,e,n,r,o,t,i]),l},Yk=({mediaRef:e,mediaType:t,lastSeek:n,onVariableFpsVideoDetected:r})=>{const o=c.useRef(null);return c.useEffect(()=>{const{current:i}=e;if(i)o.current={time:i.currentTime,lastUpdate:performance.now()};else{o.current=null;return}if(t!=="video"){o.current=null;return}const s=i;if(!s.requestVideoFrameCallback)return;let a=()=>{};const l=()=>{if(!s)return;const u=s.requestVideoFrameCallback((f,p)=>{if(o.current!==null){const m=Math.abs(o.current.time-p.mediaTime),h=Math.abs(n.current===null?1/0:p.mediaTime-n.current);m>.5&&h>.5&&p.mediaTime>o.current.time&&r()}o.current={time:p.mediaTime,lastUpdate:performance.now()},l()});a=()=>{s.cancelVideoFrameCallback(u),a=()=>{}}};return l(),()=>{a()}},[n,e,t,r]),o},H0=({frame:e,playbackRate:t,startFrom:n})=>Ko(e,[-1,n,n+1],[-1,n,n+t]),Z0=({fps:e,frame:t,playbackRate:n,startFrom:r})=>{const o=H0({frame:t,playbackRate:n,startFrom:r}),i=1e3/e;return o*i/1e3},Ym={},Kk=(e,t)=>{if(e===null||e.seekable.length===0||e.seekable.length>1||Ym[e.src])return;const n={start:e.seekable.start(0),end:e.seekable.end(0)};if(n.start===0&&n.end===0){const r=[`The media ${e.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(`
|
|
57
|
+
`);console.error(r),Ym[e.src]=!0}},Y0=({mediaRef:e,src:t,mediaType:n,playbackRate:r,preservePitch:o=!0,onlyWarnForMediaSeekingError:i,acceptableTimeshift:s,pauseWhenBuffering:a,isPremounting:l,isPostmounting:u,onAutoPlayError:f})=>{const{playbackRate:p}=kf(),m=ct(),h=xr(),[y]=Ky(),g=c.useContext(qo),{fps:S}=Xe(),v=zr(),w=c.useRef(null),x=c.useRef(null),b=In(),k=fs();if(!g)throw new Error("useMediaPlayback must be used inside a <BufferingContext>");const E=c.useRef({}),I=c.useCallback(()=>{t&&(E.current[t]||(rt.verbose({logLevel:b,tag:null},`Detected ${t} as a variable FPS video. Disabling buffering while seeking.`),E.current[t]=!0))},[b,t]),T=Yk({mediaRef:e,mediaType:n,lastSeek:x,onVariableFpsVideoDetected:I}),_=Hk(e),$=Z0({frame:m,playbackRate:r,startFrom:-v,fps:S}),j=Zk({element:e,shouldBuffer:a,isPremounting:l,isPostmounting:u,logLevel:b,mountTime:k,src:t??null}),{bufferUntilFirstFrame:L,isBuffering:M}=Wk({mediaRef:e,mediaType:n,onVariableFpsVideoDetected:I,pauseWhenBuffering:a,logLevel:b,mountTime:k}),O=r*p,Z=(()=>{var V;return(V=e.current)!=null&&V.duration?Math.min(e.current.duration,s??.65):s??.65})(),D=U0(g);c.useEffect(()=>{var P,V,W,N,A;if((P=e.current)!=null&&P.paused)return;if(!y){gt({logLevel:b,tag:"pause",message:`Pausing ${(V=e.current)==null?void 0:V.src} because ${l?"media is premounting":u?"media is postmounting":"Player is not playing"}`,mountTime:k}),(W=e.current)==null||W.pause();return}const C=j||M();g.buffering.current&&!C&&(gt({logLevel:b,tag:"pause",message:`Pausing ${(N=e.current)==null?void 0:N.src} because player is buffering but media tag is not`,mountTime:k}),(A=e.current)==null||A.pause())},[M,j,g,D,l,b,e,n,k,y,u]);const R=Ze();c.useLayoutEffect(()=>{const C=Math.max(0,O);e.current&&e.current.playbackRate!==C&&(e.current.playbackRate=C),e.current&&e.current.preservesPitch!==o&&(e.current.preservesPitch=o)},[e,O,o]),c.useEffect(()=>{var V,W;const C=n==="audio"?"<Html5Audio>":"<Html5Video>";if(!e.current)throw new Error(`No ${n} ref found`);if(!t)throw new Error(`No 'src' attribute was passed to the ${C} element.`);const{current:F}=e,P=Uk({duration:F.duration,currentTime:F.currentTime,paused:F.paused,ended:F.ended,desiredUnclampedTime:$,mediaTagTime:_.current.time,mediaTagLastUpdate:_.current.lastUpdate,rvcTime:((V=T.current)==null?void 0:V.time)??null,rvcLastUpdate:((W=T.current)==null?void 0:W.lastUpdate)??null,isVariableFpsVideo:!!E.current[t],acceptableTimeShift:Z,lastSeekDueToShift:w.current,playing:y,playbackRate:O,mediaTagBufferingOrStalled:j||M(),playerBuffering:g.buffering.current,absoluteFrame:h,onlyWarnForMediaSeekingError:i,isPremounting:l,isPostmounting:u,pauseWhenBuffering:a});if(P.type!=="none"){if(P.type==="seek-due-to-shift"){x.current=ka({mediaRef:F,time:P.shouldBeTime,logLevel:b,why:P.why,mountTime:k}),w.current=x.current,P.bufferUntilFirstFrame&&L(P.shouldBeTime),P.playReason!==null&&tl({mediaRef:e,mediaType:n,onAutoPlayError:f,logLevel:b,mountTime:k,reason:P.playReason,isPlayer:R.isPlayer}),P.warnAboutNonSeekable&&Kk(F);return}if(P.type==="seek-if-not-playing"){P.why!==null&&(x.current=ka({mediaRef:F,time:P.shouldBeTime,logLevel:b,why:P.why,mountTime:k}));return}P.why!==null&&(x.current=ka({mediaRef:F,time:P.shouldBeTime,logLevel:b,why:P.why,mountTime:k})),tl({mediaRef:e,mediaType:n,onAutoPlayError:f,logLevel:b,mountTime:k,reason:P.playReason,isPlayer:R.isPlayer}),P.bufferUntilFirstFrame&&L(P.shouldBeTime)}},[h,Z,L,g.buffering,T,b,$,M,j,e,n,i,O,y,t,f,l,u,a,k,_,R.isPlayer])},K0=({mediaRef:e,id:t,mediaType:n,onAutoPlayError:r,isPremounting:o,isPostmounting:i})=>{const{audioAndVideoTags:s,imperativePlaying:a}=wr(),l=In(),u=fs(),f=Ze();c.useEffect(()=>{const p={id:t,play:m=>{if(a.current&&!(o||i))return tl({mediaRef:e,mediaType:n,onAutoPlayError:r,logLevel:l,mountTime:u,reason:m,isPlayer:f.isPlayer})}};return s.current.push(p),()=>{s.current=s.current.filter(m=>m.id!==t)}},[s,t,e,n,r,a,o,i,l,u,f.isPlayer])},Lf=c.createContext({playerMuted:!1,mediaVolume:1}),zf=c.createContext({setPlayerMuted:()=>{throw new Error("default")},setMediaVolume:()=>{throw new Error("default")}}),Df=()=>{const{mediaVolume:e}=c.useContext(Lf),{setMediaVolume:t}=c.useContext(zf);return c.useMemo(()=>[e,t],[e,t])},Of=()=>{const{playerMuted:e}=c.useContext(Lf),{setPlayerMuted:t}=c.useContext(zf);return c.useMemo(()=>[e,t],[e,t])},Qo=e=>{if(e>=100)throw new Error(`Volume was set to ${e}, 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.`)},Xk=(e,t)=>{const[n]=c.useState(e.shouldPreMountAudioTags);if(e.shouldPreMountAudioTags!==n)throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");const r=In(),{volume:o,muted:i,playbackRate:s,preservePitch:a,shouldPreMountAudioTags:l,src:u,onDuration:f,acceptableTimeShiftInSeconds:p,_remotionInternalNeedsDurationCalculation:m,_remotionInternalNativeLoopPassed:h,_remotionInternalStack:y,allowAmplificationDuringRender:g,name:S,pauseWhenBuffering:v,showInTimeline:w,loopVolumeCurveBehavior:x,stack:b,crossOrigin:k,delayRenderRetries:E,delayRenderTimeoutInMilliseconds:I,toneFrequency:T,useWebAudioApi:_,onError:$,onNativeError:j,audioStreamIndex:L,...M}=e,[O]=Df(),[Z]=Of(),D=Go(x??"repeat");if(!u)throw new TypeError("No 'src' was passed to <Html5Audio>.");const R=Yr(u),C=c.useContext(et),[F]=c.useState(()=>String(Math.random())),P=Kr({frame:D,volume:o,mediaVolume:O});Qo(P);const V=$f({crossOrigin:k,requestsVideoFrame:!1,isClientSideRendering:!1}),W=c.useMemo(()=>({muted:i||Z||P<=0,src:R,loop:h,crossOrigin:V,...M}),[h,Z,i,M,R,P,V]),N=c.useMemo(()=>`audio-${Hr(u??"")}-${C==null?void 0:C.relativeFrom}-${C==null?void 0:C.cumulatedFrom}-${C==null?void 0:C.durationInFrames}-muted:${e.muted}-loop:${e.loop}`,[u,C==null?void 0:C.relativeFrom,C==null?void 0:C.cumulatedFrom,C==null?void 0:C.durationInFrames,e.muted,e.loop]),{el:A,mediaElementSourceNode:B,cleanupOnMediaTagUnmount:H}=jk({aud:W,audioId:N,premounting:!!(C!=null&&C.premounting),postmounting:!!(C!=null&&C.postmounting)}),z=c.useCallback(()=>y??null,[y]);Nf({volume:o,mediaVolume:O,src:u,mediaType:"audio",playbackRate:s??1,displayName:S??null,id:F,getStack:z,showInTimeline:w,premountDisplay:(C==null?void 0:C.premountDisplay)??null,postmountDisplay:(C==null?void 0:C.postmountDisplay)??null,loopDisplay:void 0,documentationLink:"https://www.remotion.dev/docs/html5-audio",refForOutline:null}),Y0({mediaRef:A,src:u,mediaType:"audio",playbackRate:s??1,preservePitch:a,onlyWarnForMediaSeekingError:!1,acceptableTimeshift:p??null,isPremounting:!!(C!=null&&C.premounting),isPostmounting:!!(C!=null&&C.postmounting),pauseWhenBuffering:v,onAutoPlayError:null}),K0({id:F,isPostmounting:!!(C!=null&&C.postmounting),isPremounting:!!(C!=null&&C.premounting),mediaRef:A,mediaType:"audio",onAutoPlayError:null}),O0({logLevel:r,mediaRef:A,source:B,volume:P,shouldUseWebAudioApi:_??!1}),(J.useInsertionEffect??J.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{H()})},[H]),c.useImperativeHandle(t,()=>A.current,[A]);const oe=c.useRef(f);return oe.current=f,c.useEffect(()=>{var se;const{current:ae}=A;if(!ae)return;if(ae.duration){(se=oe.current)==null||se.call(oe,ae.src,ae.duration);return}const ce=()=>{var G;(G=oe.current)==null||G.call(oe,ae.src,ae.duration)};return ae.addEventListener("loadedmetadata",ce),()=>{ae.removeEventListener("loadedmetadata",ce)}},[A,u]),n?null:d.jsx("audio",{ref:A,preload:"metadata",crossOrigin:V,...W})},X0=c.forwardRef(Xk),Gk=(e,t)=>{const n=c.useRef(null),{volume:r,playbackRate:o,allowAmplificationDuringRender:i,onDuration:s,toneFrequency:a,_remotionInternalNeedsDurationCalculation:l,_remotionInternalNativeLoopPassed:u,acceptableTimeShiftInSeconds:f,name:p,onNativeError:m,delayRenderRetries:h,delayRenderTimeoutInMilliseconds:y,loopVolumeCurveBehavior:g,pauseWhenBuffering:S,audioStreamIndex:v,preservePitch:w,...x}=e,b=xr(),k=Go(g??"repeat"),E=ct(),I=c.useContext(et),{registerRenderAsset:T,unregisterRenderAsset:_}=c.useContext(Zr),{delayRender:$,continueRender:j}=mn(),L=c.useMemo(()=>`audio-${Hr(e.src??"")}-${I==null?void 0:I.relativeFrom}-${I==null?void 0:I.cumulatedFrom}-${I==null?void 0:I.durationInFrames}`,[e.src,I==null?void 0:I.relativeFrom,I==null?void 0:I.cumulatedFrom,I==null?void 0:I.durationInFrames]),M=Kr({volume:r,frame:k,mediaVolume:1});Qo(M),c.useImperativeHandle(t,()=>n.current,[]),c.useEffect(()=>{if(!e.src)throw new Error("No src passed");if(window.remotion_audioEnabled&&!e.muted&&!(M<=0))return T({type:"audio",src:Cn(e.src),id:L,frame:b,volume:M,mediaFrame:E,playbackRate:e.playbackRate??1,toneFrequency:a??1,audioStartFrame:Math.max(0,-((I==null?void 0:I.cumulatedNegativeFrom)??0)),audioStreamIndex:v??0}),()=>_(L)},[e.muted,e.src,T,b,L,_,M,k,E,o,e.playbackRate,a,I==null?void 0:I.cumulatedNegativeFrom,v]);const{src:O}=e,Z=t||l;return c.useLayoutEffect(()=>{var F,P;if(((P=(F=window.process)==null?void 0:F.env)==null?void 0:P.NODE_ENV)==="test"||!Z)return;const D=$("Loading <Html5Audio> duration with src="+O,{retries:h??void 0,timeoutInMilliseconds:y??void 0}),{current:R}=n,C=()=>{R!=null&&R.duration&&s(R.src,R.duration),j(D)};return R!=null&&R.duration?(s(R.src,R.duration),j(D)):R==null||R.addEventListener("loadedmetadata",C,{once:!0}),()=>{R==null||R.removeEventListener("loadedmetadata",C),j(D)}},[O,s,Z,h,y,j,$]),Z?d.jsx("audio",{ref:n,...x,onError:m}):null},qk=c.forwardRef(Gk),Qk=(e,t)=>{const n=c.useContext(Yl),r=e,{startFrom:o,endAt:i,trimBefore:s,trimAfter:a,name:l,stack:u,pauseWhenBuffering:f,showInTimeline:p,onError:m,freeze:h,...y}=r,{loop:g,freeze:S,...v}=r,{fps:w}=Xe(),x=Ze(),b=ms(f);if(x.isClientSideRendering)throw new Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");if(typeof h<"u")throw new TypeError('The "freeze" prop is not supported on <Html5Audio />. Use <Sequence freeze={...}> to freeze media playback.');const{durations:k,setDurations:E}=c.useContext(Mf);if(typeof e.src!="string")throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);const I=Yr(e.src),T=c.useCallback(M=>{console.log(M.currentTarget.error);const O=`Could not play audio with src ${I}: ${M.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;if(g){if(m){m(new Error(O));return}es(new Error(O))}else m==null||m(new Error(O)),console.warn(O)},[g,m,I]),_=c.useCallback((M,O)=>{E({type:"got-duration",durationInSeconds:O,src:M})},[E]),$=k[Cn(I)]??k[Cn(e.src)];Hl({startFrom:o,endAt:i,trimBefore:s,trimAfter:a});const{trimBeforeValue:j,trimAfterValue:L}=Zl({startFrom:o,endAt:i,trimBefore:s,trimAfter:a});if(g&&$!==void 0){if(!Number.isFinite($))return d.jsx(Ca,{...v,ref:t,_remotionInternalNativeLoopPassed:!0});const M=$*w;return d.jsx(Bl,{layout:"none",durationInFrames:Vl({trimAfter:L,mediaDurationInFrames:M,playbackRate:e.playbackRate??1,trimBefore:j}),children:d.jsx(Ca,{...v,ref:t,_remotionInternalNativeLoopPassed:!0})})}return typeof j<"u"||typeof L<"u"?d.jsx(dt,{layout:"none",from:0-(j??0),showInTimeline:!1,durationInFrames:L,name:l,children:d.jsx(Ca,{_remotionInternalNeedsDurationCalculation:!!g,pauseWhenBuffering:b,...y,ref:t})}):(Ul({playbackRate:e.playbackRate,preservePitch:e.preservePitch,volume:e.volume},"Html5Audio"),x.isRendering?d.jsx(qk,{onDuration:_,...e,ref:t,onNativeError:T,_remotionInternalNeedsDurationCalculation:!!g}):d.jsx(X0,{_remotionInternalNativeLoopPassed:e._remotionInternalNativeLoopPassed??!1,_remotionInternalStack:u??null,shouldPreMountAudioTags:n!==null&&n.numberOfAudioTags>0,...e,ref:t,onNativeError:T,onDuration:_,pauseWhenBuffering:b,_remotionInternalNeedsDurationCalculation:!!g,showInTimeline:p??!0}))},Ca=c.forwardRef(Qk);St(Ca);var Jk=e=>{if(e===void 0)return 1;if(typeof e!="number"||!Number.isFinite(e)||e<=0)throw new Error(`<Solid>: \`pixelDensity\` must be a positive finite number. Received: ${String(e)}.`);return e},eC={...Bn,color:{type:"color",default:"transparent",description:"Color"},width:{type:"number",min:1,step:1,default:1920,description:"Width",hiddenFromList:!1},height:{type:"number",min:1,step:1,default:1080,description:"Height",hiddenFromList:!1},pixelDensity:{type:"number",min:1,max:3,step:.1,default:1,description:"Pixel density",hiddenFromList:!1},...Tn,...Sr,...br},tC=({color:e,width:t,height:n,effects:r=[],className:o,style:i,pixelDensity:s,overrideId:a,reference:l})=>{const{delayRender:u,continueRender:f,cancelRender:p}=mn(),m=Jk(s),h=Math.ceil(t*m),y=Math.ceil(n*m),[g,S]=c.useState(null),v=ys({effects:r,overrideId:a??null}),w=c.useMemo(()=>{if(typeof document>"u")return null;const E=document.createElement("canvas");return E.width=1,E.height=1,E},[]),x=xs(),b=c.useCallback(E=>{S(E),typeof l=="function"?l(E):l&&(l.current=E)},[l]);c.useEffect(()=>{if(!g||!w)return;const E=u("Solid effect chain");if(!x)return f(E),()=>{f(E)};const I=w.getContext("2d",{colorSpace:"srgb"});if(!I){p(new Error("Failed to acquire 2D context for <Solid> source"));return}return I.clearRect(0,0,1,1),e!==void 0&&(I.fillStyle=e,I.fillRect(0,0,1,1)),ws({state:x.get(h,y),source:w,effects:v,output:g,width:h,height:y}).then(T=>{T&&f(E)}).catch(T=>{p(T)}),()=>{f(E)}},[e,g,w,x,h,y,u,f,p,v]);const k=c.useMemo(()=>({width:t,height:n,...i??{}}),[n,i,t]);return d.jsx("canvas",{ref:b,width:h,height:y,className:o,style:k})},nC=c.forwardRef(({effects:e=[],controls:t,color:n,height:r,width:o,className:i,durationInFrames:s,style:a,name:l,from:u,trimBefore:f,freeze:p,hidden:m,showInTimeline:h,pixelDensity:y,...g},S)=>{const v=vs(e),w=c.useRef(null);return c.useImperativeHandle(S,()=>w.current,[]),d.jsx(dt,{layout:"none",from:u,trimBefore:f,freeze:p,hidden:m,showInTimeline:h,controls:t,_remotionInternalEffects:v,durationInFrames:s,name:l??"<Solid>",outlineRef:w,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/solid",...g,children:d.jsx(tC,{reference:w,overrideId:(t==null?void 0:t.overrideId)??null,color:n,height:r,width:o,className:i,style:a,effects:e,pixelDensity:y})})}),G0=Wn({Component:nC,componentName:"<Solid>",componentIdentity:"dev.remotion.remotion.Solid",schema:eC,supportsEffects:!0});G0.displayName="Solid";St(G0);var qs=null,q0=()=>{if(qs!==null)return qs;if(typeof document>"u")return!1;const e=document.createElement("canvas"),t=e.getContext("2d");return qs=typeof(t==null?void 0:t.drawElementImage)=="function"&&typeof e.requestPaint=="function"&&typeof e.captureElementImage=="function"&&"transferControlToOffscreen"in HTMLCanvasElement.prototype,qs},rC="HTML in Canvas is not supported. Two common causes: Chrome is older than version 148 (update Chrome), or the HTML-in-Canvas flag is disabled at chrome://flags/#canvas-draw-element (enable it and restart Chrome).";function oC(e,t){if(typeof e!="number"||typeof t!="number")throw new Error(`HtmlInCanvas: \`width\` and \`height\` must be numbers. Received width=${String(e)}, height=${String(t)}.`);if(!Number.isInteger(e)||e<=0)throw new Error(`HtmlInCanvas: \`width\` must be a positive integer. Received: ${String(e)}.`);if(!Number.isInteger(t)||t<=0)throw new Error(`HtmlInCanvas: \`height\` must be a positive integer. Received: ${String(t)}.`)}function iC(e){if(e===void 0)return 1;if(typeof e!="number"||!Number.isFinite(e)||e<=0)throw new Error(`HtmlInCanvas: \`pixelDensity\` must be a positive finite number. Received: ${String(e)}.`);return e}var Qs=e=>e instanceof DOMException&&e.name==="InvalidStateError",Km="HtmlInCanvas: Expected the element to be inside the viewport during rendering, but Chrome had no cached paint record for it.",Xm=({target:e,width:t,height:n})=>{e.width!==t&&(e.width=t),e.height!==n&&(e.height=n)},sC=({canvas:e,element:t,elementImage:n})=>{const r=e.getContext("2d");if(!r)throw new Error("Failed to acquire 2D context for <HtmlInCanvas> canvas");r.reset();const o=r.drawElementImage(n,0,0);t.style.transform=o.toString()},Gm=c.createContext(null),Q0=c.forwardRef(({width:e,height:t,effects:n,children:r,onPaint:o,onInit:i,pixelDensity:s,controls:a,style:l},u)=>{const f=c.useContext(Gm);oC(e,t);const p=iC(s),m=Math.ceil(e*p),h=Math.ceil(t*p),{delayRender:y,continueRender:g,cancelRender:S}=mn(),{isClientSideRendering:v,isRendering:w}=Ze(),x=!w||v,b=o===void 0&&i===void 0;q0()||S(new Error(rC));const k=c.useRef(null),E=c.useRef(null),I=c.useRef(null),T=`${e}x${t}@${p}-${b?"direct":"offscreen"}`,_=c.useCallback(A=>{k.current=A,typeof u=="function"?u(A):u&&(u.current=A)},[u]),$=xs(),j=ys({effects:n,overrideId:(a==null?void 0:a.overrideId)??null}),L=c.useRef(j);L.current=j;const M=c.useRef(o);M.current=o;const O=c.useRef(i);O.current=i;const Z=c.useRef(!1),D=c.useRef(null),R=c.useRef(!1),C=c.useRef(f);C.current=f;const F=c.useCallback(async()=>{var H;const A=I.current;if(!A)throw new Error("Canvas or scene element not found");const B=E.current;if(!B)throw new Error("HtmlInCanvas: paint target is not ready because the canvas is remounting");Xm({target:B,width:m,height:h});try{const z=k.current;if(!z)throw new Error("Canvas not found");const Y=y("onPaint");if(!Z.current){const ae=O.current;if(!ae)Z.current=!0;else{let ce;try{ce=z.captureElementImage(A)}catch(se){if(Qs(se)&&x){g(Y);return}throw Qs(se)?new Error(Km):se}Z.current=!0;try{if(B instanceof HTMLCanvasElement)throw new Error("HtmlInCanvas: onInit requires an OffscreenCanvas paint target");const se=await ae({canvas:B,element:A,elementImage:ce,pixelDensity:p});if(typeof se!="function")throw new Error("HtmlInCanvas: when `onInit` is provided, it must return a cleanup function, or a Promise that resolves to one.");R.current?se():D.current=se}finally{ce.close()}}}let oe;try{oe=z.captureElementImage(A)}catch(ae){if(Qs(ae)&&x){g(Y);return}throw Qs(ae)?new Error(Km):ae}try{const ae=M.current;if(ae){if(B instanceof HTMLCanvasElement)throw new Error("HtmlInCanvas: onPaint requires an OffscreenCanvas paint target");const ce=ae({canvas:B,element:A,elementImage:oe,pixelDensity:p});ce&&await ce}else sC({canvas:B,element:A,elementImage:oe,pixelDensity:p});await ws({state:$.get(m,h),source:B,effects:L.current,output:B,width:m,height:h})}finally{oe.close()}(H=C.current)==null||H.requestParentPaint(),g(Y)}catch(z){S(z)}},[h,m,$,g,S,y,p,x]);c.useLayoutEffect(()=>{const A=k.current;if(!A)throw new Error("Canvas not found");A.layoutSubtree=!0;const B=b?A:A.transferControlToOffscreen();return E.current=B,Xm({target:B,width:m,height:h}),Z.current=!1,R.current=!1,A.addEventListener("paint",F),()=>{var H;A.removeEventListener("paint",F),E.current=null,Z.current=!1,R.current=!0,(H=D.current)==null||H.call(D),D.current=null}},[F,S,m,h,b]);const P=c.useRef(!1);c.useLayoutEffect(()=>{var B;if(!P.current){P.current=!0;return}const A=k.current;A&&((B=A.requestPaint)==null||B.call(A))},[o,j]),c.useLayoutEffect(()=>{const A=k.current;if(!A)return;const B=y("waiting for first paint after canvas resize");return A.addEventListener("paint",()=>{g(B)},{once:!0}),()=>{g(B)}},[e,t,g,y,T]);const V=c.useMemo(()=>({width:e,height:t}),[e,t]),W=c.useMemo(()=>({width:e,height:t,...l??{}}),[t,l,e]),N=c.useMemo(()=>({requestParentPaint:()=>{var A,B;(B=(A=k.current)==null?void 0:A.requestPaint)==null||B.call(A)}}),[]);return d.jsx(Gm.Provider,{value:N,children:d.jsx("canvas",{ref:_,width:m,height:h,style:W,children:d.jsx("div",{ref:I,style:V,children:r})},T)})});Q0.displayName="HtmlInCanvasContent";var J0=c.forwardRef(({width:e,height:t,effects:n=[],children:r,onPaint:o,onInit:i,pixelDensity:s,controls:a,style:l,durationInFrames:u,name:f,...p},m)=>{const h=vs(n),y=c.useRef(null),g=c.useCallback(S=>{y.current=S,typeof m=="function"?m(S):m&&(m.current=S)},[m]);return d.jsx(dt,{durationInFrames:u,name:f??"<HtmlInCanvas>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/remotion/html-in-canvas",controls:a,_remotionInternalEffects:h,outlineRef:y,layout:"none",...p,children:d.jsx(Q0,{ref:g,width:e,height:t,effects:n,onPaint:o,onInit:i,pixelDensity:s,controls:a,style:l,children:r})})});J0.displayName="HtmlInCanvas";var aC={...Bn,pixelDensity:{type:"number",min:1,max:3,step:.1,default:1,description:"Pixel density",hiddenFromList:!1},...Tn,...Sr,...br},lC=Wn({Component:J0,componentName:"<HtmlInCanvas>",componentIdentity:"dev.remotion.remotion.HtmlInCanvas",schema:aC,supportsEffects:!0}),ew=Object.assign(lC,{isSupported:q0});ew.displayName="HtmlInCanvas";St(ew);function $n(e){return e.startsWith("data:")&&e.length>100?e.slice(0,60)+"...["+e.length+" chars total]":e}var uC={...Bn,...Zo,fit:{type:"enum",default:"fill",description:"Fit",variants:{fill:{},contain:{},cover:{}}},...Tn,...Sr,...br},cC=()=>{if(typeof DOMException<"u")return new DOMException("Image loading was aborted","AbortError");const e=new Error("Image loading was aborted");return e.name="AbortError",e},dC=({src:e,signal:t})=>new Promise((n,r)=>{const o=new Image;let i=!1;function s(){o.onload=null,o.onerror=null}function a(u){i||(i=!0,s(),u())}function l(){a(()=>r(cC()))}if(o.onload=()=>{var u;Promise.resolve((u=o.decode)==null?void 0:u.call(o)).catch(()=>{}).then(()=>{const f=o.naturalWidth||o.width,p=o.naturalHeight||o.height;if(f<=0||p<=0){a(()=>r(new Error(`Could not determine dimensions for <CanvasImage> with src="${$n(e)}"`)));return}a(()=>n({element:o,width:f,height:p}))})},o.onerror=()=>{a(()=>r(new Error(`Could not load <CanvasImage> with src="${$n(e)}"`)))},t.addEventListener("abort",l,{once:!0}),t.aborted){l();return}o.crossOrigin="anonymous",o.src=e});function fC(e){return 1e3*2**(e-1)}var pC=({onFrame:e})=>{if(typeof requestAnimationFrame>"u")return e(),()=>{};const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)},tw=c.forwardRef(({src:e,width:t,height:n,fit:r="fill",effects:o,controls:i,onError:s,className:a,style:l,id:u,pauseWhenLoading:f,maxRetries:p=2,delayRenderRetries:m,delayRenderTimeoutInMilliseconds:h,refForOutline:y,...g},S)=>{const{delayRender:v,continueRender:w,cancelRender:x}=mn(),{delayPlayback:b}=Xl(),[k,E]=c.useState(null),[I,T]=c.useState(null),_=Yr(e),$=xs(),j=ys({effects:o,overrideId:(i==null?void 0:i.overrideId)??null}),L=c.useContext(et),M=c.useRef(null),[O,Z]=c.useState(!1),D=!!(L!=null&&L.premounting),R=!!(L!=null&&L.postmounting),C=c.useCallback(({markAsReady:V})=>{const W=M.current;!W||W.continued||(W.continued=!0,V&&Z(!1),w(W.handle),M.current=null)},[w]),F=c.useMemo(()=>typeof document>"u"?null:document.createElement("canvas"),[]),P=c.useCallback(V=>{E(V),y&&(y.current=V),typeof S=="function"?S(V):S&&(S.current=V)},[S,y]);return c.useLayoutEffect(()=>{if(!(!f||!O||D||R))return b().unblock},[b,O,R,D,f]),c.useLayoutEffect(()=>{const V=v(`Rendering <CanvasImage> with src="${$n(_)}"`,{retries:m??void 0,timeoutInMilliseconds:h??void 0}),W=new AbortController;let N=!1,A=0,B=null;T(null),Z(!0),M.current={handle:V,continued:!1};const H=()=>{dC({src:_,signal:W.signal}).then(z=>{N||T(z)}).catch(z=>{if(z.name==="AbortError"){C({markAsReady:!1});return}if(A++,A<=p){const Y=fC(A);console.warn(`Could not load <CanvasImage> with src="${$n(_)}", retrying in ${Y}ms`),B=setTimeout(()=>{N||H()},Y)}else s?(s(z),C({markAsReady:!0})):x(z)})};return H(),()=>{N=!0,B!==null&&clearTimeout(B),W.abort(),C({markAsReady:!1})}},[_,x,C,v,m,h,p,s]),c.useLayoutEffect(()=>{if(!I||!k||!F)return;const V=v(`Applying effects to <CanvasImage> with src="${$n(_)}"`);let W=!1,N=!1,A=()=>{};const B=()=>{N||(N=!0,w(V))},H=t??I.width,z=n??I.height,Y=F.getContext("2d",{colorSpace:"srgb"});return Y?(F.width=H,F.height=z,k.width=H,k.height=z,Y.clearRect(0,0,H,z),Y.drawImage(I.element,...C0(r,{width:I.width,height:I.height},{width:H,height:z})),ws({state:$.get(H,z),source:F,effects:j,output:k,width:H,height:z}).then(oe=>{oe&&!W&&(A=pC({onFrame:()=>{W||(B(),C({markAsReady:!0}))}}))}).catch(oe=>{W||(s?(s(oe),B(),C({markAsReady:!0})):x(oe))}),()=>{W=!0,A(),B()}):(x(new Error("Could not get 2D context for <CanvasImage> source canvas")),B(),()=>{B()})},[_,x,$,w,C,v,r,n,I,j,s,k,F,t]),d.jsx("canvas",{...g,ref:P,width:t,height:n,className:a,style:l,id:u})});tw.displayName="CanvasImageContent";var mC=c.forwardRef(({src:e,width:t,height:n,fit:r,effects:o=[],className:i,style:s,id:a,onError:l,pauseWhenLoading:u,maxRetries:f,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,durationInFrames:h,from:y,trimBefore:g,freeze:S,premountFor:v,postmountFor:w,styleWhilePremounted:x,styleWhilePostmounted:b,hidden:k,name:E,showInTimeline:I,stack:T,controls:_,_remotionInternalDocumentationLink:$,outlineRef:j,...L},M)=>{if(!e)throw new Error('No "src" prop was passed to <CanvasImage>.');const O=vs(o),Z=c.useRef(null);c.useImperativeHandle(M,()=>Z.current,[]);const{effectivePostmountFor:D,effectivePremountFor:R,freezeFrame:C,isPremountingOrPostmounting:F,postmountingActive:P,premountingActive:V,premountingStyle:W}=hs({from:y??0,durationInFrames:h??1/0,premountFor:v??null,postmountFor:w??null,style:s??null,styleWhilePremounted:x??null,styleWhilePostmounted:b??null,hideWhilePremounted:"display-none"});return d.jsx(ps,{frame:C,active:F,children:d.jsx(dt,{layout:"none",from:y??0,trimBefore:g,durationInFrames:h??1/0,freeze:S,hidden:k,showInTimeline:I??!0,name:E??"<CanvasImage>",_remotionInternalDocumentationLink:$??"https://www.remotion.dev/docs/canvasimage",controls:_,_remotionInternalEffects:O,_remotionInternalIsMedia:{type:"image",src:e},_remotionInternalStack:T,_remotionInternalPremountDisplay:R||null,_remotionInternalPostmountDisplay:D||null,_remotionInternalIsPremounting:V,_remotionInternalIsPostmounting:P,outlineRef:j??Z,children:d.jsx(tw,{ref:Z,src:e,width:t,height:n,fit:r,effects:o,controls:_,className:i,style:W??void 0,id:a,onError:l,pauseWhenLoading:u,maxRetries:f,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,refForOutline:j??null,...L})})})}),Vf=Wn({Component:mC,componentName:"<CanvasImage>",componentIdentity:"dev.remotion.remotion.CanvasImage",schema:uC,supportsEffects:!0});Vf.displayName="CanvasImage";St(Vf);var hC=({onLoad:e,onError:t,delayRenderRetries:n,delayRenderTimeoutInMilliseconds:r,...o},i)=>{const{delayRender:s,continueRender:a}=mn(),[l]=c.useState(()=>s(`Loading <IFrame> with source ${o.src}`,{retries:n??void 0,timeoutInMilliseconds:r??void 0})),u=c.useCallback(p=>{a(l),e==null||e(p)},[l,e,a]),f=c.useCallback(p=>{a(l),t?t(p):console.error("Error loading iframe:",p,"Handle the event using the onError() prop to make this message disappear.")},[l,t,a]);return d.jsx("iframe",{referrerPolicy:"strict-origin-when-cross-origin",...o,ref:i,onError:f,onLoad:u})};c.forwardRef(hC);function gC(e){return 1e3*2**(e-1)}var vC=({onError:e,maxRetries:t=2,src:n,pauseWhenLoading:r,delayRenderRetries:o,delayRenderTimeoutInMilliseconds:i,onImageFrame:s,crossOrigin:a,decoding:l,ref:u,refForOutline:f,...p})=>{const m=c.useRef(null),h=c.useRef({}),{delayPlayback:y}=Xl(),g=c.useContext(et),[S,v]=c.useState(!1),w=c.useCallback(O=>{m.current=O,f.current=O,typeof u=="function"?u(O):u&&(u.current=O)},[u,f]),x=Yr(n),b=c.useCallback(O=>{if(!m.current)return;const Z=m.current.src;setTimeout(()=>{var R;if(!m.current)return;const D=(R=m.current)==null?void 0:R.src;D===Z&&(m.current.removeAttribute("src"),m.current.setAttribute("src",D))},O)},[]),{delayRender:k,continueRender:E,cancelRender:I}=mn(),T=!!(g!=null&&g.premounting),_=!!(g!=null&&g.postmounting),$=c.useCallback(O=>{var Z,D,R,C,F,P,V;if(h.current){if(h.current[(Z=m.current)==null?void 0:Z.src]=(h.current[(D=m.current)==null?void 0:D.src]??0)+1,e&&(h.current[(R=m.current)==null?void 0:R.src]??0)>t){e(O);return}if((h.current[(C=m.current)==null?void 0:C.src]??0)<=t){const W=gC(h.current[(F=m.current)==null?void 0:F.src]??0);console.warn(`Could not load image with source ${$n((P=m.current)==null?void 0:P.src)}, retrying again in ${W}ms`),b(W);return}try{I("Error loading image with src: "+$n((V=m.current)==null?void 0:V.src))}catch{}}},[I,t,e,b]);typeof window<"u"&&(c.useLayoutEffect(()=>{if(!(!r||!S||T||_))return y().unblock},[y,S,_,T,r]),c.useLayoutEffect(()=>{var C,F;if(((F=(C=window.process)==null?void 0:C.env)==null?void 0:F.NODE_ENV)==="test"){m.current&&(m.current.src=x);return}const{current:O}=m;if(!O)return;v(!0);const Z=k("Loading <Img> with src="+$n(x),{retries:o??void 0,timeoutInMilliseconds:i??void 0});let D=!1;const R=()=>{var P,V,W;if(D){E(Z);return}(h.current[(P=m.current)==null?void 0:P.src]??0)>0&&(delete h.current[(V=m.current)==null?void 0:V.src],console.info(`Retry successful - ${$n((W=m.current)==null?void 0:W.src)} is now loaded`)),O&&(s==null||s(O)),v(!1),E(Z)};if(!m.current){R();return}return O.src=x,O.decode().then(R).catch(P=>{console.warn(P),O.complete&&O.naturalWidth>0&&O.naturalHeight>0?R():O.addEventListener("load",R)}),()=>{D=!0,O.removeEventListener("load",R),E(Z)}},[x,o,i,s,E,k]));const{isClientSideRendering:j,isRendering:L}=Ze(),M=$f({crossOrigin:a,requestsVideoFrame:!1,isClientSideRendering:j});return d.jsx("img",{...p,ref:w,crossOrigin:M,onError:$,decoding:L?"sync":l})},yC=({hidden:e,name:t,stack:n,showInTimeline:r,src:o,from:i,trimBefore:s,durationInFrames:a,freeze:l,premountFor:u,postmountFor:f,style:p,styleWhilePremounted:m,styleWhilePostmounted:h,controls:y,outlineRef:g,...S})=>{if(!o)throw new Error('No "src" prop was passed to <Img>.');const{effectivePostmountFor:v,effectivePremountFor:w,freezeFrame:x,isPremountingOrPostmounting:b,postmountingActive:k,premountingActive:E,premountingStyle:I}=hs({from:i??0,durationInFrames:a??1/0,premountFor:u??null,postmountFor:f??null,style:p??null,styleWhilePremounted:m??null,styleWhilePostmounted:h??null,hideWhilePremounted:"display-none"});return d.jsx(ps,{frame:x,active:b,children:d.jsx(dt,{layout:"none",from:i??0,trimBefore:s,durationInFrames:a??1/0,freeze:l,_remotionInternalStack:n,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/img",_remotionInternalIsMedia:{type:"image",src:o},_remotionInternalPremountDisplay:w||null,_remotionInternalPostmountDisplay:v||null,_remotionInternalIsPremounting:E,_remotionInternalIsPostmounting:k,name:t??"<Img>",controls:y,showInTimeline:r??!0,hidden:e,outlineRef:g,children:d.jsx(vC,{src:o,refForOutline:g,style:I??void 0,...S})})})},wC=Vf,xC={src:{type:"asset",default:void 0,description:"Source",keyframable:!1},...Bn,...Zo,...Tn,...Sr,...br},bC=new Set(["alt","crossOrigin","decoding","fetchPriority","loading","onError","onImageFrame","onLoad","sizes","srcSet","useMap"]),SC=e=>Object.keys(e).filter(t=>e[t]!==void 0&&bC.has(t)),EC=e=>e.map(t=>`"${t}"`).join(", "),kC=({props:e,ref:t,width:n,height:r})=>{if(typeof n=="string"||typeof r=="string")throw new Error('The "width" and "height" props must be numbers on <Img> when effects are passed, because <Img> renders a <CanvasImage>. Use numeric props or CSS dimensions in "style".');const o=SC(e);if(t!=null&&o.unshift("ref"),o.length!==0)throw new Error(`The ${EC(o)} prop${o.length===1?"":"s"} cannot be used on <Img> when effects are passed, because <Img> renders a <canvas> instead of a native <img>. Remove ${o.length===1?"this prop":"these props"}.`)},CC=e=>{const t=e==null?void 0:e.objectFit;if(t==="fill"||t==="contain"||t==="cover")return t},IC=({effects:e=[],ref:t,hidden:n,name:r,stack:o,showInTimeline:i,src:s,from:a,trimBefore:l,durationInFrames:u,freeze:f,premountFor:p,postmountFor:m,styleWhilePremounted:h,styleWhilePostmounted:y,controls:g,width:S,height:v,className:w,style:x,id:b,pauseWhenLoading:k,maxRetries:E,delayRenderRetries:I,delayRenderTimeoutInMilliseconds:T,..._})=>{const $=c.useRef(null),j=ms(k);if(e.length===0)return d.jsx(yC,{..._,ref:t,hidden:n,name:r,stack:o,showInTimeline:i,src:s,from:a,trimBefore:l,durationInFrames:u,freeze:f,premountFor:p,postmountFor:m,styleWhilePremounted:h,styleWhilePostmounted:y,controls:g,width:S,height:v,className:w,style:x,id:b,pauseWhenLoading:j,maxRetries:E,delayRenderRetries:I,delayRenderTimeoutInMilliseconds:T,outlineRef:$});if(!s)throw new Error('No "src" prop was passed to <Img>.');kC({props:_,ref:t,width:S,height:v});const L=typeof S=="number"?S:void 0,M=typeof v=="number"?v:void 0,O=_,Z=CC(x)??"fill";return d.jsx(wC,{src:s,width:L,height:M,fit:Z,effects:e,className:w,style:x,id:b,pauseWhenLoading:j,maxRetries:E,delayRenderRetries:I,delayRenderTimeoutInMilliseconds:T,from:a,trimBefore:l,durationInFrames:u,freeze:f,premountFor:p,postmountFor:m,styleWhilePremounted:h,styleWhilePostmounted:y,hidden:n,name:r??"<Img>",showInTimeline:i,stack:o,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/img",controls:g,outlineRef:$,...O})},Bf=Wn({Component:IC,componentName:"<Img>",componentIdentity:"dev.remotion.remotion.Img",schema:xC,supportsEffects:!0});St(Bf);var TC=e=>{if(e==="remotion")return"dev.remotion.remotion";if(e.startsWith("@remotion/"))return`dev.remotion.${e.slice(10).replace(/-([a-z])/g,(n,r)=>r.toUpperCase())}`;throw new Error(`Unsupported Remotion package name: ${e}`)},nw=({packageName:e,componentName:t})=>`${TC(e)}.${t}`,Wf={...Bn,...Tn},RC={...Wf,...Sr},rw={...RC,...br},_C={...rw,...Ml,...Xy},PC={...Wf,...Ml,...Xy},FC=(e,t)=>{typeof e=="function"?e(t):e&&(e.current=t)},ow=e=>{const t=Wn(e);return St(t),t},rl=(e,t,n)=>{const r=c.forwardRef((i,s)=>{const{durationInFrames:a,from:l,trimBefore:u,freeze:f,hidden:p,name:m,showInTimeline:h,stack:y,controls:g,...S}=i,v=c.useRef(null),w=c.useCallback(x=>{v.current=x,FC(s,x)},[s]);return d.jsx(dt,{layout:"none",from:l??0,trimBefore:u,durationInFrames:a??1/0,freeze:f,hidden:p,name:m??t,showInTimeline:h??!0,controls:g,_remotionInternalStack:y,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/interactive",outlineRef:v,children:J.createElement(e,{...S,ref:w})})});r.displayName=t;const o=ow({Component:r,componentName:t,componentIdentity:nw({packageName:"remotion",componentName:t.slice(1,-1)}),schema:n,supportsEffects:!1});return o.displayName=t,o},Te=(e,t)=>rl(e,t,_C),Jr=(e,t)=>rl(e,t,Wf),Kn={baseSchema:Bn,transformSchema:Tn,textSchema:Ml,backgroundSchema:Sr,borderSchema:br,premountSchema:Zo,sequenceSchema:Lo,withSchema:ow,_internalMakeRemotionComponentIdentity:nw,A:Te("a","<Interactive.A>"),Article:Te("article","<Interactive.Article>"),Aside:Te("aside","<Interactive.Aside>"),Button:Te("button","<Interactive.Button>"),Circle:Jr("circle","<Interactive.Circle>"),Code:Te("code","<Interactive.Code>"),Div:Te("div","<Interactive.Div>"),Ellipse:Jr("ellipse","<Interactive.Ellipse>"),Em:Te("em","<Interactive.Em>"),Footer:Te("footer","<Interactive.Footer>"),G:Jr("g","<Interactive.G>"),H1:Te("h1","<Interactive.H1>"),H2:Te("h2","<Interactive.H2>"),H3:Te("h3","<Interactive.H3>"),H4:Te("h4","<Interactive.H4>"),H5:Te("h5","<Interactive.H5>"),H6:Te("h6","<Interactive.H6>"),Header:Te("header","<Interactive.Header>"),Label:Te("label","<Interactive.Label>"),Li:Te("li","<Interactive.Li>"),Line:Jr("line","<Interactive.Line>"),Main:Te("main","<Interactive.Main>"),Nav:Te("nav","<Interactive.Nav>"),Ol:Te("ol","<Interactive.Ol>"),P:Te("p","<Interactive.P>"),Path:Jr("path","<Interactive.Path>"),Pre:Te("pre","<Interactive.Pre>"),Rect:Jr("rect","<Interactive.Rect>"),Section:Te("section","<Interactive.Section>"),Small:Te("small","<Interactive.Small>"),Span:Te("span","<Interactive.Span>"),Strong:Te("strong","<Interactive.Strong>"),Svg:rl("svg","<Interactive.Svg>",rw),Text:rl("text","<Interactive.Text>",PC),Ul:Te("ul","<Interactive.Ul>")},jC=async({resolvedSrc:e,signal:t,requestInit:n,contentType:r})=>{const{decoder:o,selectedTrack:i}=await _0({resolvedSrc:e,signal:t,requestInit:n,contentType:r});try{const{image:s}=await o.decode({frameIndex:i.frameCount-1,completeFramesOnly:!0});try{if(s.duration===null)throw new Error("Could not determine animated image duration");return(s.timestamp+s.duration)/1e6}finally{s.close()}}finally{o.close()}},iw=J.createRef(),MC=({children:e,onlyRenderComposition:t,currentCompositionMetadata:n,initialCompositions:r,initialCanvasContent:o})=>{const[i,s]=c.useState([]),[a,l]=c.useState(o),[u,f]=c.useState(r),p=c.useRef(u),m=c.useCallback(x=>{f(b=>{const k=x(b);return p.current=k,k})},[]),h=c.useCallback(x=>{m(b=>{if(b.find(k=>k.id===x.id))throw new Error(`Multiple composition with id ${x.id} are registered.`);return[...b,x]})},[m]),y=c.useCallback(x=>{f(b=>b.filter(k=>k.id!==x))},[]),g=c.useCallback((x,b,k,E)=>{s(I=>[...I,{name:x,parent:b,nonce:k,stack:E}])},[]),S=c.useCallback((x,b)=>{s(k=>k.filter(E=>!(E.name===x&&E.parent===b)))},[]);c.useImperativeHandle(iw,()=>({getCompositions:()=>p.current}),[]);const v=c.useMemo(()=>({registerComposition:h,unregisterComposition:y,registerFolder:g,unregisterFolder:S,setCanvasContent:l,onlyRenderComposition:t}),[h,g,y,S,t]),w=c.useMemo(()=>({compositions:u,folders:i,currentCompositionMetadata:n,canvasContent:a}),[u,i,n,a]);return d.jsx(Bo.Provider,{value:w,children:d.jsx(us.Provider,{value:v,children:e})})},sw={};Cy(sw,{makeDefaultPreviewCSS:()=>AC,injectCSS:()=>$C,OBJECTFIT_CONTAIN_CLASS_NAME:()=>ts});var Js={},$C=e=>{if(typeof document>"u")return()=>{};if(Js[e])return()=>{};const t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");return n.appendChild(document.createTextNode(e)),t.prepend(n),Js[e]=n,()=>{const r=Js[e];r&&(r.parentNode&&r.parentNode.removeChild(r),delete Js[e])}},ts="__remotion_objectfitcontain",AC=(e,t)=>e?`
|
|
58
58
|
${e} * {
|
|
59
59
|
box-sizing: border-box;
|
|
60
60
|
}
|
|
@@ -76,7 +76,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
76
76
|
.${ts} {
|
|
77
77
|
object-fit: contain;
|
|
78
78
|
}
|
|
79
|
-
`,aw="__remotion-studio-container",NC=()=>document.getElementById(aw),LC=J.createContext(null),zC=null,Vu=[],DC=()=>zC,OC=e=>(Vu.push(e),()=>{Vu=Vu.filter(t=>t!==e)}),Uf=c.createContext(null),VC=()=>{const e=c.useContext(Uf);return!e||e.videoEnabled===null?window.remotion_videoEnabled:e.videoEnabled},BC=()=>{const e=c.useContext(Uf);return!e||e.audioEnabled===null?window.remotion_audioEnabled:e.audioEnabled},WC=({children:e,videoEnabled:t,audioEnabled:n})=>{const r=c.useMemo(()=>({videoEnabled:t,audioEnabled:n}),[t,n]);return d.jsx(Uf.Provider,{value:r,children:e})},UC=({children:e,numberOfAudioTags:t,logLevel:n,audioLatencyHint:r,previewSampleRate:o,videoEnabled:i,audioEnabled:s,frameState:a})=>{const l=c.useMemo(()=>{let f=0;return{getNonce:()=>f++}},[]),u=c.useMemo(()=>({logLevel:n,mountTime:Date.now()}),[n]);return d.jsx(Ur.Provider,{value:u,children:d.jsx(cs.Provider,{value:l,children:d.jsx(OS,{frameState:a,children:d.jsx(WC,{videoEnabled:i,audioEnabled:s,children:d.jsx(jy,{children:d.jsx($0,{children:d.jsx(ZS,{children:d.jsx(N0,{children:d.jsx(W0,{children:d.jsx(L0,{audioLatencyHint:r,audioEnabled:s,previewSampleRate:o,children:d.jsx(z0,{numberOfAudioTags:t,children:e})})})})})})})})})})})},qm=["h264","h265","vp8","vp9","av1","mp3","aac","wav","prores","h264-mkv","h264-ts","gif"];function HC(e,t,n){if(!(typeof e>"u")){if(typeof e!="string")throw new TypeError(`The "${n}" prop ${t} must be a string, but you passed a value of type ${typeof e}.`);if(!qm.includes(e))throw new Error(`The "${n}" prop ${t} must be one of ${qm.join(", ")}, but you passed ${e}.`)}}var ZC=({calculated:e,compositionId:t,compositionFps:n,compositionHeight:r,compositionWidth:o,compositionDurationInFrames:i})=>{const s=`calculated by calculateMetadata() for the composition "${t}"`,a=`of the "<Composition />" component with the id "${t}"`,l=(e==null?void 0:e.width)??o??void 0;qa(l,"width",e!=null&&e.width?s:a);const u=(e==null?void 0:e.height)??r??void 0;qa(u,"height",e!=null&&e.height?s:a);const f=(e==null?void 0:e.fps)??n??null;Rl(f,e!=null&&e.fps?s:a);const p=(e==null?void 0:e.durationInFrames)??i??null;Tl(p,{allowFloats:!1,component:`of the "<Composition />" component with the id "${t}"`});const m=e==null?void 0:e.defaultCodec;HC(m,s,"defaultCodec");const h=e==null?void 0:e.defaultOutName,w=e==null?void 0:e.defaultVideoImageFormat,v=e==null?void 0:e.defaultPixelFormat,S=e==null?void 0:e.defaultProResProfile,g=e==null?void 0:e.defaultSampleRate;return{width:l,height:u,fps:f,durationInFrames:p,defaultCodec:m,defaultOutName:h,defaultVideoImageFormat:w,defaultPixelFormat:v,defaultProResProfile:S,defaultSampleRate:g}},Qm=({calculated:e,compositionDurationInFrames:t,compositionFps:n,compositionHeight:r,compositionId:o,compositionWidth:i,defaultProps:s,originalProps:a})=>{const l=ZC({calculated:e,compositionDurationInFrames:t,compositionFps:n,compositionHeight:r,compositionWidth:i,compositionId:o});return{metadataSource:{durationInFrames:(e==null?void 0:e.durationInFrames)===void 0?"composition":"calculate-metadata",fps:(e==null?void 0:e.fps)===void 0?"composition":"calculate-metadata",height:(e==null?void 0:e.height)===void 0?"composition":"calculate-metadata",width:(e==null?void 0:e.width)===void 0?"composition":"calculate-metadata"},videoConfig:{...l,id:o,defaultProps:nd(s??{}),props:nd((e==null?void 0:e.props)??a),defaultCodec:l.defaultCodec??null,defaultOutName:l.defaultOutName??null,defaultVideoImageFormat:l.defaultVideoImageFormat??null,defaultPixelFormat:l.defaultPixelFormat??null,defaultProResProfile:l.defaultProResProfile??null,defaultSampleRate:l.defaultSampleRate??null}}},lw=({calculateMetadata:e,signal:t,defaultProps:n,inputProps:r,compositionId:o,compositionDurationInFrames:i,compositionFps:s,compositionHeight:a,compositionWidth:l})=>{const u=e?e({defaultProps:n,props:r,abortSignal:t,compositionId:o,isRendering:xn().isRendering}):null;return u!==null&&typeof u=="object"&&"then"in u?u.then(f=>Qm({calculated:f,compositionDurationInFrames:i,compositionFps:s,compositionHeight:a,compositionWidth:l,compositionId:o,defaultProps:n,originalProps:r})):Qm({calculated:u,compositionDurationInFrames:i,compositionFps:s,compositionHeight:a,compositionWidth:l,compositionId:o,defaultProps:n,originalProps:r})},uw=e=>{const t=lw(e);return typeof t=="object"&&"then"in t?t.then(({videoConfig:n})=>n):t.videoConfig},YC=e=>{try{return{type:"success",result:lw(e)}}catch(t){return{type:"error",error:t}}},KC=e=>{try{return{type:"success",result:uw(e)}}catch(t){return{type:"error",error:t}}},XC=J.createContext(()=>{}),GC=()=>{if(xn().isRendering){const e=window.remotion_envVariables;return e?{...JSON.parse(e),NODE_ENV:"production"}:{}}return{NODE_ENV:"production"}},qC=()=>{const e=GC();window.process||(window.process={}),window.process.env||(window.process.env={}),Object.keys(e).forEach(t=>{window.process.env[t]=e[t]})},QC=J.createContext(null),JC=c.createContext({setSize:()=>{},size:{size:"auto",translation:{x:0,y:0}}}),e2=({canvasSize:e,compositionHeight:t,compositionWidth:n,previewSize:r})=>{const o=e.height/t,i=e.width/n,s=Math.min(o,i);return r==="auto"?s===0?1:s:Number(r)},t2=J.createContext(null),n2=({src:e,transparent:t,currentTime:n,toneMapped:r})=>`http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(Cn(e))}&time=${encodeURIComponent(Math.max(0,n))}&transparent=${String(t)}&toneMapped=${String(r)}`,r2=({onError:e,volume:t,playbackRate:n,src:r,muted:o,allowAmplificationDuringRender:i,transparent:s,toneMapped:a,toneFrequency:l,name:u,loopVolumeCurveBehavior:f,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,onVideoFrame:h,crossOrigin:w,audioStreamIndex:v,preservePitch:S,...g})=>{const y=xr(),x=ct(),b=Go(f),k=jl(),E=c.useContext(et),I=zr(),{registerRenderAsset:T,unregisterRenderAsset:_}=c.useContext(Zr);if(!r)throw new TypeError("No `src` was passed to <OffthreadVideo>.");const $=c.useMemo(()=>`offthreadvideo-${Hr(r)}-${E==null?void 0:E.cumulatedFrom}-${E==null?void 0:E.relativeFrom}-${E==null?void 0:E.durationInFrames}`,[r,E==null?void 0:E.cumulatedFrom,E==null?void 0:E.relativeFrom,E==null?void 0:E.durationInFrames]);if(!k)throw new Error("No video config found");const M=Kr({volume:t,frame:b,mediaVolume:1});Qo(M),c.useEffect(()=>{if(!r)throw new Error("No src passed");if(window.remotion_audioEnabled&&!o&&!(M<=0))return T({type:"video",src:Cn(r),id:$,frame:y,volume:M,mediaFrame:x,playbackRate:n,toneFrequency:l,audioStartFrame:Math.max(0,-((E==null?void 0:E.cumulatedNegativeFrom)??0)),audioStreamIndex:v}),()=>_($)},[o,r,T,$,_,M,x,y,n,l,E==null?void 0:E.cumulatedNegativeFrom,v]);const P=c.useMemo(()=>H0({frame:x,playbackRate:n||1,startFrom:-I})/k.fps,[x,I,n,k.fps]),D=c.useMemo(()=>n2({src:r,currentTime:P,transparent:s,toneMapped:a}),[a,P,r,s]),[O,A]=c.useState(null),{delayRender:Z,continueRender:R}=pn();c.useLayoutEffect(()=>{if(!window.remotion_videoEnabled)return;const V=[];A(null);const W=new AbortController,N=Z(`Fetching ${D} from server`,{retries:p??void 0,timeoutInMilliseconds:m??void 0});return(async()=>{try{const B=await fetch(D,{signal:W.signal,cache:"no-store"});if(B.status!==200){if(B.status===500){const Y=await B.json();if(Y.error){const oe=Y.error.replace(/^Error: /,"");throw new Error(oe)}}throw new Error(`Server returned status ${B.status} while fetching ${D}`)}const H=await B.blob(),z=URL.createObjectURL(H);V.push(()=>URL.revokeObjectURL(z)),A({src:z,handle:N})}catch(B){if(B.message.includes("aborted")){R(N);return}if(W.signal.aborted){R(N);return}B.message.includes("Failed to fetch")&&(B=new Error(`Failed to fetch ${D}. This could be caused by Chrome rejecting the request because the disk space is low. Consider increasing the disk size of your environment.`,{cause:B})),e?e(B):es(B)}})(),V.push(()=>{W.signal.aborted||W.abort()}),()=>{V.forEach(B=>B())}},[D,p,m,e,R,Z]);const C=c.useCallback(()=>{e?e==null||e(new Error("Failed to load image with src "+O)):es("Failed to load image with src "+O)},[O,e]),j=c.useMemo(()=>[ts,g.className].filter(Wo).join(" "),[g.className]),F=c.useCallback(V=>{h&&h(V)},[h]);return!O||!window.remotion_videoEnabled?null:(R(O.handle),d.jsx(Bf,{src:O.src,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,onImageFrame:F,...g,onError:C,className:j}))},cw=({ref:e,onVideoFrame:t})=>{c.useEffect(()=>{const{current:n}=e;if(!n||!t)return;let r=0;const o=(i,s)=>{e.current&&(t(e.current,i,s),r=e.current.requestVideoFrameCallback(o))};if(t(n),!!n.requestVideoFrameCallback)return r=n.requestVideoFrameCallback(o),()=>{r&&n.cancelVideoFrameCallback(r)}},[t,e])};class wo extends Error{constructor({message:n,src:r}){super(n);Ie(this,"src");this.name="MediaPlaybackError",this.src=r}}var o2=(e,t)=>{const n=c.useContext(Xo);if(!n)throw new Error("SharedAudioContext not found");const r=c.useRef(null),o=c.useMemo(()=>n.audioContext?Af({audioContext:n.audioContext,ref:r}):null,[n.audioContext]);(J.useInsertionEffect??J.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{o==null||o.cleanup()})},[o]);const{volume:s,muted:a,playbackRate:l,preservePitch:u,onlyWarnForMediaSeekingError:f,src:p,onDuration:m,acceptableTimeShift:h,acceptableTimeShiftInSeconds:w,toneFrequency:v,name:S,_remotionInternalNativeLoopPassed:g,_remotionInternalStack:y,style:x,pauseWhenBuffering:b,showInTimeline:k,loopVolumeCurveBehavior:E,onError:I,onAutoPlayError:T,onVideoFrame:_,crossOrigin:$,delayRenderRetries:M,delayRenderTimeoutInMilliseconds:P,allowAmplificationDuringRender:D,useWebAudioApi:O,audioStreamIndex:A,...Z}=e,R=Go(E??"repeat"),{fps:C,durationInFrames:j}=Xe(),F=c.useContext(et),V=In(),W=fs(),[N]=c.useState(()=>String(Math.random()));if(typeof h<"u")throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");const[L]=Df(),[B]=Of(),H=Kr({frame:R,volume:s,mediaVolume:L});Qo(H);const z=c.useCallback(()=>y??null,[y]);Nf({volume:s,mediaVolume:L,mediaType:"video",src:p,playbackRate:e.playbackRate??1,displayName:S??null,id:N,getStack:z,showInTimeline:k,premountDisplay:(F==null?void 0:F.premountDisplay)??null,postmountDisplay:(F==null?void 0:F.postmountDisplay)??null,loopDisplay:void 0,documentationLink:f?"https://www.remotion.dev/docs/offthreadvideo":"https://www.remotion.dev/docs/html5-video",refForOutline:r}),Y0({mediaRef:r,src:p,mediaType:"video",playbackRate:e.playbackRate??1,preservePitch:u,onlyWarnForMediaSeekingError:f,acceptableTimeshift:w??null,isPremounting:!!(F!=null&&F.premounting),isPostmounting:!!(F!=null&&F.postmounting),pauseWhenBuffering:b,onAutoPlayError:T??null}),K0({id:N,isPostmounting:!!(F!=null&&F.postmounting),isPremounting:!!(F!=null&&F.premounting),mediaRef:r,mediaType:"video",onAutoPlayError:T??null}),O0({logLevel:V,mediaRef:r,volume:H,source:o,shouldUseWebAudioApi:O??!1});const Y=F?F.relativeFrom:0,oe=F?Math.min(F.durationInFrames,j):j,ae=Yr(p),ce=Lk({actualSrc:ae,actualFrom:Y,duration:oe,fps:C});c.useImperativeHandle(t,()=>r.current,[]),c.useState(()=>gt({logLevel:V,message:`Mounting video with source = ${ce}, v=${Si}, user agent=${typeof navigator>"u"?"server":navigator.userAgent}`,tag:"video",mountTime:W})),c.useEffect(()=>{const{current:Q}=r;if(!Q)return;const q=()=>{var he;if(Q.error){if(console.error("Error occurred in video",Q==null?void 0:Q.error),I){const Ce=new wo({message:`Code ${Q.error.code}: ${Q.error.message}`,src:p});I(Ce);return}throw new wo({message:`The browser threw an error while playing the video ${p}: Code ${Q.error.code} - ${(he=Q==null?void 0:Q.error)==null?void 0:he.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,src:p})}else{if(I){const Ce=new wo({message:`The browser threw an error while playing the video ${p}`,src:p});I(Ce);return}throw new wo({message:"The browser threw an error while playing the video",src:p})}};return Q.addEventListener("error",q,{once:!0}),()=>{Q.removeEventListener("error",q)}},[I,p]);const se=c.useRef(m);se.current=m,cw({ref:r,onVideoFrame:_}),c.useEffect(()=>{var he;const{current:Q}=r;if(!Q)return;if(Q.duration){(he=se.current)==null||he.call(se,p,Q.duration);return}const q=()=>{var Ce;(Ce=se.current)==null||Ce.call(se,p,Q.duration)};return Q.addEventListener("loadedmetadata",q),()=>{Q.removeEventListener("loadedmetadata",q)}},[p]),c.useEffect(()=>{const{current:Q}=r;Q&&(Kl()?Q.preload="metadata":Q.preload="auto")},[]);const G=c.useMemo(()=>({...x}),[x]),ee=$f({crossOrigin:$,requestsVideoFrame:!!_,isClientSideRendering:!1});return d.jsx("video",{...Z,ref:r,muted:a||B||H<=0,playsInline:!0,src:ce,loop:g,style:G,disableRemotePlayback:!0,crossOrigin:ee,controls:!1})},Hf=c.forwardRef(o2),Zf=e=>{const{startFrom:t,endAt:n,trimBefore:r,trimAfter:o,name:i,pauseWhenBuffering:s,stack:a,showInTimeline:l,...u}=e,f=Ze(),p=ms(s);if(f.isClientSideRendering)throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");const m=c.useCallback(()=>{},[]);if(typeof e.src!="string")throw new TypeError(`The \`<OffthreadVideo>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);Hl({startFrom:t,endAt:n,trimBefore:r,trimAfter:o});const{trimBeforeValue:h,trimAfterValue:w}=Zl({startFrom:t,endAt:n,trimBefore:r,trimAfter:o});if(typeof h<"u"||typeof w<"u")return d.jsx(dt,{layout:"none",from:0-(h??0),showInTimeline:!1,durationInFrames:w,name:i,children:d.jsx(Zf,{pauseWhenBuffering:p,...u,trimAfter:void 0,name:void 0,showInTimeline:l,trimBefore:void 0,stack:void 0,startFrom:void 0,endAt:void 0})});if(Ul(e,"Video"),f.isRendering)return d.jsx(r2,{pauseWhenBuffering:p,...u,trimAfter:void 0,name:void 0,showInTimeline:l,trimBefore:void 0,stack:void 0,startFrom:void 0,endAt:void 0});const{transparent:v,toneMapped:S,onAutoPlayError:g,onVideoFrame:y,crossOrigin:x,delayRenderRetries:b,delayRenderTimeoutInMilliseconds:k,...E}=u;return d.jsx(Hf,{_remotionInternalStack:a??null,onDuration:m,onlyWarnForMediaSeekingError:!0,pauseWhenBuffering:p,showInTimeline:l??!0,onAutoPlayError:g??void 0,onVideoFrame:y??null,crossOrigin:x,...E,_remotionInternalNativeLoopPassed:!1})},dw=({src:e,acceptableTimeShiftInSeconds:t,allowAmplificationDuringRender:n,audioStreamIndex:r,crossOrigin:o,delayRenderRetries:i,delayRenderTimeoutInMilliseconds:s,loopVolumeCurveBehavior:a,muted:l,name:u,onAutoPlayError:f,onError:p,onVideoFrame:m,pauseWhenBuffering:h,playbackRate:w,preservePitch:v,showInTimeline:S,style:g,toneFrequency:y,toneMapped:x,transparent:b,trimAfter:k,trimBefore:E,useWebAudioApi:I,volume:T,_remotionInternalNativeLoopPassed:_,endAt:$,stack:M,startFrom:P,imageFormat:D,...O})=>{if(D)throw new TypeError("The `<OffthreadVideo>` tag does no longer accept `imageFormat`. Use the `transparent` prop if you want to render a transparent video.");return d.jsx(Zf,{acceptableTimeShiftInSeconds:t,allowAmplificationDuringRender:n??!0,audioStreamIndex:r??0,crossOrigin:o,delayRenderRetries:i,delayRenderTimeoutInMilliseconds:s,loopVolumeCurveBehavior:a??"repeat",muted:l??!1,name:u,onAutoPlayError:f??null,onError:p,onVideoFrame:m,pauseWhenBuffering:ms(h),playbackRate:w??1,preservePitch:v,toneFrequency:y??1,showInTimeline:S??!0,src:e,stack:M,startFrom:P,_remotionInternalNativeLoopPassed:_??!1,endAt:$,style:g,toneMapped:x??!0,transparent:b??!1,trimAfter:k,trimBefore:E,useWebAudioApi:I??!1,volume:T,...O})};St(dw);var i2="remotion_staticFilesChanged";function s2(){const e=J.useContext(Bo),t=J.useContext(Ho),n=J.useContext(Uo),r=J.useContext(et),o=J.useContext(cs),i=J.useContext(Wr),s=J.useContext(Wl),a=J.useContext(_l),l=J.useContext(Zr),u=J.useContext(Yo),f=J.useContext($l),p=J.useContext(Nl),m=J.useContext(qo),h=J.useContext(Ur);return c.useMemo(()=>({compositionManagerCtx:e,timelineContext:t,setTimelineContext:n,sequenceContext:r,nonceContext:o,canUseRemotionHooksContext:i,preloadContext:s,resolveCompositionContext:a,renderAssetManagerContext:l,sequenceManagerContext:u,sequenceManagerRefContext:f,visualModePropStatusesRefContext:p,bufferManagerContext:m,logLevelContext:h}),[e,o,r,n,t,i,s,a,l,u,f,p,m,h])}var a2=e=>{const{children:t,contexts:n}=e;return d.jsx(Ur.Provider,{value:n.logLevelContext,children:d.jsx(Wr.Provider,{value:n.canUseRemotionHooksContext,children:d.jsx(cs.Provider,{value:n.nonceContext,children:d.jsx(Wl.Provider,{value:n.preloadContext,children:d.jsx(Bo.Provider,{value:n.compositionManagerCtx,children:d.jsx($l.Provider,{value:n.sequenceManagerRefContext,children:d.jsx(Yo.Provider,{value:n.sequenceManagerContext,children:d.jsx(Nl.Provider,{value:n.visualModePropStatusesRefContext,children:d.jsx(Zr.Provider,{value:n.renderAssetManagerContext,children:d.jsx(_l.Provider,{value:n.resolveCompositionContext,children:d.jsx(Ho.Provider,{value:n.timelineContext,children:d.jsx(Uo.Provider,{value:n.setTimelineContext,children:d.jsx(et.Provider,{value:n.sequenceContext,children:d.jsx(qo.Provider,{value:n.bufferManagerContext,children:t})})})})})})})})})})})})})})},l2=c.createRef(),ie={MaxMediaCacheSizeContext:LC,useUnsafeVideoConfig:jl,useFrameForVolumeProp:Go,useTimelinePosition:xr,useAbsoluteTimelinePosition:Zy,evaluateVolume:Kr,getAbsoluteSrc:Cn,getAnimatedImageDurationInSeconds:jC,getAssetDisplayName:V0,Timeline:id,validateMediaTrimProps:Hl,validateMediaProps:Ul,resolveTrimProps:Zl,VideoForPreview:Hf,CompositionManager:Bo,CompositionSetters:us,VisualModePropStatusesContext:Al,VisualModePropStatusesRefContext:Nl,VisualModeDragOverridesContext:Ll,VisualModeSettersContext:t0,SequenceManager:Yo,SequenceManagerRefContext:$l,SequenceStackTracesUpdateContext:XC,baseSchema:Bn,sequenceSchema:Lo,SequenceWithoutSchema:k0,sequenceStyleSchema:qy,sequenceVisualStyleSchema:VS,sequencePremountSchema:Gy,textSchema:Ml,transformSchema:Tn,premountSchema:Zo,flattenActiveSchema:Ff,getFlatSchemaWithAllKeys:jf,RemotionRootContexts:UC,CompositionManagerProvider:MC,useVideo:Fl,getRoot:DC,useMediaVolumeState:Df,usePlayerMutedState:Of,useMediaInTimeline:Nf,useLazyComponent:Ny,truthy:Wo,SequenceContext:et,PremountContext:r0,usePremounting:hs,useRemotionContexts:s2,RemotionContextProvider:a2,CSSUtils:sw,setupEnvVariables:qC,MediaVolumeContext:Lf,SetMediaVolumeContext:zf,getRemotionEnvironment:xn,SharedAudioContext:Xo,SharedAudioContextProvider:L0,SharedAudioTagsContext:Yl,SharedAudioTagsContextProvider:z0,invalidCompositionErrorMessage:PS,invalidFolderNameErrorMessage:Jb,calculateMediaDuration:Vl,isCompositionIdValid:zy,isFolderNameValid:Ry,getPreviewDomElement:NC,compositionsRef:iw,portalNode:rd,waitForRoot:OC,SetTimelineContext:Uo,CanUseRemotionHooksProvider:Jc,CanUseRemotionHooks:Wr,PrefetchProvider:$0,DurationsContextProvider:N0,IsPlayerContextProvider:rS,useIsPlayer:vf,EditorPropsProvider:jy,EditorPropsContext:yf,usePreload:Yr,NonceContext:cs,resolveVideoConfig:uw,resolveVideoConfigOrCatch:KC,resolveVideoConfigWithMetadataOrCatch:YC,ResolveCompositionContext:_l,useResolvedVideoConfig:wf,resolveCompositionsRef:pS,REMOTION_STUDIO_CONTAINER_ELEMENT:aw,RenderAssetManager:Zr,persistCurrentFrame:Vy,usePlaybackRate:kf,useTimelineContext:wr,useTimelineSetFrame:Yy,isIosSafari:Kl,WATCH_REMOTION_STATIC_FILES:i2,addSequenceStackTraces:St,useMediaStartsAt:zr,BufferingProvider:W0,BufferingContextReact:qo,getComponentsToAddStacksTo:$S,getSequenceComponent:NS,getSingleChildComponent:LS,CurrentScaleContext:QC,PixelDensityContext:t2,PreviewSizeContext:JC,calculateScale:e2,validateRenderAsset:j0,Log:rt,LogLevelContext:Ur,useLogLevel:In,playbackLogging:gt,timeValueRef:fS,compositionSelectorRef:l2,RemotionEnvironmentContext:My,warnAboutTooHighVolume:Qo,AudioForPreview:X0,OBJECTFIT_CONTAIN_CLASS_NAME:ts,InnerOffthreadVideo:Zf,useBasicMediaInTimeline:B0,getInputPropsOverride:Fy,setInputPropsOverride:uS,useVideoEnabled:VC,useAudioEnabled:BC,useIsPlayerBuffering:U0,TimelinePosition:id,DelayRenderContextType:Ay,TimelineContext:Ho,PlaybackRateContext:bf,AbsoluteTimeContext:Sf,RenderAssetManagerProvider:xk,getEffectiveVisualModeValue:g0,CompositionRenderErrorContext:Iy,useEffectChainState:xs,createEffectChainState:R0,cleanupEffectChainState:ad,runEffectChain:ws,useMemoizedEffects:ys,useMemoizedEffectDefinitions:vs,createEffect:vk,createWebGLContextError:tk,createWebGL2ContextError:T0,computeEffectiveSchemaValuesDotNotation:b0,interpolateKeyframedStatus:gs,makeStaticDragOverride:BE,makeKeyframedDragOverride:WE,resolveDragOverrideValue:Dl,getStaticDragOverrideValue:UE,OverrideIdsToNodePathsGettersContext:Pf,OverrideIdsToNodePathsSettersContext:zE,findPropsToDelete:w0,makeSequencePropsSubscriptionKey:Fn,getPropStatusesCtx:y0,getEffectPropStatusesCtx:v0,hiddenField:Cf,durationInFramesField:Tf,freezeField:Rf,fromField:Jy},fw=e=>J.Children.toArray(e).reduce((n,r)=>r.type===J.Fragment?n.concat(fw(r.props.children)):(n.push(r),n),[]),u2={durationInFrames:Kn.baseSchema.durationInFrames,name:Kn.sequenceSchema.name,hidden:Kn.sequenceSchema.hidden,showInTimeline:Kn.sequenceSchema.showInTimeline,freeze:Kn.baseSchema.freeze,trimBefore:Kn.sequenceSchema.trimBefore,layout:Kn.sequenceSchema.layout},c2=c.forwardRef(({offset:e=0,className:t="",stack:n=null,_remotionInternalRender:r=null,...o},i)=>(KS(),r?r({...o,offset:e,className:t||void 0,stack:n},i):d.jsx(n0,{children:o.children}))),pw=Kn.withSchema({Component:c2,componentName:"<Series.Sequence>",componentIdentity:"dev.remotion.remotion.Series.Sequence",schema:u2,supportsEffects:!1}),d2=k0,Jm=({durationInFrames:e,offset:t,index:n,childrenLength:r})=>{const o=`index = ${n}, duration = ${e}`;(n!==r-1||e!==1/0)&&Tl(e,{component:"of a <Series.Sequence /> component",allowFloats:!0});const i=t??0;if(Number.isNaN(i))throw new TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${o}).`);if(!Number.isFinite(i))throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${i} (${o}).`);if(i%1!==0)throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${i} (${o}).`);return i},f2=e=>{const t=c.useMemo(()=>{const n=fw(e.children),r=(o,i)=>{if(o===n.length)return null;const a=n[o];if(typeof a=="string"){if(a.trim()==="")return r(o+1,i);throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but you passed a string "${a}"`)}if(a.type!==pw)throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${a} instead`);const l=a;return Jm({durationInFrames:l.props.durationInFrames,offset:l.props.offset,index:o,childrenLength:n.length}),J.cloneElement(l,{_remotionInternalRender:(u,f)=>{const p=u.durationInFrames,{durationInFrames:m,children:h,offset:w,controls:v,stack:S,from:g,name:y,...x}=u,b=Jm({durationInFrames:p,offset:w,index:o,childrenLength:n.length}),k=i+b,E=i+p+b;return d.jsxs(d.Fragment,{children:[d.jsx(d2,{ref:f,name:y||"<Series.Sequence>",_remotionInternalDocumentationLink:y?void 0:"https://www.remotion.dev/docs/series",_remotionInternalStack:S??void 0,controls:v??void 0,from:k,durationInFrames:p,...x,children:d.jsx(n0,{children:h})}),r(o+1,E)]})}})};return r(0,0)},[e.children]);return d.jsx(YS,{children:d.jsx(dt,{layout:"none",name:"<Series>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/series",...e,children:t})})},p2=Object.assign(Wn({Component:f2,componentName:"<Series>",componentIdentity:"dev.remotion.remotion.Series",schema:HS,supportsEffects:!1}),{Sequence:pw});St(p2);var m2={"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";"},eh={},h2=e=>{eh[e]||(console.warn(e),eh[e]=!0)},g2=e=>{for(const t of Object.keys(m2))if(e.includes(t))return{containsHex:!0,hexCode:t};return{containsHex:!1}},dd=e=>e.startsWith("/")?dd(e.substring(1)):e,v2=e=>{if(typeof window<"u"&&window.remotion_staticBase){if(e.startsWith(window.remotion_staticBase))throw new Error(`The value "${e}" is already prefixed with the static base ${window.remotion_staticBase}. You don't need to call staticFile() on it.`);return`${window.remotion_staticBase}/${dd(e)}`}return`/${dd(e)}`},y2=e=>e.split("/").map(o=>encodeURIComponent(o)).join("/"),mw=e=>{if(e===null)throw new TypeError("null was passed to staticFile()");if(typeof e>"u")throw new TypeError("undefined was passed to staticFile()");if(e.startsWith("http://")||e.startsWith("https://"))throw new TypeError(`staticFile() does not support remote URLs - got "${e}". Instead, pass the URL without wrapping it in staticFile(). See: https://remotion.dev/docs/staticfile-remote-urls`);if(e.startsWith("..")||e.startsWith("./"))throw new TypeError(`staticFile() does not support relative paths - got "${e}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);if(e.startsWith("/Users")||e.startsWith("/home")||e.startsWith("/tmp")||e.startsWith("/etc")||e.startsWith("/opt")||e.startsWith("/var")||e.startsWith("C:")||e.startsWith("D:")||e.startsWith("E:"))throw new TypeError(`staticFile() does not support absolute paths - got "${e}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);if(e.startsWith("public/"))throw new TypeError(`Do not include the public/ prefix when using staticFile() - got "${e}". See: https://remotion.dev/docs/staticfile-relative-paths`);const t=g2(e);t.containsHex&&h2(`WARNING: You seem to pass an already encoded path (path contains ${t.hexCode}). Since Remotion 4.0, the encoding is done by staticFile() itself. You may want to remove a encodeURIComponent() wrapping.`);const n=y2(e),r=v2(n);return r.startsWith("/")?r:`/${r}`},w2=e=>{const t={...e,durationInFrames:1,fps:1};return J.createElement(Qa,t)};St(w2);var th=e=>Math.round(e*1e5)/1e5,Bu=({element:e,desiredTime:t,logLevel:n,mountTime:r})=>{if(nl(e.currentTime,t))return{wait:Promise.resolve(t),cancel:()=>{}};ka({logLevel:n,mediaRef:e,time:t,why:"Seeking during rendering",mountTime:r});let o,i=null;const s=new Promise(l=>{o=e.requestVideoFrameCallback((u,f)=>{const p=f.expectedDisplayTime-u;if(p<=0){l(f.mediaTime);return}setTimeout(()=>{l(f.mediaTime)},p+150)})}),a=new Promise(l=>{const u=()=>{l()};e.addEventListener("seeked",u,{once:!0}),i=()=>{e.removeEventListener("seeked",u)}});return{wait:Promise.all([s,a]).then(([l])=>l),cancel:()=>{i==null||i(),e.cancelVideoFrameCallback(o)}}},x2=({element:e,desiredTime:t,fps:n,logLevel:r,mountTime:o})=>{const i=1/n/2;let s=()=>{};return Number.isFinite(e.duration)&&e.currentTime>=e.duration&&t>=e.duration?{prom:Promise.resolve(),cancel:()=>{}}:{prom:new Promise((l,u)=>{const f=Bu({element:e,desiredTime:t+i,logLevel:r,mountTime:o});f.wait.then(p=>{if(Math.abs(t-p)<=i)return l();const h=t>p?1:-1,w=Bu({element:e,desiredTime:p+i*h,logLevel:r,mountTime:o});s=w.cancel,w.wait.then(v=>{const S=Math.abs(t-v);if(th(S)<=th(i))return l();const g=Bu({element:e,desiredTime:t+i,logLevel:r,mountTime:o});return s=g.cancel,g.wait.then(()=>{l()}).catch(y=>{u(y)})}).catch(v=>{u(v)})}),s=f.cancel}),cancel:()=>{s()}}},b2=({onError:e,volume:t,allowAmplificationDuringRender:n,playbackRate:r,onDuration:o,toneFrequency:i,name:s,acceptableTimeShiftInSeconds:a,delayRenderRetries:l,delayRenderTimeoutInMilliseconds:u,loopVolumeCurveBehavior:f,audioStreamIndex:p,onVideoFrame:m,preservePitch:h,...w},v)=>{const S=xr(),g=ct(),y=Go(f??"repeat"),x=jl(),b=c.useRef(null),k=c.useContext(et),E=zr(),I=Ze(),T=In(),_=fs(),{delayRender:$,continueRender:M}=pn(),{registerRenderAsset:P,unregisterRenderAsset:D}=c.useContext(Zr),O=c.useMemo(()=>`video-${Hr(w.src??"")}-${k==null?void 0:k.cumulatedFrom}-${k==null?void 0:k.relativeFrom}-${k==null?void 0:k.durationInFrames}`,[w.src,k==null?void 0:k.cumulatedFrom,k==null?void 0:k.relativeFrom,k==null?void 0:k.durationInFrames]);if(!x)throw new Error("No video config found");const A=Kr({volume:t,frame:y,mediaVolume:1});Qo(A),c.useEffect(()=>{if(!w.src)throw new Error("No src passed");if(!w.muted&&!(A<=0)&&window.remotion_audioEnabled)return P({type:"video",src:Cn(w.src),id:O,frame:S,volume:A,mediaFrame:g,playbackRate:r??1,toneFrequency:i??1,audioStartFrame:Math.max(0,-((k==null?void 0:k.cumulatedNegativeFrom)??0)),audioStreamIndex:p??0}),()=>D(O)},[w.muted,w.src,P,O,D,A,g,S,r,i,k==null?void 0:k.cumulatedNegativeFrom,p]),c.useImperativeHandle(v,()=>b.current,[]),cw({ref:b,onVideoFrame:m}),c.useEffect(()=>{var N,L;if(!window.remotion_videoEnabled)return;const{current:R}=b;if(!R)return;const C=Z0({frame:g,playbackRate:r||1,startFrom:-E,fps:x.fps}),j=$(`Rendering <Html5Video /> with src="${w.src}" at time ${C}`,{retries:l??void 0,timeoutInMilliseconds:u??void 0});if(((L=(N=window.process)==null?void 0:N.env)==null?void 0:L.NODE_ENV)==="test"){M(j);return}if(nl(R.currentTime,C)){if(R.readyState>=2){M(j);return}const B=()=>{M(j)};return R.addEventListener("loadeddata",B,{once:!0}),()=>{R.removeEventListener("loadeddata",B)}}const F=()=>{M(j)},V=x2({element:R,desiredTime:C,fps:x.fps,logLevel:T,mountTime:_});V.prom.then(()=>{M(j)}),R.addEventListener("ended",F,{once:!0});const W=()=>{var B;if(R!=null&&R.error){if(console.error("Error occurred in video",R==null?void 0:R.error),e)return;throw new wo({message:`The browser threw an error while playing the video ${w.src}: Code ${R.error.code} - ${(B=R==null?void 0:R.error)==null?void 0:B.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,src:w.src})}else throw new wo({message:"The browser threw an error",src:w.src})};return R.addEventListener("error",W,{once:!0}),()=>{V.cancel(),R.removeEventListener("ended",F),R.removeEventListener("error",W),M(j)}},[y,w.src,r,x.fps,g,E,e,l,u,T,_,M,$]);const{src:Z}=w;return I.isRendering&&c.useLayoutEffect(()=>{var F,V;if(((V=(F=window.process)==null?void 0:F.env)==null?void 0:V.NODE_ENV)==="test")return;const R=$("Loading <Html5Video> duration with src="+Z,{retries:l??void 0,timeoutInMilliseconds:u??void 0}),{current:C}=b,j=()=>{C!=null&&C.duration&&o(Z,C.duration),M(R)};return C!=null&&C.duration?(o(Z,C.duration),M(R)):C==null||C.addEventListener("loadedmetadata",j,{once:!0}),()=>{C==null||C.removeEventListener("loadedmetadata",j),M(R)}},[Z,o,l,u,M,$]),d.jsx("video",{ref:b,disableRemotePlayback:!0,...w})},S2=c.forwardRef(b2),E2=(e,t)=>{const{startFrom:n,endAt:r,trimBefore:o,trimAfter:i,name:s,pauseWhenBuffering:a,stack:l,_remotionInternalNativeLoopPassed:u,showInTimeline:f,onAutoPlayError:p,onVideoFrame:m,...h}=e,{loop:w,...v}=e,{fps:S}=Xe(),g=Ze(),y=ms(a);if(g.isClientSideRendering)throw new Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");const{durations:x,setDurations:b}=c.useContext(Mf);if(typeof t=="string")throw new Error("string refs are not supported");if(typeof e.src!="string")throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);const k=Yr(e.src),E=c.useCallback(($,M)=>{b({type:"got-duration",durationInSeconds:M,src:$})},[b]),I=x[Cn(k)]??x[Cn(e.src)];Hl({startFrom:n,endAt:r,trimBefore:o,trimAfter:i});const{trimBeforeValue:T,trimAfterValue:_}=Zl({startFrom:n,endAt:r,trimBefore:o,trimAfter:i});if(w&&I!==void 0){if(!Number.isFinite(I))return d.jsx(Ia,{...v,ref:t,stack:l,_remotionInternalNativeLoopPassed:!0});const $=I*S;return d.jsx(Bl,{durationInFrames:Vl({trimAfter:_,mediaDurationInFrames:$,playbackRate:e.playbackRate??1,trimBefore:T}),layout:"none",name:s,showInTimeline:!1,children:d.jsx(Ia,{...v,ref:t,stack:l,_remotionInternalNativeLoopPassed:!0})})}return typeof T<"u"||typeof _<"u"?d.jsx(dt,{layout:"none",from:0-(T??0),showInTimeline:!1,durationInFrames:_===void 0?void 0:_/(e.playbackRate??1),name:s,children:d.jsx(Ia,{pauseWhenBuffering:y,onVideoFrame:m,...h,ref:t,stack:l})}):(Ul({playbackRate:e.playbackRate,preservePitch:e.preservePitch,volume:e.volume},"Html5Video"),g.isRendering?d.jsx(S2,{onDuration:E,onVideoFrame:m??null,...h,ref:t}):d.jsx(Hf,{onlyWarnForMediaSeekingError:!1,...h,ref:t,onVideoFrame:m??null,pauseWhenBuffering:y,onDuration:E,_remotionInternalStack:l??null,_remotionInternalNativeLoopPassed:u??!1,showInTimeline:f??!0,onAutoPlayError:p??void 0}))},Ia=c.forwardRef(E2);St(Ia);zS();var k2={},C2=new Proxy(k2,{get(e,t){return t==="Bundling"||t==="Rendering"||t==="Log"||t==="Puppeteer"||t==="Output"?C2:()=>{console.warn("⚠️ The CLI configuration has been extracted from Remotion Core."),console.warn("Update the import from the config file:"),console.warn(),console.warn("- Delete:"),console.warn('import {Config} from "remotion";'),console.warn("+ Replace:"),console.warn('import {Config} from "@remotion/cli/config";'),console.warn(),console.warn("For more information, see https://www.remotion.dev/docs/4-0-migration."),process.exit(1)}}});dt.displayName="Sequence";St(dt);AS(dt);St(Qa);St(eS);typeof window<"u"&&(window.remotion_renderReady=!1,window.remotion_delayRenderTimeouts||(window.remotion_delayRenderTimeouts={}),window.remotion_delayRenderHandles=[]);var I2={"style.transformOrigin":{type:"transform-origin",step:1,default:"50% 50%",description:"Transform origin"},"style.translate":{type:"translate",step:1,default:"0px 0px",description:"Offset"},"style.scale":{type:"scale",max:100,step:.01,default:1,description:"Scale",defaultKeyframeOutput:"perceptual-scale"},"style.rotate":{type:"rotation-css",step:1,default:"0deg",description:"Rotation"},"style.opacity":{type:"number",min:0,max:1,step:.01,default:1,description:"Opacity",hiddenFromList:!1}},T2={"style.borderWidth":{type:"number",default:void 0,min:0,step:1,description:"Border width",hiddenFromList:!1},"style.borderStyle":{type:"enum",default:"none",description:"Border style",variants:{none:{},hidden:{},solid:{},dashed:{},dotted:{},double:{},groove:{},ridge:{},inset:{},outset:{}}},"style.borderColor":{type:"color",default:void 0,description:"Border color"}},R2={"style.backgroundColor":{type:"color",default:"transparent",description:"Color"}},_2={premountFor:{type:"number",default:0,description:"Premount For",min:0,step:1,hiddenFromList:!1,keyframable:!1},postmountFor:{type:"number",default:0,min:0,step:1,hiddenFromList:!0,keyframable:!1}},P2={..._2},F2={...I2,...R2,...T2,...P2},j2={layout:{type:"enum",default:"absolute-fill",description:"Layout",variants:{"absolute-fill":F2,none:{}}}};({...j2.layout});var M2=(e,t,n)=>{if(e){if(typeof e!="object")throw new Error(`"${t}" must be an object, but you passed a value of type ${typeof e}`);if(Array.isArray(e))throw new Error(`"${t}" must be an object, an array was passed ${n?`for composition "${n}"`:""}`)}};function $2(e,t,n){if(typeof e!="number")throw new Error(`The "${t}" prop ${n} must be a number, but you passed a value of type ${typeof e}`);if(isNaN(e))throw new TypeError(`The "${t}" prop ${n} must not be NaN, but is NaN.`);if(!Number.isFinite(e))throw new TypeError(`The "${t}" prop ${n} must be finite, but is ${e}.`);if(e%1!==0)throw new TypeError(`The "${t}" prop ${n} must be an integer, but is ${e}.`);if(e<=0)throw new TypeError(`The "${t}" prop ${n} must be positive, but got ${e}.`)}function A2(e,t){const{allowFloats:n,component:r}=t;if(typeof e>"u")throw new Error(`The "durationInFrames" prop ${r} is missing.`);if(typeof e!="number")throw new Error(`The "durationInFrames" prop ${r} must be a number, but you passed a value of type ${typeof e}`);if(e<=0)throw new TypeError(`The "durationInFrames" prop ${r} must be positive, but got ${e}.`);if(!n&&e%1!==0)throw new TypeError(`The "durationInFrames" prop ${r} must be an integer, but got ${e}.`);if(!Number.isFinite(e))throw new TypeError(`The "durationInFrames" prop ${r} must be finite, but got ${e}.`)}function N2(e,t,n){if(typeof e!="number")throw new Error(`"fps" must be a number, but you passed a value of type ${typeof e} ${t}`);if(!Number.isFinite(e))throw new Error(`"fps" must be a finite, but you passed ${e} ${t}`);if(isNaN(e))throw new Error(`"fps" must not be NaN, but got ${e} ${t}`);if(e<=0)throw new TypeError(`"fps" must be positive, but got ${e} ${t}`);if(n&&e>50)throw new TypeError("The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif")}var Gl={validateFps:N2,validateDimension:$2,validateDurationInFrames:A2,validateDefaultAndInputProps:M2};if(typeof c.createContext!="function"){const e=['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 {Player} from "@remotion/player";',"","After:",' "use client";',' import {Player} from "@remotion/player";'];throw new Error(e.join(`
|
|
79
|
+
`,aw="__remotion-studio-container",NC=()=>document.getElementById(aw),LC=J.createContext(null),zC=null,Vu=[],DC=()=>zC,OC=e=>(Vu.push(e),()=>{Vu=Vu.filter(t=>t!==e)}),Uf=c.createContext(null),VC=()=>{const e=c.useContext(Uf);return!e||e.videoEnabled===null?window.remotion_videoEnabled:e.videoEnabled},BC=()=>{const e=c.useContext(Uf);return!e||e.audioEnabled===null?window.remotion_audioEnabled:e.audioEnabled},WC=({children:e,videoEnabled:t,audioEnabled:n})=>{const r=c.useMemo(()=>({videoEnabled:t,audioEnabled:n}),[t,n]);return d.jsx(Uf.Provider,{value:r,children:e})},UC=({children:e,numberOfAudioTags:t,logLevel:n,audioLatencyHint:r,previewSampleRate:o,videoEnabled:i,audioEnabled:s,frameState:a})=>{const l=c.useMemo(()=>{let f=0;return{getNonce:()=>f++}},[]),u=c.useMemo(()=>({logLevel:n,mountTime:Date.now()}),[n]);return d.jsx(Ur.Provider,{value:u,children:d.jsx(cs.Provider,{value:l,children:d.jsx(OS,{frameState:a,children:d.jsx(WC,{videoEnabled:i,audioEnabled:s,children:d.jsx(jy,{children:d.jsx($0,{children:d.jsx(ZS,{children:d.jsx(N0,{children:d.jsx(W0,{children:d.jsx(L0,{audioLatencyHint:r,audioEnabled:s,previewSampleRate:o,children:d.jsx(z0,{numberOfAudioTags:t,children:e})})})})})})})})})})})},qm=["h264","h265","vp8","vp9","av1","mp3","aac","wav","prores","h264-mkv","h264-ts","gif"];function HC(e,t,n){if(!(typeof e>"u")){if(typeof e!="string")throw new TypeError(`The "${n}" prop ${t} must be a string, but you passed a value of type ${typeof e}.`);if(!qm.includes(e))throw new Error(`The "${n}" prop ${t} must be one of ${qm.join(", ")}, but you passed ${e}.`)}}var ZC=({calculated:e,compositionId:t,compositionFps:n,compositionHeight:r,compositionWidth:o,compositionDurationInFrames:i})=>{const s=`calculated by calculateMetadata() for the composition "${t}"`,a=`of the "<Composition />" component with the id "${t}"`,l=(e==null?void 0:e.width)??o??void 0;qa(l,"width",e!=null&&e.width?s:a);const u=(e==null?void 0:e.height)??r??void 0;qa(u,"height",e!=null&&e.height?s:a);const f=(e==null?void 0:e.fps)??n??null;Rl(f,e!=null&&e.fps?s:a);const p=(e==null?void 0:e.durationInFrames)??i??null;Tl(p,{allowFloats:!1,component:`of the "<Composition />" component with the id "${t}"`});const m=e==null?void 0:e.defaultCodec;HC(m,s,"defaultCodec");const h=e==null?void 0:e.defaultOutName,y=e==null?void 0:e.defaultVideoImageFormat,g=e==null?void 0:e.defaultPixelFormat,S=e==null?void 0:e.defaultProResProfile,v=e==null?void 0:e.defaultSampleRate;return{width:l,height:u,fps:f,durationInFrames:p,defaultCodec:m,defaultOutName:h,defaultVideoImageFormat:y,defaultPixelFormat:g,defaultProResProfile:S,defaultSampleRate:v}},Qm=({calculated:e,compositionDurationInFrames:t,compositionFps:n,compositionHeight:r,compositionId:o,compositionWidth:i,defaultProps:s,originalProps:a})=>{const l=ZC({calculated:e,compositionDurationInFrames:t,compositionFps:n,compositionHeight:r,compositionWidth:i,compositionId:o});return{metadataSource:{durationInFrames:(e==null?void 0:e.durationInFrames)===void 0?"composition":"calculate-metadata",fps:(e==null?void 0:e.fps)===void 0?"composition":"calculate-metadata",height:(e==null?void 0:e.height)===void 0?"composition":"calculate-metadata",width:(e==null?void 0:e.width)===void 0?"composition":"calculate-metadata"},videoConfig:{...l,id:o,defaultProps:nd(s??{}),props:nd((e==null?void 0:e.props)??a),defaultCodec:l.defaultCodec??null,defaultOutName:l.defaultOutName??null,defaultVideoImageFormat:l.defaultVideoImageFormat??null,defaultPixelFormat:l.defaultPixelFormat??null,defaultProResProfile:l.defaultProResProfile??null,defaultSampleRate:l.defaultSampleRate??null}}},lw=({calculateMetadata:e,signal:t,defaultProps:n,inputProps:r,compositionId:o,compositionDurationInFrames:i,compositionFps:s,compositionHeight:a,compositionWidth:l})=>{const u=e?e({defaultProps:n,props:r,abortSignal:t,compositionId:o,isRendering:bn().isRendering}):null;return u!==null&&typeof u=="object"&&"then"in u?u.then(f=>Qm({calculated:f,compositionDurationInFrames:i,compositionFps:s,compositionHeight:a,compositionWidth:l,compositionId:o,defaultProps:n,originalProps:r})):Qm({calculated:u,compositionDurationInFrames:i,compositionFps:s,compositionHeight:a,compositionWidth:l,compositionId:o,defaultProps:n,originalProps:r})},uw=e=>{const t=lw(e);return typeof t=="object"&&"then"in t?t.then(({videoConfig:n})=>n):t.videoConfig},YC=e=>{try{return{type:"success",result:lw(e)}}catch(t){return{type:"error",error:t}}},KC=e=>{try{return{type:"success",result:uw(e)}}catch(t){return{type:"error",error:t}}},XC=J.createContext(()=>{}),GC=()=>{if(bn().isRendering){const e=window.remotion_envVariables;return e?{...JSON.parse(e),NODE_ENV:"production"}:{}}return{NODE_ENV:"production"}},qC=()=>{const e=GC();window.process||(window.process={}),window.process.env||(window.process.env={}),Object.keys(e).forEach(t=>{window.process.env[t]=e[t]})},QC=J.createContext(null),JC=c.createContext({setSize:()=>{},size:{size:"auto",translation:{x:0,y:0}}}),e2=({canvasSize:e,compositionHeight:t,compositionWidth:n,previewSize:r})=>{const o=e.height/t,i=e.width/n,s=Math.min(o,i);return r==="auto"?s===0?1:s:Number(r)},t2=J.createContext(null),n2=({src:e,transparent:t,currentTime:n,toneMapped:r})=>`http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(Cn(e))}&time=${encodeURIComponent(Math.max(0,n))}&transparent=${String(t)}&toneMapped=${String(r)}`,r2=({onError:e,volume:t,playbackRate:n,src:r,muted:o,allowAmplificationDuringRender:i,transparent:s,toneMapped:a,toneFrequency:l,name:u,loopVolumeCurveBehavior:f,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,onVideoFrame:h,crossOrigin:y,audioStreamIndex:g,preservePitch:S,...v})=>{const w=xr(),x=ct(),b=Go(f),k=jl(),E=c.useContext(et),I=zr(),{registerRenderAsset:T,unregisterRenderAsset:_}=c.useContext(Zr);if(!r)throw new TypeError("No `src` was passed to <OffthreadVideo>.");const $=c.useMemo(()=>`offthreadvideo-${Hr(r)}-${E==null?void 0:E.cumulatedFrom}-${E==null?void 0:E.relativeFrom}-${E==null?void 0:E.durationInFrames}`,[r,E==null?void 0:E.cumulatedFrom,E==null?void 0:E.relativeFrom,E==null?void 0:E.durationInFrames]);if(!k)throw new Error("No video config found");const j=Kr({volume:t,frame:b,mediaVolume:1});Qo(j),c.useEffect(()=>{if(!r)throw new Error("No src passed");if(window.remotion_audioEnabled&&!o&&!(j<=0))return T({type:"video",src:Cn(r),id:$,frame:w,volume:j,mediaFrame:x,playbackRate:n,toneFrequency:l,audioStartFrame:Math.max(0,-((E==null?void 0:E.cumulatedNegativeFrom)??0)),audioStreamIndex:g}),()=>_($)},[o,r,T,$,_,j,x,w,n,l,E==null?void 0:E.cumulatedNegativeFrom,g]);const L=c.useMemo(()=>H0({frame:x,playbackRate:n||1,startFrom:-I})/k.fps,[x,I,n,k.fps]),M=c.useMemo(()=>n2({src:r,currentTime:L,transparent:s,toneMapped:a}),[a,L,r,s]),[O,Z]=c.useState(null),{delayRender:D,continueRender:R}=mn();c.useLayoutEffect(()=>{if(!window.remotion_videoEnabled)return;const V=[];Z(null);const W=new AbortController,N=D(`Fetching ${M} from server`,{retries:p??void 0,timeoutInMilliseconds:m??void 0});return(async()=>{try{const B=await fetch(M,{signal:W.signal,cache:"no-store"});if(B.status!==200){if(B.status===500){const Y=await B.json();if(Y.error){const oe=Y.error.replace(/^Error: /,"");throw new Error(oe)}}throw new Error(`Server returned status ${B.status} while fetching ${M}`)}const H=await B.blob(),z=URL.createObjectURL(H);V.push(()=>URL.revokeObjectURL(z)),Z({src:z,handle:N})}catch(B){if(B.message.includes("aborted")){R(N);return}if(W.signal.aborted){R(N);return}B.message.includes("Failed to fetch")&&(B=new Error(`Failed to fetch ${M}. This could be caused by Chrome rejecting the request because the disk space is low. Consider increasing the disk size of your environment.`,{cause:B})),e?e(B):es(B)}})(),V.push(()=>{W.signal.aborted||W.abort()}),()=>{V.forEach(B=>B())}},[M,p,m,e,R,D]);const C=c.useCallback(()=>{e?e==null||e(new Error("Failed to load image with src "+O)):es("Failed to load image with src "+O)},[O,e]),F=c.useMemo(()=>[ts,v.className].filter(Wo).join(" "),[v.className]),P=c.useCallback(V=>{h&&h(V)},[h]);return!O||!window.remotion_videoEnabled?null:(R(O.handle),d.jsx(Bf,{src:O.src,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,onImageFrame:P,...v,onError:C,className:F}))},cw=({ref:e,onVideoFrame:t})=>{c.useEffect(()=>{const{current:n}=e;if(!n||!t)return;let r=0;const o=(i,s)=>{e.current&&(t(e.current,i,s),r=e.current.requestVideoFrameCallback(o))};if(t(n),!!n.requestVideoFrameCallback)return r=n.requestVideoFrameCallback(o),()=>{r&&n.cancelVideoFrameCallback(r)}},[t,e])};class wo extends Error{constructor({message:n,src:r}){super(n);Ie(this,"src");this.name="MediaPlaybackError",this.src=r}}var o2=(e,t)=>{const n=c.useContext(Xo);if(!n)throw new Error("SharedAudioContext not found");const r=c.useRef(null),o=c.useMemo(()=>n.audioContext?Af({audioContext:n.audioContext,ref:r}):null,[n.audioContext]);(J.useInsertionEffect??J.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{o==null||o.cleanup()})},[o]);const{volume:s,muted:a,playbackRate:l,preservePitch:u,onlyWarnForMediaSeekingError:f,src:p,onDuration:m,acceptableTimeShift:h,acceptableTimeShiftInSeconds:y,toneFrequency:g,name:S,_remotionInternalNativeLoopPassed:v,_remotionInternalStack:w,style:x,pauseWhenBuffering:b,showInTimeline:k,loopVolumeCurveBehavior:E,onError:I,onAutoPlayError:T,onVideoFrame:_,crossOrigin:$,delayRenderRetries:j,delayRenderTimeoutInMilliseconds:L,allowAmplificationDuringRender:M,useWebAudioApi:O,audioStreamIndex:Z,...D}=e,R=Go(E??"repeat"),{fps:C,durationInFrames:F}=Xe(),P=c.useContext(et),V=In(),W=fs(),[N]=c.useState(()=>String(Math.random()));if(typeof h<"u")throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");const[A]=Df(),[B]=Of(),H=Kr({frame:R,volume:s,mediaVolume:A});Qo(H);const z=c.useCallback(()=>w??null,[w]);Nf({volume:s,mediaVolume:A,mediaType:"video",src:p,playbackRate:e.playbackRate??1,displayName:S??null,id:N,getStack:z,showInTimeline:k,premountDisplay:(P==null?void 0:P.premountDisplay)??null,postmountDisplay:(P==null?void 0:P.postmountDisplay)??null,loopDisplay:void 0,documentationLink:f?"https://www.remotion.dev/docs/offthreadvideo":"https://www.remotion.dev/docs/html5-video",refForOutline:r}),Y0({mediaRef:r,src:p,mediaType:"video",playbackRate:e.playbackRate??1,preservePitch:u,onlyWarnForMediaSeekingError:f,acceptableTimeshift:y??null,isPremounting:!!(P!=null&&P.premounting),isPostmounting:!!(P!=null&&P.postmounting),pauseWhenBuffering:b,onAutoPlayError:T??null}),K0({id:N,isPostmounting:!!(P!=null&&P.postmounting),isPremounting:!!(P!=null&&P.premounting),mediaRef:r,mediaType:"video",onAutoPlayError:T??null}),O0({logLevel:V,mediaRef:r,volume:H,source:o,shouldUseWebAudioApi:O??!1});const Y=P?P.relativeFrom:0,oe=P?Math.min(P.durationInFrames,F):F,ae=Yr(p),ce=Lk({actualSrc:ae,actualFrom:Y,duration:oe,fps:C});c.useImperativeHandle(t,()=>r.current,[]),c.useState(()=>gt({logLevel:V,message:`Mounting video with source = ${ce}, v=${Si}, user agent=${typeof navigator>"u"?"server":navigator.userAgent}`,tag:"video",mountTime:W})),c.useEffect(()=>{const{current:Q}=r;if(!Q)return;const q=()=>{var he;if(Q.error){if(console.error("Error occurred in video",Q==null?void 0:Q.error),I){const Ce=new wo({message:`Code ${Q.error.code}: ${Q.error.message}`,src:p});I(Ce);return}throw new wo({message:`The browser threw an error while playing the video ${p}: Code ${Q.error.code} - ${(he=Q==null?void 0:Q.error)==null?void 0:he.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,src:p})}else{if(I){const Ce=new wo({message:`The browser threw an error while playing the video ${p}`,src:p});I(Ce);return}throw new wo({message:"The browser threw an error while playing the video",src:p})}};return Q.addEventListener("error",q,{once:!0}),()=>{Q.removeEventListener("error",q)}},[I,p]);const se=c.useRef(m);se.current=m,cw({ref:r,onVideoFrame:_}),c.useEffect(()=>{var he;const{current:Q}=r;if(!Q)return;if(Q.duration){(he=se.current)==null||he.call(se,p,Q.duration);return}const q=()=>{var Ce;(Ce=se.current)==null||Ce.call(se,p,Q.duration)};return Q.addEventListener("loadedmetadata",q),()=>{Q.removeEventListener("loadedmetadata",q)}},[p]),c.useEffect(()=>{const{current:Q}=r;Q&&(Kl()?Q.preload="metadata":Q.preload="auto")},[]);const G=c.useMemo(()=>({...x}),[x]),ee=$f({crossOrigin:$,requestsVideoFrame:!!_,isClientSideRendering:!1});return d.jsx("video",{...D,ref:r,muted:a||B||H<=0,playsInline:!0,src:ce,loop:v,style:G,disableRemotePlayback:!0,crossOrigin:ee,controls:!1})},Hf=c.forwardRef(o2),Zf=e=>{const{startFrom:t,endAt:n,trimBefore:r,trimAfter:o,name:i,pauseWhenBuffering:s,stack:a,showInTimeline:l,...u}=e,f=Ze(),p=ms(s);if(f.isClientSideRendering)throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");const m=c.useCallback(()=>{},[]);if(typeof e.src!="string")throw new TypeError(`The \`<OffthreadVideo>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);Hl({startFrom:t,endAt:n,trimBefore:r,trimAfter:o});const{trimBeforeValue:h,trimAfterValue:y}=Zl({startFrom:t,endAt:n,trimBefore:r,trimAfter:o});if(typeof h<"u"||typeof y<"u")return d.jsx(dt,{layout:"none",from:0-(h??0),showInTimeline:!1,durationInFrames:y,name:i,children:d.jsx(Zf,{pauseWhenBuffering:p,...u,trimAfter:void 0,name:void 0,showInTimeline:l,trimBefore:void 0,stack:void 0,startFrom:void 0,endAt:void 0})});if(Ul(e,"Video"),f.isRendering)return d.jsx(r2,{pauseWhenBuffering:p,...u,trimAfter:void 0,name:void 0,showInTimeline:l,trimBefore:void 0,stack:void 0,startFrom:void 0,endAt:void 0});const{transparent:g,toneMapped:S,onAutoPlayError:v,onVideoFrame:w,crossOrigin:x,delayRenderRetries:b,delayRenderTimeoutInMilliseconds:k,...E}=u;return d.jsx(Hf,{_remotionInternalStack:a??null,onDuration:m,onlyWarnForMediaSeekingError:!0,pauseWhenBuffering:p,showInTimeline:l??!0,onAutoPlayError:v??void 0,onVideoFrame:w??null,crossOrigin:x,...E,_remotionInternalNativeLoopPassed:!1})},dw=({src:e,acceptableTimeShiftInSeconds:t,allowAmplificationDuringRender:n,audioStreamIndex:r,crossOrigin:o,delayRenderRetries:i,delayRenderTimeoutInMilliseconds:s,loopVolumeCurveBehavior:a,muted:l,name:u,onAutoPlayError:f,onError:p,onVideoFrame:m,pauseWhenBuffering:h,playbackRate:y,preservePitch:g,showInTimeline:S,style:v,toneFrequency:w,toneMapped:x,transparent:b,trimAfter:k,trimBefore:E,useWebAudioApi:I,volume:T,_remotionInternalNativeLoopPassed:_,endAt:$,stack:j,startFrom:L,imageFormat:M,...O})=>{if(M)throw new TypeError("The `<OffthreadVideo>` tag does no longer accept `imageFormat`. Use the `transparent` prop if you want to render a transparent video.");return d.jsx(Zf,{acceptableTimeShiftInSeconds:t,allowAmplificationDuringRender:n??!0,audioStreamIndex:r??0,crossOrigin:o,delayRenderRetries:i,delayRenderTimeoutInMilliseconds:s,loopVolumeCurveBehavior:a??"repeat",muted:l??!1,name:u,onAutoPlayError:f??null,onError:p,onVideoFrame:m,pauseWhenBuffering:ms(h),playbackRate:y??1,preservePitch:g,toneFrequency:w??1,showInTimeline:S??!0,src:e,stack:j,startFrom:L,_remotionInternalNativeLoopPassed:_??!1,endAt:$,style:v,toneMapped:x??!0,transparent:b??!1,trimAfter:k,trimBefore:E,useWebAudioApi:I??!1,volume:T,...O})};St(dw);var i2="remotion_staticFilesChanged";function s2(){const e=J.useContext(Bo),t=J.useContext(Ho),n=J.useContext(Uo),r=J.useContext(et),o=J.useContext(cs),i=J.useContext(Wr),s=J.useContext(Wl),a=J.useContext(_l),l=J.useContext(Zr),u=J.useContext(Yo),f=J.useContext($l),p=J.useContext(Nl),m=J.useContext(qo),h=J.useContext(Ur);return c.useMemo(()=>({compositionManagerCtx:e,timelineContext:t,setTimelineContext:n,sequenceContext:r,nonceContext:o,canUseRemotionHooksContext:i,preloadContext:s,resolveCompositionContext:a,renderAssetManagerContext:l,sequenceManagerContext:u,sequenceManagerRefContext:f,visualModePropStatusesRefContext:p,bufferManagerContext:m,logLevelContext:h}),[e,o,r,n,t,i,s,a,l,u,f,p,m,h])}var a2=e=>{const{children:t,contexts:n}=e;return d.jsx(Ur.Provider,{value:n.logLevelContext,children:d.jsx(Wr.Provider,{value:n.canUseRemotionHooksContext,children:d.jsx(cs.Provider,{value:n.nonceContext,children:d.jsx(Wl.Provider,{value:n.preloadContext,children:d.jsx(Bo.Provider,{value:n.compositionManagerCtx,children:d.jsx($l.Provider,{value:n.sequenceManagerRefContext,children:d.jsx(Yo.Provider,{value:n.sequenceManagerContext,children:d.jsx(Nl.Provider,{value:n.visualModePropStatusesRefContext,children:d.jsx(Zr.Provider,{value:n.renderAssetManagerContext,children:d.jsx(_l.Provider,{value:n.resolveCompositionContext,children:d.jsx(Ho.Provider,{value:n.timelineContext,children:d.jsx(Uo.Provider,{value:n.setTimelineContext,children:d.jsx(et.Provider,{value:n.sequenceContext,children:d.jsx(qo.Provider,{value:n.bufferManagerContext,children:t})})})})})})})})})})})})})})},l2=c.createRef(),ie={MaxMediaCacheSizeContext:LC,useUnsafeVideoConfig:jl,useFrameForVolumeProp:Go,useTimelinePosition:xr,useAbsoluteTimelinePosition:Zy,evaluateVolume:Kr,getAbsoluteSrc:Cn,getAnimatedImageDurationInSeconds:jC,getAssetDisplayName:V0,Timeline:id,validateMediaTrimProps:Hl,validateMediaProps:Ul,resolveTrimProps:Zl,VideoForPreview:Hf,CompositionManager:Bo,CompositionSetters:us,VisualModePropStatusesContext:Al,VisualModePropStatusesRefContext:Nl,VisualModeDragOverridesContext:Ll,VisualModeSettersContext:t0,SequenceManager:Yo,SequenceManagerRefContext:$l,SequenceStackTracesUpdateContext:XC,baseSchema:Bn,sequenceSchema:Lo,SequenceWithoutSchema:k0,sequenceStyleSchema:qy,sequenceVisualStyleSchema:VS,sequencePremountSchema:Gy,textSchema:Ml,transformSchema:Tn,premountSchema:Zo,flattenActiveSchema:Ff,getFlatSchemaWithAllKeys:jf,RemotionRootContexts:UC,CompositionManagerProvider:MC,useVideo:Fl,getRoot:DC,useMediaVolumeState:Df,usePlayerMutedState:Of,useMediaInTimeline:Nf,useLazyComponent:Ny,truthy:Wo,SequenceContext:et,PremountContext:r0,usePremounting:hs,useRemotionContexts:s2,RemotionContextProvider:a2,CSSUtils:sw,setupEnvVariables:qC,MediaVolumeContext:Lf,SetMediaVolumeContext:zf,getRemotionEnvironment:bn,SharedAudioContext:Xo,SharedAudioContextProvider:L0,SharedAudioTagsContext:Yl,SharedAudioTagsContextProvider:z0,invalidCompositionErrorMessage:PS,invalidFolderNameErrorMessage:Jb,calculateMediaDuration:Vl,isCompositionIdValid:zy,isFolderNameValid:Ry,getPreviewDomElement:NC,compositionsRef:iw,portalNode:rd,waitForRoot:OC,SetTimelineContext:Uo,CanUseRemotionHooksProvider:Jc,CanUseRemotionHooks:Wr,PrefetchProvider:$0,DurationsContextProvider:N0,IsPlayerContextProvider:rS,useIsPlayer:vf,EditorPropsProvider:jy,EditorPropsContext:yf,usePreload:Yr,NonceContext:cs,resolveVideoConfig:uw,resolveVideoConfigOrCatch:KC,resolveVideoConfigWithMetadataOrCatch:YC,ResolveCompositionContext:_l,useResolvedVideoConfig:wf,resolveCompositionsRef:pS,REMOTION_STUDIO_CONTAINER_ELEMENT:aw,RenderAssetManager:Zr,persistCurrentFrame:Vy,usePlaybackRate:kf,useTimelineContext:wr,useTimelineSetFrame:Yy,isIosSafari:Kl,WATCH_REMOTION_STATIC_FILES:i2,addSequenceStackTraces:St,useMediaStartsAt:zr,BufferingProvider:W0,BufferingContextReact:qo,getComponentsToAddStacksTo:$S,getSequenceComponent:NS,getSingleChildComponent:LS,CurrentScaleContext:QC,PixelDensityContext:t2,PreviewSizeContext:JC,calculateScale:e2,validateRenderAsset:j0,Log:rt,LogLevelContext:Ur,useLogLevel:In,playbackLogging:gt,timeValueRef:fS,compositionSelectorRef:l2,RemotionEnvironmentContext:My,warnAboutTooHighVolume:Qo,AudioForPreview:X0,OBJECTFIT_CONTAIN_CLASS_NAME:ts,InnerOffthreadVideo:Zf,useBasicMediaInTimeline:B0,getInputPropsOverride:Fy,setInputPropsOverride:uS,useVideoEnabled:VC,useAudioEnabled:BC,useIsPlayerBuffering:U0,TimelinePosition:id,DelayRenderContextType:Ay,TimelineContext:Ho,PlaybackRateContext:bf,AbsoluteTimeContext:Sf,RenderAssetManagerProvider:xk,getEffectiveVisualModeValue:g0,CompositionRenderErrorContext:Iy,useEffectChainState:xs,createEffectChainState:R0,cleanupEffectChainState:ad,runEffectChain:ws,useMemoizedEffects:ys,useMemoizedEffectDefinitions:vs,createEffect:vk,createWebGLContextError:tk,createWebGL2ContextError:T0,computeEffectiveSchemaValuesDotNotation:b0,interpolateKeyframedStatus:gs,makeStaticDragOverride:BE,makeKeyframedDragOverride:WE,resolveDragOverrideValue:Dl,getStaticDragOverrideValue:UE,OverrideIdsToNodePathsGettersContext:Pf,OverrideIdsToNodePathsSettersContext:zE,findPropsToDelete:w0,makeSequencePropsSubscriptionKey:Fn,getPropStatusesCtx:y0,getEffectPropStatusesCtx:v0,hiddenField:Cf,durationInFramesField:Tf,freezeField:Rf,fromField:Jy},fw=e=>J.Children.toArray(e).reduce((n,r)=>r.type===J.Fragment?n.concat(fw(r.props.children)):(n.push(r),n),[]),u2={durationInFrames:Kn.baseSchema.durationInFrames,name:Kn.sequenceSchema.name,hidden:Kn.sequenceSchema.hidden,showInTimeline:Kn.sequenceSchema.showInTimeline,freeze:Kn.baseSchema.freeze,trimBefore:Kn.sequenceSchema.trimBefore,layout:Kn.sequenceSchema.layout},c2=c.forwardRef(({offset:e=0,className:t="",stack:n=null,_remotionInternalRender:r=null,...o},i)=>(KS(),r?r({...o,offset:e,className:t||void 0,stack:n},i):d.jsx(n0,{children:o.children}))),pw=Kn.withSchema({Component:c2,componentName:"<Series.Sequence>",componentIdentity:"dev.remotion.remotion.Series.Sequence",schema:u2,supportsEffects:!1}),d2=k0,Jm=({durationInFrames:e,offset:t,index:n,childrenLength:r})=>{const o=`index = ${n}, duration = ${e}`;(n!==r-1||e!==1/0)&&Tl(e,{component:"of a <Series.Sequence /> component",allowFloats:!0});const i=t??0;if(Number.isNaN(i))throw new TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${o}).`);if(!Number.isFinite(i))throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${i} (${o}).`);if(i%1!==0)throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${i} (${o}).`);return i},f2=e=>{const t=c.useMemo(()=>{const n=fw(e.children),r=(o,i)=>{if(o===n.length)return null;const a=n[o];if(typeof a=="string"){if(a.trim()==="")return r(o+1,i);throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but you passed a string "${a}"`)}if(a.type!==pw)throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${a} instead`);const l=a;return Jm({durationInFrames:l.props.durationInFrames,offset:l.props.offset,index:o,childrenLength:n.length}),J.cloneElement(l,{_remotionInternalRender:(u,f)=>{const p=u.durationInFrames,{durationInFrames:m,children:h,offset:y,controls:g,stack:S,from:v,name:w,...x}=u,b=Jm({durationInFrames:p,offset:y,index:o,childrenLength:n.length}),k=i+b,E=i+p+b;return d.jsxs(d.Fragment,{children:[d.jsx(d2,{ref:f,name:w||"<Series.Sequence>",_remotionInternalDocumentationLink:w?void 0:"https://www.remotion.dev/docs/series",_remotionInternalStack:S??void 0,controls:g??void 0,from:k,durationInFrames:p,...x,children:d.jsx(n0,{children:h})}),r(o+1,E)]})}})};return r(0,0)},[e.children]);return d.jsx(YS,{children:d.jsx(dt,{layout:"none",name:"<Series>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/series",...e,children:t})})},p2=Object.assign(Wn({Component:f2,componentName:"<Series>",componentIdentity:"dev.remotion.remotion.Series",schema:HS,supportsEffects:!1}),{Sequence:pw});St(p2);var m2={"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";"},eh={},h2=e=>{eh[e]||(console.warn(e),eh[e]=!0)},g2=e=>{for(const t of Object.keys(m2))if(e.includes(t))return{containsHex:!0,hexCode:t};return{containsHex:!1}},dd=e=>e.startsWith("/")?dd(e.substring(1)):e,v2=e=>{if(typeof window<"u"&&window.remotion_staticBase){if(e.startsWith(window.remotion_staticBase))throw new Error(`The value "${e}" is already prefixed with the static base ${window.remotion_staticBase}. You don't need to call staticFile() on it.`);return`${window.remotion_staticBase}/${dd(e)}`}return`/${dd(e)}`},y2=e=>e.split("/").map(o=>encodeURIComponent(o)).join("/"),mw=e=>{if(e===null)throw new TypeError("null was passed to staticFile()");if(typeof e>"u")throw new TypeError("undefined was passed to staticFile()");if(e.startsWith("http://")||e.startsWith("https://"))throw new TypeError(`staticFile() does not support remote URLs - got "${e}". Instead, pass the URL without wrapping it in staticFile(). See: https://remotion.dev/docs/staticfile-remote-urls`);if(e.startsWith("..")||e.startsWith("./"))throw new TypeError(`staticFile() does not support relative paths - got "${e}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);if(e.startsWith("/Users")||e.startsWith("/home")||e.startsWith("/tmp")||e.startsWith("/etc")||e.startsWith("/opt")||e.startsWith("/var")||e.startsWith("C:")||e.startsWith("D:")||e.startsWith("E:"))throw new TypeError(`staticFile() does not support absolute paths - got "${e}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);if(e.startsWith("public/"))throw new TypeError(`Do not include the public/ prefix when using staticFile() - got "${e}". See: https://remotion.dev/docs/staticfile-relative-paths`);const t=g2(e);t.containsHex&&h2(`WARNING: You seem to pass an already encoded path (path contains ${t.hexCode}). Since Remotion 4.0, the encoding is done by staticFile() itself. You may want to remove a encodeURIComponent() wrapping.`);const n=y2(e),r=v2(n);return r.startsWith("/")?r:`/${r}`},w2=e=>{const t={...e,durationInFrames:1,fps:1};return J.createElement(Qa,t)};St(w2);var th=e=>Math.round(e*1e5)/1e5,Bu=({element:e,desiredTime:t,logLevel:n,mountTime:r})=>{if(nl(e.currentTime,t))return{wait:Promise.resolve(t),cancel:()=>{}};ka({logLevel:n,mediaRef:e,time:t,why:"Seeking during rendering",mountTime:r});let o,i=null;const s=new Promise(l=>{o=e.requestVideoFrameCallback((u,f)=>{const p=f.expectedDisplayTime-u;if(p<=0){l(f.mediaTime);return}setTimeout(()=>{l(f.mediaTime)},p+150)})}),a=new Promise(l=>{const u=()=>{l()};e.addEventListener("seeked",u,{once:!0}),i=()=>{e.removeEventListener("seeked",u)}});return{wait:Promise.all([s,a]).then(([l])=>l),cancel:()=>{i==null||i(),e.cancelVideoFrameCallback(o)}}},x2=({element:e,desiredTime:t,fps:n,logLevel:r,mountTime:o})=>{const i=1/n/2;let s=()=>{};return Number.isFinite(e.duration)&&e.currentTime>=e.duration&&t>=e.duration?{prom:Promise.resolve(),cancel:()=>{}}:{prom:new Promise((l,u)=>{const f=Bu({element:e,desiredTime:t+i,logLevel:r,mountTime:o});f.wait.then(p=>{if(Math.abs(t-p)<=i)return l();const h=t>p?1:-1,y=Bu({element:e,desiredTime:p+i*h,logLevel:r,mountTime:o});s=y.cancel,y.wait.then(g=>{const S=Math.abs(t-g);if(th(S)<=th(i))return l();const v=Bu({element:e,desiredTime:t+i,logLevel:r,mountTime:o});return s=v.cancel,v.wait.then(()=>{l()}).catch(w=>{u(w)})}).catch(g=>{u(g)})}),s=f.cancel}),cancel:()=>{s()}}},b2=({onError:e,volume:t,allowAmplificationDuringRender:n,playbackRate:r,onDuration:o,toneFrequency:i,name:s,acceptableTimeShiftInSeconds:a,delayRenderRetries:l,delayRenderTimeoutInMilliseconds:u,loopVolumeCurveBehavior:f,audioStreamIndex:p,onVideoFrame:m,preservePitch:h,...y},g)=>{const S=xr(),v=ct(),w=Go(f??"repeat"),x=jl(),b=c.useRef(null),k=c.useContext(et),E=zr(),I=Ze(),T=In(),_=fs(),{delayRender:$,continueRender:j}=mn(),{registerRenderAsset:L,unregisterRenderAsset:M}=c.useContext(Zr),O=c.useMemo(()=>`video-${Hr(y.src??"")}-${k==null?void 0:k.cumulatedFrom}-${k==null?void 0:k.relativeFrom}-${k==null?void 0:k.durationInFrames}`,[y.src,k==null?void 0:k.cumulatedFrom,k==null?void 0:k.relativeFrom,k==null?void 0:k.durationInFrames]);if(!x)throw new Error("No video config found");const Z=Kr({volume:t,frame:w,mediaVolume:1});Qo(Z),c.useEffect(()=>{if(!y.src)throw new Error("No src passed");if(!y.muted&&!(Z<=0)&&window.remotion_audioEnabled)return L({type:"video",src:Cn(y.src),id:O,frame:S,volume:Z,mediaFrame:v,playbackRate:r??1,toneFrequency:i??1,audioStartFrame:Math.max(0,-((k==null?void 0:k.cumulatedNegativeFrom)??0)),audioStreamIndex:p??0}),()=>M(O)},[y.muted,y.src,L,O,M,Z,v,S,r,i,k==null?void 0:k.cumulatedNegativeFrom,p]),c.useImperativeHandle(g,()=>b.current,[]),cw({ref:b,onVideoFrame:m}),c.useEffect(()=>{var N,A;if(!window.remotion_videoEnabled)return;const{current:R}=b;if(!R)return;const C=Z0({frame:v,playbackRate:r||1,startFrom:-E,fps:x.fps}),F=$(`Rendering <Html5Video /> with src="${y.src}" at time ${C}`,{retries:l??void 0,timeoutInMilliseconds:u??void 0});if(((A=(N=window.process)==null?void 0:N.env)==null?void 0:A.NODE_ENV)==="test"){j(F);return}if(nl(R.currentTime,C)){if(R.readyState>=2){j(F);return}const B=()=>{j(F)};return R.addEventListener("loadeddata",B,{once:!0}),()=>{R.removeEventListener("loadeddata",B)}}const P=()=>{j(F)},V=x2({element:R,desiredTime:C,fps:x.fps,logLevel:T,mountTime:_});V.prom.then(()=>{j(F)}),R.addEventListener("ended",P,{once:!0});const W=()=>{var B;if(R!=null&&R.error){if(console.error("Error occurred in video",R==null?void 0:R.error),e)return;throw new wo({message:`The browser threw an error while playing the video ${y.src}: Code ${R.error.code} - ${(B=R==null?void 0:R.error)==null?void 0:B.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,src:y.src})}else throw new wo({message:"The browser threw an error",src:y.src})};return R.addEventListener("error",W,{once:!0}),()=>{V.cancel(),R.removeEventListener("ended",P),R.removeEventListener("error",W),j(F)}},[w,y.src,r,x.fps,v,E,e,l,u,T,_,j,$]);const{src:D}=y;return I.isRendering&&c.useLayoutEffect(()=>{var P,V;if(((V=(P=window.process)==null?void 0:P.env)==null?void 0:V.NODE_ENV)==="test")return;const R=$("Loading <Html5Video> duration with src="+D,{retries:l??void 0,timeoutInMilliseconds:u??void 0}),{current:C}=b,F=()=>{C!=null&&C.duration&&o(D,C.duration),j(R)};return C!=null&&C.duration?(o(D,C.duration),j(R)):C==null||C.addEventListener("loadedmetadata",F,{once:!0}),()=>{C==null||C.removeEventListener("loadedmetadata",F),j(R)}},[D,o,l,u,j,$]),d.jsx("video",{ref:b,disableRemotePlayback:!0,...y})},S2=c.forwardRef(b2),E2=(e,t)=>{const{startFrom:n,endAt:r,trimBefore:o,trimAfter:i,name:s,pauseWhenBuffering:a,stack:l,_remotionInternalNativeLoopPassed:u,showInTimeline:f,onAutoPlayError:p,onVideoFrame:m,...h}=e,{loop:y,...g}=e,{fps:S}=Xe(),v=Ze(),w=ms(a);if(v.isClientSideRendering)throw new Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");const{durations:x,setDurations:b}=c.useContext(Mf);if(typeof t=="string")throw new Error("string refs are not supported");if(typeof e.src!="string")throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);const k=Yr(e.src),E=c.useCallback(($,j)=>{b({type:"got-duration",durationInSeconds:j,src:$})},[b]),I=x[Cn(k)]??x[Cn(e.src)];Hl({startFrom:n,endAt:r,trimBefore:o,trimAfter:i});const{trimBeforeValue:T,trimAfterValue:_}=Zl({startFrom:n,endAt:r,trimBefore:o,trimAfter:i});if(y&&I!==void 0){if(!Number.isFinite(I))return d.jsx(Ia,{...g,ref:t,stack:l,_remotionInternalNativeLoopPassed:!0});const $=I*S;return d.jsx(Bl,{durationInFrames:Vl({trimAfter:_,mediaDurationInFrames:$,playbackRate:e.playbackRate??1,trimBefore:T}),layout:"none",name:s,showInTimeline:!1,children:d.jsx(Ia,{...g,ref:t,stack:l,_remotionInternalNativeLoopPassed:!0})})}return typeof T<"u"||typeof _<"u"?d.jsx(dt,{layout:"none",from:0-(T??0),showInTimeline:!1,durationInFrames:_===void 0?void 0:_/(e.playbackRate??1),name:s,children:d.jsx(Ia,{pauseWhenBuffering:w,onVideoFrame:m,...h,ref:t,stack:l})}):(Ul({playbackRate:e.playbackRate,preservePitch:e.preservePitch,volume:e.volume},"Html5Video"),v.isRendering?d.jsx(S2,{onDuration:E,onVideoFrame:m??null,...h,ref:t}):d.jsx(Hf,{onlyWarnForMediaSeekingError:!1,...h,ref:t,onVideoFrame:m??null,pauseWhenBuffering:w,onDuration:E,_remotionInternalStack:l??null,_remotionInternalNativeLoopPassed:u??!1,showInTimeline:f??!0,onAutoPlayError:p??void 0}))},Ia=c.forwardRef(E2);St(Ia);zS();var k2={},C2=new Proxy(k2,{get(e,t){return t==="Bundling"||t==="Rendering"||t==="Log"||t==="Puppeteer"||t==="Output"?C2:()=>{console.warn("⚠️ The CLI configuration has been extracted from Remotion Core."),console.warn("Update the import from the config file:"),console.warn(),console.warn("- Delete:"),console.warn('import {Config} from "remotion";'),console.warn("+ Replace:"),console.warn('import {Config} from "@remotion/cli/config";'),console.warn(),console.warn("For more information, see https://www.remotion.dev/docs/4-0-migration."),process.exit(1)}}});dt.displayName="Sequence";St(dt);AS(dt);St(Qa);St(eS);typeof window<"u"&&(window.remotion_renderReady=!1,window.remotion_delayRenderTimeouts||(window.remotion_delayRenderTimeouts={}),window.remotion_delayRenderHandles=[]);var I2={"style.transformOrigin":{type:"transform-origin",step:1,default:"50% 50%",description:"Transform origin"},"style.translate":{type:"translate",step:1,default:"0px 0px",description:"Offset"},"style.scale":{type:"scale",max:100,step:.01,default:1,description:"Scale",defaultKeyframeOutput:"perceptual-scale"},"style.rotate":{type:"rotation-css",step:1,default:"0deg",description:"Rotation"},"style.opacity":{type:"number",min:0,max:1,step:.01,default:1,description:"Opacity",hiddenFromList:!1}},T2={"style.borderWidth":{type:"number",default:void 0,min:0,step:1,description:"Border width",hiddenFromList:!1},"style.borderStyle":{type:"enum",default:"none",description:"Border style",variants:{none:{},hidden:{},solid:{},dashed:{},dotted:{},double:{},groove:{},ridge:{},inset:{},outset:{}}},"style.borderColor":{type:"color",default:void 0,description:"Border color"}},R2={"style.backgroundColor":{type:"color",default:"transparent",description:"Color"}},_2={premountFor:{type:"number",default:0,description:"Premount For",min:0,step:1,hiddenFromList:!1,keyframable:!1},postmountFor:{type:"number",default:0,min:0,step:1,hiddenFromList:!0,keyframable:!1}},P2={..._2},F2={...I2,...R2,...T2,...P2},j2={layout:{type:"enum",default:"absolute-fill",description:"Layout",variants:{"absolute-fill":F2,none:{}}}};({...j2.layout});var M2=(e,t,n)=>{if(e){if(typeof e!="object")throw new Error(`"${t}" must be an object, but you passed a value of type ${typeof e}`);if(Array.isArray(e))throw new Error(`"${t}" must be an object, an array was passed ${n?`for composition "${n}"`:""}`)}};function $2(e,t,n){if(typeof e!="number")throw new Error(`The "${t}" prop ${n} must be a number, but you passed a value of type ${typeof e}`);if(isNaN(e))throw new TypeError(`The "${t}" prop ${n} must not be NaN, but is NaN.`);if(!Number.isFinite(e))throw new TypeError(`The "${t}" prop ${n} must be finite, but is ${e}.`);if(e%1!==0)throw new TypeError(`The "${t}" prop ${n} must be an integer, but is ${e}.`);if(e<=0)throw new TypeError(`The "${t}" prop ${n} must be positive, but got ${e}.`)}function A2(e,t){const{allowFloats:n,component:r}=t;if(typeof e>"u")throw new Error(`The "durationInFrames" prop ${r} is missing.`);if(typeof e!="number")throw new Error(`The "durationInFrames" prop ${r} must be a number, but you passed a value of type ${typeof e}`);if(e<=0)throw new TypeError(`The "durationInFrames" prop ${r} must be positive, but got ${e}.`);if(!n&&e%1!==0)throw new TypeError(`The "durationInFrames" prop ${r} must be an integer, but got ${e}.`);if(!Number.isFinite(e))throw new TypeError(`The "durationInFrames" prop ${r} must be finite, but got ${e}.`)}function N2(e,t,n){if(typeof e!="number")throw new Error(`"fps" must be a number, but you passed a value of type ${typeof e} ${t}`);if(!Number.isFinite(e))throw new Error(`"fps" must be a finite, but you passed ${e} ${t}`);if(isNaN(e))throw new Error(`"fps" must not be NaN, but got ${e} ${t}`);if(e<=0)throw new TypeError(`"fps" must be positive, but got ${e} ${t}`);if(n&&e>50)throw new TypeError("The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif")}var Gl={validateFps:N2,validateDimension:$2,validateDurationInFrames:A2,validateDefaultAndInputProps:M2};if(typeof c.createContext!="function"){const e=['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 {Player} from "@remotion/player";',"","After:",' "use client";',' import {Player} from "@remotion/player";'];throw new Error(e.join(`
|
|
80
80
|
`))}var lt=25,fd=16,L2=()=>d.jsx("svg",{width:lt,height:lt,viewBox:"0 0 25 25",fill:"none",children:d.jsx("path",{d:"M8 6.375C7.40904 8.17576 7.06921 10.2486 7.01438 12.3871C6.95955 14.5255 7.19163 16.6547 7.6875 18.5625C9.95364 18.2995 12.116 17.6164 14.009 16.5655C15.902 15.5147 17.4755 14.124 18.6088 12.5C17.5158 10.8949 15.9949 9.51103 14.1585 8.45082C12.3222 7.3906 10.2174 6.68116 8 6.375Z",fill:"white",stroke:"white",strokeWidth:"6.25",strokeLinejoin:"round"})}),z2=()=>d.jsxs("svg",{viewBox:"0 0 100 100",width:lt,height:lt,children:[d.jsx("rect",{x:"25",y:"20",width:"20",height:"60",fill:"#fff",ry:"5",rx:"5"}),d.jsx("rect",{x:"55",y:"20",width:"20",height:"60",fill:"#fff",ry:"5",rx:"5"})]}),D2=({isFullscreen:e})=>{const r=e?0:3,o=e?6*1.6:6/2,i=e?6*1.6:6*2;return d.jsxs("svg",{viewBox:"0 0 32 32",height:fd,width:fd,children:[d.jsx("path",{d:`
|
|
81
81
|
M ${r} ${i}
|
|
82
82
|
L ${o} ${o}
|
|
@@ -106,7 +106,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
106
106
|
.${nh} {
|
|
107
107
|
animation: ${rh} 1s linear infinite;
|
|
108
108
|
}
|
|
109
|
-
`}),d.jsx("div",{style:t,children:d.jsx("svg",{viewBox:e==="player"?"0 0 22 22":"0 0 18 18",style:t,className:nh,children:d.jsx("path",{d:e==="player"?"M 11 4 A 7 7 0 0 1 15.1145 16.66312":"M 9 2 A 7 7 0 0 1 13.1145 14.66312",stroke:"white",strokeLinecap:"round",fill:"none",strokeWidth:3})})})]})},H2=({currentSize:e,width:t,height:n,compositionWidth:r,compositionHeight:o})=>t!==void 0&&n===void 0?{aspectRatio:[r,o].join("/")}:n!==void 0&&t===void 0?{aspectRatio:[r,o].join("/")}:e?{width:r,height:o}:{width:r,height:o},hw=({previewSize:e,compositionWidth:t,compositionHeight:n,canvasSize:r})=>{const o=ie.calculateScale({canvasSize:r,compositionHeight:n,compositionWidth:t,previewSize:e}),i=0-(1-o)/2,s=i*t,a=i*n,l=t*o,u=n*o,f=r.width/2-l/2,p=r.height/2-u/2;return{centerX:f,centerY:p,xCorrection:s,yCorrection:a,scale:o}},gw=({config:e,style:t,canvasSize:n,overflowVisible:r,layout:o})=>e?{position:"relative",overflow:r?"visible":"hidden",...H2({compositionHeight:e.height,compositionWidth:e.width,currentSize:n,height:t==null?void 0:t.height,width:t==null?void 0:t.width}),opacity:o?1:0,...t}:{},vw=({config:e,layout:t,scale:n,overflowVisible:r})=>e?t?{position:"absolute",width:e.width,height:e.height,display:"flex",transform:`scale(${n})`,marginLeft:t.xCorrection,marginTop:t.yCorrection,overflow:r?"visible":"hidden"}:{position:"absolute",width:e.width,height:e.height,display:"flex",transform:`scale(${n})`,overflow:r?"visible":"hidden"}:{},yw=({layout:e,scale:t,config:n,overflowVisible:r})=>{if(!n)return{};if(!e)return{width:n.width*t,height:n.height*t,display:"flex",flexDirection:"column",position:"absolute",overflow:r?"visible":"hidden"};const{centerX:o,centerY:i}=e;return{width:n.width*t,height:n.height*t,display:"flex",flexDirection:"column",position:"absolute",left:o,top:i,overflow:r?"visible":"hidden"}},ww=J.createContext(void 0),xw=J.createContext(void 0);class Z2{constructor(){Ie(this,"listeners",{ended:[],error:[],pause:[],play:[],ratechange:[],scalechange:[],seeked:[],timeupdate:[],frameupdate:[],fullscreenchange:[],volumechange:[],mutechange:[],waiting:[],resume:[]});Ie(this,"dispatchSeek",t=>{this.dispatchEvent("seeked",{frame:t})});Ie(this,"dispatchVolumeChange",t=>{this.dispatchEvent("volumechange",{volume:t})});Ie(this,"dispatchPause",()=>{this.dispatchEvent("pause",void 0)});Ie(this,"dispatchPlay",()=>{this.dispatchEvent("play",void 0)});Ie(this,"dispatchEnded",()=>{this.dispatchEvent("ended",void 0)});Ie(this,"dispatchRateChange",t=>{this.dispatchEvent("ratechange",{playbackRate:t})});Ie(this,"dispatchScaleChange",t=>{this.dispatchEvent("scalechange",{scale:t})});Ie(this,"dispatchError",t=>{this.dispatchEvent("error",{error:t})});Ie(this,"dispatchTimeUpdate",t=>{this.dispatchEvent("timeupdate",t)});Ie(this,"dispatchFrameUpdate",t=>{this.dispatchEvent("frameupdate",t)});Ie(this,"dispatchFullscreenChange",t=>{this.dispatchEvent("fullscreenchange",t)});Ie(this,"dispatchMuteChange",t=>{this.dispatchEvent("mutechange",t)});Ie(this,"dispatchWaiting",t=>{this.dispatchEvent("waiting",t)});Ie(this,"dispatchResume",t=>{this.dispatchEvent("resume",t)})}addEventListener(t,n){this.listeners[t].push(n)}removeEventListener(t,n){this.listeners[t]=this.listeners[t].filter(r=>r!==n)}dispatchEvent(t,n){this.listeners[t].forEach(r=>{r({detail:n})})}}class Y2{constructor(){Ie(this,"listeners",{error:[],waiting:[],resume:[]});Ie(this,"dispatchError",t=>{this.dispatchEvent("error",{error:t})});Ie(this,"dispatchWaiting",t=>{this.dispatchEvent("waiting",t)});Ie(this,"dispatchResume",t=>{this.dispatchEvent("resume",t)})}addEventListener(t,n){this.listeners[t].push(n)}removeEventListener(t,n){this.listeners[t]=this.listeners[t].filter(r=>r!==n)}dispatchEvent(t,n){this.listeners[t].forEach(r=>{r({detail:n})})}}var bw=e=>{const t=c.useContext(ie.BufferingContextReact);if(!t)throw new Error("BufferingContextReact not found");c.useLayoutEffect(()=>{const n=t.listenForBuffering(()=>{t.buffering.current=!0,e.dispatchWaiting({})}),r=t.listenForResume(()=>{t.buffering.current=!1,e.dispatchResume({})});return()=>{n.remove(),r.remove()}},[t,e])},K2=({children:e,currentPlaybackRate:t})=>{const[n]=c.useState(()=>new Z2);if(!c.useContext(ie.BufferingContextReact))throw new Error("BufferingContextReact not found");return c.useEffect(()=>{t&&n.dispatchRateChange(t)},[n,t]),bw(n),d.jsx(ww.Provider,{value:n,children:e})},Yf=(e,t)=>{const[n,r]=c.useState(!1);return c.useEffect(()=>{const{current:o}=e;if(!o)return;let i;const s=()=>{t&&(clearTimeout(i),i=setTimeout(()=>{r(!1)},t===!0?3e3:t))},a=()=>{r(!0),s()},l=()=>{r(!1),clearTimeout(i)},u=()=>{r(!0),s()};return o.addEventListener("mouseenter",a),o.addEventListener("mouseleave",l),o.addEventListener("mousemove",u),()=>{o.removeEventListener("mouseenter",a),o.removeEventListener("mouseleave",l),o.removeEventListener("mousemove",u),clearTimeout(i)}},[t,e]),n},ql=()=>{const[e,t,n]=ie.Timeline.usePlayingState(),[r,o]=c.useState(!1),i=ie.Timeline.useTimelinePosition(),s=c.useRef(i),a=ie.Timeline.useTimelineSetFrame(),l=ie.Timeline.useTimelineSetFrame(),u=c.useContext(ie.SharedAudioContext),f=c.useContext(ie.SharedAudioTagsContext),{audioAndVideoTags:p}=ie.useTimelineContext(),m=c.useRef(i);m.current=i;const h=ie.useVideo(),w=ie.useUnsafeVideoConfig(),v=c.useContext(ww),S=((w==null?void 0:w.durationInFrames)??1)-1,g=i===S,y=i===0;if(!v)throw new TypeError("Expected Player event emitter context");const x=c.useContext(ie.BufferingContextReact);if(!x)throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");const{buffering:b}=x,k=c.useCallback(R=>{const C=w?ie.TimelinePosition.clampFrameToCompositionRange(R,w.durationInFrames):Math.max(0,R);h!=null&&h.id&&l(j=>({...j,[h.id]:C})),m.current=C,v.dispatchSeek(C)},[w,v,l,h==null?void 0:h.id]),E=c.useCallback(R=>{n.current||(o(!0),g&&k(0),u==null||u.resume(),f&&f.numberOfAudioTags>0&&R&&f.playAllAudios(),p.current.forEach(C=>C.play("player play() was called and playing audio from a click")),n.current=!0,t(!0),s.current=m.current,v.dispatchPlay())},[n,g,u,f,t,v,k,p]),I=c.useCallback(()=>{n.current&&(n.current=!1,t(!1),v.dispatchPause(),u==null||u.suspend())},[v,n,t,u]),T=c.useCallback(()=>{n.current&&(n.current=!1,m.current=s.current,w&&(l(R=>({...R,[w.id]:s.current})),t(!1),v.dispatchPause()))},[w,v,n,t,l]),_=h==null?void 0:h.id,$=c.useCallback(R=>{if(!_)return null;n.current||a(C=>{const j=C[_]??window.remotion_initialFrame??0,F=Math.max(0,j-R);return j===F?C:{...C,[_]:F}})},[n,a,_]),M=c.useCallback(R=>{if(!_)return null;n.current||a(C=>{const j=C[_]??window.remotion_initialFrame??0,F=Math.min(S,j+R);return j===F?C:{...C,[_]:F}})},[_,n,S,a]),P=c.useCallback(R=>{n.current?I():E(R)},[n,I,E]),D=c.useCallback(()=>n.current,[n]),O=c.useCallback(()=>m.current,[m]),A=c.useCallback(()=>b.current,[b]);return c.useMemo(()=>({frameBack:$,frameForward:M,isLastFrame:g,emitter:v,playing:e,play:E,pause:I,seek:k,isFirstFrame:y,getCurrentFrame:O,isPlaying:D,isBuffering:A,pauseAndReturnToPlayStart:T,hasPlayed:r,toggle:P}),[v,$,M,r,y,g,O,I,T,E,e,k,P,D,A])},X2=({browserMediaControlsBehavior:e,videoConfig:t,playbackRate:n})=>{const{playing:r,pause:o,play:i,emitter:s,getCurrentFrame:a,seek:l}=ql(),u=c.useRef(!1);c.useEffect(()=>{r&&(u.current=!0)},[r]),c.useEffect(()=>{navigator.mediaSession&&e.mode!=="do-nothing"&&(r?navigator.mediaSession.playbackState="playing":u.current&&(navigator.mediaSession.playbackState="paused"))},[e.mode,r]),c.useEffect(()=>{if(!navigator.mediaSession||e.mode==="do-nothing")return;const f=()=>{t&&navigator.mediaSession&&navigator.mediaSession.setPositionState({duration:t.durationInFrames/t.fps,playbackRate:n,position:a()/t.fps})};return s.addEventListener("timeupdate",f),()=>{s.removeEventListener("timeupdate",f)}},[e.mode,s,a,n,t]),c.useEffect(()=>{if(navigator.mediaSession&&e.mode!=="do-nothing")return navigator.mediaSession.setActionHandler("play",()=>{e.mode==="register-media-session"&&i()}),navigator.mediaSession.setActionHandler("pause",()=>{e.mode==="register-media-session"&&o()}),navigator.mediaSession.setActionHandler("seekto",f=>{e.mode==="register-media-session"&&f.seekTime!==void 0&&t&&l(Math.round(f.seekTime*t.fps))}),navigator.mediaSession.setActionHandler("seekbackward",()=>{e.mode==="register-media-session"&&t&&l(Math.max(0,Math.round((a()-10)*t.fps)))}),navigator.mediaSession.setActionHandler("seekforward",()=>{e.mode==="register-media-session"&&t&&l(Math.max(t.durationInFrames-1,Math.round((a()+10)*t.fps)))}),navigator.mediaSession.setActionHandler("previoustrack",()=>{e.mode==="register-media-session"&&l(0)}),()=>{navigator.mediaSession.metadata=null,navigator.mediaSession.setActionHandler("play",null),navigator.mediaSession.setActionHandler("pause",null),navigator.mediaSession.setActionHandler("seekto",null),navigator.mediaSession.setActionHandler("seekbackward",null),navigator.mediaSession.setActionHandler("seekforward",null),navigator.mediaSession.setActionHandler("previoustrack",null)}},[e.mode,a,o,i,l,t])},G2=({time:e,currentFrame:t,playbackSpeed:n,fps:r,actualLastFrame:o,actualFirstFrame:i,framesAdvanced:s,shouldLoop:a})=>{const u=(n<0?Math.ceil:Math.floor)(e*n/(1e3/r))-s,f=u+t,p=t>o||t<i,m=f>o||f<i,h=!a&&m&&!p;return n>0?m?{nextFrame:i,framesToAdvance:u,hasEnded:h}:{nextFrame:f,framesToAdvance:u,hasEnded:h}:m?{nextFrame:o,framesToAdvance:u,hasEnded:h}:{nextFrame:f,framesToAdvance:u,hasEnded:h}},oh=()=>typeof document>"u"?!1:document.visibilityState==="hidden",q2=()=>{const e=c.useRef(oh());return c.useEffect(()=>{const t=()=>{e.current=oh()};return document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[]),e},Q2=.1,ih=({audioContext:e,audioSyncAnchor:t,absoluteTimeInSeconds:n,globalPlaybackRate:r,logLevel:o,force:i})=>{const s=e.currentTime-n/r,a=s-t.value,{outputLatency:l}=e,u=l===0?.3:l,f=e.baseLatency+u;return Math.abs(a)<Q2+f&&!i||Math.abs(a)<Number.EPSILON?!1:(ie.Log.verbose({logLevel:o,tag:"audio-scheduling"},"Anchor "+(i?"forcibly ":"")+"changed from %s to %s with shift %s",t.value,s,a),t.value=s,!0)},J2=e=>{if(e==="suspended"||e==="running-to-suspended")return!0;if(e==="closed"||e==="interrupted"||e==="running"||e==="suspended-to-running")return!1;throw new Error(`Unexpected audio context state: ${e}`)},eI=({loop:e,playbackRate:t,moveToBeginningWhenEnded:n,inFrame:r,outFrame:o,browserMediaControlsBehavior:i,getCurrentFrame:s,muted:a})=>{const l=ie.useUnsafeVideoConfig(),u=ie.Timeline.useTimelinePosition(),{playing:f,pause:p,emitter:m,isPlaying:h}=ql(),w=ie.Timeline.useTimelineSetFrame(),v=c.useContext(ie.SharedAudioContext),S=ie.useLogLevel(),g=q2(),y=c.useRef(0),x=c.useContext(ie.BufferingContextReact);if(!x)throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");X2({browserMediaControlsBehavior:i,playbackRate:t,videoConfig:l}),c.useLayoutEffect(()=>{if(!v||!v.audioContext||!l||a)return;ih({audioContext:v.audioContext,audioSyncAnchor:v.audioSyncAnchor,absoluteTimeInSeconds:u/l.fps,globalPlaybackRate:t,logLevel:S,force:!1})&&v.audioSyncAnchorEmitter.dispatch("changed")},[l,u,S,t,v,a]),c.useLayoutEffect(()=>{const b=v==null?void 0:v.audioContext;if(!b||!l||a)return;const k=()=>{const E=v==null?void 0:v.getAudioContextState();E&&J2(E)&&ih({audioContext:b,audioSyncAnchor:v.audioSyncAnchor,absoluteTimeInSeconds:s()/l.fps,globalPlaybackRate:t,logLevel:S,force:!0})};return b==null||b.addEventListener("statechange",k),()=>{b==null||b.removeEventListener("statechange",k)}},[l,s,S,a,t,v]),c.useEffect(()=>{var D;if(!l)return;if(!f){(D=v==null?void 0:v.suspend)==null||D.call(v);return}let b=!1,k=null,E=performance.now(),I=0;const T=()=>{k!==null&&(k.type==="raf"?cancelAnimationFrame(k.id):clearTimeout(k.id))},_=()=>{b=!0,T()},$=()=>{var V,W;if(b)return;if(!h()){(V=v==null?void 0:v.suspend)==null||V.call(v);return}!a&&!x.buffering.current&&((W=v==null?void 0:v.resume)==null||W.call(v));const O=performance.now()-E,A=o??l.durationInFrames-1,Z=r??0,R=s(),{nextFrame:C,framesToAdvance:j,hasEnded:F}=G2({time:O,currentFrame:R,playbackSpeed:t,fps:l.fps,actualFirstFrame:Z,actualLastFrame:A,framesAdvanced:I,shouldLoop:e});if(I+=j,C!==s()&&(!F||n)&&!x.buffering.current&&w(N=>({...N,[l.id]:C})),F){_(),p(),m.dispatchEnded();return}M()},M=()=>{var A,Z;const O=((A=v==null?void 0:v.getIsResumingAudioContext)==null?void 0:A.call(v))??null;if(O!==null&&!a){O.then(()=>{E=performance.now(),I=0,M()});return}if(x.buffering.current){a||(Z=v==null?void 0:v.suspend)==null||Z.call(v);const R=x.listenForResume(()=>{R.remove(),E=performance.now(),I=0,M()});return}if(g.current){k={type:"timeout",id:setTimeout($,1e3/l.fps)};return}k={type:"raf",id:requestAnimationFrame($)}};M();const P=()=>{document.visibilityState!=="visible"&&(T(),$())};return window.addEventListener("visibilitychange",P),()=>{window.removeEventListener("visibilitychange",P),_()}},[l,e,p,f,w,m,t,r,o,n,g,s,x,h,v,S,a]),c.useEffect(()=>{const b=performance.now(),k=b-y.current;if(k>=250){m.dispatchTimeUpdate({frame:u}),y.current=b;return}const E=setTimeout(()=>{m.dispatchTimeUpdate({frame:u}),y.current=performance.now()},250-k);return()=>clearTimeout(E)},[m,u]),c.useEffect(()=>{m.dispatchFrameUpdate({frame:u})},[m,u])},Wu=[],Uu=e=>e?"current"in e?e.current:e:null,Kf=(e,t)=>{const[n,r]=c.useState(()=>{const s=Uu(e);if(!s)return null;const a=s.getClientRects();return a[0]?{width:a[0].width,height:a[0].height,left:a[0].x,top:a[0].y,windowSize:{height:window.innerHeight,width:window.innerWidth}}:null}),o=c.useMemo(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const{contentRect:a,target:l}=s[0],u=l.getClientRects();if(!(u!=null&&u[0])){r(null);return}const f=a.width===0?1:u[0].width/a.width,p=a.height===0?1:u[0].height/a.height,m=t.shouldApplyCssTransforms||f===0?u[0].width:u[0].width*(1/f),h=t.shouldApplyCssTransforms||p===0?u[0].height:u[0].height*(1/p);r(w=>w&&w.width===m&&w.height===h&&w.left===u[0].x&&w.top===u[0].y&&w.windowSize.height===window.innerHeight&&w.windowSize.width===window.innerWidth?w:{width:m,height:h,left:u[0].x,top:u[0].y,windowSize:{height:window.innerHeight,width:window.innerWidth}})}),[t.shouldApplyCssTransforms]),i=c.useCallback(()=>{const s=Uu(e);if(!s)return;const a=s.getClientRects();if(!a[0]){r(null);return}r(l=>l&&l.width===a[0].width&&l.height===a[0].height&&l.left===a[0].x&&l.top===a[0].y&&l.windowSize.height===window.innerHeight&&l.windowSize.width===window.innerWidth?l:{width:a[0].width,height:a[0].height,left:a[0].x,top:a[0].y,windowSize:{height:window.innerHeight,width:window.innerWidth}})},[e]);return c.useEffect(()=>{i()},[i]),c.useEffect(()=>{if(!o)return;const s=Uu(e);return s&&o.observe(s),()=>{s&&o.unobserve(s)}},[o,e]),c.useEffect(()=>{if(t.triggerOnWindowResize)return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[t.triggerOnWindowResize,i]),c.useEffect(()=>(Wu.push(i),()=>{Wu=Wu.filter(s=>s!==i)}),[i]),c.useMemo(()=>n?{...n,refresh:i}:null,[n,i])},Xf=e=>e??"__remotion-player",tI={display:"flex",justifyContent:"center",alignItems:"center",flex:1,height:"100%",width:"100%"};class Sw extends J.Component{constructor(){super(...arguments);Ie(this,"state",{hasError:null})}static getDerivedStateFromError(n){return{hasError:n}}componentDidCatch(n){this.props.onError(n)}render(){return this.state.hasError?d.jsx("div",{style:tI,children:this.props.errorFallback({error:this.state.hasError})}):this.props.children}}var nI=async()=>{if(typeof window>"u"||typeof window.crypto>"u"||typeof window.crypto.subtle>"u")return null;try{const e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(window.location.hostname));return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}catch{return null}},Hu={backgroundColor:"red",position:"absolute",padding:12,fontFamily:"Arial"},rI=["28d262b44cc61fa750f1686b16ad0604dabfe193fbc263eec05c89b7ad4c2cd6","4db1b0a94be33165dfefcb3ba03d04c7a2666dd27c496d3dc9fa41858e94925e","fbc48530bbf245da790f63675e84e06bab38c3b114fab07eb350025119922bdc","7baf10a8932757b1b3a22b3fce10a048747ac2f8eaf638603487e3705b07eb83","8a6c21a598d8c667272b5207c051b85997bf5b45d5fb712378be3f27cd72c6a6","a2f7aaac9c50a9255e7fc376110c4e0bfe153722dc66ed3c5d3bf2a135f65518"],sh=!1,oI=()=>{const[e,t]=J.useState(!1);return c.useEffect(()=>{sh||(sh=!0,nI().then(n=>{n&&rI.includes(n)&&t(!0)}).catch(()=>{}))},[]),c.useEffect(()=>{if(!e)return;const n=()=>{if(!document.querySelector(".warning-banner")){const i=document.createElement("div");i.className="warning-banner",Object.assign(i.style,Hu,{zIndex:"9999",cssText:`${Hu.cssText} !important;`}),i.innerHTML=`
|
|
109
|
+
`}),d.jsx("div",{style:t,children:d.jsx("svg",{viewBox:e==="player"?"0 0 22 22":"0 0 18 18",style:t,className:nh,children:d.jsx("path",{d:e==="player"?"M 11 4 A 7 7 0 0 1 15.1145 16.66312":"M 9 2 A 7 7 0 0 1 13.1145 14.66312",stroke:"white",strokeLinecap:"round",fill:"none",strokeWidth:3})})})]})},H2=({currentSize:e,width:t,height:n,compositionWidth:r,compositionHeight:o})=>t!==void 0&&n===void 0?{aspectRatio:[r,o].join("/")}:n!==void 0&&t===void 0?{aspectRatio:[r,o].join("/")}:e?{width:r,height:o}:{width:r,height:o},hw=({previewSize:e,compositionWidth:t,compositionHeight:n,canvasSize:r})=>{const o=ie.calculateScale({canvasSize:r,compositionHeight:n,compositionWidth:t,previewSize:e}),i=0-(1-o)/2,s=i*t,a=i*n,l=t*o,u=n*o,f=r.width/2-l/2,p=r.height/2-u/2;return{centerX:f,centerY:p,xCorrection:s,yCorrection:a,scale:o}},gw=({config:e,style:t,canvasSize:n,overflowVisible:r,layout:o})=>e?{position:"relative",overflow:r?"visible":"hidden",...H2({compositionHeight:e.height,compositionWidth:e.width,currentSize:n,height:t==null?void 0:t.height,width:t==null?void 0:t.width}),opacity:o?1:0,...t}:{},vw=({config:e,layout:t,scale:n,overflowVisible:r})=>e?t?{position:"absolute",width:e.width,height:e.height,display:"flex",transform:`scale(${n})`,marginLeft:t.xCorrection,marginTop:t.yCorrection,overflow:r?"visible":"hidden"}:{position:"absolute",width:e.width,height:e.height,display:"flex",transform:`scale(${n})`,overflow:r?"visible":"hidden"}:{},yw=({layout:e,scale:t,config:n,overflowVisible:r})=>{if(!n)return{};if(!e)return{width:n.width*t,height:n.height*t,display:"flex",flexDirection:"column",position:"absolute",overflow:r?"visible":"hidden"};const{centerX:o,centerY:i}=e;return{width:n.width*t,height:n.height*t,display:"flex",flexDirection:"column",position:"absolute",left:o,top:i,overflow:r?"visible":"hidden"}},ww=J.createContext(void 0),xw=J.createContext(void 0);class Z2{constructor(){Ie(this,"listeners",{ended:[],error:[],pause:[],play:[],ratechange:[],scalechange:[],seeked:[],timeupdate:[],frameupdate:[],fullscreenchange:[],volumechange:[],mutechange:[],waiting:[],resume:[]});Ie(this,"dispatchSeek",t=>{this.dispatchEvent("seeked",{frame:t})});Ie(this,"dispatchVolumeChange",t=>{this.dispatchEvent("volumechange",{volume:t})});Ie(this,"dispatchPause",()=>{this.dispatchEvent("pause",void 0)});Ie(this,"dispatchPlay",()=>{this.dispatchEvent("play",void 0)});Ie(this,"dispatchEnded",()=>{this.dispatchEvent("ended",void 0)});Ie(this,"dispatchRateChange",t=>{this.dispatchEvent("ratechange",{playbackRate:t})});Ie(this,"dispatchScaleChange",t=>{this.dispatchEvent("scalechange",{scale:t})});Ie(this,"dispatchError",t=>{this.dispatchEvent("error",{error:t})});Ie(this,"dispatchTimeUpdate",t=>{this.dispatchEvent("timeupdate",t)});Ie(this,"dispatchFrameUpdate",t=>{this.dispatchEvent("frameupdate",t)});Ie(this,"dispatchFullscreenChange",t=>{this.dispatchEvent("fullscreenchange",t)});Ie(this,"dispatchMuteChange",t=>{this.dispatchEvent("mutechange",t)});Ie(this,"dispatchWaiting",t=>{this.dispatchEvent("waiting",t)});Ie(this,"dispatchResume",t=>{this.dispatchEvent("resume",t)})}addEventListener(t,n){this.listeners[t].push(n)}removeEventListener(t,n){this.listeners[t]=this.listeners[t].filter(r=>r!==n)}dispatchEvent(t,n){this.listeners[t].forEach(r=>{r({detail:n})})}}class Y2{constructor(){Ie(this,"listeners",{error:[],waiting:[],resume:[]});Ie(this,"dispatchError",t=>{this.dispatchEvent("error",{error:t})});Ie(this,"dispatchWaiting",t=>{this.dispatchEvent("waiting",t)});Ie(this,"dispatchResume",t=>{this.dispatchEvent("resume",t)})}addEventListener(t,n){this.listeners[t].push(n)}removeEventListener(t,n){this.listeners[t]=this.listeners[t].filter(r=>r!==n)}dispatchEvent(t,n){this.listeners[t].forEach(r=>{r({detail:n})})}}var bw=e=>{const t=c.useContext(ie.BufferingContextReact);if(!t)throw new Error("BufferingContextReact not found");c.useLayoutEffect(()=>{const n=t.listenForBuffering(()=>{t.buffering.current=!0,e.dispatchWaiting({})}),r=t.listenForResume(()=>{t.buffering.current=!1,e.dispatchResume({})});return()=>{n.remove(),r.remove()}},[t,e])},K2=({children:e,currentPlaybackRate:t})=>{const[n]=c.useState(()=>new Z2);if(!c.useContext(ie.BufferingContextReact))throw new Error("BufferingContextReact not found");return c.useEffect(()=>{t&&n.dispatchRateChange(t)},[n,t]),bw(n),d.jsx(ww.Provider,{value:n,children:e})},Yf=(e,t)=>{const[n,r]=c.useState(!1);return c.useEffect(()=>{const{current:o}=e;if(!o)return;let i;const s=()=>{t&&(clearTimeout(i),i=setTimeout(()=>{r(!1)},t===!0?3e3:t))},a=()=>{r(!0),s()},l=()=>{r(!1),clearTimeout(i)},u=()=>{r(!0),s()};return o.addEventListener("mouseenter",a),o.addEventListener("mouseleave",l),o.addEventListener("mousemove",u),()=>{o.removeEventListener("mouseenter",a),o.removeEventListener("mouseleave",l),o.removeEventListener("mousemove",u),clearTimeout(i)}},[t,e]),n},ql=()=>{const[e,t,n]=ie.Timeline.usePlayingState(),[r,o]=c.useState(!1),i=ie.Timeline.useTimelinePosition(),s=c.useRef(i),a=ie.Timeline.useTimelineSetFrame(),l=ie.Timeline.useTimelineSetFrame(),u=c.useContext(ie.SharedAudioContext),f=c.useContext(ie.SharedAudioTagsContext),{audioAndVideoTags:p}=ie.useTimelineContext(),m=c.useRef(i);m.current=i;const h=ie.useVideo(),y=ie.useUnsafeVideoConfig(),g=c.useContext(ww),S=((y==null?void 0:y.durationInFrames)??1)-1,v=i===S,w=i===0;if(!g)throw new TypeError("Expected Player event emitter context");const x=c.useContext(ie.BufferingContextReact);if(!x)throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");const{buffering:b}=x,k=c.useCallback(R=>{const C=y?ie.TimelinePosition.clampFrameToCompositionRange(R,y.durationInFrames):Math.max(0,R);h!=null&&h.id&&l(F=>({...F,[h.id]:C})),m.current=C,g.dispatchSeek(C)},[y,g,l,h==null?void 0:h.id]),E=c.useCallback(R=>{n.current||(o(!0),v&&k(0),u==null||u.resume(),f&&f.numberOfAudioTags>0&&R&&f.playAllAudios(),p.current.forEach(C=>C.play("player play() was called and playing audio from a click")),n.current=!0,t(!0),s.current=m.current,g.dispatchPlay())},[n,v,u,f,t,g,k,p]),I=c.useCallback(()=>{n.current&&(n.current=!1,t(!1),g.dispatchPause(),u==null||u.suspend())},[g,n,t,u]),T=c.useCallback(()=>{n.current&&(n.current=!1,m.current=s.current,y&&(l(R=>({...R,[y.id]:s.current})),t(!1),g.dispatchPause()))},[y,g,n,t,l]),_=h==null?void 0:h.id,$=c.useCallback(R=>{if(!_)return null;n.current||a(C=>{const F=C[_]??window.remotion_initialFrame??0,P=Math.max(0,F-R);return F===P?C:{...C,[_]:P}})},[n,a,_]),j=c.useCallback(R=>{if(!_)return null;n.current||a(C=>{const F=C[_]??window.remotion_initialFrame??0,P=Math.min(S,F+R);return F===P?C:{...C,[_]:P}})},[_,n,S,a]),L=c.useCallback(R=>{n.current?I():E(R)},[n,I,E]),M=c.useCallback(()=>n.current,[n]),O=c.useCallback(()=>m.current,[m]),Z=c.useCallback(()=>b.current,[b]);return c.useMemo(()=>({frameBack:$,frameForward:j,isLastFrame:v,emitter:g,playing:e,play:E,pause:I,seek:k,isFirstFrame:w,getCurrentFrame:O,isPlaying:M,isBuffering:Z,pauseAndReturnToPlayStart:T,hasPlayed:r,toggle:L}),[g,$,j,r,w,v,O,I,T,E,e,k,L,M,Z])},X2=({browserMediaControlsBehavior:e,videoConfig:t,playbackRate:n})=>{const{playing:r,pause:o,play:i,emitter:s,getCurrentFrame:a,seek:l}=ql(),u=c.useRef(!1);c.useEffect(()=>{r&&(u.current=!0)},[r]),c.useEffect(()=>{navigator.mediaSession&&e.mode!=="do-nothing"&&(r?navigator.mediaSession.playbackState="playing":u.current&&(navigator.mediaSession.playbackState="paused"))},[e.mode,r]),c.useEffect(()=>{if(!navigator.mediaSession||e.mode==="do-nothing")return;const f=()=>{t&&navigator.mediaSession&&navigator.mediaSession.setPositionState({duration:t.durationInFrames/t.fps,playbackRate:n,position:a()/t.fps})};return s.addEventListener("timeupdate",f),()=>{s.removeEventListener("timeupdate",f)}},[e.mode,s,a,n,t]),c.useEffect(()=>{if(navigator.mediaSession&&e.mode!=="do-nothing")return navigator.mediaSession.setActionHandler("play",()=>{e.mode==="register-media-session"&&i()}),navigator.mediaSession.setActionHandler("pause",()=>{e.mode==="register-media-session"&&o()}),navigator.mediaSession.setActionHandler("seekto",f=>{e.mode==="register-media-session"&&f.seekTime!==void 0&&t&&l(Math.round(f.seekTime*t.fps))}),navigator.mediaSession.setActionHandler("seekbackward",()=>{e.mode==="register-media-session"&&t&&l(Math.max(0,Math.round((a()-10)*t.fps)))}),navigator.mediaSession.setActionHandler("seekforward",()=>{e.mode==="register-media-session"&&t&&l(Math.max(t.durationInFrames-1,Math.round((a()+10)*t.fps)))}),navigator.mediaSession.setActionHandler("previoustrack",()=>{e.mode==="register-media-session"&&l(0)}),()=>{navigator.mediaSession.metadata=null,navigator.mediaSession.setActionHandler("play",null),navigator.mediaSession.setActionHandler("pause",null),navigator.mediaSession.setActionHandler("seekto",null),navigator.mediaSession.setActionHandler("seekbackward",null),navigator.mediaSession.setActionHandler("seekforward",null),navigator.mediaSession.setActionHandler("previoustrack",null)}},[e.mode,a,o,i,l,t])},G2=({time:e,currentFrame:t,playbackSpeed:n,fps:r,actualLastFrame:o,actualFirstFrame:i,framesAdvanced:s,shouldLoop:a})=>{const u=(n<0?Math.ceil:Math.floor)(e*n/(1e3/r))-s,f=u+t,p=t>o||t<i,m=f>o||f<i,h=!a&&m&&!p;return n>0?m?{nextFrame:i,framesToAdvance:u,hasEnded:h}:{nextFrame:f,framesToAdvance:u,hasEnded:h}:m?{nextFrame:o,framesToAdvance:u,hasEnded:h}:{nextFrame:f,framesToAdvance:u,hasEnded:h}},oh=()=>typeof document>"u"?!1:document.visibilityState==="hidden",q2=()=>{const e=c.useRef(oh());return c.useEffect(()=>{const t=()=>{e.current=oh()};return document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[]),e},Q2=.1,ih=({audioContext:e,audioSyncAnchor:t,absoluteTimeInSeconds:n,globalPlaybackRate:r,logLevel:o,force:i})=>{const s=e.currentTime-n/r,a=s-t.value,{outputLatency:l}=e,u=l===0?.3:l,f=e.baseLatency+u;return Math.abs(a)<Q2+f&&!i||Math.abs(a)<Number.EPSILON?!1:(ie.Log.verbose({logLevel:o,tag:"audio-scheduling"},"Anchor "+(i?"forcibly ":"")+"changed from %s to %s with shift %s",t.value,s,a),t.value=s,!0)},J2=e=>{if(e==="suspended"||e==="running-to-suspended")return!0;if(e==="closed"||e==="interrupted"||e==="running"||e==="suspended-to-running")return!1;throw new Error(`Unexpected audio context state: ${e}`)},eI=({loop:e,playbackRate:t,moveToBeginningWhenEnded:n,inFrame:r,outFrame:o,browserMediaControlsBehavior:i,getCurrentFrame:s,muted:a})=>{const l=ie.useUnsafeVideoConfig(),u=ie.Timeline.useTimelinePosition(),{playing:f,pause:p,emitter:m,isPlaying:h}=ql(),y=ie.Timeline.useTimelineSetFrame(),g=c.useContext(ie.SharedAudioContext),S=ie.useLogLevel(),v=q2(),w=c.useRef(0),x=c.useContext(ie.BufferingContextReact);if(!x)throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");X2({browserMediaControlsBehavior:i,playbackRate:t,videoConfig:l}),c.useLayoutEffect(()=>{if(!g||!g.audioContext||!l||a)return;ih({audioContext:g.audioContext,audioSyncAnchor:g.audioSyncAnchor,absoluteTimeInSeconds:u/l.fps,globalPlaybackRate:t,logLevel:S,force:!1})&&g.audioSyncAnchorEmitter.dispatch("changed")},[l,u,S,t,g,a]),c.useLayoutEffect(()=>{const b=g==null?void 0:g.audioContext;if(!b||!l||a)return;const k=()=>{const E=g==null?void 0:g.getAudioContextState();E&&J2(E)&&ih({audioContext:b,audioSyncAnchor:g.audioSyncAnchor,absoluteTimeInSeconds:s()/l.fps,globalPlaybackRate:t,logLevel:S,force:!0})};return b==null||b.addEventListener("statechange",k),()=>{b==null||b.removeEventListener("statechange",k)}},[l,s,S,a,t,g]),c.useEffect(()=>{var M;if(!l)return;if(!f){(M=g==null?void 0:g.suspend)==null||M.call(g);return}let b=!1,k=null,E=performance.now(),I=0;const T=()=>{k!==null&&(k.type==="raf"?cancelAnimationFrame(k.id):clearTimeout(k.id))},_=()=>{b=!0,T()},$=()=>{var V,W;if(b)return;if(!h()){(V=g==null?void 0:g.suspend)==null||V.call(g);return}!a&&!x.buffering.current&&((W=g==null?void 0:g.resume)==null||W.call(g));const O=performance.now()-E,Z=o??l.durationInFrames-1,D=r??0,R=s(),{nextFrame:C,framesToAdvance:F,hasEnded:P}=G2({time:O,currentFrame:R,playbackSpeed:t,fps:l.fps,actualFirstFrame:D,actualLastFrame:Z,framesAdvanced:I,shouldLoop:e});if(I+=F,C!==s()&&(!P||n)&&!x.buffering.current&&y(N=>({...N,[l.id]:C})),P){_(),p(),m.dispatchEnded();return}j()},j=()=>{var Z,D;const O=((Z=g==null?void 0:g.getIsResumingAudioContext)==null?void 0:Z.call(g))??null;if(O!==null&&!a){O.then(()=>{E=performance.now(),I=0,j()});return}if(x.buffering.current){a||(D=g==null?void 0:g.suspend)==null||D.call(g);const R=x.listenForResume(()=>{R.remove(),E=performance.now(),I=0,j()});return}if(v.current){k={type:"timeout",id:setTimeout($,1e3/l.fps)};return}k={type:"raf",id:requestAnimationFrame($)}};j();const L=()=>{document.visibilityState!=="visible"&&(T(),$())};return window.addEventListener("visibilitychange",L),()=>{window.removeEventListener("visibilitychange",L),_()}},[l,e,p,f,y,m,t,r,o,n,v,s,x,h,g,S,a]),c.useEffect(()=>{const b=performance.now(),k=b-w.current;if(k>=250){m.dispatchTimeUpdate({frame:u}),w.current=b;return}const E=setTimeout(()=>{m.dispatchTimeUpdate({frame:u}),w.current=performance.now()},250-k);return()=>clearTimeout(E)},[m,u]),c.useEffect(()=>{m.dispatchFrameUpdate({frame:u})},[m,u])},Wu=[],Uu=e=>e?"current"in e?e.current:e:null,Kf=(e,t)=>{const[n,r]=c.useState(()=>{const s=Uu(e);if(!s)return null;const a=s.getClientRects();return a[0]?{width:a[0].width,height:a[0].height,left:a[0].x,top:a[0].y,windowSize:{height:window.innerHeight,width:window.innerWidth}}:null}),o=c.useMemo(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const{contentRect:a,target:l}=s[0],u=l.getClientRects();if(!(u!=null&&u[0])){r(null);return}const f=a.width===0?1:u[0].width/a.width,p=a.height===0?1:u[0].height/a.height,m=t.shouldApplyCssTransforms||f===0?u[0].width:u[0].width*(1/f),h=t.shouldApplyCssTransforms||p===0?u[0].height:u[0].height*(1/p);r(y=>y&&y.width===m&&y.height===h&&y.left===u[0].x&&y.top===u[0].y&&y.windowSize.height===window.innerHeight&&y.windowSize.width===window.innerWidth?y:{width:m,height:h,left:u[0].x,top:u[0].y,windowSize:{height:window.innerHeight,width:window.innerWidth}})}),[t.shouldApplyCssTransforms]),i=c.useCallback(()=>{const s=Uu(e);if(!s)return;const a=s.getClientRects();if(!a[0]){r(null);return}r(l=>l&&l.width===a[0].width&&l.height===a[0].height&&l.left===a[0].x&&l.top===a[0].y&&l.windowSize.height===window.innerHeight&&l.windowSize.width===window.innerWidth?l:{width:a[0].width,height:a[0].height,left:a[0].x,top:a[0].y,windowSize:{height:window.innerHeight,width:window.innerWidth}})},[e]);return c.useEffect(()=>{i()},[i]),c.useEffect(()=>{if(!o)return;const s=Uu(e);return s&&o.observe(s),()=>{s&&o.unobserve(s)}},[o,e]),c.useEffect(()=>{if(t.triggerOnWindowResize)return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[t.triggerOnWindowResize,i]),c.useEffect(()=>(Wu.push(i),()=>{Wu=Wu.filter(s=>s!==i)}),[i]),c.useMemo(()=>n?{...n,refresh:i}:null,[n,i])},Xf=e=>e??"__remotion-player",tI={display:"flex",justifyContent:"center",alignItems:"center",flex:1,height:"100%",width:"100%"};class Sw extends J.Component{constructor(){super(...arguments);Ie(this,"state",{hasError:null})}static getDerivedStateFromError(n){return{hasError:n}}componentDidCatch(n){this.props.onError(n)}render(){return this.state.hasError?d.jsx("div",{style:tI,children:this.props.errorFallback({error:this.state.hasError})}):this.props.children}}var nI=async()=>{if(typeof window>"u"||typeof window.crypto>"u"||typeof window.crypto.subtle>"u")return null;try{const e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(window.location.hostname));return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}catch{return null}},Hu={backgroundColor:"red",position:"absolute",padding:12,fontFamily:"Arial"},rI=["28d262b44cc61fa750f1686b16ad0604dabfe193fbc263eec05c89b7ad4c2cd6","4db1b0a94be33165dfefcb3ba03d04c7a2666dd27c496d3dc9fa41858e94925e","fbc48530bbf245da790f63675e84e06bab38c3b114fab07eb350025119922bdc","7baf10a8932757b1b3a22b3fce10a048747ac2f8eaf638603487e3705b07eb83","8a6c21a598d8c667272b5207c051b85997bf5b45d5fb712378be3f27cd72c6a6","a2f7aaac9c50a9255e7fc376110c4e0bfe153722dc66ed3c5d3bf2a135f65518"],sh=!1,oI=()=>{const[e,t]=J.useState(!1);return c.useEffect(()=>{sh||(sh=!0,nI().then(n=>{n&&rI.includes(n)&&t(!0)}).catch(()=>{}))},[]),c.useEffect(()=>{if(!e)return;const n=()=>{if(!document.querySelector(".warning-banner")){const i=document.createElement("div");i.className="warning-banner",Object.assign(i.style,Hu,{zIndex:"9999",cssText:`${Hu.cssText} !important;`}),i.innerHTML=`
|
|
110
110
|
<a href="https://github.com/remotion-dev/remotion/pull/4589" style="color: white;">
|
|
111
111
|
Remotion Unlicensed – Contact hi@remotion.dev
|
|
112
112
|
</a>
|
|
@@ -131,9 +131,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
131
131
|
height: ${eo}px;
|
|
132
132
|
width: ${eo}px;
|
|
133
133
|
}
|
|
134
|
-
`;return d.jsxs("div",{style:i,children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:f}}),d.jsx("input",{ref:r,"aria-label":"Change volume",className:a,max:1,min:0,onBlur:n,onChange:l,step:.01,type:"range",value:e,style:u})]})},sI=e=>d.jsx(iI,{...e}),_r=100,aI=({displayVerticalVolumeSlider:e,renderMuteButton:t,renderVolumeSlider:n})=>{const[r,o]=ie.usePlayerMutedState(),[i,s]=ie.useMediaVolumeState(),[a,l]=c.useState(!1),u=c.useRef(null),f=c.useRef(null),p=Yf(u,!1),m=c.useCallback(()=>{setTimeout(()=>{f.current&&document.activeElement!==f.current&&l(!1)},10)},[]),h=i===0,w=c.useCallback(()=>{if(h){s(1),o(!1);return}o(b=>!b)},[h,o,s]),v=c.useMemo(()=>({display:"inline-flex",background:"none",border:"none",justifyContent:"center",alignItems:"center",touchAction:"none",...e&&{position:"relative"}}),[e]),S=c.useMemo(()=>({display:"inline",width:lt,height:lt,cursor:"pointer",appearance:"none",background:"none",border:"none",padding:0}),[]),g=c.useCallback(({muted:b,volume:k})=>{const E=b||k===0;return d.jsx("button",{"aria-label":E?"Unmute sound":"Mute sound",title:E?"Unmute sound":"Mute sound",onClick:w,onBlur:m,onFocus:()=>l(!0),style:S,type:"button",children:E?d.jsx(O2,{}):d.jsx(V2,{})})},[m,w,S]),y=c.useMemo(()=>t?t({muted:r,volume:i}):g({muted:r,volume:i}),[r,i,g,t]),x=c.useMemo(()=>(a||p)&&!r&&!ie.isIosSafari()?(n??sI)({isVertical:e,volume:i,onBlur:()=>l(!1),inputRef:f,setVolume:s}):null,[e,a,p,r,i,n,s]);return d.jsxs("div",{ref:u,style:v,children:[y,x]})};function lI(e){const[t,n]=c.useState(e),r=c.useRef(null);return c.useEffect(()=>{const o=i=>{r.current&&!r.current.contains(i.target)&&n(!1)};return document.addEventListener("pointerup",o,!0),()=>{document.removeEventListener("pointerup",o,!0)}},[]),{ref:r,isComponentVisible:t,setIsComponentVisible:n}}var uI=35,cI=70,dI={height:30,paddingRight:15,paddingLeft:12,display:"flex",flexDirection:"row",alignItems:"center"},fI={width:22,display:"flex",alignItems:"center"},pI={width:14,height:14,color:"black"},mI=()=>d.jsx("svg",{viewBox:"0 0 512 512",style:pI,children:d.jsx("path",{fill:"currentColor",d:"M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"})}),hI=e=>{const t=e.toString();return t.includes(".")?t:t+".0"},gI=({rate:e,onSelect:t,selectedRate:n,keyboardSelectedRate:r})=>{const o=c.useCallback(p=>{p.stopPropagation(),p.preventDefault(),t(e)},[t,e]),[i,s]=c.useState(!1),a=c.useCallback(()=>{s(!0)},[]),l=c.useCallback(()=>{s(!1)},[]),u=r===e,f=c.useMemo(()=>({...dI,backgroundColor:i||u?"#eee":"transparent"}),[i,u]);return d.jsxs("div",{onPointerEnter:a,onPointerLeave:l,tabIndex:0,style:f,onClick:o,children:[d.jsx("div",{style:fI,children:e===n?d.jsx(mI,{}):null}),hI(e),"x"]},e)},vI=({setIsComponentVisible:e,playbackRates:t,canvasSize:n})=>{const{setPlaybackRate:r,playbackRate:o}=ie.usePlaybackRate(),[i,s]=c.useState(o);c.useEffect(()=>{const u=f=>{if(f.preventDefault(),f.key==="ArrowUp"){const p=t.findIndex(m=>m===i);if(p===0)return;s(p===-1?t[0]:t[p-1])}else if(f.key==="ArrowDown"){const p=t.findIndex(m=>m===i);if(p===t.length-1)return;s(p===-1?t[t.length-1]:t[p+1])}else f.key==="Enter"&&(r(i),e(!1))};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[t,i,r,e]);const a=c.useCallback(u=>{r(u),e(!1)},[e,r]),l=c.useMemo(()=>({position:"absolute",right:0,width:125,maxHeight:n.height-cI-uI,bottom:35,background:"#fff",borderRadius:4,overflow:"auto",color:"black",textAlign:"left"}),[n.height]);return d.jsx("div",{style:l,children:t.map(u=>d.jsx(gI,{selectedRate:o,onSelect:a,rate:u,keyboardSelectedRate:i},u))})},yI={fontSize:13,fontWeight:"bold",color:"white",border:"2px solid white",borderRadius:20,paddingLeft:8,paddingRight:8,paddingTop:2,paddingBottom:2},pd={appearance:"none",backgroundColor:"transparent",border:"none",cursor:"pointer",paddingLeft:0,paddingRight:0,paddingTop:6,paddingBottom:6,height:37,display:"inline-flex",marginBottom:0,marginTop:0,alignItems:"center"},wI={...pd,position:"relative"},xI=({playbackRates:e,canvasSize:t})=>{const{ref:n,isComponentVisible:r,setIsComponentVisible:o}=lI(!1),{playbackRate:i}=ie.usePlaybackRate(),s=c.useCallback(a=>{a.stopPropagation(),a.preventDefault(),o(l=>!l)},[o]);return d.jsx("div",{ref:n,children:d.jsxs("button",{type:"button","aria-label":"Change playback rate",style:wI,onClick:s,children:[d.jsxs("div",{style:yI,children:[i,"x"]}),r&&d.jsx(vI,{canvasSize:t,playbackRates:e,setIsComponentVisible:o})]})})},uh=(e,t,n)=>Math.round(Ko(e,[0,n],[0,t-1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"})),xo=5,mi=12,md=4,bI={userSelect:"none",WebkitUserSelect:"none",paddingTop:md,paddingBottom:md,boxSizing:"border-box",cursor:"pointer",position:"relative",touchAction:"none"},SI={height:xo,backgroundColor:"rgba(255, 255, 255, 0.25)",width:"100%",borderRadius:xo/2},EI=e=>{let t=e;for(;t.parentElement;)t=t.parentElement;return t},kI=({durationInFrames:e,onSeekEnd:t,onSeekStart:n,inFrame:r,outFrame:o})=>{const i=c.useRef(null),s=Yf(i,!1),a=Kf(i,{triggerOnWindowResize:!0,shouldApplyCssTransforms:!0}),{seek:l,play:u,pause:f,playing:p}=ql(),m=ie.Timeline.useTimelinePosition(),[h,w]=c.useState({dragging:!1}),v=(a==null?void 0:a.width)??0,S=c.useCallback(E=>{var _;if(E.button!==0)return;const I=(_=i.current)==null?void 0:_.getBoundingClientRect().left,T=uh(E.clientX-I,e,v);f(),l(T),w({dragging:!0,wasPlaying:p}),n()},[e,v,f,l,p,n]),g=c.useCallback(E=>{var _;if(!a)throw new Error("Player has no size");if(!h.dragging)return;const I=(_=i.current)==null?void 0:_.getBoundingClientRect().left,T=uh(E.clientX-I,e,a.width);l(T)},[h.dragging,e,l,a]),y=c.useCallback(()=>{w({dragging:!1}),h.dragging&&(h.wasPlaying?u():f(),t())},[h,t,f,u]);c.useEffect(()=>{if(!h.dragging)return;const E=EI(i.current);return E.addEventListener("pointermove",g),E.addEventListener("pointerup",y),()=>{E.removeEventListener("pointermove",g),E.removeEventListener("pointerup",y)}},[h.dragging,g,y]);const x=c.useMemo(()=>({height:mi,width:mi,borderRadius:mi/2,position:"absolute",top:md-mi/2+5/2,backgroundColor:"white",left:Math.max(0,m/Math.max(1,e-1)*v-mi/2),boxShadow:"0 0 2px black",opacity:Number(s||h.dragging)}),[s,h.dragging,e,m,v]),b=c.useMemo(()=>({height:xo,backgroundColor:"rgba(255, 255, 255, 1)",width:(m-(r??0))/(e-1)*v,marginLeft:(r??0)/(e-1)*v,borderRadius:xo/2}),[e,m,r,v]),k=c.useMemo(()=>({height:xo,backgroundColor:"rgba(255, 255, 255, 0.25)",width:((o??e-1)-(r??0))/(e-1)*100+"%",marginLeft:(r??0)/(e-1)*100+"%",borderRadius:xo/2,position:"absolute"}),[e,r,o]);return d.jsxs("div",{ref:i,onPointerDown:S,style:bI,children:[d.jsxs("div",{style:SI,children:[d.jsx("div",{style:k}),d.jsx("div",{style:b})]}),d.jsx("div",{style:x})]})},ch=e=>{const t=Math.floor(e/60),n=Math.floor(e-t*60);return`${String(t)}:${String(n).padStart(2,"0")}`},CI=({durationInFrames:e,maxTimeLabelWidth:t,fps:n})=>{const r=ie.Timeline.useTimelinePosition(),o=c.useMemo(()=>({color:"white",fontFamily:"sans-serif",fontSize:14,maxWidth:t===null?void 0:t,overflow:"hidden",textOverflow:"ellipsis"}),[t]),s=r===e-1?r+1:r;return d.jsxs("div",{style:o,children:[ch(s/n)," / ",ch(e/n)]})},II=10,hd=12,TI=({allowFullscreen:e,playerWidth:t})=>c.useMemo(()=>{const r=lt,o=lt,i=e?fd:0,s=o+r+i+hd*2+II*2,a=t-s,l=Math.max(a,0),u=l-_r,p=(u<_r?l:u)+s+_r,m=t<p;return{maxTimeLabelWidth:l===0?null:l,displayVerticalVolumeSlider:m}},[e,t]),RI=[0,.013,.049,.104,.175,.259,.352,.45,.55,.648,.741,.825,.896,.951,.987],_I=[0,8.1,15.5,22.5,29,35.3,41.2,47.1,52.9,58.8,64.7,71,77.5,84.5,91.9],PI=1/.7,FI={boxSizing:"border-box",position:"absolute",bottom:0,width:"100%",paddingTop:40,paddingBottom:10,backgroundImage:`linear-gradient(to bottom,${RI.map((e,t)=>`hsla(0, 0%, 0%, ${e}) ${_I[t]*PI}%`).join(", ")}, hsl(0, 0%, 0%) 100%)`,backgroundSize:"auto 145px",display:"flex",paddingRight:hd,paddingLeft:hd,flexDirection:"column",transition:"opacity 0.3s"},jI={display:"flex",flexDirection:"row",width:"100%",alignItems:"center",justifyContent:"center",userSelect:"none",WebkitUserSelect:"none"},MI={display:"flex",flexDirection:"row",userSelect:"none",WebkitUserSelect:"none",alignItems:"center"},hi={width:12},$I={height:8},AI={flex:1},NI={},LI=({durationInFrames:e,isFullscreen:t,fps:n,showVolumeControls:r,onFullscreenButtonClick:o,allowFullscreen:i,onExitFullscreenButtonClick:s,spaceKeyToPlayOrPause:a,onSeekEnd:l,onSeekStart:u,inFrame:f,outFrame:p,initiallyShowControls:m,canvasSize:h,renderPlayPauseButton:w,renderFullscreenButton:v,alwaysShowControls:S,showPlaybackRateControl:g,containerRef:y,buffering:x,hideControlsWhenPointerDoesntMove:b,onPointerDown:k,onDoubleClick:E,renderMuteButton:I,renderVolumeSlider:T,playing:_,toggle:$,renderCustomControls:M})=>{const P=c.useRef(null),[D,O]=c.useState(!1),A=Yf(y,b),{maxTimeLabelWidth:Z,displayVerticalVolumeSlider:R}=TI({allowFullscreen:i,playerWidth:(h==null?void 0:h.width)??0}),[C,j]=c.useState(()=>{if(typeof m=="boolean")return m;if(typeof m=="number"){if(m%1!==0)throw new Error("initiallyShowControls must be an integer or a boolean");if(Number.isNaN(m))throw new Error("initiallyShowControls must not be NaN");if(!Number.isFinite(m))throw new Error("initiallyShowControls must be finite");if(m<=0)throw new Error("initiallyShowControls must be a positive integer");return m}throw new TypeError("initiallyShowControls must be a number or a boolean")}),F=c.useMemo(()=>({...FI,opacity:Number(A||!_||C||S)}),[A,C,_,S]);c.useEffect(()=>{P.current&&a&&P.current.focus({preventScroll:!0})},[_,a]),c.useEffect(()=>{O((typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled))??!1)},[]),c.useEffect(()=>{if(C===!1)return;const Y=setTimeout(()=>{j(!1)},C===!0?2e3:C);return()=>{clearInterval(Y)}},[C]);const V=c.useMemo(()=>{if(g===!0)return[.5,.8,1,1.2,1.5,1.8,2,2.5,3];if(Array.isArray(g)){for(const z of g){if(typeof z!="number")throw new Error("Every item in showPlaybackRateControl must be a number");if(z<=0)throw new Error("Every item in showPlaybackRateControl must be positive")}return g}return null},[g]),W=M?M():null,N=c.useRef(null),L=c.useRef(null),B=c.useCallback(z=>{(z.target===N.current||z.target===L.current)&&(k==null||k(z))},[k]),H=c.useCallback(z=>{(z.target===N.current||z.target===L.current)&&(E==null||E(z))},[E]);return d.jsxs("div",{ref:N,style:F,onPointerDown:B,onDoubleClick:H,children:[d.jsxs("div",{ref:L,style:jI,children:[d.jsxs("div",{style:MI,children:[d.jsx("button",{ref:P,type:"button",style:pd,onClick:$,"aria-label":_?"Pause video":"Play video",title:_?"Pause video":"Play video",children:w===null?d.jsx(ah,{buffering:x,playing:_}):w({playing:_,isBuffering:x})??d.jsx(ah,{buffering:x,playing:_})}),r?d.jsxs(d.Fragment,{children:[d.jsx("div",{style:hi}),d.jsx(aI,{renderMuteButton:I,renderVolumeSlider:T,displayVerticalVolumeSlider:R})]}):null,d.jsx("div",{style:hi}),d.jsx(CI,{durationInFrames:e,fps:n,maxTimeLabelWidth:Z}),d.jsx("div",{style:hi})]}),d.jsx("div",{style:AI}),W,W&&V&&h?d.jsx("div",{style:hi}):null,V&&h&&d.jsx(xI,{canvasSize:h,playbackRates:V}),V&&D&&i?d.jsx("div",{style:hi}):null,d.jsx("div",{style:NI,children:D&&i?d.jsx("button",{type:"button","aria-label":t?"Exit fullscreen":"Enter Fullscreen",title:t?"Exit fullscreen":"Enter Fullscreen",style:pd,onClick:t?s:o,children:v===null?d.jsx(D2,{isFullscreen:t}):v({isFullscreen:t})}):null})]}),d.jsx("div",{style:$I}),d.jsx(kI,{onSeekEnd:l,onSeekStart:u,durationInFrames:e,inFrame:f,outFrame:p})]})},Ew=typeof document>"u",zI=e=>{let t=!1;return{promise:new Promise((r,o)=>{e.then(i=>{if(t){o({isCanceled:t,value:i});return}r(i)}).catch(i=>{o({isCanceled:t,error:i})})}),cancel:()=>{t=!0}}},DI=e=>new Promise(t=>setTimeout(t,e)),OI=()=>{const e=c.useRef([]),t=c.useCallback(i=>{e.current=[...e.current,i]},[]),n=c.useCallback(i=>{e.current=e.current.filter(s=>s!==i)},[]),r=c.useCallback(()=>e.current.map(i=>i.cancel()),[]);return c.useMemo(()=>({appendPendingPromise:t,removePendingPromise:n,clearPendingPromises:r}),[t,r,n])},VI=(e,t,n)=>{const r=OI(),o=c.useCallback(async l=>{if(l instanceof PointerEvent?l.pointerType==="touch":l.nativeEvent.pointerType==="touch"){e(l);return}r.clearPendingPromises();const u=zI(DI(200));r.appendPendingPromise(u);try{await u.promise,r.removePendingPromise(u),e(l)}catch(f){const p=f;if(r.removePendingPromise(u),!p.isCanceled)throw p.error}},[r,e]),i=c.useCallback(()=>{document.addEventListener("pointerup",l=>{o(l)},{once:!0})},[o]),s=c.useCallback(()=>{r.clearPendingPromises(),t()},[r,t]);return c.useMemo(()=>n?{handlePointerDown:i,handleDoubleClick:s}:{handlePointerDown:e,handleDoubleClick:()=>{}},[n,s,i,e])},gd=J.version.split(".")[0];if(gd==="0")throw new Error(`Version ${gd} of "react" is not supported by Remotion`);var BI=parseInt(gd,10)>=18,WI=({controls:e,style:t,loop:n,autoPlay:r,allowFullscreen:o,inputProps:i,clickToPlay:s,showVolumeControls:a,doubleClickToFullscreen:l,spaceKeyToPlayOrPause:u,errorFallback:f,playbackRate:p,renderLoading:m,renderPoster:h,className:w,moveToBeginningWhenEnded:v,showPosterWhenUnplayed:S,showPosterWhenEnded:g,showPosterWhenPaused:y,showPosterWhenBuffering:x,showPosterWhenBufferingAndPaused:b,inFrame:k,outFrame:E,initiallyShowControls:I,renderFullscreen:T,renderPlayPauseButton:_,renderMuteButton:$,renderVolumeSlider:M,renderCustomControls:P,alwaysShowControls:D,showPlaybackRateControl:O,posterFillMode:A,bufferStateDelayInMilliseconds:Z,hideControlsWhenPointerDoesntMove:R,overflowVisible:C,browserMediaControlsBehavior:j,overrideInternalClassName:F,noSuspense:V},W)=>{const N=ie.useUnsafeVideoConfig(),L=ie.useVideo(),B=c.useRef(null),H=Kf(B,{triggerOnWindowResize:!1,shouldApplyCssTransforms:!1}),[z,Y]=c.useState(!1),[oe,ae]=c.useState(r),[ce,se]=c.useState(()=>!1),[G,ee]=c.useState(!1),Q=c.useMemo(()=>typeof document>"u"?!1:!!(document.fullscreenEnabled||document.webkitFullscreenEnabled),[]),q=ql(),he=q.toggle,{playerMuted:Ce,mediaVolume:ve}=c.useContext(ie.MediaVolumeContext);c.useEffect(()=>{q.emitter.dispatchVolumeChange(ve)},[q.emitter,ve]);const pe=Ce||ve===0;c.useEffect(()=>{q.emitter.dispatchMuteChange({isMuted:pe})},[q.emitter,pe]),eI({loop:n,playbackRate:p,moveToBeginningWhenEnded:v,inFrame:k,outFrame:E,getCurrentFrame:q.getCurrentFrame,browserMediaControlsBehavior:j,muted:pe}),c.useEffect(()=>{z&&!q.playing&&(Y(!1),q.play())},[z,q]),c.useEffect(()=>{const{current:xe}=B;if(!xe)return;const Ee=()=>{const tn=document.fullscreenElement===xe||document.webkitFullscreenElement===xe;se(tn)};return document.addEventListener("fullscreenchange",Ee),document.addEventListener("webkitfullscreenchange",Ee),()=>{document.removeEventListener("fullscreenchange",Ee),document.removeEventListener("webkitfullscreenchange",Ee)}},[]);const Re=c.useCallback(xe=>{he(xe)},[he]),be=c.useCallback(()=>{if(!o)throw new Error("allowFullscreen is false");if(!Q)throw new Error("Browser doesnt support fullscreen");if(!B.current)throw new Error("No player ref found");B.current.webkitRequestFullScreen?B.current.webkitRequestFullScreen():B.current.requestFullscreen()},[o,Q]),we=c.useCallback(()=>{document.webkitExitFullscreen?document.webkitExitFullscreen():document.exitFullscreen()},[]);c.useEffect(()=>{const{current:xe}=B;if(!xe)return;const Ee=()=>{const tn=document.webkitFullscreenElement??document.fullscreenElement;tn&&tn===B.current?q.emitter.dispatchFullscreenChange({isFullscreen:!0}):q.emitter.dispatchFullscreenChange({isFullscreen:!1})};return xe.addEventListener("webkitfullscreenchange",Ee),xe.addEventListener("fullscreenchange",Ee),()=>{xe.removeEventListener("webkitfullscreenchange",Ee),xe.removeEventListener("fullscreenchange",Ee)}},[q.emitter]);const Pe=(N==null?void 0:N.durationInFrames)??1,ue=c.useMemo(()=>!N||!H?null:hw({canvasSize:H,compositionHeight:N.height,compositionWidth:N.width,previewSize:"auto"}),[H,N]),Ge=(ue==null?void 0:ue.scale)??1,Et=c.useRef(!1);c.useEffect(()=>{if(!Et.current){Et.current=!0;return}q.emitter.dispatchScaleChange(Ge)},[q.emitter,Ge]);const{setMediaVolume:At,setPlayerMuted:kt}=c.useContext(ie.SetMediaVolumeContext),[mn,Un]=c.useState(!1);c.useEffect(()=>{let xe=null,Ee=!1;const tn=()=>{Ee=!1,requestAnimationFrame(()=>{Z===0?Un(!0):xe=setTimeout(()=>{Ee||Un(!0)},Z)})},Gr=()=>{requestAnimationFrame(()=>{Ee=!0,Un(!1),xe&&clearTimeout(xe)})};return q.emitter.addEventListener("waiting",tn),q.emitter.addEventListener("resume",Gr),()=>{q.emitter.removeEventListener("waiting",tn),q.emitter.removeEventListener("resume",Gr),Un(!1),xe&&clearTimeout(xe),Ee=!0}},[Z,q.emitter]),c.useImperativeHandle(W,()=>{const xe={play:q.play,pause:()=>{Y(!1),q.pause()},toggle:Re,getContainerNode:()=>B.current,getCurrentFrame:q.getCurrentFrame,isPlaying:q.isPlaying,seekTo:Ee=>{const tn=Pe-1,Gr=Math.max(0,Math.min(tn,Ee));q.isPlaying()&&(Y(Gr!==tn||n),q.pause()),Gr===tn&&!n&&q.emitter.dispatchEnded(),q.seek(Gr)},isFullscreen:()=>{const{current:Ee}=B;return Ee?document.fullscreenElement===Ee||document.webkitFullscreenElement===Ee:!1},requestFullscreen:be,exitFullscreen:we,getVolume:()=>Ce?0:ve,setVolume:Ee=>{if(typeof Ee!="number")throw new TypeError(`setVolume() takes a number, got value of type ${typeof Ee}`);if(isNaN(Ee))throw new TypeError("setVolume() got a number that is NaN. Volume must be between 0 and 1.");if(Ee<0||Ee>1)throw new TypeError(`setVolume() got a number that is out of range. Must be between 0 and 1, got ${Ee}`);At(Ee)},isMuted:()=>pe,mute:()=>{kt(!0)},unmute:()=>{kt(!1)},getScale:()=>Ge,pauseAndReturnToPlayStart:()=>{q.pauseAndReturnToPlayStart()}};return Object.assign(q.emitter,xe)},[Pe,we,n,Ce,pe,ve,q,be,kt,At,Re,Ge]);const Er=L?L.component:null,Ht=c.useMemo(()=>gw({canvasSize:H,config:N,style:t,overflowVisible:C,layout:ue}),[H,N,ue,C,t]),K=c.useMemo(()=>yw({config:N,layout:ue,scale:Ge,overflowVisible:C}),[N,ue,C,Ge]),te=c.useMemo(()=>vw({config:N,layout:ue,scale:Ge,overflowVisible:C}),[N,ue,C,Ge]),re=q.pause,Se=q.emitter.dispatchError,it=c.useCallback(xe=>{re(),Se(xe)},[Se,re]),Ct=c.useCallback(xe=>{xe.stopPropagation(),be()},[be]),ou=c.useCallback(xe=>{xe.stopPropagation(),we()},[we]),Es=c.useCallback(xe=>{(xe instanceof MouseEvent?xe.button===2:xe.nativeEvent.button)||Re(xe)},[Re]),ei=c.useCallback(()=>{ee(!0)},[]),iu=c.useCallback(()=>{ee(!1)},[]),It=c.useCallback(()=>{ce?we():be()},[we,ce,be]),{handlePointerDown:ks,handleDoubleClick:Cs}=VI(Es,It,l&&o&&Q);c.useEffect(()=>{oe&&(q.play(),ae(!1))},[oe,q]);const wx=c.useMemo(()=>m?m({height:Ht.height,width:Ht.width,isBuffering:mn}):null,[Ht.height,Ht.width,m,mn]),xx=c.useMemo(()=>({type:"scale",scale:Ge}),[Ge]);if(!N)return null;const Is=h?h({height:A==="player-size"?Ht.height:N.height,width:A==="player-size"?Ht.width:N.width,isBuffering:mn}):null;if(Is===void 0)throw new TypeError("renderPoster() must return a React element, but undefined was returned");const lp=Is&&[y&&!q.isPlaying()&&!G,g&&q.isLastFrame&&!q.isPlaying(),S&&!q.hasPlayed&&!q.isPlaying(),x&&mn&&q.isPlaying(),b&&mn&&!q.isPlaying()].some(Boolean),{left:y$,top:w$,width:x$,height:b$,...bx}=K,up=d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:K,onPointerDown:s?ks:void 0,onDoubleClick:l?Cs:void 0,children:[d.jsxs("div",{style:te,className:Xf(F),children:[Er?d.jsx(Sw,{onError:it,errorFallback:f,children:d.jsx(ie.CurrentScaleContext.Provider,{value:xx,children:d.jsx(Er,{...(L==null?void 0:L.props)??{},...i??{}})})}):null,lp&&A==="composition-size"?d.jsx("div",{style:{...bx,width:N.width,height:N.height},onPointerDown:s?ks:void 0,onDoubleClick:l?Cs:void 0,children:Is}):null]}),d.jsx(oI,{})]}),lp&&A==="player-size"?d.jsx("div",{style:K,onPointerDown:s?ks:void 0,onDoubleClick:l?Cs:void 0,children:Is}):null,e?d.jsx(LI,{fps:N.fps,playing:q.playing,toggle:q.toggle,durationInFrames:N.durationInFrames,containerRef:B,onFullscreenButtonClick:Ct,isFullscreen:ce,allowFullscreen:o,showVolumeControls:a,onExitFullscreenButtonClick:ou,spaceKeyToPlayOrPause:u,onSeekEnd:iu,onSeekStart:ei,inFrame:k,outFrame:E,initiallyShowControls:I,canvasSize:H,renderFullscreenButton:T,renderPlayPauseButton:_,alwaysShowControls:D,showPlaybackRateControl:O,buffering:mn,hideControlsWhenPointerDoesntMove:R,onDoubleClick:l?Cs:void 0,onPointerDown:s?ks:void 0,renderMuteButton:$,renderVolumeSlider:M,renderCustomControls:P}):null]});return V||Ew&&!BI?d.jsx("div",{ref:B,style:Ht,className:w,children:up}):d.jsx("div",{ref:B,style:Ht,className:w,children:d.jsx(c.Suspense,{fallback:wx,children:up})})},UI=c.forwardRef(WI),kw="remotion.volumePreference",HI=(e,t,n)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(n??kw,String(e))}catch(r){ie.Log.error({logLevel:t,tag:null},"Could not persist volume",r)}},ZI=e=>{if(typeof window>"u")return 1;try{const t=window.localStorage.getItem(e??kw);return t?Number(t):1}catch{return 1}},Gf="player-comp",Cw=({children:e,timelineContext:t,playbackRateContext:n,fps:r,compositionHeight:o,compositionWidth:i,durationInFrames:s,component:a,numberOfSharedAudioTags:l,initiallyMuted:u,logLevel:f,audioLatencyHint:p,sampleRate:m,volumePersistenceKey:h,initialVolume:w,inputProps:v,audioEnabled:S})=>{const g=w===void 0,y=c.useMemo(()=>({compositions:[{component:a,durationInFrames:s,height:o,width:i,fps:r,id:Gf,nonce:[[0,777]],folderName:null,parentFolderName:null,schema:null,calculateMetadata:null,stack:null}],folders:[],currentCompositionMetadata:{defaultCodec:null,defaultOutName:null,defaultPixelFormat:null,defaultProResProfile:null,defaultSampleRate:null,defaultVideoImageFormat:null,durationInFrames:s,fps:r,height:o,width:i,props:v},canvasContent:{type:"composition",compositionId:"player-comp"}}),[a,s,o,i,r,v]),[x,b]=c.useState(()=>u),[k,E]=c.useState(()=>g?ZI(h??null):w),I=c.useMemo(()=>({playerMuted:x,mediaVolume:k}),[x,k]),T=c.useRef(!1),_=T.current||S&&!x&&k>0;T.current=_;const $=c.useCallback(O=>{E(O),g&&HI(O,f,h??null)},[g,f,h]),M=c.useMemo(()=>({setPlayerMuted:b,setMediaVolume:$}),[$]),P=c.useMemo(()=>({logLevel:f,mountTime:Date.now()}),[f]),D=c.useMemo(()=>({isPlayer:!0,isRendering:!1,isStudio:!1,isClientSideRendering:!1,isReadOnlyStudio:!1}),[]);return d.jsx(ie.RemotionEnvironmentContext.Provider,{value:D,children:d.jsx(ie.LogLevelContext.Provider,{value:P,children:d.jsx(ie.CanUseRemotionHooksProvider,{children:d.jsx(ie.AbsoluteTimeContext.Provider,{value:t,children:d.jsx(ie.PlaybackRateContext.Provider,{value:n,children:d.jsx(ie.TimelineContext.Provider,{value:t,children:d.jsx(ie.CompositionManager.Provider,{value:y,children:d.jsx(ie.PrefetchProvider,{children:d.jsx(ie.DurationsContextProvider,{children:d.jsx(ie.MediaVolumeContext.Provider,{value:I,children:d.jsx(ie.SetMediaVolumeContext.Provider,{value:M,children:d.jsx(ie.BufferingProvider,{children:d.jsx(ie.SharedAudioContextProvider,{audioLatencyHint:p,audioEnabled:_,previewSampleRate:m,children:d.jsx(ie.SharedAudioTagsContextProvider,{numberOfAudioTags:l,children:e})})})})})})})})})})})})})})},dh=!1,YI=(e,t)=>{e||dh||(dh=!0,ie.Log.warn({logLevel:t,tag:null},"Note: Some companies are required to obtain a license to use Remotion. See: https://remotion.dev/license\nPass the `acknowledgeRemotionLicense` prop to `<Player />` function to make this message disappear."))},fh=(e,t)=>{if(typeof e>"u"||e===null)return e??null;if(typeof e!="number")throw new TypeError(`"${t}" must be a number, but is ${JSON.stringify(e)}`);if(Number.isNaN(e))throw new TypeError(`"${t}" must not be NaN, but is ${JSON.stringify(e)}`);if(!Number.isFinite(e))throw new TypeError(`"${t}" must be finite, but is ${JSON.stringify(e)}`);if(e%1!==0)throw new TypeError(`"${t}" must be an integer, but is ${JSON.stringify(e)}`);return e},KI=({inFrame:e,durationInFrames:t,outFrame:n})=>{const r=fh(e,"inFrame"),o=fh(n,"outFrame");if(!(r===null&&o===null)){if(r!==null&&r>t-1)throw new Error("inFrame must be less than (durationInFrames - 1), but is "+r);if(o!==null&&o>t-1)throw new Error("outFrame must be less than (durationInFrames - 1), but is "+o);if(r!==null&&r<0)throw new Error("inFrame must be greater than 0, but is "+r);if(o!==null&&o<=0)throw new Error(`outFrame must be greater than 0, but is ${o}. If you want to render a single frame, use <Thumbnail /> instead.`);if(o!==null&&r!==null&&o<=r)throw new Error("outFrame must be greater than inFrame, but is "+o+" <= "+r)}},XI=({initialFrame:e,durationInFrames:t})=>{if(typeof t!="number")throw new Error(`\`durationInFrames\` must be a number, but is ${JSON.stringify(t)}`);if(!(typeof e>"u")){if(typeof e!="number")throw new Error(`\`initialFrame\` must be a number, but is ${JSON.stringify(e)}`);if(Number.isNaN(e))throw new Error("`initialFrame` must be a number, but is NaN");if(!Number.isFinite(e))throw new Error("`initialFrame` must be a number, but is Infinity");if(e%1!==0)throw new Error(`\`initialFrame\` must be an integer, but is ${JSON.stringify(e)}`);if(e>t-1)throw new Error(`\`initialFrame\` must be less or equal than \`durationInFrames - 1\`, but is ${JSON.stringify(e)}`)}},GI=e=>{if(e!==void 0){if(e>10)throw new Error(`The highest possible playback rate is 10. You passed: ${e}`);if(e<-10)throw new Error(`The lowest possible playback rate is -10. You passed: ${e}`);if(e===0)throw new Error("A playback rate of 0 is not supported.")}},qI=Gl.validateFps,ph=Gl.validateDimension,QI=Gl.validateDurationInFrames,JI=Gl.validateDefaultAndInputProps,eT=e=>"component"in e?e.component:null,tT=({durationInFrames:e,compositionHeight:t,compositionWidth:n,fps:r,inputProps:o,style:i,controls:s=!1,loop:a=!1,autoPlay:l=!1,showVolumeControls:u=!0,allowFullscreen:f=!0,clickToPlay:p,doubleClickToFullscreen:m=!1,spaceKeyToPlayOrPause:h=!0,moveToBeginningWhenEnded:w=!0,numberOfSharedAudioTags:v=5,errorFallback:S=()=>"⚠️",playbackRate:g=1,renderLoading:y,className:x,showPosterWhenUnplayed:b,showPosterWhenEnded:k,showPosterWhenPaused:E,showPosterWhenBuffering:I,showPosterWhenBufferingAndPaused:T,initialFrame:_,renderPoster:$,inFrame:M,outFrame:P,initiallyShowControls:D,renderFullscreenButton:O,renderPlayPauseButton:A,renderVolumeSlider:Z,renderCustomControls:R,alwaysShowControls:C=!1,initiallyMuted:j=!1,showPlaybackRateControl:F=!1,posterFillMode:V="player-size",bufferStateDelayInMilliseconds:W,hideControlsWhenPointerDoesntMove:N=!0,overflowVisible:L=!1,renderMuteButton:B,browserMediaControlsBehavior:H,overrideInternalClassName:z,logLevel:Y="info",noSuspense:oe,acknowledgeRemotionLicense:ae,audioLatencyHint:ce="playback",sampleRate:se=48e3,volumePersistenceKey:G,initialVolume:ee,...Q},q)=>{if(typeof window<"u"&&(window.remotion_isPlayer=!0),Q.defaultProps!==void 0)throw new Error("The <Player /> component does not accept `defaultProps`, but some were passed. Use `inputProps` instead.");const he=eT(Q);if((he==null?void 0:he.type)===Qa)throw new TypeError("'component' should not be an instance of <Composition/>. Pass the React component directly, and set the duration, fps and dimensions as separate props. See https://www.remotion.dev/docs/player/examples for an example.");if(he===Qa)throw new TypeError("'component' must not be the 'Composition' component. Pass your own React component directly, and set the duration, fps and dimensions as separate props. See https://www.remotion.dev/docs/player/examples for an example.");c.useState(()=>YI(!!ae,Y));const Ce=ie.useLazyComponent({compProps:Q,componentName:"Player",noSuspense:!!oe});XI({initialFrame:_,durationInFrames:e});const[ve,pe]=c.useState(()=>({[Gf]:_??0})),[Re,be]=c.useState(!1),[we]=c.useState("player-comp"),Pe=c.useRef(null),ue=c.useRef([]),Ge=c.useRef(!1),[Et,At]=c.useState(g);if(typeof t!="number")throw new TypeError(`'compositionHeight' must be a number but got '${typeof t}' instead`);if(typeof n!="number")throw new TypeError(`'compositionWidth' must be a number but got '${typeof n}' instead`);if(ph(t,"compositionHeight","of the <Player /> component"),ph(n,"compositionWidth","of the <Player /> component"),QI(e,{component:"of the <Player/> component",allowFloats:!1}),qI(r,"as a prop of the <Player/> component",!1),JI(o,"inputProps",null),KI({durationInFrames:e,inFrame:M,outFrame:P}),typeof s!="boolean"&&typeof s<"u")throw new TypeError(`'controls' must be a boolean or undefined but got '${typeof s}' instead`);if(typeof l!="boolean"&&typeof l<"u")throw new TypeError(`'autoPlay' must be a boolean or undefined but got '${typeof l}' instead`);if(typeof a!="boolean"&&typeof a<"u")throw new TypeError(`'loop' must be a boolean or undefined but got '${typeof a}' instead`);if(typeof m!="boolean"&&typeof m<"u")throw new TypeError(`'doubleClickToFullscreen' must be a boolean or undefined but got '${typeof m}' instead`);if(typeof u!="boolean"&&typeof u<"u")throw new TypeError(`'showVolumeControls' must be a boolean or undefined but got '${typeof u}' instead`);if(typeof f!="boolean"&&typeof f<"u")throw new TypeError(`'allowFullscreen' must be a boolean or undefined but got '${typeof f}' instead`);if(typeof p!="boolean"&&typeof p<"u")throw new TypeError(`'clickToPlay' must be a boolean or undefined but got '${typeof p}' instead`);if(typeof h!="boolean"&&typeof h<"u")throw new TypeError(`'spaceKeyToPlayOrPause' must be a boolean or undefined but got '${typeof h}' instead`);if(typeof se!="number"||!Number.isFinite(se)||Number.isNaN(se)||se<=0||se%1!==0)throw new TypeError(`'sampleRate' must be a positive integer but got '${se}' instead`);if(typeof ee<"u"&&typeof ee!="number")throw new TypeError(`'initialVolume' must be a number or undefined but got '${typeof ee}' instead`);if(typeof ee=="number"&&(!Number.isFinite(ee)||Number.isNaN(ee)||ee<0||ee>1))throw new TypeError(`'initialVolume' must be between 0 and 1 but got '${ee}' instead`);if(typeof v!="number"||v%1!==0||!Number.isFinite(v)||Number.isNaN(v)||v<0)throw new TypeError(`'numberOfSharedAudioTags' must be an integer but got '${v}' instead`);GI(Et),c.useEffect(()=>{At(g)},[g]),c.useImperativeHandle(q,()=>Pe.current,[]),c.useState(()=>{ie.playbackLogging({logLevel:Y,message:`[player] Mounting <Player>. User agent = ${typeof navigator>"u"?"server":navigator.userAgent}`,tag:"player",mountTime:Date.now()})});const kt=c.useMemo(()=>({frame:ve,playing:Re,rootId:we,imperativePlaying:Ge,audioAndVideoTags:ue}),[ve,Re,we]),mn=c.useMemo(()=>({playbackRate:Et,setPlaybackRate:At}),[Et]),Un=c.useMemo(()=>({setFrame:pe,setPlaying:be}),[pe]);typeof window<"u"&&c.useLayoutEffect(()=>{ie.CSSUtils.injectCSS(ie.CSSUtils.makeDefaultPreviewCSS(`.${Xf(z)}`,"#fff"))},[z]);const Er=c.useMemo(()=>o??{},[o]),Ht=c.useMemo(()=>H??{mode:"prevent-media-session"},[H]);return d.jsx(ie.IsPlayerContextProvider,{children:d.jsx(Cw,{timelineContext:kt,playbackRateContext:mn,component:Ce,compositionHeight:t,compositionWidth:n,durationInFrames:e,fps:r,numberOfSharedAudioTags:v,initiallyMuted:j,logLevel:Y,audioLatencyHint:ce,sampleRate:se,volumePersistenceKey:G,initialVolume:ee,inputProps:Er,audioEnabled:!0,children:d.jsx(ie.SetTimelineContext.Provider,{value:Un,children:d.jsx(K2,{currentPlaybackRate:Et,children:d.jsx(UI,{ref:Pe,posterFillMode:V,renderLoading:y,autoPlay:!!l,loop:!!a,controls:!!s,errorFallback:S,style:i,inputProps:Er,allowFullscreen:!!f,moveToBeginningWhenEnded:!!w,clickToPlay:typeof p=="boolean"?p:!!s,showVolumeControls:!!u,doubleClickToFullscreen:!!m,spaceKeyToPlayOrPause:!!h,playbackRate:Et,className:x??void 0,showPosterWhenUnplayed:!!b,showPosterWhenEnded:!!k,showPosterWhenPaused:!!E,showPosterWhenBuffering:!!I,showPosterWhenBufferingAndPaused:!!T,renderPoster:$,inFrame:M??null,outFrame:P??null,initiallyShowControls:D??!0,renderFullscreen:O??null,renderPlayPauseButton:A??null,renderMuteButton:B??null,renderVolumeSlider:Z??null,renderCustomControls:R??null,alwaysShowControls:C,showPlaybackRateControl:F,bufferStateDelayInMilliseconds:W??300,hideControlsWhenPointerDoesntMove:N,overflowVisible:L,browserMediaControlsBehavior:Ht,overrideInternalClassName:z??void 0,noSuspense:!!oe})})})})})},nT=c.forwardRef,rT=nT(tT),oT=()=>{const e=c.useContext(xw);if(!e)throw new TypeError("Expected Player event emitter context");return c.useMemo(()=>({emitter:e}),[e])},vd=J.version.split(".")[0];if(vd==="0")throw new Error(`Version ${vd} of "react" is not supported by Remotion`);var iT=parseInt(vd,10)>=18,sT=({style:e,inputProps:t,errorFallback:n,renderLoading:r,className:o,overflowVisible:i,noSuspense:s,overrideInternalClassName:a},l)=>{const u=ie.useUnsafeVideoConfig(),f=ie.useVideo(),p=c.useRef(null),m=Kf(p,{triggerOnWindowResize:!1,shouldApplyCssTransforms:!1}),h=c.useMemo(()=>!u||!m?null:hw({canvasSize:m,compositionHeight:u.height,compositionWidth:u.width,previewSize:"auto"}),[m,u]),w=(h==null?void 0:h.scale)??1,v=oT();bw(v.emitter),c.useImperativeHandle(l,()=>{const T={getContainerNode:()=>p.current,getScale:()=>w};return Object.assign(v.emitter,T)},[w,v.emitter]);const S=f?f.component:null,g=c.useMemo(()=>gw({config:u,style:e,canvasSize:m,overflowVisible:i,layout:h}),[m,u,h,i,e]),y=c.useMemo(()=>yw({config:u,layout:h,scale:w,overflowVisible:i}),[u,h,i,w]),x=c.useMemo(()=>vw({config:u,layout:h,scale:w,overflowVisible:i}),[u,h,i,w]),b=c.useCallback(T=>{v.emitter.dispatchError(T)},[v.emitter]),k=c.useMemo(()=>r?r({height:g.height,width:g.width,isBuffering:!1}):null,[g.height,g.width,r]),E=c.useMemo(()=>({type:"scale",scale:w}),[w]);if(!u)return null;const I=d.jsx("div",{style:y,children:d.jsx("div",{style:x,className:Xf(a),children:S?d.jsx(Sw,{onError:b,errorFallback:n,children:d.jsx(ie.CurrentScaleContext.Provider,{value:E,children:d.jsx(S,{...(f==null?void 0:f.props)??{},...t??{}})})}):null})});return s||Ew&&!iT?d.jsx("div",{ref:p,style:g,className:o,children:I}):d.jsx("div",{ref:p,style:g,className:o,children:d.jsx(c.Suspense,{fallback:k,children:I})})},aT=c.forwardRef(sT),lT=({frameToDisplay:e,style:t,inputProps:n,compositionHeight:r,compositionWidth:o,durationInFrames:i,fps:s,className:a,errorFallback:l=()=>"⚠️",renderLoading:u,overflowVisible:f=!1,overrideInternalClassName:p,logLevel:m="info",noSuspense:h,...w},v)=>{typeof window<"u"&&c.useLayoutEffect(()=>{window.remotion_isPlayer=!0},[]);const[S]=c.useState(()=>String(Hr(null))),g=c.useRef(null),y=c.useMemo(()=>({playing:!1,frame:{[Gf]:e},rootId:S,imperativePlaying:{current:!1},audioAndVideoTags:{current:[]}}),[e,S]),x=c.useMemo(()=>({playbackRate:1,setPlaybackRate:()=>{throw new Error("thumbnail")}}),[]);c.useImperativeHandle(v,()=>g.current,[]);const b=ie.useLazyComponent({compProps:w,componentName:"Thumbnail",noSuspense:!!h}),[k]=c.useState(()=>new Y2),E=c.useMemo(()=>n??{},[n]);return d.jsx(ie.IsPlayerContextProvider,{children:d.jsx(Cw,{timelineContext:y,playbackRateContext:x,component:b,compositionHeight:r,compositionWidth:o,durationInFrames:i,fps:s,numberOfSharedAudioTags:0,initiallyMuted:!0,logLevel:m,audioLatencyHint:"playback",sampleRate:48e3,inputProps:E,audioEnabled:!1,children:d.jsx(xw.Provider,{value:k,children:d.jsx(aT,{ref:g,className:a,errorFallback:l,inputProps:E,renderLoading:u,style:t,overflowVisible:f,overrideInternalClassName:p,noSuspense:!!h})})})})},uT=c.forwardRef;uT(lT);const _o=[1,1.5,2,4];function mh(e){return _o.find(t=>t>e+1e-9)??_o[_o.length-1]}function cT(e,t){switch(t){case"L":return e.playing&&e.rate>0?{rate:mh(e.rate),playing:!0}:{rate:_o[0],playing:!0};case"J":return e.playing&&e.rate<0?{rate:-mh(-e.rate),playing:!0}:{rate:-_o[0],playing:!0};case"K":return{rate:_o[0],playing:!e.playing}}}function qf(e,t,n){const r=Math.round(e*n),o=Math.round(t*n);return{from:r,durationInFrames:Math.max(1,o-r)}}const dT=({src:e,spans:t,punchInScale:n=1.07,punchThresholdSec:r=.15,audioFadeSec:o=.01,background:i="black"})=>{const{fps:s}=Xe(),a=c.useMemo(()=>{const u=[];let f=!1;for(let p=0;p<t.length;p++){const m=t[p-1],h=m?t[p].srcIn-m.srcOut:0;p>0&&h>=r&&(f=!f),u.push(f?n:1)}return u},[t,n,r]),l=Math.max(1,Math.round(o*s));return d.jsx(fn,{style:{backgroundColor:i},children:t.map((u,f)=>{const{from:p,durationInFrames:m}=qf(u.outIn,u.outOut,s);return d.jsx(dt,{from:p,durationInFrames:m,premountFor:s,children:d.jsx(fn,{style:{transform:`scale(${a[f]})`},children:d.jsx(dw,{src:e,trimBefore:Math.round(u.srcIn*s),trimAfter:Math.round(u.srcOut*s),style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"var(--ossclip-obj-x, 50%) var(--ossclip-obj-y, 50%)"},volume:h=>Math.max(0,Math.min(1,(h+1)/l,(m-h)/l))})})},f)})})};function U(e,t,n){function r(a,l){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,l);for(const f in s.prototype)f in a||Object.defineProperty(a,f,{value:s.prototype[f].bind(a)});a._zod.constr=s,a._zod.def=l}const o=(n==null?void 0:n.Parent)??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var l;const u=n!=null&&n.Parent?new i:this;r(u,a),(l=u._zod).deferred??(l.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>{var l,u;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(u=(l=a==null?void 0:a._zod)==null?void 0:l.traits)==null?void 0:u.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class ns extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Iw={};function pr(e){return Iw}function fT(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function pT(e,t){return typeof t=="bigint"?t.toString():t}function Tw(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Qf(e){return e==null}function Jf(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function mT(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function Ae(e,t,n){Object.defineProperty(e,t,{get(){{const r=n();return e[t]=r,r}},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function ep(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function gi(e){return JSON.stringify(e)}const Rw=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function yd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const hT=Tw(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function ol(e){if(yd(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(yd(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}const gT=new Set(["string","number","symbol"]);function Ql(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xr(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function le(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function vT(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const yT={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function wT(e,t){const n={},r=e._zod.def;for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(n[o]=r.shape[o])}return Xr(e,{...e._zod.def,shape:n,checks:[]})}function xT(e,t){const n={...e._zod.def.shape},r=e._zod.def;for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete n[o]}return Xr(e,{...e._zod.def,shape:n,checks:[]})}function bT(e,t){if(!ol(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return ep(this,"shape",r),r},checks:[]};return Xr(e,n)}function ST(e,t){return Xr(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return ep(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function ET(e,t,n){const r=t._zod.def.shape,o={...r};if(n)for(const i in n){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=e?new e({type:"optional",innerType:r[i]}):r[i])}else for(const i in r)o[i]=e?new e({type:"optional",innerType:r[i]}):r[i];return Xr(t,{...t._zod.def,shape:o,checks:[]})}function kT(e,t,n){const r=t._zod.def.shape,o={...r};if(n)for(const i in n){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=new e({type:"nonoptional",innerType:r[i]}))}else for(const i in r)o[i]=new e({type:"nonoptional",innerType:r[i]});return Xr(t,{...t._zod.def,shape:o,checks:[]})}function Mi(e,t=0){var n;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function Pr(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function ea(e){return typeof e=="string"?e:e==null?void 0:e.message}function mr(e,t,n){var o,i,s,a,l,u;const r={...e,path:e.path??[]};if(!e.message){const f=ea((s=(i=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:i.error)==null?void 0:s.call(i,e))??ea((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??ea((l=n.customError)==null?void 0:l.call(n,e))??ea((u=n.localeError)==null?void 0:u.call(n,e))??"Invalid input";r.message=f}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function tp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function rs(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const _w=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,pT,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Pw=U("$ZodError",_w),Fw=U("$ZodError",_w,{Parent:Error});function CT(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function IT(e,t){const n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>o({issues:a}));else if(s.code==="invalid_key")o({issues:s.issues});else if(s.code==="invalid_element")o({issues:s.issues});else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const u=s.path[l];l===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(s))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return o(e),r}const TT=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new ns;if(s.issues.length){const a=new((o==null?void 0:o.Err)??e)(s.issues.map(l=>mr(l,i,pr())));throw Rw(a,o==null?void 0:o.callee),a}return s.value},RT=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new((o==null?void 0:o.Err)??e)(s.issues.map(l=>mr(l,i,pr())));throw Rw(a,o==null?void 0:o.callee),a}return s.value},jw=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new ns;return i.issues.length?{success:!1,error:new(e??Pw)(i.issues.map(s=>mr(s,o,pr())))}:{success:!0,data:i.value}},_T=jw(Fw),Mw=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>mr(s,o,pr())))}:{success:!0,data:i.value}},PT=Mw(Fw),FT=/^[cC][^\s-]{8,}$/,jT=/^[0-9a-z]+$/,MT=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$T=/^[0-9a-vA-V]{20}$/,AT=/^[A-Za-z0-9]{27}$/,NT=/^[a-zA-Z0-9_-]{21}$/,LT=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zT=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,hh=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,DT=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,OT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function VT(){return new RegExp(OT,"u")}const BT=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,WT=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,UT=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,HT=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ZT=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$w=/^[A-Za-z0-9_-]*$/,YT=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,KT=/^\+(?:[0-9]){6,14}[0-9]$/,Aw="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",XT=new RegExp(`^${Aw}$`);function Nw(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function GT(e){return new RegExp(`^${Nw(e)}$`)}function qT(e){const t=Nw({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Aw}T(?:${r})$`)}const QT=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},JT=/^\d+$/,eR=/^-?\d+(?:\.\d+)?/i,tR=/true|false/i,nR=/^[^A-Z]*$/,rR=/^[^a-z]*$/,Mt=U("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Lw={number:"number",bigint:"bigint",object:"date"},zw=U("$ZodCheckLessThan",(e,t)=>{Mt.init(e,t);const n=Lw[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Dw=U("$ZodCheckGreaterThan",(e,t)=>{Mt.init(e,t);const n=Lw[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),oR=U("$ZodCheckMultipleOf",(e,t)=>{Mt.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):mT(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),iR=U("$ZodCheckNumberFormat",(e,t)=>{var s;Mt.init(e,t),t.format=t.format||"float64";const n=(s=t.format)==null?void 0:s.includes("int"),r=n?"int":"number",[o,i]=yT[t.format];e._zod.onattach.push(a=>{const l=a._zod.bag;l.format=t.format,l.minimum=o,l.maximum=i,n&&(l.pattern=JT)}),e._zod.check=a=>{const l=a.value;if(n){if(!Number.isInteger(l)){a.issues.push({expected:r,format:t.format,code:"invalid_type",input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}l<o&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>i&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inst:e})}}),sR=U("$ZodCheckMaxLength",(e,t)=>{var n;Mt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Qf(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const s=tp(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),aR=U("$ZodCheckMinLength",(e,t)=>{var n;Mt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Qf(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const s=tp(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),lR=U("$ZodCheckLengthEquals",(e,t)=>{var n;Mt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Qf(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const s=tp(o),a=i>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Jl=U("$ZodCheckStringFormat",(e,t)=>{var n,r;Mt.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),uR=U("$ZodCheckRegex",(e,t)=>{Jl.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),cR=U("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=nR),Jl.init(e,t)}),dR=U("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=rR),Jl.init(e,t)}),fR=U("$ZodCheckIncludes",(e,t)=>{Mt.init(e,t);const n=Ql(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),pR=U("$ZodCheckStartsWith",(e,t)=>{Mt.init(e,t);const n=new RegExp(`^${Ql(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),mR=U("$ZodCheckEndsWith",(e,t)=>{Mt.init(e,t);const n=new RegExp(`.*${Ql(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),hR=U("$ZodCheckOverwrite",(e,t)=>{Mt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class gR{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
134
|
+
`;return d.jsxs("div",{style:i,children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:f}}),d.jsx("input",{ref:r,"aria-label":"Change volume",className:a,max:1,min:0,onBlur:n,onChange:l,step:.01,type:"range",value:e,style:u})]})},sI=e=>d.jsx(iI,{...e}),_r=100,aI=({displayVerticalVolumeSlider:e,renderMuteButton:t,renderVolumeSlider:n})=>{const[r,o]=ie.usePlayerMutedState(),[i,s]=ie.useMediaVolumeState(),[a,l]=c.useState(!1),u=c.useRef(null),f=c.useRef(null),p=Yf(u,!1),m=c.useCallback(()=>{setTimeout(()=>{f.current&&document.activeElement!==f.current&&l(!1)},10)},[]),h=i===0,y=c.useCallback(()=>{if(h){s(1),o(!1);return}o(b=>!b)},[h,o,s]),g=c.useMemo(()=>({display:"inline-flex",background:"none",border:"none",justifyContent:"center",alignItems:"center",touchAction:"none",...e&&{position:"relative"}}),[e]),S=c.useMemo(()=>({display:"inline",width:lt,height:lt,cursor:"pointer",appearance:"none",background:"none",border:"none",padding:0}),[]),v=c.useCallback(({muted:b,volume:k})=>{const E=b||k===0;return d.jsx("button",{"aria-label":E?"Unmute sound":"Mute sound",title:E?"Unmute sound":"Mute sound",onClick:y,onBlur:m,onFocus:()=>l(!0),style:S,type:"button",children:E?d.jsx(O2,{}):d.jsx(V2,{})})},[m,y,S]),w=c.useMemo(()=>t?t({muted:r,volume:i}):v({muted:r,volume:i}),[r,i,v,t]),x=c.useMemo(()=>(a||p)&&!r&&!ie.isIosSafari()?(n??sI)({isVertical:e,volume:i,onBlur:()=>l(!1),inputRef:f,setVolume:s}):null,[e,a,p,r,i,n,s]);return d.jsxs("div",{ref:u,style:g,children:[w,x]})};function lI(e){const[t,n]=c.useState(e),r=c.useRef(null);return c.useEffect(()=>{const o=i=>{r.current&&!r.current.contains(i.target)&&n(!1)};return document.addEventListener("pointerup",o,!0),()=>{document.removeEventListener("pointerup",o,!0)}},[]),{ref:r,isComponentVisible:t,setIsComponentVisible:n}}var uI=35,cI=70,dI={height:30,paddingRight:15,paddingLeft:12,display:"flex",flexDirection:"row",alignItems:"center"},fI={width:22,display:"flex",alignItems:"center"},pI={width:14,height:14,color:"black"},mI=()=>d.jsx("svg",{viewBox:"0 0 512 512",style:pI,children:d.jsx("path",{fill:"currentColor",d:"M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"})}),hI=e=>{const t=e.toString();return t.includes(".")?t:t+".0"},gI=({rate:e,onSelect:t,selectedRate:n,keyboardSelectedRate:r})=>{const o=c.useCallback(p=>{p.stopPropagation(),p.preventDefault(),t(e)},[t,e]),[i,s]=c.useState(!1),a=c.useCallback(()=>{s(!0)},[]),l=c.useCallback(()=>{s(!1)},[]),u=r===e,f=c.useMemo(()=>({...dI,backgroundColor:i||u?"#eee":"transparent"}),[i,u]);return d.jsxs("div",{onPointerEnter:a,onPointerLeave:l,tabIndex:0,style:f,onClick:o,children:[d.jsx("div",{style:fI,children:e===n?d.jsx(mI,{}):null}),hI(e),"x"]},e)},vI=({setIsComponentVisible:e,playbackRates:t,canvasSize:n})=>{const{setPlaybackRate:r,playbackRate:o}=ie.usePlaybackRate(),[i,s]=c.useState(o);c.useEffect(()=>{const u=f=>{if(f.preventDefault(),f.key==="ArrowUp"){const p=t.findIndex(m=>m===i);if(p===0)return;s(p===-1?t[0]:t[p-1])}else if(f.key==="ArrowDown"){const p=t.findIndex(m=>m===i);if(p===t.length-1)return;s(p===-1?t[t.length-1]:t[p+1])}else f.key==="Enter"&&(r(i),e(!1))};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[t,i,r,e]);const a=c.useCallback(u=>{r(u),e(!1)},[e,r]),l=c.useMemo(()=>({position:"absolute",right:0,width:125,maxHeight:n.height-cI-uI,bottom:35,background:"#fff",borderRadius:4,overflow:"auto",color:"black",textAlign:"left"}),[n.height]);return d.jsx("div",{style:l,children:t.map(u=>d.jsx(gI,{selectedRate:o,onSelect:a,rate:u,keyboardSelectedRate:i},u))})},yI={fontSize:13,fontWeight:"bold",color:"white",border:"2px solid white",borderRadius:20,paddingLeft:8,paddingRight:8,paddingTop:2,paddingBottom:2},pd={appearance:"none",backgroundColor:"transparent",border:"none",cursor:"pointer",paddingLeft:0,paddingRight:0,paddingTop:6,paddingBottom:6,height:37,display:"inline-flex",marginBottom:0,marginTop:0,alignItems:"center"},wI={...pd,position:"relative"},xI=({playbackRates:e,canvasSize:t})=>{const{ref:n,isComponentVisible:r,setIsComponentVisible:o}=lI(!1),{playbackRate:i}=ie.usePlaybackRate(),s=c.useCallback(a=>{a.stopPropagation(),a.preventDefault(),o(l=>!l)},[o]);return d.jsx("div",{ref:n,children:d.jsxs("button",{type:"button","aria-label":"Change playback rate",style:wI,onClick:s,children:[d.jsxs("div",{style:yI,children:[i,"x"]}),r&&d.jsx(vI,{canvasSize:t,playbackRates:e,setIsComponentVisible:o})]})})},uh=(e,t,n)=>Math.round(Ko(e,[0,n],[0,t-1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"})),xo=5,mi=12,md=4,bI={userSelect:"none",WebkitUserSelect:"none",paddingTop:md,paddingBottom:md,boxSizing:"border-box",cursor:"pointer",position:"relative",touchAction:"none"},SI={height:xo,backgroundColor:"rgba(255, 255, 255, 0.25)",width:"100%",borderRadius:xo/2},EI=e=>{let t=e;for(;t.parentElement;)t=t.parentElement;return t},kI=({durationInFrames:e,onSeekEnd:t,onSeekStart:n,inFrame:r,outFrame:o})=>{const i=c.useRef(null),s=Yf(i,!1),a=Kf(i,{triggerOnWindowResize:!0,shouldApplyCssTransforms:!0}),{seek:l,play:u,pause:f,playing:p}=ql(),m=ie.Timeline.useTimelinePosition(),[h,y]=c.useState({dragging:!1}),g=(a==null?void 0:a.width)??0,S=c.useCallback(E=>{var _;if(E.button!==0)return;const I=(_=i.current)==null?void 0:_.getBoundingClientRect().left,T=uh(E.clientX-I,e,g);f(),l(T),y({dragging:!0,wasPlaying:p}),n()},[e,g,f,l,p,n]),v=c.useCallback(E=>{var _;if(!a)throw new Error("Player has no size");if(!h.dragging)return;const I=(_=i.current)==null?void 0:_.getBoundingClientRect().left,T=uh(E.clientX-I,e,a.width);l(T)},[h.dragging,e,l,a]),w=c.useCallback(()=>{y({dragging:!1}),h.dragging&&(h.wasPlaying?u():f(),t())},[h,t,f,u]);c.useEffect(()=>{if(!h.dragging)return;const E=EI(i.current);return E.addEventListener("pointermove",v),E.addEventListener("pointerup",w),()=>{E.removeEventListener("pointermove",v),E.removeEventListener("pointerup",w)}},[h.dragging,v,w]);const x=c.useMemo(()=>({height:mi,width:mi,borderRadius:mi/2,position:"absolute",top:md-mi/2+5/2,backgroundColor:"white",left:Math.max(0,m/Math.max(1,e-1)*g-mi/2),boxShadow:"0 0 2px black",opacity:Number(s||h.dragging)}),[s,h.dragging,e,m,g]),b=c.useMemo(()=>({height:xo,backgroundColor:"rgba(255, 255, 255, 1)",width:(m-(r??0))/(e-1)*g,marginLeft:(r??0)/(e-1)*g,borderRadius:xo/2}),[e,m,r,g]),k=c.useMemo(()=>({height:xo,backgroundColor:"rgba(255, 255, 255, 0.25)",width:((o??e-1)-(r??0))/(e-1)*100+"%",marginLeft:(r??0)/(e-1)*100+"%",borderRadius:xo/2,position:"absolute"}),[e,r,o]);return d.jsxs("div",{ref:i,onPointerDown:S,style:bI,children:[d.jsxs("div",{style:SI,children:[d.jsx("div",{style:k}),d.jsx("div",{style:b})]}),d.jsx("div",{style:x})]})},ch=e=>{const t=Math.floor(e/60),n=Math.floor(e-t*60);return`${String(t)}:${String(n).padStart(2,"0")}`},CI=({durationInFrames:e,maxTimeLabelWidth:t,fps:n})=>{const r=ie.Timeline.useTimelinePosition(),o=c.useMemo(()=>({color:"white",fontFamily:"sans-serif",fontSize:14,maxWidth:t===null?void 0:t,overflow:"hidden",textOverflow:"ellipsis"}),[t]),s=r===e-1?r+1:r;return d.jsxs("div",{style:o,children:[ch(s/n)," / ",ch(e/n)]})},II=10,hd=12,TI=({allowFullscreen:e,playerWidth:t})=>c.useMemo(()=>{const r=lt,o=lt,i=e?fd:0,s=o+r+i+hd*2+II*2,a=t-s,l=Math.max(a,0),u=l-_r,p=(u<_r?l:u)+s+_r,m=t<p;return{maxTimeLabelWidth:l===0?null:l,displayVerticalVolumeSlider:m}},[e,t]),RI=[0,.013,.049,.104,.175,.259,.352,.45,.55,.648,.741,.825,.896,.951,.987],_I=[0,8.1,15.5,22.5,29,35.3,41.2,47.1,52.9,58.8,64.7,71,77.5,84.5,91.9],PI=1/.7,FI={boxSizing:"border-box",position:"absolute",bottom:0,width:"100%",paddingTop:40,paddingBottom:10,backgroundImage:`linear-gradient(to bottom,${RI.map((e,t)=>`hsla(0, 0%, 0%, ${e}) ${_I[t]*PI}%`).join(", ")}, hsl(0, 0%, 0%) 100%)`,backgroundSize:"auto 145px",display:"flex",paddingRight:hd,paddingLeft:hd,flexDirection:"column",transition:"opacity 0.3s"},jI={display:"flex",flexDirection:"row",width:"100%",alignItems:"center",justifyContent:"center",userSelect:"none",WebkitUserSelect:"none"},MI={display:"flex",flexDirection:"row",userSelect:"none",WebkitUserSelect:"none",alignItems:"center"},hi={width:12},$I={height:8},AI={flex:1},NI={},LI=({durationInFrames:e,isFullscreen:t,fps:n,showVolumeControls:r,onFullscreenButtonClick:o,allowFullscreen:i,onExitFullscreenButtonClick:s,spaceKeyToPlayOrPause:a,onSeekEnd:l,onSeekStart:u,inFrame:f,outFrame:p,initiallyShowControls:m,canvasSize:h,renderPlayPauseButton:y,renderFullscreenButton:g,alwaysShowControls:S,showPlaybackRateControl:v,containerRef:w,buffering:x,hideControlsWhenPointerDoesntMove:b,onPointerDown:k,onDoubleClick:E,renderMuteButton:I,renderVolumeSlider:T,playing:_,toggle:$,renderCustomControls:j})=>{const L=c.useRef(null),[M,O]=c.useState(!1),Z=Yf(w,b),{maxTimeLabelWidth:D,displayVerticalVolumeSlider:R}=TI({allowFullscreen:i,playerWidth:(h==null?void 0:h.width)??0}),[C,F]=c.useState(()=>{if(typeof m=="boolean")return m;if(typeof m=="number"){if(m%1!==0)throw new Error("initiallyShowControls must be an integer or a boolean");if(Number.isNaN(m))throw new Error("initiallyShowControls must not be NaN");if(!Number.isFinite(m))throw new Error("initiallyShowControls must be finite");if(m<=0)throw new Error("initiallyShowControls must be a positive integer");return m}throw new TypeError("initiallyShowControls must be a number or a boolean")}),P=c.useMemo(()=>({...FI,opacity:Number(Z||!_||C||S)}),[Z,C,_,S]);c.useEffect(()=>{L.current&&a&&L.current.focus({preventScroll:!0})},[_,a]),c.useEffect(()=>{O((typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled))??!1)},[]),c.useEffect(()=>{if(C===!1)return;const Y=setTimeout(()=>{F(!1)},C===!0?2e3:C);return()=>{clearInterval(Y)}},[C]);const V=c.useMemo(()=>{if(v===!0)return[.5,.8,1,1.2,1.5,1.8,2,2.5,3];if(Array.isArray(v)){for(const z of v){if(typeof z!="number")throw new Error("Every item in showPlaybackRateControl must be a number");if(z<=0)throw new Error("Every item in showPlaybackRateControl must be positive")}return v}return null},[v]),W=j?j():null,N=c.useRef(null),A=c.useRef(null),B=c.useCallback(z=>{(z.target===N.current||z.target===A.current)&&(k==null||k(z))},[k]),H=c.useCallback(z=>{(z.target===N.current||z.target===A.current)&&(E==null||E(z))},[E]);return d.jsxs("div",{ref:N,style:P,onPointerDown:B,onDoubleClick:H,children:[d.jsxs("div",{ref:A,style:jI,children:[d.jsxs("div",{style:MI,children:[d.jsx("button",{ref:L,type:"button",style:pd,onClick:$,"aria-label":_?"Pause video":"Play video",title:_?"Pause video":"Play video",children:y===null?d.jsx(ah,{buffering:x,playing:_}):y({playing:_,isBuffering:x})??d.jsx(ah,{buffering:x,playing:_})}),r?d.jsxs(d.Fragment,{children:[d.jsx("div",{style:hi}),d.jsx(aI,{renderMuteButton:I,renderVolumeSlider:T,displayVerticalVolumeSlider:R})]}):null,d.jsx("div",{style:hi}),d.jsx(CI,{durationInFrames:e,fps:n,maxTimeLabelWidth:D}),d.jsx("div",{style:hi})]}),d.jsx("div",{style:AI}),W,W&&V&&h?d.jsx("div",{style:hi}):null,V&&h&&d.jsx(xI,{canvasSize:h,playbackRates:V}),V&&M&&i?d.jsx("div",{style:hi}):null,d.jsx("div",{style:NI,children:M&&i?d.jsx("button",{type:"button","aria-label":t?"Exit fullscreen":"Enter Fullscreen",title:t?"Exit fullscreen":"Enter Fullscreen",style:pd,onClick:t?s:o,children:g===null?d.jsx(D2,{isFullscreen:t}):g({isFullscreen:t})}):null})]}),d.jsx("div",{style:$I}),d.jsx(kI,{onSeekEnd:l,onSeekStart:u,durationInFrames:e,inFrame:f,outFrame:p})]})},Ew=typeof document>"u",zI=e=>{let t=!1;return{promise:new Promise((r,o)=>{e.then(i=>{if(t){o({isCanceled:t,value:i});return}r(i)}).catch(i=>{o({isCanceled:t,error:i})})}),cancel:()=>{t=!0}}},DI=e=>new Promise(t=>setTimeout(t,e)),OI=()=>{const e=c.useRef([]),t=c.useCallback(i=>{e.current=[...e.current,i]},[]),n=c.useCallback(i=>{e.current=e.current.filter(s=>s!==i)},[]),r=c.useCallback(()=>e.current.map(i=>i.cancel()),[]);return c.useMemo(()=>({appendPendingPromise:t,removePendingPromise:n,clearPendingPromises:r}),[t,r,n])},VI=(e,t,n)=>{const r=OI(),o=c.useCallback(async l=>{if(l instanceof PointerEvent?l.pointerType==="touch":l.nativeEvent.pointerType==="touch"){e(l);return}r.clearPendingPromises();const u=zI(DI(200));r.appendPendingPromise(u);try{await u.promise,r.removePendingPromise(u),e(l)}catch(f){const p=f;if(r.removePendingPromise(u),!p.isCanceled)throw p.error}},[r,e]),i=c.useCallback(()=>{document.addEventListener("pointerup",l=>{o(l)},{once:!0})},[o]),s=c.useCallback(()=>{r.clearPendingPromises(),t()},[r,t]);return c.useMemo(()=>n?{handlePointerDown:i,handleDoubleClick:s}:{handlePointerDown:e,handleDoubleClick:()=>{}},[n,s,i,e])},gd=J.version.split(".")[0];if(gd==="0")throw new Error(`Version ${gd} of "react" is not supported by Remotion`);var BI=parseInt(gd,10)>=18,WI=({controls:e,style:t,loop:n,autoPlay:r,allowFullscreen:o,inputProps:i,clickToPlay:s,showVolumeControls:a,doubleClickToFullscreen:l,spaceKeyToPlayOrPause:u,errorFallback:f,playbackRate:p,renderLoading:m,renderPoster:h,className:y,moveToBeginningWhenEnded:g,showPosterWhenUnplayed:S,showPosterWhenEnded:v,showPosterWhenPaused:w,showPosterWhenBuffering:x,showPosterWhenBufferingAndPaused:b,inFrame:k,outFrame:E,initiallyShowControls:I,renderFullscreen:T,renderPlayPauseButton:_,renderMuteButton:$,renderVolumeSlider:j,renderCustomControls:L,alwaysShowControls:M,showPlaybackRateControl:O,posterFillMode:Z,bufferStateDelayInMilliseconds:D,hideControlsWhenPointerDoesntMove:R,overflowVisible:C,browserMediaControlsBehavior:F,overrideInternalClassName:P,noSuspense:V},W)=>{const N=ie.useUnsafeVideoConfig(),A=ie.useVideo(),B=c.useRef(null),H=Kf(B,{triggerOnWindowResize:!1,shouldApplyCssTransforms:!1}),[z,Y]=c.useState(!1),[oe,ae]=c.useState(r),[ce,se]=c.useState(()=>!1),[G,ee]=c.useState(!1),Q=c.useMemo(()=>typeof document>"u"?!1:!!(document.fullscreenEnabled||document.webkitFullscreenEnabled),[]),q=ql(),he=q.toggle,{playerMuted:Ce,mediaVolume:ve}=c.useContext(ie.MediaVolumeContext);c.useEffect(()=>{q.emitter.dispatchVolumeChange(ve)},[q.emitter,ve]);const pe=Ce||ve===0;c.useEffect(()=>{q.emitter.dispatchMuteChange({isMuted:pe})},[q.emitter,pe]),eI({loop:n,playbackRate:p,moveToBeginningWhenEnded:g,inFrame:k,outFrame:E,getCurrentFrame:q.getCurrentFrame,browserMediaControlsBehavior:F,muted:pe}),c.useEffect(()=>{z&&!q.playing&&(Y(!1),q.play())},[z,q]),c.useEffect(()=>{const{current:xe}=B;if(!xe)return;const Ee=()=>{const tn=document.fullscreenElement===xe||document.webkitFullscreenElement===xe;se(tn)};return document.addEventListener("fullscreenchange",Ee),document.addEventListener("webkitfullscreenchange",Ee),()=>{document.removeEventListener("fullscreenchange",Ee),document.removeEventListener("webkitfullscreenchange",Ee)}},[]);const Re=c.useCallback(xe=>{he(xe)},[he]),be=c.useCallback(()=>{if(!o)throw new Error("allowFullscreen is false");if(!Q)throw new Error("Browser doesnt support fullscreen");if(!B.current)throw new Error("No player ref found");B.current.webkitRequestFullScreen?B.current.webkitRequestFullScreen():B.current.requestFullscreen()},[o,Q]),we=c.useCallback(()=>{document.webkitExitFullscreen?document.webkitExitFullscreen():document.exitFullscreen()},[]);c.useEffect(()=>{const{current:xe}=B;if(!xe)return;const Ee=()=>{const tn=document.webkitFullscreenElement??document.fullscreenElement;tn&&tn===B.current?q.emitter.dispatchFullscreenChange({isFullscreen:!0}):q.emitter.dispatchFullscreenChange({isFullscreen:!1})};return xe.addEventListener("webkitfullscreenchange",Ee),xe.addEventListener("fullscreenchange",Ee),()=>{xe.removeEventListener("webkitfullscreenchange",Ee),xe.removeEventListener("fullscreenchange",Ee)}},[q.emitter]);const Pe=(N==null?void 0:N.durationInFrames)??1,ue=c.useMemo(()=>!N||!H?null:hw({canvasSize:H,compositionHeight:N.height,compositionWidth:N.width,previewSize:"auto"}),[H,N]),Ge=(ue==null?void 0:ue.scale)??1,Et=c.useRef(!1);c.useEffect(()=>{if(!Et.current){Et.current=!0;return}q.emitter.dispatchScaleChange(Ge)},[q.emitter,Ge]);const{setMediaVolume:At,setPlayerMuted:kt}=c.useContext(ie.SetMediaVolumeContext),[hn,Un]=c.useState(!1);c.useEffect(()=>{let xe=null,Ee=!1;const tn=()=>{Ee=!1,requestAnimationFrame(()=>{D===0?Un(!0):xe=setTimeout(()=>{Ee||Un(!0)},D)})},Gr=()=>{requestAnimationFrame(()=>{Ee=!0,Un(!1),xe&&clearTimeout(xe)})};return q.emitter.addEventListener("waiting",tn),q.emitter.addEventListener("resume",Gr),()=>{q.emitter.removeEventListener("waiting",tn),q.emitter.removeEventListener("resume",Gr),Un(!1),xe&&clearTimeout(xe),Ee=!0}},[D,q.emitter]),c.useImperativeHandle(W,()=>{const xe={play:q.play,pause:()=>{Y(!1),q.pause()},toggle:Re,getContainerNode:()=>B.current,getCurrentFrame:q.getCurrentFrame,isPlaying:q.isPlaying,seekTo:Ee=>{const tn=Pe-1,Gr=Math.max(0,Math.min(tn,Ee));q.isPlaying()&&(Y(Gr!==tn||n),q.pause()),Gr===tn&&!n&&q.emitter.dispatchEnded(),q.seek(Gr)},isFullscreen:()=>{const{current:Ee}=B;return Ee?document.fullscreenElement===Ee||document.webkitFullscreenElement===Ee:!1},requestFullscreen:be,exitFullscreen:we,getVolume:()=>Ce?0:ve,setVolume:Ee=>{if(typeof Ee!="number")throw new TypeError(`setVolume() takes a number, got value of type ${typeof Ee}`);if(isNaN(Ee))throw new TypeError("setVolume() got a number that is NaN. Volume must be between 0 and 1.");if(Ee<0||Ee>1)throw new TypeError(`setVolume() got a number that is out of range. Must be between 0 and 1, got ${Ee}`);At(Ee)},isMuted:()=>pe,mute:()=>{kt(!0)},unmute:()=>{kt(!1)},getScale:()=>Ge,pauseAndReturnToPlayStart:()=>{q.pauseAndReturnToPlayStart()}};return Object.assign(q.emitter,xe)},[Pe,we,n,Ce,pe,ve,q,be,kt,At,Re,Ge]);const Er=A?A.component:null,Ht=c.useMemo(()=>gw({canvasSize:H,config:N,style:t,overflowVisible:C,layout:ue}),[H,N,ue,C,t]),K=c.useMemo(()=>yw({config:N,layout:ue,scale:Ge,overflowVisible:C}),[N,ue,C,Ge]),te=c.useMemo(()=>vw({config:N,layout:ue,scale:Ge,overflowVisible:C}),[N,ue,C,Ge]),re=q.pause,Se=q.emitter.dispatchError,it=c.useCallback(xe=>{re(),Se(xe)},[Se,re]),Ct=c.useCallback(xe=>{xe.stopPropagation(),be()},[be]),ou=c.useCallback(xe=>{xe.stopPropagation(),we()},[we]),Es=c.useCallback(xe=>{(xe instanceof MouseEvent?xe.button===2:xe.nativeEvent.button)||Re(xe)},[Re]),ei=c.useCallback(()=>{ee(!0)},[]),iu=c.useCallback(()=>{ee(!1)},[]),It=c.useCallback(()=>{ce?we():be()},[we,ce,be]),{handlePointerDown:ks,handleDoubleClick:Cs}=VI(Es,It,l&&o&&Q);c.useEffect(()=>{oe&&(q.play(),ae(!1))},[oe,q]);const wx=c.useMemo(()=>m?m({height:Ht.height,width:Ht.width,isBuffering:hn}):null,[Ht.height,Ht.width,m,hn]),xx=c.useMemo(()=>({type:"scale",scale:Ge}),[Ge]);if(!N)return null;const Is=h?h({height:Z==="player-size"?Ht.height:N.height,width:Z==="player-size"?Ht.width:N.width,isBuffering:hn}):null;if(Is===void 0)throw new TypeError("renderPoster() must return a React element, but undefined was returned");const lp=Is&&[w&&!q.isPlaying()&&!G,v&&q.isLastFrame&&!q.isPlaying(),S&&!q.hasPlayed&&!q.isPlaying(),x&&hn&&q.isPlaying(),b&&hn&&!q.isPlaying()].some(Boolean),{left:w$,top:x$,width:b$,height:S$,...bx}=K,up=d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:K,onPointerDown:s?ks:void 0,onDoubleClick:l?Cs:void 0,children:[d.jsxs("div",{style:te,className:Xf(P),children:[Er?d.jsx(Sw,{onError:it,errorFallback:f,children:d.jsx(ie.CurrentScaleContext.Provider,{value:xx,children:d.jsx(Er,{...(A==null?void 0:A.props)??{},...i??{}})})}):null,lp&&Z==="composition-size"?d.jsx("div",{style:{...bx,width:N.width,height:N.height},onPointerDown:s?ks:void 0,onDoubleClick:l?Cs:void 0,children:Is}):null]}),d.jsx(oI,{})]}),lp&&Z==="player-size"?d.jsx("div",{style:K,onPointerDown:s?ks:void 0,onDoubleClick:l?Cs:void 0,children:Is}):null,e?d.jsx(LI,{fps:N.fps,playing:q.playing,toggle:q.toggle,durationInFrames:N.durationInFrames,containerRef:B,onFullscreenButtonClick:Ct,isFullscreen:ce,allowFullscreen:o,showVolumeControls:a,onExitFullscreenButtonClick:ou,spaceKeyToPlayOrPause:u,onSeekEnd:iu,onSeekStart:ei,inFrame:k,outFrame:E,initiallyShowControls:I,canvasSize:H,renderFullscreenButton:T,renderPlayPauseButton:_,alwaysShowControls:M,showPlaybackRateControl:O,buffering:hn,hideControlsWhenPointerDoesntMove:R,onDoubleClick:l?Cs:void 0,onPointerDown:s?ks:void 0,renderMuteButton:$,renderVolumeSlider:j,renderCustomControls:L}):null]});return V||Ew&&!BI?d.jsx("div",{ref:B,style:Ht,className:y,children:up}):d.jsx("div",{ref:B,style:Ht,className:y,children:d.jsx(c.Suspense,{fallback:wx,children:up})})},UI=c.forwardRef(WI),kw="remotion.volumePreference",HI=(e,t,n)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(n??kw,String(e))}catch(r){ie.Log.error({logLevel:t,tag:null},"Could not persist volume",r)}},ZI=e=>{if(typeof window>"u")return 1;try{const t=window.localStorage.getItem(e??kw);return t?Number(t):1}catch{return 1}},Gf="player-comp",Cw=({children:e,timelineContext:t,playbackRateContext:n,fps:r,compositionHeight:o,compositionWidth:i,durationInFrames:s,component:a,numberOfSharedAudioTags:l,initiallyMuted:u,logLevel:f,audioLatencyHint:p,sampleRate:m,volumePersistenceKey:h,initialVolume:y,inputProps:g,audioEnabled:S})=>{const v=y===void 0,w=c.useMemo(()=>({compositions:[{component:a,durationInFrames:s,height:o,width:i,fps:r,id:Gf,nonce:[[0,777]],folderName:null,parentFolderName:null,schema:null,calculateMetadata:null,stack:null}],folders:[],currentCompositionMetadata:{defaultCodec:null,defaultOutName:null,defaultPixelFormat:null,defaultProResProfile:null,defaultSampleRate:null,defaultVideoImageFormat:null,durationInFrames:s,fps:r,height:o,width:i,props:g},canvasContent:{type:"composition",compositionId:"player-comp"}}),[a,s,o,i,r,g]),[x,b]=c.useState(()=>u),[k,E]=c.useState(()=>v?ZI(h??null):y),I=c.useMemo(()=>({playerMuted:x,mediaVolume:k}),[x,k]),T=c.useRef(!1),_=T.current||S&&!x&&k>0;T.current=_;const $=c.useCallback(O=>{E(O),v&&HI(O,f,h??null)},[v,f,h]),j=c.useMemo(()=>({setPlayerMuted:b,setMediaVolume:$}),[$]),L=c.useMemo(()=>({logLevel:f,mountTime:Date.now()}),[f]),M=c.useMemo(()=>({isPlayer:!0,isRendering:!1,isStudio:!1,isClientSideRendering:!1,isReadOnlyStudio:!1}),[]);return d.jsx(ie.RemotionEnvironmentContext.Provider,{value:M,children:d.jsx(ie.LogLevelContext.Provider,{value:L,children:d.jsx(ie.CanUseRemotionHooksProvider,{children:d.jsx(ie.AbsoluteTimeContext.Provider,{value:t,children:d.jsx(ie.PlaybackRateContext.Provider,{value:n,children:d.jsx(ie.TimelineContext.Provider,{value:t,children:d.jsx(ie.CompositionManager.Provider,{value:w,children:d.jsx(ie.PrefetchProvider,{children:d.jsx(ie.DurationsContextProvider,{children:d.jsx(ie.MediaVolumeContext.Provider,{value:I,children:d.jsx(ie.SetMediaVolumeContext.Provider,{value:j,children:d.jsx(ie.BufferingProvider,{children:d.jsx(ie.SharedAudioContextProvider,{audioLatencyHint:p,audioEnabled:_,previewSampleRate:m,children:d.jsx(ie.SharedAudioTagsContextProvider,{numberOfAudioTags:l,children:e})})})})})})})})})})})})})})},dh=!1,YI=(e,t)=>{e||dh||(dh=!0,ie.Log.warn({logLevel:t,tag:null},"Note: Some companies are required to obtain a license to use Remotion. See: https://remotion.dev/license\nPass the `acknowledgeRemotionLicense` prop to `<Player />` function to make this message disappear."))},fh=(e,t)=>{if(typeof e>"u"||e===null)return e??null;if(typeof e!="number")throw new TypeError(`"${t}" must be a number, but is ${JSON.stringify(e)}`);if(Number.isNaN(e))throw new TypeError(`"${t}" must not be NaN, but is ${JSON.stringify(e)}`);if(!Number.isFinite(e))throw new TypeError(`"${t}" must be finite, but is ${JSON.stringify(e)}`);if(e%1!==0)throw new TypeError(`"${t}" must be an integer, but is ${JSON.stringify(e)}`);return e},KI=({inFrame:e,durationInFrames:t,outFrame:n})=>{const r=fh(e,"inFrame"),o=fh(n,"outFrame");if(!(r===null&&o===null)){if(r!==null&&r>t-1)throw new Error("inFrame must be less than (durationInFrames - 1), but is "+r);if(o!==null&&o>t-1)throw new Error("outFrame must be less than (durationInFrames - 1), but is "+o);if(r!==null&&r<0)throw new Error("inFrame must be greater than 0, but is "+r);if(o!==null&&o<=0)throw new Error(`outFrame must be greater than 0, but is ${o}. If you want to render a single frame, use <Thumbnail /> instead.`);if(o!==null&&r!==null&&o<=r)throw new Error("outFrame must be greater than inFrame, but is "+o+" <= "+r)}},XI=({initialFrame:e,durationInFrames:t})=>{if(typeof t!="number")throw new Error(`\`durationInFrames\` must be a number, but is ${JSON.stringify(t)}`);if(!(typeof e>"u")){if(typeof e!="number")throw new Error(`\`initialFrame\` must be a number, but is ${JSON.stringify(e)}`);if(Number.isNaN(e))throw new Error("`initialFrame` must be a number, but is NaN");if(!Number.isFinite(e))throw new Error("`initialFrame` must be a number, but is Infinity");if(e%1!==0)throw new Error(`\`initialFrame\` must be an integer, but is ${JSON.stringify(e)}`);if(e>t-1)throw new Error(`\`initialFrame\` must be less or equal than \`durationInFrames - 1\`, but is ${JSON.stringify(e)}`)}},GI=e=>{if(e!==void 0){if(e>10)throw new Error(`The highest possible playback rate is 10. You passed: ${e}`);if(e<-10)throw new Error(`The lowest possible playback rate is -10. You passed: ${e}`);if(e===0)throw new Error("A playback rate of 0 is not supported.")}},qI=Gl.validateFps,ph=Gl.validateDimension,QI=Gl.validateDurationInFrames,JI=Gl.validateDefaultAndInputProps,eT=e=>"component"in e?e.component:null,tT=({durationInFrames:e,compositionHeight:t,compositionWidth:n,fps:r,inputProps:o,style:i,controls:s=!1,loop:a=!1,autoPlay:l=!1,showVolumeControls:u=!0,allowFullscreen:f=!0,clickToPlay:p,doubleClickToFullscreen:m=!1,spaceKeyToPlayOrPause:h=!0,moveToBeginningWhenEnded:y=!0,numberOfSharedAudioTags:g=5,errorFallback:S=()=>"⚠️",playbackRate:v=1,renderLoading:w,className:x,showPosterWhenUnplayed:b,showPosterWhenEnded:k,showPosterWhenPaused:E,showPosterWhenBuffering:I,showPosterWhenBufferingAndPaused:T,initialFrame:_,renderPoster:$,inFrame:j,outFrame:L,initiallyShowControls:M,renderFullscreenButton:O,renderPlayPauseButton:Z,renderVolumeSlider:D,renderCustomControls:R,alwaysShowControls:C=!1,initiallyMuted:F=!1,showPlaybackRateControl:P=!1,posterFillMode:V="player-size",bufferStateDelayInMilliseconds:W,hideControlsWhenPointerDoesntMove:N=!0,overflowVisible:A=!1,renderMuteButton:B,browserMediaControlsBehavior:H,overrideInternalClassName:z,logLevel:Y="info",noSuspense:oe,acknowledgeRemotionLicense:ae,audioLatencyHint:ce="playback",sampleRate:se=48e3,volumePersistenceKey:G,initialVolume:ee,...Q},q)=>{if(typeof window<"u"&&(window.remotion_isPlayer=!0),Q.defaultProps!==void 0)throw new Error("The <Player /> component does not accept `defaultProps`, but some were passed. Use `inputProps` instead.");const he=eT(Q);if((he==null?void 0:he.type)===Qa)throw new TypeError("'component' should not be an instance of <Composition/>. Pass the React component directly, and set the duration, fps and dimensions as separate props. See https://www.remotion.dev/docs/player/examples for an example.");if(he===Qa)throw new TypeError("'component' must not be the 'Composition' component. Pass your own React component directly, and set the duration, fps and dimensions as separate props. See https://www.remotion.dev/docs/player/examples for an example.");c.useState(()=>YI(!!ae,Y));const Ce=ie.useLazyComponent({compProps:Q,componentName:"Player",noSuspense:!!oe});XI({initialFrame:_,durationInFrames:e});const[ve,pe]=c.useState(()=>({[Gf]:_??0})),[Re,be]=c.useState(!1),[we]=c.useState("player-comp"),Pe=c.useRef(null),ue=c.useRef([]),Ge=c.useRef(!1),[Et,At]=c.useState(v);if(typeof t!="number")throw new TypeError(`'compositionHeight' must be a number but got '${typeof t}' instead`);if(typeof n!="number")throw new TypeError(`'compositionWidth' must be a number but got '${typeof n}' instead`);if(ph(t,"compositionHeight","of the <Player /> component"),ph(n,"compositionWidth","of the <Player /> component"),QI(e,{component:"of the <Player/> component",allowFloats:!1}),qI(r,"as a prop of the <Player/> component",!1),JI(o,"inputProps",null),KI({durationInFrames:e,inFrame:j,outFrame:L}),typeof s!="boolean"&&typeof s<"u")throw new TypeError(`'controls' must be a boolean or undefined but got '${typeof s}' instead`);if(typeof l!="boolean"&&typeof l<"u")throw new TypeError(`'autoPlay' must be a boolean or undefined but got '${typeof l}' instead`);if(typeof a!="boolean"&&typeof a<"u")throw new TypeError(`'loop' must be a boolean or undefined but got '${typeof a}' instead`);if(typeof m!="boolean"&&typeof m<"u")throw new TypeError(`'doubleClickToFullscreen' must be a boolean or undefined but got '${typeof m}' instead`);if(typeof u!="boolean"&&typeof u<"u")throw new TypeError(`'showVolumeControls' must be a boolean or undefined but got '${typeof u}' instead`);if(typeof f!="boolean"&&typeof f<"u")throw new TypeError(`'allowFullscreen' must be a boolean or undefined but got '${typeof f}' instead`);if(typeof p!="boolean"&&typeof p<"u")throw new TypeError(`'clickToPlay' must be a boolean or undefined but got '${typeof p}' instead`);if(typeof h!="boolean"&&typeof h<"u")throw new TypeError(`'spaceKeyToPlayOrPause' must be a boolean or undefined but got '${typeof h}' instead`);if(typeof se!="number"||!Number.isFinite(se)||Number.isNaN(se)||se<=0||se%1!==0)throw new TypeError(`'sampleRate' must be a positive integer but got '${se}' instead`);if(typeof ee<"u"&&typeof ee!="number")throw new TypeError(`'initialVolume' must be a number or undefined but got '${typeof ee}' instead`);if(typeof ee=="number"&&(!Number.isFinite(ee)||Number.isNaN(ee)||ee<0||ee>1))throw new TypeError(`'initialVolume' must be between 0 and 1 but got '${ee}' instead`);if(typeof g!="number"||g%1!==0||!Number.isFinite(g)||Number.isNaN(g)||g<0)throw new TypeError(`'numberOfSharedAudioTags' must be an integer but got '${g}' instead`);GI(Et),c.useEffect(()=>{At(v)},[v]),c.useImperativeHandle(q,()=>Pe.current,[]),c.useState(()=>{ie.playbackLogging({logLevel:Y,message:`[player] Mounting <Player>. User agent = ${typeof navigator>"u"?"server":navigator.userAgent}`,tag:"player",mountTime:Date.now()})});const kt=c.useMemo(()=>({frame:ve,playing:Re,rootId:we,imperativePlaying:Ge,audioAndVideoTags:ue}),[ve,Re,we]),hn=c.useMemo(()=>({playbackRate:Et,setPlaybackRate:At}),[Et]),Un=c.useMemo(()=>({setFrame:pe,setPlaying:be}),[pe]);typeof window<"u"&&c.useLayoutEffect(()=>{ie.CSSUtils.injectCSS(ie.CSSUtils.makeDefaultPreviewCSS(`.${Xf(z)}`,"#fff"))},[z]);const Er=c.useMemo(()=>o??{},[o]),Ht=c.useMemo(()=>H??{mode:"prevent-media-session"},[H]);return d.jsx(ie.IsPlayerContextProvider,{children:d.jsx(Cw,{timelineContext:kt,playbackRateContext:hn,component:Ce,compositionHeight:t,compositionWidth:n,durationInFrames:e,fps:r,numberOfSharedAudioTags:g,initiallyMuted:F,logLevel:Y,audioLatencyHint:ce,sampleRate:se,volumePersistenceKey:G,initialVolume:ee,inputProps:Er,audioEnabled:!0,children:d.jsx(ie.SetTimelineContext.Provider,{value:Un,children:d.jsx(K2,{currentPlaybackRate:Et,children:d.jsx(UI,{ref:Pe,posterFillMode:V,renderLoading:w,autoPlay:!!l,loop:!!a,controls:!!s,errorFallback:S,style:i,inputProps:Er,allowFullscreen:!!f,moveToBeginningWhenEnded:!!y,clickToPlay:typeof p=="boolean"?p:!!s,showVolumeControls:!!u,doubleClickToFullscreen:!!m,spaceKeyToPlayOrPause:!!h,playbackRate:Et,className:x??void 0,showPosterWhenUnplayed:!!b,showPosterWhenEnded:!!k,showPosterWhenPaused:!!E,showPosterWhenBuffering:!!I,showPosterWhenBufferingAndPaused:!!T,renderPoster:$,inFrame:j??null,outFrame:L??null,initiallyShowControls:M??!0,renderFullscreen:O??null,renderPlayPauseButton:Z??null,renderMuteButton:B??null,renderVolumeSlider:D??null,renderCustomControls:R??null,alwaysShowControls:C,showPlaybackRateControl:P,bufferStateDelayInMilliseconds:W??300,hideControlsWhenPointerDoesntMove:N,overflowVisible:A,browserMediaControlsBehavior:Ht,overrideInternalClassName:z??void 0,noSuspense:!!oe})})})})})},nT=c.forwardRef,rT=nT(tT),oT=()=>{const e=c.useContext(xw);if(!e)throw new TypeError("Expected Player event emitter context");return c.useMemo(()=>({emitter:e}),[e])},vd=J.version.split(".")[0];if(vd==="0")throw new Error(`Version ${vd} of "react" is not supported by Remotion`);var iT=parseInt(vd,10)>=18,sT=({style:e,inputProps:t,errorFallback:n,renderLoading:r,className:o,overflowVisible:i,noSuspense:s,overrideInternalClassName:a},l)=>{const u=ie.useUnsafeVideoConfig(),f=ie.useVideo(),p=c.useRef(null),m=Kf(p,{triggerOnWindowResize:!1,shouldApplyCssTransforms:!1}),h=c.useMemo(()=>!u||!m?null:hw({canvasSize:m,compositionHeight:u.height,compositionWidth:u.width,previewSize:"auto"}),[m,u]),y=(h==null?void 0:h.scale)??1,g=oT();bw(g.emitter),c.useImperativeHandle(l,()=>{const T={getContainerNode:()=>p.current,getScale:()=>y};return Object.assign(g.emitter,T)},[y,g.emitter]);const S=f?f.component:null,v=c.useMemo(()=>gw({config:u,style:e,canvasSize:m,overflowVisible:i,layout:h}),[m,u,h,i,e]),w=c.useMemo(()=>yw({config:u,layout:h,scale:y,overflowVisible:i}),[u,h,i,y]),x=c.useMemo(()=>vw({config:u,layout:h,scale:y,overflowVisible:i}),[u,h,i,y]),b=c.useCallback(T=>{g.emitter.dispatchError(T)},[g.emitter]),k=c.useMemo(()=>r?r({height:v.height,width:v.width,isBuffering:!1}):null,[v.height,v.width,r]),E=c.useMemo(()=>({type:"scale",scale:y}),[y]);if(!u)return null;const I=d.jsx("div",{style:w,children:d.jsx("div",{style:x,className:Xf(a),children:S?d.jsx(Sw,{onError:b,errorFallback:n,children:d.jsx(ie.CurrentScaleContext.Provider,{value:E,children:d.jsx(S,{...(f==null?void 0:f.props)??{},...t??{}})})}):null})});return s||Ew&&!iT?d.jsx("div",{ref:p,style:v,className:o,children:I}):d.jsx("div",{ref:p,style:v,className:o,children:d.jsx(c.Suspense,{fallback:k,children:I})})},aT=c.forwardRef(sT),lT=({frameToDisplay:e,style:t,inputProps:n,compositionHeight:r,compositionWidth:o,durationInFrames:i,fps:s,className:a,errorFallback:l=()=>"⚠️",renderLoading:u,overflowVisible:f=!1,overrideInternalClassName:p,logLevel:m="info",noSuspense:h,...y},g)=>{typeof window<"u"&&c.useLayoutEffect(()=>{window.remotion_isPlayer=!0},[]);const[S]=c.useState(()=>String(Hr(null))),v=c.useRef(null),w=c.useMemo(()=>({playing:!1,frame:{[Gf]:e},rootId:S,imperativePlaying:{current:!1},audioAndVideoTags:{current:[]}}),[e,S]),x=c.useMemo(()=>({playbackRate:1,setPlaybackRate:()=>{throw new Error("thumbnail")}}),[]);c.useImperativeHandle(g,()=>v.current,[]);const b=ie.useLazyComponent({compProps:y,componentName:"Thumbnail",noSuspense:!!h}),[k]=c.useState(()=>new Y2),E=c.useMemo(()=>n??{},[n]);return d.jsx(ie.IsPlayerContextProvider,{children:d.jsx(Cw,{timelineContext:w,playbackRateContext:x,component:b,compositionHeight:r,compositionWidth:o,durationInFrames:i,fps:s,numberOfSharedAudioTags:0,initiallyMuted:!0,logLevel:m,audioLatencyHint:"playback",sampleRate:48e3,inputProps:E,audioEnabled:!1,children:d.jsx(xw.Provider,{value:k,children:d.jsx(aT,{ref:v,className:a,errorFallback:l,inputProps:E,renderLoading:u,style:t,overflowVisible:f,overrideInternalClassName:p,noSuspense:!!h})})})})},uT=c.forwardRef;uT(lT);const _o=[1,1.5,2,4];function mh(e){return _o.find(t=>t>e+1e-9)??_o[_o.length-1]}function cT(e,t){switch(t){case"L":return e.playing&&e.rate>0?{rate:mh(e.rate),playing:!0}:{rate:_o[0],playing:!0};case"J":return e.playing&&e.rate<0?{rate:-mh(-e.rate),playing:!0}:{rate:-_o[0],playing:!0};case"K":return{rate:_o[0],playing:!e.playing}}}function qf(e,t,n){const r=Math.round(e*n),o=Math.round(t*n);return{from:r,durationInFrames:Math.max(1,o-r)}}const dT=({src:e,spans:t,punchInScale:n=1.07,punchThresholdSec:r=.15,audioFadeSec:o=.01,background:i="black"})=>{const{fps:s}=Xe(),a=c.useMemo(()=>{const u=[];let f=!1;for(let p=0;p<t.length;p++){const m=t[p-1],h=m?t[p].srcIn-m.srcOut:0;p>0&&h>=r&&(f=!f),u.push(f?n:1)}return u},[t,n,r]),l=Math.max(1,Math.round(o*s));return d.jsx(pn,{style:{backgroundColor:i},children:t.map((u,f)=>{const{from:p,durationInFrames:m}=qf(u.outIn,u.outOut,s);return d.jsx(dt,{from:p,durationInFrames:m,premountFor:s,children:d.jsx(pn,{style:{transform:`scale(${a[f]})`},children:d.jsx(dw,{src:e,trimBefore:Math.round(u.srcIn*s),trimAfter:Math.round(u.srcOut*s),style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"var(--ossclip-obj-x, 50%) var(--ossclip-obj-y, 50%)"},volume:h=>Math.max(0,Math.min(1,(h+1)/l,(m-h)/l))})})},f)})})};function U(e,t,n){function r(a,l){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,l);for(const f in s.prototype)f in a||Object.defineProperty(a,f,{value:s.prototype[f].bind(a)});a._zod.constr=s,a._zod.def=l}const o=(n==null?void 0:n.Parent)??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var l;const u=n!=null&&n.Parent?new i:this;r(u,a),(l=u._zod).deferred??(l.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>{var l,u;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(u=(l=a==null?void 0:a._zod)==null?void 0:l.traits)==null?void 0:u.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class ns extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Iw={};function pr(e){return Iw}function fT(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function pT(e,t){return typeof t=="bigint"?t.toString():t}function Tw(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Qf(e){return e==null}function Jf(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function mT(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function Ne(e,t,n){Object.defineProperty(e,t,{get(){{const r=n();return e[t]=r,r}},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function ep(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function gi(e){return JSON.stringify(e)}const Rw=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function yd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const hT=Tw(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function ol(e){if(yd(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(yd(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}const gT=new Set(["string","number","symbol"]);function Ql(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Xr(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function le(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function vT(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const yT={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function wT(e,t){const n={},r=e._zod.def;for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(n[o]=r.shape[o])}return Xr(e,{...e._zod.def,shape:n,checks:[]})}function xT(e,t){const n={...e._zod.def.shape},r=e._zod.def;for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete n[o]}return Xr(e,{...e._zod.def,shape:n,checks:[]})}function bT(e,t){if(!ol(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return ep(this,"shape",r),r},checks:[]};return Xr(e,n)}function ST(e,t){return Xr(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return ep(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function ET(e,t,n){const r=t._zod.def.shape,o={...r};if(n)for(const i in n){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=e?new e({type:"optional",innerType:r[i]}):r[i])}else for(const i in r)o[i]=e?new e({type:"optional",innerType:r[i]}):r[i];return Xr(t,{...t._zod.def,shape:o,checks:[]})}function kT(e,t,n){const r=t._zod.def.shape,o={...r};if(n)for(const i in n){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=new e({type:"nonoptional",innerType:r[i]}))}else for(const i in r)o[i]=new e({type:"nonoptional",innerType:r[i]});return Xr(t,{...t._zod.def,shape:o,checks:[]})}function Mi(e,t=0){var n;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function Pr(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function ea(e){return typeof e=="string"?e:e==null?void 0:e.message}function mr(e,t,n){var o,i,s,a,l,u;const r={...e,path:e.path??[]};if(!e.message){const f=ea((s=(i=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:i.error)==null?void 0:s.call(i,e))??ea((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??ea((l=n.customError)==null?void 0:l.call(n,e))??ea((u=n.localeError)==null?void 0:u.call(n,e))??"Invalid input";r.message=f}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function tp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function rs(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const _w=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,pT,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Pw=U("$ZodError",_w),Fw=U("$ZodError",_w,{Parent:Error});function CT(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function IT(e,t){const n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>o({issues:a}));else if(s.code==="invalid_key")o({issues:s.issues});else if(s.code==="invalid_element")o({issues:s.issues});else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const u=s.path[l];l===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(s))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return o(e),r}const TT=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new ns;if(s.issues.length){const a=new((o==null?void 0:o.Err)??e)(s.issues.map(l=>mr(l,i,pr())));throw Rw(a,o==null?void 0:o.callee),a}return s.value},RT=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new((o==null?void 0:o.Err)??e)(s.issues.map(l=>mr(l,i,pr())));throw Rw(a,o==null?void 0:o.callee),a}return s.value},jw=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new ns;return i.issues.length?{success:!1,error:new(e??Pw)(i.issues.map(s=>mr(s,o,pr())))}:{success:!0,data:i.value}},_T=jw(Fw),Mw=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>mr(s,o,pr())))}:{success:!0,data:i.value}},PT=Mw(Fw),FT=/^[cC][^\s-]{8,}$/,jT=/^[0-9a-z]+$/,MT=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$T=/^[0-9a-vA-V]{20}$/,AT=/^[A-Za-z0-9]{27}$/,NT=/^[a-zA-Z0-9_-]{21}$/,LT=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zT=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,hh=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,DT=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,OT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function VT(){return new RegExp(OT,"u")}const BT=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,WT=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,UT=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,HT=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ZT=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$w=/^[A-Za-z0-9_-]*$/,YT=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,KT=/^\+(?:[0-9]){6,14}[0-9]$/,Aw="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",XT=new RegExp(`^${Aw}$`);function Nw(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function GT(e){return new RegExp(`^${Nw(e)}$`)}function qT(e){const t=Nw({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Aw}T(?:${r})$`)}const QT=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},JT=/^\d+$/,eR=/^-?\d+(?:\.\d+)?/i,tR=/true|false/i,nR=/^[^A-Z]*$/,rR=/^[^a-z]*$/,Mt=U("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Lw={number:"number",bigint:"bigint",object:"date"},zw=U("$ZodCheckLessThan",(e,t)=>{Mt.init(e,t);const n=Lw[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Dw=U("$ZodCheckGreaterThan",(e,t)=>{Mt.init(e,t);const n=Lw[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),oR=U("$ZodCheckMultipleOf",(e,t)=>{Mt.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):mT(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),iR=U("$ZodCheckNumberFormat",(e,t)=>{var s;Mt.init(e,t),t.format=t.format||"float64";const n=(s=t.format)==null?void 0:s.includes("int"),r=n?"int":"number",[o,i]=yT[t.format];e._zod.onattach.push(a=>{const l=a._zod.bag;l.format=t.format,l.minimum=o,l.maximum=i,n&&(l.pattern=JT)}),e._zod.check=a=>{const l=a.value;if(n){if(!Number.isInteger(l)){a.issues.push({expected:r,format:t.format,code:"invalid_type",input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}l<o&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>i&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inst:e})}}),sR=U("$ZodCheckMaxLength",(e,t)=>{var n;Mt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Qf(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const s=tp(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),aR=U("$ZodCheckMinLength",(e,t)=>{var n;Mt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Qf(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const s=tp(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),lR=U("$ZodCheckLengthEquals",(e,t)=>{var n;Mt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Qf(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const s=tp(o),a=i>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Jl=U("$ZodCheckStringFormat",(e,t)=>{var n,r;Mt.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),uR=U("$ZodCheckRegex",(e,t)=>{Jl.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),cR=U("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=nR),Jl.init(e,t)}),dR=U("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=rR),Jl.init(e,t)}),fR=U("$ZodCheckIncludes",(e,t)=>{Mt.init(e,t);const n=Ql(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),pR=U("$ZodCheckStartsWith",(e,t)=>{Mt.init(e,t);const n=new RegExp(`^${Ql(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),mR=U("$ZodCheckEndsWith",(e,t)=>{Mt.init(e,t);const n=new RegExp(`.*${Ql(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),hR=U("$ZodCheckOverwrite",(e,t)=>{Mt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class gR{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
135
135
|
`).filter(s=>s),o=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(const s of i)this.content.push(s)}compile(){const t=Function,n=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(i=>` ${i}`)];return new t(...n,o.join(`
|
|
136
|
-
`))}}const vR={major:4,minor:0,patch:0},Ve=U("$ZodType",(e,t)=>{var o;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=vR;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const s of i._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const i=(s,a,l)=>{let u=Mi(s),f;for(const p of a){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(u)continue;const m=s.issues.length,h=p._zod.check(s);if(h instanceof Promise&&(l==null?void 0:l.async)===!1)throw new ns;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,s.issues.length!==m&&(u||(u=Mi(s,m)))});else{if(s.issues.length===m)continue;u||(u=Mi(s,m))}}return f?f.then(()=>s):s};e._zod.run=(s,a)=>{const l=e._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new ns;return l.then(u=>i(u,r,a))}return i(l,r,a)}}e["~standard"]={validate:i=>{var s;try{const a=_T(e,i);return a.success?{value:a.data}:{issues:(s=a.error)==null?void 0:s.issues}}catch{return PT(e,i).then(l=>{var u;return l.success?{value:l.data}:{issues:(u=l.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}}),np=U("$ZodString",(e,t)=>{var n;Ve.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??QT(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),
|
|
136
|
+
`))}}const vR={major:4,minor:0,patch:0},Ve=U("$ZodType",(e,t)=>{var o;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=vR;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const s of i._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const i=(s,a,l)=>{let u=Mi(s),f;for(const p of a){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(u)continue;const m=s.issues.length,h=p._zod.check(s);if(h instanceof Promise&&(l==null?void 0:l.async)===!1)throw new ns;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,s.issues.length!==m&&(u||(u=Mi(s,m)))});else{if(s.issues.length===m)continue;u||(u=Mi(s,m))}}return f?f.then(()=>s):s};e._zod.run=(s,a)=>{const l=e._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new ns;return l.then(u=>i(u,r,a))}return i(l,r,a)}}e["~standard"]={validate:i=>{var s;try{const a=_T(e,i);return a.success?{value:a.data}:{issues:(s=a.error)==null?void 0:s.issues}}catch{return PT(e,i).then(l=>{var u;return l.success?{value:l.data}:{issues:(u=l.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}}),np=U("$ZodString",(e,t)=>{var n;Ve.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??QT(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Le=U("$ZodStringFormat",(e,t)=>{Jl.init(e,t),np.init(e,t)}),yR=U("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=zT),Le.init(e,t)}),wR=U("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=hh(r))}else t.pattern??(t.pattern=hh());Le.init(e,t)}),xR=U("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=DT),Le.init(e,t)}),bR=U("$ZodURL",(e,t)=>{Le.init(e,t),e._zod.check=n=>{try{const r=n.value,o=new URL(r),i=o.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:YT.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!r.endsWith("/")&&i.endsWith("/")?n.value=i.slice(0,-1):n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),SR=U("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=VT()),Le.init(e,t)}),ER=U("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=NT),Le.init(e,t)}),kR=U("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=FT),Le.init(e,t)}),CR=U("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=jT),Le.init(e,t)}),IR=U("$ZodULID",(e,t)=>{t.pattern??(t.pattern=MT),Le.init(e,t)}),TR=U("$ZodXID",(e,t)=>{t.pattern??(t.pattern=$T),Le.init(e,t)}),RR=U("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=AT),Le.init(e,t)}),_R=U("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=qT(t)),Le.init(e,t)}),PR=U("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=XT),Le.init(e,t)}),FR=U("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=GT(t)),Le.init(e,t)}),jR=U("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=LT),Le.init(e,t)}),MR=U("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=BT),Le.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),$R=U("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=WT),Le.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),AR=U("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=UT),Le.init(e,t)}),NR=U("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=HT),Le.init(e,t),e._zod.check=n=>{const[r,o]=n.value.split("/");try{if(!o)throw new Error;const i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Ow(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const LR=U("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ZT),Le.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{Ow(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function zR(e){if(!$w.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ow(n)}const DR=U("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=$w),Le.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{zR(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),OR=U("$ZodE164",(e,t)=>{t.pattern??(t.pattern=KT),Le.init(e,t)});function VR(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const BR=U("$ZodJWT",(e,t)=>{Le.init(e,t),e._zod.check=n=>{VR(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Vw=U("$ZodNumber",(e,t)=>{Ve.init(e,t),e._zod.pattern=e._zod.bag.pattern??eR,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),WR=U("$ZodNumber",(e,t)=>{iR.init(e,t),Vw.init(e,t)}),UR=U("$ZodBoolean",(e,t)=>{Ve.init(e,t),e._zod.pattern=tR,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),HR=U("$ZodUnknown",(e,t)=>{Ve.init(e,t),e._zod.parse=n=>n}),ZR=U("$ZodNever",(e,t)=>{Ve.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function gh(e,t,n){e.issues.length&&t.issues.push(...Pr(n,e.issues)),t.value[n]=e.value}const YR=U("$ZodArray",(e,t)=>{Ve.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let s=0;s<o.length;s++){const a=o[s],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?i.push(l.then(u=>gh(u,n,s))):gh(l,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function ta(e,t,n){e.issues.length&&t.issues.push(...Pr(n,e.issues)),t.value[n]=e.value}function vh(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...Pr(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const KR=U("$ZodObject",(e,t)=>{Ve.init(e,t);const n=Tw(()=>{const p=Object.keys(t.shape);for(const h of p)if(!(t.shape[h]instanceof Ve))throw new Error(`Invalid element at key "${h}": expected a Zod schema`);const m=vT(t.shape);return{shape:t.shape,keys:p,keySet:new Set(p),numKeys:p.length,optionalKeys:new Set(m)}});Ne(e._zod,"propValues",()=>{const p=t.shape,m={};for(const h in p){const y=p[h]._zod;if(y.values){m[h]??(m[h]=new Set);for(const g of y.values)m[h].add(g)}}return m});const r=p=>{const m=new gR(["shape","payload","ctx"]),h=n.value,y=w=>{const x=gi(w);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};m.write("const input = payload.value;");const g=Object.create(null);let S=0;for(const w of h.keys)g[w]=`key_${S++}`;m.write("const newResult = {}");for(const w of h.keys)if(h.optionalKeys.has(w)){const x=g[w];m.write(`const ${x} = ${y(w)};`);const b=gi(w);m.write(`
|
|
137
137
|
if (${x}.issues.length) {
|
|
138
138
|
if (input[${b}] === undefined) {
|
|
139
139
|
if (${b} in input) {
|
|
@@ -152,8 +152,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
152
152
|
} else {
|
|
153
153
|
newResult[${b}] = ${x}.value;
|
|
154
154
|
}
|
|
155
|
-
`)}else{const x=
|
|
155
|
+
`)}else{const x=g[w];m.write(`const ${x} = ${y(w)};`),m.write(`
|
|
156
156
|
if (${x}.issues.length) payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
|
|
157
157
|
...iss,
|
|
158
|
-
path: iss.path ? [${gi(
|
|
159
|
-
})));`),m.write(`newResult[${gi(y)}] = ${x}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");const g=m.compile();return(y,x)=>g(p,y,x)};let o;const i=yd,s=!Iw.jitless,l=s&&hT.value,u=t.catchall;let f;e._zod.parse=(p,m)=>{f??(f=n.value);const h=p.value;if(!i(h))return p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p;const w=[];if(s&&l&&(m==null?void 0:m.async)===!1&&m.jitless!==!0)o||(o=r(t.shape)),p=o(p,m);else{p.value={};const x=f.shape;for(const b of f.keys){const k=x[b],E=k._zod.run({value:h[b],issues:[]},m),I=k._zod.optin==="optional"&&k._zod.optout==="optional";E instanceof Promise?w.push(E.then(T=>I?vh(T,p,b,h):ta(T,p,b))):I?vh(E,p,b,h):ta(E,p,b)}}if(!u)return w.length?Promise.all(w).then(()=>p):p;const v=[],S=f.keySet,g=u._zod,y=g.def.type;for(const x of Object.keys(h)){if(S.has(x))continue;if(y==="never"){v.push(x);continue}const b=g.run({value:h[x],issues:[]},m);b instanceof Promise?w.push(b.then(k=>ta(k,p,x))):ta(b,p,x)}return v.length&&p.issues.push({code:"unrecognized_keys",keys:v,input:h,inst:e}),w.length?Promise.all(w).then(()=>p):p}});function yh(e,t,n,r){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(i=>mr(i,r,pr())))}),t}const XR=U("$ZodUnion",(e,t)=>{Ve.init(e,t),Ae(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Ae(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Ae(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Ae(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>Jf(r.source)).join("|")})$`)}}),e._zod.parse=(n,r)=>{let o=!1;const i=[];for(const s of t.options){const a=s._zod.run({value:n.value,issues:[]},r);if(a instanceof Promise)i.push(a),o=!0;else{if(a.issues.length===0)return a;i.push(a)}}return o?Promise.all(i).then(s=>yh(s,n,e,r)):yh(i,n,e,r)}}),GR=U("$ZodIntersection",(e,t)=>{Ve.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,u])=>wh(n,l,u)):wh(n,i,s)}});function wd(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ol(e)&&ol(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const s=wd(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],s=wd(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wh(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Mi(e))return e;const r=wd(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const qR=U("$ZodRecord",(e,t)=>{Ve.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!ol(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[];if(t.keyType._zod.values){const s=t.keyType._zod.values;n.value={};for(const l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){const u=t.valueType._zod.run({value:o[l],issues:[]},r);u instanceof Promise?i.push(u.then(f=>{f.issues.length&&n.issues.push(...Pr(l,f.issues)),n.value[l]=f.value})):(u.issues.length&&n.issues.push(...Pr(l,u.issues)),n.value[l]=u.value)}let a;for(const l in o)s.has(l)||(a=a??[],a.push(l));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const s of Reflect.ownKeys(o)){if(s==="__proto__")continue;const a=t.keyType._zod.run({value:s,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(u=>mr(u,r,pr())),input:s,path:[s],inst:e}),n.value[a.value]=a.value;continue}const l=t.valueType._zod.run({value:o[s],issues:[]},r);l instanceof Promise?i.push(l.then(u=>{u.issues.length&&n.issues.push(...Pr(s,u.issues)),n.value[a.value]=u.value})):(l.issues.length&&n.issues.push(...Pr(s,l.issues)),n.value[a.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}}),QR=U("$ZodEnum",(e,t)=>{Ve.init(e,t);const n=fT(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(r=>gT.has(typeof r)).map(r=>typeof r=="string"?Ql(r):r.toString()).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return e._zod.values.has(i)||r.issues.push({code:"invalid_value",values:n,input:i,inst:e}),r}}),JR=U("$ZodTransform",(e,t)=>{Ve.init(e,t),e._zod.parse=(n,r)=>{const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(n.value=s,n));if(o instanceof Promise)throw new ns;return n.value=o,n}}),e_=U("$ZodOptional",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ae(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Jf(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(n,r):n.value===void 0?n:t.innerType._zod.run(n,r)}),t_=U("$ZodNullable",(e,t)=>{Ve.init(e,t),Ae(e._zod,"optin",()=>t.innerType._zod.optin),Ae(e._zod,"optout",()=>t.innerType._zod.optout),Ae(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Jf(n.source)}|null)$`):void 0}),Ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),n_=U("$ZodDefault",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",Ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>xh(i,t)):xh(o,t)}});function xh(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const r_=U("$ZodPrefault",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",Ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),o_=U("$ZodNonOptional",(e,t)=>{Ve.init(e,t),Ae(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>bh(i,e)):bh(o,e)}});function bh(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const i_=U("$ZodCatch",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",Ae(e._zod,"optout",()=>t.innerType._zod.optout),Ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>mr(s,r,pr()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>mr(i,r,pr()))},input:n.value}),n.issues=[]),n)}}),s_=U("$ZodPipe",(e,t)=>{Ve.init(e,t),Ae(e._zod,"values",()=>t.in._zod.values),Ae(e._zod,"optin",()=>t.in._zod.optin),Ae(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(n,r)=>{const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Sh(i,t,r)):Sh(o,t,r)}});function Sh(e,t,n){return Mi(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const a_=U("$ZodReadonly",(e,t)=>{Ve.init(e,t),Ae(e._zod,"propValues",()=>t.innerType._zod.propValues),Ae(e._zod,"values",()=>t.innerType._zod.values),Ae(e._zod,"optin",()=>t.innerType._zod.optin),Ae(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Eh):Eh(o)}});function Eh(e){return e.value=Object.freeze(e.value),e}const l_=U("$ZodCustom",(e,t)=>{Mt.init(e,t),Ve.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>kh(i,n,r,e));kh(o,n,r,e)}});function kh(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(rs(o))}}class u_{constructor(){this._map=new Map,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function c_(){return new u_}const na=c_();function d_(e,t){return new e({type:"string",...le(t)})}function f_(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...le(t)})}function Ch(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...le(t)})}function p_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...le(t)})}function m_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...le(t)})}function h_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...le(t)})}function g_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...le(t)})}function v_(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...le(t)})}function y_(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...le(t)})}function w_(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...le(t)})}function x_(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...le(t)})}function b_(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...le(t)})}function S_(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...le(t)})}function E_(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...le(t)})}function k_(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...le(t)})}function C_(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...le(t)})}function I_(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...le(t)})}function T_(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...le(t)})}function R_(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...le(t)})}function __(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...le(t)})}function P_(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...le(t)})}function F_(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...le(t)})}function j_(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...le(t)})}function M_(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...le(t)})}function $_(e,t){return new e({type:"string",format:"date",check:"string_format",...le(t)})}function A_(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...le(t)})}function N_(e,t){return new e({type:"string",format:"duration",check:"string_format",...le(t)})}function L_(e,t){return new e({type:"number",checks:[],...le(t)})}function z_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...le(t)})}function D_(e,t){return new e({type:"boolean",...le(t)})}function O_(e){return new e({type:"unknown"})}function V_(e,t){return new e({type:"never",...le(t)})}function Ih(e,t){return new zw({check:"less_than",...le(t),value:e,inclusive:!1})}function Zu(e,t){return new zw({check:"less_than",...le(t),value:e,inclusive:!0})}function Th(e,t){return new Dw({check:"greater_than",...le(t),value:e,inclusive:!1})}function Yu(e,t){return new Dw({check:"greater_than",...le(t),value:e,inclusive:!0})}function Rh(e,t){return new oR({check:"multiple_of",...le(t),value:e})}function Bw(e,t){return new sR({check:"max_length",...le(t),maximum:e})}function il(e,t){return new aR({check:"min_length",...le(t),minimum:e})}function Ww(e,t){return new lR({check:"length_equals",...le(t),length:e})}function B_(e,t){return new uR({check:"string_format",format:"regex",...le(t),pattern:e})}function W_(e){return new cR({check:"string_format",format:"lowercase",...le(e)})}function U_(e){return new dR({check:"string_format",format:"uppercase",...le(e)})}function H_(e,t){return new fR({check:"string_format",format:"includes",...le(t),includes:e})}function Z_(e,t){return new pR({check:"string_format",format:"starts_with",...le(t),prefix:e})}function Y_(e,t){return new mR({check:"string_format",format:"ends_with",...le(t),suffix:e})}function bs(e){return new hR({check:"overwrite",tx:e})}function K_(e){return bs(t=>t.normalize(e))}function X_(){return bs(e=>e.trim())}function G_(){return bs(e=>e.toLowerCase())}function q_(){return bs(e=>e.toUpperCase())}function Q_(e,t,n){return new e({type:"array",element:t,...le(n)})}function J_(e,t,n){return new e({type:"custom",check:"custom",fn:t,...le(n)})}const eP=U("ZodISODateTime",(e,t)=>{_R.init(e,t),Be.init(e,t)});function tP(e){return M_(eP,e)}const nP=U("ZodISODate",(e,t)=>{PR.init(e,t),Be.init(e,t)});function rP(e){return $_(nP,e)}const oP=U("ZodISOTime",(e,t)=>{FR.init(e,t),Be.init(e,t)});function iP(e){return A_(oP,e)}const sP=U("ZodISODuration",(e,t)=>{jR.init(e,t),Be.init(e,t)});function aP(e){return N_(sP,e)}const lP=(e,t)=>{Pw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>IT(e,n)},flatten:{value:n=>CT(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},eu=U("ZodError",lP,{Parent:Error}),uP=TT(eu),cP=RT(eu),dP=jw(eu),fP=Mw(eu),Ye=U("ZodType",(e,t)=>(Ve.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(n,r)=>Xr(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e),e.parse=(n,r)=>uP(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>dP(e,n,r),e.parseAsync=async(n,r)=>cP(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>fP(e,n,r),e.spa=e.safeParseAsync,e.refine=(n,r)=>e.check(oF(n,r)),e.superRefine=n=>e.check(iF(n)),e.overwrite=n=>e.check(bs(n)),e.optional=()=>Fh(e),e.nullable=()=>jh(e),e.nullish=()=>Fh(jh(e)),e.nonoptional=n=>GP(e,n),e.array=()=>On(e),e.or=n=>DP([e,n]),e.and=n=>VP(e,n),e.transform=n=>Mh(e,UP(n)),e.default=n=>YP(e,n),e.prefault=n=>XP(e,n),e.catch=n=>QP(e,n),e.pipe=n=>Mh(e,n),e.readonly=()=>tF(e),e.describe=n=>{const r=e.clone();return na.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=na.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return na.get(e);const r=e.clone();return na.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Uw=U("_ZodString",(e,t)=>{np.init(e,t),Ye.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(B_(...r)),e.includes=(...r)=>e.check(H_(...r)),e.startsWith=(...r)=>e.check(Z_(...r)),e.endsWith=(...r)=>e.check(Y_(...r)),e.min=(...r)=>e.check(il(...r)),e.max=(...r)=>e.check(Bw(...r)),e.length=(...r)=>e.check(Ww(...r)),e.nonempty=(...r)=>e.check(il(1,...r)),e.lowercase=r=>e.check(W_(r)),e.uppercase=r=>e.check(U_(r)),e.trim=()=>e.check(X_()),e.normalize=(...r)=>e.check(K_(...r)),e.toLowerCase=()=>e.check(G_()),e.toUpperCase=()=>e.check(q_())}),pP=U("ZodString",(e,t)=>{np.init(e,t),Uw.init(e,t),e.email=n=>e.check(f_(mP,n)),e.url=n=>e.check(v_(hP,n)),e.jwt=n=>e.check(j_(PP,n)),e.emoji=n=>e.check(y_(gP,n)),e.guid=n=>e.check(Ch(_h,n)),e.uuid=n=>e.check(p_(ra,n)),e.uuidv4=n=>e.check(m_(ra,n)),e.uuidv6=n=>e.check(h_(ra,n)),e.uuidv7=n=>e.check(g_(ra,n)),e.nanoid=n=>e.check(w_(vP,n)),e.guid=n=>e.check(Ch(_h,n)),e.cuid=n=>e.check(x_(yP,n)),e.cuid2=n=>e.check(b_(wP,n)),e.ulid=n=>e.check(S_(xP,n)),e.base64=n=>e.check(__(TP,n)),e.base64url=n=>e.check(P_(RP,n)),e.xid=n=>e.check(E_(bP,n)),e.ksuid=n=>e.check(k_(SP,n)),e.ipv4=n=>e.check(C_(EP,n)),e.ipv6=n=>e.check(I_(kP,n)),e.cidrv4=n=>e.check(T_(CP,n)),e.cidrv6=n=>e.check(R_(IP,n)),e.e164=n=>e.check(F_(_P,n)),e.datetime=n=>e.check(tP(n)),e.date=n=>e.check(rP(n)),e.time=n=>e.check(iP(n)),e.duration=n=>e.check(aP(n))});function fe(e){return d_(pP,e)}const Be=U("ZodStringFormat",(e,t)=>{Ne.init(e,t),Uw.init(e,t)}),mP=U("ZodEmail",(e,t)=>{xR.init(e,t),Be.init(e,t)}),_h=U("ZodGUID",(e,t)=>{yR.init(e,t),Be.init(e,t)}),ra=U("ZodUUID",(e,t)=>{wR.init(e,t),Be.init(e,t)}),hP=U("ZodURL",(e,t)=>{bR.init(e,t),Be.init(e,t)}),gP=U("ZodEmoji",(e,t)=>{SR.init(e,t),Be.init(e,t)}),vP=U("ZodNanoID",(e,t)=>{ER.init(e,t),Be.init(e,t)}),yP=U("ZodCUID",(e,t)=>{kR.init(e,t),Be.init(e,t)}),wP=U("ZodCUID2",(e,t)=>{CR.init(e,t),Be.init(e,t)}),xP=U("ZodULID",(e,t)=>{IR.init(e,t),Be.init(e,t)}),bP=U("ZodXID",(e,t)=>{TR.init(e,t),Be.init(e,t)}),SP=U("ZodKSUID",(e,t)=>{RR.init(e,t),Be.init(e,t)}),EP=U("ZodIPv4",(e,t)=>{MR.init(e,t),Be.init(e,t)}),kP=U("ZodIPv6",(e,t)=>{$R.init(e,t),Be.init(e,t)}),CP=U("ZodCIDRv4",(e,t)=>{AR.init(e,t),Be.init(e,t)}),IP=U("ZodCIDRv6",(e,t)=>{NR.init(e,t),Be.init(e,t)}),TP=U("ZodBase64",(e,t)=>{LR.init(e,t),Be.init(e,t)}),RP=U("ZodBase64URL",(e,t)=>{DR.init(e,t),Be.init(e,t)}),_P=U("ZodE164",(e,t)=>{OR.init(e,t),Be.init(e,t)}),PP=U("ZodJWT",(e,t)=>{BR.init(e,t),Be.init(e,t)}),Hw=U("ZodNumber",(e,t)=>{Vw.init(e,t),Ye.init(e,t),e.gt=(r,o)=>e.check(Th(r,o)),e.gte=(r,o)=>e.check(Yu(r,o)),e.min=(r,o)=>e.check(Yu(r,o)),e.lt=(r,o)=>e.check(Ih(r,o)),e.lte=(r,o)=>e.check(Zu(r,o)),e.max=(r,o)=>e.check(Zu(r,o)),e.int=r=>e.check(Ph(r)),e.safe=r=>e.check(Ph(r)),e.positive=r=>e.check(Th(0,r)),e.nonnegative=r=>e.check(Yu(0,r)),e.negative=r=>e.check(Ih(0,r)),e.nonpositive=r=>e.check(Zu(0,r)),e.multipleOf=(r,o)=>e.check(Rh(r,o)),e.step=(r,o)=>e.check(Rh(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function de(e){return L_(Hw,e)}const FP=U("ZodNumberFormat",(e,t)=>{WR.init(e,t),Hw.init(e,t)});function Ph(e){return z_(FP,e)}const jP=U("ZodBoolean",(e,t)=>{UR.init(e,t),Ye.init(e,t)});function kn(e){return D_(jP,e)}const MP=U("ZodUnknown",(e,t)=>{HR.init(e,t),Ye.init(e,t)});function zo(){return O_(MP)}const $P=U("ZodNever",(e,t)=>{ZR.init(e,t),Ye.init(e,t)});function AP(e){return V_($P,e)}const NP=U("ZodArray",(e,t)=>{YR.init(e,t),Ye.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(il(n,r)),e.nonempty=n=>e.check(il(1,n)),e.max=(n,r)=>e.check(Bw(n,r)),e.length=(n,r)=>e.check(Ww(n,r)),e.unwrap=()=>e.element});function On(e,t){return Q_(NP,e,t)}const LP=U("ZodObject",(e,t)=>{KR.init(e,t),Ye.init(e,t),Ae(e,"shape",()=>t.shape),e.keyof=()=>Jo(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:zo()}),e.loose=()=>e.clone({...e._zod.def,catchall:zo()}),e.strict=()=>e.clone({...e._zod.def,catchall:AP()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>bT(e,n),e.merge=n=>ST(e,n),e.pick=n=>wT(e,n),e.omit=n=>xT(e,n),e.partial=(...n)=>ET(Zw,e,n[0]),e.required=(...n)=>kT(Yw,e,n[0])});function ye(e,t){const n={type:"object",get shape(){return ep(this,"shape",{...e}),this.shape},...le(t)};return new LP(n)}const zP=U("ZodUnion",(e,t)=>{XR.init(e,t),Ye.init(e,t),e.options=t.options});function DP(e,t){return new zP({type:"union",options:e,...le(t)})}const OP=U("ZodIntersection",(e,t)=>{GR.init(e,t),Ye.init(e,t)});function VP(e,t){return new OP({type:"intersection",left:e,right:t})}const BP=U("ZodRecord",(e,t)=>{qR.init(e,t),Ye.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function hr(e,t,n){return new BP({type:"record",keyType:e,valueType:t,...le(n)})}const xd=U("ZodEnum",(e,t)=>{QR.init(e,t),Ye.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new xd({...t,checks:[],...le(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new xd({...t,checks:[],...le(o),entries:i})}});function Jo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new xd({type:"enum",entries:n,...le(t)})}const WP=U("ZodTransform",(e,t)=>{JR.init(e,t),Ye.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=i=>{if(typeof i=="string")n.issues.push(rs(i,n.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),n.issues.push(rs(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function UP(e){return new WP({type:"transform",transform:e})}const Zw=U("ZodOptional",(e,t)=>{e_.init(e,t),Ye.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Fh(e){return new Zw({type:"optional",innerType:e})}const HP=U("ZodNullable",(e,t)=>{t_.init(e,t),Ye.init(e,t),e.unwrap=()=>e._zod.def.innerType});function jh(e){return new HP({type:"nullable",innerType:e})}const ZP=U("ZodDefault",(e,t)=>{n_.init(e,t),Ye.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function YP(e,t){return new ZP({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const KP=U("ZodPrefault",(e,t)=>{r_.init(e,t),Ye.init(e,t),e.unwrap=()=>e._zod.def.innerType});function XP(e,t){return new KP({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Yw=U("ZodNonOptional",(e,t)=>{o_.init(e,t),Ye.init(e,t),e.unwrap=()=>e._zod.def.innerType});function GP(e,t){return new Yw({type:"nonoptional",innerType:e,...le(t)})}const qP=U("ZodCatch",(e,t)=>{i_.init(e,t),Ye.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function QP(e,t){return new qP({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const JP=U("ZodPipe",(e,t)=>{s_.init(e,t),Ye.init(e,t),e.in=t.in,e.out=t.out});function Mh(e,t){return new JP({type:"pipe",in:e,out:t})}const eF=U("ZodReadonly",(e,t)=>{a_.init(e,t),Ye.init(e,t)});function tF(e){return new eF({type:"readonly",innerType:e})}const nF=U("ZodCustom",(e,t)=>{l_.init(e,t),Ye.init(e,t)});function rF(e){const t=new Mt({check:"custom"});return t._zod.check=e,t}function oF(e,t={}){return J_(nF,e,t)}function iF(e){const t=rF(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(rs(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(rs(o))}},e(n.value,n)));return t}const tu=Jo(["full-bleed","video-top","pip-bubble","graphic-only","blurred-behind","lower-third","split-left","split-right"]),nu=Jo(["TitleCard","StatCard","RuleCard","StrikethroughReveal","FlowDiagram","TerminalMock","ChatMock","ScreenshotFrame","BulletList"]),sF=ye({startWord:de().int().nonnegative(),endWord:de().int().nonnegative()});ye({id:fe(),anchor:sF,layout:tu,component:nu,props:hr(fe(),zo()),overrides:hr(fe(),zo()).default({}),rationale:fe().optional()});ye({id:fe(),kind:Jo(["graphic","plain"]).optional(),layout:tu,component:nu.optional(),props:hr(fe(),zo()).optional(),startSec:de().nonnegative(),endSec:de().nonnegative(),graphicRect:ye({x:de(),y:de(),w:de(),h:de()}).optional(),elements:hr(fe(),ye({dx:de().optional(),dy:de().optional(),scale:de().positive().optional(),hidden:kn().optional()})).optional(),video:ye({scale:de().positive().max(4).optional(),dy:de().optional(),dx:de().optional(),autoZoom:kn().optional()}).optional(),pip:ye({cornerRadius:de().min(0).max(1).optional(),x:de().min(0).max(1).optional(),y:de().min(0).max(1).optional()}).optional(),captionY:de().min(0).max(1).optional(),captionScale:de().min(.2).max(3).optional(),pinned:kn().optional()}).superRefine((e,t)=>{e.kind!=="plain"&&(e.component===void 0||e.props===void 0)&&t.addIssue({code:"custom",message:'a graphic cue requires component and props; only kind: "plain" may omit them'})});ye({centerYFrac:de().min(0).max(1),sizeFrac:de().min(0).max(1).optional(),centerXFrac:de().min(0).max(1).optional(),sourceAspect:de().positive().optional()});const rp=ye({bg:fe().default("#0B0B0E"),fg:fe().default("#FFFFFF"),accent:fe().default("#FFE14D"),muted:fe().default("#9A9AA3"),success:fe().default("#5FBF77"),cardBg:fe().default("#15151B"),cardBorder:fe().default("#2A2A33"),danger:fe().default("#FF5C5C"),radiusPx:de().default(24),fontDisplay:fe().default("'Inter', 'Helvetica Neue', 'Arial Black', Arial, sans-serif"),fontMono:fe().default("'SF Mono', 'Cascadia Code', Consolas, monospace")}),aF=rp.parse({}),lF=ye({eyebrow:fe().max(28).optional(),title:fe().min(1).max(48).describe("the claim WITHOUT the emphasis token — never repeat the emphasis here"),emphasis:fe().max(16).optional().describe("the number/punch token pulled OUT of the title (e.g. '861%') — not a duplicate of it"),sub:fe().max(64).optional()}),uF=ye({label:fe().min(1).max(28),value:fe().min(1).max(12),caption:fe().max(40).optional(),inverted:kn().default(!1)}),cF=ye({kicker:fe().min(1).max(24),text:fe().min(1).max(40),struck:fe().max(40).optional()}),dF=ye({lines:On(ye({text:fe().min(1).max(32),struck:kn().default(!1),mark:Jo(["none","cross","check"]).default("none")})).min(1).max(4)}),fF=ye({title:fe().max(28).optional(),items:On(fe().min(1).max(36)).min(2).max(5)}),pF=ye({nodes:On(fe().min(1).max(16)).min(2).max(5),emphasizeLast:kn().default(!0)}),mF=ye({windows:On(ye({title:fe().max(24),lines:On(fe().max(40)).min(1).max(6)})).min(1).max(5),fanOut:fe().max(20).optional()}),hF=ye({messages:On(ye({from:Jo(["user","agent"]),text:fe().min(1).max(60)})).min(1).max(4),keyword:fe().max(16).optional().describe("ONLY for a 'comment <word>' ask: the single distinctive word the viewer types, plain and unformatted. Leave unset for any other CTA — especially 'reply with a number/which one', where there is no word to type. Never a referential filler like 'number', 'answer', 'comment' or 'below'.")}),gF=ye({src:fe().optional().describe("OMIT THIS unless the user supplied an actual image file beside the video — never invent a filename from the transcript; without it the frame renders as a styled placeholder, which is the intended look"),label:fe().max(32).optional(),kenBurns:kn().default(!0)}),vF={TitleCard:{propsSchema:lF,defaultProps:{title:"TITLE"},defaultLayout:"pip-bubble",altLayouts:[],whenToUse:"The core claim or hook as big typography; use `emphasis` for a huge number or punch word."},StatCard:{propsSchema:uF,defaultProps:{label:"METRIC",value:"+0%"},defaultLayout:"video-top",altLayouts:["blurred-behind"],whenToUse:"One striking metric (value like '+242%', '×3', '5s'); punchline in `caption`."},RuleCard:{propsSchema:cF,defaultProps:{kicker:"RULE",text:"DO THE THING"},defaultLayout:"video-top",altLayouts:["blurred-behind"],whenToUse:"A prescriptive takeaway ('CAPACITY RULE / CAP ACTIVE AGENTS'); `struck` shows the rejected alternative."},StrikethroughReveal:{propsSchema:dF,defaultProps:{lines:[{text:"NOT THIS",struck:!0}]},defaultLayout:"blurred-behind",altLayouts:["graphic-only"],whenToUse:'Negation/contrast beat — big words over the blurred speaker. Strike EVERY line of the phrase the speaker negates, not just its tail — a half-struck claim reads as a typo. For wrong-vs-right lists, set mark: "cross"/"check" (✗/✓) per line instead.'},FlowDiagram:{propsSchema:pF,defaultProps:{nodes:["A","B"]},defaultLayout:"graphic-only",altLayouts:[],whenToUse:"A causal chain or pipeline as chips with arrows (TEAM → AI AGENTS → CHURN)."},TerminalMock:{propsSchema:mF,defaultProps:{windows:[{title:"terminal-01",lines:["$ run"]}]},defaultLayout:"graphic-only",altLayouts:[],whenToUse:"Anything about running code/processes/agents — stylized terminal windows."},ChatMock:{propsSchema:hF,defaultProps:{messages:[{from:"user",text:"hello"}]},defaultLayout:"blurred-behind",altLayouts:["graphic-only"],whenToUse:"A quoted phrase or exchange as chat bubbles over the blurred speaker; for a comment-CTA beat, set `keyword` to the word viewers should type."},ScreenshotFrame:{propsSchema:gF,defaultProps:{},defaultLayout:"video-top",altLayouts:["blurred-behind"],whenToUse:"Reference to a document/PR/review — a framed screenshot look with a label chip."},BulletList:{propsSchema:fF,defaultProps:{items:["FIRST","SECOND"]},defaultLayout:"blurred-behind",altLayouts:["graphic-only"],whenToUse:"An ENUMERATION — the speaker lists two or more parallel things ('what you need is X, Y, Z'). One bullet per item, optional kicker title. Use this for lists instead of bending TitleCard or StrikethroughReveal around them."}};function $h(e,t,n={}){const r=vF[e],o={...r.defaultProps,...t,...n},i=r.propsSchema.safeParse(o);return i.success?i.data:null}const yF=ye({dx:de().optional(),dy:de().optional(),scale:de().positive().optional(),hidden:kn().optional()}),Kw=ye({props:hr(fe(),zo()).default({}),elements:hr(fe(),yF).default({}),timing:ye({startSec:de().nonnegative(),endSec:de().nonnegative()}).optional(),component:nu.optional(),layout:tu.optional(),video:ye({scale:de().positive().max(4).optional(),dy:de().optional(),dx:de().optional(),autoZoom:kn().optional()}).optional(),pip:ye({cornerRadius:de().min(0).max(1).optional(),x:de().min(0).max(1).optional(),y:de().min(0).max(1).optional()}).optional(),captionY:de().min(0).max(1).optional(),captionScale:de().min(.2).max(3).optional(),graphicRect:ye({x:de().min(0).max(1),y:de().min(0).max(1),w:de().min(.08).max(1),h:de().min(.05).max(1)}).optional(),hidden:kn().optional()}),wF=ye({text:fe().min(1).max(80),was:fe()});function xF(e,t,n){var r;return((r=e[String(t)])==null?void 0:r.was)??n}const bF=ye({theme:rp.partial().default({}),scenes:hr(fe(),Kw).default({}),captions:hr(fe(),wF).default({}),splits:On(de().nonnegative()).default([]),cuts:On(ye({startSec:de().nonnegative(),endSec:de().nonnegative(),src:ye({startSec:de().nonnegative(),endSec:de().nonnegative()}).optional()})).default([])}),SF=()=>bF.parse({});function EF(e,t){return $h(e,{},t)??$h(e,{},{})}function kF(e,t){const n=e[t],r=t.indexOf("@");if(r===-1)return n;const o=e[t.slice(0,r)];if(!o)return n;const{timing:i,hidden:s,...a}=o;return n?{...a,...n,props:{...a.props,...n.props},elements:{...a.elements,...n.elements},...a.video||n.video?{video:{...a.video,...n.video}}:{},...a.pip||n.pip?{pip:{...a.pip,...n.pip}}:{}}:{...a,props:{...a.props},elements:{...a.elements}}}function bd(e,t){const n=new Set(e.map(i=>i.id)),r=Object.keys(t.scenes).filter(i=>!n.has(i));return{cues:e.map(i=>{const s=kF(t.scenes,i.id);if(!s)return i;const a=s.component!==void 0&&s.component!==i.component,l=s.component??i.component,u=s.component!==void 0&&a?EF(s.component,s.props):{...i.props,...s.props},f=s.layout!==void 0&&s.layout!==i.layout,{graphicRect:p,...m}=i;return{...f?m:i,component:l,layout:s.layout??i.layout,props:u,...Object.keys(s.elements).length>0?{elements:s.elements}:{},...s.video?{video:s.video}:{},...s.pip?{pip:s.pip}:{},...s.captionY!==void 0?{captionY:s.captionY}:{},...s.captionScale!==void 0?{captionScale:s.captionScale}:{},...s.graphicRect?{graphicRect:s.graphicRect}:{},...s.timing&&!i.pinned?{startSec:s.timing.startSec,endSec:s.timing.endSec,pinned:!0}:{}}}),orphans:r}}const sl=.3;function op(e,t){const n=[...e];for(const r of[...t].sort((o,i)=>o-i)){const o=n.findIndex(s=>r>=s.startSec+sl&&r<=s.endSec-sl);if(o===-1)continue;const i=n[o];n.splice(o,1,{...i,endSec:r},{...i,id:`${i.id.split("@")[0]}@${Math.round(r*1e3)}`,startSec:r})}return n}function Xw(e,t){const n=[];return{cues:e.filter(o=>{var i;return((i=t.scenes[o.id])==null?void 0:i.hidden)!==!0?!0:(n.push(o.id),!1)}),hidden:n}}function CF(e,t){return Xw(op(e,t.splits),t)}function IF(e,t){const n=[];if(Object.keys(t).length===0)return{lines:[...e],dropped:n};let r=0;return{lines:e.map(i=>({...i,words:i.words.map(s=>{const a=t[String(r++)];return a?s.text!==a.was?(n.push({index:r-1,expected:a.was,found:s.text}),s):{...s,text:a.text}:s})})),dropped:n}}function TF(e,t){return rp.parse({...e,...t.theme})}function Ah(e,t,n,r){const o=e.scenes[t]??Kw.parse({});return{...e,scenes:{...e.scenes,[t]:{...o,elements:{...o.elements,[n]:{...o.elements[n],...r}}}}}}function RF(e,t,n){const r=e.scenes[t];if(!r)return e;const{[n]:o,...i}=r.elements;return{...e,scenes:{...e.scenes,[t]:{...r,elements:i}}}}function _F(e,t,n){const r=e.scenes[t],o=r==null?void 0:r.elements[n];if(!r||!(o!=null&&o.hidden))return e;const{hidden:i,...s}=o,{[n]:a,...l}=r.elements,u=Object.keys(s).length>0?{...r.elements,[n]:s}:l;return{...e,scenes:{...e.scenes,[t]:{...r,elements:u}}}}function PF(e,t){const n=e.scenes[t];if(!n||!n.timing)return e;const{timing:r,...o}=n;return{...e,scenes:{...e.scenes,[t]:o}}}function FF(e,t){const n=e.scenes[t];if(!n||!n.graphicRect)return e;const{graphicRect:r,...o}=n;return{...e,scenes:{...e.scenes,[t]:o}}}function jF(e){const t=e.indexOf("@");return t===-1?e:e.slice(0,t)}const MF=.6;function $F(e,t){const n=new Set([0]);for(const r of e??[])Number.isFinite(r)&&r>0&&r<t&&n.add(r);return[...n].sort((r,o)=>r-o)}function AF(e,t){const n=t.outputDurationSec,r=[...e].sort((f,p)=>f.startSec-p.startSec);if(n<=0)return r;const o=$F(t.clipStarts,n),i=[];let s=0;for(const f of r)f.startSec-s>1e-9&&i.push({start:s,end:f.startSec}),s=Math.max(s,f.endSec);n-s>1e-9&&i.push({start:s,end:n});const a=[];for(const f of i){const p=o.filter(h=>h>f.start+1e-9&&h<f.end-1e-9),m=[f.start,...p,f.end];for(let h=0;h<m.length-1;h++){const w=m[h],v=m[h+1];if(v-w<MF)continue;let S=0;for(let g=0;g<o.length;g++)o[g]<=w+1e-9&&(S=g);a.push({start:w,end:v,clip:S})}}const l=new Map,u=a.map(f=>{const p=l.get(f.clip)??0;return l.set(f.clip,p+1),{id:p===0?`take-${f.clip}`:`take-${f.clip}-${p}`,kind:"plain",layout:"full-bleed",startSec:f.start,endSec:f.end}});return[...r,...u].sort((f,p)=>f.startSec-p.startSec)}const NF=1.05;function LF(e,t){for(const r of e)if(t>=r.startSec&&t<r.endSec){const o=r.endSec-r.startSec,i=o>0?(t-r.startSec)/o:1,s=.5-.5*Math.cos(Math.PI*i);return r.from+(r.to-r.from)*s}const n=e[e.length-1];return n&&t===n.endSec?n.to:1}function zF(e,t,n){if(e.length===0)return{x:0,y:0,w:(n==null?void 0:n.width)??0,h:(n==null?void 0:n.height)??0,full:!0};if(t<e[0].startSec)return e[0].rect;for(const r of e)if(t>=r.startSec&&t<r.endSec)return r.rect;return e[e.length-1].rect}const DF=/[\p{Script=Arabic}\p{Script=Hebrew}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Nko}]/u,OF=new RegExp("\\p{L}","u");function VF(e){for(const t of e){if(DF.test(t))return"rtl";if(OF.test(t))return"ltr"}return"ltr"}const $t={width:1080,height:1920};$t.width;$t.height;const Ss={centerYFrac:.38,sizeFrac:.22},BF=.35,WF=.45,Gw=1-1/NF,UF=.4*Gw,HF=.6*Gw;function qw(e,t,n=$t){const r=e.w*n.width,o=e.h*n.height;return Math.max(o,r/(t.sourceAspect??n.width/n.height))}function ZF(e,t,n=$t){const r=e.h*n.height,o=qw(e,t,n),i=o-r;if(i<=1)return .5;const s=t.sizeFrac??Ss.sizeFrac,a=(t.centerYFrac-s/2-BF*s)*o,l=(t.centerYFrac+s/2)*o,u=(a+l)/2-WF*r,f=a-UF*r,p=l+HF*r-r,m=p<=f?Math.min(Math.max(u,p),f):p;return Math.min(1,Math.max(0,m/i))}function YF(e,t,n,r,o=$t){if(r.length===0)return e;const i=t.h*o.height,s=qw(t,n,o);if(s-i<=1)return e;const l=i/s,u=1-l;if(u<=0)return e;let f=e*u;for(let p=0;p<r.length+1;p++){const m=r.find(x=>{const b=x.y,k=x.y+x.h,E=f+l,I=b<f&&f<k,T=b<E&&E<k;return I||T});if(!m)break;const h=[],w=m.y+m.h;w<=u&&h.push(w);const v=m.y-l;if(v>=0&&h.push(v),m.h<=l){const x=Math.max(0,m.y+m.h-l),b=Math.min(u,m.y);x<=b&&h.push(Math.min(Math.max(f,x),b))}const S=n.sizeFrac??Ss.sizeFrac,g=n.centerYFrac+S/2,y=h.filter(x=>x+l>=g);if(y.length===0)return e;f=y.reduce((x,b)=>Math.abs(b-f)<Math.abs(x-f)?b:x)}return Math.min(1,Math.max(0,f/u))}function KF(e,t,n=$t){const r=e.w*n.width,o=e.h*n.height,i=Math.max(r,o*(t.sourceAspect??n.width/n.height)),s=i-r;if(s<=1||t.centerXFrac===void 0)return .5;const a=t.centerXFrac*i-r/2;return Math.min(1,Math.max(0,a/s))}const XF={top:.12,bottom:.22,right:.16,left:.04},GF={top:.06,bottom:.12,right:.05,left:.05};function yn(e=$t){return e.width>e.height?GF:XF}function qF(e=$t){const t=yn(e);return{x:t.left,y:t.top,w:1-t.left-t.right,h:1-t.top-t.bottom}}const QF=.08,JF=.05;function al(e,t=$t){const n=qF(t),r=1e-9,o=(u,f,p)=>u<f-r?f:u>p+r?p:u,i=o(e.w,QF,n.w),s=o(e.h,JF,n.h),a=o(e.x,n.x,n.x+n.w-i),l=o(e.y,n.y,n.y+n.h-s);return{x:a,y:l,w:i,h:s}}const Nh=.045,Rn={x:0,y:0,w:1,h:1},Ku=.3,to={x:.5-Ku/2,y:.66,w:Ku,h:Ku*1080/1920};function Dr(e,t=Ss,n=[],r=$t){const o=a=>YF(ZF(a,t,r),a,t,n,r),i=a=>KF(a,t,r),s=r.width>r.height;switch(e){case"full-bleed":return{video:{rect:Rn,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(Rn),objectPosX:i(Rn)},graphic:null,captionAnchor:.7};case"lower-third":{const a=s?{x:.05,y:.7,w:.62,h:.18}:{x:.04,y:.56,w:.8,h:.22};return{video:{rect:Rn,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(Rn),objectPosX:i(Rn)},graphic:a,captionAnchor:s?.62:.49}}case"split-left":case"split-right":{if(s){const l=e==="split-left",u={x:l?0:.5,y:0,w:.5,h:1};return{video:{rect:u,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(u),objectPosX:i(u)},graphic:l?{x:.55,y:.2,w:.4,h:.56}:{x:.05,y:.2,w:.4,h:.56},captionAnchor:.82}}const a={x:0,y:0,w:1,h:.5};return{video:{rect:a,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(a),objectPosX:i(a)},graphic:{x:.04,y:.58,w:.8,h:.2},captionAnchor:.53}}case"video-top":{const a={x:0,y:0,w:1,h:.42};return{video:{rect:a,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(a),objectPosX:i(a)},graphic:{x:.04,y:.54,w:.8,h:.24},captionAnchor:.48}}case"pip-bubble":return{video:{rect:to,cornerRadius:1,blurPx:0,dim:0,opacity:1,objectPosY:o(to),objectPosX:i(to)},graphic:{x:.06,y:.14,w:.78,h:.42},captionAnchor:.61};case"graphic-only":return{video:{rect:to,cornerRadius:1,blurPx:0,dim:0,opacity:0,objectPosY:o(to),objectPosX:i(to)},graphic:{x:.04,y:.14,w:.8,h:.54},captionAnchor:.73};case"blurred-behind":return{video:{rect:Rn,cornerRadius:0,blurPx:22,dim:.55,opacity:1,objectPosY:o(Rn),objectPosX:i(Rn)},graphic:{x:.07,y:.24,w:.77,h:.36},captionAnchor:.69}}}const e4={x:.07,y:.24,w:.77,h:.36};function Qw(e,t=$t){return e.graphicRect?al(e.graphicRect,t):Dr(e.layout,Ss,[],t).graphic??e4}const Jw=.35;function cr(e,t){for(const n of e)if(t>=n.startSec&&t<n.endSec)return n;return null}function Gt(e,t,n){return e+(t-e)*n}function t4(e,t,n){return{x:Gt(e.x,t.x,n),y:Gt(e.y,t.y,n),w:Gt(e.w,t.w,n),h:Gt(e.h,t.h,n)}}function Lh(e,t,n){return{rect:t4(e.rect,t.rect,n),cornerRadius:Gt(e.cornerRadius,t.cornerRadius,n),blurPx:Gt(e.blurPx,t.blurPx,n),dim:Gt(e.dim,t.dim,n),opacity:Gt(e.opacity,t.opacity,n),objectPosY:Gt(e.objectPosY,t.objectPosY,n),objectPosX:Gt(e.objectPosX,t.objectPosX,n)}}function ll(e){return e*e*(3-2*e)}function ex(e){return e.filter(t=>!(t.kind==="plain"&&t.layout==="full-bleed"))}function Xu(e,t,n,r){const o=Dr(e.layout,t,n,r).video,i=e.layout==="pip-bubble"?e.pip:void 0;if(!i)return o;const s={...o.rect,x:Math.min(Math.max(i.x??o.rect.x,0),1-o.rect.w),y:Math.min(Math.max(i.y??o.rect.y,0),1-o.rect.h)};return{...o,rect:s,cornerRadius:i.cornerRadius??o.cornerRadius}}function n4(e,t,n=Ss,r=[],o=$t){const i=ex(e),s=r.filter(g=>t>=g.startSec&&t<g.endSec),a=Dr("full-bleed",n,s,o).video,l=cr(i,t);if(!l)return a;const u=Xu(l,n,s,o),f=Math.min(Jw,(l.endSec-l.startSec)/2),p=t-l.startSec,m=l.endSec-t,h=cr(i,l.startSec-.001),w=cr(i,l.endSec+.001),v=h?Xu(h,n,s,o):a,S=w?Xu(w,n,s,o):a;return p<f?Lh(v,u,ll(p/f)):m<f?Lh(u,S,ll(1-m/f)):u}function Gu(e){return e==="pip-bubble"||e==="graphic-only"?1:0}function r4(e,t){const n=ex(e),r=cr(n,t);if(!r)return 0;const o=Gu(r.layout),i=Math.min(Jw,(r.endSec-r.startSec)/2),s=cr(n,r.startSec-.001),a=cr(n,r.endSec+.001),l=s?Gu(s.layout):0,u=a?Gu(a.layout):0,f=t-r.startSec,p=r.endSec-t;return f<i?Gt(l,o,ll(f/i)):p<i?Gt(o,u,ll(1-p/i)):o}function o4(e,t,n){return e.filter(r=>(r.startSec??Number.NEGATIVE_INFINITY)<n&&(r.endSec??Number.POSITIVE_INFINITY)>t)}function i4(e,t){let n=0;for(const r of t){const o=Math.max(e.y,r.y),i=Math.min(e.y+e.h,r.y+r.h);i>o&&(n+=i-o)}return Math.min(1,n/e.h)}function s4(e,t,n,r=$t){const o=Dr(e,void 0,[],r),i=yn(r),s=o.captionAnchor,a=l=>{const u={y:l-Nh,h:Nh*2};if(u.y<i.top||u.y+u.h>1-i.bottom||i4(u,t)>0)return!1;const f=n??o.graphic;return!(f&&Math.min(u.y+u.h,f.y+f.h)-Math.max(u.y,f.y)>0)};if(a(s))return s;for(let l=.02;l<=.6;l+=.02)for(const u of[s-l,s+l])if(a(u))return u;return s}const a4=.3,l4=.3,u4=.133,ip=e=>e*(2-e);function tx(e,t=a4,n=l4){if(e<=0)return{enterSec:0,exitSec:0};const r=t+n;if(r<=e)return{enterSec:t,exitSec:n};const o=e/r;return{enterSec:t*o,exitSec:n*o}}const zh=.4;function c4(e,t){if(!t)return e;const n=e.replace(/^[^A-Za-z0-9]+|[^A-Za-z0-9]+$/g,"");return n.toLowerCase()!==t.toLowerCase()?e:e.replace(n,`"${n.toUpperCase()}"`)}function d4(e,t){return t?e>=t.startSec-zh&&e<=t.endSec+zh:!1}const f4=({line:e,wordOffset:t,verticalAnchor:n,fontSizePx:r,activeColor:o,ctaKeyword:i,ctaWindow:s})=>{const a=ct(),{fps:l,width:u,height:f}=Xe(),p=yn({width:u,height:f}),m=e.start+a/l,h=VF(e.words.map(w=>w.text).join(" "));return d.jsx(fn,{style:{pointerEvents:"none"},children:d.jsx("div",{style:{position:"absolute",top:`${n*100}%`,left:0,right:0,transform:"translateY(-50%)",direction:h,display:"flex",justifyContent:"center",gap:"0.28em",flexWrap:"wrap",paddingLeft:`${p.left*100}%`,paddingRight:`${p.right*100}%`,fontFamily:"'Inter', 'Helvetica Neue', 'Arial Black', Arial, sans-serif",fontWeight:900,fontSize:r,lineHeight:1.15,textAlign:"center",color:"white",WebkitTextStroke:"10px rgba(0,0,0,0.85)",paintOrder:"stroke fill",textShadow:"0 4px 24px rgba(0,0,0,0.55)"},children:e.words.map((w,v)=>{const S=Math.max(w.end,w.start+.12),g=m>=w.start&&m<=S,y=g?Math.min(1,(m-w.start)/u4):0,x=ip(y);return d.jsx("span",{"data-caption-word":t+v,"data-caption-text":w.text,style:{display:"inline-block",pointerEvents:"auto",transform:x>0?`scale(${1+.08*x})`:"scale(1)",color:g?o:"white"},children:c4(w.text,d4(w.start,s)?i:void 0)},v)})})})},p4=({lines:e,cues:t=[],verticalAnchor:n=.76,fontSizePx:r=64,activeColor:o="#FFE14D",ctaKeyword:i,ctaWindow:s,sourceTextRegions:a=[]})=>{const{fps:l,width:u,height:f}=Xe(),p={width:u,height:f},m=[];let h=0;for(const w of e)m.push(h),h+=w.words.length;return d.jsx(fn,{children:e.map((w,v)=>{const S=t.length>0?cr(t,w.start):null,g=(S==null?void 0:S.captionY)!==void 0?S.captionY:t.length>0||a.length>0?s4((S==null?void 0:S.layout)??"full-bleed",o4(a,w.start,w.end),S==null?void 0:S.graphicRect,p):n,{from:y,durationInFrames:x}=qf(w.start,w.end,l);return d.jsx(dt,{from:y,durationInFrames:x,children:d.jsx(f4,{line:w,wordOffset:m[v],verticalAnchor:g,fontSizePx:r*((S==null?void 0:S.captionScale)??1),activeColor:o,ctaKeyword:i,ctaWindow:s})},v)})})};function m4(e,t,n,r=.5,o=.5){const i=Math.max(1,e.width),s=Math.max(1,e.height),a=Math.max(1,t.w),l=Math.max(1,t.h),u=Math.max(n.width/a,n.height/l),f=-t.x*u+(n.width-a*u)*Dh(r),p=-t.y*u+(n.height-l*u)*Dh(o);return{width:i*u,height:s*u,left:f,top:p}}function Dh(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):.5}function nx(e,t,n){const r=Math.max(1,e.width),o=Math.max(1,e.height),i=Math.max(1,t.w),s=Math.max(1,t.h),a=Math.min(n.width/i,n.height/s),l=-t.x*a+(n.width-i*a)/2,u=-t.y*a+(n.height-s*a)/2;return{width:r*a,height:o*a,left:l,top:u}}function h4(e,t){return nx(e,{x:0,y:0,w:e.width,h:e.height},t)}function g4(e,t){if(e.length===0)return t;for(const o of e)if(t>=o.outIn&&t<o.outOut)return o.srcIn+(t-o.outIn);const n=e[0];return t<n.outIn?n.srcIn:e[e.length-1].srcOut}function v4(e,t,n,r,o,i){return e==="fit"?nx(t,n,r):m4(t,n,r,o,i)}function y4(e,t,n,r){return e.length===0?{x:0,y:0,w:r.width,h:r.height,full:!0}:zF(e,g4(t,n),r)}const w4=({cues:e,theme:t,face:n,zoomPlan:r,sourceTextRegions:o,contentTimeline:i,spans:s,sourceSize:a,contentCropMode:l="cover",sourceFit:u="cover",children:f})=>{const p=ct(),{fps:m,width:h,height:w}=Xe(),v=p/m,g=n4(e,v,n??void 0,o??[],{width:h,height:w}),y=r4(e,v),x=g.rect.w*h,b=g.rect.h*w,k=g.cornerRadius*Math.min(x,b)/2,E=cr(e,v),I=E==null?void 0:E.video,T=r&&r.length>0?LF(r,v):1,_=Math.max(0,g.opacity*(1-.6*g.cornerRadius)),$=(I==null?void 0:I.autoZoom)!==!1,M=u==="contain"&&a!==void 0,P=$&&!M?1+(T-1)*_:1,D=(I==null?void 0:I.scale)??1,O=(I==null?void 0:I.dx)??0,A=(I==null?void 0:I.dy)??0,Z=[O!==0||A!==0?`translate(${O}px, ${A}px)`:"",P*D!==1?`scale(${P*D})`:""].filter(Boolean).join(" ")||void 0;return d.jsxs(fn,{children:[d.jsx(fn,{style:{background:t.bg,opacity:y}}),d.jsxs("div",{"data-edit-video":E==null?void 0:E.id,style:{position:"absolute",left:`${g.rect.x*100}%`,top:`${g.rect.y*100}%`,width:x,height:b,borderRadius:k,overflow:"hidden",opacity:g.opacity,backgroundColor:M?t.bg:void 0,boxShadow:g.cornerRadius>.5?"0 18px 60px rgba(0,0,0,0.55)":void 0},children:[d.jsx("div",{style:{position:"absolute",inset:0,filter:g.blurPx>.5?`blur(${g.blurPx}px)`:void 0,transform:Z,transformOrigin:"50% 40%","--ossclip-obj-y":`${g.objectPosY*100}%`,"--ossclip-obj-x":`${g.objectPosX*100}%`},children:M?d.jsx(x4,{source:a,slot:{width:x,height:b},children:f}):d.jsx(b4,{timeline:i,spans:s,sourceSize:a,mode:l,tSec:v,slot:{width:x,height:b},posX:g.objectPosX,posY:g.objectPosY,children:f})}),d.jsx("div",{style:{position:"absolute",inset:0,background:"black",opacity:g.dim}})]})]})},x4=({source:e,slot:t,children:n})=>{const r=h4(e,t);return d.jsx("div",{style:{position:"absolute",width:r.width,height:r.height,left:r.left,top:r.top},children:n})},b4=({timeline:e,spans:t,sourceSize:n,mode:r,tSec:o,slot:i,posX:s,posY:a,children:l})=>{const u=d.jsx("div",{style:{position:"absolute",inset:0},children:l});if(!e||e.length<2||!n)return u;const f=y4(e,t??[],o,n);if(f.full)return u;const p=v4(r,n,f,i,s,a);return d.jsx("div",{style:{position:"absolute",width:p.width,height:p.height,left:p.left,top:p.top},children:l})},sp=.94,S4=new Set(["FlowDiagram","StrikethroughReveal","ChatMock","BulletList"]),Oh=2.4,oa=.45,ru=.58,mt=.72,E4=.62;function oo(e,t,n,r,o){const i=Math.max(1,Math.floor(n/Math.max(1,o*t)));return Math.max(1,Math.ceil(e/i))*t*r}const Me=e=>typeof e=="string"?e:"",Jn=e=>Array.isArray(e)?e:[];function k4(e,t,n,r=1/0){switch(e){case"TitleCard":{const o=n-80,i=Me(t.emphasis),s=28;let a=0,l=0;Me(t.eyebrow)&&(a+=34*1.2,l++),i&&(a+=210*.95,l++);const u=i?64:96;return a+=oo(Me(t.title).length,u,o,1.05,mt),l++,Me(t.sub)&&(a+=oo(Me(t.sub).length,40,o,1.2,ru),l++),a+s*Math.max(0,l-1)}case"StatCard":{const o=oo(Me(t.label).length,42,n*.55,1.15,mt);let i=88+Math.max(o,110*1.15)+4;return Me(t.caption)&&(i+=30+(38*1.2+32+4)),i}case"RuleCard":{const o=n-60-96;let i=80;return i+=30*1.2+14,i+=oo(Me(t.text).length,72,o,1.02,mt),Me(t.struck)&&(i+=26+oo(Me(t.struck).length,44,o,1.2,mt)),i}case"StrikethroughReveal":{const o=Jn(t.lines).map(a=>Me(a==null?void 0:a.text)),i=ax(o,n,r),s=o.reduce((a,l)=>a+sx(l,i,n).length,0);return s*i*1.08+i*.2*Math.max(0,s-1)}case"FlowDiagram":{const o=Jn(t.nodes).map(l=>Me(l)),i=Math.max(1,o.length),{mode:s,fontSize:a}=mx(o,n,r);return s==="row"?a*$i+4:a*($i*i+px*(i-1))}case"TerminalMock":{const o=Jn(t.windows);let i=0;for(const s of o){const a=Jn(s==null?void 0:s.lines);i+=56.8+2,i+=Math.max(1,a.length)*27*1.2+8*Math.max(0,a.length-1)+36,i+=4}return i+=22*Math.max(0,o.length-1),Me(t.fanOut)&&(i+=22+40*1.2),i}case"ChatMock":{const o=dx(t).map(s=>s.text),i=fx(o,{widthPx:n,heightPx:r});return cx(o,i,n)}case"ScreenshotFrame":{const o=n*.94;return(Me(t.src)?o*9/16:480)+4}case"BulletList":{const o=Jn(t.items).map(s=>Me(s)),i=ix(o,n,r,!!Me(t.title),Me(t.title));return _4(o.length,i,!!Me(t.title))}}}const Yn=e=>Me(e).split(/\s+/).reduce((t,n)=>Math.max(t,n.length),0);function C4(e,t){switch(e){case"RuleCard":{const n=Yn(t.kicker)*30*(mt+.28),r=Yn(t.text)*72*mt,o=Yn(t.struck)*44*(mt+.04),i=Math.max(n,r,o);return i>0?156+i:0}case"TitleCard":{const n=Me(t.emphasis)?64:96,r=Yn(t.eyebrow)*34*(mt+.35),o=Yn(t.emphasis)*210*mt,i=Yn(t.title)*n*(mt+.02),s=Yn(t.sub)*40*ru,a=Math.max(r,o,i,s);return a>0?80+a:0}case"TerminalMock":{let n=0;for(const r of Jn(t.windows))for(const o of Jn(r==null?void 0:r.lines))n=Math.max(n,Me(o).length);return n>0?108+n*27*E4:0}case"StatCard":{const n=Me(t.value).length*110*mt;return n===0?0:164+Yn(t.label)*42*mt+40+n}default:return 0}}const Vh=36,I4=120,rx=1.6,ox=.88,T4=(mt+.28)*.36,R4=1.1;function _4(e,t,n){return(Math.max(1,e)*rx+(n?ox:0))*t}function ix(e,t=831,n=1/0,r=!1,o=""){const i=e.reduce((l,u)=>Math.max(l,u.length),0);if(i===0)return Vh;const s=Math.min(t/(i*mt+R4),o?t/(o.length*T4):1/0),a=n*sp/(Math.max(1,e.length)*rx+(r?ox:0));return Math.max(Vh,Math.min(I4,Math.floor(Math.min(s,a))))}const P4=92,F4=44,j4=150,M4=[" → "," -> "," → "," > "];function sx(e,t,n){const r=o=>o.length*t*mt<=n;if(r(e))return[e];for(const o of M4){if(!e.includes(o))continue;const s=e.split(o).map((a,l)=>l===0?a:`${o.trim()} ${a}`.trim());if(s.every(r))return s}return[e]}function ax(e,t=831,n=1/0){const r=e.reduce((s,a)=>Math.max(s,a.length),0);if(r===0)return P4;const o=t/(r*mt),i=n/(Math.max(1,e.length)*1.28);return Math.max(F4,Math.min(j4,Math.floor(Math.min(o,i))))}const Bh=22,Wh=44,$4=96,Uh=22,lx=.85,ux=.82;function cx(e,t,n){const o=(n-80)*ux-2*t*lx;let i=0;for(const s of e)i+=oo(s.length,t,o,1.2,ru)+t*1.2+4;return i+t*.5*Math.max(0,e.length-1)}function dx(e){const t=Me(e.keyword);return t?[{from:"user",text:`"${t.toUpperCase()}"`}]:Jn(e.messages).map(n=>{const r=n??{};return{from:r.from==="agent"?"agent":"user",text:Me(r.text)}})}function fx(e,t={}){const n=t.widthPx??831,r=t.heightPx??1/0,o=n-80,i=e.reduce((p,m)=>Math.max(p,m.length),0);if(i===0)return Wh;const s=e.flatMap(p=>p.split(/\s+/)).reduce((p,m)=>Math.max(p,m.length),0),a=p=>o*ux/(p*ru+2*lx),l=Math.min(i,Uh),u=i>Uh?Wh:$4;let f=Math.floor(Math.min(a(l),a(s),u));for(;f>Bh&&cx(e,f,n)>r*sp;)f-=1;return Math.max(Bh,f)}const Hh=26,A4=22,N4=76,$i=2.1,px=2.05;function mx(e,t,n=1/0){const r=e.reduce((v,S)=>v+S.length,0),o=Math.max(1,e.length),i=.78,s=1.6,a=1.8,l=t-20,u=Math.floor(Math.min(l/(i*r+s*o+a*(o-1)),n/$i)),f=Math.max(...e.map(v=>v.length),1),p=$i*o+px*(o-1),m=Math.floor(Math.min(l/(i*f+s),n/p,N4)),h=u>=Hh;return m>=A4?h?u*$i>=m*p?{mode:"row",fontSize:u}:{mode:"stack",fontSize:m}:{mode:"stack",fontSize:m}:{mode:"row",fontSize:Math.max(Hh,u)}}function L4(e,t,n){if(S4.has(e))return 1;const r=n.heightPx*sp,o=u=>k4(e,t,n.widthPx/u)*u<=r;if(!o(oa))return oa;const i=C4(e,t),s=i>0?n.widthPx/i:Oh;let a=oa,l=Math.max(oa,Math.min(Oh,s));if(l<=a)return a;for(let u=0;u<24;u++){const f=(a+l)/2;o(f)?a=f:l=f}return a}function ot(e=0){const t=ct(),{fps:n}=Xe();return sd({frame:t-e,fps:n,config:{damping:200,stiffness:130},durationInFrames:Math.round(n*.5)})}function bn(e,t=26){return{opacity:e,transform:`translateY(${(1-e)*t}px)`}}function Or(e){return{opacity:e,transform:`scale(${.9+.1*e})`}}function z4(e,t){return!e||t===1?e:Object.fromEntries(Object.entries(e).map(([n,r])=>[n,{...r,...r.dx!==void 0?{dx:r.dx/t}:{},...r.dy!==void 0?{dy:r.dy/t}:{}}]))}function Je(e,t){const n=e==null?void 0:e[t];if(!n)return{};if(n.hidden)return{display:"none"};const r=[`translate(${n.dx??0}px, ${n.dy??0}px)`];return n.scale!==void 0&&n.scale!==1&&r.push(`scale(${n.scale})`),{transform:r.join(" ")}}const D4=({props:e,theme:t,edits:n})=>{var l;const r=ot(0),o=ot(5),i=ot(10),s=(l=e.emphasis)==null?void 0:l.trim(),a=!!s&&s.toLowerCase().includes(e.title.trim().toLowerCase());return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:28,textAlign:"center",fontFamily:t.fontDisplay,color:t.fg,padding:"0 40px"},children:[e.eyebrow?d.jsx("div",{"data-edit-id":"eyebrow",style:{...bn(r),fontSize:34,fontWeight:700,letterSpacing:"0.35em",color:t.muted,textTransform:"uppercase",...Je(n,"eyebrow")},children:e.eyebrow}):null,s?d.jsx("div",{"data-edit-id":"emphasis",style:{...bn(o,40),fontSize:210,fontWeight:900,lineHeight:.95,...Je(n,"emphasis")},children:s}):null,a?null:d.jsx("div",{"data-edit-id":"title",style:{...bn(s?i:o,34),fontSize:s?64:96,fontWeight:900,lineHeight:1.05,textTransform:"uppercase",letterSpacing:"0.02em",...Je(n,"title")},children:e.title}),e.sub?d.jsx("div",{"data-edit-id":"sub",style:{...bn(i),fontSize:40,fontWeight:600,color:t.muted,...Je(n,"sub")},children:e.sub}):null]})},O4=({props:e,theme:t,edits:n})=>{const r=ot(0),o=ot(6),i=e.inverted;return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:30,fontFamily:t.fontDisplay,width:"100%",padding:"0 30px"},children:[d.jsxs("div",{style:{...Or(r),display:"flex",alignItems:"center",justifyContent:"space-between",gap:40,width:"100%",background:i?t.fg:t.cardBg,color:i?t.bg:t.fg,border:`2px solid ${i?t.fg:t.cardBorder}`,borderRadius:t.radiusPx,padding:"44px 52px"},children:[d.jsx("div",{"data-edit-id":"label",style:{fontSize:42,fontWeight:800,textTransform:"uppercase",letterSpacing:"0.06em",lineHeight:1.15,maxWidth:"55%",...Je(n,"label")},children:e.label}),d.jsx("div",{"data-edit-id":"value",style:{fontSize:110,fontWeight:900,whiteSpace:"nowrap",...Je(n,"value")},children:e.value})]}),e.caption?d.jsx("div",{"data-edit-id":"caption",style:{...bn(o),fontSize:38,fontWeight:800,color:t.fg,background:t.cardBg,border:`2px solid ${t.cardBorder}`,borderRadius:t.radiusPx/2,padding:"16px 30px",textTransform:"uppercase",letterSpacing:"0.08em",...Je(n,"caption")},children:e.caption}):null]})},V4=({props:e,theme:t,edits:n})=>{const r=ot(0),o=ot(8);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:26,fontFamily:t.fontDisplay,width:"100%",padding:"0 30px"},children:[d.jsxs("div",{style:{...Or(r),width:"100%",background:t.fg,color:t.bg,borderRadius:t.radiusPx,padding:"40px 48px",textAlign:"left"},children:[d.jsx("div",{"data-edit-id":"kicker",style:{fontSize:30,fontWeight:800,letterSpacing:"0.28em",textTransform:"uppercase",color:"#55555E",marginBottom:14,fontFamily:t.fontMono,...Je(n,"kicker")},children:e.kicker}),d.jsx("div",{"data-edit-id":"text",style:{fontSize:72,fontWeight:900,lineHeight:1.02,textTransform:"uppercase",...Je(n,"text")},children:e.text})]}),e.struck?d.jsx("div",{"data-edit-id":"struck",style:{...bn(o),fontSize:44,fontWeight:800,color:t.muted,textDecoration:"line-through",textDecorationThickness:6,textDecorationColor:t.danger,textTransform:"uppercase",letterSpacing:"0.04em",...Je(n,"struck")},children:e.struck}):null]})},B4=({text:e,struck:t,mark:n,delay:r,fontSize:o,theme:i,editId:s,edits:a})=>{const l=ot(r),u=ot(r+8);return d.jsxs("div",{"data-edit-id":s,style:{...bn(l,30),position:"relative",display:"inline-block",...Je(a,s)},children:[d.jsxs("span",{style:{fontSize:o,fontWeight:900,textTransform:"uppercase",lineHeight:1.08,whiteSpace:"nowrap",color:t?i.muted:i.fg},children:[n!=="none"?d.jsx("span",{style:{color:n==="cross"?i.danger:i.success,marginRight:"0.3em"},children:n==="cross"?"✗":"✓"}):null,e]}),t?d.jsx("div",{style:{position:"absolute",left:"-2%",top:"50%",height:o*.11,width:`${u*104}%`,background:i.danger,borderRadius:o*.055,transform:"translateY(-50%) rotate(-2deg)"}}):null]})},W4=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const i=e.lines.map(l=>(l.mark??"none")!=="none"?`✗ ${l.text}`:l.text),s=ax(i,n,r),a=e.lines.flatMap((l,u)=>sx(l.text,s,n??831).map((f,p)=>({text:f,struck:l.struck,mark:p===0?l.mark??"none":"none",lineIndex:u})));return d.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:s*.2,textAlign:"center",fontFamily:t.fontDisplay},children:a.map((l,u)=>d.jsx(B4,{text:l.text,struck:l.struck,mark:l.mark,delay:u*6,fontSize:s,theme:t,editId:`line-${l.lineIndex}`,edits:o},u))})},U4=({text:e,emphasized:t,delay:n,fontSize:r,theme:o,editId:i,edits:s})=>{const a=ot(n);return d.jsx("div",{"data-edit-id":i,style:{...Or(a),background:t?o.fg:o.cardBg,color:t?o.bg:o.fg,border:`2px solid ${t?o.fg:o.cardBorder}`,borderRadius:o.radiusPx/2,padding:`${r*.55}px ${r*.8}px`,fontSize:r,fontWeight:900,textTransform:"uppercase",letterSpacing:"0.04em",whiteSpace:"nowrap",fontFamily:o.fontDisplay,...Je(s,i)},children:e})},H4=({delay:e,fontSize:t,theme:n,down:r=!1})=>{const o=ot(e);return d.jsx("div",{style:{opacity:o,color:n.muted,fontSize:t*1.15,fontWeight:700,lineHeight:1,paddingLeft:r?0:t*.55},children:r?"↓":"→"})};function Z4(e,t=Y4,n){return mx(e,t,n)}const Y4=864,K4=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const{mode:i,fontSize:s}=Z4(e.nodes,n,r),a=i==="row";return d.jsx("div",{style:{display:"flex",flexDirection:a?"row":"column",flexWrap:"nowrap",alignItems:"center",justifyContent:"center",gap:a?0:s*.45,padding:"0 10px"},children:e.nodes.map((l,u)=>d.jsxs("div",{style:{display:"flex",flexDirection:a?"row":"column",alignItems:"center",gap:a?s*.55:s*.45},children:[u>0?d.jsx(H4,{delay:u*6+3,fontSize:s,theme:t,down:!a}):null,d.jsx(U4,{text:l,emphasized:e.emphasizeLast&&u===e.nodes.length-1,delay:u*6,fontSize:s,theme:t,editId:`node-${u}`,edits:o})]},u))})},X4=({title:e,lines:t,delay:n,theme:r,editId:o,edits:i})=>{const s=ot(n);return d.jsxs("div",{"data-edit-id":o,style:{...Or(s),background:r.cardBg,border:`2px solid ${r.cardBorder}`,borderRadius:r.radiusPx/2,overflow:"hidden",width:"100%",fontFamily:r.fontMono,...Je(i,o)},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 20px",borderBottom:`2px solid ${r.cardBorder}`},children:[["#FF5F57","#FEBC2E","#28C840"].map(a=>d.jsx("div",{style:{width:16,height:16,borderRadius:8,background:a}},a)),d.jsx("div",{style:{marginLeft:10,fontSize:24,color:r.muted},children:e})]}),d.jsx("div",{style:{padding:"18px 22px",display:"flex",flexDirection:"column",gap:8},children:t.map((a,l)=>d.jsx("div",{style:{fontSize:27,color:r.fg,whiteSpace:"pre"},children:a},l))})]})},G4=({props:e,theme:t,edits:n})=>{const r=ot(e.windows.length*6+4);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:22,width:"100%",padding:"0 30px"},children:[e.windows.map((o,i)=>d.jsx(X4,{title:o.title,lines:o.lines,delay:i*6,theme:t,editId:`window-${i}`,edits:n},i)),e.fanOut?d.jsxs("div",{"data-edit-id":"fanOut",style:{...bn(r),fontFamily:t.fontDisplay,fontSize:40,fontWeight:900,letterSpacing:"0.2em",color:t.fg,textTransform:"uppercase",...Je(n,"fanOut")},children:["⌄ ",e.fanOut]}):null]})},q4=({from:e,text:t,delay:n,fontSize:r,theme:o,editId:i,edits:s})=>{const a=ot(n),l=e==="user";return d.jsx("div",{"data-edit-id":i,style:{...Or(a),alignSelf:l?"flex-end":"flex-start",background:l?o.fg:o.cardBg,color:l?o.bg:o.fg,border:`2px solid ${l?o.fg:o.cardBorder}`,borderRadius:28,[l?"borderBottomRightRadius":"borderBottomLeftRadius"]:8,padding:`${r*.6}px ${r*.85}px`,fontSize:r,fontWeight:700,maxWidth:"82%",fontFamily:o.fontDisplay,...Je(s,i)},children:t})},Q4=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const i=dx(e),s=fx(i.map(a=>a.text),{widthPx:n,heightPx:r});return d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:s*.5,width:"100%",padding:"0 40px"},children:i.map((a,l)=>d.jsx(q4,{from:a.from,text:a.text,delay:l*8,fontSize:s,theme:t,editId:`message-${l}`,edits:o},l))})},J4=({props:e,theme:t,edits:n})=>{const r=ot(0),o=ot(8),i=ct(),{fps:s}=Xe(),a=e.kenBurns?Ko(i,[0,s*8],[1,1.08],{extrapolateRight:"clamp"}):1,l=e.src?/^https?:\/\//.test(e.src)?e.src:mw(e.src):null;return d.jsxs("div",{"data-edit-id":"image",style:{...Or(r),position:"relative",width:"94%",...Je(n,"image")},children:[d.jsx("div",{style:{overflow:"hidden",borderRadius:t.radiusPx/2,border:`2px solid ${t.cardBorder}`,background:t.cardBg,boxShadow:"0 24px 80px rgba(0,0,0,0.5)"},children:l?d.jsx(Bf,{src:l,style:{width:"100%",display:"block",transform:`scale(${a})`}}):d.jsx("div",{style:{height:420,display:"flex",flexDirection:"column",gap:14,padding:30,transform:`scale(${a})`},children:[.9,.75,.85,.6,.8,.5].map((u,f)=>d.jsx("div",{style:{height:22,width:`${u*100}%`,borderRadius:6,background:f%3===0?t.cardBorder:"#22222B"}},f))})}),e.label?d.jsx("div",{"data-edit-id":"label",style:{...Or(o),position:"absolute",right:-8,bottom:-20,background:t.fg,color:t.bg,fontFamily:t.fontMono,fontSize:28,fontWeight:800,letterSpacing:"0.08em",padding:"12px 22px",borderRadius:10,textTransform:"uppercase",...Je(n,"label")},children:e.label}):null]})},ej=({text:e,index:t,fontSize:n,theme:r,edits:o})=>{const i=`item-${t}`,s=ot(t*7);return d.jsxs("div",{"data-edit-id":i,style:{...bn(s,26),display:"flex",alignItems:"baseline",gap:n*.35,...Je(o,i)},children:[d.jsx("span",{style:{fontSize:n*.75,color:r.accent,fontWeight:900},children:"▸"}),d.jsx("span",{style:{fontSize:n,fontWeight:900,textTransform:"uppercase",lineHeight:1.15,whiteSpace:"nowrap",color:r.fg},children:e})]})},tj=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const i=ix(e.items,n,r,!!e.title,e.title),s=ot(0);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:i*.45,fontFamily:t.fontDisplay},children:[e.title?d.jsx("div",{"data-edit-id":"title",style:{...bn(s,20),fontSize:i*.36,fontWeight:700,letterSpacing:"0.28em",textTransform:"uppercase",color:t.muted,...Je(o,"title")},children:e.title}):null,e.items.map((a,l)=>d.jsx(ej,{text:a,index:l,fontSize:i,theme:t,edits:o},l))]})},nj={TitleCard:D4,StatCard:O4,RuleCard:V4,StrikethroughReveal:W4,FlowDiagram:K4,TerminalMock:G4,ChatMock:Q4,ScreenshotFrame:J4,BulletList:tj},rj=new Set(["lower-third","full-bleed"]),oj=.55,ij=e=>{const t=/^#([0-9a-fA-F]{6})$/.exec(e.trim()),[n,r,o]=t?[0,2,4].map(i=>Number.parseInt(t[1].slice(i,i+2),16)):[0,0,0];return`rgba(${n}, ${r}, ${o}, ${oj})`},sj=e=>({width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",opacity:e,transform:e<1?`translateY(${(1-e)*18}px)`:void 0}),aj=({durationInFrames:e,children:t})=>{const n=ct(),{fps:r}=Xe(),{exitSec:o}=tx(e/r),i=(e-n)/r,s=o<=0?1:Math.min(1,Math.max(0,i/o));return d.jsx("div",{style:sj(ip(s)),children:t})},lj=({durationInFrames:e,themeBg:t,radiusPx:n})=>{const r=ct(),{fps:o}=Xe(),{enterSec:i}=tx(e/o),s=i<=0?1:Math.min(1,Math.max(0,r/o/i)),a=ip(s);return d.jsx("div",{style:{position:"absolute",inset:0,background:ij(t),backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",borderRadius:n,opacity:a,transform:a<1?`translateY(${(1-a)*18}px)`:void 0}})},uj=({cues:e,theme:t})=>{const{fps:n,width:r,height:o}=Xe();return d.jsx(fn,{style:{pointerEvents:"none"},children:e.map(i=>{if(i.kind==="plain"||!i.component||!i.props)return null;const s=Qw(i,{width:r,height:o}),a=nj[i.component],{from:l,durationInFrames:u}=qf(i.startSec,i.endSec,n),f=s.w*r,p=s.h*o,m=rj.has(i.layout),h=m?Math.min(24,Math.round(p*.12)):0,w=f-h*2,v=p-h*2,S=L4(i.component,i.props,{widthPx:w,heightPx:v});return d.jsx(dt,{from:l,durationInFrames:u,children:d.jsx("div",{"data-edit-scene":i.id,style:{position:"absolute",left:`${s.x*100}%`,top:`${s.y*100}%`,width:`${s.w*100}%`,height:`${s.h*100}%`,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"auto",overflow:"hidden"},children:d.jsxs(aj,{durationInFrames:u,children:[m?d.jsx(lj,{durationInFrames:u,themeBg:t.bg,radiusPx:t.radiusPx}):null,d.jsx("div",{style:{width:w/S,transform:`scale(${S})`,position:"relative"},children:d.jsx(a,{props:i.props,theme:t,widthPx:w/S,heightPx:v/S,edits:z4(i.elements,S)})})]})})},i.id)})})},cj="made with ossclip",dj=.45,fj=.024;function pj(e=$t){const t=yn(e);return{xPx:Math.round(t.left*e.width),yPx:Math.round(t.top*e.height),fontPx:Math.round(Math.min(e.width,e.height)*fj),opacity:dj,text:cj}}function mj(e){return e===!0}const hj=({theme:e,frame:t})=>{const n=pj(t);return d.jsx("div",{style:{position:"absolute",left:n.xPx,top:n.yPx,fontFamily:e.fontDisplay,fontSize:n.fontPx,fontWeight:600,letterSpacing:"0.02em",color:e.fg,opacity:n.opacity,pointerEvents:"none",whiteSpace:"nowrap"},children:n.text})},gj=({videoFileName:e,spans:t,captionLines:n,sceneCues:r,theme:o,settings:i,face:s,zoomPlan:a,ctaKeyword:l,ctaWindow:u,sourceTextRegions:f,contentTimeline:p,sourceSize:m,contentCropMode:h,sourceFit:w,watermark:v})=>{if(!e)return d.jsx(fn,{style:{backgroundColor:"#111",color:"#888",alignItems:"center",justifyContent:"center",fontFamily:"monospace",fontSize:40},children:"no production loaded"});const S=/^https?:\/\//.test(e)?e:mw(e);return d.jsxs(fn,{style:{backgroundColor:"black"},children:[d.jsx(w4,{cues:r,theme:o,face:s,zoomPlan:a,sourceTextRegions:f,contentTimeline:p,spans:t,sourceSize:m,contentCropMode:h,sourceFit:w,children:d.jsx(dT,{src:S,spans:t,...w==="contain"?{punchInScale:1,background:"transparent"}:{}})}),d.jsx(uj,{cues:r,theme:o}),d.jsx(p4,{lines:n,cues:r,activeColor:o.accent,ctaKeyword:l,ctaWindow:u,sourceTextRegions:f}),mj(v)?d.jsx(hj,{theme:o,frame:{width:i.width,height:i.height}}):null]})},vj=600,yj=()=>({doc:SF(),past:[],future:[],dirty:!1,savedAt:0,lastCoalesce:null}),gn=(e,t)=>e.scenes[t]??{props:{},elements:{}};function wj(e,t){var r;const n=(o,i)=>{const s=Date.now(),a=i!==void 0&&e.lastCoalesce!==null&&e.lastCoalesce.key===i&&s-e.lastCoalesce.at<vj;return{doc:o,past:a?e.past:[...e.past,e.doc],future:[],dirty:!0,savedAt:e.savedAt,lastCoalesce:i!==void 0?{key:i,at:s}:null}};switch(t.type){case"load":return{doc:t.doc,past:[],future:[],dirty:!1,savedAt:0,lastCoalesce:null};case"patchProps":{const o=gn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,props:{...o.props,...t.patch}}}},t.coalesce)}case"patchElement":return n(Ah(e.doc,t.sceneId,t.elementId,t.patch),t.coalesce);case"clearElement":return n(RF(e.doc,t.sceneId,t.elementId));case"hideElement":return n(Ah(e.doc,t.sceneId,t.elementId,{hidden:!0}));case"restoreElement":{const o=(r=e.doc.scenes[t.sceneId])==null?void 0:r.elements[t.elementId];return o!=null&&o.hidden?n(_F(e.doc,t.sceneId,t.elementId)):e}case"patchTiming":{const o=gn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,timing:{startSec:t.startSec,endSec:t.endSec}}}})}case"clearTiming":return n(PF(e.doc,t.sceneId));case"patchVideo":{const o=gn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,video:{...o.video,...t.patch}}}},t.coalesce)}case"clearVideo":{const o=e.doc.scenes[t.sceneId];if(!(o!=null&&o.video))return e;const{video:i,...s}=o;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:s}})}case"patchPip":{const o=gn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,pip:{...o.pip,...t.patch}}}},t.coalesce)}case"clearPip":{const o=e.doc.scenes[t.sceneId];if(!(o!=null&&o.pip))return e;const{pip:i,...s}=o;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:s}})}case"patchCaptionY":{const o=gn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,captionY:t.y}}},t.coalesce)}case"patchCaptionScale":{const o=gn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,captionScale:t.scale}}},t.coalesce)}case"clearCaptionStyle":{const o=e.doc.scenes[t.sceneId];if((o==null?void 0:o.captionY)===void 0&&(o==null?void 0:o.captionScale)===void 0)return e;const{captionY:i,captionScale:s,...a}=o;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:a}})}case"patchCaptionStyleAll":{const o={...e.doc.scenes};for(const i of t.sceneIds){const s=o[i]??{props:{},elements:{}};o[i]={...s,...t.y!==void 0?{captionY:t.y}:{},...t.scale!==void 0?{captionScale:t.scale}:{}}}return n({...e.doc,scenes:o})}case"addSplit":return e.doc.splits.some(o=>Math.abs(o-t.t)<.001)?e:n({...e.doc,splits:[...e.doc.splits,t.t].sort((o,i)=>o-i)});case"hideScene":{const o=gn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,hidden:!0}}})}case"restoreScene":{const o=e.doc.scenes[t.sceneId];if(!(o!=null&&o.hidden))return e;const{hidden:i,...s}=o;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:s}})}case"cutChunk":{const o=e.doc.cuts.filter(i=>i.src!==void 0||i.startSec!==t.startSec||i.endSec!==t.endSec);return n({...e.doc,cuts:[...o,{startSec:t.startSec,endSec:t.endSec}]})}case"restoreChunk":{if(t.index<0||t.index>=e.doc.cuts.length)return e;const o=e.doc.cuts.filter((i,s)=>s!==t.index);return n({...e.doc,cuts:o})}case"patchComponent":{const o=gn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,component:t.component}}})}case"patchLayout":{const{graphicRect:o,...i}=gn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...i,layout:t.layout}}})}case"patchGraphicRect":{const o=gn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,graphicRect:t.rect}}},t.coalesce)}case"clearGraphicRect":return n(FF(e.doc,t.sceneId));case"patchCaption":{const o=String(t.index),i=xF(e.doc.captions,t.index,t.was);if(t.text===i){const{[o]:s,...a}=e.doc.captions;return n({...e.doc,captions:a})}return n({...e.doc,captions:{...e.doc.captions,[o]:{text:t.text,was:i}}})}case"patchTheme":return n({...e.doc,theme:{...e.doc.theme,...t.patch}});case"undo":{if(e.past.length===0)return e;const o=e.past[e.past.length-1],i=e.past.slice(0,-1);return{doc:o,past:i,future:[...e.future,e.doc],savedAt:e.savedAt,dirty:i.length!==e.savedAt,lastCoalesce:null}}case"redo":{if(e.future.length===0)return e;const o=e.future[e.future.length-1],i=[...e.past,e.doc];return{doc:o,past:i,future:e.future.slice(0,-1),savedAt:e.savedAt,dirty:i.length!==e.savedAt,lastCoalesce:null}}case"saved":return{...e,dirty:!1,savedAt:e.past.length}}}function xj(){const[e,t]=c.useReducer(wj,void 0,yj),n=async()=>{const r=await fetch("/api/overrides",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e.doc)});if(!r.ok){const o=await r.json().catch(()=>({}));throw new Error(o.error??"save failed")}t({type:"saved"})};return{doc:e.doc,dirty:e.dirty,canUndo:e.past.length>0,canRedo:e.future.length>0,load:r=>t({type:"load",doc:r}),undo:()=>t({type:"undo"}),redo:()=>t({type:"redo"}),save:n,patchProps:(r,o,i)=>t({type:"patchProps",sceneId:r,patch:o,coalesce:i}),patchElement:(r,o,i,s)=>t({type:"patchElement",sceneId:r,elementId:o,patch:i,coalesce:s}),clearElement:(r,o)=>t({type:"clearElement",sceneId:r,elementId:o}),hideElement:(r,o)=>t({type:"hideElement",sceneId:r,elementId:o}),restoreElement:(r,o)=>t({type:"restoreElement",sceneId:r,elementId:o}),patchTiming:(r,o,i)=>t({type:"patchTiming",sceneId:r,startSec:o,endSec:i}),clearTiming:r=>t({type:"clearTiming",sceneId:r}),patchVideo:(r,o,i)=>t({type:"patchVideo",sceneId:r,patch:o,coalesce:i}),clearVideo:r=>t({type:"clearVideo",sceneId:r}),patchPip:(r,o,i)=>t({type:"patchPip",sceneId:r,patch:o,coalesce:i}),clearPip:r=>t({type:"clearPip",sceneId:r}),patchCaptionY:(r,o,i)=>t({type:"patchCaptionY",sceneId:r,y:o,coalesce:i}),patchCaptionScale:(r,o,i)=>t({type:"patchCaptionScale",sceneId:r,scale:o,coalesce:i}),clearCaptionStyle:r=>t({type:"clearCaptionStyle",sceneId:r}),patchCaptionStyleAll:(r,o)=>t({type:"patchCaptionStyleAll",sceneIds:r,...o}),addSplit:r=>t({type:"addSplit",t:r}),hideScene:r=>t({type:"hideScene",sceneId:r}),restoreScene:r=>t({type:"restoreScene",sceneId:r}),cutChunk:(r,o)=>t({type:"cutChunk",startSec:r,endSec:o}),restoreChunk:r=>t({type:"restoreChunk",index:r}),patchGraphicRect:(r,o,i)=>t({type:"patchGraphicRect",sceneId:r,rect:o,coalesce:i}),clearGraphicRect:r=>t({type:"clearGraphicRect",sceneId:r}),patchComponent:(r,o)=>t({type:"patchComponent",sceneId:r,component:o}),patchLayout:(r,o)=>t({type:"patchLayout",sceneId:r,layout:o}),patchCaption:(r,o,i)=>t({type:"patchCaption",index:r,text:o,was:i}),patchTheme:r=>t({type:"patchTheme",patch:r})}}function Zh(e){const t=e==null?void 0:e.closest("[data-edit-id]");if(!t)return null;const n=t.closest("[data-edit-scene]");return n?{sceneId:n.dataset.editScene,elementId:t.dataset.editId}:null}function Yh(e){const t=e==null?void 0:e.closest("[data-edit-video]");return(t==null?void 0:t.dataset.editVideo)||null}function Kh(e,t,n){const r=e.querySelectorAll(`[data-edit-scene="${t}"] [data-edit-id="${n}"]`);if(r.length===0)return null;let o=1/0,i=1/0,s=-1/0,a=-1/0;return r.forEach(l=>{const u=l.getBoundingClientRect();o=Math.min(o,u.left),i=Math.min(i,u.top),s=Math.max(s,u.right),a=Math.max(a,u.bottom)}),new DOMRect(o,i,s-o,a-i)}const Xh=.015,bj=1e-9;function no(e,t){let n=null,r=1/0;for(const o of e){const i=Math.abs(o.feature-o.target);i<=t+bj&&i<r&&(n=o,r=i)}return n}function Gh(e,t,n,r){const o={...e},i=[];if(t==="move"){const s=e.x+e.w/2,a=e.x+e.w,l=.5-e.w/2,u=l>=n.left&&l+e.w<=1-n.right,f=no([...u?[{target:.5,feature:s}]:[],{target:n.left,feature:e.x},{target:1-n.right,feature:a}],r);f&&(o.x=e.x+(f.target-f.feature),i.push({axis:"x",at:f.target}));const p=e.y+e.h/2,m=e.y+e.h,h=.5-e.h/2,w=h>=n.top&&h+e.h<=1-n.bottom,v=no([...w?[{target:.5,feature:p}]:[],{target:n.top,feature:e.y},{target:1-n.bottom,feature:m}],r);return v&&(o.y=e.y+(v.target-v.feature),i.push({axis:"y",at:v.target})),{rect:o,guides:i}}if(t.includes("w")){const s=no([{target:n.left,feature:e.x}],r);if(s){const a=e.x+e.w;o.x=s.target,o.w=a-s.target,i.push({axis:"x",at:s.target})}}else if(t.includes("e")){const s=1-n.right,a=no([{target:s,feature:e.x+e.w}],r);a&&(o.w=a.target-e.x,i.push({axis:"x",at:a.target}))}if(t.includes("n")){const s=no([{target:n.top,feature:e.y}],r);if(s){const a=e.y+e.h;o.y=s.target,o.h=a-s.target,i.push({axis:"y",at:s.target})}}else if(t.includes("s")){const s=1-n.bottom,a=no([{target:s,feature:e.y+e.h}],r);a&&(o.h=a.target-e.y,i.push({axis:"y",at:a.target}))}return{rect:o,guides:i}}function qh(e,t,n,r){const o={...e};return t==="move"?(o.x+=n,o.y+=r,o):(t.includes("w")&&(o.x+=n,o.w-=n),t.includes("e")&&(o.w+=n),t.includes("n")&&(o.y+=r,o.h-=r),t.includes("s")&&(o.h+=r),o)}const Qh=64,ia=9,sa=e=>Math.round(e*10)/10,ro=e=>Math.round(e*1e4)/1e4,hx={position:"absolute",width:10,height:10,background:"#5b8cff",border:"1px solid #0B0B0E",borderRadius:2,pointerEvents:"auto",zIndex:6},Jh={nw:{left:0,top:0,transform:"translate(-50%,-50%)",cursor:"nwse-resize"},n:{left:"50%",top:0,transform:"translate(-50%,-50%)",cursor:"ns-resize"},ne:{right:0,top:0,transform:"translate(50%,-50%)",cursor:"nesw-resize"},e:{right:0,top:"50%",transform:"translate(50%,-50%)",cursor:"ew-resize"},se:{right:0,bottom:0,transform:"translate(50%,50%)",cursor:"nwse-resize"},s:{left:"50%",bottom:0,transform:"translate(-50%,50%)",cursor:"ns-resize"},sw:{left:0,bottom:0,transform:"translate(-50%,50%)",cursor:"nesw-resize"},w:{left:0,top:"50%",transform:"translate(-50%,-50%)",cursor:"ew-resize"}},Sj={...hx,background:"#ffe14d"},Ej={top:{top:0,left:14,right:14,height:10},bottom:{bottom:0,left:14,right:14,height:10},left:{left:0,top:14,bottom:14,width:10},right:{right:0,top:14,bottom:14,width:10}},kj={position:"absolute",cursor:"move",pointerEvents:"auto",zIndex:5},gx=/^(line|node|message|window|item)-(\d+)$/;function Cj(e,t,n){const r=gx.exec(e);if(!r||r[1]==="window")return null;const o=r[1],i=Number(r[2]);if(o==="message"&&i===0&&typeof t.keyword=="string"&&t.keyword){const f=n.trim().replace(/^"(.*)"$/,"$1").toLowerCase();return f?{keyword:f}:null}const s=o==="line"?"lines":o==="node"?"nodes":o==="item"?"items":"messages",a=t[s];if(!Array.isArray(a)||i<0||i>=a.length)return null;const l=a.slice(),u=l[i];if(o==="node"||o==="item")l[i]=n;else{if(typeof u!="object"||u===null)return null;l[i]={...u,text:n}}return{[s]:l}}function Ij(e,t){const n=gx.exec(e);if(!n){const u=t[e];return typeof u=="string"?u:null}if(n[1]==="window")return null;const r=n[1],o=Number(n[2]);if(r==="message"&&o===0&&typeof t.keyword=="string"&&t.keyword)return t.keyword;const s=t[r==="line"?"lines":r==="node"?"nodes":r==="item"?"items":"messages"];if(!Array.isArray(s)||o<0||o>=s.length)return null;const a=s[o];if(r==="node"||r==="item")return typeof a=="string"?a:null;const l=a==null?void 0:a.text;return typeof l=="string"?l:null}function vx(){const e=document.activeElement;(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&e.blur()}const Tj=({stageRef:e,selection:t,onSelect:n,edits:r,onSave:o,settings:i,playerRef:s,onTransport:a,onVideoPreview:l,onGraphicPreview:u,cue:f,cues:p,onToggleHelp:m})=>{const[h,w]=c.useState(null),v=c.useRef(null),S=c.useRef(0),g=c.useRef(null),y=c.useRef(0),x=c.useRef(null),b=c.useRef(0),k=c.useRef(null),[E,I]=c.useState(!1),[T,_]=c.useState([]),$=c.useRef(null),[M,P]=c.useState(null),[D,O]=c.useState(null),A=c.useRef(null),[Z,R]=c.useState({dx:0,dy:0}),C=c.useRef(null),j=c.useRef(t),F=c.useCallback(N=>{j.current=N,n(N)},[n]);c.useEffect(()=>{j.current=t},[t]);const V=(N,L)=>{const B=[];let H=null;for(let z=0;z<25;z++){const Y=document.elementFromPoint(N,L);if(!Y||Y===document.documentElement||Y===document.body){H=Y;break}if(H=Y,Y.hasAttribute("data-edit-id")||Y.hasAttribute("data-edit-scene")||Y.hasAttribute("data-caption-word")||Y.closest("[data-edit-video]")!==null||["BUTTON","INPUT","SELECT","TEXTAREA"].includes(Y.tagName)||!(Y instanceof HTMLElement))break;B.push({el:Y,prev:Y.style.pointerEvents}),Y.style.pointerEvents="none"}return B.forEach(({el:z,prev:Y})=>{z.style.pointerEvents=Y}),H},W=c.useCallback(()=>{var Y,oe;const N=e.current,L=(Y=s.current)==null?void 0:Y.getScale(),B=((oe=N==null?void 0:N.querySelector(".__remotion-player"))==null?void 0:oe.getBoundingClientRect())??(N==null?void 0:N.getBoundingClientRect());if(!B||!L||L<=0)return null;const H=i.width*L,z=i.height*L;return{left:B.left+(B.width-H)/2,top:B.top+(B.height-z)/2,w:H,h:z}},[e,s,i]);return c.useEffect(()=>{if(!t){w(null);return}let N;const L=()=>{var H;const B=e.current;if(B){const z=t.elementId?Kh(B,t.sceneId,t.elementId):((H=B.querySelector(`[data-edit-scene="${t.sceneId}"]`))==null?void 0:H.getBoundingClientRect())??null;w(z)}N=requestAnimationFrame(L)};return N=requestAnimationFrame(L),()=>cancelAnimationFrame(N)},[e,t]),c.useEffect(()=>{const N=L=>{var z,Y;const B=e.current;if(!B||!B.contains(L.target)||L.altKey||L.button!==0)return;(((z=j.current)==null?void 0:z.elementId)&&((Y=C.current)==null?void 0:Y.contains(L.target))||Zh(V(L.clientX,L.clientY))!==null)&&L.stopPropagation()};return window.addEventListener("pointerdown",N,!0),()=>window.removeEventListener("pointerdown",N,!0)},[e]),c.useEffect(()=>{const N=L=>{var se,G,ee,Q,q,he,Ce;const B=e.current;if(!B||!B.contains(L.target)||(vx(),L.altKey||L.button!==0))return;const H=L.target instanceof Element?L.target.closest("[data-el-handle]"):null,z=j.current;if(H&&(z!=null&&z.elementId)){const ve=Kh(B,z.sceneId,z.elementId);if(ve){const pe=ve.left+ve.width/2,Re=ve.top+ve.height/2,be=Math.hypot(L.clientX-pe,L.clientY-Re);if(be>2){const we=((G=(se=r.doc.scenes[z.sceneId])==null?void 0:se.elements[z.elementId])==null?void 0:G.scale)??1;$.current={sceneId:z.sceneId,elementId:z.elementId,cx:pe,cy:Re,startDist:be,prior:we,factor:1},P(1)}}return}if((ee=j.current)!=null&&ee.elementId&&((Q=C.current)!=null&&Q.contains(L.target))){A.current={x:L.clientX,y:L.clientY,dx:0,dy:0},R({dx:0,dy:0});return}const Y=L.target instanceof Element?L.target.closest("[data-box-handle]"):null,oe=j.current;if(Y&&oe&&!oe.elementId){const ve=B.querySelector(`[data-edit-scene="${oe.sceneId}"]`),pe=W();if(ve&&pe){const Re=ve.getBoundingClientRect();k.current=null,x.current={sceneId:oe.sceneId,handle:Y.dataset.boxHandle,x:L.clientX,y:L.clientY,dx:0,dy:0,start:{x:(Re.left-pe.left)/pe.w,y:(Re.top-pe.top)/pe.h,w:Re.width/pe.w,h:Re.height/pe.h}},I(!0)}return}const ae=V(L.clientX,L.clientY),ce=Zh(ae);if(!ce){const ve=ae==null?void 0:ae.closest("[data-edit-scene]");if(ve){F({sceneId:ve.dataset.editScene,elementId:null});return}const pe=Yh(ae),Re=B.getBoundingClientRect().bottom;if(pe&&L.clientY<Re-Qh){F({sceneId:pe,elementId:null});const be=p.find(Pe=>Pe.id===pe);if((be==null?void 0:be.layout)==="pip-bubble"&&!L.altKey){const Pe=Dr("pip-bubble",void 0,[],i).video.rect;g.current={sceneId:pe,x:L.clientX,y:L.clientY,base:{x:((q=be.pip)==null?void 0:q.x)??Pe.x,y:((he=be.pip)==null?void 0:he.y)??Pe.y},slot:{w:Pe.w,h:Pe.h}};return}const we=(Ce=r.doc.scenes[pe])==null?void 0:Ce.video;v.current={sceneId:pe,x:L.clientX,y:L.clientY,dx:0,dy:0,baseDx:(we==null?void 0:we.dx)??0,baseDy:(we==null?void 0:we.dy)??0};return}F(null);return}F({sceneId:ce.sceneId,elementId:ce.elementId}),A.current={x:L.clientX,y:L.clientY,dx:0,dy:0},R({dx:0,dy:0})};return window.addEventListener("mousedown",N),()=>window.removeEventListener("mousedown",N)},[e,F,r,W,p,i]),c.useEffect(()=>{const N=()=>{var Y,oe;const H=(Y=s.current)==null?void 0:Y.getScale(),z=(oe=e.current)==null?void 0:oe.getBoundingClientRect();return H&&H>0?1/H:z&&z.width>0?i.width/z.width:1},L=H=>{const z=e.current;if(z&&!(x.current||$.current))if(g.current)z.style.cursor="move";else if(v.current)z.style.cursor="grabbing";else{const G=H.target instanceof Element?H.target:null,ee=G!==null&&z.contains(G)&&!G.closest("button, input, select, textarea, [data-edit-id], [data-edit-scene], [data-caption-word]")&&H.clientY<z.getBoundingClientRect().bottom-Qh,Q=ee&&(()=>{var he;const q=Yh(G);return q!==null&&((he=p.find(Ce=>Ce.id===q))==null?void 0:he.layout)==="pip-bubble"})();z.style.cursor=ee?Q?"move":"grab":""}const Y=$.current;if(Y){const ee=Math.hypot(H.clientX-Y.cx,H.clientY-Y.cy)/Y.startDist;Y.factor=Math.min(4/Y.prior,Math.max(.05/Y.prior,ee)),P(Y.factor);return}const oe=x.current;if(oe){oe.dx=H.clientX-oe.x,oe.dy=H.clientY-oe.y,k.current=H.altKey,b.current||(b.current=requestAnimationFrame(()=>{b.current=0;const G=x.current,ee=W();if(!G||!ee)return;const Q=al(qh(G.start,G.handle,G.dx/ee.w,G.dy/ee.h),i);if(H.altKey)_([]),u({sceneId:G.sceneId,rect:Q});else{const q=Gh(Q,G.handle,yn(i),Xh);_(q.guides),u({sceneId:G.sceneId,rect:q.rect})}}));return}if(g.current){y.current||(y.current=requestAnimationFrame(()=>{y.current=0;const G=g.current,ee=W();if(!G||!ee)return;const Q=(H.clientX-G.x)/ee.w,q=(H.clientY-G.y)/ee.h;r.patchPip(G.sceneId,{x:ro(Math.min(Math.max(G.base.x+Q,0),1-G.slot.w)),y:ro(Math.min(Math.max(G.base.y+q,0),1-G.slot.h))},`pip:${G.sceneId}:drag`)}));return}const ce=v.current;if(ce){ce.dx=H.clientX-ce.x,ce.dy=H.clientY-ce.y,S.current||(S.current=requestAnimationFrame(()=>{S.current=0;const G=v.current;if(!G)return;const ee=N();l({sceneId:G.sceneId,patch:{dx:G.baseDx+G.dx*ee,dy:G.baseDy+G.dy*ee}})}));return}const se=A.current;se&&(se.dx=H.clientX-se.x,se.dy=H.clientY-se.y,R({dx:se.dx,dy:se.dy}))},B=H=>{const z=$.current;if(z){$.current=null,P(null),Math.abs(z.factor-1)>.001&&r.patchElement(z.sceneId,z.elementId,{scale:Math.round(z.prior*z.factor*1e3)/1e3});return}const Y=x.current;if(Y){if(x.current=null,I(!1),_([]),b.current&&(cancelAnimationFrame(b.current),b.current=0),Y.dx!==0||Y.dy!==0){const G=W();if(G){let ee=al(qh(Y.start,Y.handle,Y.dx/G.w,Y.dy/G.h),i);(k.current??H.altKey)||(ee=Gh(ee,Y.handle,yn(i),Xh).rect),r.patchGraphicRect(Y.sceneId,{x:ro(ee.x),y:ro(ee.y),w:ro(ee.w),h:ro(ee.h)})}}k.current=null,u(null);return}if(g.current){g.current=null,y.current&&(cancelAnimationFrame(y.current),y.current=0);return}const ae=v.current;if(ae){if(v.current=null,S.current&&(cancelAnimationFrame(S.current),S.current=0),ae.dx!==0||ae.dy!==0){const G=N();r.patchVideo(ae.sceneId,{dx:sa(ae.baseDx+ae.dx*G),dy:sa(ae.baseDy+ae.dy*G)})}l(null);return}const ce=A.current,se=j.current;if(!ce||!(se!=null&&se.elementId)){A.current=null;return}if(ce.dx!==0||ce.dy!==0){const G=N(),ee=r.doc.scenes[se.sceneId],Q=ee==null?void 0:ee.elements[se.elementId];r.patchElement(se.sceneId,se.elementId,{dx:sa(((Q==null?void 0:Q.dx)??0)+ce.dx*G),dy:sa(((Q==null?void 0:Q.dy)??0)+ce.dy*G)})}A.current=null,R({dx:0,dy:0})};return window.addEventListener("mousemove",L),window.addEventListener("mouseup",B),()=>{window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",B)}},[r,e,i,s,l,u,W,p]),c.useEffect(()=>{const N=L=>{var oe;const B=e.current;if(!B||!B.contains(L.target))return;const H=(oe=V(L.clientX,L.clientY))==null?void 0:oe.closest("[data-caption-word]");if(!H)return;L.preventDefault();const z=Number(H.dataset.captionWord),Y=H.dataset.captionText??"";!Number.isFinite(z)||!Y||O({index:z,was:Y,draft:Y,rect:H.getBoundingClientRect()})};return window.addEventListener("dblclick",N),()=>window.removeEventListener("dblclick",N)},[e]),c.useEffect(()=>{const N=()=>{const z=document.activeElement;return z instanceof HTMLInputElement||z instanceof HTMLTextAreaElement||z instanceof HTMLSelectElement||z instanceof HTMLElement&&z.isContentEditable},L=()=>{const z=document.activeElement;return z instanceof HTMLTextAreaElement||z instanceof HTMLElement&&z.isContentEditable?!0:z instanceof HTMLInputElement&&!["range","checkbox","radio","button"].includes(z.type)},B=()=>{const z=document.activeElement;z instanceof HTMLElement&&!L()&&z.blur()},H=z=>{var oe,ae,ce,se;if(D!==null)return;const Y=z.metaKey||z.ctrlKey;if(z.key==="Escape"){if(N()){(oe=document.activeElement)==null||oe.blur();return}F(null)}else if(Y&&z.key.toLowerCase()==="z")z.preventDefault(),z.shiftKey?r.redo():r.undo();else if(Y&&z.key.toLowerCase()==="y")z.preventDefault(),r.redo();else if(Y&&z.key.toLowerCase()==="s")z.preventDefault(),o();else if(z.key===" "&&!Y){if(L())return;const G=document.activeElement;if(G instanceof HTMLElement&&G.tagName==="BUTTON"&&((ae=e.current)!=null&&ae.contains(G)))return;B(),z.preventDefault(),(ce=s.current)==null||ce.toggle()}else if(!Y&&["j","k","l"].includes(z.key.toLowerCase())){if(L())return;B(),z.preventDefault(),a(z.key.toUpperCase())}else if(!Y&&!z.altKey&&(z.key==="ArrowLeft"||z.key==="ArrowRight")){if(N())return;z.preventDefault();const G=s.current;if(!G)return;G.seekTo(Math.max(0,G.getCurrentFrame()+(z.key==="ArrowRight"?1:-1)))}else if(Y&&z.key.toLowerCase()==="b"){if(L())return;z.preventDefault();const G=s.current;if(!G)return;const ee=G.getCurrentFrame()/i.fps;if(!p.find(q=>ee>=q.startSec+sl&&ee<=q.endSec-sl))return;r.addSplit(Math.round(ee*1e3)/1e3)}else if(!Y&&z.altKey&&(z.key==="ArrowLeft"||z.key==="ArrowRight")){if(L())return;const G=j.current,ee=G?(()=>{const Q=p.findIndex(q=>q.id===G.sceneId);return Q===-1?void 0:p[Q+(z.key==="ArrowRight"?1:-1)]})():p[z.key==="ArrowRight"?0:p.length-1];if(!ee)return;z.preventDefault(),F({sceneId:ee.id,elementId:null})}else if(Y&&(z.key==="ArrowLeft"||z.key==="ArrowRight")){if(L())return;z.preventDefault();const G=s.current;if(!G)return;const ee=G.getCurrentFrame()/i.fps,Q=p.findIndex(he=>ee>=he.startSec&&ee<he.endSec),q=p[(Q===-1?0:Q)+(z.key==="ArrowRight"?1:-1)];if(!q)return;G.seekTo(Math.round(q.startSec*i.fps)),F({sceneId:q.id,elementId:null})}else if(!Y&&!z.altKey&&z.key==="?"){if(N())return;z.preventDefault(),m()}else if(!Y&&(z.key==="Delete"||z.key==="Backspace")){if(N())return;const G=j.current;if(!G||G.elementId!==null||!f||f.kind==="plain"||f.id!==G.sceneId||((se=r.doc.scenes[G.sceneId])==null?void 0:se.hidden)===!0)return;z.preventDefault(),r.hideScene(G.sceneId)}};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[F,r,D,o,s,e,a,f,p,i,m]),d.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[Z.dx!==0||Z.dy!==0||E?d.jsx("div",{"data-testid":"safe-area-guide",style:{position:"absolute",left:`${yn(i).left*100}%`,top:`${yn(i).top*100}%`,right:`${yn(i).right*100}%`,bottom:`${yn(i).bottom*100}%`,border:"1px dashed rgba(255, 225, 77, 0.45)",boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.18)",pointerEvents:"none"}}):null,T.map(N=>d.jsx("div",{"data-testid":`guide-${N.axis}`,style:{position:"absolute",pointerEvents:"none",background:"#FFE14D",...N.axis==="x"?{left:`${N.at*100}%`,top:0,bottom:0,width:1}:{top:`${N.at*100}%`,left:0,right:0,height:1}}},N.axis)),h&&t?d.jsxs("div",{ref:C,"data-testid":"overlay-box",style:{position:"fixed",pointerEvents:"auto",left:h.left+Z.dx-ia/2+h.width*(1-(M??1))/2,top:h.top+Z.dy-ia/2+h.height*(1-(M??1))/2,width:h.width*(M??1)+ia,height:h.height*(M??1)+ia,border:t.elementId?"2px dashed #ffe14d":"2px dashed #5b8cff",borderRadius:4,boxShadow:"0 0 0 1px rgba(0,0,0,0.35)",cursor:t.elementId?"grab":"default"},children:[t.elementId?d.jsx("div",{style:{position:"absolute",bottom:"100%",left:0,marginBottom:4,fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",letterSpacing:"0.04em",textTransform:"uppercase",color:"#0B0B0E",background:"#ffe14d",padding:"2px 6px",borderRadius:3,whiteSpace:"nowrap"},children:t.elementId}):null,t.elementId?["nw","ne","se","sw"].map(N=>d.jsx("div",{"data-el-handle":N,"data-testid":`el-handle-${N}`,style:{...Sj,...Jh[N]}},N)):null,!t.elementId&&f&&f.kind!=="plain"?d.jsxs(d.Fragment,{children:[["top","bottom","left","right"].map(N=>d.jsx("div",{"data-box-handle":"move","data-testid":N==="top"?"box-handle-move":`box-handle-move-${N}`,style:{...kj,...Ej[N]}},N)),["nw","n","ne","e","se","s","sw","w"].map(N=>d.jsx("div",{"data-box-handle":N,"data-testid":`box-handle-${N}`,style:{...hx,...Jh[N]}},N))]}):null]}):null,D?d.jsx("input",{autoFocus:!0,"data-testid":"caption-edit",value:D.draft,onChange:N=>O({...D,draft:N.target.value}),onBlur:()=>{const N=D.draft.trim();N&&r.patchCaption(D.index,N,D.was),O(null)},onKeyDown:N=>{N.key==="Enter"&&N.target.blur(),N.key==="Escape"&&O(null)},style:{position:"fixed",pointerEvents:"auto",left:D.rect.left-4,top:D.rect.top-4,width:Math.max(D.rect.width+40,90),height:D.rect.height+8,fontSize:Math.max(13,Math.min(D.rect.height*.7,28)),fontFamily:"'Inter', system-ui, sans-serif",fontWeight:800,border:"2px solid #FFE14D",borderRadius:4,padding:"0 4px",background:"#0B0B0E",color:"#fff",outline:"none",zIndex:11}}):null]})},on={display:"flex",flexDirection:"column",gap:6},vi={display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},Le={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"#9A9AA3"},Ai={fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace",fontSize:13,background:"#0F0F14",border:"1px solid #2A2A33",borderRadius:6,color:"#fff",padding:"6px 8px",width:"100%"},yx={...Ai,fontFamily:"'Inter', system-ui, sans-serif"},Ue={display:"flex",flexDirection:"column",gap:14,padding:"16px 18px",borderBottom:"1px solid #22222a"},Lt={fontSize:12,fontWeight:600,color:"#FF5C5C",background:"transparent",border:"1px solid #452626",borderRadius:6,padding:"7px 10px",cursor:"pointer"},zt=()=>{var e,t;(t=(e=document.activeElement)==null?void 0:e.blur)==null||t.call(e)},Rj=e=>String(Math.round(e*1e3)/1e3),Tt=({id:e,value:t,onCommit:n,min:r,max:o,dragStep:i})=>{const[s,a]=J.useState(null),[l,u]=J.useState(!1),f=J.useRef(null),p=J.useRef(null),m=r??-1/0,h=o??1/0,w=i??(r!==void 0&&o!==void 0?(o-r)/240:.5),v=s!==null;return d.jsxs("div",{style:on,children:[d.jsx("span",{style:Le,children:e}),d.jsx("input",{type:"text",inputMode:"decimal",ref:f,"data-testid":`field-${e}`,style:{...Ai,...v?{}:{cursor:"ew-resize",touchAction:"none"},...l?{borderColor:"#FFE14D",color:"#FFE14D"}:{}},value:s??(Number.isFinite(t)?Rj(t):"0"),onFocus:S=>a(S.target.value),onBlur:()=>a(null),onPointerDown:S=>{v||(S.preventDefault(),p.current={x:S.clientX,v:Number.isFinite(t)?t:0,moved:!1},S.currentTarget.setPointerCapture(S.pointerId),u(!0))},onPointerMove:S=>{const g=p.current;if(!g)return;const y=S.clientX-g.x;if(!g.moved&&Math.abs(y)<=2)return;g.moved=!0;const x=Math.round(Math.min(h,Math.max(m,g.v+y*w))*1e3)/1e3;n(x)},onPointerUp:()=>{var g,y,x;const S=((g=p.current)==null?void 0:g.moved)===!0;p.current=null,u(!1),S||((y=f.current)==null||y.focus(),(x=f.current)==null||x.select())},onPointerCancel:()=>{p.current=null,u(!1)},onChange:S=>{a(S.target.value);const g=S.target.value.trim();if(g==="")return;const y=Number(g.replace(",","."));Number.isFinite(y)&&n(Math.min(h,Math.max(m,y)))}})]})},aa=({id:e,value:t,isColor:n,onCommit:r})=>d.jsxs("div",{style:on,children:[d.jsx("span",{style:Le,children:e}),d.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[n?d.jsx("input",{type:"color",value:t,onChange:o=>r(o.target.value),style:{width:28,height:28,border:"1px solid #2A2A33",borderRadius:6,padding:0,background:"none"}}):null,d.jsx("input",{style:{...yx,flex:1},value:t,onChange:o=>r(o.target.value)})]})]}),_j=({selection:e,cue:t,frame:n,allSceneIds:r,edits:o,onSelect:i,resolvedTheme:s,anchorText:a,onVideoPreview:l,runInfo:u})=>{var S,g,y,x,b,k,E,I,T,_,$,M;if(e!=null&&e.elementId&&t){const P=e.elementId,D=((S=t.elements)==null?void 0:S[P])??{},O=t.props?Ij(P,t.props):null;return d.jsxs("div",{children:[d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Le,children:"Selected"}),d.jsx("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:P})]}),(()=>{var F;const A=/^line-(\d+)$/.exec(P),Z=(F=t.props)==null?void 0:F.lines;if(t.component!=="StrikethroughReveal"||!A||!Array.isArray(Z))return null;const R=Number(A[1]),C=Z[R];if(!C)return null;const j=C.struck?"struck":(C.mark??"none")!=="none"?C.mark:"plain";return d.jsx("div",{style:Ue,children:d.jsxs("div",{style:on,children:[d.jsx("span",{style:Le,children:"Line style"}),d.jsxs("select",{"data-testid":"line-style",style:Ai,value:j,onChange:V=>{const W=V.target.value,N=Z.slice();N[R]={...N[R],struck:W==="struck",mark:W==="cross"||W==="check"?W:"none"},o.patchProps(e.sceneId,{lines:N})},children:[d.jsx("option",{value:"plain",children:"plain"}),d.jsx("option",{value:"struck",children:"struck through"}),d.jsx("option",{value:"cross",children:"✗ wrong"}),d.jsx("option",{value:"check",children:"✓ right"})]})]})})})(),O!==null?d.jsx("div",{style:Ue,children:d.jsxs("div",{style:on,children:[d.jsx("span",{style:Le,children:"Text"}),d.jsx("input",{style:yx,"data-testid":"element-text",value:O,onChange:A=>{const Z=t.props??{},R=/^(line|node|message|window|item)-\d+$/.test(P)?Cj(P,Z,A.target.value):{[P]:A.target.value};R&&o.patchProps(e.sceneId,R,`text:${e.sceneId}:${P}`)}})]})}):null,d.jsxs("div",{style:Ue,children:[d.jsxs("div",{style:on,children:[d.jsxs("span",{style:Le,children:["scale"," ",d.jsxs("span",{style:{color:"#EDEDF2"},children:[(D.scale??1).toFixed(2),"×"]})]}),d.jsx("input",{type:"range","data-testid":"el-scale-slider",min:.1,max:3,step:.01,value:D.scale??1,onChange:A=>o.patchElement(e.sceneId,P,{scale:Number(A.target.value)},`element:${e.sceneId}:${P}:scale`)})]}),d.jsxs("div",{style:vi,children:[d.jsx(Tt,{id:"x",value:D.dx??0,dragStep:1,onCommit:A=>o.patchElement(e.sceneId,P,{dx:A},`element:${e.sceneId}:${P}:dx`)}),d.jsx(Tt,{id:"y",value:D.dy??0,dragStep:1,onCommit:A=>o.patchElement(e.sceneId,P,{dy:A},`element:${e.sceneId}:${P}:dy`)})]}),d.jsx(Tt,{id:"scale",value:D.scale??1,min:.05,max:4,dragStep:.01,onCommit:A=>o.patchElement(e.sceneId,P,{scale:A},`element:${e.sceneId}:${P}:scale`)})]}),d.jsxs("div",{style:Ue,children:[d.jsx("button",{style:Lt,onClick:()=>{zt(),o.clearElement(e.sceneId,P)},children:"Reset element"}),d.jsx("button",{"data-testid":"delete-element",style:{...Lt,marginTop:8},onClick:()=>{zt(),o.hideElement(e.sceneId,P),i({sceneId:e.sceneId,elementId:null})},children:"Delete element"})]})]})}if(e&&t){const P=t.kind==="plain";if(((g=o.doc.scenes[e.sceneId])==null?void 0:g.hidden)===!0)return d.jsx("div",{children:d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Le,children:"Scene"}),d.jsxs("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:[e.sceneId," ",d.jsx("span",{style:{color:"#9A9AA3",fontWeight:400},children:"(deleted)"})]}),d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Its window plays as a plain take. Restore brings the graphic back."}),d.jsx("button",{"data-testid":"restore-scene",style:{...Lt,color:"#5FBF77",border:"1px solid #24402c"},onClick:()=>{zt(),o.restoreScene(e.sceneId)},children:"Restore scene"})]})});const D=o.doc.cuts.findIndex(A=>A.src===void 0&&A.startSec===t.startSec&&A.endSec===t.endSec);if(D!==-1)return d.jsx("div",{children:d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Le,children:P?"Take":"Scene"}),d.jsxs("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:[e.sceneId," ",d.jsx("span",{style:{color:"#9A9AA3",fontWeight:400},children:"(marked for removal)"})]}),d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Struck through on the timeline. It disappears from the output on the next produce/Render — this preview still plays it (the editor doesn't re-derive a second cut timeline just to show one early)."}),d.jsx("button",{"data-testid":"restore-chunk",style:{...Lt,color:"#5FBF77",border:"1px solid #24402c"},onClick:()=>{zt(),o.restoreChunk(D)},children:"Restore"})]})});const O=Object.entries(t.elements??{}).filter(([,A])=>A.hidden===!0).map(([A])=>{var C,j;const R=((j=(C=o.doc.scenes[e.sceneId])==null?void 0:C.elements[A])==null?void 0:j.hidden)===!0?e.sceneId:jF(e.sceneId);return{id:A,owningSceneId:R}});return d.jsxs("div",{children:[d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Le,children:P?"Take":"Scene"}),d.jsx("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:e.sceneId}),P?d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"A continuous stretch of the talking head — no graphic. Frame it below; its window follows the cut."}):null]}),d.jsxs("div",{style:Ue,children:[!P&&t.component?d.jsxs("div",{style:on,children:[d.jsx("span",{style:Le,children:"Component"}),d.jsx("select",{style:Ai,value:t.component,onChange:A=>o.patchComponent(e.sceneId,A.target.value),children:nu.options.map(A=>d.jsx("option",{value:A,children:A},A))})]}):null,d.jsxs("div",{style:on,children:[d.jsx("span",{style:Le,children:"Layout"}),d.jsx("select",{style:Ai,"data-testid":"layout-select",value:t.layout,onChange:A=>o.patchLayout(e.sceneId,A.target.value),children:tu.options.map(A=>d.jsx("option",{value:A,children:A},A))})]})]}),d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Le,children:"Video framing"}),d.jsxs("div",{style:on,children:[d.jsxs("span",{style:Le,children:["zoom"," ",d.jsxs("span",{style:{color:"#EDEDF2"},children:[(((y=t.video)==null?void 0:y.scale)??1).toFixed(2),"×"]})]}),d.jsx("input",{type:"range","data-testid":"zoom-slider",min:.5,max:3,step:.01,value:((x=t.video)==null?void 0:x.scale)??1,onChange:A=>l({sceneId:e.sceneId,patch:{scale:Number(A.target.value)}}),onPointerUp:A=>{const Z=Number(A.target.value);o.patchVideo(e.sceneId,{scale:Z},`video:${e.sceneId}:scale`),l(null)},onKeyUp:A=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(A.key))return;const R=Number(A.target.value);o.patchVideo(e.sceneId,{scale:R},`video:${e.sceneId}:scale`),l(null)}})]}),d.jsxs("label",{style:{display:"flex",gap:8,alignItems:"center",fontSize:12,color:"#9A9AA3",cursor:"pointer"},children:[d.jsx("input",{type:"checkbox","data-testid":"auto-zoom",checked:((b=t.video)==null?void 0:b.autoZoom)!==!1,onChange:A=>o.patchVideo(e.sceneId,{autoZoom:A.target.checked})}),"auto zoom (the slow push composes on top of your zoom)"]}),d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Pan: drag the picture on the stage."}),d.jsx(Tt,{id:"scale",value:((k=t.video)==null?void 0:k.scale)??1,min:.05,max:4,dragStep:.01,onCommit:A=>o.patchVideo(e.sceneId,{scale:A},`video:${e.sceneId}:scale`)}),d.jsxs("div",{style:vi,children:[d.jsx(Tt,{id:"dx",value:((E=t.video)==null?void 0:E.dx)??0,dragStep:1,onCommit:A=>o.patchVideo(e.sceneId,{dx:A},`video:${e.sceneId}:dx`)}),d.jsx(Tt,{id:"dy",value:((I=t.video)==null?void 0:I.dy)??0,dragStep:1,onCommit:A=>o.patchVideo(e.sceneId,{dy:A},`video:${e.sceneId}:dy`)})]}),t.video?d.jsx("button",{style:Lt,onClick:()=>{zt(),o.clearVideo(e.sceneId)},children:"Reset framing"}):null]}),t.layout==="pip-bubble"?(()=>{const A=Dr("pip-bubble",void 0,[],n).video,Z=t.pip??{},R=Z.cornerRadius??A.cornerRadius;return d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Le,children:"PiP bubble"}),d.jsxs("div",{style:on,children:[d.jsxs("span",{style:Le,children:["roundness"," ",d.jsx("span",{style:{color:"#EDEDF2"},children:R.toFixed(2)})]}),d.jsx("input",{type:"range","data-testid":"pip-roundness",min:0,max:1,step:.01,value:R,onChange:C=>o.patchPip(e.sceneId,{cornerRadius:Number(C.target.value)},`pip:${e.sceneId}:cornerRadius`)})]}),d.jsxs("div",{style:vi,children:[d.jsx(Tt,{id:"pip-x",value:Z.x??A.rect.x,min:0,max:1-A.rect.w,dragStep:.002,onCommit:C=>o.patchPip(e.sceneId,{x:C},`pip:${e.sceneId}:x`)}),d.jsx(Tt,{id:"pip-y",value:Z.y??A.rect.y,min:0,max:1-A.rect.h,dragStep:.002,onCommit:C=>o.patchPip(e.sceneId,{y:C},`pip:${e.sceneId}:y`)})]}),t.pip?d.jsx("button",{"data-testid":"reset-pip",style:Lt,onClick:()=>{zt(),o.clearPip(e.sceneId)},children:"Reset bubble"}):null]})})():null,(()=>{var R;if(P)return null;const A=Qw(t,n),Z=C=>j=>o.patchGraphicRect(e.sceneId,al({...A,[C]:j},n),`box:${e.sceneId}:${C}`);return d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Le,children:"Graphic box"}),d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Frame fractions — or drag the handles on the stage."}),d.jsxs("div",{style:vi,children:[d.jsx(Tt,{id:"box-x",value:A.x,min:0,max:1,dragStep:.002,onCommit:Z("x")}),d.jsx(Tt,{id:"box-y",value:A.y,min:0,max:1,dragStep:.002,onCommit:Z("y")})]}),d.jsxs("div",{style:vi,children:[d.jsx(Tt,{id:"box-w",value:A.w,min:.08,max:1,dragStep:.002,onCommit:Z("w")}),d.jsx(Tt,{id:"box-h",value:A.h,min:.05,max:1,dragStep:.002,onCommit:Z("h")})]}),(R=o.doc.scenes[e.sceneId])!=null&&R.graphicRect?d.jsx("button",{"data-testid":"reset-box",style:Lt,onClick:()=>{zt(),o.clearGraphicRect(e.sceneId)},children:"Reset box"}):null]})})(),(()=>{const A=Dr(t.layout,void 0,[],n).captionAnchor,Z=t.captionY??A,R=t.captionScale??1,C=o.doc.scenes[e.sceneId];return d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Le,children:"Captions"}),d.jsxs("div",{style:on,children:[d.jsxs("span",{style:Le,children:["position"," ",d.jsx("span",{style:{color:"#EDEDF2"},children:Z.toFixed(2)})]}),d.jsx("input",{type:"range","data-testid":"caption-y-slider",min:.05,max:.95,step:.01,value:Z,onChange:j=>o.patchCaptionY(e.sceneId,Number(j.target.value),`captionY:${e.sceneId}`)})]}),d.jsxs("div",{style:on,children:[d.jsxs("span",{style:Le,children:["scale"," ",d.jsxs("span",{style:{color:"#EDEDF2"},children:[R.toFixed(2),"×"]})]}),d.jsx("input",{type:"range","data-testid":"caption-scale-slider",min:.2,max:3,step:.01,value:R,onChange:j=>o.patchCaptionScale(e.sceneId,Number(j.target.value),`captionScale:${e.sceneId}`)})]}),d.jsx(Tt,{id:"caption-scale",value:R,min:.2,max:3,dragStep:.01,onCommit:j=>o.patchCaptionScale(e.sceneId,j,`captionScale:${e.sceneId}`)}),d.jsx("button",{"data-testid":"caption-y-all",style:{...Lt,color:"#EDEDF2",border:"1px solid #2A2A33"},title:"Write this scene's caption position and scale to every scene — one undo step",onClick:()=>{zt(),o.patchCaptionStyleAll(r,{y:Z,scale:R})},children:"Apply to all scenes"}),(C==null?void 0:C.captionY)!==void 0||(C==null?void 0:C.captionScale)!==void 0?d.jsx("button",{"data-testid":"reset-caption-y",style:Lt,onClick:()=>{zt(),o.clearCaptionStyle(e.sceneId)},children:"Reset captions"}):null]})})(),d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Le,children:"Timing"}),d.jsxs("div",{"data-testid":"timing-range",style:{fontSize:13,fontFamily:"ui-monospace, 'SF Mono', monospace"},children:[t.startSec.toFixed(2),"s – ",t.endSec.toFixed(2),"s",d.jsxs("span",{style:{color:"#9A9AA3"},children:[" ","(",(t.endSec-t.startSec).toFixed(2),"s)"]})]}),d.jsx("div",{style:{fontSize:12,color:t.pinned?"#FFE14D":"#9A9AA3"},children:P?"Derived from the cut — not movable":t.pinned?"Pinned to these times":"Tracking transcript"}),!t.pinned&&a?d.jsxs("div",{style:{fontSize:12,color:"#9A9AA3",fontStyle:"italic"},children:["“",a,"”"]}):null,t.pinned?d.jsx("button",{style:Lt,onClick:()=>{zt(),o.clearTiming(e.sceneId)},children:"Un-pin (re-anchor to words)"}):null]}),P?null:d.jsx("div",{style:Ue,children:d.jsx("button",{"data-testid":"delete-scene",style:Lt,onClick:()=>{zt(),o.hideScene(e.sceneId)},children:"Delete scene"})}),O.length>0?d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Le,children:"Hidden elements"}),O.map(({id:A,owningSceneId:Z})=>d.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[d.jsx("span",{style:{fontSize:13,fontFamily:"ui-monospace, monospace",color:"#C9C9D4"},children:A}),d.jsx("button",{"data-testid":`restore-element-${A}`,style:{...Lt,color:"#5FBF77",border:"1px solid #24402c",padding:"4px 8px"},onClick:()=>{zt(),o.restoreElement(Z,A)},children:"Restore"})]},A))]}):null,d.jsxs("div",{style:Ue,children:[d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Removes this window from the output on the next produce/Render. Struck through here until then — the preview keeps playing it."}),d.jsx("button",{"data-testid":"cut-chunk",style:Lt,onClick:()=>{zt(),o.cutChunk(t.startSec,t.endSec)},children:"Delete this chunk"})]})]})}const f=o.doc.theme,p=(P,D)=>o.patchTheme({[P]:D}),m=P=>`${Math.floor(P/60)}:${String(Math.floor(P%60)).padStart(2,"0")}`,h=((T=u==null?void 0:u.usage)==null?void 0:T.totals)??null,w=((_=u==null?void 0:u.production)==null?void 0:_.producer)??null,v=(($=u==null?void 0:u.production)==null?void 0:$.clip)??null;return d.jsxs("div",{children:[d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Le,children:"Theme"}),d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Nothing selected — global tokens."})]}),d.jsxs("div",{style:Ue,children:[d.jsx(aa,{id:"accent",value:f.accent??s.accent,isColor:!0,onCommit:P=>p("accent",P)}),d.jsx(aa,{id:"bg",value:f.bg??s.bg,isColor:!0,onCommit:P=>p("bg",P)}),d.jsx(aa,{id:"fg",value:f.fg??s.fg,isColor:!0,onCommit:P=>p("fg",P)}),d.jsx(Tt,{id:"radiusPx",value:f.radiusPx??s.radiusPx,min:0,dragStep:.5,onCommit:P=>p("radiusPx",P)}),d.jsx(aa,{id:"fontDisplay",value:f.fontDisplay??s.fontDisplay,isColor:!1,onCommit:P=>p("fontDisplay",P)})]}),w||h?d.jsxs("div",{style:Ue,"data-testid":"run-info",children:[d.jsx("span",{style:Le,children:"This video"}),w?d.jsxs("div",{style:{fontSize:12,color:"#C9C9D4"},children:["planned by ",d.jsx("span",{style:{color:"#EDEDF2"},children:w.provider}),w.models.length>0?` (${w.models.join(", ")})`:"",w.cached?" · reused from cache":"",w.at?` · ${new Date(w.at).toLocaleString()}`:""]}):null,h?d.jsxs("div",{style:{fontSize:12,color:"#C9C9D4"},children:[h.calls," LLM call",h.calls===1?"":"s"," ·"," ",h.inputTokens.toLocaleString()," in / ",h.outputTokens.toLocaleString()," out tokens",h.anyEstimated?" (partly estimated)":""]}):null,h&&h.equivalentUsd!==null?d.jsx("div",{style:{fontSize:12,color:"#C9C9D4"},children:h.allUnbilled?`~$${h.equivalentUsd.toFixed(2)} of API-rate work, covered by the subscription`:h.billedUsd!==null?`~$${h.billedUsd.toFixed(2)} charged at API rates`:`~$${h.equivalentUsd.toFixed(2)} at API rates`}):null,v?d.jsxs("div",{style:{fontSize:12,color:"#C9C9D4"},children:["clip: ",m(v.startSec),"–",m(v.endSec),(M=u==null?void 0:u.production)!=null&&M.sourceDuration?` of ${m(u.production.sourceDuration)}`:""," ","(--clip ",v.targetSec,")"]}):null]}):null,d.jsx("div",{style:Ue,children:d.jsx("div",{"data-testid":"ai-disclaimer",style:{fontSize:12,color:"#9A9AA3"},children:"AI can make mistakes. The cut, captions and graphics are generated — review them before publishing."})})]})},qu=1.2,ul=.05;function Pj(e,t,n,r){return n<=0||r<=0?0:Math.min(1,Math.max(0,(e-t)/n))*r}const Fj=16,jj=e=>Math.min(Fj,Math.max(1,e));function Mj(e,t,n,r,o){if(e<=0||n<=0)return 0;const s=(r+o)*(t/e),a=Math.max(0,t*n-n);return Math.min(a,Math.max(0,s-o))}const ap=e=>e.filter(t=>t.kind!=="plain");function $j(e,t,n,r){const o=ap(e),i=o.findIndex(h=>h.id===t),s=o[i];if(!s)return null;const a=s.endSec-s.startSec,l=i>0?o[i-1]:void 0,u=i<o.length-1?o[i+1]:void 0,f=l?l.endSec+ul:0,p=u?u.startSec-ul:r,m=Math.min(Math.max(s.startSec+n,f),Math.max(f,p-a));return{startSec:m,endSec:m+a}}function Aj(e,t,n,r,o){const i=ap(e),s=i.findIndex(h=>h.id===t),a=s>0?i[s-1]:void 0,l=s>=0&&s<i.length-1?i[s+1]:void 0,u=a?a.endSec+ul:0,f=l?l.startSec-ul:o;let p=Math.min(Math.max(n,u),Math.max(u,f-qu)),m=Math.max(Math.min(r,f),p+qu);return m>f&&(m=f,p=Math.max(u,m-qu)),{startSec:p,endSec:m}}function eg(e,t,n,r){const o=[0,r,n];for(const a of ap(e))a.id!==t&&o.push(a.startSec,a.endSec);o.sort((a,l)=>a-l);const i=[];let s;for(const a of o)(s===void 0||a-s>1e-6)&&(i.push(a),s=a);return i}function la(e,t,n){if(n<=0||t.length===0)return{sec:e,snapped:null};let r=null,o=1/0;for(const i of t){const s=Math.abs(e-i);(s<o||s===o&&r!==null&&i<r)&&(r=i,o=s)}return r===null||o>n?{sec:e,snapped:null}:{sec:r,snapped:r}}function Nj(e,t){if(e.length===0)return 0;for(const r of e)if(t>=r.srcIn&&t<=r.srcOut)return r.outIn+(t-r.srcIn);let n=0;for(const r of e)if(r.srcOut<=t)n=r.outOut;else if(r.srcIn>=t)return r.outIn;return n}function Qu(e,t){const n=Math.max(0,e);if(t<=0)return`${n.toFixed(1)}s`;const r=Math.floor(n),o=Math.floor(r/60),i=r%60,s=Math.floor((n-r)*t),a=String(Math.max(1,Math.ceil(t)-1)).length;return`${o}:${String(i).padStart(2,"0")}:${String(s).padStart(a,"0")}`}const Lj=10,zj=4,tg=8,ng=8,Dj=300,Oj=e=>{const t=Math.max(0,Math.round(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`},Vj=(e,t)=>{const[n,r]=J.useState({}),o=J.useRef({}),i=t.map(s=>s.toFixed(1)).join(",");return J.useEffect(()=>{if(!e||t.length===0)return;const s=[...new Set(t.map(p=>p.toFixed(1)))].filter(p=>o.current[p]===void 0);if(s.length===0)return;let a=!1;const l=document.createElement("video");l.src=e,l.muted=!0,l.preload="auto";const u=document.createElement("canvas");return(async()=>{await new Promise((m,h)=>{l.onloadedmetadata=()=>m(),l.onerror=()=>h(new Error("no video for thumbnails"))}),u.width=168,u.height=Math.max(1,Math.round(168*l.videoHeight/Math.max(1,l.videoWidth)));const p=u.getContext("2d");if(p){for(const m of s){if(a)return;await new Promise(h=>{l.onseeked=()=>h(),l.currentTime=Math.max(0,Number(m))}),p.drawImage(l,0,0,u.width,u.height),o.current[m]=u.toDataURL("image/jpeg",.6)}a||r({...o.current})}})().catch(()=>{}),()=>{a=!0,l.removeAttribute("src"),l.load()}},[e,i]),n},Bj=({cues:e,ghosts:t,cuts:n=[],spans:r=[],durationSec:o,fps:i,playerRef:s,selection:a,onSelect:l,edits:u,videoSrc:f,toSourceSec:p})=>{const m=c.useRef(null),h=c.useRef(null),w=c.useRef(!1),v=c.useRef(null),[S,g]=c.useState(0),y=c.useRef(S);y.current=S;const[x,b]=c.useState(null),[k,E]=c.useState(1),I=J.useMemo(()=>p?e.filter(R=>R.kind==="plain").map(R=>p((R.startSec+R.endSec)/2)):[],[e,p]),T=Vj(f,I),_=c.useRef(null),$=c.useRef(null),M=c.useCallback((R,C)=>{const j=_.current;E(F=>{const V=jj(R);if(V===F||!j)return V;const W=j.getBoundingClientRect();return $.current={prevZoom:F,anchorX:C!==void 0?C-W.left:W.width/2},V})},[]);c.useLayoutEffect(()=>{const R=_.current,C=$.current;!R||!C||($.current=null,R.scrollLeft=Mj(C.prevZoom,k,R.clientWidth,R.scrollLeft,C.anchorX))},[k]);const P=c.useRef(k);P.current=k,c.useEffect(()=>{const R=_.current;if(!R)return;const C=j=>{j.ctrlKey||j.metaKey?(j.preventDefault(),M(P.current*Math.exp(-j.deltaY*.01),j.clientX)):R.scrollWidth>R.clientWidth&&(j.preventDefault(),R.scrollLeft+=j.deltaY+j.deltaX)};return R.addEventListener("wheel",C,{passive:!1}),()=>R.removeEventListener("wheel",C)},[M]),c.useEffect(()=>{const R=s.current;if(!R)return;g(R.getCurrentFrame());const C=j=>g(j.detail.frame);return R.addEventListener("frameupdate",C),()=>R.removeEventListener("frameupdate",C)},[s]),c.useEffect(()=>{const R=_.current;if(!R||o<=0||R.scrollWidth<=R.clientWidth)return;const C=S/i/o*R.scrollWidth,{scrollLeft:j,clientWidth:F}=R;(C<j||C>j+F)&&(R.scrollLeft=Math.max(0,Math.min(R.scrollWidth-F,C-F*.1)))},[S,i,o]),c.useEffect(()=>{var C,j;if(!a)return;const R=(C=_.current)==null?void 0:C.querySelector(`[data-testid="timeline-block-${a.sceneId}"]`);(j=R==null?void 0:R.scrollIntoView)==null||j.call(R,{inline:"nearest",block:"nearest"})},[a]);const D=c.useCallback(R=>{var F;const C=m.current;if(!C||o<=0)return;const j=C.getBoundingClientRect();(F=s.current)==null||F.seekTo(Math.round(Pj(R,j.left,j.width,o)*i))},[s,o,i]),O=c.useCallback((R,C)=>j=>{j.stopPropagation(),j.preventDefault();const F=m.current;F&&(h.current={sceneId:R.id,edge:C,startContentX:j.clientX-F.getBoundingClientRect().left,origStart:R.startSec,origEnd:R.endSec},b({sceneId:R.id,startSec:R.startSec,endSec:R.endSec,snapped:null}))},[]),A=c.useRef(0);c.useEffect(()=>{const R=F=>{const V=_.current;if(!V||V.scrollWidth<=V.clientWidth)return;const W=Date.now();if(W-A.current<Dj)return;const N=V.getBoundingClientRect(),L=V.scrollWidth-V.clientWidth;F>=N.right-ng&&V.scrollLeft<L?(V.scrollLeft=Math.min(L,V.scrollLeft+V.clientWidth),A.current=W):F<=N.left+ng&&V.scrollLeft>0&&(V.scrollLeft=Math.max(0,V.scrollLeft-V.clientWidth),A.current=W)},C=F=>{var se;if((w.current||((se=v.current)==null?void 0:se.moved)===!0||h.current!==null)&&R(F.clientX),w.current){D(F.clientX);return}const W=v.current;if(W&&o>0){if(!W.moved&&Math.abs(F.clientX-W.startX)<zj)return;W.moved=!0;const G=m.current,ee=G==null?void 0:G.getBoundingClientRect(),Q=ee?(F.clientX-ee.left-W.startContentX)/ee.width*o:0;let q=Q,he=null;const Ce=ee&&ee.width>0&&!F.altKey?e.find(pe=>pe.id===W.sceneId):void 0;if(Ce&&ee){const pe=tg/(ee.width/o),Re=eg(e,W.sceneId,y.current/i,o),be=Ce.startSec+Q,we=Ce.endSec+Q,Pe=la(be,Re,pe),ue=la(we,Re,pe),Ge=Pe.snapped===null?1/0:Math.abs(Pe.sec-be),Et=ue.snapped===null?1/0:Math.abs(ue.sec-we);Ge<=Et&&Pe.snapped!==null?(q=Q+(Pe.sec-be),he=Pe.snapped):ue.snapped!==null&&(q=Q+(ue.sec-we),he=ue.snapped)}const ve=$j(e,W.sceneId,q,o);if(ve){const pe=he!==null&&(Math.abs(ve.startSec-he)<1e-6||Math.abs(ve.endSec-he)<1e-6)?he:null;b({sceneId:W.sceneId,...ve,snapped:pe})}return}const N=h.current;if(!N||o<=0)return;const L=m.current;if(!L)return;const B=L.getBoundingClientRect(),H=(F.clientX-B.left-N.startContentX)/B.width*o;let z=N.edge==="start"?N.origStart+H:N.origStart,Y=N.edge==="end"?N.origEnd+H:N.origEnd,oe=null;if(!F.altKey&&B.width>0){const G=tg/(B.width/o),ee=eg(e,N.sceneId,y.current/i,o);if(N.edge==="start"){const Q=la(z,ee,G);z=Q.sec,oe=Q.snapped}else{const Q=la(Y,ee,G);Y=Q.sec,oe=Q.snapped}}const ae=Aj(e,N.sceneId,z,Y,o),ce=oe!==null&&(Math.abs(ae.startSec-oe)<1e-6||Math.abs(ae.endSec-oe)<1e-6)?oe:null;b({sceneId:N.sceneId,...ae,snapped:ce})},j=F=>{w.current=!1;const V=v.current;if(V){v.current=null,V.moved?b(N=>(N&&N.sceneId===V.sceneId&&u.patchTiming(V.sceneId,N.startSec,N.endSec),null)):D(F.clientX);return}const W=h.current;W&&(b(N=>(N&&N.sceneId===W.sceneId&&(N.startSec!==W.origStart||N.endSec!==W.origEnd)&&u.patchTiming(W.sceneId,N.startSec,N.endSec),null)),h.current=null)};return window.addEventListener("mousemove",C),window.addEventListener("mouseup",j),()=>{window.removeEventListener("mousemove",C),window.removeEventListener("mouseup",j)}},[e,o,u,D,i]);const Z=o>0?Math.min(1,S/i/o)*100:0;return d.jsxs("div",{style:Wj,onMouseDownCapture:vx,children:[d.jsxs("div",{style:Uj,children:[d.jsx("span",{style:Zj,children:"ctrl+scroll to zoom"}),d.jsx("button",{"data-testid":"zoom-out",style:Ju,onClick:()=>M(k/2),disabled:k<=1,title:"Zoom out (ctrl/cmd + scroll on the timeline)",children:"−"}),d.jsxs("span",{"data-testid":"zoom-level",style:Hj,children:[Math.round(k*10)/10,"×"]}),d.jsx("button",{"data-testid":"zoom-in",style:Ju,onClick:()=>M(k*2),disabled:k>=16,title:"Zoom in (ctrl/cmd + scroll on the timeline)",children:"+"}),d.jsx("button",{"data-testid":"zoom-fit",style:{...Ju,width:"auto",padding:"0 8px"},onClick:()=>M(1),disabled:k<=1,title:"Fit the whole clip in view",children:"fit"})]}),d.jsx("div",{ref:_,"data-testid":"timeline-scroller",style:Yj,children:d.jsxs("div",{style:{width:`${k*100}%`,minWidth:"100%",paddingBottom:6},children:[d.jsx("div",{"data-testid":"ruler",style:Kj,onMouseDown:R=>{R.preventDefault(),D(R.clientX),w.current=!0},children:(()=>{var N;if(o<=0)return d.jsx("span",{style:ec,children:"0:00"});const C=(((N=_.current)==null?void 0:N.clientWidth)??1200)*k/o;let F=[.5,1,2,5,10,15,30,60,120,300,600].find(L=>L*C>=70)??600;for(;o/(F/5)>600;)F*=2;const V=F/5,W=[];for(let L=0;L<=o+1e-6;L+=V){const B=Math.round(L/V)%5===0,H=`${L/o*100}%`;W.push(d.jsx("div",{style:{position:"absolute",left:H,bottom:0,width:1,height:B?8:4,background:B?"#3A3A44":"#26262e",pointerEvents:"none"}},L.toFixed(3))),B&&L+V<=o&&W.push(d.jsx("span",{style:{...ec,position:"absolute",left:H,top:0,transform:L===0?void 0:"translateX(-50%)",pointerEvents:"none"},children:Oj(L)},`l${L.toFixed(3)}`))}return d.jsxs(d.Fragment,{children:[W,d.jsx("span",{style:{...ec,position:"absolute",right:2,top:0,pointerEvents:"none"},children:Qu(o,i)})]})})()}),d.jsxs("div",{ref:m,style:Xj,onMouseDown:R=>{R.preventDefault(),D(R.clientX),w.current=!0},children:[e.map(R=>{const C=R.kind==="plain",j=(x==null?void 0:x.sceneId)===R.id,F=j?x.startSec:R.startSec,V=j?x.endSec:R.endSec,W=o>0?F/o*100:0,N=o>0?Math.max(0,(V-F)/o*100):0,L=(a==null?void 0:a.sceneId)===R.id,B=C&&p?T[p((R.startSec+R.endSec)/2).toFixed(1)]:void 0;return d.jsxs("div",{"data-testid":`timeline-block-${R.id}`,onMouseDown:H=>{var z;if(H.stopPropagation(),H.preventDefault(),l({sceneId:R.id,elementId:null}),C){D(H.clientX),w.current=!0;return}v.current={sceneId:R.id,startX:H.clientX,startContentX:H.clientX-(((z=m.current)==null?void 0:z.getBoundingClientRect().left)??0),moved:!1}},style:{...rg,left:`${W}%`,width:`${N}%`,zIndex:j?4:L?3:1,border:L?"2px solid #5b8cff":C?"1px solid #22222a":"1px solid #2A2A33",backgroundColor:L?"#1c2333":C?"#131318":"#1A1A21",...B?{backgroundImage:`linear-gradient(rgba(10,10,14,0.35), rgba(10,10,14,0.6)), url(${B})`,backgroundSize:"auto 100%, auto 100%",backgroundRepeat:"repeat-x"}:{}},children:[d.jsx("span",{style:C?B?{...ua,color:"#D8D8DE",textShadow:"0 1px 2px rgba(0,0,0,0.9)"}:{...ua,color:"#55555f"}:ua,children:R.id}),!C&&R.pinned?d.jsx("span",{style:Gj,children:"PIN"}):null,C?null:d.jsxs(d.Fragment,{children:[d.jsx("div",{onMouseDown:O(R,"start"),style:{...og,left:0,cursor:"ew-resize"}}),d.jsx("div",{onMouseDown:O(R,"end"),style:{...og,right:0,cursor:"ew-resize"}})]})]},R.id)}),t.map(R=>{const C=o>0?R.startSec/o*100:0,j=o>0?Math.max(0,(R.endSec-R.startSec)/o*100):0,F=(a==null?void 0:a.sceneId)===R.id;return d.jsx("div",{"data-testid":`timeline-block-${R.id}`,onMouseDown:V=>{V.stopPropagation(),V.preventDefault(),l({sceneId:R.id,elementId:null})},style:{...rg,left:`${C}%`,width:`${j}%`,zIndex:F?3:2,border:F?"2px dashed #5b8cff":"1px dashed #6a6a75",background:"transparent"},children:d.jsx("span",{style:{...ua,color:"#6a6a75",textDecoration:"line-through"},children:R.id})},`ghost-${R.id}`)}),n.map((R,C)=>{const j=V=>o>0?Math.min(100,Math.max(0,V/o*100)):0;if(!R.src){const V=Math.min(Math.max(R.startSec,0),o),W=Math.min(Math.max(R.endSec,0),o),N=j(V),L=o>0?Math.max(0,(W-V)/o*100):0;return d.jsx("div",{"data-testid":`timeline-cut-${R.startSec}-${R.endSec}`,style:{...qj,left:`${N}%`,width:`${L}%`},children:d.jsx("div",{style:Qj})},`cut-${C}-${R.startSec}-${R.endSec}`)}if(r.length===0)return null;const F=j(Nj(r,R.src.startSec));return d.jsx("div",{"data-testid":`timeline-cut-seam-${R.startSec}-${R.endSec}`,title:"Restore cut — the material returns on the next produce/Render",onMouseDown:V=>{V.stopPropagation(),V.preventDefault(),u.restoreChunk(C)},style:{...Jj,left:`${F}%`},children:d.jsx("div",{style:eM})},`cut-${C}-${R.startSec}-${R.endSec}`)}),x?d.jsxs("div",{"data-testid":"drag-readout",style:{...ig,left:`${o>0?x.startSec/o*100:0}%`,transform:o>0&&x.startSec/o>.85?"translateX(-100%)":ig.transform},children:[Qu(x.startSec,i)," – ",Qu(x.endSec,i)]}):null,(x==null?void 0:x.snapped)!==null&&(x==null?void 0:x.snapped)!==void 0?d.jsx("div",{"data-testid":"snap-tick",style:{...tM,left:`${o>0?x.snapped/o*100:0}%`}}):null,d.jsx("div",{"data-testid":"playhead",style:{...nM,left:`${Z}%`},children:d.jsx("div",{"data-testid":"playhead-grab",onMouseDown:R=>{R.stopPropagation(),R.preventDefault(),w.current=!0},style:rM})})]})]})})]})},Wj={flexShrink:0,borderTop:"1px solid #1E1E24",background:"#111116",padding:"6px 20px 8px"},Uj={display:"flex",justifyContent:"flex-end",alignItems:"center",gap:6,marginBottom:4},Ju={width:22,height:18,fontSize:12,lineHeight:1,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:4,cursor:"pointer",padding:0},Hj={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3",minWidth:26,textAlign:"center"},Zj={fontSize:10,color:"#55555f",marginRight:4,userSelect:"none"},Yj={overflowX:"auto",overflowY:"hidden"},Kj={position:"relative",height:18,padding:"0 2px",marginBottom:4,borderBottom:"1px solid #1E1E24",cursor:"ew-resize",userSelect:"none"},ec={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3"},Xj={position:"relative",height:44,background:"#0F0F14",border:"1px solid #2A2A33",borderRadius:6,overflow:"visible",userSelect:"none"},rg={position:"absolute",top:3,bottom:3,borderRadius:4,boxSizing:"border-box",cursor:"pointer",display:"flex",alignItems:"center",overflow:"hidden"},ua={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",textTransform:"uppercase",letterSpacing:"0.04em",color:"#9A9AA3",padding:"0 8px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",pointerEvents:"none"},Gj={position:"absolute",top:3,right:3,fontSize:9,fontFamily:"ui-monospace, 'SF Mono', monospace",letterSpacing:"0.04em",textTransform:"uppercase",color:"#0B0B0E",background:"#ffe14d",padding:"1px 5px",borderRadius:3,pointerEvents:"none"},qj={position:"absolute",top:3,bottom:3,zIndex:3,pointerEvents:"none",borderRadius:4,border:"1px solid rgba(255,92,92,0.6)",background:"repeating-linear-gradient(135deg, rgba(255,92,92,0.22), rgba(255,92,92,0.22) 6px, transparent 6px, transparent 12px)"},Qj={position:"absolute",left:0,right:0,top:"50%",height:2,background:"rgba(255,92,92,0.8)"},Jj={position:"absolute",top:-4,bottom:-4,width:12,marginLeft:-6,zIndex:4,cursor:"pointer",pointerEvents:"auto"},eM={position:"absolute",left:"50%",top:0,bottom:0,width:2,background:"#FF5C5C",pointerEvents:"none"},og={position:"absolute",top:0,bottom:0,width:Lj},tM={position:"absolute",top:-4,bottom:-4,width:1,zIndex:6,background:"#FFE14D",pointerEvents:"none"},ig={position:"absolute",bottom:"100%",marginBottom:3,transform:"translateX(-4px)",whiteSpace:"nowrap",fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#0B0B0E",background:"#FFE14D",padding:"1px 5px",borderRadius:3,zIndex:6,pointerEvents:"none"},nM={position:"absolute",top:-26,bottom:-4,width:2,zIndex:5,background:"#FFE14D",pointerEvents:"none"},rM={position:"absolute",top:0,bottom:0,left:-4,width:10,pointerEvents:"auto",cursor:"ew-resize"},oM=({baseLines:e,liveLines:t,fps:n,playerRef:r,edits:o,width:i})=>{const[s,a]=c.useState(""),[l,u]=c.useState(null),[f,p]=c.useState(null),m=c.useRef(null),h=c.useMemo(()=>{var T;const E=[];let I=0;for(let _=0;_<t.length;_++){const $=t[_],M=e[_];for(let P=0;P<$.words.length;P++){const D=$.words[P];E.push({index:I,base:((T=M==null?void 0:M.words[P])==null?void 0:T.text)??D.text,live:D.text,start:D.start,end:D.end,lineStart:$.start}),I++}}return E},[e,t]);c.useEffect(()=>{const E=r.current;if(!E)return;const I=T=>{const _=T.detail.frame/n,$=h.find(M=>_>=M.start&&_<M.end);p(M=>$?$.index===M?M:$.index:M)};return E.addEventListener("frameupdate",I),()=>E.removeEventListener("frameupdate",I)},[r,n,h]),c.useEffect(()=>{var E,I,T;f!==null&&((T=(I=(E=m.current)==null?void 0:E.querySelector(`[data-testid="transcript-word-${f}"]`))==null?void 0:I.scrollIntoView)==null||T.call(I,{block:"nearest"}))},[f]);const w=s.trim().toLowerCase(),v=c.useMemo(()=>w?h.filter(E=>E.live.toLowerCase().includes(w)).map(E=>E.index):[],[w,h]),S=c.useMemo(()=>w?new Set(v):null,[w,v]),[g,y]=c.useState(0),x=E=>{var I,T,_;(_=(T=(I=m.current)==null?void 0:I.querySelector(`[data-testid="transcript-word-${E}"]`))==null?void 0:T.scrollIntoView)==null||_.call(T,{block:"center"})};c.useEffect(()=>{y(0),v.length>0&&x(v[0])},[v]);const b=E=>{if(v.length===0)return;const I=(g+E+v.length)%v.length;y(I),x(v[I])},k=(E,I,T)=>{const _=T.trim();_&&o.patchCaption(E,_,I),u(null)};return d.jsxs("div",{"data-testid":"transcript-panel",style:{...iM,width:i},children:[d.jsxs("div",{style:sM,children:[d.jsx("span",{style:aM,children:"Transcript"}),d.jsx("div",{style:lM,children:"Click a word to jump the preview there; double-click to retype it. 1:1 retype only — word count and timing stay fixed, so scene anchors and the caption highlight keep working."}),d.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[d.jsx("input",{"data-testid":"transcript-search",style:{...uM,flex:1},placeholder:"Find a word…",value:s,onChange:E=>a(E.target.value),onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),b(E.shiftKey?-1:1))}}),d.jsx("button",{"data-testid":"transcript-prev",style:sg,onClick:()=>b(-1),disabled:v.length===0,title:"Previous match (⇧Enter)","aria-label":"Previous match",children:"‹"}),d.jsx("button",{"data-testid":"transcript-next",style:sg,onClick:()=>b(1),disabled:v.length===0,title:"Next match (Enter)","aria-label":"Next match",children:"›"})]}),S?d.jsx("div",{"data-testid":"transcript-match-count",style:{fontSize:11,color:"#9A9AA3"},children:v.length===0?"0 matches":`${g+1}/${v.length} match${v.length===1?"":"es"}`}):null]}),d.jsx("div",{style:cM,"data-testid":"transcript-body",ref:m,children:h.map((E,I)=>d.jsxs(J.Fragment,{children:[I>0?" ":null,(l==null?void 0:l.index)===E.index?d.jsx("input",{autoFocus:!0,"data-testid":"transcript-edit",style:gM,value:l.draft,onChange:T=>u({index:E.index,draft:T.target.value}),onBlur:()=>k(E.index,E.base,l.draft),onKeyDown:T=>{T.key==="Enter"&&T.target.blur(),T.key==="Escape"&&u(null)}}):d.jsx("span",{"data-testid":`transcript-word-${E.index}`,onClick:()=>{var T;return(T=r.current)==null?void 0:T.seekTo(Math.round(E.start*n))},onDoubleClick:()=>u({index:E.index,draft:E.live}),title:E.live!==E.base?`edited (was “${E.base}”) — double-click to retype`:"click to jump · double-click to retype",style:{...dM,...S!=null&&S.has(E.index)?fM:{},...v[g]===E.index?pM:{},...E.live!==E.base?mM:{},...f===E.index?hM:{}},children:E.live})]},E.index))})]})},iM={flexShrink:0,display:"flex",flexDirection:"column",background:"#111116",minHeight:0},sM={display:"flex",flexDirection:"column",gap:8,padding:"14px 14px 10px",borderBottom:"1px solid #1E1E24"},aM={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"#9A9AA3"},lM={fontSize:11,lineHeight:1.45,color:"#6a6a75"},uM={fontFamily:"'Inter', system-ui, sans-serif",fontSize:13,background:"#0F0F14",border:"1px solid #2A2A33",borderRadius:6,color:"#fff",padding:"6px 8px"},cM={flex:1,overflowY:"auto",overflowX:"hidden",overflowWrap:"break-word",padding:"10px 14px 16px",fontSize:13,lineHeight:2,color:"#C9C9D4"},dM={cursor:"pointer",borderRadius:3,padding:"1px 2px"},fM={background:"#2b2b1a",outline:"1px solid #6b6432"},pM={background:"#3d3a17",outline:"2px solid #FFE14D",color:"#fff"},sg={width:26,height:30,fontSize:16,lineHeight:1,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:6,cursor:"pointer",padding:0},mM={color:"#FFE14D"},hM={background:"#1c2333",outline:"1px solid #5b8cff"},gM={fontFamily:"'Inter', system-ui, sans-serif",fontSize:13,width:110,background:"#0F0F14",border:"1px solid #FFE14D",borderRadius:4,color:"#fff",padding:"1px 4px"},vM=[{title:"transport",rows:[["space","play / pause"],["J / K / L","reverse · pause · forward (tap again to speed up)"],["← / →","step one frame back / forward"],["⌘/ctrl + ← / →","jump to and select the previous / next scene"]]},{title:"selection",rows:[["click","select scene or element"],["⌥ + ← / →","select previous / next scene"],["esc","clear selection · close dialogs"]]},{title:"editing",rows:[["⌘/ctrl + B","split the scene at the playhead"],["delete / backspace","delete the selected scene (restorable)"],["⌘/ctrl + Z","undo"],["⌘/ctrl + ⇧ + Z","redo (⌘Y works too)"],["⌘/ctrl + S","save"],["double-click caption word","retype it in place"],["drag element / corner handles","move · resize"],["drag picture","pan the video framing"],["drag a scene block / edge on the timeline","snaps to scene edges + the playhead (hold ⌥ while dragging to disable)"],["drag a box on the stage","snaps to centre / safe-area guides (hold ⌥ mid-drag to disable)"]]},{title:"view",rows:[["⌘/ctrl + scroll on preview","zoom the view (never edits)"],["⌥-drag / middle-drag","pan the zoomed view"],["⌘/ctrl + scroll on timeline","zoom the timeline"],["?","this reference"]]}],yM=({onClose:e})=>(c.useEffect(()=>{const t=n=>{n.key==="Escape"&&(n.stopPropagation(),e())};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e]),d.jsx("div",{style:wM,onMouseDown:e,children:d.jsxs("div",{"data-testid":"shortcuts-modal",style:xM,onMouseDown:t=>t.stopPropagation(),children:[d.jsxs("div",{style:bM,children:[d.jsx("span",{style:SM,children:"keybinds"}),d.jsx("span",{style:EM,children:"esc close"})]}),d.jsx("div",{style:kM,children:"available commands and configured shortcuts"}),vM.map(t=>d.jsxs("div",{style:{marginTop:18},children:[d.jsx("div",{style:CM,children:t.title}),t.rows.map(([n,r])=>d.jsxs("div",{style:IM,children:[d.jsx("span",{style:TM,children:n}),d.jsx("span",{style:RM,children:r})]},n))]},t.title))]})})),wM={position:"fixed",inset:0,zIndex:30,background:"rgba(5,5,8,0.6)",display:"flex",alignItems:"center",justifyContent:"center"},xM={width:620,maxWidth:"90vw",maxHeight:"82vh",overflowY:"auto",background:"#12121A",border:"1px solid #3A3A48",borderRadius:8,padding:"20px 26px 26px",fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace"},bM={display:"flex",justifyContent:"space-between",alignItems:"center"},SM={fontSize:18,fontWeight:700,color:"#EDEDF2"},EM={fontSize:13,fontWeight:700,color:"#0B0B0E",background:"#a8c7fa",borderRadius:4,padding:"3px 10px"},kM={fontSize:13,color:"#6a6a75",marginTop:4},CM={fontSize:14,fontWeight:700,color:"#8ab4f8",marginBottom:6},IM={display:"flex",gap:16,padding:"3px 0"},TM={width:290,flexShrink:0,color:"#c5a3ff",fontWeight:600,fontSize:13},RM={color:"#C9C9D4",fontSize:13},ag=({recent:e,required:t,onOpen:n,onClose:r})=>{const[o,i]=c.useState(null),[s,a]=c.useState(null),[l,u]=c.useState(!1),f=c.useRef(null),[p,m]=c.useState(!1),h=()=>{const S=f.current;if(!S){m(!1);return}m(S.scrollTop+S.clientHeight<S.scrollHeight-1)},w=async S=>{try{const g=await fetch(`/api/fs${S?`?dir=${encodeURIComponent(S)}`:""}`),y=await g.json();if(!g.ok)throw new Error(y.error??`listing failed: ${g.status}`);i(y)}catch(g){a(g instanceof Error?g.message:String(g))}};c.useEffect(()=>{w()},[]),c.useEffect(()=>(h(),window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)),[o]),c.useEffect(()=>{if(t)return;const S=g=>{g.key==="Escape"&&(g.stopPropagation(),r())};return window.addEventListener("keydown",S,!0),()=>window.removeEventListener("keydown",S,!0)},[t,r]);const v=S=>{u(!0),a(null),n(S).then(g=>{u(!1),g&&a(g)})};return d.jsx("div",{style:_M,onMouseDown:t?void 0:r,children:d.jsxs("div",{"data-testid":"project-picker",style:PM,onMouseDown:S=>S.stopPropagation(),children:[d.jsxs("div",{style:FM,children:[d.jsx("span",{style:jM,children:t?"open a project":"switch project"}),t?null:d.jsx("button",{"data-testid":"project-picker-close",style:MM,onClick:r,children:"esc close"})]}),d.jsx("div",{style:$M,children:"A project is a work directory a `ossclip produce` run wrote — the folder holding render-props.json."}),s?d.jsx("div",{"data-testid":"project-picker-error",style:AM,children:s}):null,e.length>0?d.jsxs("div",{style:{marginTop:16,flexShrink:0},children:[d.jsx("div",{style:lg,children:"recent"}),d.jsx("div",{className:"ossclip-scroll-list",style:OM,"data-testid":"project-recent-list",children:e.map(S=>d.jsxs("button",{"data-testid":"project-recent",style:tc,disabled:l,onClick:()=>v(S),title:S,children:[d.jsx("span",{style:{color:"#FFE14D",marginRight:8},children:"▸"}),S]},S))})]}):null,d.jsxs("div",{style:DM,children:[d.jsx("div",{style:lg,children:"browse"}),d.jsxs("div",{style:{color:"#6a6a75",fontSize:12,marginBottom:6},children:["Folders only — hidden ones are omitted, and any projects produced inside a folder show up directly as ",d.jsx("span",{style:{color:"#FFE14D"},children:"▸ .ossclip/…"})," entries."]}),o?d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:NM,children:[d.jsx("span",{style:LM,title:o.dir,children:o.dir}),o.isWorkdir?d.jsx("button",{"data-testid":"project-open-current",style:zM,disabled:l,onClick:()=>v(o.dir),children:"open this project"}):null]}),d.jsxs("div",{ref:f,className:"ossclip-scroll-list",style:p?{...ug,...VM}:ug,onScroll:h,"data-testid":"project-fs-list",children:[o.parent?d.jsx("button",{"data-testid":"project-fs-up",style:tc,disabled:l,onClick:()=>void w(o.parent),children:".."}):null,o.entries.map(S=>d.jsxs("button",{"data-testid":S.isWorkdir?"project-fs-workdir":"project-fs-dir",style:{...tc,...S.isWorkdir?BM:{}},disabled:l,onClick:()=>S.isWorkdir?v(S.path):void w(S.path),title:S.path,children:[d.jsx("span",{style:{marginRight:8,color:S.isWorkdir?"#FFE14D":"#6a6a75"},children:S.isWorkdir?"▸":"▪"}),S.name,S.isWorkdir?d.jsx("span",{style:WM,children:"project"}):d.jsx("span",{style:{color:"#55555f"},children:"/"})]},S.path)),o.entries.length===0?d.jsx("div",{style:{color:"#6a6a75",fontSize:12,padding:"6px 8px"},children:"no folders here"}):null]})]}):d.jsx("div",{style:{color:"#6a6a75",fontSize:13},children:"loading…"})]})]})})},_M={position:"fixed",inset:0,zIndex:30,background:"rgba(5,5,8,0.6)",display:"flex",alignItems:"center",justifyContent:"center"},PM={width:620,maxWidth:"90vw",maxHeight:"82vh",display:"flex",flexDirection:"column",background:"#12121A",border:"1px solid #3A3A48",borderRadius:8,padding:"20px 26px 26px",fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace"},FM={display:"flex",justifyContent:"space-between",alignItems:"center"},jM={fontSize:18,fontWeight:700,color:"#EDEDF2"},MM={fontSize:13,fontWeight:700,color:"#0B0B0E",background:"#a8c7fa",border:"none",borderRadius:4,padding:"3px 10px",cursor:"pointer"},$M={fontSize:13,color:"#6a6a75",marginTop:4},AM={marginTop:12,fontSize:13,color:"#FF5C5C"},lg={fontSize:14,fontWeight:700,color:"#8ab4f8",marginBottom:6},NM={display:"flex",alignItems:"center",gap:10,marginBottom:6},LM={fontSize:12,color:"#9A9AA3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},zM={flexShrink:0,fontSize:12,fontWeight:700,color:"#0B0B0E",background:"#FFE14D",border:"1px solid #FFE14D",borderRadius:6,padding:"4px 10px",cursor:"pointer"},DM={marginTop:16,display:"flex",flexDirection:"column",flex:1,minHeight:0},OM={maxHeight:176,overflowY:"auto",flexShrink:0,display:"flex",flexDirection:"column",gap:2},ug={flex:1,minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:2},VM={maskImage:"linear-gradient(to bottom, black calc(100% - 24px), transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black calc(100% - 24px), transparent 100%)"},tc={display:"block",width:"100%",textAlign:"left",fontFamily:"inherit",fontSize:13,color:"#C9C9D4",background:"transparent",border:"1px solid transparent",borderRadius:6,padding:"5px 8px",cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},BM={color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33"},WM={marginLeft:10,fontSize:11,fontWeight:700,color:"#FFE14D"};function ca(e){for(let t=e.length-1;t>=0;t--){const n=/^\s*(\d{1,3})%\s*$/.exec(e[t]);if(n)return Math.min(100,Number(n[1]))}return null}function UM(e){const t=n=>{for(let r=e.length-1;r>=0;r--)if(n.test(e[r]))return e[r]};return[t(/^▸ producing scenes/),t(/^▸ llm:/)].filter(n=>n!==void 0)}function HM(e,t){const n=Math.max(0,Math.floor((t-e)/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function ZM(e,t){return e?{load:e,notifyDiscard:t}:{load:null,notifyDiscard:!1}}function YM(e){if(e.dirty){if(e.renderRunning){e.onBlocked();return}e.save().catch(t=>e.onSaveError(t instanceof Error?t.message:String(t)))}}function KM(e,t){const{cues:n}=bd(e,t);return op(n,t.splits).filter(o=>{var i;return((i=t.scenes[o.id])==null?void 0:i.hidden)===!0})}const XM=()=>{const e=xj(),t=c.useRef(e.dirty);t.current=e.dirty;const[n,r]=c.useState(!1),[o,i]=c.useState(!1),[s,a]=c.useState(null),[l,u]=c.useState(null),[f,p]=c.useState(null),[m,h]=c.useState(null),[w,v]=c.useState(!1),[S,g]=c.useState(1),[y,x]=c.useState(null),[b,k]=c.useState(!1),[E,I]=c.useState([]),[T,_]=c.useState(null),[$,M]=c.useState(!1),[P,D]=c.useState(null),O=c.useRef(null);c.useEffect(()=>()=>{O.current!==null&&window.clearInterval(O.current)},[]);const[A,Z]=c.useState(null),R=c.useRef(null),C=c.useRef(null),j=c.useRef(null),F=c.useRef(null),[V,W]=c.useState(null),[N,L]=c.useState(null),B=c.useCallback(K=>{var Se;if(j.current=K,L(K),(Se=F.current)==null||Se.disconnect(),F.current=null,!K)return;const te=()=>W({w:Math.max(0,K.clientWidth-rc*2),h:Math.max(0,K.clientHeight-rc*2)});te();const re=new ResizeObserver(te);re.observe(K),F.current=re},[]),[H,z]=c.useState(1),Y=c.useRef(H);Y.current=H;const oe=c.useRef(null),ae=c.useCallback((K,te)=>{const re=j.current,Se=Math.min(8,Math.max(.25,K)),it=Y.current;if(re&&Se!==it){const Ct=re.getBoundingClientRect();oe.current={prev:it,ax:((te==null?void 0:te.x)??Ct.left+Ct.width/2)-Ct.left,ay:((te==null?void 0:te.y)??Ct.top+Ct.height/2)-Ct.top,sl:re.scrollLeft,st:re.scrollTop}}z(Se)},[]);c.useLayoutEffect(()=>{const K=j.current,te=oe.current;if(!K||!te)return;oe.current=null;const re=H/te.prev;K.scrollLeft=(te.sl+te.ax)*re-te.ax,K.scrollTop=(te.st+te.ay)*re-te.ay},[H]),c.useEffect(()=>{const K=N;if(!K)return;const te=re=>{(re.ctrlKey||re.metaKey)&&(re.preventDefault(),ae(Y.current*Math.exp(-re.deltaY*.01),{x:re.clientX,y:re.clientY}))};return K.addEventListener("wheel",te,{passive:!1}),()=>K.removeEventListener("wheel",te)},[N,ae]);const ce=c.useRef(null);c.useEffect(()=>{const K=re=>{const Se=ce.current,it=j.current;!Se||!it||(it.scrollLeft=Se.sl-(re.clientX-Se.x),it.scrollTop=Se.st-(re.clientY-Se.y))},te=()=>{ce.current=null};return window.addEventListener("mousemove",K),window.addEventListener("mouseup",te),()=>{window.removeEventListener("mousemove",K),window.removeEventListener("mouseup",te)}},[]);const[se,G]=c.useState(!1),[ee,Q]=c.useState(()=>{const K=Number(window.localStorage.getItem(cg));return Number.isFinite(K)&&K>0?dg(K):300}),q=c.useRef(null);c.useEffect(()=>{const K=re=>{const Se=q.current;Se&&Q(dg(Se.startW+(re.clientX-Se.startX)))},te=()=>{q.current&&(q.current=null,Q(re=>(window.localStorage.setItem(cg,String(re)),re)))};return window.addEventListener("mousemove",K),window.addEventListener("mouseup",te),()=>{window.removeEventListener("mousemove",K),window.removeEventListener("mouseup",te)}},[]);const[he,Ce]=c.useState(!1),[ve,pe]=c.useState(!0),Re=c.useCallback(K=>{const te=cT({rate:S,playing:w},K);g(te.rate);const re=C.current;re&&(te.playing&&!w&&re.play(),!te.playing&&w&&re.pause())},[S,w]);c.useEffect(()=>{const K=C.current;if(!K)return;const te=()=>v(!0),re=()=>v(!1);return K.addEventListener("play",te),K.addEventListener("pause",re),()=>{K.removeEventListener("play",te),K.removeEventListener("pause",re)}});const be=c.useCallback(()=>{if(O.current!==null)return;const K=window.setInterval(()=>{(async()=>{try{const re=await(await fetch("/api/render/status")).json();if(re.running||re.exitCode===null){D(Se=>({running:re.running,lines:re.lines??[],startedAt:re.startedAt??(Se==null?void 0:Se.startedAt)}));return}if(O.current!==null&&(window.clearInterval(O.current),O.current=null),re.exitCode===0){const it=await(await fetch("/api/production")).json();a(it.renderProps),M(!!it.canRender);const Ct=ZM(it.overrides,t.current);Ct.load&&e.load(Ct.load),Ct.notifyDiscard&&r(!0),D(null)}else D({running:!1,lines:re.lines??[],failed:re.exitCode,cancelled:re.cancelled})}catch{O.current===null&&be()}})()},1e3);O.current=K},[]),we=c.useCallback(async()=>{const K=await fetch("/api/production");if(!K.ok)throw new Error(`GET /api/production failed: ${K.status}`);const te=await K.json();if(I(te.recent??[]),te.noWorkdir){k(!0);return}a(te.renderProps),_(te.workdir??null),M(!!te.canRender),e.load(te.overrides),fetch("/api/usage").then(async it=>u(it.ok?await it.json():null)).catch(()=>u(null));const Se=await(await fetch("/api/render/status")).json();Se.running&&(D({running:!0,lines:Se.lines??[],startedAt:Se.startedAt}),be())},[be]);c.useEffect(()=>{we().catch(K=>p(K instanceof Error?K.message:String(K)))},[]);const Pe=c.useCallback(async K=>{if(e.dirty&&!window.confirm("Unsaved edits will be lost — switch projects anyway?"))return null;try{const te=await fetch("/api/workdir",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:K})}),re=await te.json().catch(()=>({}));return te.ok?(h(null),x(null),Z(null),D(null),z(1),a(null),k(!1),await we(),null):re.error??`open failed: ${te.status}`}catch(te){return te instanceof Error?te.message:String(te)}},[e.dirty,we]),ue=c.useMemo(()=>{if(!s)return null;const K=(s.baseSceneCues??s.sceneCues??[]).filter(It=>It.kind!=="plain"),te=s.baseTheme??s.theme??aF,{cues:re}=bd(K,e.doc),{cues:Se}=CF(re,e.doc),it=AF(Se,{outputDurationSec:s.outputDurationSec,clipStarts:(s.spans??[]).map(It=>It.outIn)}),Ct=op(it,e.doc.splits),{cues:ou}=bd(Ct,e.doc),{cues:Es}=Xw(ou,e.doc);let ei=y?Es.map(It=>It.id===y.sceneId?{...It,video:{...It.video,...y.patch}}:It):Es;A&&(ei=ei.map(It=>It.id===A.sceneId?{...It,graphicRect:A.rect}:It));const iu=s.baseCaptionLines??s.captionLines??[];return{...s,sceneCues:ei,captionLines:IF(iu,e.doc.captions).lines,theme:TF(te,e.doc),videoFileName:`/media/${s.videoFileName}`}},[s,e.doc,y,A]),Ge=()=>{YM({dirty:e.dirty,renderRunning:(P==null?void 0:P.running)===!0,save:e.save,onBlocked:()=>i(!0),onSaveError:K=>p(K)})},Et=c.useCallback(async()=>{try{e.dirty&&await e.save();const K=await fetch("/api/render",{method:"POST"});if(!K.ok){const te=await K.json().catch(()=>({}));throw new Error(te.error??`render failed to start: ${K.status}`)}D({running:!0,lines:[],startedAt:Date.now()}),be()}catch(K){p(K instanceof Error?K.message:String(K))}},[e,be]),At=c.useMemo(()=>{if(!s)return[];const K=(s.baseSceneCues??s.sceneCues??[]).filter(te=>te.kind!=="plain");return KM(K,e.doc)},[s,e.doc]),kt=c.useMemo(()=>m?(ue==null?void 0:ue.sceneCues.find(K=>K.id===m.sceneId))??At.find(K=>K.id===m.sceneId)??null:null,[ue,m,At]),mn=c.useMemo(()=>{if(!kt||!ue)return;const K=ue.captionLines.filter(re=>re.start<kt.endSec&&re.end>kt.startSec).flatMap(re=>re.words).filter(re=>re.start<kt.endSec&&re.end>kt.startSec).map(re=>re.text);if(K.length===0)return;const te=K.join(" ");return te.length>90?`${te.slice(0,90)}…`:te},[kt,ue]);if(f)return d.jsx("div",{style:nc,children:d.jsxs("div",{style:{padding:24,color:"#FF5C5C",fontFamily:"ui-monospace, monospace"},children:["Couldn't load the production: ",f]})});if(!ue)return d.jsx("div",{style:nc,children:b?d.jsx(ag,{recent:E,required:!0,onOpen:Pe,onClose:()=>{}}):d.jsx("div",{style:{padding:24,color:"#9A9AA3"},children:"Loading production…"})});const Un=ue.settings.width/ue.settings.height,Er=V?Math.max(220,Math.min(V.w,V.h*Un)):380,Ht=Math.round(Er*H);return d.jsxs("div",{style:nc,children:[d.jsxs("div",{style:JM,children:[d.jsx("span",{style:e$,children:"ossclip"}),T?d.jsx("span",{"data-testid":"workdir-label",style:t$,title:T,children:T.split("/").filter(Boolean).slice(-2).join("/")}):null,d.jsxs("div",{style:{display:"flex",gap:8},children:[d.jsx("button",{"data-testid":"open-button",style:Yt,onClick:()=>k(!0),title:T?`Open another project — currently ${T}`:"Open another project",children:"Open"}),d.jsx("button",{"data-testid":"undo-button",style:Yt,onClick:()=>e.undo(),disabled:!e.canUndo,title:"Undo (⌘Z)","aria-label":"Undo",children:d.jsx(qM,{})}),d.jsx("button",{"data-testid":"redo-button",style:Yt,onClick:()=>e.redo(),disabled:!e.canRedo,title:"Redo (⌘⇧Z)","aria-label":"Redo",children:d.jsx(QM,{})}),d.jsx("button",{"data-testid":"transcript-toggle",style:{...Yt,...se?{borderColor:"#5b8cff"}:{}},onClick:()=>G(K=>!K),title:"Find and retype caption words across the whole transcript",children:"Transcript"}),d.jsx("button",{style:{...Yt,...e.dirty?r$:{}},onClick:Ge,disabled:!e.dirty||(P==null?void 0:P.running)===!0,title:(P==null?void 0:P.running)===!0?"Can't save while a render is running":void 0,children:"Save"}),d.jsx("button",{"data-testid":"render-button",style:Yt,onClick:()=>void Et(),disabled:!$||(P==null?void 0:P.running)===!0,title:$?"Saves if needed, then replays the last completed produce command — pipeline flags come from that run; your saved edits apply on top":"No command.json in this workdir — run `ossclip produce` once in a terminal; it records the invocation and Render replays it",children:P!=null&&P.running?"Rendering…":"Render"})]}),d.jsx("span",{style:{...n$,color:e.dirty?"#FFE14D":"#5FBF77"},...e.dirty?{"data-testid":"dirty"}:{},children:e.dirty?"● Unsaved changes":"✓ Saved"}),d.jsx("button",{"data-testid":"shortcuts-button",style:{...Yt,padding:"7px 10px"},onClick:()=>Ce(K=>!K),title:"Keyboard shortcuts (?)",children:"?"})]}),he?d.jsx(yM,{onClose:()=>Ce(!1)}):null,b?d.jsx(ag,{recent:E,required:!1,onOpen:Pe,onClose:()=>k(!1)}):null,P?d.jsxs("div",{"data-testid":"render-log",style:{...f$,borderColor:P.failed!==void 0?"#FF5C5C":"#2A2A33"},children:[P.failed!==void 0?d.jsxs("div",{style:{color:P.cancelled?"#9A9AA3":"#FF5C5C",marginBottom:4},"data-testid":P.cancelled?"render-cancelled":"render-failed",children:[P.cancelled?"render cancelled":`render failed (exit ${P.failed})`,d.jsx("button",{style:{...Yt,marginLeft:10,padding:"2px 8px"},onClick:()=>D(null),children:"Dismiss"})]}):null,P.running?d.jsxs("div",{"data-testid":"render-status",style:p$,children:[d.jsx("style",{children:"@keyframes ossclip-spin { to { transform: rotate(360deg) } }"}),d.jsx("span",{style:m$,"aria-hidden":!0}),d.jsxs("span",{style:{color:"#EDEDF2"},children:["rendering",P.startedAt!=null?` · ${HM(P.startedAt,Date.now())}`:"",ca(P.lines)!==null?` · ${ca(P.lines)}%`:""]}),ca(P.lines)!==null?d.jsx("div",{style:h$,children:d.jsx("div",{"data-testid":"render-progress-bar",style:{...g$,width:`${ca(P.lines)}%`}})}):null,d.jsx("button",{"data-testid":"render-cancel",style:{...Yt,padding:"2px 8px"},onClick:()=>void fetch("/api/render/cancel",{method:"POST"}),children:"Cancel"}),d.jsx("button",{"data-testid":"render-logs-toggle",style:{...Yt,padding:"2px 8px"},onClick:()=>pe(K=>!K),title:ve?"Collapse the log":"Expand the log",children:ve?"▾ logs":"▸ logs"})]}):null,ve?d.jsxs(d.Fragment,{children:[UM(P.lines).map(K=>d.jsx("div",{"data-testid":"render-pinned",style:{color:"#C9C9D4"},children:K},K)),d.jsx(GM,{lines:P.lines})]}):null]}):null,n?d.jsxs("div",{"data-testid":"reanchor-notice",style:fg,children:["Render re-anchored your saved cuts and splits — edits made while it ran were dropped, not merged, to avoid overwriting that anchor.",d.jsx("button",{style:{...Yt,marginLeft:10,padding:"2px 8px"},onClick:()=>r(!1),children:"Dismiss"})]}):null,o?d.jsxs("div",{"data-testid":"save-blocked-notice",style:fg,children:["Can't save while a render is running — it's writing its own overrides.json right now. Wait for it to finish (or cancel it) before saving.",d.jsx("button",{style:{...Yt,marginLeft:10,padding:"2px 8px"},onClick:()=>i(!1),children:"Dismiss"})]}):null,d.jsxs("div",{style:o$,children:[se?d.jsxs(d.Fragment,{children:[d.jsx(oM,{baseLines:(s==null?void 0:s.baseCaptionLines)??(s==null?void 0:s.captionLines)??[],liveLines:ue.captionLines,fps:ue.settings.fps,playerRef:C,edits:e,width:ee}),d.jsx("div",{"data-testid":"transcript-divider",style:i$,title:"Drag to resize the transcript pane",onMouseDown:K=>{K.preventDefault(),q.current={startX:K.clientX,startW:ee}}})]}):null,d.jsxs("div",{style:s$,children:[d.jsx("div",{ref:B,style:a$,onMouseDown:K=>{if(K.altKey||K.button===1){K.preventDefault();const te=j.current;te&&(ce.current={x:K.clientX,y:K.clientY,sl:te.scrollLeft,st:te.scrollTop})}},children:d.jsx("div",{style:{margin:"auto",padding:rc},children:d.jsxs("div",{ref:R,"data-testid":"stage","data-playing":w?"true":"false","data-rate":S,style:{position:"relative",display:"inline-block"},children:[d.jsx(rT,{ref:C,component:gj,inputProps:ue,durationInFrames:Math.max(1,Math.round(ue.outputDurationSec*ue.settings.fps)),fps:ue.settings.fps,compositionWidth:ue.settings.width,compositionHeight:ue.settings.height,style:{width:Ht},controls:!0,clickToPlay:!1,playbackRate:S}),d.jsx(Tj,{stageRef:R,selection:m,onSelect:h,edits:e,onSave:Ge,settings:ue.settings,cues:ue.sceneCues,playerRef:C,cue:kt,onTransport:Re,onVideoPreview:x,onGraphicPreview:Z,onToggleHelp:()=>Ce(K=>!K)}),d.jsx("button",{"data-testid":"rate-chip",onClick:()=>Re("L"),title:"Playback rate — click to speed up (J/K/L on the keyboard)",style:v$,children:S<0?`◂◂ ${Math.abs(S)}×`:`${S}×`})]})})}),d.jsxs("div",{style:l$,children:[d.jsx("button",{"data-testid":"view-zoom-out",style:oc,onClick:()=>ae(H/2),disabled:H<=.25,title:"Zoom the preview out — below 100% shrinks under the fitted size",children:"−"}),d.jsxs("span",{"data-testid":"view-zoom-level",style:u$,children:[Math.round(H*100),"%"]}),d.jsx("button",{"data-testid":"view-zoom-in",style:oc,onClick:()=>ae(H*2),disabled:H>=8,title:"Zoom the preview in — a viewing magnifier, it never edits the video",children:"+"}),d.jsx("button",{"data-testid":"view-zoom-fit",style:{...oc,width:"auto",padding:"0 8px"},onClick:()=>ae(1),disabled:Math.abs(H-1)<.001,title:"Fit the preview to the window",children:"fit"}),d.jsx("span",{style:c$,children:"⌥-drag pans"})]})]}),d.jsx("div",{style:d$,children:d.jsx(_j,{selection:m,cue:kt,frame:{width:ue.settings.width,height:ue.settings.height},allSceneIds:ue.sceneCues.map(K=>K.id),edits:e,onSelect:h,resolvedTheme:ue.theme,anchorText:mn,onVideoPreview:x,runInfo:l})})]}),d.jsx(Bj,{cues:ue.sceneCues,ghosts:At,cuts:e.doc.cuts,spans:ue.spans??[],durationSec:ue.outputDurationSec,fps:ue.settings.fps,playerRef:C,selection:m,onSelect:h,edits:e,videoSrc:ue.videoFileName,toSourceSec:K=>{var te;for(const re of ue.spans??[])if(K>=re.outIn&&K<re.outOut)return re.srcIn+(K-re.outIn);return((te=(ue.spans??[])[0])==null?void 0:te.srcIn)??K}})]})},GM=({lines:e})=>{const t=c.useRef(null),n=c.useRef(!0);return c.useEffect(()=>{const r=t.current;r&&n.current&&(r.scrollTop=r.scrollHeight)},[e]),d.jsx("div",{ref:t,"data-testid":"render-tail",onScroll:r=>{const o=r.currentTarget;n.current=o.scrollTop+o.clientHeight>=o.scrollHeight-8},style:{maxHeight:220,overflowY:"auto"},children:e.map((r,o)=>d.jsx("div",{children:r},o))})},qM=()=>d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:[d.jsx("path",{d:"M9 14 4 9l5-5"}),d.jsx("path",{d:"M4 9h10.5a5.5 5.5 0 0 1 0 11H11"})]}),QM=()=>d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:[d.jsx("path",{d:"m15 14 5-5-5-5"}),d.jsx("path",{d:"M20 9H9.5a5.5 5.5 0 0 0 0 11H13"})]}),nc={fontFamily:"'Inter', system-ui, sans-serif",background:"#0B0B0E",color:"#EDEDF2",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column"},JM={display:"flex",alignItems:"center",gap:14,padding:"10px 20px",borderBottom:"1px solid #1E1E24",background:"#111116"},e$={fontWeight:800,fontSize:14,letterSpacing:"0.02em",color:"#FFE14D",marginRight:8},t$={fontSize:12,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#6a6a75",maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n$={fontSize:12,fontFamily:"ui-monospace, 'SF Mono', monospace",marginLeft:"auto"},Yt={fontSize:12,fontWeight:600,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:6,padding:"7px 12px",cursor:"pointer"},r$={background:"#FFE14D",color:"#0B0B0E",border:"1px solid #FFE14D"},o$={display:"flex",flex:1,minHeight:0},rc=32,cg="ossclip.transcriptWidth",dg=e=>Math.min(640,Math.max(220,e)),i$={width:5,flexShrink:0,cursor:"col-resize",background:"#1E1E24",borderLeft:"1px solid #2A2A33"},s$={position:"relative",flex:1,minWidth:0},a$={position:"absolute",inset:0,display:"flex",overflow:"auto"},l$={position:"absolute",top:10,left:10,zIndex:6,display:"flex",alignItems:"center",gap:6,padding:"4px 6px",background:"rgba(17,17,22,0.85)",border:"1px solid #2A2A33",borderRadius:6},oc={width:22,height:18,fontSize:12,lineHeight:1,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:4,cursor:"pointer",padding:0},u$={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3",minWidth:34,textAlign:"center"},c$={fontSize:10,color:"#55555f",userSelect:"none"},d$={width:260,flexShrink:0,borderLeft:"1px solid #1E1E24",background:"#111116",overflowY:"auto"},f$={fontSize:11,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3",background:"#0F0F14",borderBottom:"1px solid #2A2A33",padding:"6px 20px",whiteSpace:"pre-wrap",flexShrink:0},fg={display:"flex",alignItems:"center",fontSize:12,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#FFE14D",background:"#0F0F14",borderBottom:"1px solid #2A2A33",padding:"6px 20px",flexShrink:0},p$={display:"flex",alignItems:"center",gap:10,marginBottom:4},m$={width:12,height:12,flexShrink:0,border:"2px solid #2A2A33",borderTopColor:"#FFE14D",borderRadius:"50%",animation:"ossclip-spin 0.8s linear infinite"},h$={flex:1,maxWidth:260,height:4,background:"#1E1E24",borderRadius:2,overflow:"hidden"},g$={height:"100%",background:"#FFE14D",borderRadius:2,transition:"width 0.6s ease"},v$={position:"absolute",top:8,right:8,zIndex:5,fontSize:11,fontWeight:700,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#FFE14D",background:"rgba(11,11,14,0.75)",border:"1px solid #2A2A33",borderRadius:6,padding:"3px 8px",cursor:"pointer"};ic.createRoot(document.getElementById("root")).render(d.jsx(J.StrictMode,{children:d.jsx(XM,{})}));
|
|
158
|
+
path: iss.path ? [${gi(w)}, ...iss.path] : [${gi(w)}]
|
|
159
|
+
})));`),m.write(`newResult[${gi(w)}] = ${x}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");const v=m.compile();return(w,x)=>v(p,w,x)};let o;const i=yd,s=!Iw.jitless,l=s&&hT.value,u=t.catchall;let f;e._zod.parse=(p,m)=>{f??(f=n.value);const h=p.value;if(!i(h))return p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p;const y=[];if(s&&l&&(m==null?void 0:m.async)===!1&&m.jitless!==!0)o||(o=r(t.shape)),p=o(p,m);else{p.value={};const x=f.shape;for(const b of f.keys){const k=x[b],E=k._zod.run({value:h[b],issues:[]},m),I=k._zod.optin==="optional"&&k._zod.optout==="optional";E instanceof Promise?y.push(E.then(T=>I?vh(T,p,b,h):ta(T,p,b))):I?vh(E,p,b,h):ta(E,p,b)}}if(!u)return y.length?Promise.all(y).then(()=>p):p;const g=[],S=f.keySet,v=u._zod,w=v.def.type;for(const x of Object.keys(h)){if(S.has(x))continue;if(w==="never"){g.push(x);continue}const b=v.run({value:h[x],issues:[]},m);b instanceof Promise?y.push(b.then(k=>ta(k,p,x))):ta(b,p,x)}return g.length&&p.issues.push({code:"unrecognized_keys",keys:g,input:h,inst:e}),y.length?Promise.all(y).then(()=>p):p}});function yh(e,t,n,r){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(i=>mr(i,r,pr())))}),t}const XR=U("$ZodUnion",(e,t)=>{Ve.init(e,t),Ne(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Ne(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Ne(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Ne(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>Jf(r.source)).join("|")})$`)}}),e._zod.parse=(n,r)=>{let o=!1;const i=[];for(const s of t.options){const a=s._zod.run({value:n.value,issues:[]},r);if(a instanceof Promise)i.push(a),o=!0;else{if(a.issues.length===0)return a;i.push(a)}}return o?Promise.all(i).then(s=>yh(s,n,e,r)):yh(i,n,e,r)}}),GR=U("$ZodIntersection",(e,t)=>{Ve.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,u])=>wh(n,l,u)):wh(n,i,s)}});function wd(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ol(e)&&ol(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const s=wd(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],s=wd(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wh(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Mi(e))return e;const r=wd(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const qR=U("$ZodRecord",(e,t)=>{Ve.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!ol(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[];if(t.keyType._zod.values){const s=t.keyType._zod.values;n.value={};for(const l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){const u=t.valueType._zod.run({value:o[l],issues:[]},r);u instanceof Promise?i.push(u.then(f=>{f.issues.length&&n.issues.push(...Pr(l,f.issues)),n.value[l]=f.value})):(u.issues.length&&n.issues.push(...Pr(l,u.issues)),n.value[l]=u.value)}let a;for(const l in o)s.has(l)||(a=a??[],a.push(l));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const s of Reflect.ownKeys(o)){if(s==="__proto__")continue;const a=t.keyType._zod.run({value:s,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(u=>mr(u,r,pr())),input:s,path:[s],inst:e}),n.value[a.value]=a.value;continue}const l=t.valueType._zod.run({value:o[s],issues:[]},r);l instanceof Promise?i.push(l.then(u=>{u.issues.length&&n.issues.push(...Pr(s,u.issues)),n.value[a.value]=u.value})):(l.issues.length&&n.issues.push(...Pr(s,l.issues)),n.value[a.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}}),QR=U("$ZodEnum",(e,t)=>{Ve.init(e,t);const n=fT(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(r=>gT.has(typeof r)).map(r=>typeof r=="string"?Ql(r):r.toString()).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return e._zod.values.has(i)||r.issues.push({code:"invalid_value",values:n,input:i,inst:e}),r}}),JR=U("$ZodTransform",(e,t)=>{Ve.init(e,t),e._zod.parse=(n,r)=>{const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(n.value=s,n));if(o instanceof Promise)throw new ns;return n.value=o,n}}),e_=U("$ZodOptional",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ne(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Jf(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(n,r):n.value===void 0?n:t.innerType._zod.run(n,r)}),t_=U("$ZodNullable",(e,t)=>{Ve.init(e,t),Ne(e._zod,"optin",()=>t.innerType._zod.optin),Ne(e._zod,"optout",()=>t.innerType._zod.optout),Ne(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Jf(n.source)}|null)$`):void 0}),Ne(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),n_=U("$ZodDefault",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",Ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>xh(i,t)):xh(o,t)}});function xh(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const r_=U("$ZodPrefault",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",Ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),o_=U("$ZodNonOptional",(e,t)=>{Ve.init(e,t),Ne(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>bh(i,e)):bh(o,e)}});function bh(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const i_=U("$ZodCatch",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",Ne(e._zod,"optout",()=>t.innerType._zod.optout),Ne(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>mr(s,r,pr()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>mr(i,r,pr()))},input:n.value}),n.issues=[]),n)}}),s_=U("$ZodPipe",(e,t)=>{Ve.init(e,t),Ne(e._zod,"values",()=>t.in._zod.values),Ne(e._zod,"optin",()=>t.in._zod.optin),Ne(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(n,r)=>{const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Sh(i,t,r)):Sh(o,t,r)}});function Sh(e,t,n){return Mi(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const a_=U("$ZodReadonly",(e,t)=>{Ve.init(e,t),Ne(e._zod,"propValues",()=>t.innerType._zod.propValues),Ne(e._zod,"values",()=>t.innerType._zod.values),Ne(e._zod,"optin",()=>t.innerType._zod.optin),Ne(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Eh):Eh(o)}});function Eh(e){return e.value=Object.freeze(e.value),e}const l_=U("$ZodCustom",(e,t)=>{Mt.init(e,t),Ve.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>kh(i,n,r,e));kh(o,n,r,e)}});function kh(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(rs(o))}}class u_{constructor(){this._map=new Map,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function c_(){return new u_}const na=c_();function d_(e,t){return new e({type:"string",...le(t)})}function f_(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...le(t)})}function Ch(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...le(t)})}function p_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...le(t)})}function m_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...le(t)})}function h_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...le(t)})}function g_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...le(t)})}function v_(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...le(t)})}function y_(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...le(t)})}function w_(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...le(t)})}function x_(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...le(t)})}function b_(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...le(t)})}function S_(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...le(t)})}function E_(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...le(t)})}function k_(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...le(t)})}function C_(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...le(t)})}function I_(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...le(t)})}function T_(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...le(t)})}function R_(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...le(t)})}function __(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...le(t)})}function P_(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...le(t)})}function F_(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...le(t)})}function j_(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...le(t)})}function M_(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...le(t)})}function $_(e,t){return new e({type:"string",format:"date",check:"string_format",...le(t)})}function A_(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...le(t)})}function N_(e,t){return new e({type:"string",format:"duration",check:"string_format",...le(t)})}function L_(e,t){return new e({type:"number",checks:[],...le(t)})}function z_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...le(t)})}function D_(e,t){return new e({type:"boolean",...le(t)})}function O_(e){return new e({type:"unknown"})}function V_(e,t){return new e({type:"never",...le(t)})}function Ih(e,t){return new zw({check:"less_than",...le(t),value:e,inclusive:!1})}function Zu(e,t){return new zw({check:"less_than",...le(t),value:e,inclusive:!0})}function Th(e,t){return new Dw({check:"greater_than",...le(t),value:e,inclusive:!1})}function Yu(e,t){return new Dw({check:"greater_than",...le(t),value:e,inclusive:!0})}function Rh(e,t){return new oR({check:"multiple_of",...le(t),value:e})}function Bw(e,t){return new sR({check:"max_length",...le(t),maximum:e})}function il(e,t){return new aR({check:"min_length",...le(t),minimum:e})}function Ww(e,t){return new lR({check:"length_equals",...le(t),length:e})}function B_(e,t){return new uR({check:"string_format",format:"regex",...le(t),pattern:e})}function W_(e){return new cR({check:"string_format",format:"lowercase",...le(e)})}function U_(e){return new dR({check:"string_format",format:"uppercase",...le(e)})}function H_(e,t){return new fR({check:"string_format",format:"includes",...le(t),includes:e})}function Z_(e,t){return new pR({check:"string_format",format:"starts_with",...le(t),prefix:e})}function Y_(e,t){return new mR({check:"string_format",format:"ends_with",...le(t),suffix:e})}function bs(e){return new hR({check:"overwrite",tx:e})}function K_(e){return bs(t=>t.normalize(e))}function X_(){return bs(e=>e.trim())}function G_(){return bs(e=>e.toLowerCase())}function q_(){return bs(e=>e.toUpperCase())}function Q_(e,t,n){return new e({type:"array",element:t,...le(n)})}function J_(e,t,n){return new e({type:"custom",check:"custom",fn:t,...le(n)})}const eP=U("ZodISODateTime",(e,t)=>{_R.init(e,t),Be.init(e,t)});function tP(e){return M_(eP,e)}const nP=U("ZodISODate",(e,t)=>{PR.init(e,t),Be.init(e,t)});function rP(e){return $_(nP,e)}const oP=U("ZodISOTime",(e,t)=>{FR.init(e,t),Be.init(e,t)});function iP(e){return A_(oP,e)}const sP=U("ZodISODuration",(e,t)=>{jR.init(e,t),Be.init(e,t)});function aP(e){return N_(sP,e)}const lP=(e,t)=>{Pw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>IT(e,n)},flatten:{value:n=>CT(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},eu=U("ZodError",lP,{Parent:Error}),uP=TT(eu),cP=RT(eu),dP=jw(eu),fP=Mw(eu),Ye=U("ZodType",(e,t)=>(Ve.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(n,r)=>Xr(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e),e.parse=(n,r)=>uP(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>dP(e,n,r),e.parseAsync=async(n,r)=>cP(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>fP(e,n,r),e.spa=e.safeParseAsync,e.refine=(n,r)=>e.check(oF(n,r)),e.superRefine=n=>e.check(iF(n)),e.overwrite=n=>e.check(bs(n)),e.optional=()=>Fh(e),e.nullable=()=>jh(e),e.nullish=()=>Fh(jh(e)),e.nonoptional=n=>GP(e,n),e.array=()=>On(e),e.or=n=>DP([e,n]),e.and=n=>VP(e,n),e.transform=n=>Mh(e,UP(n)),e.default=n=>YP(e,n),e.prefault=n=>XP(e,n),e.catch=n=>QP(e,n),e.pipe=n=>Mh(e,n),e.readonly=()=>tF(e),e.describe=n=>{const r=e.clone();return na.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=na.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return na.get(e);const r=e.clone();return na.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Uw=U("_ZodString",(e,t)=>{np.init(e,t),Ye.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(B_(...r)),e.includes=(...r)=>e.check(H_(...r)),e.startsWith=(...r)=>e.check(Z_(...r)),e.endsWith=(...r)=>e.check(Y_(...r)),e.min=(...r)=>e.check(il(...r)),e.max=(...r)=>e.check(Bw(...r)),e.length=(...r)=>e.check(Ww(...r)),e.nonempty=(...r)=>e.check(il(1,...r)),e.lowercase=r=>e.check(W_(r)),e.uppercase=r=>e.check(U_(r)),e.trim=()=>e.check(X_()),e.normalize=(...r)=>e.check(K_(...r)),e.toLowerCase=()=>e.check(G_()),e.toUpperCase=()=>e.check(q_())}),pP=U("ZodString",(e,t)=>{np.init(e,t),Uw.init(e,t),e.email=n=>e.check(f_(mP,n)),e.url=n=>e.check(v_(hP,n)),e.jwt=n=>e.check(j_(PP,n)),e.emoji=n=>e.check(y_(gP,n)),e.guid=n=>e.check(Ch(_h,n)),e.uuid=n=>e.check(p_(ra,n)),e.uuidv4=n=>e.check(m_(ra,n)),e.uuidv6=n=>e.check(h_(ra,n)),e.uuidv7=n=>e.check(g_(ra,n)),e.nanoid=n=>e.check(w_(vP,n)),e.guid=n=>e.check(Ch(_h,n)),e.cuid=n=>e.check(x_(yP,n)),e.cuid2=n=>e.check(b_(wP,n)),e.ulid=n=>e.check(S_(xP,n)),e.base64=n=>e.check(__(TP,n)),e.base64url=n=>e.check(P_(RP,n)),e.xid=n=>e.check(E_(bP,n)),e.ksuid=n=>e.check(k_(SP,n)),e.ipv4=n=>e.check(C_(EP,n)),e.ipv6=n=>e.check(I_(kP,n)),e.cidrv4=n=>e.check(T_(CP,n)),e.cidrv6=n=>e.check(R_(IP,n)),e.e164=n=>e.check(F_(_P,n)),e.datetime=n=>e.check(tP(n)),e.date=n=>e.check(rP(n)),e.time=n=>e.check(iP(n)),e.duration=n=>e.check(aP(n))});function fe(e){return d_(pP,e)}const Be=U("ZodStringFormat",(e,t)=>{Le.init(e,t),Uw.init(e,t)}),mP=U("ZodEmail",(e,t)=>{xR.init(e,t),Be.init(e,t)}),_h=U("ZodGUID",(e,t)=>{yR.init(e,t),Be.init(e,t)}),ra=U("ZodUUID",(e,t)=>{wR.init(e,t),Be.init(e,t)}),hP=U("ZodURL",(e,t)=>{bR.init(e,t),Be.init(e,t)}),gP=U("ZodEmoji",(e,t)=>{SR.init(e,t),Be.init(e,t)}),vP=U("ZodNanoID",(e,t)=>{ER.init(e,t),Be.init(e,t)}),yP=U("ZodCUID",(e,t)=>{kR.init(e,t),Be.init(e,t)}),wP=U("ZodCUID2",(e,t)=>{CR.init(e,t),Be.init(e,t)}),xP=U("ZodULID",(e,t)=>{IR.init(e,t),Be.init(e,t)}),bP=U("ZodXID",(e,t)=>{TR.init(e,t),Be.init(e,t)}),SP=U("ZodKSUID",(e,t)=>{RR.init(e,t),Be.init(e,t)}),EP=U("ZodIPv4",(e,t)=>{MR.init(e,t),Be.init(e,t)}),kP=U("ZodIPv6",(e,t)=>{$R.init(e,t),Be.init(e,t)}),CP=U("ZodCIDRv4",(e,t)=>{AR.init(e,t),Be.init(e,t)}),IP=U("ZodCIDRv6",(e,t)=>{NR.init(e,t),Be.init(e,t)}),TP=U("ZodBase64",(e,t)=>{LR.init(e,t),Be.init(e,t)}),RP=U("ZodBase64URL",(e,t)=>{DR.init(e,t),Be.init(e,t)}),_P=U("ZodE164",(e,t)=>{OR.init(e,t),Be.init(e,t)}),PP=U("ZodJWT",(e,t)=>{BR.init(e,t),Be.init(e,t)}),Hw=U("ZodNumber",(e,t)=>{Vw.init(e,t),Ye.init(e,t),e.gt=(r,o)=>e.check(Th(r,o)),e.gte=(r,o)=>e.check(Yu(r,o)),e.min=(r,o)=>e.check(Yu(r,o)),e.lt=(r,o)=>e.check(Ih(r,o)),e.lte=(r,o)=>e.check(Zu(r,o)),e.max=(r,o)=>e.check(Zu(r,o)),e.int=r=>e.check(Ph(r)),e.safe=r=>e.check(Ph(r)),e.positive=r=>e.check(Th(0,r)),e.nonnegative=r=>e.check(Yu(0,r)),e.negative=r=>e.check(Ih(0,r)),e.nonpositive=r=>e.check(Zu(0,r)),e.multipleOf=(r,o)=>e.check(Rh(r,o)),e.step=(r,o)=>e.check(Rh(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function de(e){return L_(Hw,e)}const FP=U("ZodNumberFormat",(e,t)=>{WR.init(e,t),Hw.init(e,t)});function Ph(e){return z_(FP,e)}const jP=U("ZodBoolean",(e,t)=>{UR.init(e,t),Ye.init(e,t)});function dn(e){return D_(jP,e)}const MP=U("ZodUnknown",(e,t)=>{HR.init(e,t),Ye.init(e,t)});function zo(){return O_(MP)}const $P=U("ZodNever",(e,t)=>{ZR.init(e,t),Ye.init(e,t)});function AP(e){return V_($P,e)}const NP=U("ZodArray",(e,t)=>{YR.init(e,t),Ye.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(il(n,r)),e.nonempty=n=>e.check(il(1,n)),e.max=(n,r)=>e.check(Bw(n,r)),e.length=(n,r)=>e.check(Ww(n,r)),e.unwrap=()=>e.element});function On(e,t){return Q_(NP,e,t)}const LP=U("ZodObject",(e,t)=>{KR.init(e,t),Ye.init(e,t),Ne(e,"shape",()=>t.shape),e.keyof=()=>Jo(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:zo()}),e.loose=()=>e.clone({...e._zod.def,catchall:zo()}),e.strict=()=>e.clone({...e._zod.def,catchall:AP()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>bT(e,n),e.merge=n=>ST(e,n),e.pick=n=>wT(e,n),e.omit=n=>xT(e,n),e.partial=(...n)=>ET(Zw,e,n[0]),e.required=(...n)=>kT(Yw,e,n[0])});function ye(e,t){const n={type:"object",get shape(){return ep(this,"shape",{...e}),this.shape},...le(t)};return new LP(n)}const zP=U("ZodUnion",(e,t)=>{XR.init(e,t),Ye.init(e,t),e.options=t.options});function DP(e,t){return new zP({type:"union",options:e,...le(t)})}const OP=U("ZodIntersection",(e,t)=>{GR.init(e,t),Ye.init(e,t)});function VP(e,t){return new OP({type:"intersection",left:e,right:t})}const BP=U("ZodRecord",(e,t)=>{qR.init(e,t),Ye.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function hr(e,t,n){return new BP({type:"record",keyType:e,valueType:t,...le(n)})}const xd=U("ZodEnum",(e,t)=>{QR.init(e,t),Ye.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new xd({...t,checks:[],...le(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new xd({...t,checks:[],...le(o),entries:i})}});function Jo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new xd({type:"enum",entries:n,...le(t)})}const WP=U("ZodTransform",(e,t)=>{JR.init(e,t),Ye.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=i=>{if(typeof i=="string")n.issues.push(rs(i,n.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),n.issues.push(rs(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function UP(e){return new WP({type:"transform",transform:e})}const Zw=U("ZodOptional",(e,t)=>{e_.init(e,t),Ye.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Fh(e){return new Zw({type:"optional",innerType:e})}const HP=U("ZodNullable",(e,t)=>{t_.init(e,t),Ye.init(e,t),e.unwrap=()=>e._zod.def.innerType});function jh(e){return new HP({type:"nullable",innerType:e})}const ZP=U("ZodDefault",(e,t)=>{n_.init(e,t),Ye.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function YP(e,t){return new ZP({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const KP=U("ZodPrefault",(e,t)=>{r_.init(e,t),Ye.init(e,t),e.unwrap=()=>e._zod.def.innerType});function XP(e,t){return new KP({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Yw=U("ZodNonOptional",(e,t)=>{o_.init(e,t),Ye.init(e,t),e.unwrap=()=>e._zod.def.innerType});function GP(e,t){return new Yw({type:"nonoptional",innerType:e,...le(t)})}const qP=U("ZodCatch",(e,t)=>{i_.init(e,t),Ye.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function QP(e,t){return new qP({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const JP=U("ZodPipe",(e,t)=>{s_.init(e,t),Ye.init(e,t),e.in=t.in,e.out=t.out});function Mh(e,t){return new JP({type:"pipe",in:e,out:t})}const eF=U("ZodReadonly",(e,t)=>{a_.init(e,t),Ye.init(e,t)});function tF(e){return new eF({type:"readonly",innerType:e})}const nF=U("ZodCustom",(e,t)=>{l_.init(e,t),Ye.init(e,t)});function rF(e){const t=new Mt({check:"custom"});return t._zod.check=e,t}function oF(e,t={}){return J_(nF,e,t)}function iF(e){const t=rF(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(rs(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(rs(o))}},e(n.value,n)));return t}const tu=Jo(["full-bleed","video-top","pip-bubble","graphic-only","blurred-behind","lower-third","split-left","split-right"]),nu=Jo(["TitleCard","StatCard","RuleCard","StrikethroughReveal","FlowDiagram","TerminalMock","ChatMock","ScreenshotFrame","BulletList"]),sF=ye({startWord:de().int().nonnegative(),endWord:de().int().nonnegative()});ye({id:fe(),anchor:sF,layout:tu,component:nu,props:hr(fe(),zo()),overrides:hr(fe(),zo()).default({}),rationale:fe().optional()});ye({id:fe(),kind:Jo(["graphic","plain"]).optional(),layout:tu,component:nu.optional(),props:hr(fe(),zo()).optional(),startSec:de().nonnegative(),endSec:de().nonnegative(),graphicRect:ye({x:de(),y:de(),w:de(),h:de()}).optional(),elements:hr(fe(),ye({dx:de().optional(),dy:de().optional(),scale:de().positive().optional(),hidden:dn().optional()})).optional(),video:ye({scale:de().positive().max(4).optional(),dy:de().optional(),dx:de().optional(),autoZoom:dn().optional()}).optional(),pip:ye({cornerRadius:de().min(0).max(1).optional(),x:de().min(0).max(1).optional(),y:de().min(0).max(1).optional()}).optional(),captionY:de().min(0).max(1).optional(),captionScale:de().min(.2).max(3).optional(),pinned:dn().optional()}).superRefine((e,t)=>{e.kind!=="plain"&&(e.component===void 0||e.props===void 0)&&t.addIssue({code:"custom",message:'a graphic cue requires component and props; only kind: "plain" may omit them'})});ye({centerYFrac:de().min(0).max(1),sizeFrac:de().min(0).max(1).optional(),centerXFrac:de().min(0).max(1).optional(),sourceAspect:de().positive().optional()});const rp=ye({bg:fe().default("#0B0B0E"),fg:fe().default("#FFFFFF"),accent:fe().default("#FFE14D"),muted:fe().default("#9A9AA3"),success:fe().default("#5FBF77"),cardBg:fe().default("#15151B"),cardBorder:fe().default("#2A2A33"),danger:fe().default("#FF5C5C"),radiusPx:de().default(24),fontDisplay:fe().default("'Inter', 'Helvetica Neue', 'Arial Black', Arial, sans-serif"),fontMono:fe().default("'SF Mono', 'Cascadia Code', Consolas, monospace")}),aF=rp.parse({}),lF=ye({eyebrow:fe().max(28).optional(),title:fe().min(1).max(48).describe("the claim WITHOUT the emphasis token — never repeat the emphasis here"),emphasis:fe().max(16).optional().describe("the number/punch token pulled OUT of the title (e.g. '861%') — not a duplicate of it"),sub:fe().max(64).optional()}),uF=ye({label:fe().min(1).max(28),value:fe().min(1).max(12),caption:fe().max(40).optional(),inverted:dn().default(!1)}),cF=ye({kicker:fe().min(1).max(24),text:fe().min(1).max(40),struck:fe().max(40).optional()}),dF=ye({lines:On(ye({text:fe().min(1).max(32),struck:dn().default(!1),mark:Jo(["none","cross","check"]).default("none")})).min(1).max(4)}),fF=ye({title:fe().max(28).optional(),items:On(fe().min(1).max(36)).min(2).max(5)}),pF=ye({nodes:On(fe().min(1).max(16)).min(2).max(5),emphasizeLast:dn().default(!0)}),mF=ye({windows:On(ye({title:fe().max(24),lines:On(fe().max(40)).min(1).max(6)})).min(1).max(5),fanOut:fe().max(20).optional()}),hF=ye({messages:On(ye({from:Jo(["user","agent"]),text:fe().min(1).max(60)})).min(1).max(4),keyword:fe().max(16).optional().describe("ONLY for a 'comment <word>' ask: the single distinctive word the viewer types, plain and unformatted. Leave unset for any other CTA — especially 'reply with a number/which one', where there is no word to type. Never a referential filler like 'number', 'answer', 'comment' or 'below'.")}),gF=ye({src:fe().optional().describe("OMIT THIS unless the user supplied an actual image file beside the video — never invent a filename from the transcript; without it the frame renders as a styled placeholder, which is the intended look"),label:fe().max(32).optional(),kenBurns:dn().default(!0)}),vF={TitleCard:{propsSchema:lF,defaultProps:{title:"TITLE"},defaultLayout:"pip-bubble",altLayouts:[],whenToUse:"The core claim or hook as big typography; use `emphasis` for a huge number or punch word."},StatCard:{propsSchema:uF,defaultProps:{label:"METRIC",value:"+0%"},defaultLayout:"video-top",altLayouts:["blurred-behind"],whenToUse:"One striking metric (value like '+242%', '×3', '5s'); punchline in `caption`."},RuleCard:{propsSchema:cF,defaultProps:{kicker:"RULE",text:"DO THE THING"},defaultLayout:"video-top",altLayouts:["blurred-behind"],whenToUse:"A prescriptive takeaway ('CAPACITY RULE / CAP ACTIVE AGENTS'); `struck` shows the rejected alternative."},StrikethroughReveal:{propsSchema:dF,defaultProps:{lines:[{text:"NOT THIS",struck:!0}]},defaultLayout:"blurred-behind",altLayouts:["graphic-only"],whenToUse:'Negation/contrast beat — big words over the blurred speaker. Strike EVERY line of the phrase the speaker negates, not just its tail — a half-struck claim reads as a typo. For wrong-vs-right lists, set mark: "cross"/"check" (✗/✓) per line instead.'},FlowDiagram:{propsSchema:pF,defaultProps:{nodes:["A","B"]},defaultLayout:"graphic-only",altLayouts:[],whenToUse:"A causal chain or pipeline as chips with arrows (TEAM → AI AGENTS → CHURN)."},TerminalMock:{propsSchema:mF,defaultProps:{windows:[{title:"terminal-01",lines:["$ run"]}]},defaultLayout:"graphic-only",altLayouts:[],whenToUse:"Anything about running code/processes/agents — stylized terminal windows."},ChatMock:{propsSchema:hF,defaultProps:{messages:[{from:"user",text:"hello"}]},defaultLayout:"blurred-behind",altLayouts:["graphic-only"],whenToUse:"A quoted phrase or exchange as chat bubbles over the blurred speaker; for a comment-CTA beat, set `keyword` to the word viewers should type."},ScreenshotFrame:{propsSchema:gF,defaultProps:{},defaultLayout:"video-top",altLayouts:["blurred-behind"],whenToUse:"Reference to a document/PR/review — a framed screenshot look with a label chip."},BulletList:{propsSchema:fF,defaultProps:{items:["FIRST","SECOND"]},defaultLayout:"blurred-behind",altLayouts:["graphic-only"],whenToUse:"An ENUMERATION — the speaker lists two or more parallel things ('what you need is X, Y, Z'). One bullet per item, optional kicker title. Use this for lists instead of bending TitleCard or StrikethroughReveal around them."}};function $h(e,t,n={}){const r=vF[e],o={...r.defaultProps,...t,...n},i=r.propsSchema.safeParse(o);return i.success?i.data:null}const yF=ye({dx:de().optional(),dy:de().optional(),scale:de().positive().optional(),hidden:dn().optional()}),Kw=ye({props:hr(fe(),zo()).default({}),elements:hr(fe(),yF).default({}),timing:ye({startSec:de().nonnegative(),endSec:de().nonnegative()}).optional(),component:nu.optional(),layout:tu.optional(),video:ye({scale:de().positive().max(4).optional(),dy:de().optional(),dx:de().optional(),autoZoom:dn().optional()}).optional(),pip:ye({cornerRadius:de().min(0).max(1).optional(),x:de().min(0).max(1).optional(),y:de().min(0).max(1).optional()}).optional(),captionY:de().min(0).max(1).optional(),captionScale:de().min(.2).max(3).optional(),graphicRect:ye({x:de().min(0).max(1),y:de().min(0).max(1),w:de().min(.08).max(1),h:de().min(.05).max(1)}).optional(),hidden:dn().optional()}),wF=ye({text:fe().min(1).max(80),was:fe()});function xF(e,t,n){var r;return((r=e[String(t)])==null?void 0:r.was)??n}const bF=ye({theme:rp.partial().default({}),captionsHidden:dn().optional(),scenes:hr(fe(),Kw).default({}),captions:hr(fe(),wF).default({}),splits:On(de().nonnegative()).default([]),cuts:On(ye({startSec:de().nonnegative(),endSec:de().nonnegative(),src:ye({startSec:de().nonnegative(),endSec:de().nonnegative()}).optional()})).default([])}),SF=()=>bF.parse({});function EF(e,t){return $h(e,{},t)??$h(e,{},{})}function kF(e,t){const n=e[t],r=t.indexOf("@");if(r===-1)return n;const o=e[t.slice(0,r)];if(!o)return n;const{timing:i,hidden:s,...a}=o;return n?{...a,...n,props:{...a.props,...n.props},elements:{...a.elements,...n.elements},...a.video||n.video?{video:{...a.video,...n.video}}:{},...a.pip||n.pip?{pip:{...a.pip,...n.pip}}:{}}:{...a,props:{...a.props},elements:{...a.elements}}}function bd(e,t){const n=new Set(e.map(i=>i.id)),r=Object.keys(t.scenes).filter(i=>!n.has(i));return{cues:e.map(i=>{const s=kF(t.scenes,i.id);if(!s)return i;const a=s.component!==void 0&&s.component!==i.component,l=s.component??i.component,u=s.component!==void 0&&a?EF(s.component,s.props):{...i.props,...s.props},f=s.layout!==void 0&&s.layout!==i.layout,{graphicRect:p,...m}=i;return{...f?m:i,component:l,layout:s.layout??i.layout,props:u,...Object.keys(s.elements).length>0?{elements:s.elements}:{},...s.video?{video:s.video}:{},...s.pip?{pip:s.pip}:{},...s.captionY!==void 0?{captionY:s.captionY}:{},...s.captionScale!==void 0?{captionScale:s.captionScale}:{},...s.graphicRect?{graphicRect:s.graphicRect}:{},...s.timing&&!i.pinned?{startSec:s.timing.startSec,endSec:s.timing.endSec,pinned:!0}:{}}}),orphans:r}}const sl=.3;function op(e,t){const n=[...e];for(const r of[...t].sort((o,i)=>o-i)){const o=n.findIndex(s=>r>=s.startSec+sl&&r<=s.endSec-sl);if(o===-1)continue;const i=n[o];n.splice(o,1,{...i,endSec:r},{...i,id:`${i.id.split("@")[0]}@${Math.round(r*1e3)}`,startSec:r})}return n}function Xw(e,t){const n=[];return{cues:e.filter(o=>{var i;return((i=t.scenes[o.id])==null?void 0:i.hidden)!==!0?!0:(n.push(o.id),!1)}),hidden:n}}function CF(e,t){return Xw(op(e,t.splits),t)}function IF(e,t){const n=[];if(Object.keys(t).length===0)return{lines:[...e],dropped:n};let r=0;return{lines:e.map(i=>({...i,words:i.words.map(s=>{const a=t[String(r++)];return a?s.text!==a.was?(n.push({index:r-1,expected:a.was,found:s.text}),s):{...s,text:a.text}:s})})),dropped:n}}function TF(e,t){return rp.parse({...e,...t.theme})}function Ah(e,t,n,r){const o=e.scenes[t]??Kw.parse({});return{...e,scenes:{...e.scenes,[t]:{...o,elements:{...o.elements,[n]:{...o.elements[n],...r}}}}}}function RF(e,t,n){const r=e.scenes[t];if(!r)return e;const{[n]:o,...i}=r.elements;return{...e,scenes:{...e.scenes,[t]:{...r,elements:i}}}}function _F(e,t,n){const r=e.scenes[t],o=r==null?void 0:r.elements[n];if(!r||!(o!=null&&o.hidden))return e;const{hidden:i,...s}=o,{[n]:a,...l}=r.elements,u=Object.keys(s).length>0?{...r.elements,[n]:s}:l;return{...e,scenes:{...e.scenes,[t]:{...r,elements:u}}}}function PF(e,t){const n=e.scenes[t];if(!n||!n.timing)return e;const{timing:r,...o}=n;return{...e,scenes:{...e.scenes,[t]:o}}}function FF(e,t){const n=e.scenes[t];if(!n||!n.graphicRect)return e;const{graphicRect:r,...o}=n;return{...e,scenes:{...e.scenes,[t]:o}}}function jF(e){const t=e.indexOf("@");return t===-1?e:e.slice(0,t)}const MF=.6;function $F(e,t){const n=new Set([0]);for(const r of e??[])Number.isFinite(r)&&r>0&&r<t&&n.add(r);return[...n].sort((r,o)=>r-o)}function AF(e,t){const n=t.outputDurationSec,r=[...e].sort((f,p)=>f.startSec-p.startSec);if(n<=0)return r;const o=$F(t.clipStarts,n),i=[];let s=0;for(const f of r)f.startSec-s>1e-9&&i.push({start:s,end:f.startSec}),s=Math.max(s,f.endSec);n-s>1e-9&&i.push({start:s,end:n});const a=[];for(const f of i){const p=o.filter(h=>h>f.start+1e-9&&h<f.end-1e-9),m=[f.start,...p,f.end];for(let h=0;h<m.length-1;h++){const y=m[h],g=m[h+1];if(g-y<MF)continue;let S=0;for(let v=0;v<o.length;v++)o[v]<=y+1e-9&&(S=v);a.push({start:y,end:g,clip:S})}}const l=new Map,u=a.map(f=>{const p=l.get(f.clip)??0;return l.set(f.clip,p+1),{id:p===0?`take-${f.clip}`:`take-${f.clip}-${p}`,kind:"plain",layout:"full-bleed",startSec:f.start,endSec:f.end}});return[...r,...u].sort((f,p)=>f.startSec-p.startSec)}const NF=1.05;function LF(e,t){for(const r of e)if(t>=r.startSec&&t<r.endSec){const o=r.endSec-r.startSec,i=o>0?(t-r.startSec)/o:1,s=.5-.5*Math.cos(Math.PI*i);return r.from+(r.to-r.from)*s}const n=e[e.length-1];return n&&t===n.endSec?n.to:1}function zF(e,t,n){if(e.length===0)return{x:0,y:0,w:(n==null?void 0:n.width)??0,h:(n==null?void 0:n.height)??0,full:!0};if(t<e[0].startSec)return e[0].rect;for(const r of e)if(t>=r.startSec&&t<r.endSec)return r.rect;return e[e.length-1].rect}const DF=/[\p{Script=Arabic}\p{Script=Hebrew}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Nko}]/u,OF=new RegExp("\\p{L}","u");function VF(e){for(const t of e){if(DF.test(t))return"rtl";if(OF.test(t))return"ltr"}return"ltr"}const $t={width:1080,height:1920};$t.width;$t.height;const Ss={centerYFrac:.38,sizeFrac:.22},BF=.35,WF=.45,Gw=1-1/NF,UF=.4*Gw,HF=.6*Gw;function qw(e,t,n=$t){const r=e.w*n.width,o=e.h*n.height;return Math.max(o,r/(t.sourceAspect??n.width/n.height))}function ZF(e,t,n=$t){const r=e.h*n.height,o=qw(e,t,n),i=o-r;if(i<=1)return .5;const s=t.sizeFrac??Ss.sizeFrac,a=(t.centerYFrac-s/2-BF*s)*o,l=(t.centerYFrac+s/2)*o,u=(a+l)/2-WF*r,f=a-UF*r,p=l+HF*r-r,m=p<=f?Math.min(Math.max(u,p),f):p;return Math.min(1,Math.max(0,m/i))}function YF(e,t,n,r,o=$t){if(r.length===0)return e;const i=t.h*o.height,s=qw(t,n,o);if(s-i<=1)return e;const l=i/s,u=1-l;if(u<=0)return e;let f=e*u;for(let p=0;p<r.length+1;p++){const m=r.find(x=>{const b=x.y,k=x.y+x.h,E=f+l,I=b<f&&f<k,T=b<E&&E<k;return I||T});if(!m)break;const h=[],y=m.y+m.h;y<=u&&h.push(y);const g=m.y-l;if(g>=0&&h.push(g),m.h<=l){const x=Math.max(0,m.y+m.h-l),b=Math.min(u,m.y);x<=b&&h.push(Math.min(Math.max(f,x),b))}const S=n.sizeFrac??Ss.sizeFrac,v=n.centerYFrac+S/2,w=h.filter(x=>x+l>=v);if(w.length===0)return e;f=w.reduce((x,b)=>Math.abs(b-f)<Math.abs(x-f)?b:x)}return Math.min(1,Math.max(0,f/u))}function KF(e,t,n=$t){const r=e.w*n.width,o=e.h*n.height,i=Math.max(r,o*(t.sourceAspect??n.width/n.height)),s=i-r;if(s<=1||t.centerXFrac===void 0)return .5;const a=t.centerXFrac*i-r/2;return Math.min(1,Math.max(0,a/s))}const XF={top:.12,bottom:.22,right:.16,left:.04},GF={top:.06,bottom:.12,right:.05,left:.05};function wn(e=$t){return e.width>e.height?GF:XF}function qF(e=$t){const t=wn(e);return{x:t.left,y:t.top,w:1-t.left-t.right,h:1-t.top-t.bottom}}const QF=.08,JF=.05;function al(e,t=$t){const n=qF(t),r=1e-9,o=(u,f,p)=>u<f-r?f:u>p+r?p:u,i=o(e.w,QF,n.w),s=o(e.h,JF,n.h),a=o(e.x,n.x,n.x+n.w-i),l=o(e.y,n.y,n.y+n.h-s);return{x:a,y:l,w:i,h:s}}const Nh=.045,Rn={x:0,y:0,w:1,h:1},Ku=.3,to={x:.5-Ku/2,y:.66,w:Ku,h:Ku*1080/1920};function Dr(e,t=Ss,n=[],r=$t){const o=a=>YF(ZF(a,t,r),a,t,n,r),i=a=>KF(a,t,r),s=r.width>r.height;switch(e){case"full-bleed":return{video:{rect:Rn,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(Rn),objectPosX:i(Rn)},graphic:null,captionAnchor:.7};case"lower-third":{const a=s?{x:.05,y:.7,w:.62,h:.18}:{x:.04,y:.56,w:.8,h:.22};return{video:{rect:Rn,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(Rn),objectPosX:i(Rn)},graphic:a,captionAnchor:s?.62:.49}}case"split-left":case"split-right":{if(s){const l=e==="split-left",u={x:l?0:.5,y:0,w:.5,h:1};return{video:{rect:u,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(u),objectPosX:i(u)},graphic:l?{x:.55,y:.2,w:.4,h:.56}:{x:.05,y:.2,w:.4,h:.56},captionAnchor:.82}}const a={x:0,y:0,w:1,h:.5};return{video:{rect:a,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(a),objectPosX:i(a)},graphic:{x:.04,y:.58,w:.8,h:.2},captionAnchor:.53}}case"video-top":{const a={x:0,y:0,w:1,h:.42};return{video:{rect:a,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(a),objectPosX:i(a)},graphic:{x:.04,y:.54,w:.8,h:.24},captionAnchor:.48}}case"pip-bubble":return{video:{rect:to,cornerRadius:1,blurPx:0,dim:0,opacity:1,objectPosY:o(to),objectPosX:i(to)},graphic:{x:.06,y:.14,w:.78,h:.42},captionAnchor:.61};case"graphic-only":return{video:{rect:to,cornerRadius:1,blurPx:0,dim:0,opacity:0,objectPosY:o(to),objectPosX:i(to)},graphic:{x:.04,y:.14,w:.8,h:.54},captionAnchor:.73};case"blurred-behind":return{video:{rect:Rn,cornerRadius:0,blurPx:22,dim:.55,opacity:1,objectPosY:o(Rn),objectPosX:i(Rn)},graphic:{x:.07,y:.24,w:.77,h:.36},captionAnchor:.69}}}const e4={x:.07,y:.24,w:.77,h:.36};function Qw(e,t=$t){return e.graphicRect?al(e.graphicRect,t):Dr(e.layout,Ss,[],t).graphic??e4}const Jw=.35;function cr(e,t){for(const n of e)if(t>=n.startSec&&t<n.endSec)return n;return null}function Gt(e,t,n){return e+(t-e)*n}function t4(e,t,n){return{x:Gt(e.x,t.x,n),y:Gt(e.y,t.y,n),w:Gt(e.w,t.w,n),h:Gt(e.h,t.h,n)}}function Lh(e,t,n){return{rect:t4(e.rect,t.rect,n),cornerRadius:Gt(e.cornerRadius,t.cornerRadius,n),blurPx:Gt(e.blurPx,t.blurPx,n),dim:Gt(e.dim,t.dim,n),opacity:Gt(e.opacity,t.opacity,n),objectPosY:Gt(e.objectPosY,t.objectPosY,n),objectPosX:Gt(e.objectPosX,t.objectPosX,n)}}function ll(e){return e*e*(3-2*e)}function ex(e){return e.filter(t=>!(t.kind==="plain"&&t.layout==="full-bleed"))}function Xu(e,t,n,r){const o=Dr(e.layout,t,n,r).video,i=e.layout==="pip-bubble"?e.pip:void 0;if(!i)return o;const s={...o.rect,x:Math.min(Math.max(i.x??o.rect.x,0),1-o.rect.w),y:Math.min(Math.max(i.y??o.rect.y,0),1-o.rect.h)};return{...o,rect:s,cornerRadius:i.cornerRadius??o.cornerRadius}}function n4(e,t,n=Ss,r=[],o=$t){const i=ex(e),s=r.filter(v=>t>=v.startSec&&t<v.endSec),a=Dr("full-bleed",n,s,o).video,l=cr(i,t);if(!l)return a;const u=Xu(l,n,s,o),f=Math.min(Jw,(l.endSec-l.startSec)/2),p=t-l.startSec,m=l.endSec-t,h=cr(i,l.startSec-.001),y=cr(i,l.endSec+.001),g=h?Xu(h,n,s,o):a,S=y?Xu(y,n,s,o):a;return p<f?Lh(g,u,ll(p/f)):m<f?Lh(u,S,ll(1-m/f)):u}function Gu(e){return e==="pip-bubble"||e==="graphic-only"?1:0}function r4(e,t){const n=ex(e),r=cr(n,t);if(!r)return 0;const o=Gu(r.layout),i=Math.min(Jw,(r.endSec-r.startSec)/2),s=cr(n,r.startSec-.001),a=cr(n,r.endSec+.001),l=s?Gu(s.layout):0,u=a?Gu(a.layout):0,f=t-r.startSec,p=r.endSec-t;return f<i?Gt(l,o,ll(f/i)):p<i?Gt(o,u,ll(1-p/i)):o}function o4(e,t,n){return e.filter(r=>(r.startSec??Number.NEGATIVE_INFINITY)<n&&(r.endSec??Number.POSITIVE_INFINITY)>t)}function i4(e,t){let n=0;for(const r of t){const o=Math.max(e.y,r.y),i=Math.min(e.y+e.h,r.y+r.h);i>o&&(n+=i-o)}return Math.min(1,n/e.h)}function s4(e,t,n,r=$t){const o=Dr(e,void 0,[],r),i=wn(r),s=o.captionAnchor,a=l=>{const u={y:l-Nh,h:Nh*2};if(u.y<i.top||u.y+u.h>1-i.bottom||i4(u,t)>0)return!1;const f=n??o.graphic;return!(f&&Math.min(u.y+u.h,f.y+f.h)-Math.max(u.y,f.y)>0)};if(a(s))return s;for(let l=.02;l<=.6;l+=.02)for(const u of[s-l,s+l])if(a(u))return u;return s}const a4=.3,l4=.3,u4=.133,ip=e=>e*(2-e);function tx(e,t=a4,n=l4){if(e<=0)return{enterSec:0,exitSec:0};const r=t+n;if(r<=e)return{enterSec:t,exitSec:n};const o=e/r;return{enterSec:t*o,exitSec:n*o}}const zh=.4;function c4(e,t){if(!t)return e;const n=e.replace(/^[^A-Za-z0-9]+|[^A-Za-z0-9]+$/g,"");return n.toLowerCase()!==t.toLowerCase()?e:e.replace(n,`"${n.toUpperCase()}"`)}function d4(e,t){return t?e>=t.startSec-zh&&e<=t.endSec+zh:!1}const f4=({line:e,wordOffset:t,verticalAnchor:n,fontSizePx:r,activeColor:o,ctaKeyword:i,ctaWindow:s})=>{const a=ct(),{fps:l,width:u,height:f}=Xe(),p=wn({width:u,height:f}),m=e.start+a/l,h=VF(e.words.map(y=>y.text).join(" "));return d.jsx(pn,{style:{pointerEvents:"none"},children:d.jsx("div",{style:{position:"absolute",top:`${n*100}%`,left:0,right:0,transform:"translateY(-50%)",direction:h,display:"flex",justifyContent:"center",gap:"0.28em",flexWrap:"wrap",paddingLeft:`${p.left*100}%`,paddingRight:`${p.right*100}%`,fontFamily:"'Inter', 'Helvetica Neue', 'Arial Black', Arial, sans-serif",fontWeight:900,fontSize:r,lineHeight:1.15,textAlign:"center",color:"white",WebkitTextStroke:"10px rgba(0,0,0,0.85)",paintOrder:"stroke fill",textShadow:"0 4px 24px rgba(0,0,0,0.55)"},children:e.words.map((y,g)=>{const S=Math.max(y.end,y.start+.12),v=m>=y.start&&m<=S,w=v?Math.min(1,(m-y.start)/u4):0,x=ip(w);return d.jsx("span",{"data-caption-word":t+g,"data-caption-text":y.text,style:{display:"inline-block",pointerEvents:"auto",transform:x>0?`scale(${1+.08*x})`:"scale(1)",color:v?o:"white"},children:c4(y.text,d4(y.start,s)?i:void 0)},g)})})})},p4=({lines:e,cues:t=[],verticalAnchor:n=.76,fontSizePx:r=64,activeColor:o="#FFE14D",ctaKeyword:i,ctaWindow:s,sourceTextRegions:a=[]})=>{const{fps:l,width:u,height:f}=Xe(),p={width:u,height:f},m=[];let h=0;for(const y of e)m.push(h),h+=y.words.length;return d.jsx(pn,{children:e.map((y,g)=>{const S=t.length>0?cr(t,y.start):null,v=(S==null?void 0:S.captionY)!==void 0?S.captionY:t.length>0||a.length>0?s4((S==null?void 0:S.layout)??"full-bleed",o4(a,y.start,y.end),S==null?void 0:S.graphicRect,p):n,{from:w,durationInFrames:x}=qf(y.start,y.end,l);return d.jsx(dt,{from:w,durationInFrames:x,children:d.jsx(f4,{line:y,wordOffset:m[g],verticalAnchor:v,fontSizePx:r*((S==null?void 0:S.captionScale)??1),activeColor:o,ctaKeyword:i,ctaWindow:s})},g)})})};function m4(e,t,n,r=.5,o=.5){const i=Math.max(1,e.width),s=Math.max(1,e.height),a=Math.max(1,t.w),l=Math.max(1,t.h),u=Math.max(n.width/a,n.height/l),f=-t.x*u+(n.width-a*u)*Dh(r),p=-t.y*u+(n.height-l*u)*Dh(o);return{width:i*u,height:s*u,left:f,top:p}}function Dh(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):.5}function nx(e,t,n){const r=Math.max(1,e.width),o=Math.max(1,e.height),i=Math.max(1,t.w),s=Math.max(1,t.h),a=Math.min(n.width/i,n.height/s),l=-t.x*a+(n.width-i*a)/2,u=-t.y*a+(n.height-s*a)/2;return{width:r*a,height:o*a,left:l,top:u}}function h4(e,t){return nx(e,{x:0,y:0,w:e.width,h:e.height},t)}function g4(e,t){if(e.length===0)return t;for(const o of e)if(t>=o.outIn&&t<o.outOut)return o.srcIn+(t-o.outIn);const n=e[0];return t<n.outIn?n.srcIn:e[e.length-1].srcOut}function v4(e,t,n,r,o,i){return e==="fit"?nx(t,n,r):m4(t,n,r,o,i)}function y4(e,t,n,r){return e.length===0?{x:0,y:0,w:r.width,h:r.height,full:!0}:zF(e,g4(t,n),r)}const w4=({cues:e,theme:t,face:n,zoomPlan:r,sourceTextRegions:o,contentTimeline:i,spans:s,sourceSize:a,contentCropMode:l="cover",sourceFit:u="cover",children:f})=>{const p=ct(),{fps:m,width:h,height:y}=Xe(),g=p/m,v=n4(e,g,n??void 0,o??[],{width:h,height:y}),w=r4(e,g),x=v.rect.w*h,b=v.rect.h*y,k=v.cornerRadius*Math.min(x,b)/2,E=cr(e,g),I=E==null?void 0:E.video,T=r&&r.length>0?LF(r,g):1,_=Math.max(0,v.opacity*(1-.6*v.cornerRadius)),$=(I==null?void 0:I.autoZoom)!==!1,j=u==="contain"&&a!==void 0,L=$&&!j?1+(T-1)*_:1,M=(I==null?void 0:I.scale)??1,O=(I==null?void 0:I.dx)??0,Z=(I==null?void 0:I.dy)??0,D=[O!==0||Z!==0?`translate(${O}px, ${Z}px)`:"",L*M!==1?`scale(${L*M})`:""].filter(Boolean).join(" ")||void 0;return d.jsxs(pn,{children:[d.jsx(pn,{style:{background:t.bg,opacity:w}}),d.jsxs("div",{"data-edit-video":E==null?void 0:E.id,style:{position:"absolute",left:`${v.rect.x*100}%`,top:`${v.rect.y*100}%`,width:x,height:b,borderRadius:k,overflow:"hidden",opacity:v.opacity,backgroundColor:j?t.bg:void 0,boxShadow:v.cornerRadius>.5?"0 18px 60px rgba(0,0,0,0.55)":void 0},children:[d.jsx("div",{style:{position:"absolute",inset:0,filter:v.blurPx>.5?`blur(${v.blurPx}px)`:void 0,transform:D,transformOrigin:"50% 40%","--ossclip-obj-y":`${v.objectPosY*100}%`,"--ossclip-obj-x":`${v.objectPosX*100}%`},children:j?d.jsx(x4,{source:a,slot:{width:x,height:b},children:f}):d.jsx(b4,{timeline:i,spans:s,sourceSize:a,mode:l,tSec:g,slot:{width:x,height:b},posX:v.objectPosX,posY:v.objectPosY,children:f})}),d.jsx("div",{style:{position:"absolute",inset:0,background:"black",opacity:v.dim}})]})]})},x4=({source:e,slot:t,children:n})=>{const r=h4(e,t);return d.jsx("div",{style:{position:"absolute",width:r.width,height:r.height,left:r.left,top:r.top},children:n})},b4=({timeline:e,spans:t,sourceSize:n,mode:r,tSec:o,slot:i,posX:s,posY:a,children:l})=>{const u=d.jsx("div",{style:{position:"absolute",inset:0},children:l});if(!e||e.length<2||!n)return u;const f=y4(e,t??[],o,n);if(f.full)return u;const p=v4(r,n,f,i,s,a);return d.jsx("div",{style:{position:"absolute",width:p.width,height:p.height,left:p.left,top:p.top},children:l})},sp=.94,S4=new Set(["FlowDiagram","StrikethroughReveal","ChatMock","BulletList"]),Oh=2.4,oa=.45,ru=.58,mt=.72,E4=.62;function oo(e,t,n,r,o){const i=Math.max(1,Math.floor(n/Math.max(1,o*t)));return Math.max(1,Math.ceil(e/i))*t*r}const $e=e=>typeof e=="string"?e:"",Jn=e=>Array.isArray(e)?e:[];function k4(e,t,n,r=1/0){switch(e){case"TitleCard":{const o=n-80,i=$e(t.emphasis),s=28;let a=0,l=0;$e(t.eyebrow)&&(a+=34*1.2,l++),i&&(a+=210*.95,l++);const u=i?64:96;return a+=oo($e(t.title).length,u,o,1.05,mt),l++,$e(t.sub)&&(a+=oo($e(t.sub).length,40,o,1.2,ru),l++),a+s*Math.max(0,l-1)}case"StatCard":{const o=oo($e(t.label).length,42,n*.55,1.15,mt);let i=88+Math.max(o,110*1.15)+4;return $e(t.caption)&&(i+=30+(38*1.2+32+4)),i}case"RuleCard":{const o=n-60-96;let i=80;return i+=30*1.2+14,i+=oo($e(t.text).length,72,o,1.02,mt),$e(t.struck)&&(i+=26+oo($e(t.struck).length,44,o,1.2,mt)),i}case"StrikethroughReveal":{const o=Jn(t.lines).map(a=>$e(a==null?void 0:a.text)),i=ax(o,n,r),s=o.reduce((a,l)=>a+sx(l,i,n).length,0);return s*i*1.08+i*.2*Math.max(0,s-1)}case"FlowDiagram":{const o=Jn(t.nodes).map(l=>$e(l)),i=Math.max(1,o.length),{mode:s,fontSize:a}=mx(o,n,r);return s==="row"?a*$i+4:a*($i*i+px*(i-1))}case"TerminalMock":{const o=Jn(t.windows);let i=0;for(const s of o){const a=Jn(s==null?void 0:s.lines);i+=56.8+2,i+=Math.max(1,a.length)*27*1.2+8*Math.max(0,a.length-1)+36,i+=4}return i+=22*Math.max(0,o.length-1),$e(t.fanOut)&&(i+=22+40*1.2),i}case"ChatMock":{const o=dx(t).map(s=>s.text),i=fx(o,{widthPx:n,heightPx:r});return cx(o,i,n)}case"ScreenshotFrame":{const o=n*.94;return($e(t.src)?o*9/16:480)+4}case"BulletList":{const o=Jn(t.items).map(s=>$e(s)),i=ix(o,n,r,!!$e(t.title),$e(t.title));return _4(o.length,i,!!$e(t.title))}}}const Yn=e=>$e(e).split(/\s+/).reduce((t,n)=>Math.max(t,n.length),0);function C4(e,t){switch(e){case"RuleCard":{const n=Yn(t.kicker)*30*(mt+.28),r=Yn(t.text)*72*mt,o=Yn(t.struck)*44*(mt+.04),i=Math.max(n,r,o);return i>0?156+i:0}case"TitleCard":{const n=$e(t.emphasis)?64:96,r=Yn(t.eyebrow)*34*(mt+.35),o=Yn(t.emphasis)*210*mt,i=Yn(t.title)*n*(mt+.02),s=Yn(t.sub)*40*ru,a=Math.max(r,o,i,s);return a>0?80+a:0}case"TerminalMock":{let n=0;for(const r of Jn(t.windows))for(const o of Jn(r==null?void 0:r.lines))n=Math.max(n,$e(o).length);return n>0?108+n*27*E4:0}case"StatCard":{const n=$e(t.value).length*110*mt;return n===0?0:164+Yn(t.label)*42*mt+40+n}default:return 0}}const Vh=36,I4=120,rx=1.6,ox=.88,T4=(mt+.28)*.36,R4=1.1;function _4(e,t,n){return(Math.max(1,e)*rx+(n?ox:0))*t}function ix(e,t=831,n=1/0,r=!1,o=""){const i=e.reduce((l,u)=>Math.max(l,u.length),0);if(i===0)return Vh;const s=Math.min(t/(i*mt+R4),o?t/(o.length*T4):1/0),a=n*sp/(Math.max(1,e.length)*rx+(r?ox:0));return Math.max(Vh,Math.min(I4,Math.floor(Math.min(s,a))))}const P4=92,F4=44,j4=150,M4=[" → "," -> "," → "," > "];function sx(e,t,n){const r=o=>o.length*t*mt<=n;if(r(e))return[e];for(const o of M4){if(!e.includes(o))continue;const s=e.split(o).map((a,l)=>l===0?a:`${o.trim()} ${a}`.trim());if(s.every(r))return s}return[e]}function ax(e,t=831,n=1/0){const r=e.reduce((s,a)=>Math.max(s,a.length),0);if(r===0)return P4;const o=t/(r*mt),i=n/(Math.max(1,e.length)*1.28);return Math.max(F4,Math.min(j4,Math.floor(Math.min(o,i))))}const Bh=22,Wh=44,$4=96,Uh=22,lx=.85,ux=.82;function cx(e,t,n){const o=(n-80)*ux-2*t*lx;let i=0;for(const s of e)i+=oo(s.length,t,o,1.2,ru)+t*1.2+4;return i+t*.5*Math.max(0,e.length-1)}function dx(e){const t=$e(e.keyword);return t?[{from:"user",text:`"${t.toUpperCase()}"`}]:Jn(e.messages).map(n=>{const r=n??{};return{from:r.from==="agent"?"agent":"user",text:$e(r.text)}})}function fx(e,t={}){const n=t.widthPx??831,r=t.heightPx??1/0,o=n-80,i=e.reduce((p,m)=>Math.max(p,m.length),0);if(i===0)return Wh;const s=e.flatMap(p=>p.split(/\s+/)).reduce((p,m)=>Math.max(p,m.length),0),a=p=>o*ux/(p*ru+2*lx),l=Math.min(i,Uh),u=i>Uh?Wh:$4;let f=Math.floor(Math.min(a(l),a(s),u));for(;f>Bh&&cx(e,f,n)>r*sp;)f-=1;return Math.max(Bh,f)}const Hh=26,A4=22,N4=76,$i=2.1,px=2.05;function mx(e,t,n=1/0){const r=e.reduce((g,S)=>g+S.length,0),o=Math.max(1,e.length),i=.78,s=1.6,a=1.8,l=t-20,u=Math.floor(Math.min(l/(i*r+s*o+a*(o-1)),n/$i)),f=Math.max(...e.map(g=>g.length),1),p=$i*o+px*(o-1),m=Math.floor(Math.min(l/(i*f+s),n/p,N4)),h=u>=Hh;return m>=A4?h?u*$i>=m*p?{mode:"row",fontSize:u}:{mode:"stack",fontSize:m}:{mode:"stack",fontSize:m}:{mode:"row",fontSize:Math.max(Hh,u)}}function L4(e,t,n){if(S4.has(e))return 1;const r=n.heightPx*sp,o=u=>k4(e,t,n.widthPx/u)*u<=r;if(!o(oa))return oa;const i=C4(e,t),s=i>0?n.widthPx/i:Oh;let a=oa,l=Math.max(oa,Math.min(Oh,s));if(l<=a)return a;for(let u=0;u<24;u++){const f=(a+l)/2;o(f)?a=f:l=f}return a}function ot(e=0){const t=ct(),{fps:n}=Xe();return sd({frame:t-e,fps:n,config:{damping:200,stiffness:130},durationInFrames:Math.round(n*.5)})}function Sn(e,t=26){return{opacity:e,transform:`translateY(${(1-e)*t}px)`}}function Or(e){return{opacity:e,transform:`scale(${.9+.1*e})`}}function z4(e,t){return!e||t===1?e:Object.fromEntries(Object.entries(e).map(([n,r])=>[n,{...r,...r.dx!==void 0?{dx:r.dx/t}:{},...r.dy!==void 0?{dy:r.dy/t}:{}}]))}function Je(e,t){const n=e==null?void 0:e[t];if(!n)return{};if(n.hidden)return{display:"none"};const r=[`translate(${n.dx??0}px, ${n.dy??0}px)`];return n.scale!==void 0&&n.scale!==1&&r.push(`scale(${n.scale})`),{transform:r.join(" ")}}const D4=({props:e,theme:t,edits:n})=>{var l;const r=ot(0),o=ot(5),i=ot(10),s=(l=e.emphasis)==null?void 0:l.trim(),a=!!s&&s.toLowerCase().includes(e.title.trim().toLowerCase());return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:28,textAlign:"center",fontFamily:t.fontDisplay,color:t.fg,padding:"0 40px"},children:[e.eyebrow?d.jsx("div",{"data-edit-id":"eyebrow",style:{...Sn(r),fontSize:34,fontWeight:700,letterSpacing:"0.35em",color:t.muted,textTransform:"uppercase",...Je(n,"eyebrow")},children:e.eyebrow}):null,s?d.jsx("div",{"data-edit-id":"emphasis",style:{...Sn(o,40),fontSize:210,fontWeight:900,lineHeight:.95,...Je(n,"emphasis")},children:s}):null,a?null:d.jsx("div",{"data-edit-id":"title",style:{...Sn(s?i:o,34),fontSize:s?64:96,fontWeight:900,lineHeight:1.05,textTransform:"uppercase",letterSpacing:"0.02em",...Je(n,"title")},children:e.title}),e.sub?d.jsx("div",{"data-edit-id":"sub",style:{...Sn(i),fontSize:40,fontWeight:600,color:t.muted,...Je(n,"sub")},children:e.sub}):null]})},O4=({props:e,theme:t,edits:n})=>{const r=ot(0),o=ot(6),i=e.inverted;return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:30,fontFamily:t.fontDisplay,width:"100%",padding:"0 30px"},children:[d.jsxs("div",{style:{...Or(r),display:"flex",alignItems:"center",justifyContent:"space-between",gap:40,width:"100%",background:i?t.fg:t.cardBg,color:i?t.bg:t.fg,border:`2px solid ${i?t.fg:t.cardBorder}`,borderRadius:t.radiusPx,padding:"44px 52px"},children:[d.jsx("div",{"data-edit-id":"label",style:{fontSize:42,fontWeight:800,textTransform:"uppercase",letterSpacing:"0.06em",lineHeight:1.15,maxWidth:"55%",...Je(n,"label")},children:e.label}),d.jsx("div",{"data-edit-id":"value",style:{fontSize:110,fontWeight:900,whiteSpace:"nowrap",...Je(n,"value")},children:e.value})]}),e.caption?d.jsx("div",{"data-edit-id":"caption",style:{...Sn(o),fontSize:38,fontWeight:800,color:t.fg,background:t.cardBg,border:`2px solid ${t.cardBorder}`,borderRadius:t.radiusPx/2,padding:"16px 30px",textTransform:"uppercase",letterSpacing:"0.08em",...Je(n,"caption")},children:e.caption}):null]})},V4=({props:e,theme:t,edits:n})=>{const r=ot(0),o=ot(8);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:26,fontFamily:t.fontDisplay,width:"100%",padding:"0 30px"},children:[d.jsxs("div",{style:{...Or(r),width:"100%",background:t.fg,color:t.bg,borderRadius:t.radiusPx,padding:"40px 48px",textAlign:"left"},children:[d.jsx("div",{"data-edit-id":"kicker",style:{fontSize:30,fontWeight:800,letterSpacing:"0.28em",textTransform:"uppercase",color:"#55555E",marginBottom:14,fontFamily:t.fontMono,...Je(n,"kicker")},children:e.kicker}),d.jsx("div",{"data-edit-id":"text",style:{fontSize:72,fontWeight:900,lineHeight:1.02,textTransform:"uppercase",...Je(n,"text")},children:e.text})]}),e.struck?d.jsx("div",{"data-edit-id":"struck",style:{...Sn(o),fontSize:44,fontWeight:800,color:t.muted,textDecoration:"line-through",textDecorationThickness:6,textDecorationColor:t.danger,textTransform:"uppercase",letterSpacing:"0.04em",...Je(n,"struck")},children:e.struck}):null]})},B4=({text:e,struck:t,mark:n,delay:r,fontSize:o,theme:i,editId:s,edits:a})=>{const l=ot(r),u=ot(r+8);return d.jsxs("div",{"data-edit-id":s,style:{...Sn(l,30),position:"relative",display:"inline-block",...Je(a,s)},children:[d.jsxs("span",{style:{fontSize:o,fontWeight:900,textTransform:"uppercase",lineHeight:1.08,whiteSpace:"nowrap",color:t?i.muted:i.fg},children:[n!=="none"?d.jsx("span",{style:{color:n==="cross"?i.danger:i.success,marginRight:"0.3em"},children:n==="cross"?"✗":"✓"}):null,e]}),t?d.jsx("div",{style:{position:"absolute",left:"-2%",top:"50%",height:o*.11,width:`${u*104}%`,background:i.danger,borderRadius:o*.055,transform:"translateY(-50%) rotate(-2deg)"}}):null]})},W4=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const i=e.lines.map(l=>(l.mark??"none")!=="none"?`✗ ${l.text}`:l.text),s=ax(i,n,r),a=e.lines.flatMap((l,u)=>sx(l.text,s,n??831).map((f,p)=>({text:f,struck:l.struck,mark:p===0?l.mark??"none":"none",lineIndex:u})));return d.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:s*.2,textAlign:"center",fontFamily:t.fontDisplay},children:a.map((l,u)=>d.jsx(B4,{text:l.text,struck:l.struck,mark:l.mark,delay:u*6,fontSize:s,theme:t,editId:`line-${l.lineIndex}`,edits:o},u))})},U4=({text:e,emphasized:t,delay:n,fontSize:r,theme:o,editId:i,edits:s})=>{const a=ot(n);return d.jsx("div",{"data-edit-id":i,style:{...Or(a),background:t?o.fg:o.cardBg,color:t?o.bg:o.fg,border:`2px solid ${t?o.fg:o.cardBorder}`,borderRadius:o.radiusPx/2,padding:`${r*.55}px ${r*.8}px`,fontSize:r,fontWeight:900,textTransform:"uppercase",letterSpacing:"0.04em",whiteSpace:"nowrap",fontFamily:o.fontDisplay,...Je(s,i)},children:e})},H4=({delay:e,fontSize:t,theme:n,down:r=!1})=>{const o=ot(e);return d.jsx("div",{style:{opacity:o,color:n.muted,fontSize:t*1.15,fontWeight:700,lineHeight:1,paddingLeft:r?0:t*.55},children:r?"↓":"→"})};function Z4(e,t=Y4,n){return mx(e,t,n)}const Y4=864,K4=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const{mode:i,fontSize:s}=Z4(e.nodes,n,r),a=i==="row";return d.jsx("div",{style:{display:"flex",flexDirection:a?"row":"column",flexWrap:"nowrap",alignItems:"center",justifyContent:"center",gap:a?0:s*.45,padding:"0 10px"},children:e.nodes.map((l,u)=>d.jsxs("div",{style:{display:"flex",flexDirection:a?"row":"column",alignItems:"center",gap:a?s*.55:s*.45},children:[u>0?d.jsx(H4,{delay:u*6+3,fontSize:s,theme:t,down:!a}):null,d.jsx(U4,{text:l,emphasized:e.emphasizeLast&&u===e.nodes.length-1,delay:u*6,fontSize:s,theme:t,editId:`node-${u}`,edits:o})]},u))})},X4=({title:e,lines:t,delay:n,theme:r,editId:o,edits:i})=>{const s=ot(n);return d.jsxs("div",{"data-edit-id":o,style:{...Or(s),background:r.cardBg,border:`2px solid ${r.cardBorder}`,borderRadius:r.radiusPx/2,overflow:"hidden",width:"100%",fontFamily:r.fontMono,...Je(i,o)},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 20px",borderBottom:`2px solid ${r.cardBorder}`},children:[["#FF5F57","#FEBC2E","#28C840"].map(a=>d.jsx("div",{style:{width:16,height:16,borderRadius:8,background:a}},a)),d.jsx("div",{style:{marginLeft:10,fontSize:24,color:r.muted},children:e})]}),d.jsx("div",{style:{padding:"18px 22px",display:"flex",flexDirection:"column",gap:8},children:t.map((a,l)=>d.jsx("div",{style:{fontSize:27,color:r.fg,whiteSpace:"pre"},children:a},l))})]})},G4=({props:e,theme:t,edits:n})=>{const r=ot(e.windows.length*6+4);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:22,width:"100%",padding:"0 30px"},children:[e.windows.map((o,i)=>d.jsx(X4,{title:o.title,lines:o.lines,delay:i*6,theme:t,editId:`window-${i}`,edits:n},i)),e.fanOut?d.jsxs("div",{"data-edit-id":"fanOut",style:{...Sn(r),fontFamily:t.fontDisplay,fontSize:40,fontWeight:900,letterSpacing:"0.2em",color:t.fg,textTransform:"uppercase",...Je(n,"fanOut")},children:["⌄ ",e.fanOut]}):null]})},q4=({from:e,text:t,delay:n,fontSize:r,theme:o,editId:i,edits:s})=>{const a=ot(n),l=e==="user";return d.jsx("div",{"data-edit-id":i,style:{...Or(a),alignSelf:l?"flex-end":"flex-start",background:l?o.fg:o.cardBg,color:l?o.bg:o.fg,border:`2px solid ${l?o.fg:o.cardBorder}`,borderRadius:28,[l?"borderBottomRightRadius":"borderBottomLeftRadius"]:8,padding:`${r*.6}px ${r*.85}px`,fontSize:r,fontWeight:700,maxWidth:"82%",fontFamily:o.fontDisplay,...Je(s,i)},children:t})},Q4=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const i=dx(e),s=fx(i.map(a=>a.text),{widthPx:n,heightPx:r});return d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:s*.5,width:"100%",padding:"0 40px"},children:i.map((a,l)=>d.jsx(q4,{from:a.from,text:a.text,delay:l*8,fontSize:s,theme:t,editId:`message-${l}`,edits:o},l))})},J4=({props:e,theme:t,edits:n})=>{const r=ot(0),o=ot(8),i=ct(),{fps:s}=Xe(),a=e.kenBurns?Ko(i,[0,s*8],[1,1.08],{extrapolateRight:"clamp"}):1,l=e.src?/^https?:\/\//.test(e.src)?e.src:mw(e.src):null;return d.jsxs("div",{"data-edit-id":"image",style:{...Or(r),position:"relative",width:"94%",...Je(n,"image")},children:[d.jsx("div",{style:{overflow:"hidden",borderRadius:t.radiusPx/2,border:`2px solid ${t.cardBorder}`,background:t.cardBg,boxShadow:"0 24px 80px rgba(0,0,0,0.5)"},children:l?d.jsx(Bf,{src:l,style:{width:"100%",display:"block",transform:`scale(${a})`}}):d.jsx("div",{style:{height:420,display:"flex",flexDirection:"column",gap:14,padding:30,transform:`scale(${a})`},children:[.9,.75,.85,.6,.8,.5].map((u,f)=>d.jsx("div",{style:{height:22,width:`${u*100}%`,borderRadius:6,background:f%3===0?t.cardBorder:"#22222B"}},f))})}),e.label?d.jsx("div",{"data-edit-id":"label",style:{...Or(o),position:"absolute",right:-8,bottom:-20,background:t.fg,color:t.bg,fontFamily:t.fontMono,fontSize:28,fontWeight:800,letterSpacing:"0.08em",padding:"12px 22px",borderRadius:10,textTransform:"uppercase",...Je(n,"label")},children:e.label}):null]})},ej=({text:e,index:t,fontSize:n,theme:r,edits:o})=>{const i=`item-${t}`,s=ot(t*7);return d.jsxs("div",{"data-edit-id":i,style:{...Sn(s,26),display:"flex",alignItems:"baseline",gap:n*.35,...Je(o,i)},children:[d.jsx("span",{style:{fontSize:n*.75,color:r.accent,fontWeight:900},children:"▸"}),d.jsx("span",{style:{fontSize:n,fontWeight:900,textTransform:"uppercase",lineHeight:1.15,whiteSpace:"nowrap",color:r.fg},children:e})]})},tj=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const i=ix(e.items,n,r,!!e.title,e.title),s=ot(0);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:i*.45,fontFamily:t.fontDisplay},children:[e.title?d.jsx("div",{"data-edit-id":"title",style:{...Sn(s,20),fontSize:i*.36,fontWeight:700,letterSpacing:"0.28em",textTransform:"uppercase",color:t.muted,...Je(o,"title")},children:e.title}):null,e.items.map((a,l)=>d.jsx(ej,{text:a,index:l,fontSize:i,theme:t,edits:o},l))]})},nj={TitleCard:D4,StatCard:O4,RuleCard:V4,StrikethroughReveal:W4,FlowDiagram:K4,TerminalMock:G4,ChatMock:Q4,ScreenshotFrame:J4,BulletList:tj},rj=new Set(["lower-third","full-bleed"]),oj=.55,ij=e=>{const t=/^#([0-9a-fA-F]{6})$/.exec(e.trim()),[n,r,o]=t?[0,2,4].map(i=>Number.parseInt(t[1].slice(i,i+2),16)):[0,0,0];return`rgba(${n}, ${r}, ${o}, ${oj})`},sj=e=>({width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",opacity:e,transform:e<1?`translateY(${(1-e)*18}px)`:void 0}),aj=({durationInFrames:e,children:t})=>{const n=ct(),{fps:r}=Xe(),{exitSec:o}=tx(e/r),i=(e-n)/r,s=o<=0?1:Math.min(1,Math.max(0,i/o));return d.jsx("div",{style:sj(ip(s)),children:t})},lj=({durationInFrames:e,themeBg:t,radiusPx:n})=>{const r=ct(),{fps:o}=Xe(),{enterSec:i}=tx(e/o),s=i<=0?1:Math.min(1,Math.max(0,r/o/i)),a=ip(s);return d.jsx("div",{style:{position:"absolute",inset:0,background:ij(t),backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",borderRadius:n,opacity:a,transform:a<1?`translateY(${(1-a)*18}px)`:void 0}})},uj=({cues:e,theme:t})=>{const{fps:n,width:r,height:o}=Xe();return d.jsx(pn,{style:{pointerEvents:"none"},children:e.map(i=>{if(i.kind==="plain"||!i.component||!i.props)return null;const s=Qw(i,{width:r,height:o}),a=nj[i.component],{from:l,durationInFrames:u}=qf(i.startSec,i.endSec,n),f=s.w*r,p=s.h*o,m=rj.has(i.layout),h=m?Math.min(24,Math.round(p*.12)):0,y=f-h*2,g=p-h*2,S=L4(i.component,i.props,{widthPx:y,heightPx:g});return d.jsx(dt,{from:l,durationInFrames:u,children:d.jsx("div",{"data-edit-scene":i.id,style:{position:"absolute",left:`${s.x*100}%`,top:`${s.y*100}%`,width:`${s.w*100}%`,height:`${s.h*100}%`,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"auto",overflow:"hidden"},children:d.jsxs(aj,{durationInFrames:u,children:[m?d.jsx(lj,{durationInFrames:u,themeBg:t.bg,radiusPx:t.radiusPx}):null,d.jsx("div",{style:{width:y/S,transform:`scale(${S})`,position:"relative"},children:d.jsx(a,{props:i.props,theme:t,widthPx:y/S,heightPx:g/S,edits:z4(i.elements,S)})})]})})},i.id)})})},cj="made with ossclip",dj=.45,fj=.024;function pj(e=$t){const t=wn(e);return{xPx:Math.round(t.left*e.width),yPx:Math.round(t.top*e.height),fontPx:Math.round(Math.min(e.width,e.height)*fj),opacity:dj,text:cj}}function mj(e){return e===!0}const hj=({theme:e,frame:t})=>{const n=pj(t);return d.jsx("div",{style:{position:"absolute",left:n.xPx,top:n.yPx,fontFamily:e.fontDisplay,fontSize:n.fontPx,fontWeight:600,letterSpacing:"0.02em",color:e.fg,opacity:n.opacity,pointerEvents:"none",whiteSpace:"nowrap"},children:n.text})};function gj(e){return e!==!0}const vj=({videoFileName:e,spans:t,captionLines:n,sceneCues:r,theme:o,settings:i,face:s,zoomPlan:a,ctaKeyword:l,ctaWindow:u,sourceTextRegions:f,contentTimeline:p,sourceSize:m,contentCropMode:h,sourceFit:y,watermark:g,captionsHidden:S})=>{if(!e)return d.jsx(pn,{style:{backgroundColor:"#111",color:"#888",alignItems:"center",justifyContent:"center",fontFamily:"monospace",fontSize:40},children:"no production loaded"});const v=/^https?:\/\//.test(e)?e:mw(e);return d.jsxs(pn,{style:{backgroundColor:"black"},children:[d.jsx(w4,{cues:r,theme:o,face:s,zoomPlan:a,sourceTextRegions:f,contentTimeline:p,spans:t,sourceSize:m,contentCropMode:h,sourceFit:y,children:d.jsx(dT,{src:v,spans:t,...y==="contain"?{punchInScale:1,background:"transparent"}:{}})}),d.jsx(uj,{cues:r,theme:o}),gj(S)?d.jsx(p4,{lines:n,cues:r,activeColor:o.accent,ctaKeyword:l,ctaWindow:u,sourceTextRegions:f}):null,mj(g)?d.jsx(hj,{theme:o,frame:{width:i.width,height:i.height}}):null]})},yj=600,wj=()=>({doc:SF(),past:[],future:[],dirty:!1,savedAt:0,lastCoalesce:null}),vn=(e,t)=>e.scenes[t]??{props:{},elements:{}};function xj(e,t){var r;const n=(o,i)=>{const s=Date.now(),a=i!==void 0&&e.lastCoalesce!==null&&e.lastCoalesce.key===i&&s-e.lastCoalesce.at<yj;return{doc:o,past:a?e.past:[...e.past,e.doc],future:[],dirty:!0,savedAt:e.savedAt,lastCoalesce:i!==void 0?{key:i,at:s}:null}};switch(t.type){case"load":return{doc:t.doc,past:[],future:[],dirty:!1,savedAt:0,lastCoalesce:null};case"patchProps":{const o=vn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,props:{...o.props,...t.patch}}}},t.coalesce)}case"patchElement":return n(Ah(e.doc,t.sceneId,t.elementId,t.patch),t.coalesce);case"clearElement":return n(RF(e.doc,t.sceneId,t.elementId));case"hideElement":return n(Ah(e.doc,t.sceneId,t.elementId,{hidden:!0}));case"restoreElement":{const o=(r=e.doc.scenes[t.sceneId])==null?void 0:r.elements[t.elementId];return o!=null&&o.hidden?n(_F(e.doc,t.sceneId,t.elementId)):e}case"patchTiming":{const o=vn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,timing:{startSec:t.startSec,endSec:t.endSec}}}})}case"clearTiming":return n(PF(e.doc,t.sceneId));case"patchVideo":{const o=vn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,video:{...o.video,...t.patch}}}},t.coalesce)}case"clearVideo":{const o=e.doc.scenes[t.sceneId];if(!(o!=null&&o.video))return e;const{video:i,...s}=o;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:s}})}case"patchPip":{const o=vn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,pip:{...o.pip,...t.patch}}}},t.coalesce)}case"clearPip":{const o=e.doc.scenes[t.sceneId];if(!(o!=null&&o.pip))return e;const{pip:i,...s}=o;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:s}})}case"patchCaptionY":{const o=vn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,captionY:t.y}}},t.coalesce)}case"patchCaptionScale":{const o=vn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,captionScale:t.scale}}},t.coalesce)}case"clearCaptionStyle":{const o=e.doc.scenes[t.sceneId];if((o==null?void 0:o.captionY)===void 0&&(o==null?void 0:o.captionScale)===void 0)return e;const{captionY:i,captionScale:s,...a}=o;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:a}})}case"patchCaptionStyleAll":{const o={...e.doc.scenes};for(const i of t.sceneIds){const s=o[i]??{props:{},elements:{}};o[i]={...s,...t.y!==void 0?{captionY:t.y}:{},...t.scale!==void 0?{captionScale:t.scale}:{}}}return n({...e.doc,scenes:o})}case"addSplit":return e.doc.splits.some(o=>Math.abs(o-t.t)<.001)?e:n({...e.doc,splits:[...e.doc.splits,t.t].sort((o,i)=>o-i)});case"setCaptionsHidden":{if(t.hidden===(e.doc.captionsHidden===!0))return e;if(t.hidden)return n({...e.doc,captionsHidden:!0});const{captionsHidden:o,...i}=e.doc;return n(i)}case"hideScene":{const o=vn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,hidden:!0}}})}case"restoreScene":{const o=e.doc.scenes[t.sceneId];if(!(o!=null&&o.hidden))return e;const{hidden:i,...s}=o;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:s}})}case"cutChunk":{const o=e.doc.cuts.filter(i=>i.src!==void 0||i.startSec!==t.startSec||i.endSec!==t.endSec);return n({...e.doc,cuts:[...o,{startSec:t.startSec,endSec:t.endSec}]})}case"restoreChunk":{if(t.index<0||t.index>=e.doc.cuts.length)return e;const o=e.doc.cuts.filter((i,s)=>s!==t.index);return n({...e.doc,cuts:o})}case"patchComponent":{const o=vn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,component:t.component}}})}case"patchLayout":{const{graphicRect:o,...i}=vn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...i,layout:t.layout}}})}case"patchGraphicRect":{const o=vn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,graphicRect:t.rect}}},t.coalesce)}case"clearGraphicRect":return n(FF(e.doc,t.sceneId));case"patchCaption":{const o=String(t.index),i=xF(e.doc.captions,t.index,t.was);if(t.text===i){const{[o]:s,...a}=e.doc.captions;return n({...e.doc,captions:a})}return n({...e.doc,captions:{...e.doc.captions,[o]:{text:t.text,was:i}}})}case"patchTheme":return n({...e.doc,theme:{...e.doc.theme,...t.patch}});case"undo":{if(e.past.length===0)return e;const o=e.past[e.past.length-1],i=e.past.slice(0,-1);return{doc:o,past:i,future:[...e.future,e.doc],savedAt:e.savedAt,dirty:i.length!==e.savedAt,lastCoalesce:null}}case"redo":{if(e.future.length===0)return e;const o=e.future[e.future.length-1],i=[...e.past,e.doc];return{doc:o,past:i,future:e.future.slice(0,-1),savedAt:e.savedAt,dirty:i.length!==e.savedAt,lastCoalesce:null}}case"saved":return{...e,dirty:!1,savedAt:e.past.length}}}function bj(){const[e,t]=c.useReducer(xj,void 0,wj),n=async()=>{const r=await fetch("/api/overrides",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e.doc)});if(!r.ok){const o=await r.json().catch(()=>({}));throw new Error(o.error??"save failed")}t({type:"saved"})};return{doc:e.doc,dirty:e.dirty,canUndo:e.past.length>0,canRedo:e.future.length>0,load:r=>t({type:"load",doc:r}),undo:()=>t({type:"undo"}),redo:()=>t({type:"redo"}),save:n,patchProps:(r,o,i)=>t({type:"patchProps",sceneId:r,patch:o,coalesce:i}),patchElement:(r,o,i,s)=>t({type:"patchElement",sceneId:r,elementId:o,patch:i,coalesce:s}),clearElement:(r,o)=>t({type:"clearElement",sceneId:r,elementId:o}),hideElement:(r,o)=>t({type:"hideElement",sceneId:r,elementId:o}),restoreElement:(r,o)=>t({type:"restoreElement",sceneId:r,elementId:o}),patchTiming:(r,o,i)=>t({type:"patchTiming",sceneId:r,startSec:o,endSec:i}),clearTiming:r=>t({type:"clearTiming",sceneId:r}),patchVideo:(r,o,i)=>t({type:"patchVideo",sceneId:r,patch:o,coalesce:i}),clearVideo:r=>t({type:"clearVideo",sceneId:r}),patchPip:(r,o,i)=>t({type:"patchPip",sceneId:r,patch:o,coalesce:i}),clearPip:r=>t({type:"clearPip",sceneId:r}),patchCaptionY:(r,o,i)=>t({type:"patchCaptionY",sceneId:r,y:o,coalesce:i}),patchCaptionScale:(r,o,i)=>t({type:"patchCaptionScale",sceneId:r,scale:o,coalesce:i}),clearCaptionStyle:r=>t({type:"clearCaptionStyle",sceneId:r}),patchCaptionStyleAll:(r,o)=>t({type:"patchCaptionStyleAll",sceneIds:r,...o}),addSplit:r=>t({type:"addSplit",t:r}),setCaptionsHidden:r=>t({type:"setCaptionsHidden",hidden:r}),hideScene:r=>t({type:"hideScene",sceneId:r}),restoreScene:r=>t({type:"restoreScene",sceneId:r}),cutChunk:(r,o)=>t({type:"cutChunk",startSec:r,endSec:o}),restoreChunk:r=>t({type:"restoreChunk",index:r}),patchGraphicRect:(r,o,i)=>t({type:"patchGraphicRect",sceneId:r,rect:o,coalesce:i}),clearGraphicRect:r=>t({type:"clearGraphicRect",sceneId:r}),patchComponent:(r,o)=>t({type:"patchComponent",sceneId:r,component:o}),patchLayout:(r,o)=>t({type:"patchLayout",sceneId:r,layout:o}),patchCaption:(r,o,i)=>t({type:"patchCaption",index:r,text:o,was:i}),patchTheme:r=>t({type:"patchTheme",patch:r})}}function Zh(e){const t=e==null?void 0:e.closest("[data-edit-id]");if(!t)return null;const n=t.closest("[data-edit-scene]");return n?{sceneId:n.dataset.editScene,elementId:t.dataset.editId}:null}function Yh(e){const t=e==null?void 0:e.closest("[data-edit-video]");return(t==null?void 0:t.dataset.editVideo)||null}function Kh(e,t,n){const r=e.querySelectorAll(`[data-edit-scene="${t}"] [data-edit-id="${n}"]`);if(r.length===0)return null;let o=1/0,i=1/0,s=-1/0,a=-1/0;return r.forEach(l=>{const u=l.getBoundingClientRect();o=Math.min(o,u.left),i=Math.min(i,u.top),s=Math.max(s,u.right),a=Math.max(a,u.bottom)}),new DOMRect(o,i,s-o,a-i)}const Xh=.015,Sj=1e-9;function no(e,t){let n=null,r=1/0;for(const o of e){const i=Math.abs(o.feature-o.target);i<=t+Sj&&i<r&&(n=o,r=i)}return n}function Gh(e,t,n,r){const o={...e},i=[];if(t==="move"){const s=e.x+e.w/2,a=e.x+e.w,l=.5-e.w/2,u=l>=n.left&&l+e.w<=1-n.right,f=no([...u?[{target:.5,feature:s}]:[],{target:n.left,feature:e.x},{target:1-n.right,feature:a}],r);f&&(o.x=e.x+(f.target-f.feature),i.push({axis:"x",at:f.target}));const p=e.y+e.h/2,m=e.y+e.h,h=.5-e.h/2,y=h>=n.top&&h+e.h<=1-n.bottom,g=no([...y?[{target:.5,feature:p}]:[],{target:n.top,feature:e.y},{target:1-n.bottom,feature:m}],r);return g&&(o.y=e.y+(g.target-g.feature),i.push({axis:"y",at:g.target})),{rect:o,guides:i}}if(t.includes("w")){const s=no([{target:n.left,feature:e.x}],r);if(s){const a=e.x+e.w;o.x=s.target,o.w=a-s.target,i.push({axis:"x",at:s.target})}}else if(t.includes("e")){const s=1-n.right,a=no([{target:s,feature:e.x+e.w}],r);a&&(o.w=a.target-e.x,i.push({axis:"x",at:a.target}))}if(t.includes("n")){const s=no([{target:n.top,feature:e.y}],r);if(s){const a=e.y+e.h;o.y=s.target,o.h=a-s.target,i.push({axis:"y",at:s.target})}}else if(t.includes("s")){const s=1-n.bottom,a=no([{target:s,feature:e.y+e.h}],r);a&&(o.h=a.target-e.y,i.push({axis:"y",at:a.target}))}return{rect:o,guides:i}}function qh(e,t,n,r){const o={...e};return t==="move"?(o.x+=n,o.y+=r,o):(t.includes("w")&&(o.x+=n,o.w-=n),t.includes("e")&&(o.w+=n),t.includes("n")&&(o.y+=r,o.h-=r),t.includes("s")&&(o.h+=r),o)}const Qh=64,ia=9,sa=e=>Math.round(e*10)/10,ro=e=>Math.round(e*1e4)/1e4,hx={position:"absolute",width:10,height:10,background:"#5b8cff",border:"1px solid #0B0B0E",borderRadius:2,pointerEvents:"auto",zIndex:6},Jh={nw:{left:0,top:0,transform:"translate(-50%,-50%)",cursor:"nwse-resize"},n:{left:"50%",top:0,transform:"translate(-50%,-50%)",cursor:"ns-resize"},ne:{right:0,top:0,transform:"translate(50%,-50%)",cursor:"nesw-resize"},e:{right:0,top:"50%",transform:"translate(50%,-50%)",cursor:"ew-resize"},se:{right:0,bottom:0,transform:"translate(50%,50%)",cursor:"nwse-resize"},s:{left:"50%",bottom:0,transform:"translate(-50%,50%)",cursor:"ns-resize"},sw:{left:0,bottom:0,transform:"translate(-50%,50%)",cursor:"nesw-resize"},w:{left:0,top:"50%",transform:"translate(-50%,-50%)",cursor:"ew-resize"}},Ej={...hx,background:"#ffe14d"},kj={top:{top:0,left:14,right:14,height:10},bottom:{bottom:0,left:14,right:14,height:10},left:{left:0,top:14,bottom:14,width:10},right:{right:0,top:14,bottom:14,width:10}},Cj={position:"absolute",cursor:"move",pointerEvents:"auto",zIndex:5},gx=/^(line|node|message|window|item)-(\d+)$/;function Ij(e,t,n){const r=gx.exec(e);if(!r||r[1]==="window")return null;const o=r[1],i=Number(r[2]);if(o==="message"&&i===0&&typeof t.keyword=="string"&&t.keyword){const f=n.trim().replace(/^"(.*)"$/,"$1").toLowerCase();return f?{keyword:f}:null}const s=o==="line"?"lines":o==="node"?"nodes":o==="item"?"items":"messages",a=t[s];if(!Array.isArray(a)||i<0||i>=a.length)return null;const l=a.slice(),u=l[i];if(o==="node"||o==="item")l[i]=n;else{if(typeof u!="object"||u===null)return null;l[i]={...u,text:n}}return{[s]:l}}function Tj(e,t){const n=gx.exec(e);if(!n){const u=t[e];return typeof u=="string"?u:null}if(n[1]==="window")return null;const r=n[1],o=Number(n[2]);if(r==="message"&&o===0&&typeof t.keyword=="string"&&t.keyword)return t.keyword;const s=t[r==="line"?"lines":r==="node"?"nodes":r==="item"?"items":"messages"];if(!Array.isArray(s)||o<0||o>=s.length)return null;const a=s[o];if(r==="node"||r==="item")return typeof a=="string"?a:null;const l=a==null?void 0:a.text;return typeof l=="string"?l:null}function vx(){const e=document.activeElement;(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&e.blur()}const Rj=({stageRef:e,selection:t,onSelect:n,edits:r,onSave:o,settings:i,playerRef:s,onTransport:a,onVideoPreview:l,onGraphicPreview:u,cue:f,cues:p,onToggleHelp:m})=>{const[h,y]=c.useState(null),g=c.useRef(null),S=c.useRef(0),v=c.useRef(null),w=c.useRef(0),x=c.useRef(null),b=c.useRef(0),k=c.useRef(null),[E,I]=c.useState(!1),[T,_]=c.useState([]),$=c.useRef(null),[j,L]=c.useState(null),[M,O]=c.useState(null),Z=c.useRef(null),[D,R]=c.useState({dx:0,dy:0}),C=c.useRef(null),F=c.useRef(t),P=c.useCallback(N=>{F.current=N,n(N)},[n]);c.useEffect(()=>{F.current=t},[t]);const V=(N,A)=>{const B=[];let H=null;for(let z=0;z<25;z++){const Y=document.elementFromPoint(N,A);if(!Y||Y===document.documentElement||Y===document.body){H=Y;break}if(H=Y,Y.hasAttribute("data-edit-id")||Y.hasAttribute("data-edit-scene")||Y.hasAttribute("data-caption-word")||Y.closest("[data-edit-video]")!==null||["BUTTON","INPUT","SELECT","TEXTAREA"].includes(Y.tagName)||!(Y instanceof HTMLElement))break;B.push({el:Y,prev:Y.style.pointerEvents}),Y.style.pointerEvents="none"}return B.forEach(({el:z,prev:Y})=>{z.style.pointerEvents=Y}),H},W=c.useCallback(()=>{var Y,oe;const N=e.current,A=(Y=s.current)==null?void 0:Y.getScale(),B=((oe=N==null?void 0:N.querySelector(".__remotion-player"))==null?void 0:oe.getBoundingClientRect())??(N==null?void 0:N.getBoundingClientRect());if(!B||!A||A<=0)return null;const H=i.width*A,z=i.height*A;return{left:B.left+(B.width-H)/2,top:B.top+(B.height-z)/2,w:H,h:z}},[e,s,i]);return c.useEffect(()=>{if(!t){y(null);return}let N;const A=()=>{var H;const B=e.current;if(B){const z=t.elementId?Kh(B,t.sceneId,t.elementId):((H=B.querySelector(`[data-edit-scene="${t.sceneId}"]`))==null?void 0:H.getBoundingClientRect())??null;y(z)}N=requestAnimationFrame(A)};return N=requestAnimationFrame(A),()=>cancelAnimationFrame(N)},[e,t]),c.useEffect(()=>{const N=A=>{var z,Y;const B=e.current;if(!B||!B.contains(A.target)||A.altKey||A.button!==0)return;(((z=F.current)==null?void 0:z.elementId)&&((Y=C.current)==null?void 0:Y.contains(A.target))||Zh(V(A.clientX,A.clientY))!==null)&&A.stopPropagation()};return window.addEventListener("pointerdown",N,!0),()=>window.removeEventListener("pointerdown",N,!0)},[e]),c.useEffect(()=>{const N=A=>{var se,G,ee,Q,q,he,Ce;const B=e.current;if(!B||!B.contains(A.target)||(vx(),A.altKey||A.button!==0))return;const H=A.target instanceof Element?A.target.closest("[data-el-handle]"):null,z=F.current;if(H&&(z!=null&&z.elementId)){const ve=Kh(B,z.sceneId,z.elementId);if(ve){const pe=ve.left+ve.width/2,Re=ve.top+ve.height/2,be=Math.hypot(A.clientX-pe,A.clientY-Re);if(be>2){const we=((G=(se=r.doc.scenes[z.sceneId])==null?void 0:se.elements[z.elementId])==null?void 0:G.scale)??1;$.current={sceneId:z.sceneId,elementId:z.elementId,cx:pe,cy:Re,startDist:be,prior:we,factor:1},L(1)}}return}if((ee=F.current)!=null&&ee.elementId&&((Q=C.current)!=null&&Q.contains(A.target))){Z.current={x:A.clientX,y:A.clientY,dx:0,dy:0},R({dx:0,dy:0});return}const Y=A.target instanceof Element?A.target.closest("[data-box-handle]"):null,oe=F.current;if(Y&&oe&&!oe.elementId){const ve=B.querySelector(`[data-edit-scene="${oe.sceneId}"]`),pe=W();if(ve&&pe){const Re=ve.getBoundingClientRect();k.current=null,x.current={sceneId:oe.sceneId,handle:Y.dataset.boxHandle,x:A.clientX,y:A.clientY,dx:0,dy:0,start:{x:(Re.left-pe.left)/pe.w,y:(Re.top-pe.top)/pe.h,w:Re.width/pe.w,h:Re.height/pe.h}},I(!0)}return}const ae=V(A.clientX,A.clientY),ce=Zh(ae);if(!ce){const ve=ae==null?void 0:ae.closest("[data-edit-scene]");if(ve){P({sceneId:ve.dataset.editScene,elementId:null});return}const pe=Yh(ae),Re=B.getBoundingClientRect().bottom;if(pe&&A.clientY<Re-Qh){P({sceneId:pe,elementId:null});const be=p.find(Pe=>Pe.id===pe);if((be==null?void 0:be.layout)==="pip-bubble"&&!A.altKey){const Pe=Dr("pip-bubble",void 0,[],i).video.rect;v.current={sceneId:pe,x:A.clientX,y:A.clientY,base:{x:((q=be.pip)==null?void 0:q.x)??Pe.x,y:((he=be.pip)==null?void 0:he.y)??Pe.y},slot:{w:Pe.w,h:Pe.h}};return}const we=(Ce=r.doc.scenes[pe])==null?void 0:Ce.video;g.current={sceneId:pe,x:A.clientX,y:A.clientY,dx:0,dy:0,baseDx:(we==null?void 0:we.dx)??0,baseDy:(we==null?void 0:we.dy)??0};return}P(null);return}P({sceneId:ce.sceneId,elementId:ce.elementId}),Z.current={x:A.clientX,y:A.clientY,dx:0,dy:0},R({dx:0,dy:0})};return window.addEventListener("mousedown",N),()=>window.removeEventListener("mousedown",N)},[e,P,r,W,p,i]),c.useEffect(()=>{const N=()=>{var Y,oe;const H=(Y=s.current)==null?void 0:Y.getScale(),z=(oe=e.current)==null?void 0:oe.getBoundingClientRect();return H&&H>0?1/H:z&&z.width>0?i.width/z.width:1},A=H=>{const z=e.current;if(z&&!(x.current||$.current))if(v.current)z.style.cursor="move";else if(g.current)z.style.cursor="grabbing";else{const G=H.target instanceof Element?H.target:null,ee=G!==null&&z.contains(G)&&!G.closest("button, input, select, textarea, [data-edit-id], [data-edit-scene], [data-caption-word]")&&H.clientY<z.getBoundingClientRect().bottom-Qh,Q=ee&&(()=>{var he;const q=Yh(G);return q!==null&&((he=p.find(Ce=>Ce.id===q))==null?void 0:he.layout)==="pip-bubble"})();z.style.cursor=ee?Q?"move":"grab":""}const Y=$.current;if(Y){const ee=Math.hypot(H.clientX-Y.cx,H.clientY-Y.cy)/Y.startDist;Y.factor=Math.min(4/Y.prior,Math.max(.05/Y.prior,ee)),L(Y.factor);return}const oe=x.current;if(oe){oe.dx=H.clientX-oe.x,oe.dy=H.clientY-oe.y,k.current=H.altKey,b.current||(b.current=requestAnimationFrame(()=>{b.current=0;const G=x.current,ee=W();if(!G||!ee)return;const Q=al(qh(G.start,G.handle,G.dx/ee.w,G.dy/ee.h),i);if(H.altKey)_([]),u({sceneId:G.sceneId,rect:Q});else{const q=Gh(Q,G.handle,wn(i),Xh);_(q.guides),u({sceneId:G.sceneId,rect:q.rect})}}));return}if(v.current){w.current||(w.current=requestAnimationFrame(()=>{w.current=0;const G=v.current,ee=W();if(!G||!ee)return;const Q=(H.clientX-G.x)/ee.w,q=(H.clientY-G.y)/ee.h;r.patchPip(G.sceneId,{x:ro(Math.min(Math.max(G.base.x+Q,0),1-G.slot.w)),y:ro(Math.min(Math.max(G.base.y+q,0),1-G.slot.h))},`pip:${G.sceneId}:drag`)}));return}const ce=g.current;if(ce){ce.dx=H.clientX-ce.x,ce.dy=H.clientY-ce.y,S.current||(S.current=requestAnimationFrame(()=>{S.current=0;const G=g.current;if(!G)return;const ee=N();l({sceneId:G.sceneId,patch:{dx:G.baseDx+G.dx*ee,dy:G.baseDy+G.dy*ee}})}));return}const se=Z.current;se&&(se.dx=H.clientX-se.x,se.dy=H.clientY-se.y,R({dx:se.dx,dy:se.dy}))},B=H=>{const z=$.current;if(z){$.current=null,L(null),Math.abs(z.factor-1)>.001&&r.patchElement(z.sceneId,z.elementId,{scale:Math.round(z.prior*z.factor*1e3)/1e3});return}const Y=x.current;if(Y){if(x.current=null,I(!1),_([]),b.current&&(cancelAnimationFrame(b.current),b.current=0),Y.dx!==0||Y.dy!==0){const G=W();if(G){let ee=al(qh(Y.start,Y.handle,Y.dx/G.w,Y.dy/G.h),i);(k.current??H.altKey)||(ee=Gh(ee,Y.handle,wn(i),Xh).rect),r.patchGraphicRect(Y.sceneId,{x:ro(ee.x),y:ro(ee.y),w:ro(ee.w),h:ro(ee.h)})}}k.current=null,u(null);return}if(v.current){v.current=null,w.current&&(cancelAnimationFrame(w.current),w.current=0);return}const ae=g.current;if(ae){if(g.current=null,S.current&&(cancelAnimationFrame(S.current),S.current=0),ae.dx!==0||ae.dy!==0){const G=N();r.patchVideo(ae.sceneId,{dx:sa(ae.baseDx+ae.dx*G),dy:sa(ae.baseDy+ae.dy*G)})}l(null);return}const ce=Z.current,se=F.current;if(!ce||!(se!=null&&se.elementId)){Z.current=null;return}if(ce.dx!==0||ce.dy!==0){const G=N(),ee=r.doc.scenes[se.sceneId],Q=ee==null?void 0:ee.elements[se.elementId];r.patchElement(se.sceneId,se.elementId,{dx:sa(((Q==null?void 0:Q.dx)??0)+ce.dx*G),dy:sa(((Q==null?void 0:Q.dy)??0)+ce.dy*G)})}Z.current=null,R({dx:0,dy:0})};return window.addEventListener("mousemove",A),window.addEventListener("mouseup",B),()=>{window.removeEventListener("mousemove",A),window.removeEventListener("mouseup",B)}},[r,e,i,s,l,u,W,p]),c.useEffect(()=>{const N=A=>{var oe;const B=e.current;if(!B||!B.contains(A.target))return;const H=(oe=V(A.clientX,A.clientY))==null?void 0:oe.closest("[data-caption-word]");if(!H)return;A.preventDefault();const z=Number(H.dataset.captionWord),Y=H.dataset.captionText??"";!Number.isFinite(z)||!Y||O({index:z,was:Y,draft:Y,rect:H.getBoundingClientRect()})};return window.addEventListener("dblclick",N),()=>window.removeEventListener("dblclick",N)},[e]),c.useEffect(()=>{const N=()=>{const z=document.activeElement;return z instanceof HTMLInputElement||z instanceof HTMLTextAreaElement||z instanceof HTMLSelectElement||z instanceof HTMLElement&&z.isContentEditable},A=()=>{const z=document.activeElement;return z instanceof HTMLTextAreaElement||z instanceof HTMLElement&&z.isContentEditable?!0:z instanceof HTMLInputElement&&!["range","checkbox","radio","button"].includes(z.type)},B=()=>{const z=document.activeElement;z instanceof HTMLElement&&!A()&&z.blur()},H=z=>{var oe,ae,ce,se;if(M!==null)return;const Y=z.metaKey||z.ctrlKey;if(z.key==="Escape"){if(N()){(oe=document.activeElement)==null||oe.blur();return}P(null)}else if(Y&&z.key.toLowerCase()==="z")z.preventDefault(),z.shiftKey?r.redo():r.undo();else if(Y&&z.key.toLowerCase()==="y")z.preventDefault(),r.redo();else if(Y&&z.key.toLowerCase()==="s")z.preventDefault(),o();else if(z.key===" "&&!Y){if(A())return;const G=document.activeElement;if(G instanceof HTMLElement&&G.tagName==="BUTTON"&&((ae=e.current)!=null&&ae.contains(G)))return;B(),z.preventDefault(),(ce=s.current)==null||ce.toggle()}else if(!Y&&["j","k","l"].includes(z.key.toLowerCase())){if(A())return;B(),z.preventDefault(),a(z.key.toUpperCase())}else if(!Y&&!z.altKey&&(z.key==="ArrowLeft"||z.key==="ArrowRight")){if(N())return;z.preventDefault();const G=s.current;if(!G)return;G.seekTo(Math.max(0,G.getCurrentFrame()+(z.key==="ArrowRight"?1:-1)))}else if(Y&&z.key.toLowerCase()==="b"){if(A())return;z.preventDefault();const G=s.current;if(!G)return;const ee=G.getCurrentFrame()/i.fps;if(!p.find(q=>ee>=q.startSec+sl&&ee<=q.endSec-sl))return;r.addSplit(Math.round(ee*1e3)/1e3)}else if(!Y&&z.altKey&&(z.key==="ArrowLeft"||z.key==="ArrowRight")){if(A())return;const G=F.current,ee=G?(()=>{const Q=p.findIndex(q=>q.id===G.sceneId);return Q===-1?void 0:p[Q+(z.key==="ArrowRight"?1:-1)]})():p[z.key==="ArrowRight"?0:p.length-1];if(!ee)return;z.preventDefault(),P({sceneId:ee.id,elementId:null})}else if(Y&&(z.key==="ArrowLeft"||z.key==="ArrowRight")){if(A())return;z.preventDefault();const G=s.current;if(!G)return;const ee=G.getCurrentFrame()/i.fps,Q=p.findIndex(he=>ee>=he.startSec&&ee<he.endSec),q=p[(Q===-1?0:Q)+(z.key==="ArrowRight"?1:-1)];if(!q)return;G.seekTo(Math.round(q.startSec*i.fps)),P({sceneId:q.id,elementId:null})}else if(!Y&&!z.altKey&&z.key==="?"){if(N())return;z.preventDefault(),m()}else if(!Y&&(z.key==="Delete"||z.key==="Backspace")){if(N())return;const G=F.current;if(!G||G.elementId!==null||!f||f.kind==="plain"||f.id!==G.sceneId||((se=r.doc.scenes[G.sceneId])==null?void 0:se.hidden)===!0)return;z.preventDefault(),r.hideScene(G.sceneId)}};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[P,r,M,o,s,e,a,f,p,i,m]),d.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[D.dx!==0||D.dy!==0||E?d.jsx("div",{"data-testid":"safe-area-guide",style:{position:"absolute",left:`${wn(i).left*100}%`,top:`${wn(i).top*100}%`,right:`${wn(i).right*100}%`,bottom:`${wn(i).bottom*100}%`,border:"1px dashed rgba(255, 225, 77, 0.45)",boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.18)",pointerEvents:"none"}}):null,T.map(N=>d.jsx("div",{"data-testid":`guide-${N.axis}`,style:{position:"absolute",pointerEvents:"none",background:"#FFE14D",...N.axis==="x"?{left:`${N.at*100}%`,top:0,bottom:0,width:1}:{top:`${N.at*100}%`,left:0,right:0,height:1}}},N.axis)),h&&t?d.jsxs("div",{ref:C,"data-testid":"overlay-box",style:{position:"fixed",pointerEvents:"auto",left:h.left+D.dx-ia/2+h.width*(1-(j??1))/2,top:h.top+D.dy-ia/2+h.height*(1-(j??1))/2,width:h.width*(j??1)+ia,height:h.height*(j??1)+ia,border:t.elementId?"2px dashed #ffe14d":"2px dashed #5b8cff",borderRadius:4,boxShadow:"0 0 0 1px rgba(0,0,0,0.35)",cursor:t.elementId?"grab":"default"},children:[t.elementId?d.jsx("div",{style:{position:"absolute",bottom:"100%",left:0,marginBottom:4,fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",letterSpacing:"0.04em",textTransform:"uppercase",color:"#0B0B0E",background:"#ffe14d",padding:"2px 6px",borderRadius:3,whiteSpace:"nowrap"},children:t.elementId}):null,t.elementId?["nw","ne","se","sw"].map(N=>d.jsx("div",{"data-el-handle":N,"data-testid":`el-handle-${N}`,style:{...Ej,...Jh[N]}},N)):null,!t.elementId&&f&&f.kind!=="plain"?d.jsxs(d.Fragment,{children:[["top","bottom","left","right"].map(N=>d.jsx("div",{"data-box-handle":"move","data-testid":N==="top"?"box-handle-move":`box-handle-move-${N}`,style:{...Cj,...kj[N]}},N)),["nw","n","ne","e","se","s","sw","w"].map(N=>d.jsx("div",{"data-box-handle":N,"data-testid":`box-handle-${N}`,style:{...hx,...Jh[N]}},N))]}):null]}):null,M?d.jsx("input",{autoFocus:!0,"data-testid":"caption-edit",value:M.draft,onChange:N=>O({...M,draft:N.target.value}),onBlur:()=>{const N=M.draft.trim();N&&r.patchCaption(M.index,N,M.was),O(null)},onKeyDown:N=>{N.key==="Enter"&&N.target.blur(),N.key==="Escape"&&O(null)},style:{position:"fixed",pointerEvents:"auto",left:M.rect.left-4,top:M.rect.top-4,width:Math.max(M.rect.width+40,90),height:M.rect.height+8,fontSize:Math.max(13,Math.min(M.rect.height*.7,28)),fontFamily:"'Inter', system-ui, sans-serif",fontWeight:800,border:"2px solid #FFE14D",borderRadius:4,padding:"0 4px",background:"#0B0B0E",color:"#fff",outline:"none",zIndex:11}}):null]})},on={display:"flex",flexDirection:"column",gap:6},vi={display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},Me={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"#9A9AA3"},Ai={fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace",fontSize:13,background:"#0F0F14",border:"1px solid #2A2A33",borderRadius:6,color:"#fff",padding:"6px 8px",width:"100%"},yx={...Ai,fontFamily:"'Inter', system-ui, sans-serif"},We={display:"flex",flexDirection:"column",gap:14,padding:"16px 18px",borderBottom:"1px solid #22222a"},Lt={fontSize:12,fontWeight:600,color:"#FF5C5C",background:"transparent",border:"1px solid #452626",borderRadius:6,padding:"7px 10px",cursor:"pointer"},zt=()=>{var e,t;(t=(e=document.activeElement)==null?void 0:e.blur)==null||t.call(e)},_j=e=>String(Math.round(e*1e3)/1e3),Tt=({id:e,value:t,onCommit:n,min:r,max:o,dragStep:i})=>{const[s,a]=J.useState(null),[l,u]=J.useState(!1),f=J.useRef(null),p=J.useRef(null),m=r??-1/0,h=o??1/0,y=i??(r!==void 0&&o!==void 0?(o-r)/240:.5),g=s!==null;return d.jsxs("div",{style:on,children:[d.jsx("span",{style:Me,children:e}),d.jsx("input",{type:"text",inputMode:"decimal",ref:f,"data-testid":`field-${e}`,style:{...Ai,...g?{}:{cursor:"ew-resize",touchAction:"none"},...l?{borderColor:"#FFE14D",color:"#FFE14D"}:{}},value:s??(Number.isFinite(t)?_j(t):"0"),onFocus:S=>a(S.target.value),onBlur:()=>a(null),onPointerDown:S=>{g||(S.preventDefault(),p.current={x:S.clientX,v:Number.isFinite(t)?t:0,moved:!1},S.currentTarget.setPointerCapture(S.pointerId),u(!0))},onPointerMove:S=>{const v=p.current;if(!v)return;const w=S.clientX-v.x;if(!v.moved&&Math.abs(w)<=2)return;v.moved=!0;const x=Math.round(Math.min(h,Math.max(m,v.v+w*y))*1e3)/1e3;n(x)},onPointerUp:()=>{var v,w,x;const S=((v=p.current)==null?void 0:v.moved)===!0;p.current=null,u(!1),S||((w=f.current)==null||w.focus(),(x=f.current)==null||x.select())},onPointerCancel:()=>{p.current=null,u(!1)},onChange:S=>{a(S.target.value);const v=S.target.value.trim();if(v==="")return;const w=Number(v.replace(",","."));Number.isFinite(w)&&n(Math.min(h,Math.max(m,w)))}})]})},aa=({id:e,value:t,isColor:n,onCommit:r})=>d.jsxs("div",{style:on,children:[d.jsx("span",{style:Me,children:e}),d.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[n?d.jsx("input",{type:"color",value:t,onChange:o=>r(o.target.value),style:{width:28,height:28,border:"1px solid #2A2A33",borderRadius:6,padding:0,background:"none"}}):null,d.jsx("input",{"data-testid":`theme-${e}`,style:{...yx,flex:1},value:t,onChange:o=>r(o.target.value)})]})]}),Pj=({selection:e,cue:t,frame:n,allSceneIds:r,edits:o,onSelect:i,resolvedTheme:s,anchorText:a,onVideoPreview:l,runInfo:u,captionsHiddenByFlag:f})=>{var v,w,x,b,k,E,I,T,_,$,j,L;if(e!=null&&e.elementId&&t){const M=e.elementId,O=((v=t.elements)==null?void 0:v[M])??{},Z=t.props?Tj(M,t.props):null;return d.jsxs("div",{children:[d.jsxs("div",{style:We,children:[d.jsx("span",{style:Me,children:"Selected"}),d.jsx("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:M})]}),(()=>{var V;const D=/^line-(\d+)$/.exec(M),R=(V=t.props)==null?void 0:V.lines;if(t.component!=="StrikethroughReveal"||!D||!Array.isArray(R))return null;const C=Number(D[1]),F=R[C];if(!F)return null;const P=F.struck?"struck":(F.mark??"none")!=="none"?F.mark:"plain";return d.jsx("div",{style:We,children:d.jsxs("div",{style:on,children:[d.jsx("span",{style:Me,children:"Line style"}),d.jsxs("select",{"data-testid":"line-style",style:Ai,value:P,onChange:W=>{const N=W.target.value,A=R.slice();A[C]={...A[C],struck:N==="struck",mark:N==="cross"||N==="check"?N:"none"},o.patchProps(e.sceneId,{lines:A})},children:[d.jsx("option",{value:"plain",children:"plain"}),d.jsx("option",{value:"struck",children:"struck through"}),d.jsx("option",{value:"cross",children:"✗ wrong"}),d.jsx("option",{value:"check",children:"✓ right"})]})]})})})(),Z!==null?d.jsx("div",{style:We,children:d.jsxs("div",{style:on,children:[d.jsx("span",{style:Me,children:"Text"}),d.jsx("input",{style:yx,"data-testid":"element-text",value:Z,onChange:D=>{const R=t.props??{},C=/^(line|node|message|window|item)-\d+$/.test(M)?Ij(M,R,D.target.value):{[M]:D.target.value};C&&o.patchProps(e.sceneId,C,`text:${e.sceneId}:${M}`)}})]})}):null,d.jsxs("div",{style:We,children:[d.jsxs("div",{style:on,children:[d.jsxs("span",{style:Me,children:["scale"," ",d.jsxs("span",{style:{color:"#EDEDF2"},children:[(O.scale??1).toFixed(2),"×"]})]}),d.jsx("input",{type:"range","data-testid":"el-scale-slider",min:.1,max:3,step:.01,value:O.scale??1,onChange:D=>o.patchElement(e.sceneId,M,{scale:Number(D.target.value)},`element:${e.sceneId}:${M}:scale`)})]}),d.jsxs("div",{style:vi,children:[d.jsx(Tt,{id:"x",value:O.dx??0,dragStep:1,onCommit:D=>o.patchElement(e.sceneId,M,{dx:D},`element:${e.sceneId}:${M}:dx`)}),d.jsx(Tt,{id:"y",value:O.dy??0,dragStep:1,onCommit:D=>o.patchElement(e.sceneId,M,{dy:D},`element:${e.sceneId}:${M}:dy`)})]}),d.jsx(Tt,{id:"scale",value:O.scale??1,min:.05,max:4,dragStep:.01,onCommit:D=>o.patchElement(e.sceneId,M,{scale:D},`element:${e.sceneId}:${M}:scale`)})]}),d.jsxs("div",{style:We,children:[d.jsx("button",{style:Lt,onClick:()=>{zt(),o.clearElement(e.sceneId,M)},children:"Reset element"}),d.jsx("button",{"data-testid":"delete-element",style:{...Lt,marginTop:8},onClick:()=>{zt(),o.hideElement(e.sceneId,M),i({sceneId:e.sceneId,elementId:null})},children:"Delete element"})]})]})}if(e&&t){const M=t.kind==="plain";if(((w=o.doc.scenes[e.sceneId])==null?void 0:w.hidden)===!0)return d.jsx("div",{children:d.jsxs("div",{style:We,children:[d.jsx("span",{style:Me,children:"Scene"}),d.jsxs("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:[e.sceneId," ",d.jsx("span",{style:{color:"#9A9AA3",fontWeight:400},children:"(deleted)"})]}),d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Its window plays as a plain take. Restore brings the graphic back."}),d.jsx("button",{"data-testid":"restore-scene",style:{...Lt,color:"#5FBF77",border:"1px solid #24402c"},onClick:()=>{zt(),o.restoreScene(e.sceneId)},children:"Restore scene"})]})});const O=o.doc.cuts.findIndex(D=>D.src===void 0&&D.startSec===t.startSec&&D.endSec===t.endSec);if(O!==-1)return d.jsx("div",{children:d.jsxs("div",{style:We,children:[d.jsx("span",{style:Me,children:M?"Take":"Scene"}),d.jsxs("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:[e.sceneId," ",d.jsx("span",{style:{color:"#9A9AA3",fontWeight:400},children:"(marked for removal)"})]}),d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Struck through on the timeline. It disappears from the output on the next produce/Render — this preview still plays it (the editor doesn't re-derive a second cut timeline just to show one early)."}),d.jsx("button",{"data-testid":"restore-chunk",style:{...Lt,color:"#5FBF77",border:"1px solid #24402c"},onClick:()=>{zt(),o.restoreChunk(O)},children:"Restore"})]})});const Z=Object.entries(t.elements??{}).filter(([,D])=>D.hidden===!0).map(([D])=>{var F,P;const C=((P=(F=o.doc.scenes[e.sceneId])==null?void 0:F.elements[D])==null?void 0:P.hidden)===!0?e.sceneId:jF(e.sceneId);return{id:D,owningSceneId:C}});return d.jsxs("div",{children:[d.jsxs("div",{style:We,children:[d.jsx("span",{style:Me,children:M?"Take":"Scene"}),d.jsx("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:e.sceneId}),M?d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"A continuous stretch of the talking head — no graphic. Frame it below; its window follows the cut."}):null]}),d.jsxs("div",{style:We,children:[!M&&t.component?d.jsxs("div",{style:on,children:[d.jsx("span",{style:Me,children:"Component"}),d.jsx("select",{style:Ai,value:t.component,onChange:D=>o.patchComponent(e.sceneId,D.target.value),children:nu.options.map(D=>d.jsx("option",{value:D,children:D},D))})]}):null,d.jsxs("div",{style:on,children:[d.jsx("span",{style:Me,children:"Layout"}),d.jsx("select",{style:Ai,"data-testid":"layout-select",value:t.layout,onChange:D=>o.patchLayout(e.sceneId,D.target.value),children:tu.options.map(D=>d.jsx("option",{value:D,children:D},D))})]})]}),d.jsxs("div",{style:We,children:[d.jsx("span",{style:Me,children:"Video framing"}),d.jsxs("div",{style:on,children:[d.jsxs("span",{style:Me,children:["zoom"," ",d.jsxs("span",{style:{color:"#EDEDF2"},children:[(((x=t.video)==null?void 0:x.scale)??1).toFixed(2),"×"]})]}),d.jsx("input",{type:"range","data-testid":"zoom-slider",min:.5,max:3,step:.01,value:((b=t.video)==null?void 0:b.scale)??1,onChange:D=>l({sceneId:e.sceneId,patch:{scale:Number(D.target.value)}}),onPointerUp:D=>{const R=Number(D.target.value);o.patchVideo(e.sceneId,{scale:R},`video:${e.sceneId}:scale`),l(null)},onKeyUp:D=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(D.key))return;const C=Number(D.target.value);o.patchVideo(e.sceneId,{scale:C},`video:${e.sceneId}:scale`),l(null)}})]}),d.jsxs("label",{style:{display:"flex",gap:8,alignItems:"center",fontSize:12,color:"#9A9AA3",cursor:"pointer"},children:[d.jsx("input",{type:"checkbox","data-testid":"auto-zoom",checked:((k=t.video)==null?void 0:k.autoZoom)!==!1,onChange:D=>o.patchVideo(e.sceneId,{autoZoom:D.target.checked})}),"auto zoom (the slow push composes on top of your zoom)"]}),d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Pan: drag the picture on the stage."}),d.jsx(Tt,{id:"scale",value:((E=t.video)==null?void 0:E.scale)??1,min:.05,max:4,dragStep:.01,onCommit:D=>o.patchVideo(e.sceneId,{scale:D},`video:${e.sceneId}:scale`)}),d.jsxs("div",{style:vi,children:[d.jsx(Tt,{id:"dx",value:((I=t.video)==null?void 0:I.dx)??0,dragStep:1,onCommit:D=>o.patchVideo(e.sceneId,{dx:D},`video:${e.sceneId}:dx`)}),d.jsx(Tt,{id:"dy",value:((T=t.video)==null?void 0:T.dy)??0,dragStep:1,onCommit:D=>o.patchVideo(e.sceneId,{dy:D},`video:${e.sceneId}:dy`)})]}),t.video?d.jsx("button",{style:Lt,onClick:()=>{zt(),o.clearVideo(e.sceneId)},children:"Reset framing"}):null]}),t.layout==="pip-bubble"?(()=>{const D=Dr("pip-bubble",void 0,[],n).video,R=t.pip??{},C=R.cornerRadius??D.cornerRadius;return d.jsxs("div",{style:We,children:[d.jsx("span",{style:Me,children:"PiP bubble"}),d.jsxs("div",{style:on,children:[d.jsxs("span",{style:Me,children:["roundness"," ",d.jsx("span",{style:{color:"#EDEDF2"},children:C.toFixed(2)})]}),d.jsx("input",{type:"range","data-testid":"pip-roundness",min:0,max:1,step:.01,value:C,onChange:F=>o.patchPip(e.sceneId,{cornerRadius:Number(F.target.value)},`pip:${e.sceneId}:cornerRadius`)})]}),d.jsxs("div",{style:vi,children:[d.jsx(Tt,{id:"pip-x",value:R.x??D.rect.x,min:0,max:1-D.rect.w,dragStep:.002,onCommit:F=>o.patchPip(e.sceneId,{x:F},`pip:${e.sceneId}:x`)}),d.jsx(Tt,{id:"pip-y",value:R.y??D.rect.y,min:0,max:1-D.rect.h,dragStep:.002,onCommit:F=>o.patchPip(e.sceneId,{y:F},`pip:${e.sceneId}:y`)})]}),t.pip?d.jsx("button",{"data-testid":"reset-pip",style:Lt,onClick:()=>{zt(),o.clearPip(e.sceneId)},children:"Reset bubble"}):null]})})():null,(()=>{var C;if(M)return null;const D=Qw(t,n),R=F=>P=>o.patchGraphicRect(e.sceneId,al({...D,[F]:P},n),`box:${e.sceneId}:${F}`);return d.jsxs("div",{style:We,children:[d.jsx("span",{style:Me,children:"Graphic box"}),d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Frame fractions — or drag the handles on the stage."}),d.jsxs("div",{style:vi,children:[d.jsx(Tt,{id:"box-x",value:D.x,min:0,max:1,dragStep:.002,onCommit:R("x")}),d.jsx(Tt,{id:"box-y",value:D.y,min:0,max:1,dragStep:.002,onCommit:R("y")})]}),d.jsxs("div",{style:vi,children:[d.jsx(Tt,{id:"box-w",value:D.w,min:.08,max:1,dragStep:.002,onCommit:R("w")}),d.jsx(Tt,{id:"box-h",value:D.h,min:.05,max:1,dragStep:.002,onCommit:R("h")})]}),(C=o.doc.scenes[e.sceneId])!=null&&C.graphicRect?d.jsx("button",{"data-testid":"reset-box",style:Lt,onClick:()=>{zt(),o.clearGraphicRect(e.sceneId)},children:"Reset box"}):null]})})(),(()=>{const D=Dr(t.layout,void 0,[],n).captionAnchor,R=t.captionY??D,C=t.captionScale??1,F=o.doc.scenes[e.sceneId];return d.jsxs("div",{style:We,children:[d.jsx("span",{style:Me,children:"Captions"}),o.doc.captionsHidden===!0||f===!0?d.jsxs("div",{"data-testid":"captions-hidden-hint",style:{fontSize:12,color:"#FFE14D"},children:["Captions are hidden globally",f===!0?" (--no-captions)":" (Theme panel)"," — these settings are kept and apply when captions are shown again."]}):null,d.jsxs("div",{style:on,children:[d.jsxs("span",{style:Me,children:["position"," ",d.jsx("span",{style:{color:"#EDEDF2"},children:R.toFixed(2)})]}),d.jsx("input",{type:"range","data-testid":"caption-y-slider",min:.05,max:.95,step:.01,value:R,onChange:P=>o.patchCaptionY(e.sceneId,Number(P.target.value),`captionY:${e.sceneId}`)})]}),d.jsxs("div",{style:on,children:[d.jsxs("span",{style:Me,children:["scale"," ",d.jsxs("span",{style:{color:"#EDEDF2"},children:[C.toFixed(2),"×"]})]}),d.jsx("input",{type:"range","data-testid":"caption-scale-slider",min:.2,max:3,step:.01,value:C,onChange:P=>o.patchCaptionScale(e.sceneId,Number(P.target.value),`captionScale:${e.sceneId}`)})]}),d.jsx(Tt,{id:"caption-scale",value:C,min:.2,max:3,dragStep:.01,onCommit:P=>o.patchCaptionScale(e.sceneId,P,`captionScale:${e.sceneId}`)}),d.jsx("button",{"data-testid":"caption-y-all",style:{...Lt,color:"#EDEDF2",border:"1px solid #2A2A33"},title:"Write this scene's caption position and scale to every scene — one undo step",onClick:()=>{zt(),o.patchCaptionStyleAll(r,{y:R,scale:C})},children:"Apply to all scenes"}),(F==null?void 0:F.captionY)!==void 0||(F==null?void 0:F.captionScale)!==void 0?d.jsx("button",{"data-testid":"reset-caption-y",style:Lt,onClick:()=>{zt(),o.clearCaptionStyle(e.sceneId)},children:"Reset captions"}):null]})})(),d.jsxs("div",{style:We,children:[d.jsx("span",{style:Me,children:"Timing"}),d.jsxs("div",{"data-testid":"timing-range",style:{fontSize:13,fontFamily:"ui-monospace, 'SF Mono', monospace"},children:[t.startSec.toFixed(2),"s – ",t.endSec.toFixed(2),"s",d.jsxs("span",{style:{color:"#9A9AA3"},children:[" ","(",(t.endSec-t.startSec).toFixed(2),"s)"]})]}),d.jsx("div",{style:{fontSize:12,color:t.pinned?"#FFE14D":"#9A9AA3"},children:M?"Derived from the cut — not movable":t.pinned?"Pinned to these times":"Tracking transcript"}),!t.pinned&&a?d.jsxs("div",{style:{fontSize:12,color:"#9A9AA3",fontStyle:"italic"},children:["“",a,"”"]}):null,t.pinned?d.jsx("button",{style:Lt,onClick:()=>{zt(),o.clearTiming(e.sceneId)},children:"Un-pin (re-anchor to words)"}):null]}),M?null:d.jsx("div",{style:We,children:d.jsx("button",{"data-testid":"delete-scene",style:Lt,onClick:()=>{zt(),o.hideScene(e.sceneId)},children:"Delete scene"})}),Z.length>0?d.jsxs("div",{style:We,children:[d.jsx("span",{style:Me,children:"Hidden elements"}),Z.map(({id:D,owningSceneId:R})=>d.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[d.jsx("span",{style:{fontSize:13,fontFamily:"ui-monospace, monospace",color:"#C9C9D4"},children:D}),d.jsx("button",{"data-testid":`restore-element-${D}`,style:{...Lt,color:"#5FBF77",border:"1px solid #24402c",padding:"4px 8px"},onClick:()=>{zt(),o.restoreElement(R,D)},children:"Restore"})]},D))]}):null,d.jsxs("div",{style:We,children:[d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Removes this window from the output on the next produce/Render. Struck through here until then — the preview keeps playing it."}),d.jsx("button",{"data-testid":"cut-chunk",style:Lt,onClick:()=>{zt(),o.cutChunk(t.startSec,t.endSec)},children:"Delete this chunk"})]})]})}const p=o.doc.theme,m=(M,O)=>o.patchTheme({[M]:O}),h=M=>`${Math.floor(M/60)}:${String(Math.floor(M%60)).padStart(2,"0")}`,y=((_=u==null?void 0:u.usage)==null?void 0:_.totals)??null,g=(($=u==null?void 0:u.production)==null?void 0:$.producer)??null,S=((j=u==null?void 0:u.production)==null?void 0:j.clip)??null;return d.jsxs("div",{children:[d.jsxs("div",{style:We,children:[d.jsx("span",{style:Me,children:"Theme"}),d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Nothing selected — global tokens."})]}),d.jsxs("div",{style:We,children:[d.jsx(aa,{id:"accent",value:p.accent??s.accent,isColor:!0,onCommit:M=>m("accent",M)}),d.jsx(aa,{id:"bg",value:p.bg??s.bg,isColor:!0,onCommit:M=>m("bg",M)}),d.jsx(aa,{id:"fg",value:p.fg??s.fg,isColor:!0,onCommit:M=>m("fg",M)}),d.jsx(Tt,{id:"radiusPx",value:p.radiusPx??s.radiusPx,min:0,dragStep:.5,onCommit:M=>m("radiusPx",M)}),d.jsx(aa,{id:"fontDisplay",value:p.fontDisplay??s.fontDisplay,isColor:!1,onCommit:M=>m("fontDisplay",M)})]}),d.jsxs("div",{style:We,children:[d.jsx("span",{style:Me,children:"Captions"}),d.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:"#EDEDF2",cursor:"pointer"},children:[d.jsx("input",{type:"checkbox","data-testid":"captions-visible-toggle",checked:o.doc.captionsHidden!==!0&&f!==!0,disabled:f===!0&&o.doc.captionsHidden!==!0,onChange:M=>o.setCaptionsHidden(!M.target.checked)}),"Show captions"]}),o.doc.captionsHidden===!0?d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Hidden everywhere — the CTA keyword styling rides the caption track, so it is hidden too. Per-scene caption position/scale edits are kept."}):null,f===!0?d.jsx("div",{"data-testid":"captions-flag-note",style:{fontSize:12,color:"#FFE14D"},children:"This project was produced with --no-captions, which Render replays — the toggle can't bring captions back here; re-run produce without the flag."}):null]}),g||y?d.jsxs("div",{style:We,"data-testid":"run-info",children:[d.jsx("span",{style:Me,children:"This video"}),g?d.jsxs("div",{style:{fontSize:12,color:"#C9C9D4"},children:["planned by ",d.jsx("span",{style:{color:"#EDEDF2"},children:g.provider}),g.models.length>0?` (${g.models.join(", ")})`:"",g.cached?" · reused from cache":"",g.at?` · ${new Date(g.at).toLocaleString()}`:""]}):null,y?d.jsxs("div",{style:{fontSize:12,color:"#C9C9D4"},children:[y.calls," LLM call",y.calls===1?"":"s"," ·"," ",y.inputTokens.toLocaleString()," in / ",y.outputTokens.toLocaleString()," out tokens",y.anyEstimated?" (partly estimated)":""]}):null,y&&y.equivalentUsd!==null?d.jsx("div",{style:{fontSize:12,color:"#C9C9D4"},children:y.allUnbilled?`~$${y.equivalentUsd.toFixed(2)} of API-rate work, covered by the subscription`:y.billedUsd!==null?`~$${y.billedUsd.toFixed(2)} charged at API rates`:`~$${y.equivalentUsd.toFixed(2)} at API rates`}):null,S?d.jsxs("div",{style:{fontSize:12,color:"#C9C9D4"},children:["clip: ",h(S.startSec),"–",h(S.endSec),(L=u==null?void 0:u.production)!=null&&L.sourceDuration?` of ${h(u.production.sourceDuration)}`:""," ","(--clip ",S.targetSec,")"]}):null]}):null,d.jsx("div",{style:We,children:d.jsx("div",{"data-testid":"ai-disclaimer",style:{fontSize:12,color:"#9A9AA3"},children:"AI can make mistakes. The cut, captions and graphics are generated — review them before publishing."})})]})},qu=1.2,ul=.05;function Fj(e,t,n,r){return n<=0||r<=0?0:Math.min(1,Math.max(0,(e-t)/n))*r}const jj=16,Mj=e=>Math.min(jj,Math.max(1,e));function $j(e,t,n,r,o){if(e<=0||n<=0)return 0;const s=(r+o)*(t/e),a=Math.max(0,t*n-n);return Math.min(a,Math.max(0,s-o))}const ap=e=>e.filter(t=>t.kind!=="plain");function Aj(e,t,n,r){const o=ap(e),i=o.findIndex(h=>h.id===t),s=o[i];if(!s)return null;const a=s.endSec-s.startSec,l=i>0?o[i-1]:void 0,u=i<o.length-1?o[i+1]:void 0,f=l?l.endSec+ul:0,p=u?u.startSec-ul:r,m=Math.min(Math.max(s.startSec+n,f),Math.max(f,p-a));return{startSec:m,endSec:m+a}}function Nj(e,t,n,r,o){const i=ap(e),s=i.findIndex(h=>h.id===t),a=s>0?i[s-1]:void 0,l=s>=0&&s<i.length-1?i[s+1]:void 0,u=a?a.endSec+ul:0,f=l?l.startSec-ul:o;let p=Math.min(Math.max(n,u),Math.max(u,f-qu)),m=Math.max(Math.min(r,f),p+qu);return m>f&&(m=f,p=Math.max(u,m-qu)),{startSec:p,endSec:m}}function eg(e,t,n,r){const o=[0,r,n];for(const a of ap(e))a.id!==t&&o.push(a.startSec,a.endSec);o.sort((a,l)=>a-l);const i=[];let s;for(const a of o)(s===void 0||a-s>1e-6)&&(i.push(a),s=a);return i}function la(e,t,n){if(n<=0||t.length===0)return{sec:e,snapped:null};let r=null,o=1/0;for(const i of t){const s=Math.abs(e-i);(s<o||s===o&&r!==null&&i<r)&&(r=i,o=s)}return r===null||o>n?{sec:e,snapped:null}:{sec:r,snapped:r}}function Lj(e,t){if(e.length===0)return 0;for(const r of e)if(t>=r.srcIn&&t<=r.srcOut)return r.outIn+(t-r.srcIn);let n=0;for(const r of e)if(r.srcOut<=t)n=r.outOut;else if(r.srcIn>=t)return r.outIn;return n}function Qu(e,t){const n=Math.max(0,e);if(t<=0)return`${n.toFixed(1)}s`;const r=Math.floor(n),o=Math.floor(r/60),i=r%60,s=Math.floor((n-r)*t),a=String(Math.max(1,Math.ceil(t)-1)).length;return`${o}:${String(i).padStart(2,"0")}:${String(s).padStart(a,"0")}`}const zj=10,Dj=4,tg=8,ng=8,Oj=300,Vj=e=>{const t=Math.max(0,Math.round(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`},Bj=(e,t)=>{const[n,r]=J.useState({}),o=J.useRef({}),i=t.map(s=>s.toFixed(1)).join(",");return J.useEffect(()=>{if(!e||t.length===0)return;const s=[...new Set(t.map(p=>p.toFixed(1)))].filter(p=>o.current[p]===void 0);if(s.length===0)return;let a=!1;const l=document.createElement("video");l.src=e,l.muted=!0,l.preload="auto";const u=document.createElement("canvas");return(async()=>{await new Promise((m,h)=>{l.onloadedmetadata=()=>m(),l.onerror=()=>h(new Error("no video for thumbnails"))}),u.width=168,u.height=Math.max(1,Math.round(168*l.videoHeight/Math.max(1,l.videoWidth)));const p=u.getContext("2d");if(p){for(const m of s){if(a)return;await new Promise(h=>{l.onseeked=()=>h(),l.currentTime=Math.max(0,Number(m))}),p.drawImage(l,0,0,u.width,u.height),o.current[m]=u.toDataURL("image/jpeg",.6)}a||r({...o.current})}})().catch(()=>{}),()=>{a=!0,l.removeAttribute("src"),l.load()}},[e,i]),n},Wj=({cues:e,ghosts:t,cuts:n=[],spans:r=[],durationSec:o,fps:i,playerRef:s,selection:a,onSelect:l,edits:u,videoSrc:f,toSourceSec:p})=>{const m=c.useRef(null),h=c.useRef(null),y=c.useRef(!1),g=c.useRef(null),[S,v]=c.useState(0),w=c.useRef(S);w.current=S;const[x,b]=c.useState(null),[k,E]=c.useState(1),I=J.useMemo(()=>p?e.filter(R=>R.kind==="plain").map(R=>p((R.startSec+R.endSec)/2)):[],[e,p]),T=Bj(f,I),_=c.useRef(null),$=c.useRef(null),j=c.useCallback((R,C)=>{const F=_.current;E(P=>{const V=Mj(R);if(V===P||!F)return V;const W=F.getBoundingClientRect();return $.current={prevZoom:P,anchorX:C!==void 0?C-W.left:W.width/2},V})},[]);c.useLayoutEffect(()=>{const R=_.current,C=$.current;!R||!C||($.current=null,R.scrollLeft=$j(C.prevZoom,k,R.clientWidth,R.scrollLeft,C.anchorX))},[k]);const L=c.useRef(k);L.current=k,c.useEffect(()=>{const R=_.current;if(!R)return;const C=F=>{F.ctrlKey||F.metaKey?(F.preventDefault(),j(L.current*Math.exp(-F.deltaY*.01),F.clientX)):R.scrollWidth>R.clientWidth&&(F.preventDefault(),R.scrollLeft+=F.deltaY+F.deltaX)};return R.addEventListener("wheel",C,{passive:!1}),()=>R.removeEventListener("wheel",C)},[j]),c.useEffect(()=>{const R=s.current;if(!R)return;v(R.getCurrentFrame());const C=F=>v(F.detail.frame);return R.addEventListener("frameupdate",C),()=>R.removeEventListener("frameupdate",C)},[s]),c.useEffect(()=>{const R=_.current;if(!R||o<=0||R.scrollWidth<=R.clientWidth)return;const C=S/i/o*R.scrollWidth,{scrollLeft:F,clientWidth:P}=R;(C<F||C>F+P)&&(R.scrollLeft=Math.max(0,Math.min(R.scrollWidth-P,C-P*.1)))},[S,i,o]),c.useEffect(()=>{var C,F;if(!a)return;const R=(C=_.current)==null?void 0:C.querySelector(`[data-testid="timeline-block-${a.sceneId}"]`);(F=R==null?void 0:R.scrollIntoView)==null||F.call(R,{inline:"nearest",block:"nearest"})},[a]);const M=c.useCallback(R=>{var P;const C=m.current;if(!C||o<=0)return;const F=C.getBoundingClientRect();(P=s.current)==null||P.seekTo(Math.round(Fj(R,F.left,F.width,o)*i))},[s,o,i]),O=c.useCallback((R,C)=>F=>{F.stopPropagation(),F.preventDefault();const P=m.current;P&&(h.current={sceneId:R.id,edge:C,startContentX:F.clientX-P.getBoundingClientRect().left,origStart:R.startSec,origEnd:R.endSec},b({sceneId:R.id,startSec:R.startSec,endSec:R.endSec,snapped:null}))},[]),Z=c.useRef(0);c.useEffect(()=>{const R=P=>{const V=_.current;if(!V||V.scrollWidth<=V.clientWidth)return;const W=Date.now();if(W-Z.current<Oj)return;const N=V.getBoundingClientRect(),A=V.scrollWidth-V.clientWidth;P>=N.right-ng&&V.scrollLeft<A?(V.scrollLeft=Math.min(A,V.scrollLeft+V.clientWidth),Z.current=W):P<=N.left+ng&&V.scrollLeft>0&&(V.scrollLeft=Math.max(0,V.scrollLeft-V.clientWidth),Z.current=W)},C=P=>{var se;if((y.current||((se=g.current)==null?void 0:se.moved)===!0||h.current!==null)&&R(P.clientX),y.current){M(P.clientX);return}const W=g.current;if(W&&o>0){if(!W.moved&&Math.abs(P.clientX-W.startX)<Dj)return;W.moved=!0;const G=m.current,ee=G==null?void 0:G.getBoundingClientRect(),Q=ee?(P.clientX-ee.left-W.startContentX)/ee.width*o:0;let q=Q,he=null;const Ce=ee&&ee.width>0&&!P.altKey?e.find(pe=>pe.id===W.sceneId):void 0;if(Ce&&ee){const pe=tg/(ee.width/o),Re=eg(e,W.sceneId,w.current/i,o),be=Ce.startSec+Q,we=Ce.endSec+Q,Pe=la(be,Re,pe),ue=la(we,Re,pe),Ge=Pe.snapped===null?1/0:Math.abs(Pe.sec-be),Et=ue.snapped===null?1/0:Math.abs(ue.sec-we);Ge<=Et&&Pe.snapped!==null?(q=Q+(Pe.sec-be),he=Pe.snapped):ue.snapped!==null&&(q=Q+(ue.sec-we),he=ue.snapped)}const ve=Aj(e,W.sceneId,q,o);if(ve){const pe=he!==null&&(Math.abs(ve.startSec-he)<1e-6||Math.abs(ve.endSec-he)<1e-6)?he:null;b({sceneId:W.sceneId,...ve,snapped:pe})}return}const N=h.current;if(!N||o<=0)return;const A=m.current;if(!A)return;const B=A.getBoundingClientRect(),H=(P.clientX-B.left-N.startContentX)/B.width*o;let z=N.edge==="start"?N.origStart+H:N.origStart,Y=N.edge==="end"?N.origEnd+H:N.origEnd,oe=null;if(!P.altKey&&B.width>0){const G=tg/(B.width/o),ee=eg(e,N.sceneId,w.current/i,o);if(N.edge==="start"){const Q=la(z,ee,G);z=Q.sec,oe=Q.snapped}else{const Q=la(Y,ee,G);Y=Q.sec,oe=Q.snapped}}const ae=Nj(e,N.sceneId,z,Y,o),ce=oe!==null&&(Math.abs(ae.startSec-oe)<1e-6||Math.abs(ae.endSec-oe)<1e-6)?oe:null;b({sceneId:N.sceneId,...ae,snapped:ce})},F=P=>{y.current=!1;const V=g.current;if(V){g.current=null,V.moved?b(N=>(N&&N.sceneId===V.sceneId&&u.patchTiming(V.sceneId,N.startSec,N.endSec),null)):M(P.clientX);return}const W=h.current;W&&(b(N=>(N&&N.sceneId===W.sceneId&&(N.startSec!==W.origStart||N.endSec!==W.origEnd)&&u.patchTiming(W.sceneId,N.startSec,N.endSec),null)),h.current=null)};return window.addEventListener("mousemove",C),window.addEventListener("mouseup",F),()=>{window.removeEventListener("mousemove",C),window.removeEventListener("mouseup",F)}},[e,o,u,M,i]);const D=o>0?Math.min(1,S/i/o)*100:0;return d.jsxs("div",{style:Uj,onMouseDownCapture:vx,children:[d.jsxs("div",{style:Hj,children:[d.jsx("span",{style:Yj,children:"ctrl+scroll to zoom"}),d.jsx("button",{"data-testid":"zoom-out",style:Ju,onClick:()=>j(k/2),disabled:k<=1,title:"Zoom out (ctrl/cmd + scroll on the timeline)",children:"−"}),d.jsxs("span",{"data-testid":"zoom-level",style:Zj,children:[Math.round(k*10)/10,"×"]}),d.jsx("button",{"data-testid":"zoom-in",style:Ju,onClick:()=>j(k*2),disabled:k>=16,title:"Zoom in (ctrl/cmd + scroll on the timeline)",children:"+"}),d.jsx("button",{"data-testid":"zoom-fit",style:{...Ju,width:"auto",padding:"0 8px"},onClick:()=>j(1),disabled:k<=1,title:"Fit the whole clip in view",children:"fit"})]}),d.jsx("div",{ref:_,"data-testid":"timeline-scroller",style:Kj,children:d.jsxs("div",{style:{width:`${k*100}%`,minWidth:"100%",paddingBottom:6},children:[d.jsx("div",{"data-testid":"ruler",style:Xj,onMouseDown:R=>{R.preventDefault(),M(R.clientX),y.current=!0},children:(()=>{var N;if(o<=0)return d.jsx("span",{style:ec,children:"0:00"});const C=(((N=_.current)==null?void 0:N.clientWidth)??1200)*k/o;let P=[.5,1,2,5,10,15,30,60,120,300,600].find(A=>A*C>=70)??600;for(;o/(P/5)>600;)P*=2;const V=P/5,W=[];for(let A=0;A<=o+1e-6;A+=V){const B=Math.round(A/V)%5===0,H=`${A/o*100}%`;W.push(d.jsx("div",{style:{position:"absolute",left:H,bottom:0,width:1,height:B?8:4,background:B?"#3A3A44":"#26262e",pointerEvents:"none"}},A.toFixed(3))),B&&A+V<=o&&W.push(d.jsx("span",{style:{...ec,position:"absolute",left:H,top:0,transform:A===0?void 0:"translateX(-50%)",pointerEvents:"none"},children:Vj(A)},`l${A.toFixed(3)}`))}return d.jsxs(d.Fragment,{children:[W,d.jsx("span",{style:{...ec,position:"absolute",right:2,top:0,pointerEvents:"none"},children:Qu(o,i)})]})})()}),d.jsxs("div",{ref:m,style:Gj,onMouseDown:R=>{R.preventDefault(),M(R.clientX),y.current=!0},children:[e.map(R=>{const C=R.kind==="plain",F=(x==null?void 0:x.sceneId)===R.id,P=F?x.startSec:R.startSec,V=F?x.endSec:R.endSec,W=o>0?P/o*100:0,N=o>0?Math.max(0,(V-P)/o*100):0,A=(a==null?void 0:a.sceneId)===R.id,B=C&&p?T[p((R.startSec+R.endSec)/2).toFixed(1)]:void 0;return d.jsxs("div",{"data-testid":`timeline-block-${R.id}`,onMouseDown:H=>{var z;if(H.stopPropagation(),H.preventDefault(),l({sceneId:R.id,elementId:null}),C){M(H.clientX),y.current=!0;return}g.current={sceneId:R.id,startX:H.clientX,startContentX:H.clientX-(((z=m.current)==null?void 0:z.getBoundingClientRect().left)??0),moved:!1}},style:{...rg,left:`${W}%`,width:`${N}%`,zIndex:F?4:A?3:1,border:A?"2px solid #5b8cff":C?"1px solid #22222a":"1px solid #2A2A33",backgroundColor:A?"#1c2333":C?"#131318":"#1A1A21",...B?{backgroundImage:`linear-gradient(rgba(10,10,14,0.35), rgba(10,10,14,0.6)), url(${B})`,backgroundSize:"auto 100%, auto 100%",backgroundRepeat:"repeat-x"}:{}},children:[d.jsx("span",{style:C?B?{...ua,color:"#D8D8DE",textShadow:"0 1px 2px rgba(0,0,0,0.9)"}:{...ua,color:"#55555f"}:ua,children:R.id}),!C&&R.pinned?d.jsx("span",{style:qj,children:"PIN"}):null,C?null:d.jsxs(d.Fragment,{children:[d.jsx("div",{onMouseDown:O(R,"start"),style:{...og,left:0,cursor:"ew-resize"}}),d.jsx("div",{onMouseDown:O(R,"end"),style:{...og,right:0,cursor:"ew-resize"}})]})]},R.id)}),t.map(R=>{const C=o>0?R.startSec/o*100:0,F=o>0?Math.max(0,(R.endSec-R.startSec)/o*100):0,P=(a==null?void 0:a.sceneId)===R.id;return d.jsx("div",{"data-testid":`timeline-block-${R.id}`,onMouseDown:V=>{V.stopPropagation(),V.preventDefault(),l({sceneId:R.id,elementId:null})},style:{...rg,left:`${C}%`,width:`${F}%`,zIndex:P?3:2,border:P?"2px dashed #5b8cff":"1px dashed #6a6a75",background:"transparent"},children:d.jsx("span",{style:{...ua,color:"#6a6a75",textDecoration:"line-through"},children:R.id})},`ghost-${R.id}`)}),n.map((R,C)=>{const F=V=>o>0?Math.min(100,Math.max(0,V/o*100)):0;if(!R.src){const V=Math.min(Math.max(R.startSec,0),o),W=Math.min(Math.max(R.endSec,0),o),N=F(V),A=o>0?Math.max(0,(W-V)/o*100):0;return d.jsx("div",{"data-testid":`timeline-cut-${R.startSec}-${R.endSec}`,style:{...Qj,left:`${N}%`,width:`${A}%`},children:d.jsx("div",{style:Jj})},`cut-${C}-${R.startSec}-${R.endSec}`)}if(r.length===0)return null;const P=F(Lj(r,R.src.startSec));return d.jsx("div",{"data-testid":`timeline-cut-seam-${R.startSec}-${R.endSec}`,title:"Restore cut — the material returns on the next produce/Render",onMouseDown:V=>{V.stopPropagation(),V.preventDefault(),u.restoreChunk(C)},style:{...eM,left:`${P}%`},children:d.jsx("div",{style:tM})},`cut-${C}-${R.startSec}-${R.endSec}`)}),x?d.jsxs("div",{"data-testid":"drag-readout",style:{...ig,left:`${o>0?x.startSec/o*100:0}%`,transform:o>0&&x.startSec/o>.85?"translateX(-100%)":ig.transform},children:[Qu(x.startSec,i)," – ",Qu(x.endSec,i)]}):null,(x==null?void 0:x.snapped)!==null&&(x==null?void 0:x.snapped)!==void 0?d.jsx("div",{"data-testid":"snap-tick",style:{...nM,left:`${o>0?x.snapped/o*100:0}%`}}):null,d.jsx("div",{"data-testid":"playhead",style:{...rM,left:`${D}%`},children:d.jsx("div",{"data-testid":"playhead-grab",onMouseDown:R=>{R.stopPropagation(),R.preventDefault(),y.current=!0},style:oM})})]})]})})]})},Uj={flexShrink:0,borderTop:"1px solid #1E1E24",background:"#111116",padding:"6px 20px 8px"},Hj={display:"flex",justifyContent:"flex-end",alignItems:"center",gap:6,marginBottom:4},Ju={width:22,height:18,fontSize:12,lineHeight:1,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:4,cursor:"pointer",padding:0},Zj={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3",minWidth:26,textAlign:"center"},Yj={fontSize:10,color:"#55555f",marginRight:4,userSelect:"none"},Kj={overflowX:"auto",overflowY:"hidden"},Xj={position:"relative",height:18,padding:"0 2px",marginBottom:4,borderBottom:"1px solid #1E1E24",cursor:"ew-resize",userSelect:"none"},ec={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3"},Gj={position:"relative",height:44,background:"#0F0F14",border:"1px solid #2A2A33",borderRadius:6,overflow:"visible",userSelect:"none"},rg={position:"absolute",top:3,bottom:3,borderRadius:4,boxSizing:"border-box",cursor:"pointer",display:"flex",alignItems:"center",overflow:"hidden"},ua={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",textTransform:"uppercase",letterSpacing:"0.04em",color:"#9A9AA3",padding:"0 8px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",pointerEvents:"none"},qj={position:"absolute",top:3,right:3,fontSize:9,fontFamily:"ui-monospace, 'SF Mono', monospace",letterSpacing:"0.04em",textTransform:"uppercase",color:"#0B0B0E",background:"#ffe14d",padding:"1px 5px",borderRadius:3,pointerEvents:"none"},Qj={position:"absolute",top:3,bottom:3,zIndex:3,pointerEvents:"none",borderRadius:4,border:"1px solid rgba(255,92,92,0.6)",background:"repeating-linear-gradient(135deg, rgba(255,92,92,0.22), rgba(255,92,92,0.22) 6px, transparent 6px, transparent 12px)"},Jj={position:"absolute",left:0,right:0,top:"50%",height:2,background:"rgba(255,92,92,0.8)"},eM={position:"absolute",top:-4,bottom:-4,width:12,marginLeft:-6,zIndex:4,cursor:"pointer",pointerEvents:"auto"},tM={position:"absolute",left:"50%",top:0,bottom:0,width:2,background:"#FF5C5C",pointerEvents:"none"},og={position:"absolute",top:0,bottom:0,width:zj},nM={position:"absolute",top:-4,bottom:-4,width:1,zIndex:6,background:"#FFE14D",pointerEvents:"none"},ig={position:"absolute",bottom:"100%",marginBottom:3,transform:"translateX(-4px)",whiteSpace:"nowrap",fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#0B0B0E",background:"#FFE14D",padding:"1px 5px",borderRadius:3,zIndex:6,pointerEvents:"none"},rM={position:"absolute",top:-26,bottom:-4,width:2,zIndex:5,background:"#FFE14D",pointerEvents:"none"},oM={position:"absolute",top:0,bottom:0,left:-4,width:10,pointerEvents:"auto",cursor:"ew-resize"},iM=({baseLines:e,liveLines:t,fps:n,playerRef:r,edits:o,width:i})=>{const[s,a]=c.useState(""),[l,u]=c.useState(null),[f,p]=c.useState(null),m=c.useRef(null),h=c.useMemo(()=>{var T;const E=[];let I=0;for(let _=0;_<t.length;_++){const $=t[_],j=e[_];for(let L=0;L<$.words.length;L++){const M=$.words[L];E.push({index:I,base:((T=j==null?void 0:j.words[L])==null?void 0:T.text)??M.text,live:M.text,start:M.start,end:M.end,lineStart:$.start}),I++}}return E},[e,t]);c.useEffect(()=>{const E=r.current;if(!E)return;const I=T=>{const _=T.detail.frame/n,$=h.find(j=>_>=j.start&&_<j.end);p(j=>$?$.index===j?j:$.index:j)};return E.addEventListener("frameupdate",I),()=>E.removeEventListener("frameupdate",I)},[r,n,h]),c.useEffect(()=>{var E,I,T;f!==null&&((T=(I=(E=m.current)==null?void 0:E.querySelector(`[data-testid="transcript-word-${f}"]`))==null?void 0:I.scrollIntoView)==null||T.call(I,{block:"nearest"}))},[f]);const y=s.trim().toLowerCase(),g=c.useMemo(()=>y?h.filter(E=>E.live.toLowerCase().includes(y)).map(E=>E.index):[],[y,h]),S=c.useMemo(()=>y?new Set(g):null,[y,g]),[v,w]=c.useState(0),x=E=>{var I,T,_;(_=(T=(I=m.current)==null?void 0:I.querySelector(`[data-testid="transcript-word-${E}"]`))==null?void 0:T.scrollIntoView)==null||_.call(T,{block:"center"})};c.useEffect(()=>{w(0),g.length>0&&x(g[0])},[g]);const b=E=>{if(g.length===0)return;const I=(v+E+g.length)%g.length;w(I),x(g[I])},k=(E,I,T)=>{const _=T.trim();_&&o.patchCaption(E,_,I),u(null)};return d.jsxs("div",{"data-testid":"transcript-panel",style:{...sM,width:i},children:[d.jsxs("div",{style:aM,children:[d.jsx("span",{style:lM,children:"Transcript"}),d.jsx("div",{style:uM,children:"Click a word to jump the preview there; double-click to retype it. 1:1 retype only — word count and timing stay fixed, so scene anchors and the caption highlight keep working."}),d.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[d.jsx("input",{"data-testid":"transcript-search",style:{...cM,flex:1},placeholder:"Find a word…",value:s,onChange:E=>a(E.target.value),onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),b(E.shiftKey?-1:1))}}),d.jsx("button",{"data-testid":"transcript-prev",style:sg,onClick:()=>b(-1),disabled:g.length===0,title:"Previous match (⇧Enter)","aria-label":"Previous match",children:"‹"}),d.jsx("button",{"data-testid":"transcript-next",style:sg,onClick:()=>b(1),disabled:g.length===0,title:"Next match (Enter)","aria-label":"Next match",children:"›"})]}),S?d.jsx("div",{"data-testid":"transcript-match-count",style:{fontSize:11,color:"#9A9AA3"},children:g.length===0?"0 matches":`${v+1}/${g.length} match${g.length===1?"":"es"}`}):null]}),d.jsx("div",{style:dM,"data-testid":"transcript-body",ref:m,children:h.map((E,I)=>d.jsxs(J.Fragment,{children:[I>0?" ":null,(l==null?void 0:l.index)===E.index?d.jsx("input",{autoFocus:!0,"data-testid":"transcript-edit",style:vM,value:l.draft,onChange:T=>u({index:E.index,draft:T.target.value}),onBlur:()=>k(E.index,E.base,l.draft),onKeyDown:T=>{T.key==="Enter"&&T.target.blur(),T.key==="Escape"&&u(null)}}):d.jsx("span",{"data-testid":`transcript-word-${E.index}`,onClick:()=>{var T;return(T=r.current)==null?void 0:T.seekTo(Math.round(E.start*n))},onDoubleClick:()=>u({index:E.index,draft:E.live}),title:E.live!==E.base?`edited (was “${E.base}”) — double-click to retype`:"click to jump · double-click to retype",style:{...fM,...S!=null&&S.has(E.index)?pM:{},...g[v]===E.index?mM:{},...E.live!==E.base?hM:{},...f===E.index?gM:{}},children:E.live})]},E.index))})]})},sM={flexShrink:0,display:"flex",flexDirection:"column",background:"#111116",minHeight:0},aM={display:"flex",flexDirection:"column",gap:8,padding:"14px 14px 10px",borderBottom:"1px solid #1E1E24"},lM={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"#9A9AA3"},uM={fontSize:11,lineHeight:1.45,color:"#6a6a75"},cM={fontFamily:"'Inter', system-ui, sans-serif",fontSize:13,background:"#0F0F14",border:"1px solid #2A2A33",borderRadius:6,color:"#fff",padding:"6px 8px"},dM={flex:1,overflowY:"auto",overflowX:"hidden",overflowWrap:"break-word",padding:"10px 14px 16px",fontSize:13,lineHeight:2,color:"#C9C9D4"},fM={cursor:"pointer",borderRadius:3,padding:"1px 2px"},pM={background:"#2b2b1a",outline:"1px solid #6b6432"},mM={background:"#3d3a17",outline:"2px solid #FFE14D",color:"#fff"},sg={width:26,height:30,fontSize:16,lineHeight:1,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:6,cursor:"pointer",padding:0},hM={color:"#FFE14D"},gM={background:"#1c2333",outline:"1px solid #5b8cff"},vM={fontFamily:"'Inter', system-ui, sans-serif",fontSize:13,width:110,background:"#0F0F14",border:"1px solid #FFE14D",borderRadius:4,color:"#fff",padding:"1px 4px"},yM=[{title:"transport",rows:[["space","play / pause"],["J / K / L","reverse · pause · forward (tap again to speed up)"],["← / →","step one frame back / forward"],["⌘/ctrl + ← / →","jump to and select the previous / next scene"]]},{title:"selection",rows:[["click","select scene or element"],["⌥ + ← / →","select previous / next scene"],["esc","clear selection · close dialogs"]]},{title:"editing",rows:[["⌘/ctrl + B","split the scene at the playhead"],["delete / backspace","delete the selected scene (restorable)"],["⌘/ctrl + Z","undo"],["⌘/ctrl + ⇧ + Z","redo (⌘Y works too)"],["⌘/ctrl + S","save"],["double-click caption word","retype it in place"],["drag element / corner handles","move · resize"],["drag picture","pan the video framing"],["drag a scene block / edge on the timeline","snaps to scene edges + the playhead (hold ⌥ while dragging to disable)"],["drag a box on the stage","snaps to centre / safe-area guides (hold ⌥ mid-drag to disable)"]]},{title:"view",rows:[["⌘/ctrl + scroll on preview","zoom the view (never edits)"],["⌥-drag / middle-drag","pan the zoomed view"],["⌘/ctrl + scroll on timeline","zoom the timeline"],["?","this reference"]]}],wM=({onClose:e})=>(c.useEffect(()=>{const t=n=>{n.key==="Escape"&&(n.stopPropagation(),e())};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e]),d.jsx("div",{style:xM,onMouseDown:e,children:d.jsxs("div",{"data-testid":"shortcuts-modal",style:bM,onMouseDown:t=>t.stopPropagation(),children:[d.jsxs("div",{style:SM,children:[d.jsx("span",{style:EM,children:"keybinds"}),d.jsx("span",{style:kM,children:"esc close"})]}),d.jsx("div",{style:CM,children:"available commands and configured shortcuts"}),yM.map(t=>d.jsxs("div",{style:{marginTop:18},children:[d.jsx("div",{style:IM,children:t.title}),t.rows.map(([n,r])=>d.jsxs("div",{style:TM,children:[d.jsx("span",{style:RM,children:n}),d.jsx("span",{style:_M,children:r})]},n))]},t.title))]})})),xM={position:"fixed",inset:0,zIndex:30,background:"rgba(5,5,8,0.6)",display:"flex",alignItems:"center",justifyContent:"center"},bM={width:620,maxWidth:"90vw",maxHeight:"82vh",overflowY:"auto",background:"#12121A",border:"1px solid #3A3A48",borderRadius:8,padding:"20px 26px 26px",fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace"},SM={display:"flex",justifyContent:"space-between",alignItems:"center"},EM={fontSize:18,fontWeight:700,color:"#EDEDF2"},kM={fontSize:13,fontWeight:700,color:"#0B0B0E",background:"#a8c7fa",borderRadius:4,padding:"3px 10px"},CM={fontSize:13,color:"#6a6a75",marginTop:4},IM={fontSize:14,fontWeight:700,color:"#8ab4f8",marginBottom:6},TM={display:"flex",gap:16,padding:"3px 0"},RM={width:290,flexShrink:0,color:"#c5a3ff",fontWeight:600,fontSize:13},_M={color:"#C9C9D4",fontSize:13},ag=({recent:e,required:t,onOpen:n,onClose:r})=>{const[o,i]=c.useState(null),[s,a]=c.useState(null),[l,u]=c.useState(!1),f=c.useRef(null),[p,m]=c.useState(!1),h=()=>{const S=f.current;if(!S){m(!1);return}m(S.scrollTop+S.clientHeight<S.scrollHeight-1)},y=async S=>{try{const v=await fetch(`/api/fs${S?`?dir=${encodeURIComponent(S)}`:""}`),w=await v.json();if(!v.ok)throw new Error(w.error??`listing failed: ${v.status}`);i(w)}catch(v){a(v instanceof Error?v.message:String(v))}};c.useEffect(()=>{y()},[]),c.useEffect(()=>(h(),window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)),[o]),c.useEffect(()=>{if(t)return;const S=v=>{v.key==="Escape"&&(v.stopPropagation(),r())};return window.addEventListener("keydown",S,!0),()=>window.removeEventListener("keydown",S,!0)},[t,r]);const g=S=>{u(!0),a(null),n(S).then(v=>{u(!1),v&&a(v)})};return d.jsx("div",{style:PM,onMouseDown:t?void 0:r,children:d.jsxs("div",{"data-testid":"project-picker",style:FM,onMouseDown:S=>S.stopPropagation(),children:[d.jsxs("div",{style:jM,children:[d.jsx("span",{style:MM,children:t?"open a project":"switch project"}),t?null:d.jsx("button",{"data-testid":"project-picker-close",style:$M,onClick:r,children:"esc close"})]}),d.jsx("div",{style:AM,children:"A project is a work directory a `ossclip produce` run wrote — the folder holding render-props.json."}),s?d.jsx("div",{"data-testid":"project-picker-error",style:NM,children:s}):null,e.length>0?d.jsxs("div",{style:{marginTop:16,flexShrink:0},children:[d.jsx("div",{style:lg,children:"recent"}),d.jsx("div",{className:"ossclip-scroll-list",style:VM,"data-testid":"project-recent-list",children:e.map(S=>d.jsxs("button",{"data-testid":"project-recent",style:tc,disabled:l,onClick:()=>g(S),title:S,children:[d.jsx("span",{style:{color:"#FFE14D",marginRight:8},children:"▸"}),S]},S))})]}):null,d.jsxs("div",{style:OM,children:[d.jsx("div",{style:lg,children:"browse"}),d.jsxs("div",{style:{color:"#6a6a75",fontSize:12,marginBottom:6},children:["Folders only — hidden ones are omitted, and any projects produced inside a folder show up directly as ",d.jsx("span",{style:{color:"#FFE14D"},children:"▸ .ossclip/…"})," entries."]}),o?d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:LM,children:[d.jsx("span",{style:zM,title:o.dir,children:o.dir}),o.isWorkdir?d.jsx("button",{"data-testid":"project-open-current",style:DM,disabled:l,onClick:()=>g(o.dir),children:"open this project"}):null]}),d.jsxs("div",{ref:f,className:"ossclip-scroll-list",style:p?{...ug,...BM}:ug,onScroll:h,"data-testid":"project-fs-list",children:[o.parent?d.jsx("button",{"data-testid":"project-fs-up",style:tc,disabled:l,onClick:()=>void y(o.parent),children:".."}):null,o.entries.map(S=>d.jsxs("button",{"data-testid":S.isWorkdir?"project-fs-workdir":"project-fs-dir",style:{...tc,...S.isWorkdir?WM:{}},disabled:l,onClick:()=>S.isWorkdir?g(S.path):void y(S.path),title:S.path,children:[d.jsx("span",{style:{marginRight:8,color:S.isWorkdir?"#FFE14D":"#6a6a75"},children:S.isWorkdir?"▸":"▪"}),S.name,S.isWorkdir?d.jsx("span",{style:UM,children:"project"}):d.jsx("span",{style:{color:"#55555f"},children:"/"})]},S.path)),o.entries.length===0?d.jsx("div",{style:{color:"#6a6a75",fontSize:12,padding:"6px 8px"},children:"no folders here"}):null]})]}):d.jsx("div",{style:{color:"#6a6a75",fontSize:13},children:"loading…"})]})]})})},PM={position:"fixed",inset:0,zIndex:30,background:"rgba(5,5,8,0.6)",display:"flex",alignItems:"center",justifyContent:"center"},FM={width:620,maxWidth:"90vw",maxHeight:"82vh",display:"flex",flexDirection:"column",background:"#12121A",border:"1px solid #3A3A48",borderRadius:8,padding:"20px 26px 26px",fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace"},jM={display:"flex",justifyContent:"space-between",alignItems:"center"},MM={fontSize:18,fontWeight:700,color:"#EDEDF2"},$M={fontSize:13,fontWeight:700,color:"#0B0B0E",background:"#a8c7fa",border:"none",borderRadius:4,padding:"3px 10px",cursor:"pointer"},AM={fontSize:13,color:"#6a6a75",marginTop:4},NM={marginTop:12,fontSize:13,color:"#FF5C5C"},lg={fontSize:14,fontWeight:700,color:"#8ab4f8",marginBottom:6},LM={display:"flex",alignItems:"center",gap:10,marginBottom:6},zM={fontSize:12,color:"#9A9AA3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},DM={flexShrink:0,fontSize:12,fontWeight:700,color:"#0B0B0E",background:"#FFE14D",border:"1px solid #FFE14D",borderRadius:6,padding:"4px 10px",cursor:"pointer"},OM={marginTop:16,display:"flex",flexDirection:"column",flex:1,minHeight:0},VM={maxHeight:176,overflowY:"auto",flexShrink:0,display:"flex",flexDirection:"column",gap:2},ug={flex:1,minHeight:0,overflowY:"auto",display:"flex",flexDirection:"column",gap:2},BM={maskImage:"linear-gradient(to bottom, black calc(100% - 24px), transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black calc(100% - 24px), transparent 100%)"},tc={display:"block",width:"100%",textAlign:"left",fontFamily:"inherit",fontSize:13,color:"#C9C9D4",background:"transparent",border:"1px solid transparent",borderRadius:6,padding:"5px 8px",cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},WM={color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33"},UM={marginLeft:10,fontSize:11,fontWeight:700,color:"#FFE14D"};function ca(e){for(let t=e.length-1;t>=0;t--){const n=/^\s*(\d{1,3})%\s*$/.exec(e[t]);if(n)return Math.min(100,Number(n[1]))}return null}function HM(e){const t=n=>{for(let r=e.length-1;r>=0;r--)if(n.test(e[r]))return e[r]};return[t(/^▸ producing scenes/),t(/^▸ llm:/)].filter(n=>n!==void 0)}function ZM(e,t){const n=Math.max(0,Math.floor((t-e)/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function YM(e,t){return e?{load:e,notifyDiscard:t}:{load:null,notifyDiscard:!1}}function KM(e){if(e.dirty){if(e.renderRunning){e.onBlocked();return}e.save().catch(t=>e.onSaveError(t instanceof Error?t.message:String(t)))}}function XM(e,t){const{cues:n}=bd(e,t);return op(n,t.splits).filter(o=>{var i;return((i=t.scenes[o.id])==null?void 0:i.hidden)===!0})}const GM=()=>{const e=bj(),t=c.useRef(e.dirty);t.current=e.dirty;const[n,r]=c.useState(!1),[o,i]=c.useState(!1),[s,a]=c.useState(null),[l,u]=c.useState(null),[f,p]=c.useState(null),[m,h]=c.useState(null),[y,g]=c.useState(!1),[S,v]=c.useState(1),[w,x]=c.useState(null),[b,k]=c.useState(!1),[E,I]=c.useState([]),[T,_]=c.useState(null),[$,j]=c.useState(!1),[L,M]=c.useState(null),O=c.useRef(null);c.useEffect(()=>()=>{O.current!==null&&window.clearInterval(O.current)},[]);const[Z,D]=c.useState(null),R=c.useRef(null),C=c.useRef(null),F=c.useRef(null),P=c.useRef(null),[V,W]=c.useState(null),[N,A]=c.useState(null),B=c.useCallback(K=>{var Se;if(F.current=K,A(K),(Se=P.current)==null||Se.disconnect(),P.current=null,!K)return;const te=()=>W({w:Math.max(0,K.clientWidth-rc*2),h:Math.max(0,K.clientHeight-rc*2)});te();const re=new ResizeObserver(te);re.observe(K),P.current=re},[]),[H,z]=c.useState(1),Y=c.useRef(H);Y.current=H;const oe=c.useRef(null),ae=c.useCallback((K,te)=>{const re=F.current,Se=Math.min(8,Math.max(.25,K)),it=Y.current;if(re&&Se!==it){const Ct=re.getBoundingClientRect();oe.current={prev:it,ax:((te==null?void 0:te.x)??Ct.left+Ct.width/2)-Ct.left,ay:((te==null?void 0:te.y)??Ct.top+Ct.height/2)-Ct.top,sl:re.scrollLeft,st:re.scrollTop}}z(Se)},[]);c.useLayoutEffect(()=>{const K=F.current,te=oe.current;if(!K||!te)return;oe.current=null;const re=H/te.prev;K.scrollLeft=(te.sl+te.ax)*re-te.ax,K.scrollTop=(te.st+te.ay)*re-te.ay},[H]),c.useEffect(()=>{const K=N;if(!K)return;const te=re=>{(re.ctrlKey||re.metaKey)&&(re.preventDefault(),ae(Y.current*Math.exp(-re.deltaY*.01),{x:re.clientX,y:re.clientY}))};return K.addEventListener("wheel",te,{passive:!1}),()=>K.removeEventListener("wheel",te)},[N,ae]);const ce=c.useRef(null);c.useEffect(()=>{const K=re=>{const Se=ce.current,it=F.current;!Se||!it||(it.scrollLeft=Se.sl-(re.clientX-Se.x),it.scrollTop=Se.st-(re.clientY-Se.y))},te=()=>{ce.current=null};return window.addEventListener("mousemove",K),window.addEventListener("mouseup",te),()=>{window.removeEventListener("mousemove",K),window.removeEventListener("mouseup",te)}},[]);const[se,G]=c.useState(!1),[ee,Q]=c.useState(()=>{const K=Number(window.localStorage.getItem(cg));return Number.isFinite(K)&&K>0?dg(K):300}),q=c.useRef(null);c.useEffect(()=>{const K=re=>{const Se=q.current;Se&&Q(dg(Se.startW+(re.clientX-Se.startX)))},te=()=>{q.current&&(q.current=null,Q(re=>(window.localStorage.setItem(cg,String(re)),re)))};return window.addEventListener("mousemove",K),window.addEventListener("mouseup",te),()=>{window.removeEventListener("mousemove",K),window.removeEventListener("mouseup",te)}},[]);const[he,Ce]=c.useState(!1),[ve,pe]=c.useState(!0),Re=c.useCallback(K=>{const te=cT({rate:S,playing:y},K);v(te.rate);const re=C.current;re&&(te.playing&&!y&&re.play(),!te.playing&&y&&re.pause())},[S,y]);c.useEffect(()=>{const K=C.current;if(!K)return;const te=()=>g(!0),re=()=>g(!1);return K.addEventListener("play",te),K.addEventListener("pause",re),()=>{K.removeEventListener("play",te),K.removeEventListener("pause",re)}});const be=c.useCallback(()=>{if(O.current!==null)return;const K=window.setInterval(()=>{(async()=>{try{const re=await(await fetch("/api/render/status")).json();if(re.running||re.exitCode===null){M(Se=>({running:re.running,lines:re.lines??[],startedAt:re.startedAt??(Se==null?void 0:Se.startedAt)}));return}if(O.current!==null&&(window.clearInterval(O.current),O.current=null),re.exitCode===0){const it=await(await fetch("/api/production")).json();a(it.renderProps),j(!!it.canRender);const Ct=YM(it.overrides,t.current);Ct.load&&e.load(Ct.load),Ct.notifyDiscard&&r(!0),M(null)}else M({running:!1,lines:re.lines??[],failed:re.exitCode,cancelled:re.cancelled})}catch{O.current===null&&be()}})()},1e3);O.current=K},[]),we=c.useCallback(async()=>{const K=await fetch("/api/production");if(!K.ok)throw new Error(`GET /api/production failed: ${K.status}`);const te=await K.json();if(I(te.recent??[]),te.noWorkdir){k(!0);return}a(te.renderProps),_(te.workdir??null),j(!!te.canRender),e.load(te.overrides),fetch("/api/usage").then(async it=>u(it.ok?await it.json():null)).catch(()=>u(null));const Se=await(await fetch("/api/render/status")).json();Se.running&&(M({running:!0,lines:Se.lines??[],startedAt:Se.startedAt}),be())},[be]);c.useEffect(()=>{we().catch(K=>p(K instanceof Error?K.message:String(K)))},[]);const Pe=c.useCallback(async K=>{if(e.dirty&&!window.confirm("Unsaved edits will be lost — switch projects anyway?"))return null;try{const te=await fetch("/api/workdir",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:K})}),re=await te.json().catch(()=>({}));return te.ok?(h(null),x(null),D(null),M(null),z(1),a(null),k(!1),await we(),null):re.error??`open failed: ${te.status}`}catch(te){return te instanceof Error?te.message:String(te)}},[e.dirty,we]),ue=c.useMemo(()=>{if(!s)return null;const K=(s.baseSceneCues??s.sceneCues??[]).filter(It=>It.kind!=="plain"),te=s.baseTheme??s.theme??aF,{cues:re}=bd(K,e.doc),{cues:Se}=CF(re,e.doc),it=AF(Se,{outputDurationSec:s.outputDurationSec,clipStarts:(s.spans??[]).map(It=>It.outIn)}),Ct=op(it,e.doc.splits),{cues:ou}=bd(Ct,e.doc),{cues:Es}=Xw(ou,e.doc);let ei=w?Es.map(It=>It.id===w.sceneId?{...It,video:{...It.video,...w.patch}}:It):Es;Z&&(ei=ei.map(It=>It.id===Z.sceneId?{...It,graphicRect:Z.rect}:It));const iu=s.baseCaptionLines??s.captionLines??[];return{...s,sceneCues:ei,captionLines:IF(iu,e.doc.captions).lines,theme:TF(te,e.doc),captionsHidden:s.captionsHiddenByFlag===!0||e.doc.captionsHidden===!0,videoFileName:`/media/${s.videoFileName}`}},[s,e.doc,w,Z]),Ge=()=>{KM({dirty:e.dirty,renderRunning:(L==null?void 0:L.running)===!0,save:e.save,onBlocked:()=>i(!0),onSaveError:K=>p(K)})},Et=c.useCallback(async()=>{try{e.dirty&&await e.save();const K=await fetch("/api/render",{method:"POST"});if(!K.ok){const te=await K.json().catch(()=>({}));throw new Error(te.error??`render failed to start: ${K.status}`)}M({running:!0,lines:[],startedAt:Date.now()}),be()}catch(K){p(K instanceof Error?K.message:String(K))}},[e,be]),At=c.useMemo(()=>{if(!s)return[];const K=(s.baseSceneCues??s.sceneCues??[]).filter(te=>te.kind!=="plain");return XM(K,e.doc)},[s,e.doc]),kt=c.useMemo(()=>m?(ue==null?void 0:ue.sceneCues.find(K=>K.id===m.sceneId))??At.find(K=>K.id===m.sceneId)??null:null,[ue,m,At]),hn=c.useMemo(()=>{if(!kt||!ue)return;const K=ue.captionLines.filter(re=>re.start<kt.endSec&&re.end>kt.startSec).flatMap(re=>re.words).filter(re=>re.start<kt.endSec&&re.end>kt.startSec).map(re=>re.text);if(K.length===0)return;const te=K.join(" ");return te.length>90?`${te.slice(0,90)}…`:te},[kt,ue]);if(f)return d.jsx("div",{style:nc,children:d.jsxs("div",{style:{padding:24,color:"#FF5C5C",fontFamily:"ui-monospace, monospace"},children:["Couldn't load the production: ",f]})});if(!ue)return d.jsx("div",{style:nc,children:b?d.jsx(ag,{recent:E,required:!0,onOpen:Pe,onClose:()=>{}}):d.jsx("div",{style:{padding:24,color:"#9A9AA3"},children:"Loading production…"})});const Un=ue.settings.width/ue.settings.height,Er=V?Math.max(220,Math.min(V.w,V.h*Un)):380,Ht=Math.round(Er*H);return d.jsxs("div",{style:nc,children:[d.jsxs("div",{style:e$,children:[d.jsx("span",{style:t$,children:"ossclip"}),T?d.jsx("span",{"data-testid":"workdir-label",style:n$,title:T,children:T.split("/").filter(Boolean).slice(-2).join("/")}):null,d.jsxs("div",{style:{display:"flex",gap:8},children:[d.jsx("button",{"data-testid":"open-button",style:Yt,onClick:()=>k(!0),title:T?`Open another project — currently ${T}`:"Open another project",children:"Open"}),d.jsx("button",{"data-testid":"undo-button",style:Yt,onClick:()=>e.undo(),disabled:!e.canUndo,title:"Undo (⌘Z)","aria-label":"Undo",children:d.jsx(QM,{})}),d.jsx("button",{"data-testid":"redo-button",style:Yt,onClick:()=>e.redo(),disabled:!e.canRedo,title:"Redo (⌘⇧Z)","aria-label":"Redo",children:d.jsx(JM,{})}),d.jsx("button",{"data-testid":"transcript-toggle",style:{...Yt,...se?{borderColor:"#5b8cff"}:{}},onClick:()=>G(K=>!K),title:"Find and retype caption words across the whole transcript",children:"Transcript"}),d.jsx("button",{style:{...Yt,...e.dirty?o$:{}},onClick:Ge,disabled:!e.dirty||(L==null?void 0:L.running)===!0,title:(L==null?void 0:L.running)===!0?"Can't save while a render is running":void 0,children:"Save"}),d.jsx("button",{"data-testid":"render-button",style:Yt,onClick:()=>void Et(),disabled:!$||(L==null?void 0:L.running)===!0,title:$?"Saves if needed, then replays the last completed produce command — pipeline flags come from that run; your saved edits apply on top":"No command.json in this workdir — run `ossclip produce` once in a terminal; it records the invocation and Render replays it",children:L!=null&&L.running?"Rendering…":"Render"})]}),d.jsx("span",{style:{...r$,color:e.dirty?"#FFE14D":"#5FBF77"},...e.dirty?{"data-testid":"dirty"}:{},children:e.dirty?"● Unsaved changes":"✓ Saved"}),d.jsx("button",{"data-testid":"shortcuts-button",style:{...Yt,padding:"7px 10px"},onClick:()=>Ce(K=>!K),title:"Keyboard shortcuts (?)",children:"?"})]}),he?d.jsx(wM,{onClose:()=>Ce(!1)}):null,b?d.jsx(ag,{recent:E,required:!1,onOpen:Pe,onClose:()=>k(!1)}):null,L?d.jsxs("div",{"data-testid":"render-log",style:{...p$,borderColor:L.failed!==void 0?"#FF5C5C":"#2A2A33"},children:[L.failed!==void 0?d.jsxs("div",{style:{color:L.cancelled?"#9A9AA3":"#FF5C5C",marginBottom:4},"data-testid":L.cancelled?"render-cancelled":"render-failed",children:[L.cancelled?"render cancelled":`render failed (exit ${L.failed})`,d.jsx("button",{style:{...Yt,marginLeft:10,padding:"2px 8px"},onClick:()=>M(null),children:"Dismiss"})]}):null,L.running?d.jsxs("div",{"data-testid":"render-status",style:m$,children:[d.jsx("style",{children:"@keyframes ossclip-spin { to { transform: rotate(360deg) } }"}),d.jsx("span",{style:h$,"aria-hidden":!0}),d.jsxs("span",{style:{color:"#EDEDF2"},children:["rendering",L.startedAt!=null?` · ${ZM(L.startedAt,Date.now())}`:"",ca(L.lines)!==null?` · ${ca(L.lines)}%`:""]}),ca(L.lines)!==null?d.jsx("div",{style:g$,children:d.jsx("div",{"data-testid":"render-progress-bar",style:{...v$,width:`${ca(L.lines)}%`}})}):null,d.jsx("button",{"data-testid":"render-cancel",style:{...Yt,padding:"2px 8px"},onClick:()=>void fetch("/api/render/cancel",{method:"POST"}),children:"Cancel"}),d.jsx("button",{"data-testid":"render-logs-toggle",style:{...Yt,padding:"2px 8px"},onClick:()=>pe(K=>!K),title:ve?"Collapse the log":"Expand the log",children:ve?"▾ logs":"▸ logs"})]}):null,ve?d.jsxs(d.Fragment,{children:[HM(L.lines).map(K=>d.jsx("div",{"data-testid":"render-pinned",style:{color:"#C9C9D4"},children:K},K)),d.jsx(qM,{lines:L.lines})]}):null]}):null,n?d.jsxs("div",{"data-testid":"reanchor-notice",style:fg,children:["Render re-anchored your saved cuts and splits — edits made while it ran were dropped, not merged, to avoid overwriting that anchor.",d.jsx("button",{style:{...Yt,marginLeft:10,padding:"2px 8px"},onClick:()=>r(!1),children:"Dismiss"})]}):null,o?d.jsxs("div",{"data-testid":"save-blocked-notice",style:fg,children:["Can't save while a render is running — it's writing its own overrides.json right now. Wait for it to finish (or cancel it) before saving.",d.jsx("button",{style:{...Yt,marginLeft:10,padding:"2px 8px"},onClick:()=>i(!1),children:"Dismiss"})]}):null,d.jsxs("div",{style:i$,children:[se?d.jsxs(d.Fragment,{children:[d.jsx(iM,{baseLines:(s==null?void 0:s.baseCaptionLines)??(s==null?void 0:s.captionLines)??[],liveLines:ue.captionLines,fps:ue.settings.fps,playerRef:C,edits:e,width:ee}),d.jsx("div",{"data-testid":"transcript-divider",style:s$,title:"Drag to resize the transcript pane",onMouseDown:K=>{K.preventDefault(),q.current={startX:K.clientX,startW:ee}}})]}):null,d.jsxs("div",{style:a$,children:[d.jsx("div",{ref:B,style:l$,onMouseDown:K=>{if(K.altKey||K.button===1){K.preventDefault();const te=F.current;te&&(ce.current={x:K.clientX,y:K.clientY,sl:te.scrollLeft,st:te.scrollTop})}},children:d.jsx("div",{style:{margin:"auto",padding:rc},children:d.jsxs("div",{ref:R,"data-testid":"stage","data-playing":y?"true":"false","data-rate":S,style:{position:"relative",display:"inline-block"},children:[d.jsx(rT,{ref:C,component:vj,inputProps:ue,durationInFrames:Math.max(1,Math.round(ue.outputDurationSec*ue.settings.fps)),fps:ue.settings.fps,compositionWidth:ue.settings.width,compositionHeight:ue.settings.height,style:{width:Ht},controls:!0,clickToPlay:!1,playbackRate:S}),d.jsx(Rj,{stageRef:R,selection:m,onSelect:h,edits:e,onSave:Ge,settings:ue.settings,cues:ue.sceneCues,playerRef:C,cue:kt,onTransport:Re,onVideoPreview:x,onGraphicPreview:D,onToggleHelp:()=>Ce(K=>!K)}),d.jsx("button",{"data-testid":"rate-chip",onClick:()=>Re("L"),title:"Playback rate — click to speed up (J/K/L on the keyboard)",style:y$,children:S<0?`◂◂ ${Math.abs(S)}×`:`${S}×`})]})})}),d.jsxs("div",{style:u$,children:[d.jsx("button",{"data-testid":"view-zoom-out",style:oc,onClick:()=>ae(H/2),disabled:H<=.25,title:"Zoom the preview out — below 100% shrinks under the fitted size",children:"−"}),d.jsxs("span",{"data-testid":"view-zoom-level",style:c$,children:[Math.round(H*100),"%"]}),d.jsx("button",{"data-testid":"view-zoom-in",style:oc,onClick:()=>ae(H*2),disabled:H>=8,title:"Zoom the preview in — a viewing magnifier, it never edits the video",children:"+"}),d.jsx("button",{"data-testid":"view-zoom-fit",style:{...oc,width:"auto",padding:"0 8px"},onClick:()=>ae(1),disabled:Math.abs(H-1)<.001,title:"Fit the preview to the window",children:"fit"}),d.jsx("span",{style:d$,children:"⌥-drag pans"})]})]}),d.jsx("div",{style:f$,children:d.jsx(Pj,{selection:m,cue:kt,frame:{width:ue.settings.width,height:ue.settings.height},allSceneIds:ue.sceneCues.map(K=>K.id),edits:e,onSelect:h,resolvedTheme:ue.theme,anchorText:hn,onVideoPreview:x,runInfo:l,captionsHiddenByFlag:(s==null?void 0:s.captionsHiddenByFlag)===!0})})]}),d.jsx(Wj,{cues:ue.sceneCues,ghosts:At,cuts:e.doc.cuts,spans:ue.spans??[],durationSec:ue.outputDurationSec,fps:ue.settings.fps,playerRef:C,selection:m,onSelect:h,edits:e,videoSrc:ue.videoFileName,toSourceSec:K=>{var te;for(const re of ue.spans??[])if(K>=re.outIn&&K<re.outOut)return re.srcIn+(K-re.outIn);return((te=(ue.spans??[])[0])==null?void 0:te.srcIn)??K}})]})},qM=({lines:e})=>{const t=c.useRef(null),n=c.useRef(!0);return c.useEffect(()=>{const r=t.current;r&&n.current&&(r.scrollTop=r.scrollHeight)},[e]),d.jsx("div",{ref:t,"data-testid":"render-tail",onScroll:r=>{const o=r.currentTarget;n.current=o.scrollTop+o.clientHeight>=o.scrollHeight-8},style:{maxHeight:220,overflowY:"auto"},children:e.map((r,o)=>d.jsx("div",{children:r},o))})},QM=()=>d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:[d.jsx("path",{d:"M9 14 4 9l5-5"}),d.jsx("path",{d:"M4 9h10.5a5.5 5.5 0 0 1 0 11H11"})]}),JM=()=>d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:[d.jsx("path",{d:"m15 14 5-5-5-5"}),d.jsx("path",{d:"M20 9H9.5a5.5 5.5 0 0 0 0 11H13"})]}),nc={fontFamily:"'Inter', system-ui, sans-serif",background:"#0B0B0E",color:"#EDEDF2",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column"},e$={display:"flex",alignItems:"center",gap:14,padding:"10px 20px",borderBottom:"1px solid #1E1E24",background:"#111116"},t$={fontWeight:800,fontSize:14,letterSpacing:"0.02em",color:"#FFE14D",marginRight:8},n$={fontSize:12,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#6a6a75",maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},r$={fontSize:12,fontFamily:"ui-monospace, 'SF Mono', monospace",marginLeft:"auto"},Yt={fontSize:12,fontWeight:600,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:6,padding:"7px 12px",cursor:"pointer"},o$={background:"#FFE14D",color:"#0B0B0E",border:"1px solid #FFE14D"},i$={display:"flex",flex:1,minHeight:0},rc=32,cg="ossclip.transcriptWidth",dg=e=>Math.min(640,Math.max(220,e)),s$={width:5,flexShrink:0,cursor:"col-resize",background:"#1E1E24",borderLeft:"1px solid #2A2A33"},a$={position:"relative",flex:1,minWidth:0},l$={position:"absolute",inset:0,display:"flex",overflow:"auto"},u$={position:"absolute",top:10,left:10,zIndex:6,display:"flex",alignItems:"center",gap:6,padding:"4px 6px",background:"rgba(17,17,22,0.85)",border:"1px solid #2A2A33",borderRadius:6},oc={width:22,height:18,fontSize:12,lineHeight:1,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:4,cursor:"pointer",padding:0},c$={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3",minWidth:34,textAlign:"center"},d$={fontSize:10,color:"#55555f",userSelect:"none"},f$={width:260,flexShrink:0,borderLeft:"1px solid #1E1E24",background:"#111116",overflowY:"auto"},p$={fontSize:11,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3",background:"#0F0F14",borderBottom:"1px solid #2A2A33",padding:"6px 20px",whiteSpace:"pre-wrap",flexShrink:0},fg={display:"flex",alignItems:"center",fontSize:12,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#FFE14D",background:"#0F0F14",borderBottom:"1px solid #2A2A33",padding:"6px 20px",flexShrink:0},m$={display:"flex",alignItems:"center",gap:10,marginBottom:4},h$={width:12,height:12,flexShrink:0,border:"2px solid #2A2A33",borderTopColor:"#FFE14D",borderRadius:"50%",animation:"ossclip-spin 0.8s linear infinite"},g$={flex:1,maxWidth:260,height:4,background:"#1E1E24",borderRadius:2,overflow:"hidden"},v$={height:"100%",background:"#FFE14D",borderRadius:2,transition:"width 0.6s ease"},y$={position:"absolute",top:8,right:8,zIndex:5,fontSize:11,fontWeight:700,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#FFE14D",background:"rgba(11,11,14,0.75)",border:"1px solid #2A2A33",borderRadius:6,padding:"3px 8px",cursor:"pointer"};ic.createRoot(document.getElementById("root")).render(d.jsx(J.StrictMode,{children:d.jsx(GM,{})}));
|