ossclip 0.1.24 → 0.1.25

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.
@@ -0,0 +1,163 @@
1
+ var E1=Object.defineProperty;var C1=(e,t,n)=>t in e?E1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Se=(e,t,n)=>C1(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function I1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var iv={exports:{}},Tl={},sv={exports:{}},pe={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var ys=Symbol.for("react.element"),T1=Symbol.for("react.portal"),R1=Symbol.for("react.fragment"),_1=Symbol.for("react.strict_mode"),P1=Symbol.for("react.profiler"),j1=Symbol.for("react.provider"),F1=Symbol.for("react.context"),$1=Symbol.for("react.forward_ref"),M1=Symbol.for("react.suspense"),A1=Symbol.for("react.memo"),N1=Symbol.for("react.lazy"),Lp=Symbol.iterator;function L1(e){return e===null||typeof e!="object"?null:(e=Lp&&e[Lp]||e["@@iterator"],typeof e=="function"?e:null)}var av={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},lv=Object.assign,uv={};function qo(e,t,n){this.props=e,this.context=t,this.refs=uv,this.updater=n||av}qo.prototype.isReactComponent={};qo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};qo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function cv(){}cv.prototype=qo.prototype;function Kd(e,t,n){this.props=e,this.context=t,this.refs=uv,this.updater=n||av}var Gd=Kd.prototype=new cv;Gd.constructor=Kd;lv(Gd,qo.prototype);Gd.isPureReactComponent=!0;var zp=Array.isArray,dv=Object.prototype.hasOwnProperty,Xd={current:null},fv={key:!0,ref:!0,__self:!0,__source:!0};function pv(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)dv.call(t,r)&&!fv.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:ys,type:e,key:i,ref:s,props:o,_owner:Xd.current}}function z1(e,t){return{$$typeof:ys,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function qd(e){return typeof e=="object"&&e!==null&&e.$$typeof===ys}function D1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Dp=/\/+/g;function Cu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?D1(""+e.key):t.toString(36)}function Ra(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case ys:case T1:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Cu(s,0):r,zp(o)?(n="",e!=null&&(n=e.replace(Dp,"$&/")+"/"),Ra(o,t,n,"",function(u){return u})):o!=null&&(qd(o)&&(o=z1(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Dp,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",zp(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Cu(i,a);s+=Ra(i,t,n,l,o)}else if(l=L1(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Cu(i,a++),s+=Ra(i,t,n,l,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Ws(e,t,n){if(e==null)return e;var r=[],o=0;return Ra(e,r,"","",function(i){return t.call(n,i,o++)}),r}function O1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var kt={current:null},_a={transition:null},B1={ReactCurrentDispatcher:kt,ReactCurrentBatchConfig:_a,ReactCurrentOwner:Xd};function mv(){throw Error("act(...) is not supported in production builds of React.")}pe.Children={map:Ws,forEach:function(e,t,n){Ws(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ws(e,function(){t++}),t},toArray:function(e){return Ws(e,function(t){return t})||[]},only:function(e){if(!qd(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};pe.Component=qo;pe.Fragment=R1;pe.Profiler=P1;pe.PureComponent=Kd;pe.StrictMode=_1;pe.Suspense=M1;pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=B1;pe.act=mv;pe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=lv({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Xd.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)dv.call(t,l)&&!fv.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:ys,type:e.type,key:o,ref:i,props:r,_owner:s}};pe.createContext=function(e){return e={$$typeof:F1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:j1,_context:e},e.Consumer=e};pe.createElement=pv;pe.createFactory=function(e){var t=pv.bind(null,e);return t.type=e,t};pe.createRef=function(){return{current:null}};pe.forwardRef=function(e){return{$$typeof:$1,render:e}};pe.isValidElement=qd;pe.lazy=function(e){return{$$typeof:N1,_payload:{_status:-1,_result:e},_init:O1}};pe.memo=function(e,t){return{$$typeof:A1,type:e,compare:t===void 0?null:t}};pe.startTransition=function(e){var t=_a.transition;_a.transition={};try{e()}finally{_a.transition=t}};pe.unstable_act=mv;pe.useCallback=function(e,t){return kt.current.useCallback(e,t)};pe.useContext=function(e){return kt.current.useContext(e)};pe.useDebugValue=function(){};pe.useDeferredValue=function(e){return kt.current.useDeferredValue(e)};pe.useEffect=function(e,t){return kt.current.useEffect(e,t)};pe.useId=function(){return kt.current.useId()};pe.useImperativeHandle=function(e,t,n){return kt.current.useImperativeHandle(e,t,n)};pe.useInsertionEffect=function(e,t){return kt.current.useInsertionEffect(e,t)};pe.useLayoutEffect=function(e,t){return kt.current.useLayoutEffect(e,t)};pe.useMemo=function(e,t){return kt.current.useMemo(e,t)};pe.useReducer=function(e,t,n){return kt.current.useReducer(e,t,n)};pe.useRef=function(e){return kt.current.useRef(e)};pe.useState=function(e){return kt.current.useState(e)};pe.useSyncExternalStore=function(e,t,n){return kt.current.useSyncExternalStore(e,t,n)};pe.useTransition=function(){return kt.current.useTransition()};pe.version="18.3.1";sv.exports=pe;var d=sv.exports;const te=I1(d);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var V1=d,W1=Symbol.for("react.element"),H1=Symbol.for("react.fragment"),U1=Object.prototype.hasOwnProperty,Z1=V1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Y1={key:!0,ref:!0,__self:!0,__source:!0};function hv(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)U1.call(t,r)&&!Y1.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:W1,type:e,key:i,ref:s,props:o,_owner:Z1.current}}Tl.Fragment=H1;Tl.jsx=hv;Tl.jsxs=hv;iv.exports=Tl;var c=iv.exports,_c={},gv={exports:{}},Wt={},vv={exports:{}},yv={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(I,P){var F=I.length;I.push(P);e:for(;0<F;){var O=F-1>>>1,H=I[O];if(0<o(H,P))I[O]=P,I[F]=H,F=O;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var P=I[0],F=I.pop();if(F!==P){I[0]=F;e:for(var O=0,H=I.length,K=H>>>1;O<K;){var N=2*(O+1)-1,L=I[N],X=N+1,Y=I[X];if(0>o(L,F))X<H&&0>o(Y,L)?(I[O]=Y,I[X]=F,O=X):(I[O]=L,I[N]=F,O=N);else if(X<H&&0>o(Y,F))I[O]=Y,I[X]=F,O=X;else break e}}return P}function o(I,P){var F=I.sortIndex-P.sortIndex;return F!==0?F:I.id-P.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,x=!1,v=!1,k=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(I){for(var P=n(u);P!==null;){if(P.callback===null)r(u);else if(P.startTime<=I)r(u),P.sortIndex=P.expirationTime,t(l,P);else break;P=n(u)}}function b(I){if(v=!1,w(I),!x)if(n(l)!==null)x=!0,D(S);else{var P=n(u);P!==null&&R(b,P.startTime-I)}}function S(I,P){x=!1,v&&(v=!1,y(T),T=-1),h=!0;var F=m;try{for(w(P),p=n(l);p!==null&&(!(p.expirationTime>P)||I&&!A());){var O=p.callback;if(typeof O=="function"){p.callback=null,m=p.priorityLevel;var H=O(p.expirationTime<=P);P=e.unstable_now(),typeof H=="function"?p.callback=H:p===n(l)&&r(l),w(P)}else r(l);p=n(l)}if(p!==null)var K=!0;else{var N=n(u);N!==null&&R(b,N.startTime-P),K=!1}return K}finally{p=null,m=F,h=!1}}var C=!1,E=null,T=-1,_=5,j=-1;function A(){return!(e.unstable_now()-j<_)}function z(){if(E!==null){var I=e.unstable_now();j=I;var P=!0;try{P=E(!0,I)}finally{P?$():(C=!1,E=null)}}else C=!1}var $;if(typeof g=="function")$=function(){g(z)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,W=M.port2;M.port1.onmessage=z,$=function(){W.postMessage(null)}}else $=function(){k(z,0)};function D(I){E=I,C||(C=!0,$())}function R(I,P){T=k(function(){I(e.unstable_now())},P)}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(I){I.callback=null},e.unstable_continueExecution=function(){x||h||(x=!0,D(S))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(I){switch(m){case 1:case 2:case 3:var P=3;break;default:P=m}var F=m;m=P;try{return I()}finally{m=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,P){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var F=m;m=I;try{return P()}finally{m=F}},e.unstable_scheduleCallback=function(I,P,F){var O=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?O+F:O):F=O,I){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=F+H,I={id:f++,callback:P,priorityLevel:I,startTime:F,expirationTime:H,sortIndex:-1},F>O?(I.sortIndex=F,t(u,I),n(l)===null&&I===n(u)&&(v?(y(T),T=-1):v=!0,R(b,F-O))):(I.sortIndex=H,t(l,I),x||h||(x=!0,D(S))),I},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(I){var P=m;return function(){var F=m;m=P;try{return I.apply(this,arguments)}finally{m=F}}}})(yv);vv.exports=yv;var K1=vv.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var G1=d,Vt=K1;function q(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var wv=new Set,Xi={};function qr(e,t){Vo(e,t),Vo(e+"Capture",t)}function Vo(e,t){for(Xi[e]=t,e=0;e<t.length;e++)wv.add(t[e])}var Dn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pc=Object.prototype.hasOwnProperty,X1=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Op={},Bp={};function q1(e){return Pc.call(Bp,e)?!0:Pc.call(Op,e)?!1:X1.test(e)?Bp[e]=!0:(Op[e]=!0,!1)}function Q1(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function J1(e,t,n,r){if(t===null||typeof t>"u"||Q1(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Et(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ut[e]=new Et(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ut[t]=new Et(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ut[e]=new Et(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ut[e]=new Et(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ut[e]=new Et(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ut[e]=new Et(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ut[e]=new Et(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ut[e]=new Et(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ut[e]=new Et(e,5,!1,e.toLowerCase(),null,!1,!1)});var Qd=/[\-:]([a-z])/g;function Jd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Qd,Jd);ut[t]=new Et(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Qd,Jd);ut[t]=new Et(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Qd,Jd);ut[t]=new Et(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ut[e]=new Et(e,1,!1,e.toLowerCase(),null,!1,!1)});ut.xlinkHref=new Et("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ut[e]=new Et(e,1,!1,e.toLowerCase(),null,!0,!0)});function ef(e,t,n,r){var o=ut.hasOwnProperty(t)?ut[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(J1(t,n,o,r)&&(n=null),r||o===null?q1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Hn=G1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Hs=Symbol.for("react.element"),yo=Symbol.for("react.portal"),wo=Symbol.for("react.fragment"),tf=Symbol.for("react.strict_mode"),jc=Symbol.for("react.profiler"),xv=Symbol.for("react.provider"),bv=Symbol.for("react.context"),nf=Symbol.for("react.forward_ref"),Fc=Symbol.for("react.suspense"),$c=Symbol.for("react.suspense_list"),rf=Symbol.for("react.memo"),nr=Symbol.for("react.lazy"),Sv=Symbol.for("react.offscreen"),Vp=Symbol.iterator;function hi(e){return e===null||typeof e!="object"?null:(e=Vp&&e[Vp]||e["@@iterator"],typeof e=="function"?e:null)}var Be=Object.assign,Iu;function Fi(e){if(Iu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Iu=t&&t[1]||""}return`
34
+ `+Iu+e}var Tu=!1;function Ru(e,t){if(!e||Tu)return"";Tu=!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
+ `),i=r.stack.split(`
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{Tu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Fi(e):""}function eb(e){switch(e.tag){case 5:return Fi(e.type);case 16:return Fi("Lazy");case 13:return Fi("Suspense");case 19:return Fi("SuspenseList");case 0:case 2:case 15:return e=Ru(e.type,!1),e;case 11:return e=Ru(e.type.render,!1),e;case 1:return e=Ru(e.type,!0),e;default:return""}}function Mc(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 wo:return"Fragment";case yo:return"Portal";case jc:return"Profiler";case tf:return"StrictMode";case Fc:return"Suspense";case $c:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case bv:return(e.displayName||"Context")+".Consumer";case xv:return(e._context.displayName||"Context")+".Provider";case nf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rf:return t=e.displayName||null,t!==null?t:Mc(e.type)||"Memo";case nr:t=e._payload,e=e._init;try{return Mc(e(t))}catch{}}return null}function tb(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 Mc(t);case 8:return t===tf?"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 yr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function kv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function nb(e){var t=kv(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 Us(e){e._valueTracker||(e._valueTracker=nb(e))}function Ev(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=kv(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ha(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 Ac(e,t){var n=t.checked;return Be({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Wp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=yr(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 Cv(e,t){t=t.checked,t!=null&&ef(e,"checked",t,!1)}function Nc(e,t){Cv(e,t);var n=yr(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")?Lc(e,t.type,n):t.hasOwnProperty("defaultValue")&&Lc(e,t.type,yr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Hp(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 Lc(e,t,n){(t!=="number"||Ha(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var $i=Array.isArray;function $o(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=""+yr(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 zc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(q(91));return Be({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Up(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(q(92));if($i(n)){if(1<n.length)throw Error(q(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:yr(n)}}function Iv(e,t){var n=yr(t.value),r=yr(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 Zp(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Tv(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 Dc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Tv(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Zs,Rv=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(Zs=Zs||document.createElement("div"),Zs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Zs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function qi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zi={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},rb=["Webkit","ms","Moz","O"];Object.keys(zi).forEach(function(e){rb.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),zi[t]=zi[e]})});function _v(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||zi.hasOwnProperty(e)&&zi[e]?(""+t).trim():t+"px"}function Pv(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=_v(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var ob=Be({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 Oc(e,t){if(t){if(ob[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(q(62))}}function Bc(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 Vc=null;function of(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wc=null,Mo=null,Ao=null;function Yp(e){if(e=bs(e)){if(typeof Wc!="function")throw Error(q(280));var t=e.stateNode;t&&(t=Fl(t),Wc(e.stateNode,e.type,t))}}function jv(e){Mo?Ao?Ao.push(e):Ao=[e]:Mo=e}function Fv(){if(Mo){var e=Mo,t=Ao;if(Ao=Mo=null,Yp(e),t)for(e=0;e<t.length;e++)Yp(t[e])}}function $v(e,t){return e(t)}function Mv(){}var _u=!1;function Av(e,t,n){if(_u)return e(t,n);_u=!0;try{return $v(e,t,n)}finally{_u=!1,(Mo!==null||Ao!==null)&&(Mv(),Fv())}}function Qi(e,t){var n=e.stateNode;if(n===null)return null;var r=Fl(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(q(231,t,typeof n));return n}var Hc=!1;if(Dn)try{var gi={};Object.defineProperty(gi,"passive",{get:function(){Hc=!0}}),window.addEventListener("test",gi,gi),window.removeEventListener("test",gi,gi)}catch{Hc=!1}function ib(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 Di=!1,Ua=null,Za=!1,Uc=null,sb={onError:function(e){Di=!0,Ua=e}};function ab(e,t,n,r,o,i,s,a,l){Di=!1,Ua=null,ib.apply(sb,arguments)}function lb(e,t,n,r,o,i,s,a,l){if(ab.apply(this,arguments),Di){if(Di){var u=Ua;Di=!1,Ua=null}else throw Error(q(198));Za||(Za=!0,Uc=u)}}function Qr(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 Nv(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 Kp(e){if(Qr(e)!==e)throw Error(q(188))}function ub(e){var t=e.alternate;if(!t){if(t=Qr(e),t===null)throw Error(q(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 Kp(o),e;if(i===r)return Kp(o),t;i=i.sibling}throw Error(q(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(q(189))}}if(n.alternate!==r)throw Error(q(190))}if(n.tag!==3)throw Error(q(188));return n.stateNode.current===n?e:t}function Lv(e){return e=ub(e),e!==null?zv(e):null}function zv(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=zv(e);if(t!==null)return t;e=e.sibling}return null}var Dv=Vt.unstable_scheduleCallback,Gp=Vt.unstable_cancelCallback,cb=Vt.unstable_shouldYield,db=Vt.unstable_requestPaint,Ze=Vt.unstable_now,fb=Vt.unstable_getCurrentPriorityLevel,sf=Vt.unstable_ImmediatePriority,Ov=Vt.unstable_UserBlockingPriority,Ya=Vt.unstable_NormalPriority,pb=Vt.unstable_LowPriority,Bv=Vt.unstable_IdlePriority,Rl=null,Sn=null;function mb(e){if(Sn&&typeof Sn.onCommitFiberRoot=="function")try{Sn.onCommitFiberRoot(Rl,e,void 0,(e.current.flags&128)===128)}catch{}}var un=Math.clz32?Math.clz32:vb,hb=Math.log,gb=Math.LN2;function vb(e){return e>>>=0,e===0?32:31-(hb(e)/gb|0)|0}var Ys=64,Ks=4194304;function Mi(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 Ka(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=Mi(a):(i&=s,i!==0&&(r=Mi(i)))}else s=n&~o,s!==0?r=Mi(s):i!==0&&(r=Mi(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 yb(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 wb(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]=yb(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Zc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Vv(){var e=Ys;return Ys<<=1,!(Ys&4194240)&&(Ys=64),e}function Pu(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ws(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 xb(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 af(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 Wv(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Hv,lf,Uv,Zv,Yv,Yc=!1,Gs=[],ur=null,cr=null,dr=null,Ji=new Map,es=new Map,or=[],bb="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 Xp(e,t){switch(e){case"focusin":case"focusout":ur=null;break;case"dragenter":case"dragleave":cr=null;break;case"mouseover":case"mouseout":dr=null;break;case"pointerover":case"pointerout":Ji.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":es.delete(t.pointerId)}}function vi(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=bs(t),t!==null&&lf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Sb(e,t,n,r,o){switch(t){case"focusin":return ur=vi(ur,e,t,n,r,o),!0;case"dragenter":return cr=vi(cr,e,t,n,r,o),!0;case"mouseover":return dr=vi(dr,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Ji.set(i,vi(Ji.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,es.set(i,vi(es.get(i)||null,e,t,n,r,o)),!0}return!1}function Kv(e){var t=Nr(e.target);if(t!==null){var n=Qr(t);if(n!==null){if(t=n.tag,t===13){if(t=Nv(n),t!==null){e.blockedOn=t,Yv(e.priority,function(){Uv(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);Vc=r,n.target.dispatchEvent(r),Vc=null}else return t=bs(n),t!==null&&lf(t),e.blockedOn=n,!1;t.shift()}return!0}function qp(e,t,n){Pa(e)&&n.delete(t)}function kb(){Yc=!1,ur!==null&&Pa(ur)&&(ur=null),cr!==null&&Pa(cr)&&(cr=null),dr!==null&&Pa(dr)&&(dr=null),Ji.forEach(qp),es.forEach(qp)}function yi(e,t){e.blockedOn===t&&(e.blockedOn=null,Yc||(Yc=!0,Vt.unstable_scheduleCallback(Vt.unstable_NormalPriority,kb)))}function ts(e){function t(o){return yi(o,e)}if(0<Gs.length){yi(Gs[0],e);for(var n=1;n<Gs.length;n++){var r=Gs[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ur!==null&&yi(ur,e),cr!==null&&yi(cr,e),dr!==null&&yi(dr,e),Ji.forEach(t),es.forEach(t),n=0;n<or.length;n++)r=or[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<or.length&&(n=or[0],n.blockedOn===null);)Kv(n),n.blockedOn===null&&or.shift()}var No=Hn.ReactCurrentBatchConfig,Ga=!0;function Eb(e,t,n,r){var o=ke,i=No.transition;No.transition=null;try{ke=1,uf(e,t,n,r)}finally{ke=o,No.transition=i}}function Cb(e,t,n,r){var o=ke,i=No.transition;No.transition=null;try{ke=4,uf(e,t,n,r)}finally{ke=o,No.transition=i}}function uf(e,t,n,r){if(Ga){var o=Kc(e,t,n,r);if(o===null)Ou(e,t,r,Xa,n),Xp(e,r);else if(Sb(o,e,t,n,r))r.stopPropagation();else if(Xp(e,r),t&4&&-1<bb.indexOf(e)){for(;o!==null;){var i=bs(o);if(i!==null&&Hv(i),i=Kc(e,t,n,r),i===null&&Ou(e,t,r,Xa,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Ou(e,t,r,null,n)}}var Xa=null;function Kc(e,t,n,r){if(Xa=null,e=of(r),e=Nr(e),e!==null)if(t=Qr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Nv(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 Xa=e,null}function Gv(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(fb()){case sf:return 1;case Ov:return 4;case Ya:case pb:return 16;case Bv:return 536870912;default:return 16}default:return 16}}var ar=null,cf=null,ja=null;function Xv(){if(ja)return ja;var e,t=cf,n=t.length,r,o="value"in ar?ar.value:ar.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 ja=o.slice(e,1<r?1-r:void 0)}function Fa(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 Xs(){return!0}function Qp(){return!1}function Ht(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)?Xs:Qp,this.isPropagationStopped=Qp,this}return Be(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=Xs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Xs)},persist:function(){},isPersistent:Xs}),t}var Qo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},df=Ht(Qo),xs=Be({},Qo,{view:0,detail:0}),Ib=Ht(xs),ju,Fu,wi,_l=Be({},xs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ff,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!==wi&&(wi&&e.type==="mousemove"?(ju=e.screenX-wi.screenX,Fu=e.screenY-wi.screenY):Fu=ju=0,wi=e),ju)},movementY:function(e){return"movementY"in e?e.movementY:Fu}}),Jp=Ht(_l),Tb=Be({},_l,{dataTransfer:0}),Rb=Ht(Tb),_b=Be({},xs,{relatedTarget:0}),$u=Ht(_b),Pb=Be({},Qo,{animationName:0,elapsedTime:0,pseudoElement:0}),jb=Ht(Pb),Fb=Be({},Qo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$b=Ht(Fb),Mb=Be({},Qo,{data:0}),em=Ht(Mb),Ab={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Nb={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"},Lb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Lb[e])?!!t[e]:!1}function ff(){return zb}var Db=Be({},xs,{key:function(e){if(e.key){var t=Ab[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Nb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ff,charCode:function(e){return e.type==="keypress"?Fa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ob=Ht(Db),Bb=Be({},_l,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tm=Ht(Bb),Vb=Be({},xs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ff}),Wb=Ht(Vb),Hb=Be({},Qo,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ub=Ht(Hb),Zb=Be({},_l,{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}),Yb=Ht(Zb),Kb=[9,13,27,32],pf=Dn&&"CompositionEvent"in window,Oi=null;Dn&&"documentMode"in document&&(Oi=document.documentMode);var Gb=Dn&&"TextEvent"in window&&!Oi,qv=Dn&&(!pf||Oi&&8<Oi&&11>=Oi),nm=" ",rm=!1;function Qv(e,t){switch(e){case"keyup":return Kb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xo=!1;function Xb(e,t){switch(e){case"compositionend":return Jv(t);case"keypress":return t.which!==32?null:(rm=!0,nm);case"textInput":return e=t.data,e===nm&&rm?null:e;default:return null}}function qb(e,t){if(xo)return e==="compositionend"||!pf&&Qv(e,t)?(e=Xv(),ja=cf=ar=null,xo=!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 qv&&t.locale!=="ko"?null:t.data;default:return null}}var Qb={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 om(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Qb[e.type]:t==="textarea"}function ey(e,t,n,r){jv(r),t=qa(t,"onChange"),0<t.length&&(n=new df("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Bi=null,ns=null;function Jb(e){dy(e,0)}function Pl(e){var t=ko(e);if(Ev(t))return e}function eS(e,t){if(e==="change")return t}var ty=!1;if(Dn){var Mu;if(Dn){var Au="oninput"in document;if(!Au){var im=document.createElement("div");im.setAttribute("oninput","return;"),Au=typeof im.oninput=="function"}Mu=Au}else Mu=!1;ty=Mu&&(!document.documentMode||9<document.documentMode)}function sm(){Bi&&(Bi.detachEvent("onpropertychange",ny),ns=Bi=null)}function ny(e){if(e.propertyName==="value"&&Pl(ns)){var t=[];ey(t,ns,e,of(e)),Av(Jb,t)}}function tS(e,t,n){e==="focusin"?(sm(),Bi=t,ns=n,Bi.attachEvent("onpropertychange",ny)):e==="focusout"&&sm()}function nS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Pl(ns)}function rS(e,t){if(e==="click")return Pl(t)}function oS(e,t){if(e==="input"||e==="change")return Pl(t)}function iS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fn=typeof Object.is=="function"?Object.is:iS;function rs(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(!Pc.call(t,o)||!fn(e[o],t[o]))return!1}return!0}function am(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lm(e,t){var n=am(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=am(n)}}function ry(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ry(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function oy(){for(var e=window,t=Ha();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ha(e.document)}return t}function mf(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 sS(e){var t=oy(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ry(n.ownerDocument.documentElement,n)){if(r!==null&&mf(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=lm(n,i);var s=lm(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 aS=Dn&&"documentMode"in document&&11>=document.documentMode,bo=null,Gc=null,Vi=null,Xc=!1;function um(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xc||bo==null||bo!==Ha(r)||(r=bo,"selectionStart"in r&&mf(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}),Vi&&rs(Vi,r)||(Vi=r,r=qa(Gc,"onSelect"),0<r.length&&(t=new df("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=bo)))}function qs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var So={animationend:qs("Animation","AnimationEnd"),animationiteration:qs("Animation","AnimationIteration"),animationstart:qs("Animation","AnimationStart"),transitionend:qs("Transition","TransitionEnd")},Nu={},iy={};Dn&&(iy=document.createElement("div").style,"AnimationEvent"in window||(delete So.animationend.animation,delete So.animationiteration.animation,delete So.animationstart.animation),"TransitionEvent"in window||delete So.transitionend.transition);function jl(e){if(Nu[e])return Nu[e];if(!So[e])return e;var t=So[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in iy)return Nu[e]=t[n];return e}var sy=jl("animationend"),ay=jl("animationiteration"),ly=jl("animationstart"),uy=jl("transitionend"),cy=new Map,cm="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 kr(e,t){cy.set(e,t),qr(t,[e])}for(var Lu=0;Lu<cm.length;Lu++){var zu=cm[Lu],lS=zu.toLowerCase(),uS=zu[0].toUpperCase()+zu.slice(1);kr(lS,"on"+uS)}kr(sy,"onAnimationEnd");kr(ay,"onAnimationIteration");kr(ly,"onAnimationStart");kr("dblclick","onDoubleClick");kr("focusin","onFocus");kr("focusout","onBlur");kr(uy,"onTransitionEnd");Vo("onMouseEnter",["mouseout","mouseover"]);Vo("onMouseLeave",["mouseout","mouseover"]);Vo("onPointerEnter",["pointerout","pointerover"]);Vo("onPointerLeave",["pointerout","pointerover"]);qr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));qr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));qr("onBeforeInput",["compositionend","keypress","textInput","paste"]);qr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));qr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));qr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ai="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(" "),cS=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ai));function dm(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,lb(r,t,void 0,e),e.currentTarget=null}function dy(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;dm(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;dm(o,a,u),i=l}}}if(Za)throw e=Uc,Za=!1,Uc=null,e}function Fe(e,t){var n=t[td];n===void 0&&(n=t[td]=new Set);var r=e+"__bubble";n.has(r)||(fy(t,e,2,!1),n.add(r))}function Du(e,t,n){var r=0;t&&(r|=4),fy(n,e,r,t)}var Qs="_reactListening"+Math.random().toString(36).slice(2);function os(e){if(!e[Qs]){e[Qs]=!0,wv.forEach(function(n){n!=="selectionchange"&&(cS.has(n)||Du(n,!1,e),Du(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qs]||(t[Qs]=!0,Du("selectionchange",!1,t))}}function fy(e,t,n,r){switch(Gv(t)){case 1:var o=Eb;break;case 4:o=Cb;break;default:o=uf}n=o.bind(null,t,n,e),o=void 0,!Hc||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 Ou(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=Nr(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}Av(function(){var u=i,f=of(n),p=[];e:{var m=cy.get(e);if(m!==void 0){var h=df,x=e;switch(e){case"keypress":if(Fa(n)===0)break e;case"keydown":case"keyup":h=Ob;break;case"focusin":x="focus",h=$u;break;case"focusout":x="blur",h=$u;break;case"beforeblur":case"afterblur":h=$u;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=Jp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=Rb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Wb;break;case sy:case ay:case ly:h=jb;break;case uy:h=Ub;break;case"scroll":h=Ib;break;case"wheel":h=Yb;break;case"copy":case"cut":case"paste":h=$b;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=tm}var v=(t&4)!==0,k=!v&&e==="scroll",y=v?m!==null?m+"Capture":null:m;v=[];for(var g=u,w;g!==null;){w=g;var b=w.stateNode;if(w.tag===5&&b!==null&&(w=b,y!==null&&(b=Qi(g,y),b!=null&&v.push(is(g,b,w)))),k)break;g=g.return}0<v.length&&(m=new h(m,x,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!==Vc&&(x=n.relatedTarget||n.fromElement)&&(Nr(x)||x[On]))break e;if((h||m)&&(m=f.window===f?f:(m=f.ownerDocument)?m.defaultView||m.parentWindow:window,h?(x=n.relatedTarget||n.toElement,h=u,x=x?Nr(x):null,x!==null&&(k=Qr(x),x!==k||x.tag!==5&&x.tag!==6)&&(x=null)):(h=null,x=u),h!==x)){if(v=Jp,b="onMouseLeave",y="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(v=tm,b="onPointerLeave",y="onPointerEnter",g="pointer"),k=h==null?m:ko(h),w=x==null?m:ko(x),m=new v(b,g+"leave",h,n,f),m.target=k,m.relatedTarget=w,b=null,Nr(f)===u&&(v=new v(y,g+"enter",x,n,f),v.target=w,v.relatedTarget=k,b=v),k=b,h&&x)t:{for(v=h,y=x,g=0,w=v;w;w=uo(w))g++;for(w=0,b=y;b;b=uo(b))w++;for(;0<g-w;)v=uo(v),g--;for(;0<w-g;)y=uo(y),w--;for(;g--;){if(v===y||y!==null&&v===y.alternate)break t;v=uo(v),y=uo(y)}v=null}else v=null;h!==null&&fm(p,m,h,v,!1),x!==null&&k!==null&&fm(p,k,x,v,!0)}}e:{if(m=u?ko(u):window,h=m.nodeName&&m.nodeName.toLowerCase(),h==="select"||h==="input"&&m.type==="file")var S=eS;else if(om(m))if(ty)S=oS;else{S=nS;var C=tS}else(h=m.nodeName)&&h.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(S=rS);if(S&&(S=S(e,u))){ey(p,S,n,f);break e}C&&C(e,m,u),e==="focusout"&&(C=m._wrapperState)&&C.controlled&&m.type==="number"&&Lc(m,"number",m.value)}switch(C=u?ko(u):window,e){case"focusin":(om(C)||C.contentEditable==="true")&&(bo=C,Gc=u,Vi=null);break;case"focusout":Vi=Gc=bo=null;break;case"mousedown":Xc=!0;break;case"contextmenu":case"mouseup":case"dragend":Xc=!1,um(p,n,f);break;case"selectionchange":if(aS)break;case"keydown":case"keyup":um(p,n,f)}var E;if(pf)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 xo?Qv(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(qv&&n.locale!=="ko"&&(xo||T!=="onCompositionStart"?T==="onCompositionEnd"&&xo&&(E=Xv()):(ar=f,cf="value"in ar?ar.value:ar.textContent,xo=!0)),C=qa(u,T),0<C.length&&(T=new em(T,e,null,n,f),p.push({event:T,listeners:C}),E?T.data=E:(E=Jv(n),E!==null&&(T.data=E)))),(E=Gb?Xb(e,n):qb(e,n))&&(u=qa(u,"onBeforeInput"),0<u.length&&(f=new em("onBeforeInput","beforeinput",null,n,f),p.push({event:f,listeners:u}),f.data=E))}dy(p,t)})}function is(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qa(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Qi(e,n),i!=null&&r.unshift(is(e,i,o)),i=Qi(e,t),i!=null&&r.push(is(e,i,o))),e=e.return}return r}function uo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function fm(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=Qi(n,i),l!=null&&s.unshift(is(n,l,a))):o||(l=Qi(n,i),l!=null&&s.push(is(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var dS=/\r\n?/g,fS=/\u0000|\uFFFD/g;function pm(e){return(typeof e=="string"?e:""+e).replace(dS,`
38
+ `).replace(fS,"")}function Js(e,t,n){if(t=pm(t),pm(e)!==t&&n)throw Error(q(425))}function Qa(){}var qc=null,Qc=null;function Jc(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 ed=typeof setTimeout=="function"?setTimeout:void 0,pS=typeof clearTimeout=="function"?clearTimeout:void 0,mm=typeof Promise=="function"?Promise:void 0,mS=typeof queueMicrotask=="function"?queueMicrotask:typeof mm<"u"?function(e){return mm.resolve(null).then(e).catch(hS)}:ed;function hS(e){setTimeout(function(){throw e})}function Bu(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),ts(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);ts(t)}function fr(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 hm(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 Jo=Math.random().toString(36).slice(2),xn="__reactFiber$"+Jo,ss="__reactProps$"+Jo,On="__reactContainer$"+Jo,td="__reactEvents$"+Jo,gS="__reactListeners$"+Jo,vS="__reactHandles$"+Jo;function Nr(e){var t=e[xn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[On]||n[xn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=hm(e);e!==null;){if(n=e[xn])return n;e=hm(e)}return t}e=n,n=e.parentNode}return null}function bs(e){return e=e[xn]||e[On],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ko(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(q(33))}function Fl(e){return e[ss]||null}var nd=[],Eo=-1;function Er(e){return{current:e}}function $e(e){0>Eo||(e.current=nd[Eo],nd[Eo]=null,Eo--)}function Pe(e,t){Eo++,nd[Eo]=e.current,e.current=t}var wr={},yt=Er(wr),_t=Er(!1),Wr=wr;function Wo(e,t){var n=e.type.contextTypes;if(!n)return wr;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 Pt(e){return e=e.childContextTypes,e!=null}function Ja(){$e(_t),$e(yt)}function gm(e,t,n){if(yt.current!==wr)throw Error(q(168));Pe(yt,t),Pe(_t,n)}function py(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(q(108,tb(e)||"Unknown",o));return Be({},n,r)}function el(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||wr,Wr=yt.current,Pe(yt,e),Pe(_t,_t.current),!0}function vm(e,t,n){var r=e.stateNode;if(!r)throw Error(q(169));n?(e=py(e,t,Wr),r.__reactInternalMemoizedMergedChildContext=e,$e(_t),$e(yt),Pe(yt,e)):$e(_t),Pe(_t,n)}var $n=null,$l=!1,Vu=!1;function my(e){$n===null?$n=[e]:$n.push(e)}function yS(e){$l=!0,my(e)}function Cr(){if(!Vu&&$n!==null){Vu=!0;var e=0,t=ke;try{var n=$n;for(ke=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}$n=null,$l=!1}catch(o){throw $n!==null&&($n=$n.slice(e+1)),Dv(sf,Cr),o}finally{ke=t,Vu=!1}}return null}var Co=[],Io=0,tl=null,nl=0,Zt=[],Yt=0,Hr=null,An=1,Nn="";function Mr(e,t){Co[Io++]=nl,Co[Io++]=tl,tl=e,nl=t}function hy(e,t,n){Zt[Yt++]=An,Zt[Yt++]=Nn,Zt[Yt++]=Hr,Hr=e;var r=An;e=Nn;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,An=1<<32-un(t)+o|n<<o|r,Nn=i+e}else An=1<<i|n<<o|r,Nn=e}function hf(e){e.return!==null&&(Mr(e,1),hy(e,1,0))}function gf(e){for(;e===tl;)tl=Co[--Io],Co[Io]=null,nl=Co[--Io],Co[Io]=null;for(;e===Hr;)Hr=Zt[--Yt],Zt[Yt]=null,Nn=Zt[--Yt],Zt[Yt]=null,An=Zt[--Yt],Zt[Yt]=null}var Bt=null,Ot=null,Ne=!1,ln=null;function gy(e,t){var n=Gt(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 ym(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,Bt=e,Ot=fr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Bt=e,Ot=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Hr!==null?{id:An,overflow:Nn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Gt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Bt=e,Ot=null,!0):!1;default:return!1}}function rd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function od(e){if(Ne){var t=Ot;if(t){var n=t;if(!ym(e,t)){if(rd(e))throw Error(q(418));t=fr(n.nextSibling);var r=Bt;t&&ym(e,t)?gy(r,n):(e.flags=e.flags&-4097|2,Ne=!1,Bt=e)}}else{if(rd(e))throw Error(q(418));e.flags=e.flags&-4097|2,Ne=!1,Bt=e}}}function wm(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Bt=e}function ea(e){if(e!==Bt)return!1;if(!Ne)return wm(e),Ne=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Jc(e.type,e.memoizedProps)),t&&(t=Ot)){if(rd(e))throw vy(),Error(q(418));for(;t;)gy(e,t),t=fr(t.nextSibling)}if(wm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ot=fr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ot=null}}else Ot=Bt?fr(e.stateNode.nextSibling):null;return!0}function vy(){for(var e=Ot;e;)e=fr(e.nextSibling)}function Ho(){Ot=Bt=null,Ne=!1}function vf(e){ln===null?ln=[e]:ln.push(e)}var wS=Hn.ReactCurrentBatchConfig;function xi(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(q(309));var r=n.stateNode}if(!r)throw Error(q(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(q(284));if(!n._owner)throw Error(q(290,e))}return e}function ta(e,t){throw e=Object.prototype.toString.call(t),Error(q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xm(e){var t=e._init;return t(e._payload)}function yy(e){function t(y,g){if(e){var w=y.deletions;w===null?(y.deletions=[g],y.flags|=16):w.push(g)}}function n(y,g){if(!e)return null;for(;g!==null;)t(y,g),g=g.sibling;return null}function r(y,g){for(y=new Map;g!==null;)g.key!==null?y.set(g.key,g):y.set(g.index,g),g=g.sibling;return y}function o(y,g){return y=gr(y,g),y.index=0,y.sibling=null,y}function i(y,g,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<g?(y.flags|=2,g):w):(y.flags|=2,g)):(y.flags|=1048576,g)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,g,w,b){return g===null||g.tag!==6?(g=Gu(w,y.mode,b),g.return=y,g):(g=o(g,w),g.return=y,g)}function l(y,g,w,b){var S=w.type;return S===wo?f(y,g,w.props.children,b,w.key):g!==null&&(g.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===nr&&xm(S)===g.type)?(b=o(g,w.props),b.ref=xi(y,g,w),b.return=y,b):(b=Da(w.type,w.key,w.props,null,y.mode,b),b.ref=xi(y,g,w),b.return=y,b)}function u(y,g,w,b){return g===null||g.tag!==4||g.stateNode.containerInfo!==w.containerInfo||g.stateNode.implementation!==w.implementation?(g=Xu(w,y.mode,b),g.return=y,g):(g=o(g,w.children||[]),g.return=y,g)}function f(y,g,w,b,S){return g===null||g.tag!==7?(g=Vr(w,y.mode,b,S),g.return=y,g):(g=o(g,w),g.return=y,g)}function p(y,g,w){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Gu(""+g,y.mode,w),g.return=y,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Hs:return w=Da(g.type,g.key,g.props,null,y.mode,w),w.ref=xi(y,null,g),w.return=y,w;case yo:return g=Xu(g,y.mode,w),g.return=y,g;case nr:var b=g._init;return p(y,b(g._payload),w)}if($i(g)||hi(g))return g=Vr(g,y.mode,w,null),g.return=y,g;ta(y,g)}return null}function m(y,g,w,b){var S=g!==null?g.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return S!==null?null:a(y,g,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Hs:return w.key===S?l(y,g,w,b):null;case yo:return w.key===S?u(y,g,w,b):null;case nr:return S=w._init,m(y,g,S(w._payload),b)}if($i(w)||hi(w))return S!==null?null:f(y,g,w,b,null);ta(y,w)}return null}function h(y,g,w,b,S){if(typeof b=="string"&&b!==""||typeof b=="number")return y=y.get(w)||null,a(g,y,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Hs:return y=y.get(b.key===null?w:b.key)||null,l(g,y,b,S);case yo:return y=y.get(b.key===null?w:b.key)||null,u(g,y,b,S);case nr:var C=b._init;return h(y,g,w,C(b._payload),S)}if($i(b)||hi(b))return y=y.get(w)||null,f(g,y,b,S,null);ta(g,b)}return null}function x(y,g,w,b){for(var S=null,C=null,E=g,T=g=0,_=null;E!==null&&T<w.length;T++){E.index>T?(_=E,E=null):_=E.sibling;var j=m(y,E,w[T],b);if(j===null){E===null&&(E=_);break}e&&E&&j.alternate===null&&t(y,E),g=i(j,g,T),C===null?S=j:C.sibling=j,C=j,E=_}if(T===w.length)return n(y,E),Ne&&Mr(y,T),S;if(E===null){for(;T<w.length;T++)E=p(y,w[T],b),E!==null&&(g=i(E,g,T),C===null?S=E:C.sibling=E,C=E);return Ne&&Mr(y,T),S}for(E=r(y,E);T<w.length;T++)_=h(E,y,T,w[T],b),_!==null&&(e&&_.alternate!==null&&E.delete(_.key===null?T:_.key),g=i(_,g,T),C===null?S=_:C.sibling=_,C=_);return e&&E.forEach(function(A){return t(y,A)}),Ne&&Mr(y,T),S}function v(y,g,w,b){var S=hi(w);if(typeof S!="function")throw Error(q(150));if(w=S.call(w),w==null)throw Error(q(151));for(var C=S=null,E=g,T=g=0,_=null,j=w.next();E!==null&&!j.done;T++,j=w.next()){E.index>T?(_=E,E=null):_=E.sibling;var A=m(y,E,j.value,b);if(A===null){E===null&&(E=_);break}e&&E&&A.alternate===null&&t(y,E),g=i(A,g,T),C===null?S=A:C.sibling=A,C=A,E=_}if(j.done)return n(y,E),Ne&&Mr(y,T),S;if(E===null){for(;!j.done;T++,j=w.next())j=p(y,j.value,b),j!==null&&(g=i(j,g,T),C===null?S=j:C.sibling=j,C=j);return Ne&&Mr(y,T),S}for(E=r(y,E);!j.done;T++,j=w.next())j=h(E,y,T,j.value,b),j!==null&&(e&&j.alternate!==null&&E.delete(j.key===null?T:j.key),g=i(j,g,T),C===null?S=j:C.sibling=j,C=j);return e&&E.forEach(function(z){return t(y,z)}),Ne&&Mr(y,T),S}function k(y,g,w,b){if(typeof w=="object"&&w!==null&&w.type===wo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Hs:e:{for(var S=w.key,C=g;C!==null;){if(C.key===S){if(S=w.type,S===wo){if(C.tag===7){n(y,C.sibling),g=o(C,w.props.children),g.return=y,y=g;break e}}else if(C.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===nr&&xm(S)===C.type){n(y,C.sibling),g=o(C,w.props),g.ref=xi(y,C,w),g.return=y,y=g;break e}n(y,C);break}else t(y,C);C=C.sibling}w.type===wo?(g=Vr(w.props.children,y.mode,b,w.key),g.return=y,y=g):(b=Da(w.type,w.key,w.props,null,y.mode,b),b.ref=xi(y,g,w),b.return=y,y=b)}return s(y);case yo:e:{for(C=w.key;g!==null;){if(g.key===C)if(g.tag===4&&g.stateNode.containerInfo===w.containerInfo&&g.stateNode.implementation===w.implementation){n(y,g.sibling),g=o(g,w.children||[]),g.return=y,y=g;break e}else{n(y,g);break}else t(y,g);g=g.sibling}g=Xu(w,y.mode,b),g.return=y,y=g}return s(y);case nr:return C=w._init,k(y,g,C(w._payload),b)}if($i(w))return x(y,g,w,b);if(hi(w))return v(y,g,w,b);ta(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,g!==null&&g.tag===6?(n(y,g.sibling),g=o(g,w),g.return=y,y=g):(n(y,g),g=Gu(w,y.mode,b),g.return=y,y=g),s(y)):n(y,g)}return k}var Uo=yy(!0),wy=yy(!1),rl=Er(null),ol=null,To=null,yf=null;function wf(){yf=To=ol=null}function xf(e){var t=rl.current;$e(rl),e._currentValue=t}function id(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 Lo(e,t){ol=e,yf=To=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Rt=!0),e.firstContext=null)}function Qt(e){var t=e._currentValue;if(yf!==e)if(e={context:e,memoizedValue:t,next:null},To===null){if(ol===null)throw Error(q(308));To=e,ol.dependencies={lanes:0,firstContext:e}}else To=To.next=e;return t}var Lr=null;function bf(e){Lr===null?Lr=[e]:Lr.push(e)}function xy(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,bf(t)):(n.next=o.next,o.next=n),t.interleaved=n,Bn(e,r)}function Bn(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 rr=!1;function Sf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function by(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 zn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function pr(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,Bn(e,n)}return o=r.interleaved,o===null?(t.next=t,bf(r)):(t.next=o.next,o.next=t),r.interleaved=t,Bn(e,n)}function $a(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,af(e,n)}}function bm(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 il(e,t,n,r){var o=e.updateQueue;rr=!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 x=e,v=a;switch(m=t,h=n,v.tag){case 1:if(x=v.payload,typeof x=="function"){p=x.call(h,p,m);break e}p=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=v.payload,m=typeof x=="function"?x.call(h,p,m):x,m==null)break e;p=Be({},p,m);break e;case 2:rr=!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);Zr|=s,e.lanes=s,e.memoizedState=p}}function Sm(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(q(191,o));o.call(r)}}}var Ss={},kn=Er(Ss),as=Er(Ss),ls=Er(Ss);function zr(e){if(e===Ss)throw Error(q(174));return e}function kf(e,t){switch(Pe(ls,t),Pe(as,e),Pe(kn,Ss),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Dc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Dc(t,e)}$e(kn),Pe(kn,t)}function Zo(){$e(kn),$e(as),$e(ls)}function Sy(e){zr(ls.current);var t=zr(kn.current),n=Dc(t,e.type);t!==n&&(Pe(as,e),Pe(kn,n))}function Ef(e){as.current===e&&($e(kn),$e(as))}var De=Er(0);function sl(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 Wu=[];function Cf(){for(var e=0;e<Wu.length;e++)Wu[e]._workInProgressVersionPrimary=null;Wu.length=0}var Ma=Hn.ReactCurrentDispatcher,Hu=Hn.ReactCurrentBatchConfig,Ur=0,Oe=null,qe=null,tt=null,al=!1,Wi=!1,us=0,xS=0;function ft(){throw Error(q(321))}function If(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 Tf(e,t,n,r,o,i){if(Ur=i,Oe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ma.current=e===null||e.memoizedState===null?ES:CS,e=n(r,o),Wi){i=0;do{if(Wi=!1,us=0,25<=i)throw Error(q(301));i+=1,tt=qe=null,t.updateQueue=null,Ma.current=IS,e=n(r,o)}while(Wi)}if(Ma.current=ll,t=qe!==null&&qe.next!==null,Ur=0,tt=qe=Oe=null,al=!1,t)throw Error(q(300));return e}function Rf(){var e=us!==0;return us=0,e}function yn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?Oe.memoizedState=tt=e:tt=tt.next=e,tt}function Jt(){if(qe===null){var e=Oe.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=tt===null?Oe.memoizedState:tt.next;if(t!==null)tt=t,qe=e;else{if(e===null)throw Error(q(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},tt===null?Oe.memoizedState=tt=e:tt=tt.next=e}return tt}function cs(e,t){return typeof t=="function"?t(e):t}function Uu(e){var t=Jt(),n=t.queue;if(n===null)throw Error(q(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((Ur&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,Oe.lanes|=f,Zr|=f}u=u.next}while(u!==null&&u!==i);l===null?s=r:l.next=a,fn(r,t.memoizedState)||(Rt=!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,Oe.lanes|=i,Zr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Zu(e){var t=Jt(),n=t.queue;if(n===null)throw Error(q(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)||(Rt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function ky(){}function Ey(e,t){var n=Oe,r=Jt(),o=t(),i=!fn(r.memoizedState,o);if(i&&(r.memoizedState=o,Rt=!0),r=r.queue,_f(Ty.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||tt!==null&&tt.memoizedState.tag&1){if(n.flags|=2048,ds(9,Iy.bind(null,n,r,o,t),void 0,null),nt===null)throw Error(q(349));Ur&30||Cy(n,t,o)}return o}function Cy(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Oe.updateQueue,t===null?(t={lastEffect:null,stores:null},Oe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Iy(e,t,n,r){t.value=n,t.getSnapshot=r,Ry(t)&&_y(e)}function Ty(e,t,n){return n(function(){Ry(t)&&_y(e)})}function Ry(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!fn(e,n)}catch{return!0}}function _y(e){var t=Bn(e,1);t!==null&&cn(t,e,1,-1)}function km(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:cs,lastRenderedState:e},t.queue=e,e=e.dispatch=kS.bind(null,Oe,e),[t.memoizedState,e]}function ds(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Oe.updateQueue,t===null?(t={lastEffect:null,stores:null},Oe.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 Py(){return Jt().memoizedState}function Aa(e,t,n,r){var o=yn();Oe.flags|=e,o.memoizedState=ds(1|t,n,void 0,r===void 0?null:r)}function Ml(e,t,n,r){var o=Jt();r=r===void 0?null:r;var i=void 0;if(qe!==null){var s=qe.memoizedState;if(i=s.destroy,r!==null&&If(r,s.deps)){o.memoizedState=ds(t,n,i,r);return}}Oe.flags|=e,o.memoizedState=ds(1|t,n,i,r)}function Em(e,t){return Aa(8390656,8,e,t)}function _f(e,t){return Ml(2048,8,e,t)}function jy(e,t){return Ml(4,2,e,t)}function Fy(e,t){return Ml(4,4,e,t)}function $y(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 My(e,t,n){return n=n!=null?n.concat([e]):null,Ml(4,4,$y.bind(null,t,e),n)}function Pf(){}function Ay(e,t){var n=Jt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&If(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ny(e,t){var n=Jt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&If(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ly(e,t,n){return Ur&21?(fn(n,t)||(n=Vv(),Oe.lanes|=n,Zr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Rt=!0),e.memoizedState=n)}function bS(e,t){var n=ke;ke=n!==0&&4>n?n:4,e(!0);var r=Hu.transition;Hu.transition={};try{e(!1),t()}finally{ke=n,Hu.transition=r}}function zy(){return Jt().memoizedState}function SS(e,t,n){var r=hr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Dy(e))Oy(t,n);else if(n=xy(e,t,n,r),n!==null){var o=St();cn(n,e,r,o),By(n,t,r)}}function kS(e,t,n){var r=hr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Dy(e))Oy(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,bf(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=xy(e,t,o,r),n!==null&&(o=St(),cn(n,e,r,o),By(n,t,r))}}function Dy(e){var t=e.alternate;return e===Oe||t!==null&&t===Oe}function Oy(e,t){Wi=al=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function By(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,af(e,n)}}var ll={readContext:Qt,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},ES={readContext:Qt,useCallback:function(e,t){return yn().memoizedState=[e,t===void 0?null:t],e},useContext:Qt,useEffect:Em,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Aa(4194308,4,$y.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Aa(4194308,4,e,t)},useInsertionEffect:function(e,t){return Aa(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=SS.bind(null,Oe,e),[r.memoizedState,e]},useRef:function(e){var t=yn();return e={current:e},t.memoizedState=e},useState:km,useDebugValue:Pf,useDeferredValue:function(e){return yn().memoizedState=e},useTransition:function(){var e=km(!1),t=e[0];return e=bS.bind(null,e[1]),yn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Oe,o=yn();if(Ne){if(n===void 0)throw Error(q(407));n=n()}else{if(n=t(),nt===null)throw Error(q(349));Ur&30||Cy(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Em(Ty.bind(null,r,i,e),[e]),r.flags|=2048,ds(9,Iy.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=yn(),t=nt.identifierPrefix;if(Ne){var n=Nn,r=An;n=(r&~(1<<32-un(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=us++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=xS++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},CS={readContext:Qt,useCallback:Ay,useContext:Qt,useEffect:_f,useImperativeHandle:My,useInsertionEffect:jy,useLayoutEffect:Fy,useMemo:Ny,useReducer:Uu,useRef:Py,useState:function(){return Uu(cs)},useDebugValue:Pf,useDeferredValue:function(e){var t=Jt();return Ly(t,qe.memoizedState,e)},useTransition:function(){var e=Uu(cs)[0],t=Jt().memoizedState;return[e,t]},useMutableSource:ky,useSyncExternalStore:Ey,useId:zy,unstable_isNewReconciler:!1},IS={readContext:Qt,useCallback:Ay,useContext:Qt,useEffect:_f,useImperativeHandle:My,useInsertionEffect:jy,useLayoutEffect:Fy,useMemo:Ny,useReducer:Zu,useRef:Py,useState:function(){return Zu(cs)},useDebugValue:Pf,useDeferredValue:function(e){var t=Jt();return qe===null?t.memoizedState=e:Ly(t,qe.memoizedState,e)},useTransition:function(){var e=Zu(cs)[0],t=Jt().memoizedState;return[e,t]},useMutableSource:ky,useSyncExternalStore:Ey,useId:zy,unstable_isNewReconciler:!1};function sn(e,t){if(e&&e.defaultProps){t=Be({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function sd(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Be({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Al={isMounted:function(e){return(e=e._reactInternals)?Qr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=St(),o=hr(e),i=zn(r,o);i.payload=t,n!=null&&(i.callback=n),t=pr(e,i,o),t!==null&&(cn(t,e,o,r),$a(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=St(),o=hr(e),i=zn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=pr(e,i,o),t!==null&&(cn(t,e,o,r),$a(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=St(),r=hr(e),o=zn(n,r);o.tag=2,t!=null&&(o.callback=t),t=pr(e,o,r),t!==null&&(cn(t,e,r,n),$a(t,e,r))}};function Cm(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?!rs(n,r)||!rs(o,i):!0}function Vy(e,t,n){var r=!1,o=wr,i=t.contextType;return typeof i=="object"&&i!==null?i=Qt(i):(o=Pt(t)?Wr:yt.current,r=t.contextTypes,i=(r=r!=null)?Wo(e,o):wr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Al,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Im(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&&Al.enqueueReplaceState(t,t.state,null)}function ad(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Sf(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Qt(i):(i=Pt(t)?Wr:yt.current,o.context=Wo(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(sd(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&&Al.enqueueReplaceState(o,o.state,null),il(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Yo(e,t){try{var n="",r=t;do n+=eb(r),r=r.return;while(r);var o=n}catch(i){o=`
39
+ Error generating stack: `+i.message+`
40
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function Yu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ld(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var TS=typeof WeakMap=="function"?WeakMap:Map;function Wy(e,t,n){n=zn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){cl||(cl=!0,yd=r),ld(e,t)},n}function Hy(e,t,n){n=zn(-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(){ld(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){ld(e,t),typeof r!="function"&&(mr===null?mr=new Set([this]):mr.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Tm(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new TS;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=BS.bind(null,e,t,n),t.then(e,e))}function Rm(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 _m(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=zn(-1,1),t.tag=2,pr(n,t,1))),n.lanes|=1),e)}var RS=Hn.ReactCurrentOwner,Rt=!1;function bt(e,t,n,r){t.child=e===null?wy(t,null,n,r):Uo(t,e.child,n,r)}function Pm(e,t,n,r,o){n=n.render;var i=t.ref;return Lo(t,o),r=Tf(e,t,n,r,i,o),n=Rf(),e!==null&&!Rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Vn(e,t,o)):(Ne&&n&&hf(t),t.flags|=1,bt(e,t,r,o),t.child)}function jm(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!zf(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Uy(e,t,i,r,o)):(e=Da(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:rs,n(s,r)&&e.ref===t.ref)return Vn(e,t,o)}return t.flags|=1,e=gr(i,r),e.ref=t.ref,e.return=t,t.child=e}function Uy(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(rs(i,r)&&e.ref===t.ref)if(Rt=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Rt=!0);else return t.lanes=e.lanes,Vn(e,t,o)}return ud(e,t,n,r,o)}function Zy(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},Pe(_o,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,Pe(_o,Dt),Dt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Pe(_o,Dt),Dt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Pe(_o,Dt),Dt|=r;return bt(e,t,o,n),t.child}function Yy(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ud(e,t,n,r,o){var i=Pt(n)?Wr:yt.current;return i=Wo(t,i),Lo(t,o),n=Tf(e,t,n,r,i,o),r=Rf(),e!==null&&!Rt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Vn(e,t,o)):(Ne&&r&&hf(t),t.flags|=1,bt(e,t,n,o),t.child)}function Fm(e,t,n,r,o){if(Pt(n)){var i=!0;el(t)}else i=!1;if(Lo(t,o),t.stateNode===null)Na(e,t),Vy(t,n,r),ad(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=Qt(u):(u=Pt(n)?Wr:yt.current,u=Wo(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)&&Im(t,s,r,u),rr=!1;var m=t.memoizedState;s.state=m,il(t,r,s,o),l=t.memoizedState,a!==r||m!==l||_t.current||rr?(typeof f=="function"&&(sd(t,n,f,r),l=t.memoizedState),(a=rr||Cm(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,by(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=Qt(l):(l=Pt(n)?Wr:yt.current,l=Wo(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)&&Im(t,s,r,l),rr=!1,m=t.memoizedState,s.state=m,il(t,r,s,o);var x=t.memoizedState;a!==p||m!==x||_t.current||rr?(typeof h=="function"&&(sd(t,n,h,r),x=t.memoizedState),(u=rr||Cm(t,n,u,r,m,x,l)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,x,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,x,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=x),s.props=r,s.state=x,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 cd(e,t,n,r,i,o)}function cd(e,t,n,r,o,i){Yy(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&vm(t,n,!1),Vn(e,t,i);r=t.stateNode,RS.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Uo(t,e.child,null,i),t.child=Uo(t,null,a,i)):bt(e,t,a,i),t.memoizedState=r.state,o&&vm(t,n,!0),t.child}function Ky(e){var t=e.stateNode;t.pendingContext?gm(e,t.pendingContext,t.pendingContext!==t.context):t.context&&gm(e,t.context,!1),kf(e,t.containerInfo)}function $m(e,t,n,r,o){return Ho(),vf(o),t.flags|=256,bt(e,t,n,r),t.child}var dd={dehydrated:null,treeContext:null,retryLane:0};function fd(e){return{baseLanes:e,cachePool:null,transitions:null}}function Gy(e,t,n){var r=t.pendingProps,o=De.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),Pe(De,o&1),e===null)return od(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=zl(s,r,0,null),e=Vr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=fd(n),t.memoizedState=dd,e):jf(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return _S(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=gr(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=gr(a,i):(i=Vr(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?fd(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=dd,r}return i=e.child,e=i.sibling,r=gr(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 jf(e,t){return t=zl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function na(e,t,n,r){return r!==null&&vf(r),Uo(t,e.child,null,n),e=jf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _S(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=Yu(Error(q(422))),na(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=zl({mode:"visible",children:r.children},o,0,null),i=Vr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Uo(t,e.child,null,s),t.child.memoizedState=fd(s),t.memoizedState=dd,i);if(!(t.mode&1))return na(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(q(419)),r=Yu(i,r,void 0),na(e,t,s,r)}if(a=(s&e.childLanes)!==0,Rt||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,Bn(e,o),cn(r,e,o,-1))}return Lf(),r=Yu(Error(q(421))),na(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=VS.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Ot=fr(o.nextSibling),Bt=t,Ne=!0,ln=null,e!==null&&(Zt[Yt++]=An,Zt[Yt++]=Nn,Zt[Yt++]=Hr,An=e.id,Nn=e.overflow,Hr=t),t=jf(t,r.children),t.flags|=4096,t)}function Mm(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),id(e.return,t,n)}function Ku(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 Xy(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(bt(e,t,r.children,n),r=De.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&&Mm(e,n,t);else if(e.tag===19)Mm(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(Pe(De,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&&sl(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ku(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&&sl(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ku(t,!0,n,null,i);break;case"together":Ku(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Na(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Vn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Zr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(q(153));if(t.child!==null){for(e=t.child,n=gr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=gr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function PS(e,t,n){switch(t.tag){case 3:Ky(t),Ho();break;case 5:Sy(t);break;case 1:Pt(t.type)&&el(t);break;case 4:kf(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Pe(rl,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Pe(De,De.current&1),t.flags|=128,null):n&t.child.childLanes?Gy(e,t,n):(Pe(De,De.current&1),e=Vn(e,t,n),e!==null?e.sibling:null);Pe(De,De.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Xy(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Pe(De,De.current),r)break;return null;case 22:case 23:return t.lanes=0,Zy(e,t,n)}return Vn(e,t,n)}var qy,pd,Qy,Jy;qy=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}};pd=function(){};Qy=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,zr(kn.current);var i=null;switch(n){case"input":o=Ac(e,o),r=Ac(e,r),i=[];break;case"select":o=Be({},o,{value:void 0}),r=Be({},r,{value:void 0}),i=[];break;case"textarea":o=zc(e,o),r=zc(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Qa)}Oc(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"&&(Xi.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"&&(Xi.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)}};Jy=function(e,t,n,r){n!==r&&(t.flags|=4)};function bi(e,t){if(!Ne)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 jS(e,t,n){var r=t.pendingProps;switch(gf(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 Pt(t.type)&&Ja(),pt(t),null;case 3:return r=t.stateNode,Zo(),$e(_t),$e(yt),Cf(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ea(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ln!==null&&(bd(ln),ln=null))),pd(e,t),pt(t),null;case 5:Ef(t);var o=zr(ls.current);if(n=t.type,e!==null&&t.stateNode!=null)Qy(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(q(166));return pt(t),null}if(e=zr(kn.current),ea(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[xn]=t,r[ss]=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<Ai.length;o++)Fe(Ai[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":Wp(r,i),Fe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Fe("invalid",r);break;case"textarea":Up(r,i),Fe("invalid",r)}Oc(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&&Js(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Js(r.textContent,a,e),o=["children",""+a]):Xi.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&Fe("scroll",r)}switch(n){case"input":Us(r),Hp(r,i,!0);break;case"textarea":Us(r),Zp(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Qa)}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=Tv(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[ss]=r,qy(e,t,!1,!1),t.stateNode=e;e:{switch(s=Bc(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<Ai.length;o++)Fe(Ai[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":Wp(e,r),o=Ac(e,r),Fe("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Be({},r,{value:void 0}),Fe("invalid",e);break;case"textarea":Up(e,r),o=zc(e,r),Fe("invalid",e);break;default:o=r}Oc(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Pv(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Rv(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&qi(e,l):typeof l=="number"&&qi(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Xi.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Fe("scroll",e):l!=null&&ef(e,i,l,s))}switch(n){case"input":Us(e),Hp(e,r,!1);break;case"textarea":Us(e),Zp(e);break;case"option":r.value!=null&&e.setAttribute("value",""+yr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?$o(e,!!r.multiple,i,!1):r.defaultValue!=null&&$o(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Qa)}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)Jy(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(q(166));if(n=zr(ls.current),zr(kn.current),ea(t)){if(r=t.stateNode,n=t.memoizedProps,r[xn]=t,(i=r.nodeValue!==n)&&(e=Bt,e!==null))switch(e.tag){case 3:Js(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Js(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($e(De),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ne&&Ot!==null&&t.mode&1&&!(t.flags&128))vy(),Ho(),t.flags|=98560,i=!1;else if(i=ea(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(q(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(q(317));i[xn]=t}else Ho(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pt(t),i=!1}else ln!==null&&(bd(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||De.current&1?Qe===0&&(Qe=3):Lf())),t.updateQueue!==null&&(t.flags|=4),pt(t),null);case 4:return Zo(),pd(e,t),e===null&&os(t.stateNode.containerInfo),pt(t),null;case 10:return xf(t.type._context),pt(t),null;case 17:return Pt(t.type)&&Ja(),pt(t),null;case 19:if($e(De),i=t.memoizedState,i===null)return pt(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)bi(i,!1);else{if(Qe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=sl(e),s!==null){for(t.flags|=128,bi(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 Pe(De,De.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ze()>Ko&&(t.flags|=128,r=!0,bi(i,!1),t.lanes=4194304)}else{if(!r)if(e=sl(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),bi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Ne)return pt(t),null}else 2*Ze()-i.renderingStartTime>Ko&&n!==1073741824&&(t.flags|=128,r=!0,bi(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=Ze(),t.sibling=null,n=De.current,Pe(De,r?n&1|2:n&1),t):(pt(t),null);case 22:case 23:return Nf(),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(q(156,t.tag))}function FS(e,t){switch(gf(t),t.tag){case 1:return Pt(t.type)&&Ja(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zo(),$e(_t),$e(yt),Cf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ef(t),null;case 13:if($e(De),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(q(340));Ho()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $e(De),null;case 4:return Zo(),null;case 10:return xf(t.type._context),null;case 22:case 23:return Nf(),null;case 24:return null;default:return null}}var ra=!1,gt=!1,$S=typeof WeakSet=="function"?WeakSet:Set,re=null;function Ro(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 md(e,t,n){try{n()}catch(r){Ue(e,t,r)}}var Am=!1;function MS(e,t){if(qc=Ga,e=oy(),mf(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(Qc={focusedElem:e,selectionRange:n},Ga=!1,re=t;re!==null;)if(t=re,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,re=e;else for(;re!==null;){t=re;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var v=x.memoizedProps,k=x.memoizedState,y=t.stateNode,g=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:sn(t.type,v),k);y.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(q(163))}}catch(b){Ue(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,re=e;break}re=t.return}return x=Am,Am=!1,x}function Hi(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&&md(t,n,i)}o=o.next}while(o!==r)}}function Nl(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 hd(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 e0(e){var t=e.alternate;t!==null&&(e.alternate=null,e0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xn],delete t[ss],delete t[td],delete t[gS],delete t[vS])),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 t0(e){return e.tag===5||e.tag===3||e.tag===4}function Nm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||t0(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 gd(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=Qa));else if(r!==4&&(e=e.child,e!==null))for(gd(e,t,n),e=e.sibling;e!==null;)gd(e,t,n),e=e.sibling}function vd(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(vd(e,t,n),e=e.sibling;e!==null;)vd(e,t,n),e=e.sibling}var st=null,an=!1;function qn(e,t,n){for(n=n.child;n!==null;)n0(e,t,n),n=n.sibling}function n0(e,t,n){if(Sn&&typeof Sn.onCommitFiberUnmount=="function")try{Sn.onCommitFiberUnmount(Rl,n)}catch{}switch(n.tag){case 5:gt||Ro(n,t);case 6:var r=st,o=an;st=null,qn(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?Bu(e.parentNode,n):e.nodeType===1&&Bu(e,n),ts(e)):Bu(st,n.stateNode));break;case 4:r=st,o=an,st=n.stateNode.containerInfo,an=!0,qn(e,t,n),st=r,an=o;break;case 0:case 11:case 14:case 15:if(!gt&&(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)&&md(n,t,s),o=o.next}while(o!==r)}qn(e,t,n);break;case 1:if(!gt&&(Ro(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)}qn(e,t,n);break;case 21:qn(e,t,n);break;case 22:n.mode&1?(gt=(r=gt)||n.memoizedState!==null,qn(e,t,n),gt=r):qn(e,t,n);break;default:qn(e,t,n)}}function Lm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new $S),t.forEach(function(r){var o=WS.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(q(160));n0(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;)r0(t,e),t=t.sibling}function r0(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{Hi(3,e,e.return),Nl(3,e)}catch(v){Ue(e,e.return,v)}try{Hi(5,e,e.return)}catch(v){Ue(e,e.return,v)}}break;case 1:nn(t,e),gn(e),r&512&&n!==null&&Ro(n,n.return);break;case 5:if(nn(t,e),gn(e),r&512&&n!==null&&Ro(n,n.return),e.flags&32){var o=e.stateNode;try{qi(o,"")}catch(v){Ue(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&&Cv(o,i),Bc(a,s);var u=Bc(a,i);for(s=0;s<l.length;s+=2){var f=l[s],p=l[s+1];f==="style"?Pv(o,p):f==="dangerouslySetInnerHTML"?Rv(o,p):f==="children"?qi(o,p):ef(o,f,p,u)}switch(a){case"input":Nc(o,i);break;case"textarea":Iv(o,i);break;case"select":var m=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?$o(o,!!i.multiple,h,!1):m!==!!i.multiple&&(i.defaultValue!=null?$o(o,!!i.multiple,i.defaultValue,!0):$o(o,!!i.multiple,i.multiple?[]:"",!1))}o[ss]=i}catch(v){Ue(e,e.return,v)}}break;case 6:if(nn(t,e),gn(e),r&4){if(e.stateNode===null)throw Error(q(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){Ue(e,e.return,v)}}break;case 3:if(nn(t,e),gn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ts(t.containerInfo)}catch(v){Ue(e,e.return,v)}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||(Mf=Ze())),r&4&&Lm(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(gt=(u=gt)||f,nn(t,e),gt=u):nn(t,e),gn(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(re=e,f=e.child;f!==null;){for(p=re=f;re!==null;){switch(m=re,h=m.child,m.tag){case 0:case 11:case 14:case 15:Hi(4,m,m.return);break;case 1:Ro(m,m.return);var x=m.stateNode;if(typeof x.componentWillUnmount=="function"){r=m,n=m.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(v){Ue(r,n,v)}}break;case 5:Ro(m,m.return);break;case 22:if(m.memoizedState!==null){Dm(p);continue}}h!==null?(h.return=m,re=h):Dm(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=_v("display",s))}catch(v){Ue(e,e.return,v)}}}else if(p.tag===6){if(f===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(v){Ue(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),gn(e),r&4&&Lm(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(t0(n)){var r=n;break e}n=n.return}throw Error(q(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(qi(o,""),r.flags&=-33);var i=Nm(e);vd(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=Nm(e);gd(e,a,s);break;default:throw Error(q(161))}}catch(l){Ue(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function AS(e,t,n){re=e,o0(e)}function o0(e,t,n){for(var r=(e.mode&1)!==0;re!==null;){var o=re,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||ra;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||gt;a=ra;var u=gt;if(ra=s,(gt=l)&&!u)for(re=o;re!==null;)s=re,l=s.child,s.tag===22&&s.memoizedState!==null?Om(o):l!==null?(l.return=s,re=l):Om(o);for(;i!==null;)re=i,o0(i),i=i.sibling;re=o,ra=a,gt=u}zm(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,re=i):zm(e)}}function zm(e){for(;re!==null;){var t=re;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:gt||Nl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!gt)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&&Sm(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}Sm(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&&ts(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(q(163))}gt||t.flags&512&&hd(t)}catch(m){Ue(t,t.return,m)}}if(t===e){re=null;break}if(n=t.sibling,n!==null){n.return=t.return,re=n;break}re=t.return}}function Dm(e){for(;re!==null;){var t=re;if(t===e){re=null;break}var n=t.sibling;if(n!==null){n.return=t.return,re=n;break}re=t.return}}function Om(e){for(;re!==null;){var t=re;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Nl(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{hd(t)}catch(l){Ue(t,i,l)}break;case 5:var s=t.return;try{hd(t)}catch(l){Ue(t,s,l)}}}catch(l){Ue(t,t.return,l)}if(t===e){re=null;break}var a=t.sibling;if(a!==null){a.return=t.return,re=a;break}re=t.return}}var NS=Math.ceil,ul=Hn.ReactCurrentDispatcher,Ff=Hn.ReactCurrentOwner,qt=Hn.ReactCurrentBatchConfig,ge=0,nt=null,Ge=null,at=0,Dt=0,_o=Er(0),Qe=0,fs=null,Zr=0,Ll=0,$f=0,Ui=null,Tt=null,Mf=0,Ko=1/0,Fn=null,cl=!1,yd=null,mr=null,oa=!1,lr=null,dl=0,Zi=0,wd=null,La=-1,za=0;function St(){return ge&6?Ze():La!==-1?La:La=Ze()}function hr(e){return e.mode&1?ge&2&&at!==0?at&-at:wS.transition!==null?(za===0&&(za=Vv()),za):(e=ke,e!==0||(e=window.event,e=e===void 0?16:Gv(e.type)),e):1}function cn(e,t,n,r){if(50<Zi)throw Zi=0,wd=null,Error(q(185));ws(e,n,r),(!(ge&2)||e!==nt)&&(e===nt&&(!(ge&2)&&(Ll|=n),Qe===4&&ir(e,at)),jt(e,r),n===1&&ge===0&&!(t.mode&1)&&(Ko=Ze()+500,$l&&Cr()))}function jt(e,t){var n=e.callbackNode;wb(e,t);var r=Ka(e,e===nt?at:0);if(r===0)n!==null&&Gp(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Gp(n),t===1)e.tag===0?yS(Bm.bind(null,e)):my(Bm.bind(null,e)),mS(function(){!(ge&6)&&Cr()}),n=null;else{switch(Wv(r)){case 1:n=sf;break;case 4:n=Ov;break;case 16:n=Ya;break;case 536870912:n=Bv;break;default:n=Ya}n=f0(n,i0.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function i0(e,t){if(La=-1,za=0,ge&6)throw Error(q(327));var n=e.callbackNode;if(zo()&&e.callbackNode!==n)return null;var r=Ka(e,e===nt?at:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=fl(e,r);else{t=r;var o=ge;ge|=2;var i=a0();(nt!==e||at!==t)&&(Fn=null,Ko=Ze()+500,Br(e,t));do try{DS();break}catch(a){s0(e,a)}while(!0);wf(),ul.current=i,ge=o,Ge!==null?t=0:(nt=null,at=0,t=Qe)}if(t!==0){if(t===2&&(o=Zc(e),o!==0&&(r=o,t=xd(e,o))),t===1)throw n=fs,Br(e,0),ir(e,r),jt(e,Ze()),n;if(t===6)ir(e,r);else{if(o=e.current.alternate,!(r&30)&&!LS(o)&&(t=fl(e,r),t===2&&(i=Zc(e),i!==0&&(r=i,t=xd(e,i))),t===1))throw n=fs,Br(e,0),ir(e,r),jt(e,Ze()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(q(345));case 2:Ar(e,Tt,Fn);break;case 3:if(ir(e,r),(r&130023424)===r&&(t=Mf+500-Ze(),10<t)){if(Ka(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){St(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ed(Ar.bind(null,e,Tt,Fn),t);break}Ar(e,Tt,Fn);break;case 4:if(ir(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=Ze()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*NS(r/1960))-r,10<r){e.timeoutHandle=ed(Ar.bind(null,e,Tt,Fn),r);break}Ar(e,Tt,Fn);break;case 5:Ar(e,Tt,Fn);break;default:throw Error(q(329))}}}return jt(e,Ze()),e.callbackNode===n?i0.bind(null,e):null}function xd(e,t){var n=Ui;return e.current.memoizedState.isDehydrated&&(Br(e,t).flags|=256),e=fl(e,t),e!==2&&(t=Tt,Tt=n,t!==null&&bd(t)),e}function bd(e){Tt===null?Tt=e:Tt.push.apply(Tt,e)}function LS(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 ir(e,t){for(t&=~$f,t&=~Ll,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 Bm(e){if(ge&6)throw Error(q(327));zo();var t=Ka(e,0);if(!(t&1))return jt(e,Ze()),null;var n=fl(e,t);if(e.tag!==0&&n===2){var r=Zc(e);r!==0&&(t=r,n=xd(e,r))}if(n===1)throw n=fs,Br(e,0),ir(e,t),jt(e,Ze()),n;if(n===6)throw Error(q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ar(e,Tt,Fn),jt(e,Ze()),null}function Af(e,t){var n=ge;ge|=1;try{return e(t)}finally{ge=n,ge===0&&(Ko=Ze()+500,$l&&Cr())}}function Yr(e){lr!==null&&lr.tag===0&&!(ge&6)&&zo();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)&&Cr()}}function Nf(){Dt=_o.current,$e(_o)}function Br(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,pS(n)),Ge!==null)for(n=Ge.return;n!==null;){var r=n;switch(gf(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ja();break;case 3:Zo(),$e(_t),$e(yt),Cf();break;case 5:Ef(r);break;case 4:Zo();break;case 13:$e(De);break;case 19:$e(De);break;case 10:xf(r.type._context);break;case 22:case 23:Nf()}n=n.return}if(nt=e,Ge=e=gr(e.current,null),at=Dt=t,Qe=0,fs=null,$f=Ll=Zr=0,Tt=Ui=null,Lr!==null){for(t=0;t<Lr.length;t++)if(n=Lr[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}Lr=null}return e}function s0(e,t){do{var n=Ge;try{if(wf(),Ma.current=ll,al){for(var r=Oe.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}al=!1}if(Ur=0,tt=qe=Oe=null,Wi=!1,us=0,Ff.current=null,n===null||n.return===null){Qe=1,fs=t,Ge=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=Rm(s);if(h!==null){h.flags&=-257,_m(h,s,a,i,t),h.mode&1&&Tm(i,u,t),t=h,l=u;var x=t.updateQueue;if(x===null){var v=new Set;v.add(l),t.updateQueue=v}else x.add(l);break e}else{if(!(t&1)){Tm(i,u,t),Lf();break e}l=Error(q(426))}}else if(Ne&&a.mode&1){var k=Rm(s);if(k!==null){!(k.flags&65536)&&(k.flags|=256),_m(k,s,a,i,t),vf(Yo(l,a));break e}}i=l=Yo(l,a),Qe!==4&&(Qe=2),Ui===null?Ui=[i]:Ui.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=Wy(i,l,t);bm(i,y);break e;case 1:a=l;var g=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(mr===null||!mr.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=Hy(i,a,t);bm(i,b);break e}}i=i.return}while(i!==null)}u0(n)}catch(S){t=S,Ge===n&&n!==null&&(Ge=n=n.return);continue}break}while(!0)}function a0(){var e=ul.current;return ul.current=ll,e===null?ll:e}function Lf(){(Qe===0||Qe===3||Qe===2)&&(Qe=4),nt===null||!(Zr&268435455)&&!(Ll&268435455)||ir(nt,at)}function fl(e,t){var n=ge;ge|=2;var r=a0();(nt!==e||at!==t)&&(Fn=null,Br(e,t));do try{zS();break}catch(o){s0(e,o)}while(!0);if(wf(),ge=n,ul.current=r,Ge!==null)throw Error(q(261));return nt=null,at=0,Qe}function zS(){for(;Ge!==null;)l0(Ge)}function DS(){for(;Ge!==null&&!cb();)l0(Ge)}function l0(e){var t=d0(e.alternate,e,Dt);e.memoizedProps=e.pendingProps,t===null?u0(e):Ge=t,Ff.current=null}function u0(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=FS(n,t),n!==null){n.flags&=32767,Ge=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Qe=6,Ge=null;return}}else if(n=jS(n,t,Dt),n!==null){Ge=n;return}if(t=t.sibling,t!==null){Ge=t;return}Ge=t=e}while(t!==null);Qe===0&&(Qe=5)}function Ar(e,t,n){var r=ke,o=qt.transition;try{qt.transition=null,ke=1,OS(e,t,n,r)}finally{qt.transition=o,ke=r}return null}function OS(e,t,n,r){do zo();while(lr!==null);if(ge&6)throw Error(q(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(q(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(xb(e,i),e===nt&&(Ge=nt=null,at=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||oa||(oa=!0,f0(Ya,function(){return zo(),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,Ff.current=null,MS(e,n),r0(n,e),sS(Qc),Ga=!!qc,Qc=qc=null,e.current=n,AS(n),db(),ge=a,ke=s,qt.transition=i}else e.current=n;if(oa&&(oa=!1,lr=e,dl=o),i=e.pendingLanes,i===0&&(mr=null),mb(n.stateNode),jt(e,Ze()),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(cl)throw cl=!1,e=yd,yd=null,e;return dl&1&&e.tag!==0&&zo(),i=e.pendingLanes,i&1?e===wd?Zi++:(Zi=0,wd=e):Zi=0,Cr(),null}function zo(){if(lr!==null){var e=Wv(dl),t=qt.transition,n=ke;try{if(qt.transition=null,ke=16>e?16:e,lr===null)var r=!1;else{if(e=lr,lr=null,dl=0,ge&6)throw Error(q(331));var o=ge;for(ge|=4,re=e.current;re!==null;){var i=re,s=i.child;if(re.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(re=u;re!==null;){var f=re;switch(f.tag){case 0:case 11:case 15:Hi(8,f,i)}var p=f.child;if(p!==null)p.return=f,re=p;else for(;re!==null;){f=re;var m=f.sibling,h=f.return;if(e0(f),f===u){re=null;break}if(m!==null){m.return=h,re=m;break}re=h}}}var x=i.alternate;if(x!==null){var v=x.child;if(v!==null){x.child=null;do{var k=v.sibling;v.sibling=null,v=k}while(v!==null)}}re=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,re=s;else e:for(;re!==null;){if(i=re,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Hi(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,re=y;break e}re=i.return}}var g=e.current;for(re=g;re!==null;){s=re;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,re=w;else e:for(s=g;re!==null;){if(a=re,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Nl(9,a)}}catch(S){Ue(a,a.return,S)}if(a===s){re=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,re=b;break e}re=a.return}}if(ge=o,Cr(),Sn&&typeof Sn.onPostCommitFiberRoot=="function")try{Sn.onPostCommitFiberRoot(Rl,e)}catch{}r=!0}return r}finally{ke=n,qt.transition=t}}return!1}function Vm(e,t,n){t=Yo(n,t),t=Wy(e,t,1),e=pr(e,t,1),t=St(),e!==null&&(ws(e,1,t),jt(e,t))}function Ue(e,t,n){if(e.tag===3)Vm(e,e,n);else for(;t!==null;){if(t.tag===3){Vm(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(mr===null||!mr.has(r))){e=Yo(n,e),e=Hy(t,e,1),t=pr(t,e,1),e=St(),t!==null&&(ws(t,1,e),jt(t,e));break}}t=t.return}}function BS(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=St(),e.pingedLanes|=e.suspendedLanes&n,nt===e&&(at&n)===n&&(Qe===4||Qe===3&&(at&130023424)===at&&500>Ze()-Mf?Br(e,0):$f|=n),jt(e,t)}function c0(e,t){t===0&&(e.mode&1?(t=Ks,Ks<<=1,!(Ks&130023424)&&(Ks=4194304)):t=1);var n=St();e=Bn(e,t),e!==null&&(ws(e,t,n),jt(e,n))}function VS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),c0(e,n)}function WS(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(q(314))}r!==null&&r.delete(t),c0(e,n)}var d0;d0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||_t.current)Rt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Rt=!1,PS(e,t,n);Rt=!!(e.flags&131072)}else Rt=!1,Ne&&t.flags&1048576&&hy(t,nl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Na(e,t),e=t.pendingProps;var o=Wo(t,yt.current);Lo(t,n),o=Tf(null,t,r,e,o,n);var i=Rf();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,Pt(r)?(i=!0,el(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Sf(t),o.updater=Al,t.stateNode=o,o._reactInternals=t,ad(t,r,e,n),t=cd(null,t,r,!0,i,n)):(t.tag=0,Ne&&i&&hf(t),bt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Na(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=US(r),e=sn(r,e),o){case 0:t=ud(null,t,r,e,n);break e;case 1:t=Fm(null,t,r,e,n);break e;case 11:t=Pm(null,t,r,e,n);break e;case 14:t=jm(null,t,r,sn(r.type,e),n);break e}throw Error(q(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),ud(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),Fm(e,t,r,o,n);case 3:e:{if(Ky(t),e===null)throw Error(q(387));r=t.pendingProps,i=t.memoizedState,o=i.element,by(e,t),il(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=Yo(Error(q(423)),t),t=$m(e,t,r,n,o);break e}else if(r!==o){o=Yo(Error(q(424)),t),t=$m(e,t,r,n,o);break e}else for(Ot=fr(t.stateNode.containerInfo.firstChild),Bt=t,Ne=!0,ln=null,n=wy(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ho(),r===o){t=Vn(e,t,n);break e}bt(e,t,r,n)}t=t.child}return t;case 5:return Sy(t),e===null&&od(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Jc(r,o)?s=null:i!==null&&Jc(r,i)&&(t.flags|=32),Yy(e,t),bt(e,t,s,n),t.child;case 6:return e===null&&od(t),null;case 13:return Gy(e,t,n);case 4:return kf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Uo(t,null,r,n):bt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),Pm(e,t,r,o,n);case 7:return bt(e,t,t.pendingProps,n),t.child;case 8:return bt(e,t,t.pendingProps.children,n),t.child;case 12:return bt(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,Pe(rl,r._currentValue),r._currentValue=s,i!==null)if(fn(i.value,s)){if(i.children===o.children&&!_t.current){t=Vn(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=zn(-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),id(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(q(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),id(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}bt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Lo(t,n),o=Qt(o),r=r(o),t.flags|=1,bt(e,t,r,n),t.child;case 14:return r=t.type,o=sn(r,t.pendingProps),o=sn(r.type,o),jm(e,t,r,o,n);case 15:return Uy(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),Na(e,t),t.tag=1,Pt(r)?(e=!0,el(t)):e=!1,Lo(t,n),Vy(t,r,o),ad(t,r,o,n),cd(null,t,r,!0,e,n);case 19:return Xy(e,t,n);case 22:return Zy(e,t,n)}throw Error(q(156,t.tag))};function f0(e,t){return Dv(e,t)}function HS(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 Gt(e,t,n,r){return new HS(e,t,n,r)}function zf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function US(e){if(typeof e=="function")return zf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===nf)return 11;if(e===rf)return 14}return 2}function gr(e,t){var n=e.alternate;return n===null?(n=Gt(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 Da(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")zf(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case wo:return Vr(n.children,o,i,t);case tf:s=8,o|=8;break;case jc:return e=Gt(12,n,t,o|2),e.elementType=jc,e.lanes=i,e;case Fc:return e=Gt(13,n,t,o),e.elementType=Fc,e.lanes=i,e;case $c:return e=Gt(19,n,t,o),e.elementType=$c,e.lanes=i,e;case Sv:return zl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case xv:s=10;break e;case bv:s=9;break e;case nf:s=11;break e;case rf:s=14;break e;case nr:s=16,r=null;break e}throw Error(q(130,e==null?e:typeof e,""))}return t=Gt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Vr(e,t,n,r){return e=Gt(7,e,r,t),e.lanes=n,e}function zl(e,t,n,r){return e=Gt(22,e,r,t),e.elementType=Sv,e.lanes=n,e.stateNode={isHidden:!1},e}function Gu(e,t,n){return e=Gt(6,e,null,t),e.lanes=n,e}function Xu(e,t,n){return t=Gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ZS(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=Pu(0),this.expirationTimes=Pu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pu(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Df(e,t,n,r,o,i,s,a,l){return e=new ZS(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Gt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sf(i),e}function YS(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:yo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function p0(e){if(!e)return wr;e=e._reactInternals;e:{if(Qr(e)!==e||e.tag!==1)throw Error(q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Pt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(q(171))}if(e.tag===1){var n=e.type;if(Pt(n))return py(e,n,t)}return t}function m0(e,t,n,r,o,i,s,a,l){return e=Df(n,r,!0,e,o,i,s,a,l),e.context=p0(null),n=e.current,r=St(),o=hr(n),i=zn(r,o),i.callback=t??null,pr(n,i,o),e.current.lanes=o,ws(e,o,r),jt(e,r),e}function Dl(e,t,n,r){var o=t.current,i=St(),s=hr(o);return n=p0(n),t.context===null?t.context=n:t.pendingContext=n,t=zn(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=pr(o,t,s),e!==null&&(cn(e,o,s,i),$a(e,o,s)),s}function pl(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 Wm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Of(e,t){Wm(e,t),(e=e.alternate)&&Wm(e,t)}function KS(){return null}var h0=typeof reportError=="function"?reportError:function(e){console.error(e)};function Bf(e){this._internalRoot=e}Ol.prototype.render=Bf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(q(409));Dl(e,t,null,null)};Ol.prototype.unmount=Bf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Yr(function(){Dl(null,e,null,null)}),t[On]=null}};function Ol(e){this._internalRoot=e}Ol.prototype.unstable_scheduleHydration=function(e){if(e){var t=Zv();e={blockedOn:null,target:e,priority:t};for(var n=0;n<or.length&&t!==0&&t<or[n].priority;n++);or.splice(n,0,e),n===0&&Kv(e)}};function Vf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Hm(){}function GS(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=pl(s);i.call(u)}}var s=m0(t,r,e,0,null,!1,!1,"",Hm);return e._reactRootContainer=s,e[On]=s.current,os(e.nodeType===8?e.parentNode:e),Yr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var u=pl(l);a.call(u)}}var l=Df(e,0,!1,null,null,!1,!1,"",Hm);return e._reactRootContainer=l,e[On]=l.current,os(e.nodeType===8?e.parentNode:e),Yr(function(){Dl(t,l,n,r)}),l}function Vl(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=pl(s);a.call(l)}}Dl(t,s,e,o)}else s=GS(n,t,e,o,r);return pl(s)}Hv=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Mi(t.pendingLanes);n!==0&&(af(t,n|1),jt(t,Ze()),!(ge&6)&&(Ko=Ze()+500,Cr()))}break;case 13:Yr(function(){var r=Bn(e,1);if(r!==null){var o=St();cn(r,e,1,o)}}),Of(e,1)}};lf=function(e){if(e.tag===13){var t=Bn(e,134217728);if(t!==null){var n=St();cn(t,e,134217728,n)}Of(e,134217728)}};Uv=function(e){if(e.tag===13){var t=hr(e),n=Bn(e,t);if(n!==null){var r=St();cn(n,e,t,r)}Of(e,t)}};Zv=function(){return ke};Yv=function(e,t){var n=ke;try{return ke=e,t()}finally{ke=n}};Wc=function(e,t,n){switch(t){case"input":if(Nc(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=Fl(r);if(!o)throw Error(q(90));Ev(r),Nc(r,o)}}}break;case"textarea":Iv(e,n);break;case"select":t=n.value,t!=null&&$o(e,!!n.multiple,t,!1)}};$v=Af;Mv=Yr;var XS={usingClientEntryPoint:!1,Events:[bs,ko,Fl,jv,Fv,Af]},Si={findFiberByHostInstance:Nr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},qS={bundleType:Si.bundleType,version:Si.version,rendererPackageName:Si.rendererPackageName,rendererConfig:Si.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Hn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Lv(e),e===null?null:e.stateNode},findFiberByHostInstance:Si.findFiberByHostInstance||KS,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 ia=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ia.isDisabled&&ia.supportsFiber)try{Rl=ia.inject(qS),Sn=ia}catch{}}Wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=XS;Wt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Vf(t))throw Error(q(200));return YS(e,t,null,n)};Wt.createRoot=function(e,t){if(!Vf(e))throw Error(q(299));var n=!1,r="",o=h0;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Df(e,1,!1,null,null,n,!1,r,o),e[On]=t.current,os(e.nodeType===8?e.parentNode:e),new Bf(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(q(188)):(e=Object.keys(e).join(","),Error(q(268,e)));return e=Lv(t),e=e===null?null:e.stateNode,e};Wt.flushSync=function(e){return Yr(e)};Wt.hydrate=function(e,t,n){if(!Bl(t))throw Error(q(200));return Vl(null,e,t,!0,n)};Wt.hydrateRoot=function(e,t,n){if(!Vf(e))throw Error(q(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=h0;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=m0(t,null,e,1,n??null,o,!1,i,s),e[On]=t.current,os(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 Ol(t)};Wt.render=function(e,t,n){if(!Bl(t))throw Error(q(200));return Vl(null,e,t,!1,n)};Wt.unmountComponentAtNode=function(e){if(!Bl(e))throw Error(q(40));return e._reactRootContainer?(Yr(function(){Vl(null,null,e,!1,function(){e._reactRootContainer=null,e[On]=null})}),!0):!1};Wt.unstable_batchedUpdates=Af;Wt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Bl(n))throw Error(q(200));if(e==null||e._reactInternals===void 0)throw Error(q(38));return Vl(e,t,n,!1,r)};Wt.version="18.3.1-next-f1338f8080-20240426";function g0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g0)}catch(e){console.error(e)}}g0(),gv.exports=Wt;var Sd=gv.exports,Um=Sd;_c.createRoot=Um.createRoot,_c.hydrateRoot=Um.hydrateRoot;var QS=Object.defineProperty,v0=(e,t)=>{for(var n in t)QS(e,n,{get:t[n],enumerable:!0,configurable:!0,set:r=>t[n]=()=>r})};if(typeof d.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 Jr=d.createContext(!1),kd=({children:e})=>c.jsx(Jr.Provider,{value:!0,children:e}),y0=d.createContext({setError:()=>{},clearError:()=>{}}),Zm=()=>{try{return typeof __webpack_module__>"u"?null:__webpack_module__.hot??null}catch{return null}};class JS extends te.Component{constructor(){super(...arguments);Se(this,"state",{hasError:!1});Se(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=Zm();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=Zm();r&&r.removeStatusHandler(n)}render(){return this.state.hasError?null:this.props.children}}var ei=d.createContext({compositions:[],folders:[],currentCompositionMetadata:null,canvasContent:null}),ks=d.createContext({registerComposition:()=>{},unregisterComposition:()=>{},registerFolder:()=>{},unregisterFolder:()=>{},setCanvasContent:()=>{},onlyRenderComposition:null}),Es=d.createContext({getNonce:()=>0}),Oa=0;try{typeof __webpack_module__<"u"&&__webpack_module__.hot&&__webpack_module__.hot.addStatusHandler(e=>{e==="idle"&&Oa++})}catch{}var Wl=()=>{const t=d.useContext(Es).getNonce(),n=d.useRef(t);n.current=t;const r=d.useRef([[Oa,t]]),o=d.useCallback(()=>(Oa!==r.current[r.current.length-1][0]&&(r.current=[...r.current,[Oa,n.current]]),r.current),[r]);return d.useMemo(()=>({get:o}),[o])};function ti(e){return!!e}var w0=()=>/^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g,x0=e=>e.match(w0()),ek=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(!x0(e))throw new Error(`Folder name can only contain a-z, A-Z, 0-9 and -. You passed ${e}`)},tk=`Folder name must match ${String(w0())}`,Ed=d.createContext({folderName:null,parentName:null}),nk=e=>{const{name:t,children:n}=e,r=d.useContext(Ed),{registerFolder:o,unregisterFolder:i}=d.useContext(ks),s=Wl(),a=e.stack??null;ek(t);const l=[r.parentName,r.folderName].filter(ti),u=l.length===0?null:l.join("/"),f=d.useMemo(()=>({folderName:t,parentName:u}),[t,u]);return d.useEffect(()=>(o(t,u,s.get(),a),()=>{i(t,u)}),[t,r.folderName,u,o,i,s,a]),c.jsx(Ed.Provider,{value:f,children:n})};function Ym(){return["NOD","E_EN","V"].join("")}var Km=()=>["e","nv"].join(""),Xt=()=>{const e=typeof window<"u"&&window.remotion_isPlayer,t=typeof window<"u"&&typeof window.process<"u"&&typeof window.process.env<"u"&&(window.process[Km()][Ym()]==="test"||window.process[Km()][Ym()]==="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}},Cd="remotion-date:",ps="remotion-file:",rk=({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,`${Cd}${f.toISOString()}`):f instanceof Map?(i=!0,u):f instanceof Set?(s=!0,u):typeof f=="string"&&n!==null&&f.startsWith(n)?(o=!0,`${ps}${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)}},b0=e=>JSON.parse(e,(t,n)=>typeof n=="string"&&n.startsWith(Cd)?new Date(n.replace(Cd,"")):typeof n=="string"&&n.startsWith(ps)?`${window.remotion_staticBase}/${n.replace(ps,"")}`:n),ok=e=>b0(rk({data:e,indent:2,staticBase:window.remotion_staticBase}).serializedString),Id=e=>Xt().isStudio?ok(e):e,S0=d.createContext(!1),ik=({children:e})=>c.jsx(S0.Provider,{value:!0,children:e}),Wf=()=>d.useContext(S0),Qn=({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}`))},sk=(e,t)=>{const{style:n,...r}=e,o=d.useMemo(()=>({position:"absolute",top:Qn({className:r.className,classPrefix:["top-","inset-"],type:"prefix"})?void 0:0,left:Qn({className:r.className,classPrefix:["left-","inset-"],type:"prefix"})?void 0:0,right:Qn({className:r.className,classPrefix:["right-","inset-"],type:"prefix"})?void 0:0,bottom:Qn({className:r.className,classPrefix:["bottom-","inset-"],type:"prefix"})?void 0:0,width:Qn({className:r.className,classPrefix:["w-"],type:"prefix"})?void 0:"100%",height:Qn({className:r.className,classPrefix:["h-"],type:"prefix"})?void 0:"100%",display:Qn({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:Qn({className:r.className,classPrefix:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"],type:"exact"})?void 0:"column",...n}),[r.className,n]);return c.jsx("div",{ref:t,style:o,...r})},pn=d.forwardRef(sk),ak={transform:"rotate(90deg)"},Gm=40,lk={color:"white",fontSize:14,fontFamily:"sans-serif"},uk={justifyContent:"center",alignItems:"center"},ck=()=>c.jsxs(pn,{style:uk,id:"remotion-comp-loading",children:[c.jsx("style",{type:"text/css",children:`
42
+ @keyframes anim {
43
+ from {
44
+ opacity: 0
45
+ }
46
+ to {
47
+ opacity: 1
48
+ }
49
+ }
50
+ #remotion-comp-loading {
51
+ animation: anim 2s;
52
+ animation-fill-mode: forwards;
53
+ }
54
+ `}),c.jsx("svg",{width:Gm,height:Gm,viewBox:"-100 -100 400 400",style:ak,children:c.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"})}),c.jsxs("p",{style:lk,children:["Resolving ","<Suspense>","..."]})]}),Nt=null,Td=()=>{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},Rd=()=>"remotion_inputPropsOverride"+window.location.origin,k0=()=>{if(typeof localStorage>"u")return null;const e=localStorage.getItem(Rd());return e?JSON.parse(e):null},dk=e=>{if(!(typeof localStorage>"u")){if(e===null){localStorage.removeItem(Rd());return}localStorage.setItem(Rd(),JSON.stringify(e))}},Xm=!1,fk=()=>{Xm||(Xm=!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()"))},pk=()=>{if(typeof window>"u")return fk(),{};if(Xt().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=k0();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?b0(t):{}},Hf=d.createContext({props:{},updateProps:()=>{throw new Error("Not implemented")}}),mk=te.createRef(),E0=({children:e})=>{const[t,n]=te.useState({}),r=d.useCallback(({defaultProps:i,id:s,newProps:a})=>{n(l=>({...l,[s]:typeof a=="function"?a(l[s]??i):a}))},[]),o=d.useMemo(()=>({props:t,updateProps:r}),[t,r]);return c.jsx(Hf.Provider,{value:o,children:e})},C0=te.createContext(null),Ye=()=>{const e=d.useContext(C0),[t]=d.useState(()=>Xt());return e??t};function ml(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 Hl(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 Ul(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 Zl=d.createContext(null),hk=d.createRef(),gk=e=>!!e.calculateMetadata,Uf=e=>{const t=d.useContext(Zl),{props:n}=d.useContext(Hf),{compositions:r,canvasContent:o,currentCompositionMetadata:i}=d.useContext(ei),s=(o==null?void 0:o.type)==="composition"?o.compositionId:null,a=e??s,l=r.find(p=>p.id===a),u=d.useMemo(()=>l?n[l.id]??{}:{},[n,l]),f=Ye();return d.useMemo(()=>l?i?{type:"success",metadataSource:null,result:{...i,id:l.id,defaultProps:l.defaultProps??{}}}:gk(l)?!t||!t[l.id]?null:t[l.id]:(Hl(l.durationInFrames,{allowFloats:!1,component:`in <Composition id="${l.id}">`}),Ul(l.fps,`in <Composition id="${l.id}">`),ml(l.width,"width",`in <Composition id="${l.id}">`),ml(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?{}:pk()??{}},defaultCodec:null,defaultOutName:null,defaultVideoImageFormat:null,defaultPixelFormat:null,defaultProResProfile:null,defaultSampleRate:null}}):null,[l,t,i,u,f.isPlayer])},I0=e=>{const t=e.stack??"";return t.startsWith("Error:")?t:`${e.message}
55
+ ${t}`},vk=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 Zf(e,t){let n;throw vk(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=I0(n)),n}function ms(e){return Zf(typeof window<"u"?window:void 0,e)}var yk=["trace","verbose","info","warn","error"],qm=e=>yk.indexOf(e),Yl=(e,t)=>qm(e)<=qm(t),Cs=({args:e,logLevel:t,tag:n})=>{const r=[...e];return Xt().isRendering&&!Xt().isClientSideRendering&&r.unshift(Symbol.for(`__remotion_level_${t}`)),n&&Xt().isRendering&&!Xt().isClientSideRendering&&r.unshift(Symbol.for(`__remotion_tag_${n}`)),r},wk=(e,...t)=>{if(Yl(e.logLevel,"verbose"))return console.debug(...Cs({args:t,logLevel:"verbose",tag:e.tag}))},xk=(e,...t)=>{if(Yl(e.logLevel,"trace"))return console.debug(...Cs({args:t,logLevel:"trace",tag:e.tag}))},bk=(e,...t)=>{if(Yl(e.logLevel,"info"))return console.log(...Cs({args:t,logLevel:"info",tag:e.tag}))},Sk=(e,...t)=>{if(Yl(e.logLevel,"warn"))return console.warn(...Cs({args:t,logLevel:"warn",tag:e.tag}))},kk=(e,...t)=>console.error(...Cs({args:t,logLevel:"error",tag:e.tag})),rt={trace:xk,verbose:wk,info:bk,warn:Sk,error:kk};typeof window<"u"&&(window.remotion_renderReady=!1,window.remotion_delayRenderTimeouts||(window.remotion_delayRenderTimeouts={}),window.remotion_delayRenderHandles=[]);var Ek="The delayRender was called:",Ck="Retries left: ",Ik="- Rendering the frame will be retried.",Tk="handle was cleared after",Rk=3e4,T0=({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??Rk)-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?Ck+l:null,l>0?Ik:null,Ek,i].filter(ti).join(" ");t.isClientSideRendering?e.remotion_cancelledError=I0(Error(u)):Zf(e,Error(u))},a)}}return e.remotion_renderReady=!1,o},_k=(e,t)=>typeof window>"u"?Math.random():T0({scope:window,environment:Xt(),label:e??null,options:{}}),R0=({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",Tk,`${Date.now()-a}ms`].filter(ti).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)},Pk=e=>{typeof window>"u"||R0({scope:window,handle:e,environment:Xt(),logLevel:window.remotion_logLevel??"info"})},eo=d.createContext({logLevel:"info",mountTime:0}),Cn=()=>{const{logLevel:e}=d.useContext(eo);if(e===null)throw new Error("useLogLevel must be used within a LogLevelProvider");return e},Is=()=>{const{mountTime:e}=d.useContext(eo);if(e===null)throw new Error("useMountTime must be used within a LogLevelProvider");return e},_0=d.createContext(null),mn=()=>{const e=Ye(),t=d.useContext(_0)??(typeof window<"u"?window:void 0),n=Cn(),r=d.useCallback((s,a)=>t?T0({scope:t,environment:e,label:s??null,options:a??{}}):Math.random(),[e,t]),o=d.useCallback(s=>{t&&R0({scope:t,handle:s,environment:e,logLevel:n})},[e,n,t]),i=d.useCallback(s=>Zf(t??(typeof window<"u"?window:void 0),s),[t]);return{delayRender:r,continueRender:o,cancelRender:i}},P0=({compProps:e,componentName:t,noSuspense:n})=>{const r=d.useRef(null);return"component"in e&&(r.current=e.component),d.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 te.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 te.lazy(e.lazyComponent)}throw new Error("You must pass either 'component' or 'lazyComponent'")},[e.lazyComponent])},Kl=()=>{const{canvasContent:e,compositions:t,currentCompositionMetadata:n}=d.useContext(ei),r=t.find(i=>(e==null?void 0:e.type)==="composition"&&i.id===e.compositionId),o=Uf((r==null?void 0:r.id)??null);return d.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])},j0=()=>/^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g,F0=e=>e.match(j0()),jk=e=>{if(!F0(e))throw new Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${e}`)},Fk=`Composition ID must match ${String(j0())}`,$k=(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}"`:""}`)}},Mk=()=>{const{continueRender:e,delayRender:t}=mn();return d.useEffect(()=>{const n=t("Waiting for Root component to unsuspend");return()=>e(n)},[e,t]),null},Ak=({width:e,height:t,fps:n,durationInFrames:r,id:o,defaultProps:i,schema:s,...a})=>{const l=d.useContext(ks),{registerComposition:u,unregisterComposition:f}=l,p=Kl(),m=P0({compProps:a,componentName:"Composition",noSuspense:!1}),h=Wl(),x=Wf(),v=Ye(),k=d.useContext(Jr);if(typeof window<"u"&&(window.remotion_seenCompositionIds=Array.from(new Set([...window.remotion_seenCompositionIds??[],o]))),k)throw x?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:y,parentName:g}=d.useContext(Ed),w=a.stack??null,b="component"in a?a.component:null;d.useEffect(()=>{if(!o)throw new Error("No id for composition passed.");return jk(o),$k(i,"defaultProps",o),u({durationInFrames:r??void 0,fps:n??void 0,height:t??void 0,width:e??void 0,id:o,folderName:y,component:m,defaultProps:Id(i??{}),nonce:h.get(),parentFolderName:g,componentFromProps:b,schema:s??null,calculateMetadata:a.calculateMetadata??null,stack:w}),()=>{f(o)}},[r,n,t,m,o,y,i,e,h,g,b,s,a.calculateMetadata,w,u,f]);const S=Uf(o),{setError:C,clearError:E}=d.useContext(y0),T=d.useCallback(j=>{C(j)},[C]),_=d.useCallback(()=>{E()},[E]);if(v.isStudio&&p&&p.component===m&&p.id===o){const j=m;return S===null||S.type!=="success"&&S.type!=="success-and-refreshing"?null:Sd.createPortal(c.jsx(kd,{children:c.jsx(JS,{onError:T,onClear:_,children:c.jsx(d.Suspense,{fallback:c.jsx(ck,{}),children:c.jsx(j,{...S.result.props??{}})})})}),Td())}if(v.isRendering&&p&&p.component===m&&p.id===o){const j=m;return S===null||S.type!=="success"&&S.type!=="success-and-refreshing"?null:Sd.createPortal(c.jsx(kd,{children:c.jsx(d.Suspense,{fallback:c.jsx(Mk,{}),children:c.jsx(j,{...S.result.props??{}})})}),Td())}return null},hl=e=>{const{onlyRenderComposition:t}=d.useContext(ks);return t&&t!==e.id?null:c.jsx(Ak,{...e})},$0=[],M0=null,Nk=()=>$0,Ct=e=>{$0.push(e)},Lk=e=>{M0=e},zk=()=>M0,Dk=e=>{const t=te.Children.toArray(e);if(t.length!==1)return null;const n=t[0];return!te.isValidElement(n)||typeof n.type!="function"&&typeof n.type!="object"?null:n.type},Ni="4.0.499",Ok=()=>{if(typeof globalThis>"u")return;const e=()=>{globalThis.remotion_imported=Ni,typeof window<"u"&&(window.remotion_imported=Ni)},t=globalThis.remotion_imported||typeof window<"u"&&window.remotion_imported;if(t){if(t===Ni)return;if(typeof t=="string"&&t.includes("webcodecs")){e();return}throw new TypeError(`🚨 Multiple versions of Remotion detected: ${[Ni,typeof t=="string"?t:"an older version"].filter(ti).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=d.createContext(null),_d={};v0(_d,{useTimelineSetFrame:()=>B0,useTimelinePosition:()=>Tr,useTimelineContext:()=>Ir,usePlayingState:()=>V0,usePlaybackRate:()=>Xf,useAbsoluteTimelinePosition:()=>O0,persistCurrentFrame:()=>A0,getInitialFrameState:()=>N0,getFrameForComposition:()=>L0,clampFrameToCompositionRange:()=>z0});function Qm(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 Bk(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 to=(e,t)=>{if(e===null)return Math.random();if(typeof e=="string")return Qm(Bk(e));if(typeof e=="number")return Qm(e*1e10);throw new Error("random() argument must be a number or a string")},ni=d.createContext({setFrame:()=>{throw new Error("default")},setPlaying:()=>{throw new Error("default")}}),ri=d.createContext(null),Yf=d.createContext(null),Kf=d.createContext(null),Vk=({children:e,frameState:t})=>{const[n,r]=d.useState(!1),o=d.useRef(!1),[i,s]=d.useState(1),a=d.useRef([]),[l]=d.useState(()=>String(to(null))),[u,f]=d.useState(()=>N0()),p=t??u,{delayRender:m,continueRender:h}=mn();typeof window<"u"&&d.useLayoutEffect(()=>{window.remotion_setFrame=(y,g,w)=>{window.remotion_attempt=w;const b=m(`Setting the current frame to ${y}`);let S=!0;f(C=>(C[g]??window.remotion_initialFrame)===y?(S=!1,C):{...C,[g]:y}),S?requestAnimationFrame(()=>h(b)):h(b)},window.remotion_isPlayer=!1},[h,m]);const x=d.useMemo(()=>({frame:p,playing:n,imperativePlaying:o,rootId:l,audioAndVideoTags:a}),[p,n,l]),v=d.useMemo(()=>({playbackRate:i,setPlaybackRate:s}),[i]),k=d.useMemo(()=>({setFrame:f,setPlaying:r}),[]);return c.jsx(Kf.Provider,{value:x,children:c.jsx(Yf.Provider,{value:v,children:c.jsx(ri.Provider,{value:x,children:c.jsx(ni.Provider,{value:k,children:e})})})})},Gf=()=>"remotion.time-all",A0=e=>{localStorage.setItem(Gf(),JSON.stringify(e))},N0=()=>{const e=localStorage.getItem(Gf())??"{}";return JSON.parse(e)},L0=e=>{const t=localStorage.getItem(Gf())??"{}",n=JSON.parse(t);return n[e]!==void 0?Number(n[e]):typeof window>"u"?0:window.remotion_initialFrame??0},z0=(e,t)=>Math.max(0,Math.min(Math.max(0,t-1),e)),D0=e=>{const t=Kl(),n=Ye();if(!t)return typeof window>"u"?0:window.remotion_initialFrame??0;const r=e.frame[t.id]??(n.isPlayer?0:L0(t.id));return z0(r,t.durationInFrames)},Ir=()=>{const e=d.useContext(ri);if(e===null)throw new Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return e},Xf=()=>{const e=d.useContext(Yf);if(e===null)throw new Error("PlaybackRateContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return e},Tr=()=>{const e=Ir();return D0(e)},O0=()=>{const e=d.useContext(Kf);if(e===null)throw new Error("AbsoluteTimeContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return D0(e)},B0=()=>{const{setFrame:e}=d.useContext(ni);return e},V0=()=>{const{playing:e,imperativePlaying:t}=Ir(),{setPlaying:n}=d.useContext(ni);return d.useMemo(()=>[e,n,t],[t,e,n])},ct=()=>{const e=d.useContext(Jr),t=Ye();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=Tr(),r=d.useContext(et),o=r?r.cumulatedFrom+r.relativeFrom:0;return n-o},Gl=()=>{const e=d.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=Kl();return d.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:x,defaultPixelFormat:v,defaultProResProfile:k,defaultSampleRate:y}=o;return{id:i,width:t??u,height:n??l,fps:a,durationInFrames:r??s,defaultProps:f,props:p,defaultCodec:m,defaultOutName:h,defaultVideoImageFormat:x,defaultPixelFormat:v,defaultProResProfile:k,defaultSampleRate:y}},[r,n,t,o])},Xe=()=>{const e=Gl(),t=d.useContext(Jr),n=Wf();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},Ts=({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=d.useMemo(()=>{if(typeof n=="boolean")return n;if(typeof n=="function")return n(r)},[n,r]),s=Ir(),a=d.useContext(et),l=(a==null?void 0:a.relativeFrom)??0,u=d.useMemo(()=>i?{...s,playing:!1,imperativePlaying:{current:!1},frame:{[o.id]:e+l}}:s,[i,s,o.id,e,l]),f=d.useMemo(()=>a?i?{...a,cumulatedFrom:0}:a:null,[a,i]);return c.jsx(ri.Provider,{value:u,children:c.jsx(et.Provider,{value:f,children:t})})},In={"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}},Wk=In,Xl={"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}},Rr={"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"}},_r={"style.backgroundColor":{type:"color",default:"transparent",description:"Color"}},W0={children:{type:"text-content",default:"",description:"Text",keyframable:!1}},oi={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}},H0={...oi},U0={...In,..._r,...Rr,...H0},qf={type:"boolean",default:!1,description:"Hidden"},Z0={type:"hidden"},Qf={type:"hidden"},Hk=e=>({name:Qf,...e}),Jf={type:"number",default:void 0,min:1,step:1,hiddenFromList:!0},Y0={type:"number",default:0,step:1,hiddenFromList:!0},K0={type:"number",default:0,min:0,step:1,hiddenFromList:!0},ep={type:"number",default:null,step:1,hiddenFromList:!0},Un={durationInFrames:Jf,from:Y0,trimBefore:K0,freeze:ep,hidden:qf,name:Qf,showInTimeline:Z0},Go={...Un,layout:{type:"enum",default:"absolute-fill",description:"Layout",variants:{"absolute-fill":U0,none:{}}}},Uk={durationInFrames:Jf,trimBefore:K0,freeze:ep,hidden:qf,name:Qf,showInTimeline:Z0},Zk={...Uk,layout:Go.layout},Yk={...Go,layout:{...Go.layout,default:"none"}},ii=te.createContext({registerSequence:()=>{throw new Error("SequenceManagerContext not initialized")},unregisterSequence:()=>{throw new Error("SequenceManagerContext not initialized")},sequences:[]}),ql=te.createContext({current:[]}),Mn=e=>`${e.absolutePath}\0${e.nodePath.join(".")}\0${e.sequenceKeys.join(".")}\0${e.effectKeys.map(t=>t.join(".")).join(".")}`,Ql=te.createContext({propStatuses:{}}),Jl=te.createContext({current:{}}),eu=te.createContext({getDragOverrides:()=>{throw new Error("VisualModeDragOverridesContext not initialized")},getEffectDragOverrides:()=>{throw new Error("VisualModeDragOverridesContext not initialized")}}),G0=te.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")}}),qu=(e,t)=>`${Mn(e)}.effects.${t}`,Kk=({children:e})=>{const[t,n]=d.useState([]),r=d.useRef(t);r.current=t;const[o,i]=d.useState({}),s=d.useRef(o);s.current=o;const[a,l]=d.useState({}),[u,f]=d.useState({}),p=d.useRef(u);p.current=u;const m=d.useCallback((_,j,A)=>{i(z=>({...z,[Mn(_)]:{...z[Mn(_)],[j]:A}}))},[]),h=d.useCallback(_=>{i(j=>{const A=Mn(_);if(!j[A])return j;const z={...j};return delete z[A],z})},[]),x=d.useCallback((_,j,A,z)=>{l($=>{const M=qu(_,j);return{...$,[M]:{...$[M],[A]:z}}})},[]),v=d.useCallback((_,j)=>{l(A=>{const z=qu(_,j);if(!A[z])return A;const $={...A};return delete $[z],$})},[]),k=d.useCallback((_,j)=>{f(A=>{const z=Mn(_),$=A[z],M=j($);return $===M?A:{...A,[z]:M}})},[]),y=d.useCallback(_=>{n(j=>[...j,_])},[]),g=d.useCallback(_=>{n(j=>j.filter(A=>A.id!==_))},[]),w=d.useMemo(()=>({registerSequence:y,sequences:t,unregisterSequence:g}),[y,t,g]),b=d.useCallback(_=>o[Mn(_)]??{},[o]),S=d.useCallback((_,j)=>a[qu(_,j)]??{},[a]),C=d.useMemo(()=>({propStatuses:u}),[u]),E=d.useMemo(()=>({getDragOverrides:b,getEffectDragOverrides:S}),[b,S]),T=d.useMemo(()=>({setDragOverrides:m,clearDragOverrides:h,setEffectDragOverrides:x,clearEffectDragOverrides:v,setPropStatuses:k}),[m,h,x,v,k]);return c.jsx(ql.Provider,{value:r,children:c.jsx(ii.Provider,{value:w,children:c.jsx(Jl.Provider,{value:p,children:c.jsx(Ql.Provider,{value:C,children:c.jsx(eu.Provider,{value:E,children:c.jsx(G0.Provider,{value:T,children:e})})})})})})},tu=d.createContext(!1),Gk=({children:e})=>c.jsx(tu.Provider,{value:!0,children:e}),X0=({children:e})=>c.jsx(tu.Provider,{value:!1,children:e}),Xk=()=>{if(!te.useContext(tu))throw new Error("This component must be inside a <Series /> component.")},q0=d.createContext({premountFramesRemaining:0}),qk=!1,Rs=e=>e??qk,_s=({from:e,durationInFrames:t,premountFor:n,postmountFor:r,style:o,styleWhilePremounted:i,styleWhilePostmounted:s,hideWhilePremounted:a})=>{const l=d.useContext(q0),u=ct()-l.premountFramesRemaining,f=Ye(),{fps:p}=Xe(),m=n??0,h=r??0,x=Math.ceil(e+t-1),v=!f.isRendering&&u<e&&u>=e-m,k=!f.isRendering&&u>x&&u<=x+h,y=v||k,g=v?e:k?e+t-1:0,w=d.useMemo(()=>y?{...o,...a==="opacity"?{opacity:0}:{display:"none"},pointerEvents:"none",...v?i:{},...k?s:{}}:o,[y,a,k,v,o,s,i]);return{effectivePremountFor:m,effectivePostmountFor:h,premountingActive:v,postmountingActive:k,isPremountingOrPostmounting:y,freezeFrame:g,premountingStyle:w}},Qk=(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},Jk=4,eE=.001,tE=1e-7,nE=10,Li=11,sa=1/(Li-1),rE=typeof Float32Array=="function";function Q0(e,t){return 1-3*t+3*e}function J0(e,t){return 3*t-6*e}function ew(e){return 3*e}function gl(e,t,n){return((Q0(t,n)*e+J0(t,n))*e+ew(t))*e}function tw(e,t,n){return 3*Q0(t,n)*e*e+2*J0(t,n)*e+ew(t)}function oE({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=gl(s,r,o)-e,i>0?u=s:l=s;while(Math.abs(i)>tE&&++a<nE);return s}function iE(e,t,n,r){let o=t;for(let i=0;i<Jk;++i){const s=tw(o,n,r);if(s===0)return o;const a=gl(o,n,r)-e;o-=a/s}return o}function nw(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=rE?new Float32Array(Li):new Array(Li);if(e!==t||n!==r)for(let s=0;s<Li;++s)o[s]=gl(s*sa,e,n);function i(s){let a=0,l=1;const u=Li-1;for(;l!==u&&o[l]<=s;++l)a+=sa;--l;const f=(s-o[l])/(o[l+1]-o[l]),p=a+f*sa,m=tw(p,e,n);return m>=eE?iE(s,p,e,n):m===0?p:oE({aX:s,_aA:a,_aB:a+sa,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:gl(i(a),t,r)}}var sE=e=>Math.round(e*1e6)/1e6,aE=new Set(["deg","rad","grad","turn"]),rw=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"]),ow=/^([+-]?(?:\d+\.?\d*|\.\d+))([a-zA-Z%]+)?$/,iw=new Set(["left","center","right","top","bottom"]),Po=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:"%"}}],ki={value:50,unit:"%"},Jm=e=>String(sE(e)),lE=(e,t)=>{const n=ow.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(aE.has(r))return{kind:"rotate",value:o,unit:r};if(rw.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`)},sw=({component:e,value:t,allowPercentage:n})=>{const r=ow.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||!rw.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}},Qu=(e,t)=>{const n=e.toLowerCase();return iw.has(n)?{type:"keyword",keyword:n}:{type:"length-percentage",parsed:sw({component:e,value:t,allowPercentage:!0})}},uE=(e,t,n)=>{const r=[];for(const o of Po(e))for(const i of Po(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]},cE=(e,t)=>{if(e.length===1){const a=Qu(e[0],t);return a.type==="length-percentage"?[a.parsed,ki]:a.keyword==="top"||a.keyword==="bottom"?[ki,Po(a.keyword)[0].value]:[Po(a.keyword)[0].value,ki]}const n=Qu(e[0],t),r=Qu(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 uE(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[Po(o.keyword)[0].value,i]}return o.keyword==="top"||o.keyword==="bottom"?[i,Po(o.keyword)[0].value]:s?[ki,i]:[i,ki]},dE=(e,t)=>{const[n,r]=cE(t.slice(0,2),e),o=t[2]===void 0?{value:0,unit:null}:sw({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}},fE=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=>iw.has(f.toLowerCase())))return dE(e,t);const n=t.map(f=>lE(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}},pE=({kind:e,values:t,units:n,dimensions:r})=>e==="scale"?t.slice(0,r).map(o=>Jm(o)).join(" "):t.slice(0,r).map((o,i)=>`${Jm(o)}${n[i]}`).join(" "),eh=e=>e===0?0:Math.sign(e)*e*e,mE=e=>e===0?0:Math.sign(e)*Math.sqrt(Math.abs(e));function hE(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=eh(p),x=eh(m);l=mE(l*(x-h)+h)}else l=l*(m-p)+p;return l}function gE(e,t){let n;for(n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var vE=e=>e,yE=e=>e??"linear",aw=e=>e.remotionShouldExtendRight===!0,th=({easing:e,segmentIndex:t})=>e===void 0?vE:typeof e=="function"?e:e[t],nh=({input:e,inputRange:t,outputRange:n,easing:r,extrapolateLeft:o,extrapolateRight:i,output:s})=>hE(e,t,n,{easing:r,extrapolateLeft:o,extrapolateRight:e>t[1]&&i==="clamp"&&aw(r)?"extend":i,output:s}),tp=({input:e,inputRange:t,outputRange:n,options:r})=>{const o=yE(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=gE(l,t),f=th({easing:i,segmentIndex:u});let p=nh({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=th({easing:i,segmentIndex:m});if(!aw(h))continue;const x=t[m+1];if(l<=x)continue;const v=nh({input:l,inputRange:[t[m],x],outputRange:[n[m],n[m+1]],easing:h,extrapolateLeft:s,extrapolateRight:"extend",output:o});p+=v-n[m+1]}return p},wE=({input:e,inputRange:t,outputRange:n,options:r})=>{var u;const o=n.map(fE),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]=tp({input:e,inputRange:t,outputRange:o.map(p=>p.values[f]),options:r});return pE({kind:i,values:l,units:a,dimensions:s})},xE=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},bE=({input:e,inputRange:t,outputRange:n,options:r})=>{const o=xE(n);return new Array(o).fill(!0).map((i,s)=>tp({input:e,inputRange:t,outputRange:n.map(a=>a[s]),options:r}))};function SE(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 rh(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 kE(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 EE(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 CE(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 si(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(rh("inputRange",t),SE(t),kE(r==null?void 0:r.easing,t.length),EE(r==null?void 0:r.posterize),CE(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 wE({input:e,inputRange:t,outputRange:n,options:r})}if(n.every(i=>Array.isArray(i)))return bE({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 rh("outputRange",n),tp({input:e,inputRange:t,outputRange:n,options:r})}var IE=({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}`)},TE=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)}},RE={damping:10,mass:1,stiffness:100,overshootClamping:!1},Ju={};function _E({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(Ju[p])return Ju[p];const m=-s,h=r-i,x=l/(2*Math.sqrt(f*u)),v=Math.sqrt(f/u),k=v*Math.sqrt(1-x**2),y=a/1e3,g=Math.sin(k*y),w=Math.cos(k*y),b=Math.exp(-x*v*y),S=b*(g*((m+x*v*h)/k)+h*w),C=r-S,E=x*v*S-b*(w*(m+x*v*h)-k*h*g),T=Math.exp(-v*y),_=r-T*(h+(m+v*h)*y),j=T*(m*(y*v-1)+y*h*v*v),A={toValue:r,prevPosition:i,lastTimestamp:t,current:x<1?C:_,velocity:x<1?E:j};return Ju[p]=A,A}var ec={};function lw({frame:e,fps:t,config:n={}}){const i=[e,t,n.damping,n.mass,n.overshootClamping,n.stiffness].join("-");if(ec[i])return ec[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=_E({animation:s,now:f,config:{...RE,...n}})}return ec[i]=s,s}var tc=new Map;function uw({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(tc.has(r))return tc.get(r);Ul(e,"to the measureSpring() function");let o=0,i=0;const s=()=>lw({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 tc.set(r,i),i}function Pd({frame:e,fps:t,config:n={},from:r=0,to:o=1,durationInFrames:i,durationRestThreshold:s,delay:a=0,reverse:l=!1}){TE(i),IE({frame:e,durationInFrames:1/0,allowFloats:!0}),Ul(t,"to spring()");const u=l||typeof i<"u",f=u?uw({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),x=i===void 0?h:h/(i/p.get());if(i&&h>i)return o;const v=lw({fps:t,frame:x,config:n}),k=n.overshootClamping?o>=r?Math.min(v.current,o):Math.max(v.current,o):v.current;return r===0&&o===1?k:si(k,[0,1],[r,o])}var oh=e=>Math.min(1,Math.max(0,e)),Ei=30;class vl{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 vl.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=oh(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:Pd(t?{fps:Ei,frame:i*uw({fps:Ei,config:r,threshold:n}),config:r}:{fps:Ei,frame:i*Ei,config:r,durationInFrames:Ei,durationRestThreshold:n}),{remotionShouldExtendRight:t})}static bounce(t){const n=oh(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 nw(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+",aa=rn+"%";function la(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var ua="(?:none|[-+]?\\d*\\.?\\d+(?:%|deg|rad|grad|turn)?)";function Ci(e){return new RegExp(e+"\\(\\s*("+ua+")\\s+("+ua+")\\s+("+ua+")(?:\\s*\\/\\s*("+ua+"))?\\s*\\)")}function PE(){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"+la(rn,rn,rn)),e.rgba=new RegExp("rgba"+la(rn,rn,rn,rn)),e.hsl=new RegExp("hsl"+la(rn,aa,aa)),e.hsla=new RegExp("hsla"+la(rn,aa,aa,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=Ci("oklch"),e.oklab=Ci("oklab"),e.lab=Ci("lab"),e.lch=Ci("lch"),e.hwb=Ci("hwb")),e}function Do(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 ih(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=Do(o,r,e+1/3),s=Do(o,r,e),a=Do(o,r,e-1/3);return Math.round(i*255)<<24|Math.round(s*255)<<16|Math.round(a*255)<<8}function co(e){const t=Number.parseInt(e,10);return t<0?0:t>255?255:t}function sh(e){return(Number.parseFloat(e)%360+360)%360/360}function ah(e){const t=Number.parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function ca(e){const t=Number.parseFloat(e);return t<0?0:t>100?1:t/100}function Ut(e,t){return e==="none"?0:e.endsWith("%")?Number.parseFloat(e)/100*t:Number.parseFloat(e)}function nc(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 Ii(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 Oo(e){return e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055}function da(e){return Math.max(0,Math.min(1,e))}function Ti(e,t,n,r){const o=Math.round(da(e)*255),i=Math.round(da(t)*255),s=Math.round(da(n)*255),a=Math.round(da(r)*255);return(o<<24|i<<16|s<<8|a)>>>0}function lh(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[Oo(u),Oo(f),Oo(p)]}function uh(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,x=e>o*r?((e+16)/116)**3:e/o,v=m>r?m:(116*f-16)/o,k=h*i,y=x*s,g=v*a,w=3.2404542*k-1.5371385*y-.4985314*g,b=-.969266*k+1.8760108*y+.041556*g,S=.0556434*k-.2040259*y+1.0572252*g;return[Oo(w),Oo(b),Oo(S)]}function jE(e,t,n){if(t+n>=1){const u=t/(t+n);return[u,u,u]}const r=1,o=0,i=Do(o,r,e+1/3),s=Do(o,r,e),a=Do(o,r,e-1/3),l=1-t-n;return[i*l+t,s*l+t,a*l+t]}var ch={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 FE(e){const t=PE();let n;if(t.hex6&&(n=t.hex6.exec(e)))return Number.parseInt(n[1]+"ff",16)>>>0;if(ch[e]!==void 0)return ch[e];if(t.rgb&&(n=t.rgb.exec(e)))return(co(n[1])<<24|co(n[2])<<16|co(n[3])<<8|255)>>>0;if(t.rgba&&(n=t.rgba.exec(e)))return(co(n[1])<<24|co(n[2])<<16|co(n[3])<<8|ah(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(ih(sh(n[1]),ca(n[2]),ca(n[3]))|255)>>>0;if(t.hsla&&(n=t.hsla.exec(e)))return(ih(sh(n[1]),ca(n[2]),ca(n[3]))|ah(n[4]))>>>0;if(t.oklch&&(n=t.oklch.exec(e))){const r=Ut(n[1],1),o=Ut(n[2],.4),i=nc(n[3]),s=Ii(n[4]),a=i*Math.PI/180,[l,u,f]=lh(r,o*Math.cos(a),o*Math.sin(a));return Ti(l,u,f,s)}if(t.oklab&&(n=t.oklab.exec(e))){const r=Ut(n[1],1),o=Ut(n[2],.4),i=Ut(n[3],.4),s=Ii(n[4]),[a,l,u]=lh(r,o,i);return Ti(a,l,u,s)}if(t.lab&&(n=t.lab.exec(e))){const r=Ut(n[1],100),o=Ut(n[2],125),i=Ut(n[3],125),s=Ii(n[4]),[a,l,u]=uh(r,o,i);return Ti(a,l,u,s)}if(t.lch&&(n=t.lch.exec(e))){const r=Ut(n[1],100),o=Ut(n[2],150),i=nc(n[3]),s=Ii(n[4]),a=i*Math.PI/180,[l,u,f]=uh(r,o*Math.cos(a),o*Math.sin(a));return Ti(l,u,f,s)}if(t.hwb&&(n=t.hwb.exec(e))){const r=nc(n[1]),o=Ut(n[2],1),i=Ut(n[3],1),s=Ii(n[4]),[a,l,u]=jE(r/360,o,i);return Ti(a,l,u,s)}throw new Error(`invalid color string ${e} provided`)}var dh=e=>(e>>24&255)/255,$E=e=>e>>16&255,ME=e=>e>>8&255,AE=e=>e&255,NE=(e,t,n,r)=>`rgba(${e}, ${t}, ${n}, ${r})`;function LE(e){const t=FE(e);return(t<<24|t>>>8)>>>0}var zE=(e,t,n,r)=>{const[o,i,s,a]=[$E,ME,AE,dh].map(l=>{const u=si(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===dh?Number(u.toFixed(3)):Math.round(u)});return NE(o,i,s,a)},DE=(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=>LE(i));return zE(e,t,o,r)},fh=({easing:e,forceSpringAllowTail:t})=>{switch(e.type){case"linear":return vl.linear;case"spring":return vl.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 nw(e.x1,e.y1,e.x2,e.y2);default:throw new TypeError(`Unsupported easing: ${JSON.stringify(e)}`)}},Ps=({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 DE(e,l,u,{easing:o.map(f=>fh({easing:f,forceSpringAllowTail:t})),posterize:n.posterize})}catch{return null}}if(s!=="interpolate")return null;try{return si(e,l,u,{easing:o.map(f=>fh({easing:f,forceSpringAllowTail:t})),extrapolateLeft:i.left,extrapolateRight:i.right,output:n.output,posterize:n.posterize})}catch{return null}},nu=({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=Ps({forceSpringAllowTail:null,frame:t,status:e.status});return n===null?{type:"none"}:{type:"resolved",value:n}},cw=({propStatus:e,dragOverrideValue:t,defaultValue:n,frame:r=null,shouldResortToDefaultValueIfUndefined:o=!1})=>{const i=nu({dragOverrideValue:t,frame:r});return i.type==="resolved"&&i.value!==void 0?i.value:e.status==="keyframed"?r!==null?Ps({forceSpringAllowTail:null,frame:r,status:e}):o?n:void 0:e.codeValue===void 0&&o?n:e.codeValue},np=d.createContext({overrideIdToNodePathMappings:{}}),OE=d.createContext({setOverrideIdToNodePath:()=>{throw new Error("OverrideIdsToNodePathsSettersContext not initialized")}}),BE=({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=nu({dragOverrideValue:s,frame:r});a.type==="resolved"&&(o[i]=a.value)}return{params:o,effectKey:e.definition.calculateKey(o)}},VE=(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=Ps({forceSpringAllowTail:null,frame:t,status:i});s!==null&&(n[o]=s,r=!0)}}return r?n:null},js=e=>{const t=d.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)},dw=({propStatuses:e,nodePath:t,effectIndex:n})=>{const r=e[Mn(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"}},fw=(e,t)=>{const n=e[Mn(t)];if(n&&n.canUpdate)return n.props},Fs=({effects:e,overrideId:t})=>{const n=d.useRef(null),{propStatuses:r}=d.useContext(Ql),{getEffectDragOverrides:o}=d.useContext(eu),i=ct(),{overrideIdToNodePathMappings:s}=d.useContext(np),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 x=dw({propStatuses:r,nodePath:l,effectIndex:h}),v=x.type==="can-update-effect"?VE(x.props,i):null,k=o(l,h),y=Object.keys(k).length===0?null:k,{params:g,effectKey:w}=BE({descriptor:m,propStatusOverrides:v,dragOverrides:y,frame:i});return{descriptor:m,params:g,effectKey:w}});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:x})=>({definition:m.definition,effectKey:x,params:h,memoized:!0}));return n.current=p,p},rp=(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,rp(s,t))}else n[r]=o}return n},op=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=op(i);for(const a of Object.keys(s))n(a,s[a])}}return t},pw=({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]},ph={type:"linear"},WE=({insertedKeyframeIndex:e,easingLength:t,keyframeCount:n})=>!(e>0&&e<n-1)||t===0?null:Math.min(e-1,t-1),HE=e=>({type:"static",value:e}),UE=({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=WE({insertedKeyframeIndex:s,easingLength:i.length,keyframeCount:o.length}),l=a===null?ph:i[a];i.splice(s,0,l)}for(;i.length<o.length-1;)i.push(ph);return i.length>o.length-1&&(i.length=o.length-1),{type:"keyframed",status:{...e,keyframes:o,easing:i}}},ZE=e=>{if((e==null?void 0:e.type)==="static")return e.value},YE=e=>e!==null&&e.status==="keyframed",mw=(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=mw(r,t);if(o)return o}},hw=({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=mw(e,l);if((f==null?void 0:f.type)==="hidden")continue;let p;if(u===null)p=t[l];else if(YE(u))if((f==null?void 0:f.type)==="array"||(f==null?void 0:f.keyframable)===!1)p=t[l];else{const m=nu({dragOverrideValue:n[l],frame:o});m.type==="resolved"?p=m.value:o!==null?p=Ps({forceSpringAllowTail:null,frame:o,status:u})??t[l]:p=t[l]}else u.status==="computed"?p=t[l]:p=cw({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(ps)&&(p=`${window.remotion_staticBase}/${p.slice(ps.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=pw({schema:e,key:l,value:i[l]});for(const f of u)s.add(f)}return{merged:i,propsToDelete:s}},gw=(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},vw=({flatSchema:e,key:t,props:n})=>{var o;const r=gw(n,t);if(!(((o=e[t])==null?void 0:o.type)==="text-content"&&typeof r!="string"))return r},KE=(e,t,n)=>{const r={};for(const o of t)r[o]=n?vw({flatSchema:n,key:o,props:e}):gw(e,o);return r},GE=(e,t)=>Object.keys(rp(e,n=>t[n])),XE=({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 Qk(i,s),i},mh={},Zn=({Component:e,componentName:t,componentIdentity:n,schema:r,supportsEffects:o})=>{const i=Hk(r),s=op(i),a=Object.keys(s),l=d.forwardRef((u,f)=>{const p=Ye();if(!p.isStudio||p.isReadOnlyStudio||p.isRendering)return te.createElement(e,{...u,controls:null,ref:f});const{propStatuses:m}=d.useContext(Ql),{getDragOverrides:h}=d.useContext(eu),x=d.useContext(np),v=ct();if(u.controls)return te.createElement(e,{...u,ref:f});const[k]=d.useState(()=>{const{stack:_}=u;if(!_)return String(Math.random());const j=mh[_];if(j)return j;const A=String(Math.random());return mh[_]=A,A}),y=x.overrideIdToNodePathMappings[k]??null,g=a.map(_=>vw({flatSchema:s,key:_,props:u})),w=d.useMemo(()=>KE(u,a,s),g),b=d.useMemo(()=>({schema:i,currentRuntimeValueDotNotation:w,overrideId:k,supportsEffects:o,componentIdentity:n,componentName:t}),[w,k]),{merged:S,propsToDelete:C}=d.useMemo(()=>hw({schema:i,currentValue:w,overrideValues:y===null?{}:h(y),propStatus:y===null?void 0:fw(m,y),frame:v}),[w,h,y,m,v]),E=GE(i,S),T=XE({flatSchema:s,props:u,valuesDotNotation:S,schemaKeys:E,propsToDelete:C});return te.createElement(e,{...T,controls:b,ref:f})});return l.displayName=`withInteractivitySchema(${e.displayName||e.name||"Component"})`,l},rc=[],qE=({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:x,_remotionInternalSingleChildComponent:v,_remotionInternalPremountDisplay:k,_remotionInternalPostmountDisplay:y,_remotionInternalIsMedia:g,outlineRef:w,...b},S)=>{const{layout:C="absolute-fill"}=b,[E]=d.useState(()=>String(Math.random())),T=d.useContext(et),{rootId:_}=Ir(),j=T?T.cumulatedFrom+T.relativeFrom:0,A=Wl();if(C!=="absolute-fill"&&C!=="none")throw new TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${C}`);if(C==="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 z=Tr(),$=Xe(),M=e-t,W=((T==null?void 0:T.absoluteFrom)??0)+M,D=T?Math.min(T.durationInFrames-M,r):r,R=Math.max(0,Math.min($.durationInFrames-e,D)),{registerSequence:I,unregisterSequence:P}=d.useContext(ii),F=d.useRef(null),O=b.layout==="none"?w??null:w??F,H=d.useMemo(()=>(T==null?void 0:T.premounting)||!!b._remotionInternalIsPremounting,[b._remotionInternalIsPremounting,T==null?void 0:T.premounting]),K=d.useMemo(()=>(T==null?void 0:T.postmounting)||!!b._remotionInternalIsPostmounting,[b._remotionInternalIsPostmounting,T==null?void 0:T.postmounting]),N=j+M,L=T?T.cumulatedFrom+T.relativeFrom:0,X=T?L-T.cumulatedNegativeFrom:0,Y=Math.max(0,X,N),V=N-Y,U=d.useMemo(()=>({absoluteFrom:W,cumulatedFrom:j,relativeFrom:M,cumulatedNegativeFrom:V,durationInFrames:R,parentFrom:(T==null?void 0:T.relativeFrom)??0,id:E,height:s??(T==null?void 0:T.height)??null,width:a??(T==null?void 0:T.width)??null,premounting:H,postmounting:K,premountDisplay:k??null,postmountDisplay:y??null}),[j,W,M,R,T,E,s,a,H,K,k,y,V]),ie=d.useMemo(()=>i??"",[i]),ce=x??"https://www.remotion.dev/docs/sequence",ae=Ye(),oe=d.useContext(tu),J=(b==null?void 0:b.stack)??null,ee=d.useRef(null);ee.current=h??J;const Q=typeof n=="number"?n:null,ue=t===0?null:t,Ee=(T==null?void 0:T.cumulatedNegativeFrom)??0,je=g&&g.type!=="image"?g.data.startMediaFrom+Ee-V:null,Ce=g&&g.type!=="image"?g.data.startMediaFrom+Ee:null,xe=g&&g.type!=="image"&&Ce!==null?Q===null?null:Ce+(m?Q%m.durationInFrames:Q)*g.data.playbackRate:null;d.useEffect(()=>{if(ae.isStudio)return g?(g.type==="image"?I({type:"image",controls:f??null,effects:p??rc,displayName:ie,documentationLink:ce,duration:R,from:e,trimBefore:ue,id:E,loopDisplay:m,nonce:A.get(),parent:(T==null?void 0:T.id)??null,postmountDisplay:y??null,premountDisplay:k??null,rootId:_,showInTimeline:l,src:g.src,getStack:()=>ee.current,refForOutline:O??null,isInsideSeries:oe,frozenFrame:Q,singleChildComponent:v??null}):I({type:g.type,controls:f??null,effects:p??rc,displayName:ie,documentationLink:ce,doesVolumeChange:g.data.doesVolumeChange,duration:R,from:e,trimBefore:ue,id:E,loopDisplay:m,nonce:A.get(),parent:(T==null?void 0:T.id)??null,playbackRate:g.data.playbackRate,postmountDisplay:y??null,premountDisplay:k??null,rootId:_,showInTimeline:l,src:g.data.src,getStack:()=>ee.current,startMediaFrom:je??g.data.startMediaFrom,mediaFrameAtSequenceZero:Ce,volume:g.data.volumes,refForOutline:O??null,isInsideSeries:oe,frozenFrame:Q,frozenMediaFrame:xe,singleChildComponent:v??null}),()=>{P(E)}):(I({from:e,trimBefore:ue,duration:R,id:E,displayName:ie,documentationLink:ce,parent:(T==null?void 0:T.id)??null,type:"sequence",rootId:_,showInTimeline:l,nonce:A.get(),loopDisplay:m,getStack:()=>ee.current,premountDisplay:k??null,postmountDisplay:y??null,controls:f??null,effects:p??rc,refForOutline:O??null,isInsideSeries:oe,frozenFrame:Q,singleChildComponent:v??null}),()=>{P(E)})},[r,E,i,I,ie,P,T==null?void 0:T.id,R,_,e,t,ue,l,A,m,k,y,ae.isStudio,f,p,g,ce,O,oe,Q,je,Ce,xe,v]);const me=Math.ceil(j+e+r-1),be=z<j+e||z>me?null:o,Re=be===null||typeof n>"u"||n===null?be:c.jsx(Ts,{frame:n,children:be}),ve=b.layout==="none"?void 0:b.style,_e=d.useCallback(en=>{F.current=en,typeof S=="function"?S(en):S&&(S.current=en)},[S]),it=d.useMemo(()=>({flexDirection:void 0,...a?{width:a}:{},...s?{height:s}:{},...ve??{}}),[s,ve,a]);if(S!==null&&C==="none")throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');return u?null:c.jsx(et.Provider,{value:U,children:Re===null?null:b.layout==="none"?Re:c.jsx(pn,{ref:_e,style:it,className:b.className,children:Re})})},QE=d.forwardRef(qE),JE=(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:x}=_s({from:r,durationInFrames:o,premountFor:i,postmountFor:s,style:n??null,styleWhilePremounted:a??null,styleWhilePostmounted:l??null,hideWhilePremounted:"opacity"});return c.jsx(Ts,{frame:f,active:p,children:c.jsx(ru,{ref:t,from:r,durationInFrames:o,style:x??void 0,_remotionInternalPremountDisplay:i,_remotionInternalPostmountDisplay:s,_remotionInternalIsPremounting:h,_remotionInternalIsPostmounting:m,...u})})},eC=d.forwardRef(JE),tC=(e,t)=>{const n=Ye(),{fps:r}=Xe();if(e.layout!=="none"&&!n.isRendering){const o=e.premountFor;if(o||e.postmountFor)return c.jsx(eC,{ref:t,...e,premountFor:o})}return c.jsx(QE,{...e,ref:t})},ru=d.forwardRef(tC),yw=ru,dt=Zn({Component:ru,componentName:"<Sequence>",componentIdentity:"dev.remotion.remotion.Sequence",schema:Go,supportsEffects:!1});Zn({Component:ru,componentName:"<Sequence>",componentIdentity:null,schema:Zk,supportsEffects:!1});var ww=(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)}},nC="https://remotion.dev/docs/troubleshooting/webgl2-context",xw=(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 ${nC}`,rC=e=>new Error(xw("WebGL",e)),bw=e=>new Error(xw("WebGL2",e));class oC{constructor(t,n){Se(this,"width");Se(this,"height");Se(this,"pairs",new Map);Se(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 bw("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 iC=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},fa=null,sC=()=>fa||(fa=(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()})(),fa),Sw=(e,t)=>({pool:new oC(e,t),setupCache:new WeakMap,cleanupRegistry:[],currentRunId:0}),jd=e=>{e.currentRunId++;for(const t of e.cleanupRegistry)t.definition.cleanup(t.state)},aC=(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},$s=async({state:e,source:t,effects:n,output:r,width:o,height:i})=>{const s=++e.currentRunId,a=()=>e.currentRunId!==s,l=n.filter(k=>!k.params.disabled),u=iC(l);let f=t,p=null;if(u.length===0){if(t===r)return!0;const k=r.getContext("2d");if(!k)throw new Error("Failed to acquire 2D context for output canvas");return k.clearRect(0,0,o,i),k.drawImage(f,0,0,o,i),!0}let m=!1;for(const k of u)if(k.backend==="webgpu"){m=!0;break}const h=m?await sC():null;if(a())return!1;let x=!0;for(let k=0;k<u.length;k++){const y=u[k],[g,w]=e.pool.getPair(y.backend);let b=g;for(const C of y.effects){const E=C.definition,T=aC(e,E,b);E.apply({source:f,target:b,state:T,params:C.params,width:o,height:i,gpuDevice:h,flipSourceY:y.backend==="webgl2"?x:!1}),y.backend==="webgl2"&&(x=!0,e.pool.assertContextNotLost(b)),f=b,b=b===g?w:g}p=f??p;const S=u[k+1];if(S&&S.backend!==y.backend&&p)if(y.backend==="2d"&&S.backend==="webgl2")f=p,x=!0;else{const C=await createImageBitmap(p);if(a())return C.close(),!1;f=C,S.backend==="webgl2"&&(x=!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},Ms=()=>{const e=d.useRef(null),t=d.useRef(null);return d.useEffect(()=>()=>{e.current&&jd(e.current)},[]),d.useMemo(()=>({get:(n,r)=>((!t.current||t.current.width!==n||t.current.height!==r)&&(e.current&&jd(e.current),e.current=Sw(n,r),t.current={width:n,height:r}),e.current)}),[])},lC=({width:e,height:t,fit:n,className:r,style:o,effects:i,...s},a)=>{const l=d.useRef(null),u=Ms(),f=d.useMemo(()=>typeof document>"u"?null:document.createElement("canvas"),[]),p=d.useCallback(m=>{const h=l.current,x=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=x,f.height=v;const k=f.getContext("2d");if(!k)throw new Error("Could not get 2d context for source canvas");return k.drawImage(m,...ww(n,{height:m.displayHeight,width:m.displayWidth},{width:x,height:v})),h.width=x,h.height=v,$s({state:u.get(x,v),source:f,effects:i,output:h,width:x,height:v})},[u,i,n,t,f,e]);return d.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]),c.jsx("canvas",{ref:l,className:r,style:o,...s})},uC=te.forwardRef(lC),kw=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}},cC=5,hh=({loopBehavior:e,durationFound:t,timeInSec:n})=>e==="loop"?t?n%t:n:Math.min(n,t||1/0),dC=async({resolvedSrc:e,signal:t,requestInit:n,currentTime:r,initialLoopBehavior:o})=>{const{decoder:i,selectedTrack:s}=await kw({resolvedSrc:e,signal:t,requestInit:n,contentType:null}),a=[];let l=null;const u=async h=>{const x=a.find(k=>k.frameIndex===h);if(x&&x.frame)return x;const v=await i.decode({frameIndex:h,completeFramesOnly:!0});return x?x.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(k=>k.frame).sort((k,y)=>{const g=Math.abs(k.timeInSeconds-h),w=Math.abs(y.timeInSeconds-h);return g-w});for(let k=0;k<v.length;k++){if(k<cC)continue;const y=v[k];y.frame=null}},p=async({timeInSec:h,loopBehavior:x})=>{const v=hh({durationFound:l,loopBehavior:x,timeInSec:h}),y=a.filter(w=>w.timeInSeconds<=v).map(w=>w.frameIndex).reduce((w,b)=>Math.max(w,b),0);let g=y;for(;;){const w=await u(g);if(g++,!w.frame)throw new Error("No frame found");if(!w.frame.duration||(g===s.frameCount&&l===null&&(l=(w.frame.timestamp+w.frame.duration)/1e6),w.timeInSeconds>v||g===s.frameCount))break}s.frameCount-y<3&&x==="loop"&&await u(0),f(v)};return await p({timeInSec:r,loopBehavior:o}),await p({timeInSec:r,loopBehavior:o}),{close:()=>{var h;for(const x of a)(h=x.frame)==null||h.close(),x.frame=null;i.close()},getFrame:async(h,x)=>{if(l!==null&&h>l&&x==="clear-after-finish")return null;const v=hh({loopBehavior:x,durationFound:l,timeInSec:h});await p({timeInSec:v,loopBehavior:x});const y=a.filter(g=>g.frame).reduce((g,w)=>{const b=Math.abs(g.timeInSeconds-v),S=Math.abs(w.timeInSeconds-v);return b<S?g:w});if(!y.frame)throw new Error("No frame found");return y},frameCount:s.frameCount}},fC=({frame:e,playbackRate:t,fps:n})=>e*t/n,pC=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})},mC=e=>typeof window>"u"?e:new URL(e,window.origin).href,hC={src:{type:"asset",default:void 0,description:"Source",keyframable:!1},...Un,...oi,playbackRate:{type:"number",min:0,max:10,step:.1,default:1,description:"Playback rate",hiddenFromList:!1,keyframable:!1},...In,..._r,...Rr},gC=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},Ew=d.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=mC(e),[h,x]=d.useState(null),{delayRender:v,continueRender:k}=mn(),[y]=d.useState(()=>v(`Rendering <AnimatedImage/> with src="${m}"`)),g=ct(),{fps:w}=Xe(),b=fC({frame:g,playbackRate:i,fps:w}),S=d.useRef(b);S.current=b;const C=pC(a),E=d.useRef(a);E.current=a;const T=d.useRef(null),_=Fs({effects:l,overrideId:(u==null?void 0:u.overrideId)??null});d.useImperativeHandle(p,()=>{var z;const A=(z=T.current)==null?void 0:z.getCanvas();if(!A)throw new Error("Canvas ref is not set");return A},[]);const[j]=d.useState(()=>o);return d.useEffect(()=>{const A=new AbortController;let z=!1,$=!1;const M=()=>{$||($=!0,k(y))};return dC({resolvedSrc:m,signal:A.signal,requestInit:E.current,currentTime:S.current,initialLoopBehavior:j}).then(W=>{if(z){W.close();return}x(W),M()}).catch(W=>{if(!z){if(W.name==="AbortError"){M();return}r?(r==null||r(W),M()):ms(W)}}),()=>{z=!0,A.abort(),M()}},[m,y,r,C,j,k]),d.useEffect(()=>()=>{h==null||h.close()},[h]),d.useLayoutEffect(()=>{if(!h)return;const A=v(`Rendering frame at ${b} of <AnimatedImage src="${e}"/>`);let z=!1;return h.getFrame(b,o).then(async $=>{var W,D;if(z)return;if($===null){(W=T.current)==null||W.clear(),k(A);return}await((D=T.current)==null?void 0:D.draw($.frame))&&!z&&k(A)}).catch($=>{z||(r?(r($),k(A)):ms($))}),()=>{z=!0,k(A)}},[b,h,o,r,e,k,v,_,s,t,n]),c.jsx(uC,{ref:T,width:t,height:n,fit:s,effects:_,...f})});Ew.displayName="AnimatedImageContent";var vC=({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:x,styleWhilePostmounted:v,requestInit:k,effects:y=[],controls:g,ref:w,...b})=>{const S=d.useRef(null),C=js(y);d.useImperativeHandle(w,()=>S.current,[]);const{effectivePostmountFor:E,effectivePremountFor:T,freezeFrame:_,isPremountingOrPostmounting:j,postmountingActive:A,premountingActive:z,premountingStyle:$}=_s({from:p??0,durationInFrames:f??1/0,premountFor:m??null,postmountFor:h??null,style:u??null,styleWhilePremounted:x??null,styleWhilePostmounted:v??null,hideWhilePremounted:"display-none"}),M=gC(b),W={src:e,width:t,height:n,onError:r,fit:o,playbackRate:i,loopBehavior:s,id:a,className:l,style:$??void 0,requestInit:k,...M};return c.jsx(Ts,{frame:_,active:j,children:c.jsx(dt,{layout:"none",from:p??0,durationInFrames:f??1/0,name:"<AnimatedImage>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/animatedimage",controls:g,_remotionInternalEffects:C,_remotionInternalPremountDisplay:T||null,_remotionInternalPostmountDisplay:E||null,_remotionInternalIsPremounting:z,_remotionInternalIsPostmounting:A,...b,outlineRef:S,children:c.jsx(Ew,{...W,ref:S,effects:y,controls:g})})})},Cw=Zn({Component:vC,componentName:"<AnimatedImage>",componentIdentity:"dev.remotion.remotion.AnimatedImage",schema:hC,supportsEffects:!0});Cw.displayName="AnimatedImage";Ct(Cw);var yC={type:"boolean",default:!1,description:"Disabled"},wC=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:yC,...e.schema}};return(i={})=>(n(i),{definition:r,params:i,effectKey:r.calculateKey(i),memoized:!1})},xC=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.')},bC=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")},Iw=e=>{e.type==="artifact"&&(xC(e.filename),e.contentType!=="thumbnail"&&bC(e.content))},no=d.createContext({registerRenderAsset:()=>{},unregisterRenderAsset:()=>{},renderAssets:[]}),SC=({children:e,collectAssets:t})=>{const[n,r]=d.useState([]),o=d.useRef([]),i=d.useCallback(l=>{Iw(l),o.current=[...o.current,l],r(o.current)},[]);t&&d.useImperativeHandle(t,()=>({collectAssets:()=>{const l=o.current;return o.current=[],r([]),l}}),[]);const s=d.useCallback(l=>{o.current=o.current.filter(u=>u.id!==l),r(o.current)},[]);d.useLayoutEffect(()=>{typeof window<"u"&&(window.remotion_collectAssets=()=>{const l=o.current;return o.current=[],r([]),l})},[]);const a=d.useMemo(()=>({registerRenderAsset:i,unregisterRenderAsset:s,renderAssets:n}),[n,i,s]);return c.jsx(no.Provider,{value:a,children:e})},En=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,ou=({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))},Tw=d.createContext(null),kC=()=>te.useContext(Tw),iu=({durationInFrames:e,times:t=1/0,children:n,name:r,showInTimeline:o,...i})=>{const s=ct(),{durationInFrames:a}=Xe();if(Hl(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,x=Math.min(h,p),v=d.useMemo(()=>({numberOfTimes:Math.min(a/e,t),startOffset:-x,durationInFrames:e}),[a,e,x,t]),k=d.useMemo(()=>({iteration:Math.floor(s/e),durationInFrames:e}),[s,e]);return c.jsx(Tw.Provider,{value:k,children:c.jsx(dt,{durationInFrames:e,from:x,name:r??"<Loop>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/loop",_remotionInternalLoopDisplay:v,layout:i.layout,style:f,showInTimeline:o,children:n})})};iu.useLoop=kC;var vt=({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)},su=d.createContext({}),gh={},oc=[],Rw=({children:e})=>{const[t,n]=d.useState(()=>gh);return d.useEffect(()=>{const r=()=>{n(gh)};return oc.push(r),()=>{oc=oc.filter(o=>o!==r)}},[]),c.jsx(su.Provider,{value:t,children:e})},_w=e=>{const t=e.indexOf("#");return t===-1?null:t},EC=e=>{const t=_w(e);return t===null?e:e.slice(0,t)},ro=e=>{const t=d.useContext(su),n=_w(e),r=EC(e);return t[r]?n!==null?t[r]+e.slice(n):t[r]:e},au=(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`)},CC=(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.")},IC=(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.")},lu=({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"?IC(n,r):(typeof e<"u"||typeof t<"u")&&CC(e,t)},uu=({startFrom:e,endAt:t,trimBefore:n,trimAfter:r})=>({trimBeforeValue:n??e??void 0,trimAfterValue:r??t??void 0}),TC=(e,t)=>{switch(t.type){case"got-duration":{const n=En(t.src);return e[n]===t.durationInSeconds?e:{...e,[n]:t.durationInSeconds}}default:return e}},ip=d.createContext({durations:{},setDurations:()=>{throw new Error("context missing")}}),Pw=({children:e})=>{const[t,n]=d.useReducer(TC,{}),r=d.useMemo(()=>({durations:t,setDurations:n}),[t]);return c.jsx(ip.Provider,{value:r,children:e})},sp=({crossOrigin:e,requestsVideoFrame:t,isClientSideRendering:n})=>{if(e!=null)return e;if(n||t)return"anonymous"},yl=({mediaRef:e,mediaType:t,onAutoPlayError:n,logLevel:r,mountTime:o,reason:i,isPlayer:s})=>{const{current:a}=e;if(!a)return;vt({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())}})},ap=({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}}},vh=!1,RC=e=>{vh||(vh=!0,typeof window<"u"&&rt.warn({logLevel:e,tag:null},"AudioContext is not supported in this browser"))},_C=({logLevel:e,latencyHint:t,audioEnabled:n,sampleRate:r})=>{const o=Ye(),i=d.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 d.useMemo(()=>{if(o.isRendering||!n)return null;if(typeof AudioContext>"u")return RC(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])},PC=(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)}),ic="data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",jC=(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},FC=(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,ai=d.createContext(null),cu=d.createContext(null),$C=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}`)},jw=({children:e,audioLatencyHint:t,audioEnabled:n,previewSampleRate:r})=>{const o=Cn(),i=r??48e3;d.useEffect(()=>{typeof window>"u"||(window.remotion_sampleRate=i)},[i]);const s=_C({logLevel:o,latencyHint:t,audioEnabled:n,sampleRate:i}),a=d.useRef(!1),l=d.useRef(null),u=d.useMemo(()=>({value:0}),[]),f=d.useRef([]),p=d.useMemo(()=>({dispatch:b=>{f.current.forEach(S=>S(b))},subscribe:b=>(f.current.push(b),{remove:()=>{f.current=f.current.filter(S=>S!==b)}})}),[]),m=d.useRef({scheduledEndTime:null,mediaEndTime:null}),h=d.useRef(new Map),x=d.useCallback(b=>{h.current.delete(b)},[]),v=d.useMemo(()=>({node:b,mediaTimestamp:S,sourceOffset:C,scheduledTime:E,duration:T,offset:_,originalUnloopedMediaTimestamp:j})=>{if(!s)throw new Error("Audio context not found");const A=s.getState();if(A==="closed")return{type:"not-started",reason:"audio context is closed"};const z=$C(A);T>0&&(z?h.current.set(b,{scheduledTime:E,offset:_,duration:T}):b.start(E,_,T));const $=E+T/b.playbackRate.value,M=S+_-C,W=M+T,D=s.audioContext.baseLatency+s.audioContext.outputLatency,R=E-s.audioContext.currentTime,I=m.current,P=I.scheduledEndTime!==null&&Math.abs(E-I.scheduledEndTime)>.001,F=I.mediaEndTime!==null&&Math.abs(M-I.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",P?"color: red; font-weight: bold":"",E.toFixed(4),"",$.toFixed(4),F?"color: red; font-weight: bold":"",M.toFixed(4),"",W.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,j!==M?"original_ts="+j.toFixed(4):"","action="+(z?"schedule":"start"),""),I.scheduledEndTime=$,I.mediaEndTime=W,T>0?{type:"started",scheduledTime:E}:{type:"not-started",reason:"missed "+Math.abs(_).toFixed(2)+"s"}},[s,o]),k=d.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((S,C)=>{C.start(S.scheduledTime,S.offset,S.duration)}),h.current.clear();const b=s.resume();return l.current=new Promise(S=>{PC(s.audioContext,o).then(S),b.catch(C=>{rt.warn({logLevel:o,tag:"audio"},"AudioContext resume rejected, continuing without audio sync",C),S()})}).finally(()=>{l.current=null}),b.catch(()=>{})},[s,o]),y=d.useCallback(()=>l.current,[]),g=d.useCallback(()=>!s||!a.current?Promise.resolve():(a.current=!1,s.suspend()),[s]),w=d.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:k,suspend:g,getIsResumingAudioContext:y,unscheduleAudioNode:x}),[s,u,p,v,k,g,y,x]);return c.jsx(ai.Provider,{value:w,children:e})},Fw=({children:e,numberOfAudioTags:t})=>{const n=d.useRef([]),[r]=d.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=Cn(),i=Is(),s=Ye(),a=d.useContext(ai),l=(a==null?void 0:a.audioContext)??null,u=a==null?void 0:a.resume,[f]=d.useState(()=>new Array(t).fill(!0).map(()=>{const b=d.createRef();return{id:Math.random(),ref:b,mediaElementSourceNode:ap({audioContext:l,ref:b})}}));for(const{mediaElementSourceNode:b}of f)b==null||b.setAudioContext(l);(te.useInsertionEffect??te.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{f.forEach(({mediaElementSourceNode:b})=>{b==null||b.cleanup()})})},[f]);const m=d.useRef(new Array(t).fill(!1)),h=d.useCallback(()=>{f.forEach(({ref:b,id:S})=>{var T;const C=(T=n.current)==null?void 0:T.find(_=>_.id===S),{current:E}=b;if(E){if(C===void 0){E.src!==ic&&(E.src=ic);return}if(!C)throw new TypeError("Expected audio data to be there");Object.keys(C.props).forEach(_=>{FC(_,C.props[_],E[_])&&(E[_]=C.props[_])})}})},[f]),x=d.useCallback(b=>{var D,R;const{aud:S,audioId:C,premounting:E,postmounting:T}=b,_=(D=n.current)==null?void 0:D.find(I=>I.audioId===C);if(_)return _;const j=m.current.findIndex(I=>I===!1);if(j===-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:A,ref:z,mediaElementSourceNode:$}=f[j],M=[...m.current];M[j]=A,m.current=M;const W={props:S,id:A,el:z,audioId:C,mediaElementSourceNode:$,premounting:E,audioMounted:!!z.current,postmounting:T,cleanupOnMediaTagUnmount:()=>{}};return(R=n.current)==null||R.push(W),h(),W},[t,f,h]),v=d.useCallback(b=>{var E;const S=[...m.current],C=f.findIndex(T=>T.id===b);if(C===-1)throw new TypeError(`Unknown audio ref ${b}; refs: ${f.map(T=>T.id).join(", ")}`);S[C]=!1,m.current=S,n.current=(E=n.current)==null?void 0:E.filter(T=>T.id!==b),h()},[f,h]),k=d.useCallback(({aud:b,audioId:S,id:C,premounting:E,postmounting:T})=>{var j;let _=!1;n.current=(j=n.current)==null?void 0:j.map(A=>{const z=!!A.el.current;return A.audioMounted!==z&&(_=!0),A.id===C?jC(b,A.props)&&A.premounting===E&&A.postmounting===T?A.audioMounted===z?A:{...A,audioMounted:z}:(_=!0,{...A,props:b,premounting:E,postmounting:T,audioId:S,audioMounted:z}):A.audioMounted===z?A:{...A,audioMounted:z}}),_&&h()},[h]),y=d.useCallback(()=>{f.forEach(b=>{const S=n.current.find(C=>C.el===b.ref);S!=null&&S.premounting||yl({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]),g=d.useMemo(()=>({registerAudio:x,unregisterAudio:v,updateAudio:k,playAllAudios:y,numberOfAudioTags:t}),[t,y,x,v,k]),w=d.useMemo(()=>f.map(({id:b,ref:S})=>c.jsx("audio",{ref:S,preload:"metadata",src:ic},b)),[f]);return c.jsxs(cu.Provider,{value:g,children:[w,e]})},MC=({aud:e,audioId:t,premounting:n,postmounting:r})=>{var l;const o=d.useContext(ai),i=d.useContext(cu),[s]=d.useState(()=>{if(i&&i.numberOfAudioTags>0)return i.registerAudio({aud:e,audioId:t,premounting:n,postmounting:r});const u=te.createRef(),f=ap({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=te.useInsertionEffect??te.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},AC=1e-5,wl=(e,t)=>Math.abs(e-t)<AC,$w=(e,t)=>Math.round(e/t*100)/100,Fd=()=>typeof window>"u"||!/AppleWebKit/.test(window.navigator.userAgent)?!1:!window.navigator.userAgent.includes("Chrome/"),du=()=>typeof window>"u"?!1:/iP(ad|od|hone)/i.test(window.navigator.userAgent)&&Fd(),NC=e=>du()&&e.startsWith("blob:"),$d=({actualFrom:e,fps:t})=>$w(Math.max(0,-e),t),Md=({duration:e,fps:t})=>$w(e,t),LC=({actualSrc:e,actualFrom:t,duration:n,fps:r})=>{if(NC(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=${$d({actualFrom:t,fps:r})}`;return Number.isFinite(n)?`${i},${Md({duration:n,fps:r})}`:i},zC=({prevStartFrom:e,newStartFrom:t,prevDuration:n,newDuration:r,fps:o})=>{const i=$d({actualFrom:e,fps:o}),s=$d({actualFrom:t,fps:o}),a=Md({duration:n,fps:o}),l=Md({duration:r,fps:o});return!(s<i||l>a)},DC=({actualSrc:e,actualFrom:t,duration:n,fps:r})=>{const o=d.useRef(t),i=d.useRef(n),s=d.useRef(e);return(!zC({prevStartFrom:o.current,newStartFrom:t,prevDuration:i.current,newDuration:n,fps:r})||e!==s.current)&&(o.current=t,i.current=n,s.current=e),LC({actualSrc:s.current,actualFrom:o.current,duration:i.current,fps:r})},yh=!1,OC=e=>{yh||(yh=!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."))},Mw=({mediaRef:e,volume:t,logLevel:n,source:r,shouldUseWebAudioApi:o})=>{var m,h,x;const i=d.useRef(null),s=d.useRef(t);s.current=t;const a=d.useContext(ai);if(!a)throw new Error("useAmplification must be used within a SharedAudioContext");const{audioContext:l,gainNode:u}=a;if(typeof window<"u"&&d.useLayoutEffect(()=>{var k,y;if(!l||!e.current||!o)return;if(e.current.playbackRate!==1&&Fd()){OC(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 ${(k=e.current)==null?void 0:k.src}. Gain = ${s.current}, playbackRate = ${(y=e.current)==null?void 0:y.playbackRate}`),()=>{i.current=null,v.disconnect(),r.get().disconnect()}},[n,e,l,r,o,u]),i.current){const v=t;wl(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(Fd()&&e.current&&((h=e.current)==null?void 0:h.playbackRate)!==1||!o)&&e.current&&!wl(t,(x=e.current)==null?void 0:x.volume)&&(e.current.volume=Math.min(t,1)),i},Kr=()=>{const e=d.useContext(et);return(e==null?void 0:e.cumulatedNegativeFrom)??0},li=e=>{const t=iu.useLoop(),n=ct(),r=Kr();return e==="repeat"||t===null?n+r:n+r+t.durationInFrames*t.iteration},Aw=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]},BC=({compositionDurationInFrames:e,playbackRate:t,trimBefore:n,trimAfter:r,parentSequenceDurationInFrames:o,loop:i})=>{if(i)return e;const s=ou({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},oo=({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)},wh={},VC=e=>{wh[e]||(console.warn(e),wh[e]=!0)},Nw=({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=d.useContext(et),[m]=d.useState(()=>e),h=BC({compositionDurationInFrames:l,playbackRate:a,trimBefore:i,trimAfter:s,parentSequenceDurationInFrames:(p==null?void 0:p.durationInFrames)??null,loop:f}),x=d.useMemo(()=>typeof e=="number"?e:new Array(Math.floor(Math.max(0,h+u))).fill(!0).map((b,S)=>oo({frame:S+u,volume:e,mediaVolume:t})).join(","),[h,u,e,t]);d.useEffect(()=>{typeof e=="number"&&e!==m&&VC(`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",k=Wl(),{rootId:y}=Ir(),g=0-u+(i??0);return d.useMemo(()=>({volumes:x,duration:h,doesVolumeChange:v,nonce:k,rootId:y,finalDisplayName:o??Aw(r),startMediaFrom:g,src:r,playbackRate:a}),[x,h,v,k,y,o,r,g,a])},lp=({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 x=d.useContext(et),v=Kr(),{registerSequence:k,unregisterSequence:y}=d.useContext(ii),{durationInFrames:g}=Xe(),w=Kr(),{volumes:b,duration:S,doesVolumeChange:C,nonce:E,rootId:T,finalDisplayName:_}=Nw({volume:e,mediaVolume:t,mediaType:r,src:n,displayName:i,trimAfter:void 0,trimBefore:void 0,playbackRate:o,sequenceDurationInFrames:g,mediaStartsAt:w,loop:!1}),{isStudio:j}=Ye();d.useEffect(()=>{var A,z;if(!n)throw new Error("No src passed");if(!(!j&&((z=(A=window.process)==null?void 0:A.env)==null?void 0:z.NODE_ENV)!=="test")&&l)return k({type:r,src:n,id:s,duration:S,from:0,trimBefore:null,parent:(x==null?void 0:x.id)??null,displayName:_,documentationLink:m,rootId:T,volume:b,showInTimeline:!0,nonce:E.get(),startMediaFrom:0-v,mediaFrameAtSequenceZero:null,doesVolumeChange:C,loopDisplay:p,playbackRate:o,getStack:a,premountDisplay:u,postmountDisplay:f,controls:null,effects:[],refForOutline:h,isInsideSeries:!1,frozenFrame:null,frozenMediaFrame:null}),()=>{y(s)}},[S,s,x,n,k,y,b,C,E,r,v,o,a,l,u,f,p,m,T,_,j,h])},WC=(e,t)=>{const[n,r]=d.useState([]),[o,i]=d.useState([]),[s,a]=d.useState([]),u=Ye().isRendering,f=d.useRef(!1),p=d.useCallback(x=>{if(u)return{unblock:()=>{}};let v=!1;return r(k=>[...k,x]),{unblock:()=>{v||(v=!0,r(k=>{const y=k.filter(g=>g!==x);return y.length===k.length?k:y}))}}},[u]),m=d.useCallback(x=>(i(v=>[...v,x]),{remove:()=>{i(v=>v.filter(k=>k!==x))}}),[]),h=d.useCallback(x=>(a(v=>[...v,x]),{remove:()=>{a(v=>v.filter(k=>k!==x))}}),[]);return d.useEffect(()=>{u||n.length>0&&!f.current&&(f.current=!0,o.forEach(x=>x()),vt({logLevel:e,message:"Player is entering buffer state",mountTime:t,tag:"player"}))},[n]),typeof window<"u"&&d.useLayoutEffect(()=>{u||n.length===0&&f.current&&(f.current=!1,s.forEach(x=>x()),vt({logLevel:e,message:"Player is exiting buffer state",mountTime:t,tag:"player"}))},[n]),d.useMemo(()=>({addBlock:p,listenForBuffering:m,listenForResume:h,buffering:f}),[p,f,m,h])},ui=te.createContext(null),Lw=({children:e})=>{const{logLevel:t,mountTime:n}=d.useContext(eo),r=WC(t??"info",n);return c.jsx(ui.Provider,{value:r,children:e})},zw=e=>{const[t,n]=d.useState(e.buffering.current);return d.useEffect(()=>{const r=()=>{n(!0)},o=()=>{n(!1)},i=e.listenForBuffering(r),s=e.listenForResume(o);return()=>{i.remove(),s.remove()}},[e]),t},fu=()=>{const e=d.useContext(ui),t=Cn(),n=e?e.addBlock:null;return d.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])},HC=()=>/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent),UC=({mediaRef:e,mediaType:t,onVariableFpsVideoDetected:n,pauseWhenBuffering:r,logLevel:o,mountTime:i})=>{const s=d.useRef(!1),{delayPlayback:a}=fu(),l=d.useCallback(u=>{var x;if(t!=="video"||!r)return;const f=e.current;if(!f)return;if(f.readyState>=f.HAVE_FUTURE_DATA&&!HC()){vt({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){vt({logLevel:o,message:"Not using buffer until first frame, because requestVideoFrameCallback is not supported",mountTime:i,tag:"buffer"});return}s.current=!0,vt({logLevel:o,message:`Buffering ${(x=e.current)==null?void 0:x.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,k)=>{Math.abs(k.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 d.useMemo(()=>({isBuffering:()=>s.current,bufferUntilFirstFrame:l}),[l])},ZC=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:x,mediaTagBufferingOrStalled:v,playerBuffering:k,absoluteFrame:y,onlyWarnForMediaSeekingError:g,isPremounting:w,isPostmounting:b,pauseWhenBuffering:S}=e,C=!Number.isNaN(t)&&Number.isFinite(t)?Math.min(t,i):i,E=Math.abs(C-s),T=l?Math.abs(C-l):null,_=u&&l>a?T:E,j=T&&!f?_:E;if(j>p&&m!==C)return{type:"seek-due-to-shift",shouldBeTime:C,why:`because time shift is too big. shouldBeTime = ${C}, isTime = ${s}, requestVideoCallbackTime = ${l}, timeShift = ${j}${f?", isVariableFpsVideo = true":""}, isPremounting = ${w}, isPostmounting = ${b}, pauseWhenBuffering = ${S}`,bufferUntilFirstFrame:h&&x>0,playReason:h&&r?"player is playing but media tag is paused, and just seeked":null,warnAboutNonSeekable:!g};const A=h?.15:.01,z=Math.abs(n-C)>A;if(!h||k&&!v)return{type:"seek-if-not-playing",shouldBeTime:C,why:z?`not playing or something else is buffering. time offset is over seek threshold (${A})`:null};if(!h||k)return{type:"none"};const M=r&&!o;if(M||y===0){const D=M?"media tag is paused":"absolute frame is 0";return{type:"play-and-seek",shouldBeTime:C,why:z?`is over timeshift threshold (threshold = ${A}) and ${D}`:null,playReason:`player is playing and ${D}`,bufferUntilFirstFrame:!f&&x>0}}return{type:"none"}},YC=e=>{var r,o;const t=te.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},Ba=({mediaRef:e,time:t,logLevel:n,why:r,mountTime:o})=>{const i=du()?Number(t.toFixed(1)):t;return vt({logLevel:n,tag:"seek",message:`Seeking from ${e.currentTime} to ${i}. src= ${e.src} Reason: ${r}`,mountTime:o}),e.currentTime=i,i},KC=({element:e,shouldBuffer:t,isPremounting:n,isPostmounting:r,logLevel:o,mountTime:i,src:s})=>{const a=fu(),[l,u]=d.useState(!1);return d.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/")){vt({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 k=!1;f.forEach(y=>{y(v),k=!0}),f=[],u(y=>(y&&(k=!0),!1)),k&&vt({logLevel:o,message:`Unmarking as buffering: ${p.src}. Reason: ${v}`,tag:"buffer",mountTime:i})},h=v=>{u(!0),vt({logLevel:o,message:`Marking as buffering: ${p.src}. Reason: ${v}`,tag:"buffer",mountTime:i});const{unblock:k}=a.delayPlayback(),y=()=>{m('"canplay" was fired'),x()},g=()=>{m('"error" event was occurred'),x()};p.addEventListener("canplay",y,{once:!0}),f.push(()=>{p.removeEventListener("canplay",y)}),p.addEventListener("error",g,{once:!0}),f.push(()=>{p.removeEventListener("error",g)}),f.push(w=>{vt({logLevel:o,message:`Unblocking ${p.src} from buffer. Reason: ${w}`,tag:"buffer",mountTime:i}),k()})},x=()=>{if(p.readyState<p.HAVE_FUTURE_DATA){if(h(`readyState is ${p.readyState}, which is less than HAVE_FUTURE_DATA`),!navigator.userAgent.includes("Firefox/")){vt({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 x(),()=>{m("element was unmounted or prop changed")}},[a,s,e,n,r,o,t,i]),l},GC=({mediaRef:e,mediaType:t,lastSeek:n,onVariableFpsVideoDetected:r})=>{const o=d.useRef(null);return d.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},Dw=({frame:e,playbackRate:t,startFrom:n})=>si(e,[-1,n,n+1],[-1,n,n+t]),Ow=({fps:e,frame:t,playbackRate:n,startFrom:r})=>{const o=Dw({frame:t,playbackRate:n,startFrom:r}),i=1e3/e;return o*i/1e3},xh={},XC=(e,t)=>{if(e===null||e.seekable.length===0||e.seekable.length>1||xh[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),xh[e.src]=!0}},Bw=({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}=Xf(),m=ct(),h=Tr(),[x]=V0(),v=d.useContext(ui),{fps:k}=Xe(),y=Kr(),g=d.useRef(null),w=d.useRef(null),b=Cn(),S=Is();if(!v)throw new Error("useMediaPlayback must be used inside a <BufferingContext>");const C=d.useRef({}),E=d.useCallback(()=>{t&&(C.current[t]||(rt.verbose({logLevel:b,tag:null},`Detected ${t} as a variable FPS video. Disabling buffering while seeking.`),C.current[t]=!0))},[b,t]),T=GC({mediaRef:e,mediaType:n,lastSeek:w,onVariableFpsVideoDetected:E}),_=YC(e),j=Ow({frame:m,playbackRate:r,startFrom:-y,fps:k}),A=KC({element:e,shouldBuffer:a,isPremounting:l,isPostmounting:u,logLevel:b,mountTime:S,src:t??null}),{bufferUntilFirstFrame:z,isBuffering:$}=UC({mediaRef:e,mediaType:n,onVariableFpsVideoDetected:E,pauseWhenBuffering:a,logLevel:b,mountTime:S}),M=r*p,W=(()=>{var O;return(O=e.current)!=null&&O.duration?Math.min(e.current.duration,s??.65):s??.65})(),D=zw(v);d.useEffect(()=>{var F,O,H,K,N;if((F=e.current)!=null&&F.paused)return;if(!x){vt({logLevel:b,tag:"pause",message:`Pausing ${(O=e.current)==null?void 0:O.src} because ${l?"media is premounting":u?"media is postmounting":"Player is not playing"}`,mountTime:S}),(H=e.current)==null||H.pause();return}const I=A||$();v.buffering.current&&!I&&(vt({logLevel:b,tag:"pause",message:`Pausing ${(K=e.current)==null?void 0:K.src} because player is buffering but media tag is not`,mountTime:S}),(N=e.current)==null||N.pause())},[$,A,v,D,l,b,e,n,S,x,u]);const R=Ye();d.useLayoutEffect(()=>{const I=Math.max(0,M);e.current&&e.current.playbackRate!==I&&(e.current.playbackRate=I),e.current&&e.current.preservesPitch!==o&&(e.current.preservesPitch=o)},[e,M,o]),d.useEffect(()=>{var O,H;const I=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 ${I} element.`);const{current:P}=e,F=ZC({duration:P.duration,currentTime:P.currentTime,paused:P.paused,ended:P.ended,desiredUnclampedTime:j,mediaTagTime:_.current.time,mediaTagLastUpdate:_.current.lastUpdate,rvcTime:((O=T.current)==null?void 0:O.time)??null,rvcLastUpdate:((H=T.current)==null?void 0:H.lastUpdate)??null,isVariableFpsVideo:!!C.current[t],acceptableTimeShift:W,lastSeekDueToShift:g.current,playing:x,playbackRate:M,mediaTagBufferingOrStalled:A||$(),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"){w.current=Ba({mediaRef:P,time:F.shouldBeTime,logLevel:b,why:F.why,mountTime:S}),g.current=w.current,F.bufferUntilFirstFrame&&z(F.shouldBeTime),F.playReason!==null&&yl({mediaRef:e,mediaType:n,onAutoPlayError:f,logLevel:b,mountTime:S,reason:F.playReason,isPlayer:R.isPlayer}),F.warnAboutNonSeekable&&XC(P);return}if(F.type==="seek-if-not-playing"){F.why!==null&&(w.current=Ba({mediaRef:P,time:F.shouldBeTime,logLevel:b,why:F.why,mountTime:S}));return}F.why!==null&&(w.current=Ba({mediaRef:P,time:F.shouldBeTime,logLevel:b,why:F.why,mountTime:S})),yl({mediaRef:e,mediaType:n,onAutoPlayError:f,logLevel:b,mountTime:S,reason:F.playReason,isPlayer:R.isPlayer}),F.bufferUntilFirstFrame&&z(F.shouldBeTime)}},[h,W,z,v.buffering,T,b,j,$,A,e,n,i,M,x,t,f,l,u,a,S,_,R.isPlayer])},Vw=({mediaRef:e,id:t,mediaType:n,onAutoPlayError:r,isPremounting:o,isPostmounting:i})=>{const{audioAndVideoTags:s,imperativePlaying:a}=Ir(),l=Cn(),u=Is(),f=Ye();d.useEffect(()=>{const p={id:t,play:m=>{if(a.current&&!(o||i))return yl({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])},up=d.createContext({playerMuted:!1,mediaVolume:1}),cp=d.createContext({setPlayerMuted:()=>{throw new Error("default")},setMediaVolume:()=>{throw new Error("default")}}),dp=()=>{const{mediaVolume:e}=d.useContext(up),{setMediaVolume:t}=d.useContext(cp);return d.useMemo(()=>[e,t],[e,t])},fp=()=>{const{playerMuted:e}=d.useContext(up),{setPlayerMuted:t}=d.useContext(cp);return d.useMemo(()=>[e,t],[e,t])},ci=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.`)},qC=(e,t)=>{const[n]=d.useState(e.shouldPreMountAudioTags);if(e.shouldPreMountAudioTags!==n)throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");const r=Cn(),{volume:o,muted:i,playbackRate:s,preservePitch:a,shouldPreMountAudioTags:l,src:u,onDuration:f,acceptableTimeShiftInSeconds:p,_remotionInternalNeedsDurationCalculation:m,_remotionInternalNativeLoopPassed:h,_remotionInternalStack:x,allowAmplificationDuringRender:v,name:k,pauseWhenBuffering:y,showInTimeline:g,loopVolumeCurveBehavior:w,stack:b,crossOrigin:S,delayRenderRetries:C,delayRenderTimeoutInMilliseconds:E,toneFrequency:T,useWebAudioApi:_,onError:j,onNativeError:A,audioStreamIndex:z,...$}=e,[M]=dp(),[W]=fp(),D=li(w??"repeat");if(!u)throw new TypeError("No 'src' was passed to <Html5Audio>.");const R=ro(u),I=d.useContext(et),[P]=d.useState(()=>String(Math.random())),F=oo({frame:D,volume:o,mediaVolume:M});ci(F);const O=sp({crossOrigin:S,requestsVideoFrame:!1,isClientSideRendering:!1}),H=d.useMemo(()=>({muted:i||W||F<=0,src:R,loop:h,crossOrigin:O,...$}),[h,W,i,$,R,F,O]),K=d.useMemo(()=>`audio-${to(u??"")}-${I==null?void 0:I.relativeFrom}-${I==null?void 0:I.cumulatedFrom}-${I==null?void 0:I.durationInFrames}-muted:${e.muted}-loop:${e.loop}`,[u,I==null?void 0:I.relativeFrom,I==null?void 0:I.cumulatedFrom,I==null?void 0:I.durationInFrames,e.muted,e.loop]),{el:N,mediaElementSourceNode:L,cleanupOnMediaTagUnmount:X}=MC({aud:H,audioId:K,premounting:!!(I!=null&&I.premounting),postmounting:!!(I!=null&&I.postmounting)}),Y=d.useCallback(()=>x??null,[x]);lp({volume:o,mediaVolume:M,src:u,mediaType:"audio",playbackRate:s??1,displayName:k??null,id:P,getStack:Y,showInTimeline:g,premountDisplay:(I==null?void 0:I.premountDisplay)??null,postmountDisplay:(I==null?void 0:I.postmountDisplay)??null,loopDisplay:void 0,documentationLink:"https://www.remotion.dev/docs/html5-audio",refForOutline:null}),Bw({mediaRef:N,src:u,mediaType:"audio",playbackRate:s??1,preservePitch:a,onlyWarnForMediaSeekingError:!1,acceptableTimeshift:p??null,isPremounting:!!(I!=null&&I.premounting),isPostmounting:!!(I!=null&&I.postmounting),pauseWhenBuffering:y,onAutoPlayError:null}),Vw({id:P,isPostmounting:!!(I!=null&&I.postmounting),isPremounting:!!(I!=null&&I.premounting),mediaRef:N,mediaType:"audio",onAutoPlayError:null}),Mw({logLevel:r,mediaRef:N,source:L,volume:F,shouldUseWebAudioApi:_??!1}),(te.useInsertionEffect??te.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{X()})},[X]),d.useImperativeHandle(t,()=>N.current,[N]);const U=d.useRef(f);return U.current=f,d.useEffect(()=>{var ae;const{current:ie}=N;if(!ie)return;if(ie.duration){(ae=U.current)==null||ae.call(U,ie.src,ie.duration);return}const ce=()=>{var oe;(oe=U.current)==null||oe.call(U,ie.src,ie.duration)};return ie.addEventListener("loadedmetadata",ce),()=>{ie.removeEventListener("loadedmetadata",ce)}},[N,u]),n?null:c.jsx("audio",{ref:N,preload:"metadata",crossOrigin:O,...H})},Ww=d.forwardRef(qC),QC=(e,t)=>{const n=d.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:x,loopVolumeCurveBehavior:v,pauseWhenBuffering:k,audioStreamIndex:y,preservePitch:g,...w}=e,b=Tr(),S=li(v??"repeat"),C=ct(),E=d.useContext(et),{registerRenderAsset:T,unregisterRenderAsset:_}=d.useContext(no),{delayRender:j,continueRender:A}=mn(),z=d.useMemo(()=>`audio-${to(e.src??"")}-${E==null?void 0:E.relativeFrom}-${E==null?void 0:E.cumulatedFrom}-${E==null?void 0:E.durationInFrames}`,[e.src,E==null?void 0:E.relativeFrom,E==null?void 0:E.cumulatedFrom,E==null?void 0:E.durationInFrames]),$=oo({volume:r,frame:S,mediaVolume:1});ci($),d.useImperativeHandle(t,()=>n.current,[]),d.useEffect(()=>{if(!e.src)throw new Error("No src passed");if(window.remotion_audioEnabled&&!e.muted&&!($<=0))return T({type:"audio",src:En(e.src),id:z,frame:b,volume:$,mediaFrame:C,playbackRate:e.playbackRate??1,toneFrequency:a??1,audioStartFrame:Math.max(0,-((E==null?void 0:E.cumulatedNegativeFrom)??0)),audioStreamIndex:y??0}),()=>_(z)},[e.muted,e.src,T,b,z,_,$,S,C,o,e.playbackRate,a,E==null?void 0:E.cumulatedNegativeFrom,y]);const{src:M}=e,W=t||l;return d.useLayoutEffect(()=>{var P,F;if(((F=(P=window.process)==null?void 0:P.env)==null?void 0:F.NODE_ENV)==="test"||!W)return;const D=j("Loading <Html5Audio> duration with src="+M,{retries:h??void 0,timeoutInMilliseconds:x??void 0}),{current:R}=n,I=()=>{R!=null&&R.duration&&s(R.src,R.duration),A(D)};return R!=null&&R.duration?(s(R.src,R.duration),A(D)):R==null||R.addEventListener("loadedmetadata",I,{once:!0}),()=>{R==null||R.removeEventListener("loadedmetadata",I),A(D)}},[M,s,W,h,x,A,j]),W?c.jsx("audio",{ref:n,...w,onError:m}):null},JC=d.forwardRef(QC),e2=(e,t)=>{const n=d.useContext(cu),r=e,{startFrom:o,endAt:i,trimBefore:s,trimAfter:a,name:l,stack:u,pauseWhenBuffering:f,showInTimeline:p,onError:m,freeze:h,...x}=r,{loop:v,freeze:k,...y}=r,{fps:g}=Xe(),w=Ye(),b=Rs(f);if(w.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:S,setDurations:C}=d.useContext(ip);if(typeof e.src!="string")throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);const E=ro(e.src),T=d.useCallback($=>{console.log($.currentTarget.error);const M=`Could not play audio with src ${E}: ${$.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;if(v){if(m){m(new Error(M));return}ms(new Error(M))}else m==null||m(new Error(M)),console.warn(M)},[v,m,E]),_=d.useCallback(($,M)=>{C({type:"got-duration",durationInSeconds:M,src:$})},[C]),j=S[En(E)]??S[En(e.src)];lu({startFrom:o,endAt:i,trimBefore:s,trimAfter:a});const{trimBeforeValue:A,trimAfterValue:z}=uu({startFrom:o,endAt:i,trimBefore:s,trimAfter:a});if(v&&j!==void 0){if(!Number.isFinite(j))return c.jsx(Va,{...y,ref:t,_remotionInternalNativeLoopPassed:!0});const $=j*g;return c.jsx(iu,{layout:"none",durationInFrames:ou({trimAfter:z,mediaDurationInFrames:$,playbackRate:e.playbackRate??1,trimBefore:A}),children:c.jsx(Va,{...y,ref:t,_remotionInternalNativeLoopPassed:!0})})}return typeof A<"u"||typeof z<"u"?c.jsx(dt,{layout:"none",from:0-(A??0),showInTimeline:!1,durationInFrames:z,name:l,children:c.jsx(Va,{_remotionInternalNeedsDurationCalculation:!!v,pauseWhenBuffering:b,...x,ref:t})}):(au({playbackRate:e.playbackRate,preservePitch:e.preservePitch,volume:e.volume},"Html5Audio"),w.isRendering?c.jsx(JC,{onDuration:_,...e,ref:t,onNativeError:T,_remotionInternalNeedsDurationCalculation:!!v}):c.jsx(Ww,{_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}))},Va=d.forwardRef(e2);Ct(Va);var t2=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},n2={...Un,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},...In,..._r,...Rr},r2=({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=t2(s),h=Math.ceil(t*m),x=Math.ceil(n*m),[v,k]=d.useState(null),y=Fs({effects:r,overrideId:a??null}),g=d.useMemo(()=>{if(typeof document>"u")return null;const C=document.createElement("canvas");return C.width=1,C.height=1,C},[]),w=Ms(),b=d.useCallback(C=>{k(C),typeof l=="function"?l(C):l&&(l.current=C)},[l]);d.useEffect(()=>{if(!v||!g)return;const C=u("Solid effect chain");if(!w)return f(C),()=>{f(C)};const E=g.getContext("2d",{colorSpace:"srgb"});if(!E){p(new Error("Failed to acquire 2D context for <Solid> source"));return}return E.clearRect(0,0,1,1),e!==void 0&&(E.fillStyle=e,E.fillRect(0,0,1,1)),$s({state:w.get(h,x),source:g,effects:y,output:v,width:h,height:x}).then(T=>{T&&f(C)}).catch(T=>{p(T)}),()=>{f(C)}},[e,v,g,w,h,x,u,f,p,y]);const S=d.useMemo(()=>({width:t,height:n,...i??{}}),[n,i,t]);return c.jsx("canvas",{ref:b,width:h,height:x,className:o,style:S})},o2=d.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:x,...v},k)=>{const y=js(e),g=d.useRef(null);return d.useImperativeHandle(k,()=>g.current,[]),c.jsx(dt,{layout:"none",from:u,trimBefore:f,freeze:p,hidden:m,showInTimeline:h,controls:t,_remotionInternalEffects:y,durationInFrames:s,name:l??"<Solid>",outlineRef:g,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/solid",...v,children:c.jsx(r2,{reference:g,overrideId:(t==null?void 0:t.overrideId)??null,color:n,height:r,width:o,className:i,style:a,effects:e,pixelDensity:x})})}),Hw=Zn({Component:o2,componentName:"<Solid>",componentIdentity:"dev.remotion.remotion.Solid",schema:n2,supportsEffects:!0});Hw.displayName="Solid";Ct(Hw);var pa=null,Uw=()=>{if(pa!==null)return pa;if(typeof document>"u")return!1;const e=document.createElement("canvas"),t=e.getContext("2d");return pa=typeof(t==null?void 0:t.drawElementImage)=="function"&&typeof e.requestPaint=="function"&&typeof e.captureElementImage=="function"&&"transferControlToOffscreen"in HTMLCanvasElement.prototype,pa},i2="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 s2(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 a2(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 ma=e=>e instanceof DOMException&&e.name==="InvalidStateError",bh="HtmlInCanvas: Expected the element to be inside the viewport during rendering, but Chrome had no cached paint record for it.",Sh=({target:e,width:t,height:n})=>{e.width!==t&&(e.width=t),e.height!==n&&(e.height=n)},l2=({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()},kh=d.createContext(null),Zw=d.forwardRef(({width:e,height:t,effects:n,children:r,onPaint:o,onInit:i,pixelDensity:s,controls:a,style:l},u)=>{const f=d.useContext(kh);s2(e,t);const p=a2(s),m=Math.ceil(e*p),h=Math.ceil(t*p),{delayRender:x,continueRender:v,cancelRender:k}=mn(),{isClientSideRendering:y,isRendering:g}=Ye(),w=!g||y,b=o===void 0&&i===void 0;Uw()||k(new Error(i2));const S=d.useRef(null),C=d.useRef(null),E=d.useRef(null),T=`${e}x${t}@${p}-${b?"direct":"offscreen"}`,_=d.useCallback(N=>{S.current=N,typeof u=="function"?u(N):u&&(u.current=N)},[u]),j=Ms(),A=Fs({effects:n,overrideId:(a==null?void 0:a.overrideId)??null}),z=d.useRef(A);z.current=A;const $=d.useRef(o);$.current=o;const M=d.useRef(i);M.current=i;const W=d.useRef(!1),D=d.useRef(null),R=d.useRef(!1),I=d.useRef(f);I.current=f;const P=d.useCallback(async()=>{var X;const N=E.current;if(!N)throw new Error("Canvas or scene element not found");const L=C.current;if(!L)throw new Error("HtmlInCanvas: paint target is not ready because the canvas is remounting");Sh({target:L,width:m,height:h});try{const Y=S.current;if(!Y)throw new Error("Canvas not found");const V=x("onPaint");if(!W.current){const ie=M.current;if(!ie)W.current=!0;else{let ce;try{ce=Y.captureElementImage(N)}catch(ae){if(ma(ae)&&w){v(V);return}throw ma(ae)?new Error(bh):ae}W.current=!0;try{if(L instanceof HTMLCanvasElement)throw new Error("HtmlInCanvas: onInit requires an OffscreenCanvas paint target");const ae=await ie({canvas:L,element:N,elementImage:ce,pixelDensity:p});if(typeof ae!="function")throw new Error("HtmlInCanvas: when `onInit` is provided, it must return a cleanup function, or a Promise that resolves to one.");R.current?ae():D.current=ae}finally{ce.close()}}}let U;try{U=Y.captureElementImage(N)}catch(ie){if(ma(ie)&&w){v(V);return}throw ma(ie)?new Error(bh):ie}try{const ie=$.current;if(ie){if(L instanceof HTMLCanvasElement)throw new Error("HtmlInCanvas: onPaint requires an OffscreenCanvas paint target");const ce=ie({canvas:L,element:N,elementImage:U,pixelDensity:p});ce&&await ce}else l2({canvas:L,element:N,elementImage:U,pixelDensity:p});await $s({state:j.get(m,h),source:L,effects:z.current,output:L,width:m,height:h})}finally{U.close()}(X=I.current)==null||X.requestParentPaint(),v(V)}catch(Y){k(Y)}},[h,m,j,v,k,x,p,w]);d.useLayoutEffect(()=>{const N=S.current;if(!N)throw new Error("Canvas not found");N.layoutSubtree=!0;const L=b?N:N.transferControlToOffscreen();return C.current=L,Sh({target:L,width:m,height:h}),W.current=!1,R.current=!1,N.addEventListener("paint",P),()=>{var X;N.removeEventListener("paint",P),C.current=null,W.current=!1,R.current=!0,(X=D.current)==null||X.call(D),D.current=null}},[P,k,m,h,b]);const F=d.useRef(!1);d.useLayoutEffect(()=>{var L;if(!F.current){F.current=!0;return}const N=S.current;N&&((L=N.requestPaint)==null||L.call(N))},[o,A]),d.useLayoutEffect(()=>{const N=S.current;if(!N)return;const L=x("waiting for first paint after canvas resize");return N.addEventListener("paint",()=>{v(L)},{once:!0}),()=>{v(L)}},[e,t,v,x,T]);const O=d.useMemo(()=>({width:e,height:t}),[e,t]),H=d.useMemo(()=>({width:e,height:t,...l??{}}),[t,l,e]),K=d.useMemo(()=>({requestParentPaint:()=>{var N,L;(L=(N=S.current)==null?void 0:N.requestPaint)==null||L.call(N)}}),[]);return c.jsx(kh.Provider,{value:K,children:c.jsx("canvas",{ref:_,width:m,height:h,style:H,children:c.jsx("div",{ref:E,style:O,children:r})},T)})});Zw.displayName="HtmlInCanvasContent";var Yw=d.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=js(n),x=d.useRef(null),v=d.useCallback(k=>{x.current=k,typeof m=="function"?m(k):m&&(m.current=k)},[m]);return c.jsx(dt,{durationInFrames:u,name:f??"<HtmlInCanvas>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/remotion/html-in-canvas",controls:a,_remotionInternalEffects:h,outlineRef:x,layout:"none",...p,children:c.jsx(Zw,{ref:v,width:e,height:t,effects:n,onPaint:o,onInit:i,pixelDensity:s,controls:a,style:l,children:r})})});Yw.displayName="HtmlInCanvas";var u2={...Un,pixelDensity:{type:"number",min:1,max:3,step:.1,default:1,description:"Pixel density",hiddenFromList:!1},...In,..._r,...Rr},c2=Zn({Component:Yw,componentName:"<HtmlInCanvas>",componentIdentity:"dev.remotion.remotion.HtmlInCanvas",schema:u2,supportsEffects:!0}),Kw=Object.assign(c2,{isSupported:Uw});Kw.displayName="HtmlInCanvas";Ct(Kw);function Ln(e){return e.startsWith("data:")&&e.length>100?e.slice(0,60)+"...["+e.length+" chars total]":e}var d2={...Un,...oi,fit:{type:"enum",default:"fill",description:"Fit",variants:{fill:{},contain:{},cover:{}}},...In,..._r,...Rr},f2=()=>{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},p2=({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(f2()))}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="${Ln(e)}"`)));return}a(()=>n({element:o,width:f,height:p}))})},o.onerror=()=>{a(()=>r(new Error(`Could not load <CanvasImage> with src="${Ln(e)}"`)))},t.addEventListener("abort",l,{once:!0}),t.aborted){l();return}o.crossOrigin="anonymous",o.src=e});function m2(e){return 1e3*2**(e-1)}var h2=({onFrame:e})=>{if(typeof requestAnimationFrame>"u")return e(),()=>{};const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)},Gw=d.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:x,...v},k)=>{const{delayRender:y,continueRender:g,cancelRender:w}=mn(),{delayPlayback:b}=fu(),[S,C]=d.useState(null),[E,T]=d.useState(null),_=ro(e),j=Ms(),A=Fs({effects:o,overrideId:(i==null?void 0:i.overrideId)??null}),z=d.useContext(et),$=d.useRef(null),[M,W]=d.useState(!1),D=!!(z!=null&&z.premounting),R=!!(z!=null&&z.postmounting),I=d.useCallback(({markAsReady:O})=>{const H=$.current;!H||H.continued||(H.continued=!0,O&&W(!1),g(H.handle),$.current=null)},[g]),P=d.useMemo(()=>typeof document>"u"?null:document.createElement("canvas"),[]),F=d.useCallback(O=>{C(O),x&&(x.current=O),typeof k=="function"?k(O):k&&(k.current=O)},[k,x]);return d.useLayoutEffect(()=>{if(!(!f||!M||D||R))return b().unblock},[b,M,R,D,f]),d.useLayoutEffect(()=>{const O=y(`Rendering <CanvasImage> with src="${Ln(_)}"`,{retries:m??void 0,timeoutInMilliseconds:h??void 0}),H=new AbortController;let K=!1,N=0,L=null;T(null),W(!0),$.current={handle:O,continued:!1};const X=()=>{p2({src:_,signal:H.signal}).then(Y=>{K||T(Y)}).catch(Y=>{if(Y.name==="AbortError"){I({markAsReady:!1});return}if(N++,N<=p){const V=m2(N);console.warn(`Could not load <CanvasImage> with src="${Ln(_)}", retrying in ${V}ms`),L=setTimeout(()=>{K||X()},V)}else s?(s(Y),I({markAsReady:!0})):w(Y)})};return X(),()=>{K=!0,L!==null&&clearTimeout(L),H.abort(),I({markAsReady:!1})}},[_,w,I,y,m,h,p,s]),d.useLayoutEffect(()=>{if(!E||!S||!P)return;const O=y(`Applying effects to <CanvasImage> with src="${Ln(_)}"`);let H=!1,K=!1,N=()=>{};const L=()=>{K||(K=!0,g(O))},X=t??E.width,Y=n??E.height,V=P.getContext("2d",{colorSpace:"srgb"});return V?(P.width=X,P.height=Y,S.width=X,S.height=Y,V.clearRect(0,0,X,Y),V.drawImage(E.element,...ww(r,{width:E.width,height:E.height},{width:X,height:Y})),$s({state:j.get(X,Y),source:P,effects:A,output:S,width:X,height:Y}).then(U=>{U&&!H&&(N=h2({onFrame:()=>{H||(L(),I({markAsReady:!0}))}}))}).catch(U=>{H||(s?(s(U),L(),I({markAsReady:!0})):w(U))}),()=>{H=!0,N(),L()}):(w(new Error("Could not get 2D context for <CanvasImage> source canvas")),L(),()=>{L()})},[_,w,j,g,I,y,r,n,E,A,s,S,P,t]),c.jsx("canvas",{...v,ref:F,width:t,height:n,className:a,style:l,id:u})});Gw.displayName="CanvasImageContent";var g2=d.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:x,trimBefore:v,freeze:k,premountFor:y,postmountFor:g,styleWhilePremounted:w,styleWhilePostmounted:b,hidden:S,name:C,showInTimeline:E,stack:T,controls:_,_remotionInternalDocumentationLink:j,outlineRef:A,...z},$)=>{if(!e)throw new Error('No "src" prop was passed to <CanvasImage>.');const M=js(o),W=d.useRef(null);d.useImperativeHandle($,()=>W.current,[]);const{effectivePostmountFor:D,effectivePremountFor:R,freezeFrame:I,isPremountingOrPostmounting:P,postmountingActive:F,premountingActive:O,premountingStyle:H}=_s({from:x??0,durationInFrames:h??1/0,premountFor:y??null,postmountFor:g??null,style:s??null,styleWhilePremounted:w??null,styleWhilePostmounted:b??null,hideWhilePremounted:"display-none"});return c.jsx(Ts,{frame:I,active:P,children:c.jsx(dt,{layout:"none",from:x??0,trimBefore:v,durationInFrames:h??1/0,freeze:k,hidden:S,showInTimeline:E??!0,name:C??"<CanvasImage>",_remotionInternalDocumentationLink:j??"https://www.remotion.dev/docs/canvasimage",controls:_,_remotionInternalEffects:M,_remotionInternalIsMedia:{type:"image",src:e},_remotionInternalStack:T,_remotionInternalPremountDisplay:R||null,_remotionInternalPostmountDisplay:D||null,_remotionInternalIsPremounting:O,_remotionInternalIsPostmounting:F,outlineRef:A??W,children:c.jsx(Gw,{ref:W,src:e,width:t,height:n,fit:r,effects:o,controls:_,className:i,style:H??void 0,id:a,onError:l,pauseWhenLoading:u,maxRetries:f,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,refForOutline:A??null,...z})})})}),pp=Zn({Component:g2,componentName:"<CanvasImage>",componentIdentity:"dev.remotion.remotion.CanvasImage",schema:d2,supportsEffects:!0});pp.displayName="CanvasImage";Ct(pp);var v2=({onLoad:e,onError:t,delayRenderRetries:n,delayRenderTimeoutInMilliseconds:r,...o},i)=>{const{delayRender:s,continueRender:a}=mn(),[l]=d.useState(()=>s(`Loading <IFrame> with source ${o.src}`,{retries:n??void 0,timeoutInMilliseconds:r??void 0})),u=d.useCallback(p=>{a(l),e==null||e(p)},[l,e,a]),f=d.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 c.jsx("iframe",{referrerPolicy:"strict-origin-when-cross-origin",...o,ref:i,onError:f,onLoad:u})};d.forwardRef(v2);function y2(e){return 1e3*2**(e-1)}var w2=({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=d.useRef(null),h=d.useRef({}),{delayPlayback:x}=fu(),v=d.useContext(et),[k,y]=d.useState(!1),g=d.useCallback(M=>{m.current=M,f.current=M,typeof u=="function"?u(M):u&&(u.current=M)},[u,f]),w=ro(n),b=d.useCallback(M=>{if(!m.current)return;const W=m.current.src;setTimeout(()=>{var R;if(!m.current)return;const D=(R=m.current)==null?void 0:R.src;D===W&&(m.current.removeAttribute("src"),m.current.setAttribute("src",D))},M)},[]),{delayRender:S,continueRender:C,cancelRender:E}=mn(),T=!!(v!=null&&v.premounting),_=!!(v!=null&&v.postmounting),j=d.useCallback(M=>{var W,D,R,I,P,F,O;if(h.current){if(h.current[(W=m.current)==null?void 0:W.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(M);return}if((h.current[(I=m.current)==null?void 0:I.src]??0)<=t){const H=y2(h.current[(P=m.current)==null?void 0:P.src]??0);console.warn(`Could not load image with source ${Ln((F=m.current)==null?void 0:F.src)}, retrying again in ${H}ms`),b(H);return}try{E("Error loading image with src: "+Ln((O=m.current)==null?void 0:O.src))}catch{}}},[E,t,e,b]);typeof window<"u"&&(d.useLayoutEffect(()=>{if(!(!r||!k||T||_))return x().unblock},[x,k,_,T,r]),d.useLayoutEffect(()=>{var I,P;if(((P=(I=window.process)==null?void 0:I.env)==null?void 0:P.NODE_ENV)==="test"){m.current&&(m.current.src=w);return}const{current:M}=m;if(!M)return;y(!0);const W=S("Loading <Img> with src="+Ln(w),{retries:o??void 0,timeoutInMilliseconds:i??void 0});let D=!1;const R=()=>{var F,O,H;if(D){C(W);return}(h.current[(F=m.current)==null?void 0:F.src]??0)>0&&(delete h.current[(O=m.current)==null?void 0:O.src],console.info(`Retry successful - ${Ln((H=m.current)==null?void 0:H.src)} is now loaded`)),M&&(s==null||s(M)),y(!1),C(W)};if(!m.current){R();return}return M.src=w,M.decode().then(R).catch(F=>{console.warn(F),M.complete&&M.naturalWidth>0&&M.naturalHeight>0?R():M.addEventListener("load",R)}),()=>{D=!0,M.removeEventListener("load",R),C(W)}},[w,o,i,s,C,S]));const{isClientSideRendering:A,isRendering:z}=Ye(),$=sp({crossOrigin:a,requestsVideoFrame:!1,isClientSideRendering:A});return c.jsx("img",{...p,ref:g,crossOrigin:$,onError:j,decoding:z?"sync":l})},x2=({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:x,outlineRef:v,...k})=>{if(!o)throw new Error('No "src" prop was passed to <Img>.');const{effectivePostmountFor:y,effectivePremountFor:g,freezeFrame:w,isPremountingOrPostmounting:b,postmountingActive:S,premountingActive:C,premountingStyle:E}=_s({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 c.jsx(Ts,{frame:w,active:b,children:c.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:g||null,_remotionInternalPostmountDisplay:y||null,_remotionInternalIsPremounting:C,_remotionInternalIsPostmounting:S,name:t??"<Img>",controls:x,showInTimeline:r??!0,hidden:e,outlineRef:v,children:c.jsx(w2,{src:o,refForOutline:v,style:E??void 0,...k})})})},b2=pp,S2={src:{type:"asset",default:void 0,description:"Source",keyframable:!1},...Un,...oi,...In,..._r,...Rr},k2=new Set(["alt","crossOrigin","decoding","fetchPriority","loading","onError","onImageFrame","onLoad","sizes","srcSet","useMap"]),E2=e=>Object.keys(e).filter(t=>e[t]!==void 0&&k2.has(t)),C2=e=>e.map(t=>`"${t}"`).join(", "),I2=({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=E2(e);if(t!=null&&o.unshift("ref"),o.length!==0)throw new Error(`The ${C2(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"}.`)},T2=e=>{const t=e==null?void 0:e.objectFit;if(t==="fill"||t==="contain"||t==="cover")return t},R2=({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:x,controls:v,width:k,height:y,className:g,style:w,id:b,pauseWhenLoading:S,maxRetries:C,delayRenderRetries:E,delayRenderTimeoutInMilliseconds:T,..._})=>{const j=d.useRef(null),A=Rs(S);if(e.length===0)return c.jsx(x2,{..._,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:x,controls:v,width:k,height:y,className:g,style:w,id:b,pauseWhenLoading:A,maxRetries:C,delayRenderRetries:E,delayRenderTimeoutInMilliseconds:T,outlineRef:j});if(!s)throw new Error('No "src" prop was passed to <Img>.');I2({props:_,ref:t,width:k,height:y});const z=typeof k=="number"?k:void 0,$=typeof y=="number"?y:void 0,M=_,W=T2(w)??"fill";return c.jsx(b2,{src:s,width:z,height:$,fit:W,effects:e,className:g,style:w,id:b,pauseWhenLoading:A,maxRetries:C,delayRenderRetries:E,delayRenderTimeoutInMilliseconds:T,from:a,trimBefore:l,durationInFrames:u,freeze:f,premountFor:p,postmountFor:m,styleWhilePremounted:h,styleWhilePostmounted:x,hidden:n,name:r??"<Img>",showInTimeline:i,stack:o,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/img",controls:v,outlineRef:j,...M})},mp=Zn({Component:R2,componentName:"<Img>",componentIdentity:"dev.remotion.remotion.Img",schema:S2,supportsEffects:!0});Ct(mp);var _2=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}`)},Xw=({packageName:e,componentName:t})=>`${_2(e)}.${t}`,hp={...Un,...In},P2={...hp,..._r},qw={...P2,...Rr},j2={...qw,...Xl,...W0},F2={...hp,...Xl,...W0},$2=(e,t)=>{typeof e=="function"?e(t):e&&(e.current=t)},Qw=e=>{const t=Zn(e);return Ct(t),t},xl=(e,t,n)=>{const r=d.forwardRef((i,s)=>{const{durationInFrames:a,from:l,trimBefore:u,freeze:f,hidden:p,name:m,showInTimeline:h,stack:x,controls:v,...k}=i,y=d.useRef(null),g=d.useCallback(w=>{y.current=w,$2(s,w)},[s]);return c.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:x,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/interactive",outlineRef:y,children:te.createElement(e,{...k,ref:g})})});r.displayName=t;const o=Qw({Component:r,componentName:t,componentIdentity:Xw({packageName:"remotion",componentName:t.slice(1,-1)}),schema:n,supportsEffects:!1});return o.displayName=t,o},Te=(e,t)=>xl(e,t,j2),fo=(e,t)=>xl(e,t,hp),tr={baseSchema:Un,transformSchema:In,textSchema:Xl,backgroundSchema:_r,borderSchema:Rr,premountSchema:oi,sequenceSchema:Go,withSchema:Qw,_internalMakeRemotionComponentIdentity:Xw,A:Te("a","<Interactive.A>"),Article:Te("article","<Interactive.Article>"),Aside:Te("aside","<Interactive.Aside>"),Button:Te("button","<Interactive.Button>"),Circle:fo("circle","<Interactive.Circle>"),Code:Te("code","<Interactive.Code>"),Div:Te("div","<Interactive.Div>"),Ellipse:fo("ellipse","<Interactive.Ellipse>"),Em:Te("em","<Interactive.Em>"),Footer:Te("footer","<Interactive.Footer>"),G:fo("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:fo("line","<Interactive.Line>"),Main:Te("main","<Interactive.Main>"),Nav:Te("nav","<Interactive.Nav>"),Ol:Te("ol","<Interactive.Ol>"),P:Te("p","<Interactive.P>"),Path:fo("path","<Interactive.Path>"),Pre:Te("pre","<Interactive.Pre>"),Rect:fo("rect","<Interactive.Rect>"),Section:Te("section","<Interactive.Section>"),Small:Te("small","<Interactive.Small>"),Span:Te("span","<Interactive.Span>"),Strong:Te("strong","<Interactive.Strong>"),Svg:xl("svg","<Interactive.Svg>",qw),Text:xl("text","<Interactive.Text>",F2),Ul:Te("ul","<Interactive.Ul>")},M2=async({resolvedSrc:e,signal:t,requestInit:n,contentType:r})=>{const{decoder:o,selectedTrack:i}=await kw({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()}},Jw=te.createRef(),A2=({children:e,onlyRenderComposition:t,currentCompositionMetadata:n,initialCompositions:r,initialCanvasContent:o})=>{const[i,s]=d.useState([]),[a,l]=d.useState(o),[u,f]=d.useState(r),p=d.useRef(u),m=d.useCallback(w=>{f(b=>{const S=w(b);return p.current=S,S})},[]),h=d.useCallback(w=>{m(b=>{if(b.find(S=>S.id===w.id))throw new Error(`Multiple composition with id ${w.id} are registered.`);return[...b,w]})},[m]),x=d.useCallback(w=>{f(b=>b.filter(S=>S.id!==w))},[]),v=d.useCallback((w,b,S,C)=>{s(E=>[...E,{name:w,parent:b,nonce:S,stack:C}])},[]),k=d.useCallback((w,b)=>{s(S=>S.filter(C=>!(C.name===w&&C.parent===b)))},[]);d.useImperativeHandle(Jw,()=>({getCompositions:()=>p.current}),[]);const y=d.useMemo(()=>({registerComposition:h,unregisterComposition:x,registerFolder:v,unregisterFolder:k,setCanvasContent:l,onlyRenderComposition:t}),[h,v,x,k,t]),g=d.useMemo(()=>({compositions:u,folders:i,currentCompositionMetadata:n,canvasContent:a}),[u,i,n,a]);return c.jsx(ei.Provider,{value:g,children:c.jsx(ks.Provider,{value:y,children:e})})},ex={};v0(ex,{makeDefaultPreviewCSS:()=>L2,injectCSS:()=>N2,OBJECTFIT_CONTAIN_CLASS_NAME:()=>hs});var ha={},N2=e=>{if(typeof document>"u")return()=>{};if(ha[e])return()=>{};const t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");return n.appendChild(document.createTextNode(e)),t.prepend(n),ha[e]=n,()=>{const r=ha[e];r&&(r.parentNode&&r.parentNode.removeChild(r),delete ha[e])}},hs="__remotion_objectfitcontain",L2=(e,t)=>e?`
58
+ ${e} * {
59
+ box-sizing: border-box;
60
+ }
61
+ ${e} *:-webkit-full-screen {
62
+ width: 100%;
63
+ height: 100%;
64
+ }
65
+ ${e} .${hs} {
66
+ object-fit: contain;
67
+ }
68
+ `:`
69
+ * {
70
+ box-sizing: border-box;
71
+ }
72
+ body {
73
+ margin: 0;
74
+ background-color: ${t};
75
+ }
76
+ .${hs} {
77
+ object-fit: contain;
78
+ }
79
+ `,tx="__remotion-studio-container",z2=()=>document.getElementById(tx),D2=te.createContext(null),O2=null,sc=[],B2=()=>O2,V2=e=>(sc.push(e),()=>{sc=sc.filter(t=>t!==e)}),gp=d.createContext(null),W2=()=>{const e=d.useContext(gp);return!e||e.videoEnabled===null?window.remotion_videoEnabled:e.videoEnabled},H2=()=>{const e=d.useContext(gp);return!e||e.audioEnabled===null?window.remotion_audioEnabled:e.audioEnabled},U2=({children:e,videoEnabled:t,audioEnabled:n})=>{const r=d.useMemo(()=>({videoEnabled:t,audioEnabled:n}),[t,n]);return c.jsx(gp.Provider,{value:r,children:e})},Z2=({children:e,numberOfAudioTags:t,logLevel:n,audioLatencyHint:r,previewSampleRate:o,videoEnabled:i,audioEnabled:s,frameState:a})=>{const l=d.useMemo(()=>{let f=0;return{getNonce:()=>f++}},[]),u=d.useMemo(()=>({logLevel:n,mountTime:Date.now()}),[n]);return c.jsx(eo.Provider,{value:u,children:c.jsx(Es.Provider,{value:l,children:c.jsx(Vk,{frameState:a,children:c.jsx(U2,{videoEnabled:i,audioEnabled:s,children:c.jsx(E0,{children:c.jsx(Rw,{children:c.jsx(Kk,{children:c.jsx(Pw,{children:c.jsx(Lw,{children:c.jsx(jw,{audioLatencyHint:r,audioEnabled:s,previewSampleRate:o,children:c.jsx(Fw,{numberOfAudioTags:t,children:e})})})})})})})})})})})},Eh=["h264","h265","vp8","vp9","av1","mp3","aac","wav","prores","h264-mkv","h264-ts","gif"];function Y2(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(!Eh.includes(e))throw new Error(`The "${n}" prop ${t} must be one of ${Eh.join(", ")}, but you passed ${e}.`)}}var K2=({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;ml(l,"width",e!=null&&e.width?s:a);const u=(e==null?void 0:e.height)??r??void 0;ml(u,"height",e!=null&&e.height?s:a);const f=(e==null?void 0:e.fps)??n??null;Ul(f,e!=null&&e.fps?s:a);const p=(e==null?void 0:e.durationInFrames)??i??null;Hl(p,{allowFloats:!1,component:`of the "<Composition />" component with the id "${t}"`});const m=e==null?void 0:e.defaultCodec;Y2(m,s,"defaultCodec");const h=e==null?void 0:e.defaultOutName,x=e==null?void 0:e.defaultVideoImageFormat,v=e==null?void 0:e.defaultPixelFormat,k=e==null?void 0:e.defaultProResProfile,y=e==null?void 0:e.defaultSampleRate;return{width:l,height:u,fps:f,durationInFrames:p,defaultCodec:m,defaultOutName:h,defaultVideoImageFormat:x,defaultPixelFormat:v,defaultProResProfile:k,defaultSampleRate:y}},Ch=({calculated:e,compositionDurationInFrames:t,compositionFps:n,compositionHeight:r,compositionId:o,compositionWidth:i,defaultProps:s,originalProps:a})=>{const l=K2({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:Id(s??{}),props:Id((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}}},nx=({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:Xt().isRendering}):null;return u!==null&&typeof u=="object"&&"then"in u?u.then(f=>Ch({calculated:f,compositionDurationInFrames:i,compositionFps:s,compositionHeight:a,compositionWidth:l,compositionId:o,defaultProps:n,originalProps:r})):Ch({calculated:u,compositionDurationInFrames:i,compositionFps:s,compositionHeight:a,compositionWidth:l,compositionId:o,defaultProps:n,originalProps:r})},rx=e=>{const t=nx(e);return typeof t=="object"&&"then"in t?t.then(({videoConfig:n})=>n):t.videoConfig},G2=e=>{try{return{type:"success",result:nx(e)}}catch(t){return{type:"error",error:t}}},X2=e=>{try{return{type:"success",result:rx(e)}}catch(t){return{type:"error",error:t}}},q2=te.createContext(()=>{}),Q2=()=>{if(Xt().isRendering){const e=window.remotion_envVariables;return e?{...JSON.parse(e),NODE_ENV:"production"}:{}}return{NODE_ENV:"production"}},J2=()=>{const e=Q2();window.process||(window.process={}),window.process.env||(window.process.env={}),Object.keys(e).forEach(t=>{window.process.env[t]=e[t]})},eI=te.createContext(null),tI=d.createContext({setSize:()=>{},size:{size:"auto",translation:{x:0,y:0}}}),nI=({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)},rI=te.createContext(null),oI=({src:e,transparent:t,currentTime:n,toneMapped:r})=>`http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(En(e))}&time=${encodeURIComponent(Math.max(0,n))}&transparent=${String(t)}&toneMapped=${String(r)}`,iI=({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:x,audioStreamIndex:v,preservePitch:k,...y})=>{const g=Tr(),w=ct(),b=li(f),S=Gl(),C=d.useContext(et),E=Kr(),{registerRenderAsset:T,unregisterRenderAsset:_}=d.useContext(no);if(!r)throw new TypeError("No `src` was passed to <OffthreadVideo>.");const j=d.useMemo(()=>`offthreadvideo-${to(r)}-${C==null?void 0:C.cumulatedFrom}-${C==null?void 0:C.relativeFrom}-${C==null?void 0:C.durationInFrames}`,[r,C==null?void 0:C.cumulatedFrom,C==null?void 0:C.relativeFrom,C==null?void 0:C.durationInFrames]);if(!S)throw new Error("No video config found");const A=oo({volume:t,frame:b,mediaVolume:1});ci(A),d.useEffect(()=>{if(!r)throw new Error("No src passed");if(window.remotion_audioEnabled&&!o&&!(A<=0))return T({type:"video",src:En(r),id:j,frame:g,volume:A,mediaFrame:w,playbackRate:n,toneFrequency:l,audioStartFrame:Math.max(0,-((C==null?void 0:C.cumulatedNegativeFrom)??0)),audioStreamIndex:v}),()=>_(j)},[o,r,T,j,_,A,w,g,n,l,C==null?void 0:C.cumulatedNegativeFrom,v]);const z=d.useMemo(()=>Dw({frame:w,playbackRate:n||1,startFrom:-E})/S.fps,[w,E,n,S.fps]),$=d.useMemo(()=>oI({src:r,currentTime:z,transparent:s,toneMapped:a}),[a,z,r,s]),[M,W]=d.useState(null),{delayRender:D,continueRender:R}=mn();d.useLayoutEffect(()=>{if(!window.remotion_videoEnabled)return;const O=[];W(null);const H=new AbortController,K=D(`Fetching ${$} from server`,{retries:p??void 0,timeoutInMilliseconds:m??void 0});return(async()=>{try{const L=await fetch($,{signal:H.signal,cache:"no-store"});if(L.status!==200){if(L.status===500){const V=await L.json();if(V.error){const U=V.error.replace(/^Error: /,"");throw new Error(U)}}throw new Error(`Server returned status ${L.status} while fetching ${$}`)}const X=await L.blob(),Y=URL.createObjectURL(X);O.push(()=>URL.revokeObjectURL(Y)),W({src:Y,handle:K})}catch(L){if(L.message.includes("aborted")){R(K);return}if(H.signal.aborted){R(K);return}L.message.includes("Failed to fetch")&&(L=new Error(`Failed to fetch ${$}. This could be caused by Chrome rejecting the request because the disk space is low. Consider increasing the disk size of your environment.`,{cause:L})),e?e(L):ms(L)}})(),O.push(()=>{H.signal.aborted||H.abort()}),()=>{O.forEach(L=>L())}},[$,p,m,e,R,D]);const I=d.useCallback(()=>{e?e==null||e(new Error("Failed to load image with src "+M)):ms("Failed to load image with src "+M)},[M,e]),P=d.useMemo(()=>[hs,y.className].filter(ti).join(" "),[y.className]),F=d.useCallback(O=>{h&&h(O)},[h]);return!M||!window.remotion_videoEnabled?null:(R(M.handle),c.jsx(mp,{src:M.src,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,onImageFrame:F,...y,onError:I,className:P}))},ox=({ref:e,onVideoFrame:t})=>{d.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 jo extends Error{constructor({message:n,src:r}){super(n);Se(this,"src");this.name="MediaPlaybackError",this.src=r}}var sI=(e,t)=>{const n=d.useContext(ai);if(!n)throw new Error("SharedAudioContext not found");const r=d.useRef(null),o=d.useMemo(()=>n.audioContext?ap({audioContext:n.audioContext,ref:r}):null,[n.audioContext]);(te.useInsertionEffect??te.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:x,toneFrequency:v,name:k,_remotionInternalNativeLoopPassed:y,_remotionInternalStack:g,style:w,pauseWhenBuffering:b,showInTimeline:S,loopVolumeCurveBehavior:C,onError:E,onAutoPlayError:T,onVideoFrame:_,crossOrigin:j,delayRenderRetries:A,delayRenderTimeoutInMilliseconds:z,allowAmplificationDuringRender:$,useWebAudioApi:M,audioStreamIndex:W,...D}=e,R=li(C??"repeat"),{fps:I,durationInFrames:P}=Xe(),F=d.useContext(et),O=Cn(),H=Is(),[K]=d.useState(()=>String(Math.random()));if(typeof h<"u")throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");const[N]=dp(),[L]=fp(),X=oo({frame:R,volume:s,mediaVolume:N});ci(X);const Y=d.useCallback(()=>g??null,[g]);lp({volume:s,mediaVolume:N,mediaType:"video",src:p,playbackRate:e.playbackRate??1,displayName:k??null,id:K,getStack:Y,showInTimeline:S,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}),Bw({mediaRef:r,src:p,mediaType:"video",playbackRate:e.playbackRate??1,preservePitch:u,onlyWarnForMediaSeekingError:f,acceptableTimeshift:x??null,isPremounting:!!(F!=null&&F.premounting),isPostmounting:!!(F!=null&&F.postmounting),pauseWhenBuffering:b,onAutoPlayError:T??null}),Vw({id:K,isPostmounting:!!(F!=null&&F.postmounting),isPremounting:!!(F!=null&&F.premounting),mediaRef:r,mediaType:"video",onAutoPlayError:T??null}),Mw({logLevel:O,mediaRef:r,volume:X,source:o,shouldUseWebAudioApi:M??!1});const V=F?F.relativeFrom:0,U=F?Math.min(F.durationInFrames,P):P,ie=ro(p),ce=DC({actualSrc:ie,actualFrom:V,duration:U,fps:I});d.useImperativeHandle(t,()=>r.current,[]),d.useState(()=>vt({logLevel:O,message:`Mounting video with source = ${ce}, v=${Ni}, user agent=${typeof navigator>"u"?"server":navigator.userAgent}`,tag:"video",mountTime:H})),d.useEffect(()=>{const{current:ee}=r;if(!ee)return;const Q=()=>{var ue;if(ee.error){if(console.error("Error occurred in video",ee==null?void 0:ee.error),E){const Ee=new jo({message:`Code ${ee.error.code}: ${ee.error.message}`,src:p});E(Ee);return}throw new jo({message:`The browser threw an error while playing the video ${p}: Code ${ee.error.code} - ${(ue=ee==null?void 0:ee.error)==null?void 0:ue.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,src:p})}else{if(E){const Ee=new jo({message:`The browser threw an error while playing the video ${p}`,src:p});E(Ee);return}throw new jo({message:"The browser threw an error while playing the video",src:p})}};return ee.addEventListener("error",Q,{once:!0}),()=>{ee.removeEventListener("error",Q)}},[E,p]);const ae=d.useRef(m);ae.current=m,ox({ref:r,onVideoFrame:_}),d.useEffect(()=>{var ue;const{current:ee}=r;if(!ee)return;if(ee.duration){(ue=ae.current)==null||ue.call(ae,p,ee.duration);return}const Q=()=>{var Ee;(Ee=ae.current)==null||Ee.call(ae,p,ee.duration)};return ee.addEventListener("loadedmetadata",Q),()=>{ee.removeEventListener("loadedmetadata",Q)}},[p]),d.useEffect(()=>{const{current:ee}=r;ee&&(du()?ee.preload="metadata":ee.preload="auto")},[]);const oe=d.useMemo(()=>({...w}),[w]),J=sp({crossOrigin:j,requestsVideoFrame:!!_,isClientSideRendering:!1});return c.jsx("video",{...D,ref:r,muted:a||L||X<=0,playsInline:!0,src:ce,loop:y,style:oe,disableRemotePlayback:!0,crossOrigin:J,controls:!1})},vp=d.forwardRef(sI),yp=e=>{const{startFrom:t,endAt:n,trimBefore:r,trimAfter:o,name:i,pauseWhenBuffering:s,stack:a,showInTimeline:l,...u}=e,f=Ye(),p=Rs(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=d.useCallback(()=>{},[]);if(typeof e.src!="string")throw new TypeError(`The \`<OffthreadVideo>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);lu({startFrom:t,endAt:n,trimBefore:r,trimAfter:o});const{trimBeforeValue:h,trimAfterValue:x}=uu({startFrom:t,endAt:n,trimBefore:r,trimAfter:o});if(typeof h<"u"||typeof x<"u")return c.jsx(dt,{layout:"none",from:0-(h??0),showInTimeline:!1,durationInFrames:x,name:i,children:c.jsx(yp,{pauseWhenBuffering:p,...u,trimAfter:void 0,name:void 0,showInTimeline:l,trimBefore:void 0,stack:void 0,startFrom:void 0,endAt:void 0})});if(au(e,"Video"),f.isRendering)return c.jsx(iI,{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:k,onAutoPlayError:y,onVideoFrame:g,crossOrigin:w,delayRenderRetries:b,delayRenderTimeoutInMilliseconds:S,...C}=u;return c.jsx(vp,{_remotionInternalStack:a??null,onDuration:m,onlyWarnForMediaSeekingError:!0,pauseWhenBuffering:p,showInTimeline:l??!0,onAutoPlayError:y??void 0,onVideoFrame:g??null,crossOrigin:w,...C,_remotionInternalNativeLoopPassed:!1})},ix=({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:x,preservePitch:v,showInTimeline:k,style:y,toneFrequency:g,toneMapped:w,transparent:b,trimAfter:S,trimBefore:C,useWebAudioApi:E,volume:T,_remotionInternalNativeLoopPassed:_,endAt:j,stack:A,startFrom:z,imageFormat:$,...M})=>{if($)throw new TypeError("The `<OffthreadVideo>` tag does no longer accept `imageFormat`. Use the `transparent` prop if you want to render a transparent video.");return c.jsx(yp,{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:Rs(h),playbackRate:x??1,preservePitch:v,toneFrequency:g??1,showInTimeline:k??!0,src:e,stack:A,startFrom:z,_remotionInternalNativeLoopPassed:_??!1,endAt:j,style:y,toneMapped:w??!0,transparent:b??!1,trimAfter:S,trimBefore:C,useWebAudioApi:E??!1,volume:T,...M})};Ct(ix);var aI="remotion_staticFilesChanged";function lI(){const e=te.useContext(ei),t=te.useContext(ri),n=te.useContext(ni),r=te.useContext(et),o=te.useContext(Es),i=te.useContext(Jr),s=te.useContext(su),a=te.useContext(Zl),l=te.useContext(no),u=te.useContext(ii),f=te.useContext(ql),p=te.useContext(Jl),m=te.useContext(ui),h=te.useContext(eo);return d.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 uI=e=>{const{children:t,contexts:n}=e;return c.jsx(eo.Provider,{value:n.logLevelContext,children:c.jsx(Jr.Provider,{value:n.canUseRemotionHooksContext,children:c.jsx(Es.Provider,{value:n.nonceContext,children:c.jsx(su.Provider,{value:n.preloadContext,children:c.jsx(ei.Provider,{value:n.compositionManagerCtx,children:c.jsx(ql.Provider,{value:n.sequenceManagerRefContext,children:c.jsx(ii.Provider,{value:n.sequenceManagerContext,children:c.jsx(Jl.Provider,{value:n.visualModePropStatusesRefContext,children:c.jsx(no.Provider,{value:n.renderAssetManagerContext,children:c.jsx(Zl.Provider,{value:n.resolveCompositionContext,children:c.jsx(ri.Provider,{value:n.timelineContext,children:c.jsx(ni.Provider,{value:n.setTimelineContext,children:c.jsx(et.Provider,{value:n.sequenceContext,children:c.jsx(ui.Provider,{value:n.bufferManagerContext,children:t})})})})})})})})})})})})})})},cI=d.createRef(),se={MaxMediaCacheSizeContext:D2,useUnsafeVideoConfig:Gl,useFrameForVolumeProp:li,useTimelinePosition:Tr,useAbsoluteTimelinePosition:O0,evaluateVolume:oo,getAbsoluteSrc:En,getAnimatedImageDurationInSeconds:M2,getAssetDisplayName:Aw,Timeline:_d,validateMediaTrimProps:lu,validateMediaProps:au,resolveTrimProps:uu,VideoForPreview:vp,CompositionManager:ei,CompositionSetters:ks,VisualModePropStatusesContext:Ql,VisualModePropStatusesRefContext:Jl,VisualModeDragOverridesContext:eu,VisualModeSettersContext:G0,SequenceManager:ii,SequenceManagerRefContext:ql,SequenceStackTracesUpdateContext:q2,baseSchema:Un,sequenceSchema:Go,SequenceWithoutSchema:yw,sequenceStyleSchema:U0,sequenceVisualStyleSchema:Wk,sequencePremountSchema:H0,textSchema:Xl,transformSchema:In,premountSchema:oi,flattenActiveSchema:rp,getFlatSchemaWithAllKeys:op,RemotionRootContexts:Z2,CompositionManagerProvider:A2,useVideo:Kl,getRoot:B2,useMediaVolumeState:dp,usePlayerMutedState:fp,useMediaInTimeline:lp,useLazyComponent:P0,truthy:ti,SequenceContext:et,PremountContext:q0,usePremounting:_s,useRemotionContexts:lI,RemotionContextProvider:uI,CSSUtils:ex,setupEnvVariables:J2,MediaVolumeContext:up,SetMediaVolumeContext:cp,getRemotionEnvironment:Xt,SharedAudioContext:ai,SharedAudioContextProvider:jw,SharedAudioTagsContext:cu,SharedAudioTagsContextProvider:Fw,invalidCompositionErrorMessage:Fk,invalidFolderNameErrorMessage:tk,calculateMediaDuration:ou,isCompositionIdValid:F0,isFolderNameValid:x0,getPreviewDomElement:z2,compositionsRef:Jw,portalNode:Td,waitForRoot:V2,SetTimelineContext:ni,CanUseRemotionHooksProvider:kd,CanUseRemotionHooks:Jr,PrefetchProvider:Rw,DurationsContextProvider:Pw,IsPlayerContextProvider:ik,useIsPlayer:Wf,EditorPropsProvider:E0,EditorPropsContext:Hf,usePreload:ro,NonceContext:Es,resolveVideoConfig:rx,resolveVideoConfigOrCatch:X2,resolveVideoConfigWithMetadataOrCatch:G2,ResolveCompositionContext:Zl,useResolvedVideoConfig:Uf,resolveCompositionsRef:hk,REMOTION_STUDIO_CONTAINER_ELEMENT:tx,RenderAssetManager:no,persistCurrentFrame:A0,usePlaybackRate:Xf,useTimelineContext:Ir,useTimelineSetFrame:B0,isIosSafari:du,WATCH_REMOTION_STATIC_FILES:aI,addSequenceStackTraces:Ct,useMediaStartsAt:Kr,BufferingProvider:Lw,BufferingContextReact:ui,getComponentsToAddStacksTo:Nk,getSequenceComponent:zk,getSingleChildComponent:Dk,CurrentScaleContext:eI,PixelDensityContext:rI,PreviewSizeContext:tI,calculateScale:nI,validateRenderAsset:Iw,Log:rt,LogLevelContext:eo,useLogLevel:Cn,playbackLogging:vt,timeValueRef:mk,compositionSelectorRef:cI,RemotionEnvironmentContext:C0,warnAboutTooHighVolume:ci,AudioForPreview:Ww,OBJECTFIT_CONTAIN_CLASS_NAME:hs,InnerOffthreadVideo:yp,useBasicMediaInTimeline:Nw,getInputPropsOverride:k0,setInputPropsOverride:dk,useVideoEnabled:W2,useAudioEnabled:H2,useIsPlayerBuffering:zw,TimelinePosition:_d,DelayRenderContextType:_0,TimelineContext:ri,PlaybackRateContext:Yf,AbsoluteTimeContext:Kf,RenderAssetManagerProvider:SC,getEffectiveVisualModeValue:cw,CompositionRenderErrorContext:y0,useEffectChainState:Ms,createEffectChainState:Sw,cleanupEffectChainState:jd,runEffectChain:$s,useMemoizedEffects:Fs,useMemoizedEffectDefinitions:js,createEffect:wC,createWebGLContextError:rC,createWebGL2ContextError:bw,computeEffectiveSchemaValuesDotNotation:hw,interpolateKeyframedStatus:Ps,makeStaticDragOverride:HE,makeKeyframedDragOverride:UE,resolveDragOverrideValue:nu,getStaticDragOverrideValue:ZE,OverrideIdsToNodePathsGettersContext:np,OverrideIdsToNodePathsSettersContext:OE,findPropsToDelete:pw,makeSequencePropsSubscriptionKey:Mn,getPropStatusesCtx:fw,getEffectPropStatusesCtx:dw,hiddenField:qf,durationInFramesField:Jf,freezeField:ep,fromField:Y0},sx=e=>te.Children.toArray(e).reduce((n,r)=>r.type===te.Fragment?n.concat(sx(r.props.children)):(n.push(r),n),[]),dI={durationInFrames:tr.baseSchema.durationInFrames,name:tr.sequenceSchema.name,hidden:tr.sequenceSchema.hidden,showInTimeline:tr.sequenceSchema.showInTimeline,freeze:tr.baseSchema.freeze,trimBefore:tr.sequenceSchema.trimBefore,layout:tr.sequenceSchema.layout},fI=d.forwardRef(({offset:e=0,className:t="",stack:n=null,_remotionInternalRender:r=null,...o},i)=>(Xk(),r?r({...o,offset:e,className:t||void 0,stack:n},i):c.jsx(X0,{children:o.children}))),ax=tr.withSchema({Component:fI,componentName:"<Series.Sequence>",componentIdentity:"dev.remotion.remotion.Series.Sequence",schema:dI,supportsEffects:!1}),pI=yw,Ih=({durationInFrames:e,offset:t,index:n,childrenLength:r})=>{const o=`index = ${n}, duration = ${e}`;(n!==r-1||e!==1/0)&&Hl(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},mI=e=>{const t=d.useMemo(()=>{const n=sx(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!==ax)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 Ih({durationInFrames:l.props.durationInFrames,offset:l.props.offset,index:o,childrenLength:n.length}),te.cloneElement(l,{_remotionInternalRender:(u,f)=>{const p=u.durationInFrames,{durationInFrames:m,children:h,offset:x,controls:v,stack:k,from:y,name:g,...w}=u,b=Ih({durationInFrames:p,offset:x,index:o,childrenLength:n.length}),S=i+b,C=i+p+b;return c.jsxs(c.Fragment,{children:[c.jsx(pI,{ref:f,name:g||"<Series.Sequence>",_remotionInternalDocumentationLink:g?void 0:"https://www.remotion.dev/docs/series",_remotionInternalStack:k??void 0,controls:v??void 0,from:S,durationInFrames:p,...w,children:c.jsx(X0,{children:h})}),r(o+1,C)]})}})};return r(0,0)},[e.children]);return c.jsx(Gk,{children:c.jsx(dt,{layout:"none",name:"<Series>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/series",...e,children:t})})},hI=Object.assign(Zn({Component:mI,componentName:"<Series>",componentIdentity:"dev.remotion.remotion.Series",schema:Yk,supportsEffects:!1}),{Sequence:ax});Ct(hI);var gI={"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";"},Th={},vI=e=>{Th[e]||(console.warn(e),Th[e]=!0)},yI=e=>{for(const t of Object.keys(gI))if(e.includes(t))return{containsHex:!0,hexCode:t};return{containsHex:!1}},Ad=e=>e.startsWith("/")?Ad(e.substring(1)):e,wI=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}/${Ad(e)}`}return`/${Ad(e)}`},xI=e=>e.split("/").map(o=>encodeURIComponent(o)).join("/"),wp=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=yI(e);t.containsHex&&vI(`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=xI(e),r=wI(n);return r.startsWith("/")?r:`/${r}`},bI=e=>{const t={...e,durationInFrames:1,fps:1};return te.createElement(hl,t)};Ct(bI);var Rh=e=>Math.round(e*1e5)/1e5,ac=({element:e,desiredTime:t,logLevel:n,mountTime:r})=>{if(wl(e.currentTime,t))return{wait:Promise.resolve(t),cancel:()=>{}};Ba({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)}}},SI=({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=ac({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,x=ac({element:e,desiredTime:p+i*h,logLevel:r,mountTime:o});s=x.cancel,x.wait.then(v=>{const k=Math.abs(t-v);if(Rh(k)<=Rh(i))return l();const y=ac({element:e,desiredTime:t+i,logLevel:r,mountTime:o});return s=y.cancel,y.wait.then(()=>{l()}).catch(g=>{u(g)})}).catch(v=>{u(v)})}),s=f.cancel}),cancel:()=>{s()}}},kI=({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,...x},v)=>{const k=Tr(),y=ct(),g=li(f??"repeat"),w=Gl(),b=d.useRef(null),S=d.useContext(et),C=Kr(),E=Ye(),T=Cn(),_=Is(),{delayRender:j,continueRender:A}=mn(),{registerRenderAsset:z,unregisterRenderAsset:$}=d.useContext(no),M=d.useMemo(()=>`video-${to(x.src??"")}-${S==null?void 0:S.cumulatedFrom}-${S==null?void 0:S.relativeFrom}-${S==null?void 0:S.durationInFrames}`,[x.src,S==null?void 0:S.cumulatedFrom,S==null?void 0:S.relativeFrom,S==null?void 0:S.durationInFrames]);if(!w)throw new Error("No video config found");const W=oo({volume:t,frame:g,mediaVolume:1});ci(W),d.useEffect(()=>{if(!x.src)throw new Error("No src passed");if(!x.muted&&!(W<=0)&&window.remotion_audioEnabled)return z({type:"video",src:En(x.src),id:M,frame:k,volume:W,mediaFrame:y,playbackRate:r??1,toneFrequency:i??1,audioStartFrame:Math.max(0,-((S==null?void 0:S.cumulatedNegativeFrom)??0)),audioStreamIndex:p??0}),()=>$(M)},[x.muted,x.src,z,M,$,W,y,k,r,i,S==null?void 0:S.cumulatedNegativeFrom,p]),d.useImperativeHandle(v,()=>b.current,[]),ox({ref:b,onVideoFrame:m}),d.useEffect(()=>{var K,N;if(!window.remotion_videoEnabled)return;const{current:R}=b;if(!R)return;const I=Ow({frame:y,playbackRate:r||1,startFrom:-C,fps:w.fps}),P=j(`Rendering <Html5Video /> with src="${x.src}" at time ${I}`,{retries:l??void 0,timeoutInMilliseconds:u??void 0});if(((N=(K=window.process)==null?void 0:K.env)==null?void 0:N.NODE_ENV)==="test"){A(P);return}if(wl(R.currentTime,I)){if(R.readyState>=2){A(P);return}const L=()=>{A(P)};return R.addEventListener("loadeddata",L,{once:!0}),()=>{R.removeEventListener("loadeddata",L)}}const F=()=>{A(P)},O=SI({element:R,desiredTime:I,fps:w.fps,logLevel:T,mountTime:_});O.prom.then(()=>{A(P)}),R.addEventListener("ended",F,{once:!0});const H=()=>{var L;if(R!=null&&R.error){if(console.error("Error occurred in video",R==null?void 0:R.error),e)return;throw new jo({message:`The browser threw an error while playing the video ${x.src}: Code ${R.error.code} - ${(L=R==null?void 0:R.error)==null?void 0:L.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,src:x.src})}else throw new jo({message:"The browser threw an error",src:x.src})};return R.addEventListener("error",H,{once:!0}),()=>{O.cancel(),R.removeEventListener("ended",F),R.removeEventListener("error",H),A(P)}},[g,x.src,r,w.fps,y,C,e,l,u,T,_,A,j]);const{src:D}=x;return E.isRendering&&d.useLayoutEffect(()=>{var F,O;if(((O=(F=window.process)==null?void 0:F.env)==null?void 0:O.NODE_ENV)==="test")return;const R=j("Loading <Html5Video> duration with src="+D,{retries:l??void 0,timeoutInMilliseconds:u??void 0}),{current:I}=b,P=()=>{I!=null&&I.duration&&o(D,I.duration),A(R)};return I!=null&&I.duration?(o(D,I.duration),A(R)):I==null||I.addEventListener("loadedmetadata",P,{once:!0}),()=>{I==null||I.removeEventListener("loadedmetadata",P),A(R)}},[D,o,l,u,A,j]),c.jsx("video",{ref:b,disableRemotePlayback:!0,...x})},EI=d.forwardRef(kI),CI=(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:x,...v}=e,{fps:k}=Xe(),y=Ye(),g=Rs(a);if(y.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:w,setDurations:b}=d.useContext(ip);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 S=ro(e.src),C=d.useCallback((j,A)=>{b({type:"got-duration",durationInSeconds:A,src:j})},[b]),E=w[En(S)]??w[En(e.src)];lu({startFrom:n,endAt:r,trimBefore:o,trimAfter:i});const{trimBeforeValue:T,trimAfterValue:_}=uu({startFrom:n,endAt:r,trimBefore:o,trimAfter:i});if(x&&E!==void 0){if(!Number.isFinite(E))return c.jsx(Wa,{...v,ref:t,stack:l,_remotionInternalNativeLoopPassed:!0});const j=E*k;return c.jsx(iu,{durationInFrames:ou({trimAfter:_,mediaDurationInFrames:j,playbackRate:e.playbackRate??1,trimBefore:T}),layout:"none",name:s,showInTimeline:!1,children:c.jsx(Wa,{...v,ref:t,stack:l,_remotionInternalNativeLoopPassed:!0})})}return typeof T<"u"||typeof _<"u"?c.jsx(dt,{layout:"none",from:0-(T??0),showInTimeline:!1,durationInFrames:_===void 0?void 0:_/(e.playbackRate??1),name:s,children:c.jsx(Wa,{pauseWhenBuffering:g,onVideoFrame:m,...h,ref:t,stack:l})}):(au({playbackRate:e.playbackRate,preservePitch:e.preservePitch,volume:e.volume},"Html5Video"),y.isRendering?c.jsx(EI,{onDuration:C,onVideoFrame:m??null,...h,ref:t}):c.jsx(vp,{onlyWarnForMediaSeekingError:!1,...h,ref:t,onVideoFrame:m??null,pauseWhenBuffering:g,onDuration:C,_remotionInternalStack:l??null,_remotionInternalNativeLoopPassed:u??!1,showInTimeline:f??!0,onAutoPlayError:p??void 0}))},Wa=d.forwardRef(CI);Ct(Wa);Ok();var II={},TI=new Proxy(II,{get(e,t){return t==="Bundling"||t==="Rendering"||t==="Log"||t==="Puppeteer"||t==="Output"?TI:()=>{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";Ct(dt);Lk(dt);Ct(hl);Ct(nk);typeof window<"u"&&(window.remotion_renderReady=!1,window.remotion_delayRenderTimeouts||(window.remotion_delayRenderTimeouts={}),window.remotion_delayRenderHandles=[]);var RI={"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}},_I={"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"}},PI={"style.backgroundColor":{type:"color",default:"transparent",description:"Color"}},jI={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}},FI={...jI},$I={...RI,...PI,..._I,...FI},MI={layout:{type:"enum",default:"absolute-fill",description:"Layout",variants:{"absolute-fill":$I,none:{}}}};({...MI.layout});var AI=(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 NI(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 LI(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 zI(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 pu={validateFps:zI,validateDimension:NI,validateDurationInFrames:LI,validateDefaultAndInputProps:AI};if(typeof d.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
+ `))}var lt=25,Nd=16,DI=()=>c.jsx("svg",{width:lt,height:lt,viewBox:"0 0 25 25",fill:"none",children:c.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"})}),OI=()=>c.jsxs("svg",{viewBox:"0 0 100 100",width:lt,height:lt,children:[c.jsx("rect",{x:"25",y:"20",width:"20",height:"60",fill:"#fff",ry:"5",rx:"5"}),c.jsx("rect",{x:"55",y:"20",width:"20",height:"60",fill:"#fff",ry:"5",rx:"5"})]}),BI=({isFullscreen:e})=>{const r=e?0:3,o=e?6*1.6:6/2,i=e?6*1.6:6*2;return c.jsxs("svg",{viewBox:"0 0 32 32",height:Nd,width:Nd,children:[c.jsx("path",{d:`
81
+ M ${r} ${i}
82
+ L ${o} ${o}
83
+ L ${i} ${r}
84
+ `,stroke:"#fff",strokeWidth:6,fill:"none"}),c.jsx("path",{d:`
85
+ M ${32-r} ${i}
86
+ L ${32-o} ${o}
87
+ L ${32-i} ${r}
88
+ `,stroke:"#fff",strokeWidth:6,fill:"none"}),c.jsx("path",{d:`
89
+ M ${r} ${32-i}
90
+ L ${o} ${32-o}
91
+ L ${i} ${32-r}
92
+ `,stroke:"#fff",strokeWidth:6,fill:"none"}),c.jsx("path",{d:`
93
+ M ${32-r} ${32-i}
94
+ L ${32-o} ${32-o}
95
+ L ${32-i} ${32-r}
96
+ `,stroke:"#fff",strokeWidth:6,fill:"none"})]})},VI=()=>c.jsx("svg",{width:lt,height:lt,viewBox:"0 0 24 24",children:c.jsx("path",{d:"M3.63 3.63a.996.996 0 000 1.41L7.29 8.7 7 9H4c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71v-4.17l4.18 4.18c-.49.37-1.02.68-1.6.91-.36.15-.58.53-.58.92 0 .72.73 1.18 1.39.91.8-.33 1.55-.77 2.22-1.31l1.34 1.34a.996.996 0 101.41-1.41L5.05 3.63c-.39-.39-1.02-.39-1.42 0zM19 12c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-3.83-2.4-7.11-5.78-8.4-.59-.23-1.22.23-1.22.86v.19c0 .38.25.71.61.85C17.18 6.54 19 9.06 19 12zm-8.71-6.29l-.17.17L12 7.76V6.41c0-.89-1.08-1.33-1.71-.7zM16.5 12A4.5 4.5 0 0014 7.97v1.79l2.48 2.48c.01-.08.02-.16.02-.24z",fill:"#fff"})}),WI=()=>c.jsx("svg",{width:lt,height:lt,viewBox:"0 0 24 24",children:c.jsx("path",{d:"M3 10v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71V6.41c0-.89-1.08-1.34-1.71-.71L7 9H4c-.55 0-1 .45-1 1zm13.5 2A4.5 4.5 0 0014 7.97v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 4.45v.2c0 .38.25.71.6.85C17.18 6.53 19 9.06 19 12s-1.82 5.47-4.4 6.5c-.36.14-.6.47-.6.85v.2c0 .63.63 1.07 1.21.85C18.6 19.11 21 15.84 21 12s-2.4-7.11-5.79-8.4c-.58-.23-1.21.22-1.21.85z",fill:"#fff"})}),_h="__remotion_buffering_indicator",Ph="__remotion_buffering_animation",HI={width:lt,height:lt,overflow:"hidden",lineHeight:"normal",fontSize:"inherit"},UI={width:14,height:14,overflow:"hidden",lineHeight:"normal",fontSize:"inherit"},ZI=({type:e})=>{const t=e==="player"?HI:UI;return c.jsxs(c.Fragment,{children:[c.jsx("style",{type:"text/css",children:`
97
+ @keyframes ${Ph} {
98
+ 0% {
99
+ rotate: 0deg;
100
+ }
101
+ 100% {
102
+ rotate: 360deg;
103
+ }
104
+ }
105
+
106
+ .${_h} {
107
+ animation: ${Ph} 1s linear infinite;
108
+ }
109
+ `}),c.jsx("div",{style:t,children:c.jsx("svg",{viewBox:e==="player"?"0 0 22 22":"0 0 18 18",style:t,className:_h,children:c.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})})})]})},YI=({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},lx=({previewSize:e,compositionWidth:t,compositionHeight:n,canvasSize:r})=>{const o=se.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}},ux=({config:e,style:t,canvasSize:n,overflowVisible:r,layout:o})=>e?{position:"relative",overflow:r?"visible":"hidden",...YI({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}:{},cx=({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"}:{},dx=({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"}},fx=te.createContext(void 0),px=te.createContext(void 0);class KI{constructor(){Se(this,"listeners",{ended:[],error:[],pause:[],play:[],ratechange:[],scalechange:[],seeked:[],timeupdate:[],frameupdate:[],fullscreenchange:[],volumechange:[],mutechange:[],waiting:[],resume:[]});Se(this,"dispatchSeek",t=>{this.dispatchEvent("seeked",{frame:t})});Se(this,"dispatchVolumeChange",t=>{this.dispatchEvent("volumechange",{volume:t})});Se(this,"dispatchPause",()=>{this.dispatchEvent("pause",void 0)});Se(this,"dispatchPlay",()=>{this.dispatchEvent("play",void 0)});Se(this,"dispatchEnded",()=>{this.dispatchEvent("ended",void 0)});Se(this,"dispatchRateChange",t=>{this.dispatchEvent("ratechange",{playbackRate:t})});Se(this,"dispatchScaleChange",t=>{this.dispatchEvent("scalechange",{scale:t})});Se(this,"dispatchError",t=>{this.dispatchEvent("error",{error:t})});Se(this,"dispatchTimeUpdate",t=>{this.dispatchEvent("timeupdate",t)});Se(this,"dispatchFrameUpdate",t=>{this.dispatchEvent("frameupdate",t)});Se(this,"dispatchFullscreenChange",t=>{this.dispatchEvent("fullscreenchange",t)});Se(this,"dispatchMuteChange",t=>{this.dispatchEvent("mutechange",t)});Se(this,"dispatchWaiting",t=>{this.dispatchEvent("waiting",t)});Se(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 GI{constructor(){Se(this,"listeners",{error:[],waiting:[],resume:[]});Se(this,"dispatchError",t=>{this.dispatchEvent("error",{error:t})});Se(this,"dispatchWaiting",t=>{this.dispatchEvent("waiting",t)});Se(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 mx=e=>{const t=d.useContext(se.BufferingContextReact);if(!t)throw new Error("BufferingContextReact not found");d.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])},XI=({children:e,currentPlaybackRate:t})=>{const[n]=d.useState(()=>new KI);if(!d.useContext(se.BufferingContextReact))throw new Error("BufferingContextReact not found");return d.useEffect(()=>{t&&n.dispatchRateChange(t)},[n,t]),mx(n),c.jsx(fx.Provider,{value:n,children:e})},xp=(e,t)=>{const[n,r]=d.useState(!1);return d.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},mu=()=>{const[e,t,n]=se.Timeline.usePlayingState(),[r,o]=d.useState(!1),i=se.Timeline.useTimelinePosition(),s=d.useRef(i),a=se.Timeline.useTimelineSetFrame(),l=se.Timeline.useTimelineSetFrame(),u=d.useContext(se.SharedAudioContext),f=d.useContext(se.SharedAudioTagsContext),{audioAndVideoTags:p}=se.useTimelineContext(),m=d.useRef(i);m.current=i;const h=se.useVideo(),x=se.useUnsafeVideoConfig(),v=d.useContext(fx),k=((x==null?void 0:x.durationInFrames)??1)-1,y=i===k,g=i===0;if(!v)throw new TypeError("Expected Player event emitter context");const w=d.useContext(se.BufferingContextReact);if(!w)throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");const{buffering:b}=w,S=d.useCallback(R=>{const I=x?se.TimelinePosition.clampFrameToCompositionRange(R,x.durationInFrames):Math.max(0,R);h!=null&&h.id&&l(P=>({...P,[h.id]:I})),m.current=I,v.dispatchSeek(I)},[x,v,l,h==null?void 0:h.id]),C=d.useCallback(R=>{n.current||(o(!0),y&&S(0),u==null||u.resume(),f&&f.numberOfAudioTags>0&&R&&f.playAllAudios(),p.current.forEach(I=>I.play("player play() was called and playing audio from a click")),n.current=!0,t(!0),s.current=m.current,v.dispatchPlay())},[n,y,u,f,t,v,S,p]),E=d.useCallback(()=>{n.current&&(n.current=!1,t(!1),v.dispatchPause(),u==null||u.suspend())},[v,n,t,u]),T=d.useCallback(()=>{n.current&&(n.current=!1,m.current=s.current,x&&(l(R=>({...R,[x.id]:s.current})),t(!1),v.dispatchPause()))},[x,v,n,t,l]),_=h==null?void 0:h.id,j=d.useCallback(R=>{if(!_)return null;n.current||a(I=>{const P=I[_]??window.remotion_initialFrame??0,F=Math.max(0,P-R);return P===F?I:{...I,[_]:F}})},[n,a,_]),A=d.useCallback(R=>{if(!_)return null;n.current||a(I=>{const P=I[_]??window.remotion_initialFrame??0,F=Math.min(k,P+R);return P===F?I:{...I,[_]:F}})},[_,n,k,a]),z=d.useCallback(R=>{n.current?E():C(R)},[n,E,C]),$=d.useCallback(()=>n.current,[n]),M=d.useCallback(()=>m.current,[m]),W=d.useCallback(()=>b.current,[b]);return d.useMemo(()=>({frameBack:j,frameForward:A,isLastFrame:y,emitter:v,playing:e,play:C,pause:E,seek:S,isFirstFrame:g,getCurrentFrame:M,isPlaying:$,isBuffering:W,pauseAndReturnToPlayStart:T,hasPlayed:r,toggle:z}),[v,j,A,r,g,y,M,E,T,C,e,S,z,$,W])},qI=({browserMediaControlsBehavior:e,videoConfig:t,playbackRate:n})=>{const{playing:r,pause:o,play:i,emitter:s,getCurrentFrame:a,seek:l}=mu(),u=d.useRef(!1);d.useEffect(()=>{r&&(u.current=!0)},[r]),d.useEffect(()=>{navigator.mediaSession&&e.mode!=="do-nothing"&&(r?navigator.mediaSession.playbackState="playing":u.current&&(navigator.mediaSession.playbackState="paused"))},[e.mode,r]),d.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]),d.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])},QI=({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}},jh=()=>typeof document>"u"?!1:document.visibilityState==="hidden",JI=()=>{const e=d.useRef(jh());return d.useEffect(()=>{const t=()=>{e.current=jh()};return document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[]),e},eT=.1,Fh=({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)<eT+f&&!i||Math.abs(a)<Number.EPSILON?!1:(se.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)},tT=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}`)},nT=({loop:e,playbackRate:t,moveToBeginningWhenEnded:n,inFrame:r,outFrame:o,browserMediaControlsBehavior:i,getCurrentFrame:s,muted:a})=>{const l=se.useUnsafeVideoConfig(),u=se.Timeline.useTimelinePosition(),{playing:f,pause:p,emitter:m,isPlaying:h}=mu(),x=se.Timeline.useTimelineSetFrame(),v=d.useContext(se.SharedAudioContext),k=se.useLogLevel(),y=JI(),g=d.useRef(0),w=d.useContext(se.BufferingContextReact);if(!w)throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");qI({browserMediaControlsBehavior:i,playbackRate:t,videoConfig:l}),d.useLayoutEffect(()=>{if(!v||!v.audioContext||!l||a)return;Fh({audioContext:v.audioContext,audioSyncAnchor:v.audioSyncAnchor,absoluteTimeInSeconds:u/l.fps,globalPlaybackRate:t,logLevel:k,force:!1})&&v.audioSyncAnchorEmitter.dispatch("changed")},[l,u,k,t,v,a]),d.useLayoutEffect(()=>{const b=v==null?void 0:v.audioContext;if(!b||!l||a)return;const S=()=>{const C=v==null?void 0:v.getAudioContextState();C&&tT(C)&&Fh({audioContext:b,audioSyncAnchor:v.audioSyncAnchor,absoluteTimeInSeconds:s()/l.fps,globalPlaybackRate:t,logLevel:k,force:!0})};return b==null||b.addEventListener("statechange",S),()=>{b==null||b.removeEventListener("statechange",S)}},[l,s,k,a,t,v]),d.useEffect(()=>{var $;if(!l)return;if(!f){($=v==null?void 0:v.suspend)==null||$.call(v);return}let b=!1,S=null,C=performance.now(),E=0;const T=()=>{S!==null&&(S.type==="raf"?cancelAnimationFrame(S.id):clearTimeout(S.id))},_=()=>{b=!0,T()},j=()=>{var O,H;if(b)return;if(!h()){(O=v==null?void 0:v.suspend)==null||O.call(v);return}!a&&!w.buffering.current&&((H=v==null?void 0:v.resume)==null||H.call(v));const M=performance.now()-C,W=o??l.durationInFrames-1,D=r??0,R=s(),{nextFrame:I,framesToAdvance:P,hasEnded:F}=QI({time:M,currentFrame:R,playbackSpeed:t,fps:l.fps,actualFirstFrame:D,actualLastFrame:W,framesAdvanced:E,shouldLoop:e});if(E+=P,I!==s()&&(!F||n)&&!w.buffering.current&&x(K=>({...K,[l.id]:I})),F){_(),p(),m.dispatchEnded();return}A()},A=()=>{var W,D;const M=((W=v==null?void 0:v.getIsResumingAudioContext)==null?void 0:W.call(v))??null;if(M!==null&&!a){M.then(()=>{C=performance.now(),E=0,A()});return}if(w.buffering.current){a||(D=v==null?void 0:v.suspend)==null||D.call(v);const R=w.listenForResume(()=>{R.remove(),C=performance.now(),E=0,A()});return}if(y.current){S={type:"timeout",id:setTimeout(j,1e3/l.fps)};return}S={type:"raf",id:requestAnimationFrame(j)}};A();const z=()=>{document.visibilityState!=="visible"&&(T(),j())};return window.addEventListener("visibilitychange",z),()=>{window.removeEventListener("visibilitychange",z),_()}},[l,e,p,f,x,m,t,r,o,n,y,s,w,h,v,k,a]),d.useEffect(()=>{const b=performance.now(),S=b-g.current;if(S>=250){m.dispatchTimeUpdate({frame:u}),g.current=b;return}const C=setTimeout(()=>{m.dispatchTimeUpdate({frame:u}),g.current=performance.now()},250-S);return()=>clearTimeout(C)},[m,u]),d.useEffect(()=>{m.dispatchFrameUpdate({frame:u})},[m,u])},lc=[],uc=e=>e?"current"in e?e.current:e:null,bp=(e,t)=>{const[n,r]=d.useState(()=>{const s=uc(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=d.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(x=>x&&x.width===m&&x.height===h&&x.left===u[0].x&&x.top===u[0].y&&x.windowSize.height===window.innerHeight&&x.windowSize.width===window.innerWidth?x:{width:m,height:h,left:u[0].x,top:u[0].y,windowSize:{height:window.innerHeight,width:window.innerWidth}})}),[t.shouldApplyCssTransforms]),i=d.useCallback(()=>{const s=uc(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 d.useEffect(()=>{i()},[i]),d.useEffect(()=>{if(!o)return;const s=uc(e);return s&&o.observe(s),()=>{s&&o.unobserve(s)}},[o,e]),d.useEffect(()=>{if(t.triggerOnWindowResize)return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[t.triggerOnWindowResize,i]),d.useEffect(()=>(lc.push(i),()=>{lc=lc.filter(s=>s!==i)}),[i]),d.useMemo(()=>n?{...n,refresh:i}:null,[n,i])},Sp=e=>e??"__remotion-player",rT={display:"flex",justifyContent:"center",alignItems:"center",flex:1,height:"100%",width:"100%"};class hx extends te.Component{constructor(){super(...arguments);Se(this,"state",{hasError:null})}static getDerivedStateFromError(n){return{hasError:n}}componentDidCatch(n){this.props.onError(n)}render(){return this.state.hasError?c.jsx("div",{style:rT,children:this.props.errorFallback({error:this.state.hasError})}):this.props.children}}var oT=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}},cc={backgroundColor:"red",position:"absolute",padding:12,fontFamily:"Arial"},iT=["28d262b44cc61fa750f1686b16ad0604dabfe193fbc263eec05c89b7ad4c2cd6","4db1b0a94be33165dfefcb3ba03d04c7a2666dd27c496d3dc9fa41858e94925e","fbc48530bbf245da790f63675e84e06bab38c3b114fab07eb350025119922bdc","7baf10a8932757b1b3a22b3fce10a048747ac2f8eaf638603487e3705b07eb83","8a6c21a598d8c667272b5207c051b85997bf5b45d5fb712378be3f27cd72c6a6","a2f7aaac9c50a9255e7fc376110c4e0bfe153722dc66ed3c5d3bf2a135f65518"],$h=!1,sT=()=>{const[e,t]=te.useState(!1);return d.useEffect(()=>{$h||($h=!0,oT().then(n=>{n&&iT.includes(n)&&t(!0)}).catch(()=>{}))},[]),d.useEffect(()=>{if(!e)return;const n=()=>{if(!document.querySelector(".warning-banner")){const i=document.createElement("div");i.className="warning-banner",Object.assign(i.style,cc,{zIndex:"9999",cssText:`${cc.cssText} !important;`}),i.innerHTML=`
110
+ <a href="https://github.com/remotion-dev/remotion/pull/4589" style="color: white;">
111
+ Remotion Unlicensed – Contact hi@remotion.dev
112
+ </a>
113
+ `,document.body.appendChild(i)}},r=new MutationObserver(()=>n());return r.observe(document.body,{childList:!0,subtree:!0}),()=>{r.disconnect()}},[e]),e?c.jsx("div",{style:cc,className:"warning-banner",children:c.jsx("a",{style:{color:"white"},href:"https://github.com/remotion-dev/remotion/pull/4589",children:"Remotion Unlicensed – Contact hi@remotion.dev"})}):null},Mh=({playing:e,buffering:t})=>e&&t?c.jsx(ZI,{type:"player"}):e?c.jsx(OI,{}):c.jsx(DI,{}),po=12,Ah=5,aT=({volume:e,isVertical:t,onBlur:n,inputRef:r,setVolume:o})=>{const i=d.useMemo(()=>{const m={paddingLeft:5,height:lt,width:Dr,display:"inline-flex",alignItems:"center"};return t?{...m,position:"absolute",transform:`rotate(-90deg) translateX(${Dr/2+lt/2}px)`}:{...m}},[t]),s=typeof te.useId>"u"?"volume-slider":te.useId(),[a]=d.useState(()=>`__remotion-volume-slider-${to(s)}`.replace(".","")),l=d.useCallback(p=>{o(parseFloat(p.target.value))},[o]),u=d.useMemo(()=>{const p={WebkitAppearance:"none",backgroundColor:"rgba(255, 255, 255, 0.5)",borderRadius:Ah/2,cursor:"pointer",height:Ah,width:Dr,backgroundImage:`linear-gradient(
114
+ to right,
115
+ white ${e*100}%, rgba(255, 255, 255, 0) ${e*100}%
116
+ )`};return t?{...p,bottom:lt+Dr/2}:p},[t,e]),f=`
117
+ .${a}::-webkit-slider-thumb {
118
+ -webkit-appearance: none;
119
+ background-color: white;
120
+ border-radius: ${po/2}px;
121
+ box-shadow: 0 0 2px black;
122
+ height: ${po}px;
123
+ width: ${po}px;
124
+ }
125
+
126
+ .${a}::-moz-range-thumb {
127
+ -webkit-appearance: none;
128
+ background-color: white;
129
+ border-radius: ${po/2}px;
130
+ box-shadow: 0 0 2px black;
131
+ height: ${po}px;
132
+ width: ${po}px;
133
+ }
134
+ `;return c.jsxs("div",{style:i,children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:f}}),c.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})]})},lT=e=>c.jsx(aT,{...e}),Dr=100,uT=({displayVerticalVolumeSlider:e,renderMuteButton:t,renderVolumeSlider:n})=>{const[r,o]=se.usePlayerMutedState(),[i,s]=se.useMediaVolumeState(),[a,l]=d.useState(!1),u=d.useRef(null),f=d.useRef(null),p=xp(u,!1),m=d.useCallback(()=>{setTimeout(()=>{f.current&&document.activeElement!==f.current&&l(!1)},10)},[]),h=i===0,x=d.useCallback(()=>{if(h){s(1),o(!1);return}o(b=>!b)},[h,o,s]),v=d.useMemo(()=>({display:"inline-flex",background:"none",border:"none",justifyContent:"center",alignItems:"center",touchAction:"none",...e&&{position:"relative"}}),[e]),k=d.useMemo(()=>({display:"inline",width:lt,height:lt,cursor:"pointer",appearance:"none",background:"none",border:"none",padding:0}),[]),y=d.useCallback(({muted:b,volume:S})=>{const C=b||S===0;return c.jsx("button",{"aria-label":C?"Unmute sound":"Mute sound",title:C?"Unmute sound":"Mute sound",onClick:x,onBlur:m,onFocus:()=>l(!0),style:k,type:"button",children:C?c.jsx(VI,{}):c.jsx(WI,{})})},[m,x,k]),g=d.useMemo(()=>t?t({muted:r,volume:i}):y({muted:r,volume:i}),[r,i,y,t]),w=d.useMemo(()=>(a||p)&&!r&&!se.isIosSafari()?(n??lT)({isVertical:e,volume:i,onBlur:()=>l(!1),inputRef:f,setVolume:s}):null,[e,a,p,r,i,n,s]);return c.jsxs("div",{ref:u,style:v,children:[g,w]})};function cT(e){const[t,n]=d.useState(e),r=d.useRef(null);return d.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 dT=35,fT=70,pT={height:30,paddingRight:15,paddingLeft:12,display:"flex",flexDirection:"row",alignItems:"center"},mT={width:22,display:"flex",alignItems:"center"},hT={width:14,height:14,color:"black"},gT=()=>c.jsx("svg",{viewBox:"0 0 512 512",style:hT,children:c.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"})}),vT=e=>{const t=e.toString();return t.includes(".")?t:t+".0"},yT=({rate:e,onSelect:t,selectedRate:n,keyboardSelectedRate:r})=>{const o=d.useCallback(p=>{p.stopPropagation(),p.preventDefault(),t(e)},[t,e]),[i,s]=d.useState(!1),a=d.useCallback(()=>{s(!0)},[]),l=d.useCallback(()=>{s(!1)},[]),u=r===e,f=d.useMemo(()=>({...pT,backgroundColor:i||u?"#eee":"transparent"}),[i,u]);return c.jsxs("div",{onPointerEnter:a,onPointerLeave:l,tabIndex:0,style:f,onClick:o,children:[c.jsx("div",{style:mT,children:e===n?c.jsx(gT,{}):null}),vT(e),"x"]},e)},wT=({setIsComponentVisible:e,playbackRates:t,canvasSize:n})=>{const{setPlaybackRate:r,playbackRate:o}=se.usePlaybackRate(),[i,s]=d.useState(o);d.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=d.useCallback(u=>{r(u),e(!1)},[e,r]),l=d.useMemo(()=>({position:"absolute",right:0,width:125,maxHeight:n.height-fT-dT,bottom:35,background:"#fff",borderRadius:4,overflow:"auto",color:"black",textAlign:"left"}),[n.height]);return c.jsx("div",{style:l,children:t.map(u=>c.jsx(yT,{selectedRate:o,onSelect:a,rate:u,keyboardSelectedRate:i},u))})},xT={fontSize:13,fontWeight:"bold",color:"white",border:"2px solid white",borderRadius:20,paddingLeft:8,paddingRight:8,paddingTop:2,paddingBottom:2},Ld={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"},bT={...Ld,position:"relative"},ST=({playbackRates:e,canvasSize:t})=>{const{ref:n,isComponentVisible:r,setIsComponentVisible:o}=cT(!1),{playbackRate:i}=se.usePlaybackRate(),s=d.useCallback(a=>{a.stopPropagation(),a.preventDefault(),o(l=>!l)},[o]);return c.jsx("div",{ref:n,children:c.jsxs("button",{type:"button","aria-label":"Change playback rate",style:bT,onClick:s,children:[c.jsxs("div",{style:xT,children:[i,"x"]}),r&&c.jsx(wT,{canvasSize:t,playbackRates:e,setIsComponentVisible:o})]})})},Nh=(e,t,n)=>Math.round(si(e,[0,n],[0,t-1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"})),Fo=5,Ri=12,zd=4,kT={userSelect:"none",WebkitUserSelect:"none",paddingTop:zd,paddingBottom:zd,boxSizing:"border-box",cursor:"pointer",position:"relative",touchAction:"none"},ET={height:Fo,backgroundColor:"rgba(255, 255, 255, 0.25)",width:"100%",borderRadius:Fo/2},CT=e=>{let t=e;for(;t.parentElement;)t=t.parentElement;return t},IT=({durationInFrames:e,onSeekEnd:t,onSeekStart:n,inFrame:r,outFrame:o})=>{const i=d.useRef(null),s=xp(i,!1),a=bp(i,{triggerOnWindowResize:!0,shouldApplyCssTransforms:!0}),{seek:l,play:u,pause:f,playing:p}=mu(),m=se.Timeline.useTimelinePosition(),[h,x]=d.useState({dragging:!1}),v=(a==null?void 0:a.width)??0,k=d.useCallback(C=>{var _;if(C.button!==0)return;const E=(_=i.current)==null?void 0:_.getBoundingClientRect().left,T=Nh(C.clientX-E,e,v);f(),l(T),x({dragging:!0,wasPlaying:p}),n()},[e,v,f,l,p,n]),y=d.useCallback(C=>{var _;if(!a)throw new Error("Player has no size");if(!h.dragging)return;const E=(_=i.current)==null?void 0:_.getBoundingClientRect().left,T=Nh(C.clientX-E,e,a.width);l(T)},[h.dragging,e,l,a]),g=d.useCallback(()=>{x({dragging:!1}),h.dragging&&(h.wasPlaying?u():f(),t())},[h,t,f,u]);d.useEffect(()=>{if(!h.dragging)return;const C=CT(i.current);return C.addEventListener("pointermove",y),C.addEventListener("pointerup",g),()=>{C.removeEventListener("pointermove",y),C.removeEventListener("pointerup",g)}},[h.dragging,y,g]);const w=d.useMemo(()=>({height:Ri,width:Ri,borderRadius:Ri/2,position:"absolute",top:zd-Ri/2+5/2,backgroundColor:"white",left:Math.max(0,m/Math.max(1,e-1)*v-Ri/2),boxShadow:"0 0 2px black",opacity:Number(s||h.dragging)}),[s,h.dragging,e,m,v]),b=d.useMemo(()=>({height:Fo,backgroundColor:"rgba(255, 255, 255, 1)",width:(m-(r??0))/(e-1)*v,marginLeft:(r??0)/(e-1)*v,borderRadius:Fo/2}),[e,m,r,v]),S=d.useMemo(()=>({height:Fo,backgroundColor:"rgba(255, 255, 255, 0.25)",width:((o??e-1)-(r??0))/(e-1)*100+"%",marginLeft:(r??0)/(e-1)*100+"%",borderRadius:Fo/2,position:"absolute"}),[e,r,o]);return c.jsxs("div",{ref:i,onPointerDown:k,style:kT,children:[c.jsxs("div",{style:ET,children:[c.jsx("div",{style:S}),c.jsx("div",{style:b})]}),c.jsx("div",{style:w})]})},Lh=e=>{const t=Math.floor(e/60),n=Math.floor(e-t*60);return`${String(t)}:${String(n).padStart(2,"0")}`},TT=({durationInFrames:e,maxTimeLabelWidth:t,fps:n})=>{const r=se.Timeline.useTimelinePosition(),o=d.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 c.jsxs("div",{style:o,children:[Lh(s/n)," / ",Lh(e/n)]})},RT=10,Dd=12,_T=({allowFullscreen:e,playerWidth:t})=>d.useMemo(()=>{const r=lt,o=lt,i=e?Nd:0,s=o+r+i+Dd*2+RT*2,a=t-s,l=Math.max(a,0),u=l-Dr,p=(u<Dr?l:u)+s+Dr,m=t<p;return{maxTimeLabelWidth:l===0?null:l,displayVerticalVolumeSlider:m}},[e,t]),PT=[0,.013,.049,.104,.175,.259,.352,.45,.55,.648,.741,.825,.896,.951,.987],jT=[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],FT=1/.7,$T={boxSizing:"border-box",position:"absolute",bottom:0,width:"100%",paddingTop:40,paddingBottom:10,backgroundImage:`linear-gradient(to bottom,${PT.map((e,t)=>`hsla(0, 0%, 0%, ${e}) ${jT[t]*FT}%`).join(", ")}, hsl(0, 0%, 0%) 100%)`,backgroundSize:"auto 145px",display:"flex",paddingRight:Dd,paddingLeft:Dd,flexDirection:"column",transition:"opacity 0.3s"},MT={display:"flex",flexDirection:"row",width:"100%",alignItems:"center",justifyContent:"center",userSelect:"none",WebkitUserSelect:"none"},AT={display:"flex",flexDirection:"row",userSelect:"none",WebkitUserSelect:"none",alignItems:"center"},_i={width:12},NT={height:8},LT={flex:1},zT={},DT=({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:x,renderFullscreenButton:v,alwaysShowControls:k,showPlaybackRateControl:y,containerRef:g,buffering:w,hideControlsWhenPointerDoesntMove:b,onPointerDown:S,onDoubleClick:C,renderMuteButton:E,renderVolumeSlider:T,playing:_,toggle:j,renderCustomControls:A})=>{const z=d.useRef(null),[$,M]=d.useState(!1),W=xp(g,b),{maxTimeLabelWidth:D,displayVerticalVolumeSlider:R}=_T({allowFullscreen:i,playerWidth:(h==null?void 0:h.width)??0}),[I,P]=d.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=d.useMemo(()=>({...$T,opacity:Number(W||!_||I||k)}),[W,I,_,k]);d.useEffect(()=>{z.current&&a&&z.current.focus({preventScroll:!0})},[_,a]),d.useEffect(()=>{M((typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled))??!1)},[]),d.useEffect(()=>{if(I===!1)return;const V=setTimeout(()=>{P(!1)},I===!0?2e3:I);return()=>{clearInterval(V)}},[I]);const O=d.useMemo(()=>{if(y===!0)return[.5,.8,1,1.2,1.5,1.8,2,2.5,3];if(Array.isArray(y)){for(const Y of y){if(typeof Y!="number")throw new Error("Every item in showPlaybackRateControl must be a number");if(Y<=0)throw new Error("Every item in showPlaybackRateControl must be positive")}return y}return null},[y]),H=A?A():null,K=d.useRef(null),N=d.useRef(null),L=d.useCallback(Y=>{(Y.target===K.current||Y.target===N.current)&&(S==null||S(Y))},[S]),X=d.useCallback(Y=>{(Y.target===K.current||Y.target===N.current)&&(C==null||C(Y))},[C]);return c.jsxs("div",{ref:K,style:F,onPointerDown:L,onDoubleClick:X,children:[c.jsxs("div",{ref:N,style:MT,children:[c.jsxs("div",{style:AT,children:[c.jsx("button",{ref:z,type:"button",style:Ld,onClick:j,"aria-label":_?"Pause video":"Play video",title:_?"Pause video":"Play video",children:x===null?c.jsx(Mh,{buffering:w,playing:_}):x({playing:_,isBuffering:w})??c.jsx(Mh,{buffering:w,playing:_})}),r?c.jsxs(c.Fragment,{children:[c.jsx("div",{style:_i}),c.jsx(uT,{renderMuteButton:E,renderVolumeSlider:T,displayVerticalVolumeSlider:R})]}):null,c.jsx("div",{style:_i}),c.jsx(TT,{durationInFrames:e,fps:n,maxTimeLabelWidth:D}),c.jsx("div",{style:_i})]}),c.jsx("div",{style:LT}),H,H&&O&&h?c.jsx("div",{style:_i}):null,O&&h&&c.jsx(ST,{canvasSize:h,playbackRates:O}),O&&$&&i?c.jsx("div",{style:_i}):null,c.jsx("div",{style:zT,children:$&&i?c.jsx("button",{type:"button","aria-label":t?"Exit fullscreen":"Enter Fullscreen",title:t?"Exit fullscreen":"Enter Fullscreen",style:Ld,onClick:t?s:o,children:v===null?c.jsx(BI,{isFullscreen:t}):v({isFullscreen:t})}):null})]}),c.jsx("div",{style:NT}),c.jsx(IT,{onSeekEnd:l,onSeekStart:u,durationInFrames:e,inFrame:f,outFrame:p})]})},gx=typeof document>"u",OT=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}}},BT=e=>new Promise(t=>setTimeout(t,e)),VT=()=>{const e=d.useRef([]),t=d.useCallback(i=>{e.current=[...e.current,i]},[]),n=d.useCallback(i=>{e.current=e.current.filter(s=>s!==i)},[]),r=d.useCallback(()=>e.current.map(i=>i.cancel()),[]);return d.useMemo(()=>({appendPendingPromise:t,removePendingPromise:n,clearPendingPromises:r}),[t,r,n])},WT=(e,t,n)=>{const r=VT(),o=d.useCallback(async l=>{if(l instanceof PointerEvent?l.pointerType==="touch":l.nativeEvent.pointerType==="touch"){e(l);return}r.clearPendingPromises();const u=OT(BT(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=d.useCallback(()=>{document.addEventListener("pointerup",l=>{o(l)},{once:!0})},[o]),s=d.useCallback(()=>{r.clearPendingPromises(),t()},[r,t]);return d.useMemo(()=>n?{handlePointerDown:i,handleDoubleClick:s}:{handlePointerDown:e,handleDoubleClick:()=>{}},[n,s,i,e])},Od=te.version.split(".")[0];if(Od==="0")throw new Error(`Version ${Od} of "react" is not supported by Remotion`);var HT=parseInt(Od,10)>=18,UT=({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:x,moveToBeginningWhenEnded:v,showPosterWhenUnplayed:k,showPosterWhenEnded:y,showPosterWhenPaused:g,showPosterWhenBuffering:w,showPosterWhenBufferingAndPaused:b,inFrame:S,outFrame:C,initiallyShowControls:E,renderFullscreen:T,renderPlayPauseButton:_,renderMuteButton:j,renderVolumeSlider:A,renderCustomControls:z,alwaysShowControls:$,showPlaybackRateControl:M,posterFillMode:W,bufferStateDelayInMilliseconds:D,hideControlsWhenPointerDoesntMove:R,overflowVisible:I,browserMediaControlsBehavior:P,overrideInternalClassName:F,noSuspense:O},H)=>{const K=se.useUnsafeVideoConfig(),N=se.useVideo(),L=d.useRef(null),X=bp(L,{triggerOnWindowResize:!1,shouldApplyCssTransforms:!1}),[Y,V]=d.useState(!1),[U,ie]=d.useState(r),[ce,ae]=d.useState(()=>!1),[oe,J]=d.useState(!1),ee=d.useMemo(()=>typeof document>"u"?!1:!!(document.fullscreenEnabled||document.webkitFullscreenEnabled),[]),Q=mu(),ue=Q.toggle,{playerMuted:Ee,mediaVolume:je}=d.useContext(se.MediaVolumeContext);d.useEffect(()=>{Q.emitter.dispatchVolumeChange(je)},[Q.emitter,je]);const Ce=Ee||je===0;d.useEffect(()=>{Q.emitter.dispatchMuteChange({isMuted:Ce})},[Q.emitter,Ce]),nT({loop:n,playbackRate:p,moveToBeginningWhenEnded:v,inFrame:S,outFrame:C,getCurrentFrame:Q.getCurrentFrame,browserMediaControlsBehavior:P,muted:Ce}),d.useEffect(()=>{Y&&!Q.playing&&(V(!1),Q.play())},[Y,Q]),d.useEffect(()=>{const{current:ye}=L;if(!ye)return;const B=()=>{const G=document.fullscreenElement===ye||document.webkitFullscreenElement===ye;ae(G)};return document.addEventListener("fullscreenchange",B),document.addEventListener("webkitfullscreenchange",B),()=>{document.removeEventListener("fullscreenchange",B),document.removeEventListener("webkitfullscreenchange",B)}},[]);const xe=d.useCallback(ye=>{ue(ye)},[ue]),me=d.useCallback(()=>{if(!o)throw new Error("allowFullscreen is false");if(!ee)throw new Error("Browser doesnt support fullscreen");if(!L.current)throw new Error("No player ref found");L.current.webkitRequestFullScreen?L.current.webkitRequestFullScreen():L.current.requestFullscreen()},[o,ee]),be=d.useCallback(()=>{document.webkitExitFullscreen?document.webkitExitFullscreen():document.exitFullscreen()},[]);d.useEffect(()=>{const{current:ye}=L;if(!ye)return;const B=()=>{const G=document.webkitFullscreenElement??document.fullscreenElement;G&&G===L.current?Q.emitter.dispatchFullscreenChange({isFullscreen:!0}):Q.emitter.dispatchFullscreenChange({isFullscreen:!1})};return ye.addEventListener("webkitfullscreenchange",B),ye.addEventListener("fullscreenchange",B),()=>{ye.removeEventListener("webkitfullscreenchange",B),ye.removeEventListener("fullscreenchange",B)}},[Q.emitter]);const Re=(K==null?void 0:K.durationInFrames)??1,ve=d.useMemo(()=>!K||!X?null:lx({canvasSize:X,compositionHeight:K.height,compositionWidth:K.width,previewSize:"auto"}),[X,K]),_e=(ve==null?void 0:ve.scale)??1,it=d.useRef(!1);d.useEffect(()=>{if(!it.current){it.current=!0;return}Q.emitter.dispatchScaleChange(_e)},[Q.emitter,_e]);const{setMediaVolume:en,setPlayerMuted:Tn}=d.useContext(se.SetMediaVolumeContext),[tn,Rn]=d.useState(!1);d.useEffect(()=>{let ye=null,B=!1;const G=()=>{B=!1,requestAnimationFrame(()=>{D===0?Rn(!0):ye=setTimeout(()=>{B||Rn(!0)},D)})},ne=()=>{requestAnimationFrame(()=>{B=!0,Rn(!1),ye&&clearTimeout(ye)})};return Q.emitter.addEventListener("waiting",G),Q.emitter.addEventListener("resume",ne),()=>{Q.emitter.removeEventListener("waiting",G),Q.emitter.removeEventListener("resume",ne),Rn(!1),ye&&clearTimeout(ye),B=!0}},[D,Q.emitter]),d.useImperativeHandle(H,()=>{const ye={play:Q.play,pause:()=>{V(!1),Q.pause()},toggle:xe,getContainerNode:()=>L.current,getCurrentFrame:Q.getCurrentFrame,isPlaying:Q.isPlaying,seekTo:B=>{const G=Re-1,ne=Math.max(0,Math.min(G,B));Q.isPlaying()&&(V(ne!==G||n),Q.pause()),ne===G&&!n&&Q.emitter.dispatchEnded(),Q.seek(ne)},isFullscreen:()=>{const{current:B}=L;return B?document.fullscreenElement===B||document.webkitFullscreenElement===B:!1},requestFullscreen:me,exitFullscreen:be,getVolume:()=>Ee?0:je,setVolume:B=>{if(typeof B!="number")throw new TypeError(`setVolume() takes a number, got value of type ${typeof B}`);if(isNaN(B))throw new TypeError("setVolume() got a number that is NaN. Volume must be between 0 and 1.");if(B<0||B>1)throw new TypeError(`setVolume() got a number that is out of range. Must be between 0 and 1, got ${B}`);en(B)},isMuted:()=>Ce,mute:()=>{Tn(!0)},unmute:()=>{Tn(!1)},getScale:()=>_e,pauseAndReturnToPlayStart:()=>{Q.pauseAndReturnToPlayStart()}};return Object.assign(Q.emitter,ye)},[Re,be,n,Ee,Ce,je,Q,me,Tn,en,xe,_e]);const Yn=N?N.component:null,Mt=d.useMemo(()=>ux({canvasSize:X,config:K,style:t,overflowVisible:I,layout:ve}),[X,K,ve,I,t]),_n=d.useMemo(()=>dx({config:K,layout:ve,scale:_e,overflowVisible:I}),[K,ve,I,_e]),Pr=d.useMemo(()=>cx({config:K,layout:ve,scale:_e,overflowVisible:I}),[K,ve,I,_e]),Kn=Q.pause,ao=Q.emitter.dispatchError,di=d.useCallback(ye=>{Kn(),ao(ye)},[ao,Kn]),bu=d.useCallback(ye=>{ye.stopPropagation(),me()},[me]),zs=d.useCallback(ye=>{ye.stopPropagation(),be()},[be]),jr=d.useCallback(ye=>{(ye instanceof MouseEvent?ye.button===2:ye.nativeEvent.button)||xe(ye)},[xe]),fi=d.useCallback(()=>{J(!0)},[]),Ds=d.useCallback(()=>{J(!1)},[]),lo=d.useCallback(()=>{ce?be():me()},[be,ce,me]),{handlePointerDown:Fr,handleDoubleClick:hn}=WT(jr,lo,l&&o&&ee);d.useEffect(()=>{U&&(Q.play(),ie(!1))},[U,Q]);const pi=d.useMemo(()=>m?m({height:Mt.height,width:Mt.width,isBuffering:tn}):null,[Mt.height,Mt.width,m,tn]),Su=d.useMemo(()=>({type:"scale",scale:_e}),[_e]);if(!K)return null;const he=h?h({height:W==="player-size"?Mt.height:K.height,width:W==="player-size"?Mt.width:K.width,isBuffering:tn}):null;if(he===void 0)throw new TypeError("renderPoster() must return a React element, but undefined was returned");const mi=he&&[g&&!Q.isPlaying()&&!oe,y&&Q.isLastFrame&&!Q.isPlaying(),k&&!Q.hasPlayed&&!Q.isPlaying(),w&&tn&&Q.isPlaying(),b&&tn&&!Q.isPlaying()].some(Boolean),{left:ku,top:Os,width:Pn,height:Np,...Eu}=_n,Bs=c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:_n,onPointerDown:s?Fr:void 0,onDoubleClick:l?hn:void 0,children:[c.jsxs("div",{style:Pr,className:Sp(F),children:[Yn?c.jsx(hx,{onError:di,errorFallback:f,children:c.jsx(se.CurrentScaleContext.Provider,{value:Su,children:c.jsx(Yn,{...(N==null?void 0:N.props)??{},...i??{}})})}):null,mi&&W==="composition-size"?c.jsx("div",{style:{...Eu,width:K.width,height:K.height},onPointerDown:s?Fr:void 0,onDoubleClick:l?hn:void 0,children:he}):null]}),c.jsx(sT,{})]}),mi&&W==="player-size"?c.jsx("div",{style:_n,onPointerDown:s?Fr:void 0,onDoubleClick:l?hn:void 0,children:he}):null,e?c.jsx(DT,{fps:K.fps,playing:Q.playing,toggle:Q.toggle,durationInFrames:K.durationInFrames,containerRef:L,onFullscreenButtonClick:bu,isFullscreen:ce,allowFullscreen:o,showVolumeControls:a,onExitFullscreenButtonClick:zs,spaceKeyToPlayOrPause:u,onSeekEnd:Ds,onSeekStart:fi,inFrame:S,outFrame:C,initiallyShowControls:E,canvasSize:X,renderFullscreenButton:T,renderPlayPauseButton:_,alwaysShowControls:$,showPlaybackRateControl:M,buffering:tn,hideControlsWhenPointerDoesntMove:R,onDoubleClick:l?hn:void 0,onPointerDown:s?Fr:void 0,renderMuteButton:j,renderVolumeSlider:A,renderCustomControls:z}):null]});return O||gx&&!HT?c.jsx("div",{ref:L,style:Mt,className:x,children:Bs}):c.jsx("div",{ref:L,style:Mt,className:x,children:c.jsx(d.Suspense,{fallback:pi,children:Bs})})},ZT=d.forwardRef(UT),vx="remotion.volumePreference",YT=(e,t,n)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(n??vx,String(e))}catch(r){se.Log.error({logLevel:t,tag:null},"Could not persist volume",r)}},KT=e=>{if(typeof window>"u")return 1;try{const t=window.localStorage.getItem(e??vx);return t?Number(t):1}catch{return 1}},kp="player-comp",yx=({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:x,inputProps:v,audioEnabled:k})=>{const y=x===void 0,g=d.useMemo(()=>({compositions:[{component:a,durationInFrames:s,height:o,width:i,fps:r,id:kp,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]),[w,b]=d.useState(()=>u),[S,C]=d.useState(()=>y?KT(h??null):x),E=d.useMemo(()=>({playerMuted:w,mediaVolume:S}),[w,S]),T=d.useRef(!1),_=T.current||k&&!w&&S>0;T.current=_;const j=d.useCallback(M=>{C(M),y&&YT(M,f,h??null)},[y,f,h]),A=d.useMemo(()=>({setPlayerMuted:b,setMediaVolume:j}),[j]),z=d.useMemo(()=>({logLevel:f,mountTime:Date.now()}),[f]),$=d.useMemo(()=>({isPlayer:!0,isRendering:!1,isStudio:!1,isClientSideRendering:!1,isReadOnlyStudio:!1}),[]);return c.jsx(se.RemotionEnvironmentContext.Provider,{value:$,children:c.jsx(se.LogLevelContext.Provider,{value:z,children:c.jsx(se.CanUseRemotionHooksProvider,{children:c.jsx(se.AbsoluteTimeContext.Provider,{value:t,children:c.jsx(se.PlaybackRateContext.Provider,{value:n,children:c.jsx(se.TimelineContext.Provider,{value:t,children:c.jsx(se.CompositionManager.Provider,{value:g,children:c.jsx(se.PrefetchProvider,{children:c.jsx(se.DurationsContextProvider,{children:c.jsx(se.MediaVolumeContext.Provider,{value:E,children:c.jsx(se.SetMediaVolumeContext.Provider,{value:A,children:c.jsx(se.BufferingProvider,{children:c.jsx(se.SharedAudioContextProvider,{audioLatencyHint:p,audioEnabled:_,previewSampleRate:m,children:c.jsx(se.SharedAudioTagsContextProvider,{numberOfAudioTags:l,children:e})})})})})})})})})})})})})})},zh=!1,GT=(e,t)=>{e||zh||(zh=!0,se.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."))},Dh=(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},XT=({inFrame:e,durationInFrames:t,outFrame:n})=>{const r=Dh(e,"inFrame"),o=Dh(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)}},qT=({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)}`)}},QT=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.")}},JT=pu.validateFps,Oh=pu.validateDimension,eR=pu.validateDurationInFrames,tR=pu.validateDefaultAndInputProps,nR=e=>"component"in e?e.component:null,rR=({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:x=!0,numberOfSharedAudioTags:v=5,errorFallback:k=()=>"⚠️",playbackRate:y=1,renderLoading:g,className:w,showPosterWhenUnplayed:b,showPosterWhenEnded:S,showPosterWhenPaused:C,showPosterWhenBuffering:E,showPosterWhenBufferingAndPaused:T,initialFrame:_,renderPoster:j,inFrame:A,outFrame:z,initiallyShowControls:$,renderFullscreenButton:M,renderPlayPauseButton:W,renderVolumeSlider:D,renderCustomControls:R,alwaysShowControls:I=!1,initiallyMuted:P=!1,showPlaybackRateControl:F=!1,posterFillMode:O="player-size",bufferStateDelayInMilliseconds:H,hideControlsWhenPointerDoesntMove:K=!0,overflowVisible:N=!1,renderMuteButton:L,browserMediaControlsBehavior:X,overrideInternalClassName:Y,logLevel:V="info",noSuspense:U,acknowledgeRemotionLicense:ie,audioLatencyHint:ce="playback",sampleRate:ae=48e3,volumePersistenceKey:oe,initialVolume:J,...ee},Q)=>{if(typeof window<"u"&&(window.remotion_isPlayer=!0),ee.defaultProps!==void 0)throw new Error("The <Player /> component does not accept `defaultProps`, but some were passed. Use `inputProps` instead.");const ue=nR(ee);if((ue==null?void 0:ue.type)===hl)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(ue===hl)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.");d.useState(()=>GT(!!ie,V));const Ee=se.useLazyComponent({compProps:ee,componentName:"Player",noSuspense:!!U});qT({initialFrame:_,durationInFrames:e});const[je,Ce]=d.useState(()=>({[kp]:_??0})),[xe,me]=d.useState(!1),[be]=d.useState("player-comp"),Re=d.useRef(null),ve=d.useRef([]),_e=d.useRef(!1),[it,en]=d.useState(y);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(Oh(t,"compositionHeight","of the <Player /> component"),Oh(n,"compositionWidth","of the <Player /> component"),eR(e,{component:"of the <Player/> component",allowFloats:!1}),JT(r,"as a prop of the <Player/> component",!1),tR(o,"inputProps",null),XT({durationInFrames:e,inFrame:A,outFrame:z}),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 ae!="number"||!Number.isFinite(ae)||Number.isNaN(ae)||ae<=0||ae%1!==0)throw new TypeError(`'sampleRate' must be a positive integer but got '${ae}' instead`);if(typeof J<"u"&&typeof J!="number")throw new TypeError(`'initialVolume' must be a number or undefined but got '${typeof J}' instead`);if(typeof J=="number"&&(!Number.isFinite(J)||Number.isNaN(J)||J<0||J>1))throw new TypeError(`'initialVolume' must be between 0 and 1 but got '${J}' 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`);QT(it),d.useEffect(()=>{en(y)},[y]),d.useImperativeHandle(Q,()=>Re.current,[]),d.useState(()=>{se.playbackLogging({logLevel:V,message:`[player] Mounting <Player>. User agent = ${typeof navigator>"u"?"server":navigator.userAgent}`,tag:"player",mountTime:Date.now()})});const Tn=d.useMemo(()=>({frame:je,playing:xe,rootId:be,imperativePlaying:_e,audioAndVideoTags:ve}),[je,xe,be]),tn=d.useMemo(()=>({playbackRate:it,setPlaybackRate:en}),[it]),Rn=d.useMemo(()=>({setFrame:Ce,setPlaying:me}),[Ce]);typeof window<"u"&&d.useLayoutEffect(()=>{se.CSSUtils.injectCSS(se.CSSUtils.makeDefaultPreviewCSS(`.${Sp(Y)}`,"#fff"))},[Y]);const Yn=d.useMemo(()=>o??{},[o]),Mt=d.useMemo(()=>X??{mode:"prevent-media-session"},[X]);return c.jsx(se.IsPlayerContextProvider,{children:c.jsx(yx,{timelineContext:Tn,playbackRateContext:tn,component:Ee,compositionHeight:t,compositionWidth:n,durationInFrames:e,fps:r,numberOfSharedAudioTags:v,initiallyMuted:P,logLevel:V,audioLatencyHint:ce,sampleRate:ae,volumePersistenceKey:oe,initialVolume:J,inputProps:Yn,audioEnabled:!0,children:c.jsx(se.SetTimelineContext.Provider,{value:Rn,children:c.jsx(XI,{currentPlaybackRate:it,children:c.jsx(ZT,{ref:Re,posterFillMode:O,renderLoading:g,autoPlay:!!l,loop:!!a,controls:!!s,errorFallback:k,style:i,inputProps:Yn,allowFullscreen:!!f,moveToBeginningWhenEnded:!!x,clickToPlay:typeof p=="boolean"?p:!!s,showVolumeControls:!!u,doubleClickToFullscreen:!!m,spaceKeyToPlayOrPause:!!h,playbackRate:it,className:w??void 0,showPosterWhenUnplayed:!!b,showPosterWhenEnded:!!S,showPosterWhenPaused:!!C,showPosterWhenBuffering:!!E,showPosterWhenBufferingAndPaused:!!T,renderPoster:j,inFrame:A??null,outFrame:z??null,initiallyShowControls:$??!0,renderFullscreen:M??null,renderPlayPauseButton:W??null,renderMuteButton:L??null,renderVolumeSlider:D??null,renderCustomControls:R??null,alwaysShowControls:I,showPlaybackRateControl:F,bufferStateDelayInMilliseconds:H??300,hideControlsWhenPointerDoesntMove:K,overflowVisible:N,browserMediaControlsBehavior:Mt,overrideInternalClassName:Y??void 0,noSuspense:!!U})})})})})},oR=d.forwardRef,iR=oR(rR),sR=()=>{const e=d.useContext(px);if(!e)throw new TypeError("Expected Player event emitter context");return d.useMemo(()=>({emitter:e}),[e])},Bd=te.version.split(".")[0];if(Bd==="0")throw new Error(`Version ${Bd} of "react" is not supported by Remotion`);var aR=parseInt(Bd,10)>=18,lR=({style:e,inputProps:t,errorFallback:n,renderLoading:r,className:o,overflowVisible:i,noSuspense:s,overrideInternalClassName:a},l)=>{const u=se.useUnsafeVideoConfig(),f=se.useVideo(),p=d.useRef(null),m=bp(p,{triggerOnWindowResize:!1,shouldApplyCssTransforms:!1}),h=d.useMemo(()=>!u||!m?null:lx({canvasSize:m,compositionHeight:u.height,compositionWidth:u.width,previewSize:"auto"}),[m,u]),x=(h==null?void 0:h.scale)??1,v=sR();mx(v.emitter),d.useImperativeHandle(l,()=>{const T={getContainerNode:()=>p.current,getScale:()=>x};return Object.assign(v.emitter,T)},[x,v.emitter]);const k=f?f.component:null,y=d.useMemo(()=>ux({config:u,style:e,canvasSize:m,overflowVisible:i,layout:h}),[m,u,h,i,e]),g=d.useMemo(()=>dx({config:u,layout:h,scale:x,overflowVisible:i}),[u,h,i,x]),w=d.useMemo(()=>cx({config:u,layout:h,scale:x,overflowVisible:i}),[u,h,i,x]),b=d.useCallback(T=>{v.emitter.dispatchError(T)},[v.emitter]),S=d.useMemo(()=>r?r({height:y.height,width:y.width,isBuffering:!1}):null,[y.height,y.width,r]),C=d.useMemo(()=>({type:"scale",scale:x}),[x]);if(!u)return null;const E=c.jsx("div",{style:g,children:c.jsx("div",{style:w,className:Sp(a),children:k?c.jsx(hx,{onError:b,errorFallback:n,children:c.jsx(se.CurrentScaleContext.Provider,{value:C,children:c.jsx(k,{...(f==null?void 0:f.props)??{},...t??{}})})}):null})});return s||gx&&!aR?c.jsx("div",{ref:p,style:y,className:o,children:E}):c.jsx("div",{ref:p,style:y,className:o,children:c.jsx(d.Suspense,{fallback:S,children:E})})},uR=d.forwardRef(lR),cR=({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,...x},v)=>{typeof window<"u"&&d.useLayoutEffect(()=>{window.remotion_isPlayer=!0},[]);const[k]=d.useState(()=>String(to(null))),y=d.useRef(null),g=d.useMemo(()=>({playing:!1,frame:{[kp]:e},rootId:k,imperativePlaying:{current:!1},audioAndVideoTags:{current:[]}}),[e,k]),w=d.useMemo(()=>({playbackRate:1,setPlaybackRate:()=>{throw new Error("thumbnail")}}),[]);d.useImperativeHandle(v,()=>y.current,[]);const b=se.useLazyComponent({compProps:x,componentName:"Thumbnail",noSuspense:!!h}),[S]=d.useState(()=>new GI),C=d.useMemo(()=>n??{},[n]);return c.jsx(se.IsPlayerContextProvider,{children:c.jsx(yx,{timelineContext:g,playbackRateContext:w,component:b,compositionHeight:r,compositionWidth:o,durationInFrames:i,fps:s,numberOfSharedAudioTags:0,initiallyMuted:!0,logLevel:m,audioLatencyHint:"playback",sampleRate:48e3,inputProps:C,audioEnabled:!1,children:c.jsx(px.Provider,{value:S,children:c.jsx(uR,{ref:y,className:a,errorFallback:l,inputProps:C,renderLoading:u,style:t,overflowVisible:f,overrideInternalClassName:p,noSuspense:!!h})})})})},dR=d.forwardRef;dR(cR);const Bo=[1,1.5,2,4];function Bh(e){return Bo.find(t=>t>e+1e-9)??Bo[Bo.length-1]}function fR(e,t){switch(t){case"L":return e.playing&&e.rate>0?{rate:Bh(e.rate),playing:!0}:{rate:Bo[0],playing:!0};case"J":return e.playing&&e.rate<0?{rate:-Bh(-e.rate),playing:!0}:{rate:-Bo[0],playing:!0};case"K":return{rate:Bo[0],playing:!e.playing}}}function Ep(e,t,n){const r=Math.round(e*n),o=Math.round(t*n);return{from:r,durationInFrames:Math.max(1,o-r)}}function pR(e){if(typeof e!="object"||e===null)return null;const t=e;return typeof t.scale!="number"||!Number.isFinite(t.scale)||t.scale<=0||!Array.isArray(t.allowed)||t.allowed.some(n=>typeof n!="boolean")?null:{scale:t.scale,allowed:t.allowed}}function mR(e,t,n,r){const o=t?t.scale:n,i=[];let s=!1;for(let a=0;a<e.length;a++){const l=e[a-1],u=l?e[a].srcIn-l.srcOut:0;a>0&&u>=r&&(s=!s);const f=t?t.allowed[a]!==!1:!0;i.push(s&&f?o:1)}return i}const hR=({src:e,spans:t,punchInScale:n=1.07,punch:r=null,punchThresholdSec:o=.15,audioFadeSec:i=.01,background:s="black"})=>{const{fps:a}=Xe(),l=d.useMemo(()=>mR(t,r,n,o),[t,r,n,o]),u=Math.max(1,Math.round(i*a));return c.jsx(pn,{style:{backgroundColor:s},children:t.map((f,p)=>{const{from:m,durationInFrames:h}=Ep(f.outIn,f.outOut,a);return c.jsx(dt,{from:m,durationInFrames:h,premountFor:a,children:c.jsx(pn,{style:{transform:`scale(${l[p]})`},children:c.jsx(ix,{src:e,trimBefore:Math.round(f.srcIn*a),trimAfter:Math.round(f.srcOut*a),style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"var(--ossclip-obj-x, 50%) var(--ossclip-obj-y, 50%)"},volume:x=>Math.max(0,Math.min(1,(x+1)/u,(h-x)/u))})})},p)})})};function Z(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 gs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const wx={};function xr(e){return wx}function gR(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 vR(e,t){return typeof t=="bigint"?t.toString():t}function xx(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Cp(e){return e==null}function Ip(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function yR(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 Le(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 Tp(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Pi(e){return JSON.stringify(e)}const bx=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Vd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const wR=xx(()=>{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 bl(e){if(Vd(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(Vd(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}const xR=new Set(["string","number","symbol"]);function hu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function io(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 bR(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const SR={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 kR(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 io(e,{...e._zod.def,shape:n,checks:[]})}function ER(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 io(e,{...e._zod.def,shape:n,checks:[]})}function CR(e,t){if(!bl(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 Tp(this,"shape",r),r},checks:[]};return io(e,n)}function IR(e,t){return io(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Tp(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function TR(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 io(t,{...t._zod.def,shape:o,checks:[]})}function RR(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 io(t,{...t._zod.def,shape:o,checks:[]})}function Yi(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 Or(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function ga(e){return typeof e=="string"?e:e==null?void 0:e.message}function br(e,t,n){var o,i,s,a,l,u;const r={...e,path:e.path??[]};if(!e.message){const f=ga((s=(i=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:i.error)==null?void 0:s.call(i,e))??ga((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??ga((l=n.customError)==null?void 0:l.call(n,e))??ga((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 Rp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function vs(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Sx=(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,vR,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},kx=Z("$ZodError",Sx),Ex=Z("$ZodError",Sx,{Parent:Error});function _R(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 PR(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 jR=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 gs;if(s.issues.length){const a=new((o==null?void 0:o.Err)??e)(s.issues.map(l=>br(l,i,xr())));throw bx(a,o==null?void 0:o.callee),a}return s.value},FR=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=>br(l,i,xr())));throw bx(a,o==null?void 0:o.callee),a}return s.value},Cx=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 gs;return i.issues.length?{success:!1,error:new(e??kx)(i.issues.map(s=>br(s,o,xr())))}:{success:!0,data:i.value}},$R=Cx(Ex),Ix=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=>br(s,o,xr())))}:{success:!0,data:i.value}},MR=Ix(Ex),AR=/^[cC][^\s-]{8,}$/,NR=/^[0-9a-z]+$/,LR=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zR=/^[0-9a-vA-V]{20}$/,DR=/^[A-Za-z0-9]{27}$/,OR=/^[a-zA-Z0-9_-]{21}$/,BR=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,VR=/^([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})$/,Vh=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)$/,WR=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,HR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function UR(){return new RegExp(HR,"u")}const ZR=/^(?:(?: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])$/,YR=/^(([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})$/,KR=/^((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])$/,GR=/^(([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])$/,XR=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Tx=/^[A-Za-z0-9_-]*$/,qR=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,QR=/^\+(?:[0-9]){6,14}[0-9]$/,Rx="(?:(?:\\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])))",JR=new RegExp(`^${Rx}$`);function _x(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 e_(e){return new RegExp(`^${_x(e)}$`)}function t_(e){const t=_x({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(`^${Rx}T(?:${r})$`)}const n_=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}$`)},r_=/^\d+$/,o_=/^-?\d+(?:\.\d+)?/i,i_=/true|false/i,s_=/^[^A-Z]*$/,a_=/^[^a-z]*$/,Ft=Z("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Px={number:"number",bigint:"bigint",object:"date"},jx=Z("$ZodCheckLessThan",(e,t)=>{Ft.init(e,t);const n=Px[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})}}),Fx=Z("$ZodCheckGreaterThan",(e,t)=>{Ft.init(e,t);const n=Px[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})}}),l_=Z("$ZodCheckMultipleOf",(e,t)=>{Ft.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):yR(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})}}),u_=Z("$ZodCheckNumberFormat",(e,t)=>{var s;Ft.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]=SR[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=r_)}),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})}}),c_=Z("$ZodCheckMaxLength",(e,t)=>{var n;Ft.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Cp(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=Rp(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),d_=Z("$ZodCheckMinLength",(e,t)=>{var n;Ft.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Cp(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=Rp(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),f_=Z("$ZodCheckLengthEquals",(e,t)=>{var n;Ft.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Cp(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=Rp(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})}}),gu=Z("$ZodCheckStringFormat",(e,t)=>{var n,r;Ft.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=()=>{})}),p_=Z("$ZodCheckRegex",(e,t)=>{gu.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})}}),m_=Z("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=s_),gu.init(e,t)}),h_=Z("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=a_),gu.init(e,t)}),g_=Z("$ZodCheckIncludes",(e,t)=>{Ft.init(e,t);const n=hu(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})}}),v_=Z("$ZodCheckStartsWith",(e,t)=>{Ft.init(e,t);const n=new RegExp(`^${hu(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})}}),y_=Z("$ZodCheckEndsWith",(e,t)=>{Ft.init(e,t);const n=new RegExp(`.*${hu(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})}}),w_=Z("$ZodCheckOverwrite",(e,t)=>{Ft.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class x_{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
+ `).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 b_={major:4,minor:0,patch:0},Ve=Z("$ZodType",(e,t)=>{var o;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=b_;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=Yi(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 gs;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,s.issues.length!==m&&(u||(u=Yi(s,m)))});else{if(s.issues.length===m)continue;u||(u=Yi(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 gs;return l.then(u=>i(u,r,a))}return i(l,r,a)}}e["~standard"]={validate:i=>{var s;try{const a=$R(e,i);return a.success?{value:a.data}:{issues:(s=a.error)==null?void 0:s.issues}}catch{return MR(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}}),_p=Z("$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()??n_(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}}),ze=Z("$ZodStringFormat",(e,t)=>{gu.init(e,t),_p.init(e,t)}),S_=Z("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=VR),ze.init(e,t)}),k_=Z("$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=Vh(r))}else t.pattern??(t.pattern=Vh());ze.init(e,t)}),E_=Z("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=WR),ze.init(e,t)}),C_=Z("$ZodURL",(e,t)=>{ze.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:qR.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})}}}),I_=Z("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=UR()),ze.init(e,t)}),T_=Z("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=OR),ze.init(e,t)}),R_=Z("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=AR),ze.init(e,t)}),__=Z("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=NR),ze.init(e,t)}),P_=Z("$ZodULID",(e,t)=>{t.pattern??(t.pattern=LR),ze.init(e,t)}),j_=Z("$ZodXID",(e,t)=>{t.pattern??(t.pattern=zR),ze.init(e,t)}),F_=Z("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=DR),ze.init(e,t)}),$_=Z("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=t_(t)),ze.init(e,t)}),M_=Z("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=JR),ze.init(e,t)}),A_=Z("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=e_(t)),ze.init(e,t)}),N_=Z("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=BR),ze.init(e,t)}),L_=Z("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ZR),ze.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),z_=Z("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=YR),ze.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})}}}),D_=Z("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=KR),ze.init(e,t)}),O_=Z("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=GR),ze.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 $x(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const B_=Z("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=XR),ze.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{$x(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function V_(e){if(!Tx.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return $x(n)}const W_=Z("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Tx),ze.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{V_(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),H_=Z("$ZodE164",(e,t)=>{t.pattern??(t.pattern=QR),ze.init(e,t)});function U_(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 Z_=Z("$ZodJWT",(e,t)=>{ze.init(e,t),e._zod.check=n=>{U_(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Mx=Z("$ZodNumber",(e,t)=>{Ve.init(e,t),e._zod.pattern=e._zod.bag.pattern??o_,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}}),Y_=Z("$ZodNumber",(e,t)=>{u_.init(e,t),Mx.init(e,t)}),K_=Z("$ZodBoolean",(e,t)=>{Ve.init(e,t),e._zod.pattern=i_,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}}),G_=Z("$ZodUnknown",(e,t)=>{Ve.init(e,t),e._zod.parse=n=>n}),X_=Z("$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 Wh(e,t,n){e.issues.length&&t.issues.push(...Or(n,e.issues)),t.value[n]=e.value}const q_=Z("$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=>Wh(u,n,s))):Wh(l,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function va(e,t,n){e.issues.length&&t.issues.push(...Or(n,e.issues)),t.value[n]=e.value}function Hh(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(...Or(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const Q_=Z("$ZodObject",(e,t)=>{Ve.init(e,t);const n=xx(()=>{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=bR(t.shape);return{shape:t.shape,keys:p,keySet:new Set(p),numKeys:p.length,optionalKeys:new Set(m)}});Le(e._zod,"propValues",()=>{const p=t.shape,m={};for(const h in p){const x=p[h]._zod;if(x.values){m[h]??(m[h]=new Set);for(const v of x.values)m[h].add(v)}}return m});const r=p=>{const m=new x_(["shape","payload","ctx"]),h=n.value,x=g=>{const w=Pi(g);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};m.write("const input = payload.value;");const v=Object.create(null);let k=0;for(const g of h.keys)v[g]=`key_${k++}`;m.write("const newResult = {}");for(const g of h.keys)if(h.optionalKeys.has(g)){const w=v[g];m.write(`const ${w} = ${x(g)};`);const b=Pi(g);m.write(`
137
+ if (${w}.issues.length) {
138
+ if (input[${b}] === undefined) {
139
+ if (${b} in input) {
140
+ newResult[${b}] = undefined;
141
+ }
142
+ } else {
143
+ payload.issues = payload.issues.concat(
144
+ ${w}.issues.map((iss) => ({
145
+ ...iss,
146
+ path: iss.path ? [${b}, ...iss.path] : [${b}],
147
+ }))
148
+ );
149
+ }
150
+ } else if (${w}.value === undefined) {
151
+ if (${b} in input) newResult[${b}] = undefined;
152
+ } else {
153
+ newResult[${b}] = ${w}.value;
154
+ }
155
+ `)}else{const w=v[g];m.write(`const ${w} = ${x(g)};`),m.write(`
156
+ if (${w}.issues.length) payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
157
+ ...iss,
158
+ path: iss.path ? [${Pi(g)}, ...iss.path] : [${Pi(g)}]
159
+ })));`),m.write(`newResult[${Pi(g)}] = ${w}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");const y=m.compile();return(g,w)=>y(p,g,w)};let o;const i=Vd,s=!wx.jitless,l=s&&wR.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 x=[];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 w=f.shape;for(const b of f.keys){const S=w[b],C=S._zod.run({value:h[b],issues:[]},m),E=S._zod.optin==="optional"&&S._zod.optout==="optional";C instanceof Promise?x.push(C.then(T=>E?Hh(T,p,b,h):va(T,p,b))):E?Hh(C,p,b,h):va(C,p,b)}}if(!u)return x.length?Promise.all(x).then(()=>p):p;const v=[],k=f.keySet,y=u._zod,g=y.def.type;for(const w of Object.keys(h)){if(k.has(w))continue;if(g==="never"){v.push(w);continue}const b=y.run({value:h[w],issues:[]},m);b instanceof Promise?x.push(b.then(S=>va(S,p,w))):va(b,p,w)}return v.length&&p.issues.push({code:"unrecognized_keys",keys:v,input:h,inst:e}),x.length?Promise.all(x).then(()=>p):p}});function Uh(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=>br(i,r,xr())))}),t}const J_=Z("$ZodUnion",(e,t)=>{Ve.init(e,t),Le(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Le(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Le(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Le(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=>Ip(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=>Uh(s,n,e,r)):Uh(i,n,e,r)}}),eP=Z("$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])=>Zh(n,l,u)):Zh(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(bl(e)&&bl(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 Zh(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Yi(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 tP=Z("$ZodRecord",(e,t)=>{Ve.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!bl(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(...Or(l,f.issues)),n.value[l]=f.value})):(u.issues.length&&n.issues.push(...Or(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=>br(u,r,xr())),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(...Or(s,u.issues)),n.value[a.value]=u.value})):(l.issues.length&&n.issues.push(...Or(s,l.issues)),n.value[a.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}}),nP=Z("$ZodEnum",(e,t)=>{Ve.init(e,t);const n=gR(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(r=>xR.has(typeof r)).map(r=>typeof r=="string"?hu(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}}),rP=Z("$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 gs;return n.value=o,n}}),oP=Z("$ZodOptional",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Le(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Le(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ip(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)}),iP=Z("$ZodNullable",(e,t)=>{Ve.init(e,t),Le(e._zod,"optin",()=>t.innerType._zod.optin),Le(e._zod,"optout",()=>t.innerType._zod.optout),Le(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ip(n.source)}|null)$`):void 0}),Le(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)}),sP=Z("$ZodDefault",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",Le(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=>Yh(i,t)):Yh(o,t)}});function Yh(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const aP=Z("$ZodPrefault",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",Le(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))}),lP=Z("$ZodNonOptional",(e,t)=>{Ve.init(e,t),Le(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=>Kh(i,e)):Kh(o,e)}});function Kh(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 uP=Z("$ZodCatch",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",Le(e._zod,"optout",()=>t.innerType._zod.optout),Le(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=>br(s,r,xr()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>br(i,r,xr()))},input:n.value}),n.issues=[]),n)}}),cP=Z("$ZodPipe",(e,t)=>{Ve.init(e,t),Le(e._zod,"values",()=>t.in._zod.values),Le(e._zod,"optin",()=>t.in._zod.optin),Le(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=>Gh(i,t,r)):Gh(o,t,r)}});function Gh(e,t,n){return Yi(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const dP=Z("$ZodReadonly",(e,t)=>{Ve.init(e,t),Le(e._zod,"propValues",()=>t.innerType._zod.propValues),Le(e._zod,"values",()=>t.innerType._zod.values),Le(e._zod,"optin",()=>t.innerType._zod.optin),Le(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(Xh):Xh(o)}});function Xh(e){return e.value=Object.freeze(e.value),e}const fP=Z("$ZodCustom",(e,t)=>{Ft.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=>qh(i,n,r,e));qh(o,n,r,e)}});function qh(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(vs(o))}}class pP{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 mP(){return new pP}const ya=mP();function hP(e,t){return new e({type:"string",...le(t)})}function gP(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...le(t)})}function Qh(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...le(t)})}function vP(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...le(t)})}function yP(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...le(t)})}function wP(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...le(t)})}function xP(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...le(t)})}function bP(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...le(t)})}function SP(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...le(t)})}function kP(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...le(t)})}function EP(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...le(t)})}function CP(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...le(t)})}function IP(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...le(t)})}function TP(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...le(t)})}function RP(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...le(t)})}function _P(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...le(t)})}function PP(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...le(t)})}function jP(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...le(t)})}function FP(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...le(t)})}function $P(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...le(t)})}function MP(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...le(t)})}function AP(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...le(t)})}function NP(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...le(t)})}function LP(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...le(t)})}function zP(e,t){return new e({type:"string",format:"date",check:"string_format",...le(t)})}function DP(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...le(t)})}function OP(e,t){return new e({type:"string",format:"duration",check:"string_format",...le(t)})}function BP(e,t){return new e({type:"number",checks:[],...le(t)})}function VP(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...le(t)})}function WP(e,t){return new e({type:"boolean",...le(t)})}function HP(e){return new e({type:"unknown"})}function UP(e,t){return new e({type:"never",...le(t)})}function Jh(e,t){return new jx({check:"less_than",...le(t),value:e,inclusive:!1})}function dc(e,t){return new jx({check:"less_than",...le(t),value:e,inclusive:!0})}function eg(e,t){return new Fx({check:"greater_than",...le(t),value:e,inclusive:!1})}function fc(e,t){return new Fx({check:"greater_than",...le(t),value:e,inclusive:!0})}function tg(e,t){return new l_({check:"multiple_of",...le(t),value:e})}function Ax(e,t){return new c_({check:"max_length",...le(t),maximum:e})}function Sl(e,t){return new d_({check:"min_length",...le(t),minimum:e})}function Nx(e,t){return new f_({check:"length_equals",...le(t),length:e})}function ZP(e,t){return new p_({check:"string_format",format:"regex",...le(t),pattern:e})}function YP(e){return new m_({check:"string_format",format:"lowercase",...le(e)})}function KP(e){return new h_({check:"string_format",format:"uppercase",...le(e)})}function GP(e,t){return new g_({check:"string_format",format:"includes",...le(t),includes:e})}function XP(e,t){return new v_({check:"string_format",format:"starts_with",...le(t),prefix:e})}function qP(e,t){return new y_({check:"string_format",format:"ends_with",...le(t),suffix:e})}function As(e){return new w_({check:"overwrite",tx:e})}function QP(e){return As(t=>t.normalize(e))}function JP(){return As(e=>e.trim())}function ej(){return As(e=>e.toLowerCase())}function tj(){return As(e=>e.toUpperCase())}function nj(e,t,n){return new e({type:"array",element:t,...le(n)})}function rj(e,t,n){return new e({type:"custom",check:"custom",fn:t,...le(n)})}const oj=Z("ZodISODateTime",(e,t)=>{$_.init(e,t),We.init(e,t)});function ij(e){return LP(oj,e)}const sj=Z("ZodISODate",(e,t)=>{M_.init(e,t),We.init(e,t)});function aj(e){return zP(sj,e)}const lj=Z("ZodISOTime",(e,t)=>{A_.init(e,t),We.init(e,t)});function uj(e){return DP(lj,e)}const cj=Z("ZodISODuration",(e,t)=>{N_.init(e,t),We.init(e,t)});function dj(e){return OP(cj,e)}const fj=(e,t)=>{kx.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>PR(e,n)},flatten:{value:n=>_R(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},vu=Z("ZodError",fj,{Parent:Error}),pj=jR(vu),mj=FR(vu),hj=Cx(vu),gj=Ix(vu),Ke=Z("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)=>io(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e),e.parse=(n,r)=>pj(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>hj(e,n,r),e.parseAsync=async(n,r)=>mj(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>gj(e,n,r),e.spa=e.safeParseAsync,e.refine=(n,r)=>e.check(aF(n,r)),e.superRefine=n=>e.check(lF(n)),e.overwrite=n=>e.check(As(n)),e.optional=()=>og(e),e.nullable=()=>ig(e),e.nullish=()=>og(ig(e)),e.nonoptional=n=>Jj(e,n),e.array=()=>Wn(e),e.or=n=>Dx([e,n]),e.and=n=>Hj(e,n),e.transform=n=>sg(e,Yj(n)),e.default=n=>Xj(e,n),e.prefault=n=>Qj(e,n),e.catch=n=>tF(e,n),e.pipe=n=>sg(e,n),e.readonly=()=>oF(e),e.describe=n=>{const r=e.clone();return ya.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=ya.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ya.get(e);const r=e.clone();return ya.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Lx=Z("_ZodString",(e,t)=>{_p.init(e,t),Ke.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(ZP(...r)),e.includes=(...r)=>e.check(GP(...r)),e.startsWith=(...r)=>e.check(XP(...r)),e.endsWith=(...r)=>e.check(qP(...r)),e.min=(...r)=>e.check(Sl(...r)),e.max=(...r)=>e.check(Ax(...r)),e.length=(...r)=>e.check(Nx(...r)),e.nonempty=(...r)=>e.check(Sl(1,...r)),e.lowercase=r=>e.check(YP(r)),e.uppercase=r=>e.check(KP(r)),e.trim=()=>e.check(JP()),e.normalize=(...r)=>e.check(QP(...r)),e.toLowerCase=()=>e.check(ej()),e.toUpperCase=()=>e.check(tj())}),vj=Z("ZodString",(e,t)=>{_p.init(e,t),Lx.init(e,t),e.email=n=>e.check(gP(yj,n)),e.url=n=>e.check(bP(wj,n)),e.jwt=n=>e.check(NP(Mj,n)),e.emoji=n=>e.check(SP(xj,n)),e.guid=n=>e.check(Qh(ng,n)),e.uuid=n=>e.check(vP(wa,n)),e.uuidv4=n=>e.check(yP(wa,n)),e.uuidv6=n=>e.check(wP(wa,n)),e.uuidv7=n=>e.check(xP(wa,n)),e.nanoid=n=>e.check(kP(bj,n)),e.guid=n=>e.check(Qh(ng,n)),e.cuid=n=>e.check(EP(Sj,n)),e.cuid2=n=>e.check(CP(kj,n)),e.ulid=n=>e.check(IP(Ej,n)),e.base64=n=>e.check($P(jj,n)),e.base64url=n=>e.check(MP(Fj,n)),e.xid=n=>e.check(TP(Cj,n)),e.ksuid=n=>e.check(RP(Ij,n)),e.ipv4=n=>e.check(_P(Tj,n)),e.ipv6=n=>e.check(PP(Rj,n)),e.cidrv4=n=>e.check(jP(_j,n)),e.cidrv6=n=>e.check(FP(Pj,n)),e.e164=n=>e.check(AP($j,n)),e.datetime=n=>e.check(ij(n)),e.date=n=>e.check(aj(n)),e.time=n=>e.check(uj(n)),e.duration=n=>e.check(dj(n))});function fe(e){return hP(vj,e)}const We=Z("ZodStringFormat",(e,t)=>{ze.init(e,t),Lx.init(e,t)}),yj=Z("ZodEmail",(e,t)=>{E_.init(e,t),We.init(e,t)}),ng=Z("ZodGUID",(e,t)=>{S_.init(e,t),We.init(e,t)}),wa=Z("ZodUUID",(e,t)=>{k_.init(e,t),We.init(e,t)}),wj=Z("ZodURL",(e,t)=>{C_.init(e,t),We.init(e,t)}),xj=Z("ZodEmoji",(e,t)=>{I_.init(e,t),We.init(e,t)}),bj=Z("ZodNanoID",(e,t)=>{T_.init(e,t),We.init(e,t)}),Sj=Z("ZodCUID",(e,t)=>{R_.init(e,t),We.init(e,t)}),kj=Z("ZodCUID2",(e,t)=>{__.init(e,t),We.init(e,t)}),Ej=Z("ZodULID",(e,t)=>{P_.init(e,t),We.init(e,t)}),Cj=Z("ZodXID",(e,t)=>{j_.init(e,t),We.init(e,t)}),Ij=Z("ZodKSUID",(e,t)=>{F_.init(e,t),We.init(e,t)}),Tj=Z("ZodIPv4",(e,t)=>{L_.init(e,t),We.init(e,t)}),Rj=Z("ZodIPv6",(e,t)=>{z_.init(e,t),We.init(e,t)}),_j=Z("ZodCIDRv4",(e,t)=>{D_.init(e,t),We.init(e,t)}),Pj=Z("ZodCIDRv6",(e,t)=>{O_.init(e,t),We.init(e,t)}),jj=Z("ZodBase64",(e,t)=>{B_.init(e,t),We.init(e,t)}),Fj=Z("ZodBase64URL",(e,t)=>{W_.init(e,t),We.init(e,t)}),$j=Z("ZodE164",(e,t)=>{H_.init(e,t),We.init(e,t)}),Mj=Z("ZodJWT",(e,t)=>{Z_.init(e,t),We.init(e,t)}),zx=Z("ZodNumber",(e,t)=>{Mx.init(e,t),Ke.init(e,t),e.gt=(r,o)=>e.check(eg(r,o)),e.gte=(r,o)=>e.check(fc(r,o)),e.min=(r,o)=>e.check(fc(r,o)),e.lt=(r,o)=>e.check(Jh(r,o)),e.lte=(r,o)=>e.check(dc(r,o)),e.max=(r,o)=>e.check(dc(r,o)),e.int=r=>e.check(rg(r)),e.safe=r=>e.check(rg(r)),e.positive=r=>e.check(eg(0,r)),e.nonnegative=r=>e.check(fc(0,r)),e.negative=r=>e.check(Jh(0,r)),e.nonpositive=r=>e.check(dc(0,r)),e.multipleOf=(r,o)=>e.check(tg(r,o)),e.step=(r,o)=>e.check(tg(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 BP(zx,e)}const Aj=Z("ZodNumberFormat",(e,t)=>{Y_.init(e,t),zx.init(e,t)});function rg(e){return VP(Aj,e)}const Nj=Z("ZodBoolean",(e,t)=>{K_.init(e,t),Ke.init(e,t)});function dn(e){return WP(Nj,e)}const Lj=Z("ZodUnknown",(e,t)=>{G_.init(e,t),Ke.init(e,t)});function Xo(){return HP(Lj)}const zj=Z("ZodNever",(e,t)=>{X_.init(e,t),Ke.init(e,t)});function Dj(e){return UP(zj,e)}const Oj=Z("ZodArray",(e,t)=>{q_.init(e,t),Ke.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(Sl(n,r)),e.nonempty=n=>e.check(Sl(1,n)),e.max=(n,r)=>e.check(Ax(n,r)),e.length=(n,r)=>e.check(Nx(n,r)),e.unwrap=()=>e.element});function Wn(e,t){return nj(Oj,e,t)}const Bj=Z("ZodObject",(e,t)=>{Q_.init(e,t),Ke.init(e,t),Le(e,"shape",()=>t.shape),e.keyof=()=>so(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Xo()}),e.loose=()=>e.clone({...e._zod.def,catchall:Xo()}),e.strict=()=>e.clone({...e._zod.def,catchall:Dj()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>CR(e,n),e.merge=n=>IR(e,n),e.pick=n=>kR(e,n),e.omit=n=>ER(e,n),e.partial=(...n)=>TR(Ox,e,n[0]),e.required=(...n)=>RR(Bx,e,n[0])});function we(e,t){const n={type:"object",get shape(){return Tp(this,"shape",{...e}),this.shape},...le(t)};return new Bj(n)}const Vj=Z("ZodUnion",(e,t)=>{J_.init(e,t),Ke.init(e,t),e.options=t.options});function Dx(e,t){return new Vj({type:"union",options:e,...le(t)})}const Wj=Z("ZodIntersection",(e,t)=>{eP.init(e,t),Ke.init(e,t)});function Hj(e,t){return new Wj({type:"intersection",left:e,right:t})}const Uj=Z("ZodRecord",(e,t)=>{tP.init(e,t),Ke.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Sr(e,t,n){return new Uj({type:"record",keyType:e,valueType:t,...le(n)})}const Hd=Z("ZodEnum",(e,t)=>{nP.init(e,t),Ke.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 Hd({...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 Hd({...t,checks:[],...le(o),entries:i})}});function so(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Hd({type:"enum",entries:n,...le(t)})}const Zj=Z("ZodTransform",(e,t)=>{rP.init(e,t),Ke.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=i=>{if(typeof i=="string")n.issues.push(vs(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(vs(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function Yj(e){return new Zj({type:"transform",transform:e})}const Ox=Z("ZodOptional",(e,t)=>{oP.init(e,t),Ke.init(e,t),e.unwrap=()=>e._zod.def.innerType});function og(e){return new Ox({type:"optional",innerType:e})}const Kj=Z("ZodNullable",(e,t)=>{iP.init(e,t),Ke.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ig(e){return new Kj({type:"nullable",innerType:e})}const Gj=Z("ZodDefault",(e,t)=>{sP.init(e,t),Ke.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Xj(e,t){return new Gj({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const qj=Z("ZodPrefault",(e,t)=>{aP.init(e,t),Ke.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Qj(e,t){return new qj({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Bx=Z("ZodNonOptional",(e,t)=>{lP.init(e,t),Ke.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Jj(e,t){return new Bx({type:"nonoptional",innerType:e,...le(t)})}const eF=Z("ZodCatch",(e,t)=>{uP.init(e,t),Ke.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function tF(e,t){return new eF({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const nF=Z("ZodPipe",(e,t)=>{cP.init(e,t),Ke.init(e,t),e.in=t.in,e.out=t.out});function sg(e,t){return new nF({type:"pipe",in:e,out:t})}const rF=Z("ZodReadonly",(e,t)=>{dP.init(e,t),Ke.init(e,t)});function oF(e){return new rF({type:"readonly",innerType:e})}const iF=Z("ZodCustom",(e,t)=>{fP.init(e,t),Ke.init(e,t)});function sF(e){const t=new Ft({check:"custom"});return t._zod.check=e,t}function aF(e,t={}){return rj(iF,e,t)}function lF(e){const t=sF(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(vs(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(vs(o))}},e(n.value,n)));return t}const yu=so(["full-bleed","video-top","pip-bubble","graphic-only","blurred-behind","lower-third","split-left","split-right"]),wu=so(["TitleCard","StatCard","RuleCard","StrikethroughReveal","FlowDiagram","TerminalMock","ChatMock","ScreenshotFrame","BulletList"]),uF=we({startWord:de().int().nonnegative(),endWord:de().int().nonnegative()});we({id:fe(),anchor:uF,layout:yu,component:wu,props:Sr(fe(),Xo()),overrides:Sr(fe(),Xo()).default({}),rationale:fe().optional()});we({id:fe(),kind:so(["graphic","plain"]).optional(),layout:yu,component:wu.optional(),props:Sr(fe(),Xo()).optional(),startSec:de().nonnegative(),endSec:de().nonnegative(),graphicRect:we({x:de(),y:de(),w:de(),h:de()}).optional(),elements:Sr(fe(),we({dx:de().optional(),dy:de().optional(),scale:de().positive().optional(),hidden:dn().optional()})).optional(),video:we({scale:de().positive().max(4).optional(),dy:de().optional(),dx:de().optional(),autoZoom:dn().optional()}).optional(),pip:we({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'})});we({centerYFrac:de().min(0).max(1),sizeFrac:de().min(0).max(1).optional(),centerXFrac:de().min(0).max(1).optional(),sourceAspect:de().positive().optional(),subject:so(["face","screen"]).optional()});const Pp=we({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")}),cF=Pp.parse({}),dF=we({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()}),fF=we({label:fe().min(1).max(28),value:fe().min(1).max(12),caption:fe().max(40).optional(),inverted:dn().default(!1)}),pF=we({kicker:fe().min(1).max(24),text:fe().min(1).max(40),struck:fe().max(40).optional()}),mF=we({lines:Wn(we({text:fe().min(1).max(32),struck:dn().default(!1),mark:so(["none","cross","check"]).default("none")})).min(1).max(4)}),hF=we({title:fe().max(28).optional(),items:Wn(fe().min(1).max(36)).min(2).max(5)}),gF=we({nodes:Wn(fe().min(1).max(16)).min(2).max(5),emphasizeLast:dn().default(!0)}),vF=we({windows:Wn(we({title:fe().max(24),lines:Wn(fe().max(40)).min(1).max(6)})).min(1).max(5),fanOut:fe().max(20).optional()}),yF=we({messages:Wn(we({from:so(["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'.")}),wF=we({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)}),xF={TitleCard:{propsSchema:dF,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:fF,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:pF,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:mF,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:gF,defaultProps:{nodes:["A","B"]},defaultLayout:"graphic-only",altLayouts:[],whenToUse:"A causal chain or pipeline as chips with arrows (TEAM → AI AGENTS → CHURN)."},TerminalMock:{propsSchema:vF,defaultProps:{windows:[{title:"terminal-01",lines:["$ run"]}]},defaultLayout:"graphic-only",altLayouts:[],whenToUse:"Anything about running code/processes/agents — stylized terminal windows."},ChatMock:{propsSchema:yF,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:wF,defaultProps:{},defaultLayout:"video-top",altLayouts:["blurred-behind"],whenToUse:"Reference to a document/PR/review — a framed screenshot look with a label chip."},BulletList:{propsSchema:hF,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 ag(e,t,n={}){const r=xF[e],o={...r.defaultProps,...t,...n},i=r.propsSchema.safeParse(o);return i.success?i.data:null}const bF=we({dx:de().optional(),dy:de().optional(),scale:de().positive().optional(),hidden:dn().optional()}),Vx=we({props:Sr(fe(),Xo()).default({}),elements:Sr(fe(),bF).default({}),timing:we({startSec:de().nonnegative(),endSec:de().nonnegative()}).optional(),component:wu.optional(),layout:yu.optional(),video:we({scale:de().positive().max(4).optional(),dy:de().optional(),dx:de().optional(),autoZoom:dn().optional()}).optional(),pip:we({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:we({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()}),SF=we({text:fe().min(1).max(80),was:fe()});function kF(e,t,n){var r;return((r=e[t])==null?void 0:r.was)??n}function Wx(e){return String(Math.round(e*1e3))}const EF=Dx([we({at:de().finite().nonnegative(),id:fe().min(1)}),de().finite().nonnegative().transform(e=>({at:e,id:Wx(e)}))]);function CF(e,t){const n=Wx(e),r=new Set(t.map(o=>o.id));if(!r.has(n))return n;for(let o=2;;o++){const i=`${n}-${o}`;if(!r.has(i))return i}}const IF=we({theme:Pp.partial().default({}),captionsHidden:dn().optional(),scenes:Sr(fe(),Vx).default({}),captions:Sr(fe(),SF).default({}),splits:Wn(EF).default([]),cuts:Wn(we({startSec:de().nonnegative(),endSec:de().nonnegative(),src:we({startSec:de().nonnegative(),endSec:de().nonnegative()}).optional()})).default([])}),TF=()=>IF.parse({});function RF(e,t){return ag(e,{},t)??ag(e,{},{})}function _F(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 Ud(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=_F(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?RF(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 kl=.3;function jp(e,t){const n=[...e];for(const r of[...t].sort((o,i)=>o.at-i.at)){const o=n.findIndex(s=>r.at>=s.startSec+kl&&r.at<=s.endSec-kl);if(o===-1)continue;const i=n[o];n.splice(o,1,{...i,endSec:r.at},{...i,id:`${i.id.split("@")[0]}@${r.id}`,startSec:r.at})}return n}function Hx(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 PF(e,t){return Hx(jp(e,t.splits),t)}function Ux(e){if(!Number.isFinite(e))throw new Error(`captionKeyFor: caption words need a finite srcStart (§137), got ${String(e)} — run backfillSrcStart on lines read from a pre-§137 render-props.json`);return`w${Math.round(e*1e3)}`}function Fp(e){return/^\d+$/.test(e)}function Ns(e){return!e||!Number.isFinite(e.srcStart)?null:Ux(e.srcStart)}const jF=8;function FF(e,t,n){var i,s;if(!Fp(e))return{to:e};const r=Number(e);if(((i=n[r])==null?void 0:i.text)===t.was)return lg(n[r]);const o=[];for(let a=1;a<=jF;a++)for(const l of[r-a,r+a])((s=n[l])==null?void 0:s.text)===t.was&&o.push(l);return o.length===0?{to:null,reason:n.some(l=>l.text===t.was)?"out-of-range":"not-found"}:o.length>1?{to:null,reason:"ambiguous"}:lg(n[o[0]])}function lg(e){const t=Ns(e);return t===null?{to:null,reason:"unanchorable"}:{to:t}}function $F(e,t){const n=t.flatMap(a=>a.words),r={},o=[],i=Object.entries(e).map(([a,l])=>({key:a,edit:l,legacy:Fp(a),claim:FF(a,l,n)})),s=new Map;for(const a of i){if(a.claim.to===null)continue;const l=s.get(a.claim.to);l?l.push(a):s.set(a.claim.to,[a])}for(const a of i){if(a.claim.to===null){o.push({key:a.key,was:a.edit.was,reason:a.claim.reason});continue}const l=s.get(a.claim.to),u=l.length===1?l[0]:l.find(f=>!f.legacy);if(u===a){r[a.claim.to]=a.edit;continue}o.push({key:a.key,was:a.edit.was,reason:u===void 0?"collision":"superseded"})}return{edits:r,unresolved:o}}function MF(e,t){const n={...t.edits};for(const r of t.unresolved){if(r.reason==="superseded")continue;const o=e[r.key];o!==void 0&&(n[r.key]=o)}return n}function AF(e,t){const n=[];if(Object.keys(t).length===0)return{lines:[...e],dropped:n};const r=new Set,o=e.map(i=>({...i,words:i.words.map(s=>{const a=Ns(s);if(a===null)return s;const l=t[a];return l?r.has(a)?(n.push({key:a,expected:l.was,found:s.text,reason:"duplicate-anchor"}),s):(r.add(a),s.text!==l.was?(n.push({key:a,expected:l.was,found:s.text}),s):{...s,text:l.text}):s})}));for(const[i,s]of Object.entries(t))r.has(i)||n.push({key:i,expected:s.was,found:null});return{lines:o,dropped:n}}function NF(e,t){return Pp.parse({...e,...t.theme})}function ug(e,t,n,r){const o=e.scenes[t]??Vx.parse({});return{...e,scenes:{...e.scenes,[t]:{...o,elements:{...o.elements,[n]:{...o.elements[n],...r}}}}}}function LF(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 zF(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 DF(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 OF(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 Zx(e){const t=e.indexOf("@");return t===-1?e:e.slice(0,t)}const BF=.6;function VF(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 WF(e,t){const n=t.outputDurationSec,r=[...e].sort((f,p)=>f.startSec-p.startSec);if(n<=0)return r;const o=VF(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 x=m[h],v=m[h+1];if(v-x<BF)continue;let k=0;for(let y=0;y<o.length;y++)o[y]<=x+1e-9&&(k=y);a.push({start:x,end:v,clip:k})}}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 HF=1.05;function UF(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}class YF{constructor(t){Se(this,"spans");Se(this,"outputDuration");let n=-1/0;for(const i of t){if(i.srcOut<i.srcIn)throw new Error(`segment ends before it starts: ${i.srcIn}..${i.srcOut}`);if(i.srcIn<n)throw new Error(`cutlist segments overlap at ${i.srcIn}`);n=i.srcOut}const r=[];let o=0;for(const i of t){if(i.kind!=="keep"||i.srcOut<=i.srcIn)continue;const s=i.srcOut-i.srcIn;r.push({srcIn:i.srcIn,srcOut:i.srcOut,outIn:o,outOut:o+s}),o+=s}this.spans=r,this.outputDuration=o}toOutput(t){for(const i of this.spans)if(t>=i.srcIn&&t<=i.srcOut)return i.outIn+(t-i.srcIn);const n=1e-9;let r=null,o=1/0;for(const i of this.spans){const s=t<i.srcIn?i.srcIn-t:t-i.srcOut;s<o&&(o=s,r=i)}if(r&&o<=n){const i=Math.min(Math.max(t,r.srcIn),r.srcOut);return r.outIn+(i-r.srcIn)}return null}toOutputClamped(t){const n=this.toOutput(t);if(n!==null)return n;let r=0;for(const o of this.spans)if(o.srcOut<=t)r=o.outOut;else if(o.srcIn>=t)return o.outIn;return r}toSource(t){const n=this.spans;if(n.length===0)return 0;const r=n[0];if(t<=r.outIn)return r.srcIn;for(const o of n)if(t>=o.outIn&&t<=o.outOut)return o.srcIn+(t-o.outIn);return n[n.length-1].srcOut}mapWord(t){const n=(t.start+t.end)/2;if(this.toOutput(n)===null&&this.toOutput(t.start)===null&&this.toOutput(t.end)===null)return null;const r=this.toOutputClamped(t.start),o=this.toOutputClamped(t.end);return o<=r?null:{start:r,end:o}}}function Yx(e){return new YF(e.map(t=>({srcIn:t.srcIn,srcOut:t.srcOut,kind:"keep"})))}function cg(e,t){const n=o=>o.words;if(e.every(o=>n(o).every(i=>i.srcStart!==void 0)))return[...e];const r=Yx(t);return e.map(o=>({...o,words:n(o).map(i=>i.srcStart===void 0?{...i,srcStart:r.toSource(i.start)}:i)}))}const KF=/[\p{Script=Arabic}\p{Script=Hebrew}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Nko}]/u,GF=new RegExp("\\p{L}","u");function Kx(e){for(const t of e){if(KF.test(t))return"rtl";if(GF.test(t))return"ltr"}return"ltr"}const Zd="Noto Nastaliq Urdu",XF="fonts/NotoNastaliqUrdu-Bold.ttf";function qF(e){return e.some(t=>Kx(t.words.map(n=>n.text).join(" "))==="rtl")}const $t={width:1080,height:1920};$t.width;$t.height;const Ls={centerYFrac:.38,sizeFrac:.22},QF=.35,JF=.45,Gx=1-1/HF,e4=.4*Gx,t4=.6*Gx;function Xx(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 n4(e,t,n=$t){if(t.subject==="screen")return .5;const r=e.h*n.height,o=Xx(e,t,n),i=o-r;if(i<=1)return .5;const s=t.sizeFrac??Ls.sizeFrac,a=(t.centerYFrac-s/2-QF*s)*o,l=(t.centerYFrac+s/2)*o,u=(a+l)/2-JF*r,f=a-e4*r,p=l+t4*r-r,m=p<=f?Math.min(Math.max(u,p),f):p;return Math.min(1,Math.max(0,m/i))}function r4(e,t,n,r,o=$t){if(r.length===0)return e;const i=t.h*o.height,s=Xx(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(w=>{const b=w.y,S=w.y+w.h,C=f+l,E=b<f&&f<S,T=b<C&&C<S;return E||T});if(!m)break;const h=[],x=m.y+m.h;x<=u&&h.push(x);const v=m.y-l;if(v>=0&&h.push(v),m.h<=l){const w=Math.max(0,m.y+m.h-l),b=Math.min(u,m.y);w<=b&&h.push(Math.min(Math.max(f,w),b))}const k=n.sizeFrac??Ls.sizeFrac,y=n.centerYFrac+k/2,g=h.filter(w=>w+l>=y);if(g.length===0)return e;f=g.reduce((w,b)=>Math.abs(b-f)<Math.abs(w-f)?b:w)}return Math.min(1,Math.max(0,f/u))}function o4(e,t,n=$t){if(t.subject==="screen")return .5;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 i4={top:.12,bottom:.22,right:.16,left:.04},s4={top:.06,bottom:.12,right:.05,left:.05};function wn(e=$t){return e.width>e.height?s4:i4}function a4(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 l4=.08,u4=.05;function El(e,t=$t){const n=a4(t),r=1e-9,o=(u,f,p)=>u<f-r?f:u>p+r?p:u,i=o(e.w,l4,n.w),s=o(e.h,u4,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 dg=.045;function c4(e){return e.width>e.height?44:64}const jn={x:0,y:0,w:1,h:1},pc=.3,mo={x:.5-pc/2,y:.66,w:pc,h:pc*1080/1920};function Gr(e,t=Ls,n=[],r=$t){const o=a=>r4(n4(a,t,r),a,t,n,r),i=a=>o4(a,t,r),s=r.width>r.height;switch(e){case"full-bleed":return{video:{rect:jn,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(jn),objectPosX:i(jn)},graphic:null,captionAnchor:s?.8:.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:jn,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(jn),objectPosX:i(jn)},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:mo,cornerRadius:1,blurPx:0,dim:0,opacity:1,objectPosY:o(mo),objectPosX:i(mo)},graphic:{x:.06,y:.14,w:.78,h:.42},captionAnchor:s?.78:.61};case"graphic-only":return{video:{rect:mo,cornerRadius:1,blurPx:0,dim:0,opacity:0,objectPosY:o(mo),objectPosX:i(mo)},graphic:{x:.04,y:.14,w:.8,h:.54},captionAnchor:s?.8:.73};case"blurred-behind":return{video:{rect:jn,cornerRadius:0,blurPx:22,dim:.55,opacity:1,objectPosY:o(jn),objectPosX:i(jn)},graphic:{x:.07,y:.24,w:.77,h:.36},captionAnchor:s?.8:.69}}}const d4={x:.07,y:.24,w:.77,h:.36};function qx(e,t=$t){return e.graphicRect?El(e.graphicRect,t):Gr(e.layout,Ls,[],t).graphic??d4}const Qx=.35;function vr(e,t){for(const n of e)if(t>=n.startSec&&t<n.endSec)return n;return null}function Kt(e,t,n){return e+(t-e)*n}function f4(e,t,n){return{x:Kt(e.x,t.x,n),y:Kt(e.y,t.y,n),w:Kt(e.w,t.w,n),h:Kt(e.h,t.h,n)}}function fg(e,t,n){return{rect:f4(e.rect,t.rect,n),cornerRadius:Kt(e.cornerRadius,t.cornerRadius,n),blurPx:Kt(e.blurPx,t.blurPx,n),dim:Kt(e.dim,t.dim,n),opacity:Kt(e.opacity,t.opacity,n),objectPosY:Kt(e.objectPosY,t.objectPosY,n),objectPosX:Kt(e.objectPosX,t.objectPosX,n)}}function Cl(e){return e*e*(3-2*e)}function Jx(e){return e.filter(t=>!(t.kind==="plain"&&t.layout==="full-bleed"))}function mc(e,t,n,r){const o=Gr(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 p4(e,t,n=Ls,r=[],o=$t){const i=Jx(e),s=r.filter(y=>t>=y.startSec&&t<y.endSec),a=Gr("full-bleed",n,s,o).video,l=vr(i,t);if(!l)return a;const u=mc(l,n,s,o),f=Math.min(Qx,(l.endSec-l.startSec)/2),p=t-l.startSec,m=l.endSec-t,h=vr(i,l.startSec-.001),x=vr(i,l.endSec+.001),v=h?mc(h,n,s,o):a,k=x?mc(x,n,s,o):a;return p<f?fg(v,u,Cl(p/f)):m<f?fg(u,k,Cl(1-m/f)):u}function m4(e,t,n,r){return[n!==0||r!==0?`translate(${n}px, ${r}px)`:"",e*t!==1?`scale(${e*t})`:""].filter(Boolean).join(" ")||void 0}function hc(e){return e==="pip-bubble"||e==="graphic-only"?1:0}function h4(e,t){const n=Jx(e),r=vr(n,t);if(!r)return 0;const o=hc(r.layout),i=Math.min(Qx,(r.endSec-r.startSec)/2),s=vr(n,r.startSec-.001),a=vr(n,r.endSec+.001),l=s?hc(s.layout):0,u=a?hc(a.layout):0,f=t-r.startSec,p=r.endSec-t;return f<i?Kt(l,o,Cl(f/i)):p<i?Kt(o,u,Cl(1-p/i)):o}function g4(e,t,n){return e.filter(r=>(r.startSec??Number.NEGATIVE_INFINITY)<n&&(r.endSec??Number.POSITIVE_INFINITY)>t)}function v4(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 y4(e,t,n,r=$t){const o=Gr(e,void 0,[],r),i=wn(r),s=o.captionAnchor,a=l=>{const u={y:l-dg,h:dg*2};if(u.y<i.top||u.y+u.h>1-i.bottom||v4(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 w4=.3,x4=.3,b4=.133,$p=e=>e*(2-e);function e1(e,t=w4,n=x4){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 pg=.4;function S4(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 k4(e,t){return t?e>=t.startSec-pg&&e<=t.endSec+pg:!1}function E4(e,t){return e??c4(t)}function C4(e){return e*10/64}function I4(e){return{fontFamily:(e==null?void 0:e.fontDisplay)??"'Inter', 'Helvetica Neue', 'Arial Black', Arial, sans-serif",color:(e==null?void 0:e.fg)??"white"}}function T4(e,t){return e==="rtl"?`'${Zd}', ${t}`:t}function R4(e){return e==="rtl"?1.9:1.15}const _4=()=>{const[e]=te.useState(()=>_k(`load ${Zd}`));return te.useEffect(()=>{let t=!1;const n=()=>{t||(t=!0,Pk(e))};return new FontFace(Zd,`url("${wp(XF)}") format("truetype")`,{weight:"900"}).load().then(o=>{document.fonts.add(o),n()},n),n},[e]),null},P4=({line:e,wordOffset:t,verticalAnchor:n,fontSizePx:r,activeColor:o,fontFamily:i,textColor:s,ctaKeyword:a,ctaWindow:l})=>{const u=ct(),{fps:f,width:p,height:m}=Xe(),h=wn({width:p,height:m}),x=e.start+u/f,v=Kx(e.words.map(k=>k.text).join(" "));return c.jsx(pn,{style:{pointerEvents:"none"},children:c.jsx("div",{style:{position:"absolute",top:`${n*100}%`,left:0,right:0,transform:"translateY(-50%)",direction:v,display:"flex",justifyContent:"center",gap:"0.28em",flexWrap:"wrap",paddingLeft:`${h.left*100}%`,paddingRight:`${h.right*100}%`,fontFamily:T4(v,i),fontWeight:900,fontSize:r,lineHeight:R4(v),textAlign:"center",color:s,WebkitTextStroke:`${C4(r)}px rgba(0,0,0,0.85)`,paintOrder:"stroke fill",textShadow:`0 4px ${r*24/64}px rgba(0,0,0,0.55)`},children:e.words.map((k,y)=>{const g=Math.max(k.end,k.start+.12),w=x>=k.start&&x<=g,b=w?Math.min(1,(x-k.start)/b4):0,S=$p(b);return c.jsx("span",{"data-caption-word":t+y,"data-caption-text":k.text,"data-caption-src":Ns(k)===null?void 0:k.srcStart,style:{display:"inline-block",pointerEvents:"auto",transform:S>0?`scale(${1+.08*S})`:"scale(1)",color:w?o:s},children:S4(k.text,k4(k.start,l)?a:void 0)},y)})})})},j4=({lines:e,cues:t=[],verticalAnchor:n=.76,fontSizePx:r,activeColor:o="#FFE14D",theme:i,ctaKeyword:s,ctaWindow:a,sourceTextRegions:l=[]})=>{const{fps:u,width:f,height:p}=Xe(),m={width:f,height:p},h=E4(r,m),{fontFamily:x,color:v}=I4(i),k=[];let y=0;for(const g of e)k.push(y),y+=g.words.length;return c.jsxs(pn,{children:[qF(e)?c.jsx(_4,{}):null,e.map((g,w)=>{const b=t.length>0?vr(t,g.start):null,S=(b==null?void 0:b.captionY)!==void 0?b.captionY:t.length>0||l.length>0?y4((b==null?void 0:b.layout)??"full-bleed",g4(l,g.start,g.end),b==null?void 0:b.graphicRect,m):n,{from:C,durationInFrames:E}=Ep(g.start,g.end,u);return c.jsx(dt,{from:C,durationInFrames:E,children:c.jsx(P4,{line:g,wordOffset:k[w],verticalAnchor:S,fontSizePx:h*((b==null?void 0:b.captionScale)??1),activeColor:o,fontFamily:x,textColor:v,ctaKeyword:s,ctaWindow:a})},w)})]})};function t1(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)*mg(r),p=-t.y*u+(n.height-l*u)*mg(o);return{width:i*u,height:s*u,left:f,top:p}}function mg(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):.5}function n1(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 F4(e,t){return n1(e,{x:0,y:0,w:e.width,h:e.height},t)}function r1(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 $4(e,t,n,r,o,i){return e==="fit"?n1(t,n,r):t1(t,n,r,o,i)}function M4(e,t,n,r){return e.length===0?{x:0,y:0,w:r.width,h:r.height,full:!0}:ZF(e,r1(t,n),r)}function A4(e,t,n){if(e.length===0)return null;const r=r1(t,n);if(r<e[0].startSec)return e[0];for(const o of e)if(r>=o.startSec&&r<o.endSec)return o;return e[e.length-1]}function N4(e,t,n,r,o,i,s,a,l){if(!o)return null;if(e&&e.length>0){const f=A4(e,n,r);if(f)return t1(o,f.window,s,f.bias.x,f.bias.y)}if(!t||t.length<2)return null;const u=M4(t,n,r,o);return u.full?null:$4(i,o,u,s,a,l)}const L4=({cues:e,theme:t,face:n,zoomPlan:r,sourceTextRegions:o,contentTimeline:i,framingTimeline:s,spans:a,sourceSize:l,contentCropMode:u="cover",sourceFit:f="cover",children:p})=>{const m=ct(),{fps:h,width:x,height:v}=Xe(),k=m/h,g=p4(e,k,n??void 0,o??[],{width:x,height:v}),w=h4(e,k),b=g.rect.w*x,S=g.rect.h*v,C=g.cornerRadius*Math.min(b,S)/2,E=vr(e,k),T=E==null?void 0:E.video,_=r&&r.length>0?UF(r,k):1,j=Math.max(0,g.opacity*(1-.6*g.cornerRadius)),A=(T==null?void 0:T.autoZoom)!==!1,z=f==="contain"&&l!==void 0,$=A&&!z?1+(_-1)*j:1,M=(T==null?void 0:T.scale)??1,W=(T==null?void 0:T.dx)??0,D=(T==null?void 0:T.dy)??0,R=m4($,M,W,D);return c.jsxs(pn,{children:[c.jsx(pn,{style:{background:t.bg,opacity:w}}),c.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:b,height:S,borderRadius:C,overflow:"hidden",opacity:g.opacity,backgroundColor:z?t.bg:void 0,boxShadow:g.cornerRadius>.5?"0 18px 60px rgba(0,0,0,0.55)":void 0},children:[c.jsx("div",{style:{position:"absolute",inset:0,filter:g.blurPx>.5?`blur(${g.blurPx}px)`:void 0,transform:R,transformOrigin:"50% 40%","--ossclip-obj-y":`${g.objectPosY*100}%`,"--ossclip-obj-x":`${g.objectPosX*100}%`},children:z?c.jsx(z4,{source:l,slot:{width:b,height:S},children:p}):c.jsx(D4,{timeline:i,framing:s,spans:a,sourceSize:l,mode:u,tSec:k,slot:{width:b,height:S},posX:g.objectPosX,posY:g.objectPosY,children:p})}),c.jsx("div",{style:{position:"absolute",inset:0,background:"black",opacity:g.dim}})]})]})},z4=({source:e,slot:t,children:n})=>{const r=F4(e,t);return c.jsx("div",{style:{position:"absolute",width:r.width,height:r.height,left:r.left,top:r.top},children:n})},D4=({timeline:e,framing:t,spans:n,sourceSize:r,mode:o,tSec:i,slot:s,posX:a,posY:l,children:u})=>{const f=N4(t,e,n??[],i,r,o,s,a,l);return f?c.jsx("div",{style:{position:"absolute",width:f.width,height:f.height,left:f.left,top:f.top},children:u}):c.jsx("div",{style:{position:"absolute",inset:0},children:u})},Mp=.94,O4=new Set(["FlowDiagram","StrikethroughReveal","ChatMock","BulletList"]),hg=2.4,xa=.45,xu=.58,ht=.72,B4=.62;function vo(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 Ae=e=>typeof e=="string"?e:"",sr=e=>Array.isArray(e)?e:[];function V4(e,t,n,r=1/0){switch(e){case"TitleCard":{const o=n-80,i=Ae(t.emphasis),s=28;let a=0,l=0;Ae(t.eyebrow)&&(a+=34*1.2,l++),i&&(a+=210*.95,l++);const u=i?64:96;return a+=vo(Ae(t.title).length,u,o,1.05,ht),l++,Ae(t.sub)&&(a+=vo(Ae(t.sub).length,40,o,1.2,xu),l++),a+s*Math.max(0,l-1)}case"StatCard":{const o=vo(Ae(t.label).length,42,n*.55,1.15,ht);let i=88+Math.max(o,110*1.15)+4;return Ae(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+=vo(Ae(t.text).length,72,o,1.02,ht),Ae(t.struck)&&(i+=26+vo(Ae(t.struck).length,44,o,1.2,ht)),i}case"StrikethroughReveal":{const o=sr(t.lines).map(a=>Ae(a==null?void 0:a.text)),i=l1(o,n,r),s=o.reduce((a,l)=>a+a1(l,i,n).length,0);return s*i*1.08+i*.2*Math.max(0,s-1)}case"FlowDiagram":{const o=sr(t.nodes).map(l=>Ae(l)),i=Math.max(1,o.length),{mode:s,fontSize:a}=h1(o,n,r);return s==="row"?a*Ki+4:a*(Ki*i+m1*(i-1))}case"TerminalMock":{const o=sr(t.windows);let i=0;for(const s of o){const a=sr(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),Ae(t.fanOut)&&(i+=22+40*1.2),i}case"ChatMock":{const o=f1(t).map(s=>s.text),i=p1(o,{widthPx:n,heightPx:r});return d1(o,i,n)}case"ScreenshotFrame":{const o=n*.94;return(Ae(t.src)?o*9/16:480)+4}case"BulletList":{const o=sr(t.items).map(s=>Ae(s)),i=s1(o,n,r,!!Ae(t.title),Ae(t.title));return Y4(o.length,i,!!Ae(t.title))}}}const Jn=e=>Ae(e).split(/\s+/).reduce((t,n)=>Math.max(t,n.length),0);function W4(e,t){switch(e){case"RuleCard":{const n=Jn(t.kicker)*30*(ht+.28),r=Jn(t.text)*72*ht,o=Jn(t.struck)*44*(ht+.04),i=Math.max(n,r,o);return i>0?156+i:0}case"TitleCard":{const n=Ae(t.emphasis)?64:96,r=Jn(t.eyebrow)*34*(ht+.35),o=Jn(t.emphasis)*210*ht,i=Jn(t.title)*n*(ht+.02),s=Jn(t.sub)*40*xu,a=Math.max(r,o,i,s);return a>0?80+a:0}case"TerminalMock":{let n=0;for(const r of sr(t.windows))for(const o of sr(r==null?void 0:r.lines))n=Math.max(n,Ae(o).length);return n>0?108+n*27*B4:0}case"StatCard":{const n=Ae(t.value).length*110*ht;return n===0?0:164+Jn(t.label)*42*ht+40+n}default:return 0}}const gg=36,H4=120,o1=1.6,i1=.88,U4=(ht+.28)*.36,Z4=1.1;function Y4(e,t,n){return(Math.max(1,e)*o1+(n?i1:0))*t}function s1(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 gg;const s=Math.min(t/(i*ht+Z4),o?t/(o.length*U4):1/0),a=n*Mp/(Math.max(1,e.length)*o1+(r?i1:0));return Math.max(gg,Math.min(H4,Math.floor(Math.min(s,a))))}const K4=92,G4=44,X4=150,q4=[" → "," -> "," → "," > "];function a1(e,t,n){const r=o=>o.length*t*ht<=n;if(r(e))return[e];for(const o of q4){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 l1(e,t=831,n=1/0){const r=e.reduce((s,a)=>Math.max(s,a.length),0);if(r===0)return K4;const o=t/(r*ht),i=n/(Math.max(1,e.length)*1.28);return Math.max(G4,Math.min(X4,Math.floor(Math.min(o,i))))}const vg=22,yg=44,Q4=96,wg=22,u1=.85,c1=.82;function d1(e,t,n){const o=(n-80)*c1-2*t*u1;let i=0;for(const s of e)i+=vo(s.length,t,o,1.2,xu)+t*1.2+4;return i+t*.5*Math.max(0,e.length-1)}function f1(e){const t=Ae(e.keyword);return t?[{from:"user",text:`"${t.toUpperCase()}"`}]:sr(e.messages).map(n=>{const r=n??{};return{from:r.from==="agent"?"agent":"user",text:Ae(r.text)}})}function p1(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 yg;const s=e.flatMap(p=>p.split(/\s+/)).reduce((p,m)=>Math.max(p,m.length),0),a=p=>o*c1/(p*xu+2*u1),l=Math.min(i,wg),u=i>wg?yg:Q4;let f=Math.floor(Math.min(a(l),a(s),u));for(;f>vg&&d1(e,f,n)>r*Mp;)f-=1;return Math.max(vg,f)}const xg=26,J4=22,e$=76,Ki=2.1,m1=2.05;function h1(e,t,n=1/0){const r=e.reduce((v,k)=>v+k.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/Ki)),f=Math.max(...e.map(v=>v.length),1),p=Ki*o+m1*(o-1),m=Math.floor(Math.min(l/(i*f+s),n/p,e$)),h=u>=xg;return m>=J4?h?u*Ki>=m*p?{mode:"row",fontSize:u}:{mode:"stack",fontSize:m}:{mode:"stack",fontSize:m}:{mode:"row",fontSize:Math.max(xg,u)}}function t$(e,t,n){if(O4.has(e))return 1;const r=n.heightPx*Mp,o=u=>V4(e,t,n.widthPx/u)*u<=r;if(!o(xa))return xa;const i=W4(e,t),s=i>0?n.widthPx/i:hg;let a=xa,l=Math.max(xa,Math.min(hg,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 Pd({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 Xr(e){return{opacity:e,transform:`scale(${.9+.1*e})`}}function n$(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 r$=({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 c.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?c.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?c.jsx("div",{"data-edit-id":"emphasis",style:{...bn(o,40),fontSize:210,fontWeight:900,lineHeight:.95,...Je(n,"emphasis")},children:s}):null,a?null:c.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?c.jsx("div",{"data-edit-id":"sub",style:{...bn(i),fontSize:40,fontWeight:600,color:t.muted,...Je(n,"sub")},children:e.sub}):null]})},o$=({props:e,theme:t,edits:n})=>{const r=ot(0),o=ot(6),i=e.inverted;return c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:30,fontFamily:t.fontDisplay,width:"100%",padding:"0 30px"},children:[c.jsxs("div",{style:{...Xr(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:[c.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}),c.jsx("div",{"data-edit-id":"value",style:{fontSize:110,fontWeight:900,whiteSpace:"nowrap",...Je(n,"value")},children:e.value})]}),e.caption?c.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]})},i$=({props:e,theme:t,edits:n})=>{const r=ot(0),o=ot(8);return c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:26,fontFamily:t.fontDisplay,width:"100%",padding:"0 30px"},children:[c.jsxs("div",{style:{...Xr(r),width:"100%",background:t.fg,color:t.bg,borderRadius:t.radiusPx,padding:"40px 48px",textAlign:"left"},children:[c.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}),c.jsx("div",{"data-edit-id":"text",style:{fontSize:72,fontWeight:900,lineHeight:1.02,textTransform:"uppercase",...Je(n,"text")},children:e.text})]}),e.struck?c.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]})},s$=({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 c.jsxs("div",{"data-edit-id":s,style:{...bn(l,30),position:"relative",display:"inline-block",...Je(a,s)},children:[c.jsxs("span",{style:{fontSize:o,fontWeight:900,textTransform:"uppercase",lineHeight:1.08,whiteSpace:"nowrap",color:t?i.muted:i.fg},children:[n!=="none"?c.jsx("span",{style:{color:n==="cross"?i.danger:i.success,marginRight:"0.3em"},children:n==="cross"?"✗":"✓"}):null,e]}),t?c.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]})},a$=({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=l1(i,n,r),a=e.lines.flatMap((l,u)=>a1(l.text,s,n??831).map((f,p)=>({text:f,struck:l.struck,mark:p===0?l.mark??"none":"none",lineIndex:u})));return c.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:s*.2,textAlign:"center",fontFamily:t.fontDisplay},children:a.map((l,u)=>c.jsx(s$,{text:l.text,struck:l.struck,mark:l.mark,delay:u*6,fontSize:s,theme:t,editId:`line-${l.lineIndex}`,edits:o},u))})},l$=({text:e,emphasized:t,delay:n,fontSize:r,theme:o,editId:i,edits:s})=>{const a=ot(n);return c.jsx("div",{"data-edit-id":i,style:{...Xr(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})},u$=({delay:e,fontSize:t,theme:n,down:r=!1})=>{const o=ot(e);return c.jsx("div",{style:{opacity:o,color:n.muted,fontSize:t*1.15,fontWeight:700,lineHeight:1,paddingLeft:r?0:t*.55},children:r?"↓":"→"})};function c$(e,t=d$,n){return h1(e,t,n)}const d$=864,f$=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const{mode:i,fontSize:s}=c$(e.nodes,n,r),a=i==="row";return c.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)=>c.jsxs("div",{style:{display:"flex",flexDirection:a?"row":"column",alignItems:"center",gap:a?s*.55:s*.45},children:[u>0?c.jsx(u$,{delay:u*6+3,fontSize:s,theme:t,down:!a}):null,c.jsx(l$,{text:l,emphasized:e.emphasizeLast&&u===e.nodes.length-1,delay:u*6,fontSize:s,theme:t,editId:`node-${u}`,edits:o})]},u))})},p$=({title:e,lines:t,delay:n,theme:r,editId:o,edits:i})=>{const s=ot(n);return c.jsxs("div",{"data-edit-id":o,style:{...Xr(s),background:r.cardBg,border:`2px solid ${r.cardBorder}`,borderRadius:r.radiusPx/2,overflow:"hidden",width:"100%",fontFamily:r.fontMono,...Je(i,o)},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 20px",borderBottom:`2px solid ${r.cardBorder}`},children:[["#FF5F57","#FEBC2E","#28C840"].map(a=>c.jsx("div",{style:{width:16,height:16,borderRadius:8,background:a}},a)),c.jsx("div",{style:{marginLeft:10,fontSize:24,color:r.muted},children:e})]}),c.jsx("div",{style:{padding:"18px 22px",display:"flex",flexDirection:"column",gap:8},children:t.map((a,l)=>c.jsx("div",{style:{fontSize:27,color:r.fg,whiteSpace:"pre"},children:a},l))})]})},m$=({props:e,theme:t,edits:n})=>{const r=ot(e.windows.length*6+4);return c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:22,width:"100%",padding:"0 30px"},children:[e.windows.map((o,i)=>c.jsx(p$,{title:o.title,lines:o.lines,delay:i*6,theme:t,editId:`window-${i}`,edits:n},i)),e.fanOut?c.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]})},h$=({from:e,text:t,delay:n,fontSize:r,theme:o,editId:i,edits:s})=>{const a=ot(n),l=e==="user";return c.jsx("div",{"data-edit-id":i,style:{...Xr(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})},g$=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const i=f1(e),s=p1(i.map(a=>a.text),{widthPx:n,heightPx:r});return c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:s*.5,width:"100%",padding:"0 40px"},children:i.map((a,l)=>c.jsx(h$,{from:a.from,text:a.text,delay:l*8,fontSize:s,theme:t,editId:`message-${l}`,edits:o},l))})},v$=({props:e,theme:t,edits:n})=>{const r=ot(0),o=ot(8),i=ct(),{fps:s}=Xe(),a=e.kenBurns?si(i,[0,s*8],[1,1.08],{extrapolateRight:"clamp"}):1,l=e.src?/^https?:\/\//.test(e.src)?e.src:wp(e.src):null;return c.jsxs("div",{"data-edit-id":"image",style:{...Xr(r),position:"relative",width:"94%",...Je(n,"image")},children:[c.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?c.jsx(mp,{src:l,style:{width:"100%",display:"block",transform:`scale(${a})`}}):c.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)=>c.jsx("div",{style:{height:22,width:`${u*100}%`,borderRadius:6,background:f%3===0?t.cardBorder:"#22222B"}},f))})}),e.label?c.jsx("div",{"data-edit-id":"label",style:{...Xr(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]})},y$=({text:e,index:t,fontSize:n,theme:r,edits:o})=>{const i=`item-${t}`,s=ot(t*7);return c.jsxs("div",{"data-edit-id":i,style:{...bn(s,26),display:"flex",alignItems:"baseline",gap:n*.35,...Je(o,i)},children:[c.jsx("span",{style:{fontSize:n*.75,color:r.accent,fontWeight:900},children:"▸"}),c.jsx("span",{style:{fontSize:n,fontWeight:900,textTransform:"uppercase",lineHeight:1.15,whiteSpace:"nowrap",color:r.fg},children:e})]})},w$=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const i=s1(e.items,n,r,!!e.title,e.title),s=ot(0);return c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:i*.45,fontFamily:t.fontDisplay},children:[e.title?c.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)=>c.jsx(y$,{text:a,index:l,fontSize:i,theme:t,edits:o},l))]})},x$={TitleCard:r$,StatCard:o$,RuleCard:i$,StrikethroughReveal:a$,FlowDiagram:f$,TerminalMock:m$,ChatMock:g$,ScreenshotFrame:v$,BulletList:w$},b$=new Set(["lower-third","full-bleed"]),S$=.55,k$=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}, ${S$})`},E$=e=>({width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",opacity:e,transform:e<1?`translateY(${(1-e)*18}px)`:void 0}),C$=({durationInFrames:e,children:t})=>{const n=ct(),{fps:r}=Xe(),{exitSec:o}=e1(e/r),i=(e-n)/r,s=o<=0?1:Math.min(1,Math.max(0,i/o));return c.jsx("div",{style:E$($p(s)),children:t})},I$=({durationInFrames:e,themeBg:t,radiusPx:n})=>{const r=ct(),{fps:o}=Xe(),{enterSec:i}=e1(e/o),s=i<=0?1:Math.min(1,Math.max(0,r/o/i)),a=$p(s);return c.jsx("div",{style:{position:"absolute",inset:0,background:k$(t),backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",borderRadius:n,opacity:a,transform:a<1?`translateY(${(1-a)*18}px)`:void 0}})},T$=({cues:e,theme:t})=>{const{fps:n,width:r,height:o}=Xe();return c.jsx(pn,{style:{pointerEvents:"none"},children:e.map(i=>{if(i.kind==="plain"||!i.component||!i.props)return null;const s=qx(i,{width:r,height:o}),a=x$[i.component],{from:l,durationInFrames:u}=Ep(i.startSec,i.endSec,n),f=s.w*r,p=s.h*o,m=b$.has(i.layout),h=m?Math.min(24,Math.round(p*.12)):0,x=f-h*2,v=p-h*2,k=t$(i.component,i.props,{widthPx:x,heightPx:v});return c.jsx(dt,{from:l,durationInFrames:u,children:c.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:c.jsxs(C$,{durationInFrames:u,children:[m?c.jsx(I$,{durationInFrames:u,themeBg:t.bg,radiusPx:t.radiusPx}):null,c.jsx("div",{style:{width:x/k,transform:`scale(${k})`,position:"relative"},children:c.jsx(a,{props:i.props,theme:t,widthPx:x/k,heightPx:v/k,edits:n$(i.elements,k)})})]})})},i.id)})})},R$="made with ossclip",_$=.45,P$=.024;function j$(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)*P$),opacity:_$,text:R$}}function F$(e){return e===!0}const $$=({theme:e,frame:t})=>{const n=j$(t);return c.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 M$(e){return e!==!0}const A$=({videoFileName:e,spans:t,captionLines:n,sceneCues:r,theme:o,settings:i,face:s,zoomPlan:a,ctaKeyword:l,ctaWindow:u,sourceTextRegions:f,contentTimeline:p,framingTimeline:m,sourceSize:h,contentCropMode:x,sourceFit:v,watermark:k,captionsHidden:y,staticCamera:g,punch:w})=>{if(!e)return c.jsx(pn,{style:{backgroundColor:"#111",color:"#888",alignItems:"center",justifyContent:"center",fontFamily:"monospace",fontSize:40},children:"no production loaded"});const b=/^https?:\/\//.test(e)?e:wp(e),S=v==="contain"||g===!0?null:pR(w);return c.jsxs(pn,{style:{backgroundColor:"black"},children:[c.jsx(L4,{cues:r,theme:o,face:s,zoomPlan:a,sourceTextRegions:f,contentTimeline:p,framingTimeline:m,spans:t,sourceSize:h,contentCropMode:x,sourceFit:v,children:c.jsx(hR,{src:b,spans:t,...S?{punch:S}:{},...v==="contain"?{punchInScale:1,background:"transparent"}:{},...g===!0?{punchInScale:1}:{}})}),c.jsx(T$,{cues:r,theme:o}),M$(y)?c.jsx(j4,{lines:n,cues:r,activeColor:o.accent,theme:o,ctaKeyword:l,ctaWindow:u,sourceTextRegions:f}):null,F$(k)?c.jsx($$,{theme:o,frame:{width:i.width,height:i.height}}):null]})},N$=600,L$=()=>({doc:TF(),past:[],future:[],dirty:!1,savedAt:0,lastCoalesce:null}),vn=(e,t)=>e.scenes[t]??{props:{},elements:{}};function z$(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<N$;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(ug(e.doc,t.sceneId,t.elementId,t.patch),t.coalesce);case"clearElement":return n(LF(e.doc,t.sceneId,t.elementId));case"hideElement":return n(ug(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(zF(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(DF(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.at-t.t)<.001)?e:n({...e.doc,splits:[...e.doc.splits,{at:t.t,id:CF(t.t,e.doc.splits)}].sort((o,i)=>o.at-i.at)});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(OF(e.doc,t.sceneId));case"patchCaption":{const o=Ux(t.srcStart),i=kF(e.doc.captions,o,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 D$(){const[e,t]=d.useReducer(z$,void 0,L$),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",srcStart:r,text:o,was:i}),patchTheme:r=>t({type:"patchTheme",patch:r})}}function bg(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 Sg(e){const t=e==null?void 0:e.closest("[data-edit-video]");return(t==null?void 0:t.dataset.editVideo)||null}function kg(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 Eg=.015,O$=1e-9;function ho(e,t){let n=null,r=1/0;for(const o of e){const i=Math.abs(o.feature-o.target);i<=t+O$&&i<r&&(n=o,r=i)}return n}function Cg(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=ho([...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,x=h>=n.top&&h+e.h<=1-n.bottom,v=ho([...x?[{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=ho([{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=ho([{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=ho([{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=ho([{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 B$(e){const t=e.spans;if(t===void 0)return{};let n;try{n=Yx(t).spans.length}catch{return{}}if(n===0)return{};const r={};return e.captionLines&&(r.captionLines=cg(e.captionLines,t)),e.baseCaptionLines&&(r.baseCaptionLines=cg(e.baseCaptionLines,t)),r}function Ig(e,t){const n=t.baseCaptionLines??t.captionLines??[],r=$F(e.captions,n);return{doc:{...e,captions:MF(e.captions,r)},unresolved:r.unresolved}}function V$(e){const t={};for(const[n,r]of Object.entries(e))Fp(n)||(t[n]=r);return t}function W$(e,t){const n=i=>JSON.stringify([i.text,i.was]),r=new Map;for(const i of Object.values(t))r.set(n(i),(r.get(n(i))??0)+1);const o=[];for(const i of Object.values(e)){const s=r.get(n(i))??0;s>0?r.set(n(i),s-1):o.push(i)}return o}function H$(e){return e.map(t=>`“${t.was}” was retyped as “${t.text}”, and the overrides this render wrote back no longer have it. Retype it if you still want it.`)}function g1(e){return e.map(t=>{const n=`“${t.was}” was retyped in an older version of this project`;switch(t.reason){case"out-of-range":return`${n}, and the word is still here but too far from where the edit was stored to be sure it is the same one — it was left alone. It is still saved. Retype it here if that is the word you meant.`;case"ambiguous":return`${n}, and more than one word here says it — it was left alone rather than applied to the wrong one. Retype the one you meant.`;case"unanchorable":return`${n}, but this project's files carry no source timing for that word, so nothing can be anchored to it. Re-run produce, then retype it.`;case"collision":return`${n} twice, and both point at the same word — neither was applied. Retype the one you meant.`;case"superseded":return`${n} and again since; the newer edit was kept and the older one dropped.`;default:return`${n}, and no word here says it any more — the cut probably removed it. Retype it if you still want it.`}})}function U$(e){return e.map(t=>t.reason==="duplicate-anchor"?`“${t.expected}” shares its moment with another word — only the first was retyped.`:t.found===null?`“${t.expected}” was retyped, but no word in this cut sits at that moment any more.`:`“${t.expected}” was retyped, but the transcript says “${t.found}” there now.`)}function Z$(e){if(e===void 0||e.trim()==="")return null;const t=Number(e);return Ns({srcStart:t})===null?null:t}function Y$(e,t){var i;if(!e)return null;const n=[];if(e.kind!=="plain"&&((i=t.scenes[e.id])==null?void 0:i.hidden)!==!0&&n.push("graphic"),t.cuts.some(s=>s.src===void 0&&s.startSec===e.startSec&&s.endSec===e.endSec)||n.push("take"),n.length===0)return null;const o=Zx(e.id);return{sceneId:e.id,rootId:o,isSplitHalf:o!==e.id,startSec:e.startSec,endSec:e.endSec,targets:n}}function Tg(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 Rg=64,ba=9,Sa=e=>Math.round(e*10)/10,go=e=>Math.round(e*1e4)/1e4,v1={position:"absolute",width:10,height:10,background:"#5b8cff",border:"1px solid #0B0B0E",borderRadius:2,pointerEvents:"auto",zIndex:6},_g={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"}},K$={...v1,background:"#ffe14d"},G$={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}},X$={position:"absolute",cursor:"move",pointerEvents:"auto",zIndex:5},y1=/^(line|node|message|window|item)-(\d+)$/;function q$(e,t,n){const r=y1.exec(e);if(!r)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":o==="window"?"windows":"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(o==="window"){if(typeof u!="object"||u===null)return null;const f=n.split(`
160
+ `).slice(0,6).map(p=>p.slice(0,40));l[i]={...u,lines:f}}else{if(typeof u!="object"||u===null)return null;l[i]={...u,text:n}}return{[s]:l}}function Q$(e,t){const n=y1.exec(e);if(!n){const u=t[e];return typeof u=="string"?u: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":r==="window"?"windows":"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;if(r==="window"){const u=a==null?void 0:a.lines;return Array.isArray(u)&&u.every(f=>typeof f=="string")?u.join(`
161
+ `):null}const l=a==null?void 0:a.text;return typeof l=="string"?l:null}function w1(){const e=document.activeElement;(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&e.blur()}const J$=({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,onRequestDelete:h})=>{const[x,v]=d.useState(null),k=d.useRef(null),y=d.useRef(0),g=d.useRef(null),w=d.useRef(0),b=d.useRef(null),S=d.useRef(0),C=d.useRef(null),[E,T]=d.useState(!1),[_,j]=d.useState([]),A=d.useRef(null),[z,$]=d.useState(null),[M,W]=d.useState(null),D=d.useRef(null),[R,I]=d.useState({dx:0,dy:0}),P=d.useRef(null),F=d.useRef(t),O=d.useCallback(N=>{F.current=N,n(N)},[n]);d.useEffect(()=>{F.current=t},[t]);const H=(N,L)=>{const X=[];let Y=null;for(let V=0;V<25;V++){const U=document.elementFromPoint(N,L);if(!U||U===document.documentElement||U===document.body){Y=U;break}if(Y=U,U.hasAttribute("data-edit-id")||U.hasAttribute("data-edit-scene")||U.hasAttribute("data-caption-word")||U.closest("[data-edit-video]")!==null||["BUTTON","INPUT","SELECT","TEXTAREA"].includes(U.tagName)||!(U instanceof HTMLElement))break;X.push({el:U,prev:U.style.pointerEvents}),U.style.pointerEvents="none"}return X.forEach(({el:V,prev:U})=>{V.style.pointerEvents=U}),Y},K=d.useCallback(()=>{var U,ie;const N=e.current,L=(U=s.current)==null?void 0:U.getScale(),X=((ie=N==null?void 0:N.querySelector(".__remotion-player"))==null?void 0:ie.getBoundingClientRect())??(N==null?void 0:N.getBoundingClientRect());if(!X||!L||L<=0)return null;const Y=i.width*L,V=i.height*L;return{left:X.left+(X.width-Y)/2,top:X.top+(X.height-V)/2,w:Y,h:V}},[e,s,i]);return d.useEffect(()=>{if(!t){v(null);return}let N;const L=()=>{var Y;const X=e.current;if(X){const V=t.elementId?kg(X,t.sceneId,t.elementId):((Y=X.querySelector(`[data-edit-scene="${t.sceneId}"]`))==null?void 0:Y.getBoundingClientRect())??null;v(V)}N=requestAnimationFrame(L)};return N=requestAnimationFrame(L),()=>cancelAnimationFrame(N)},[e,t]),d.useEffect(()=>{const N=L=>{var V,U;const X=e.current;if(!X||!X.contains(L.target)||L.altKey||L.button!==0)return;(((V=F.current)==null?void 0:V.elementId)&&((U=P.current)==null?void 0:U.contains(L.target))||bg(H(L.clientX,L.clientY))!==null)&&L.stopPropagation()};return window.addEventListener("pointerdown",N,!0),()=>window.removeEventListener("pointerdown",N,!0)},[e]),d.useEffect(()=>{const N=L=>{var J,ee,Q,ue,Ee,je,Ce;const X=e.current;if(!X||!X.contains(L.target))return;const Y=document.activeElement;if((Y instanceof HTMLInputElement||Y instanceof HTMLTextAreaElement)&&Y.contains(L.target)||(w1(),L.altKey||L.button!==0))return;const V=L.target instanceof Element?L.target.closest("[data-el-handle]"):null,U=F.current;if(V&&(U!=null&&U.elementId)){const xe=kg(X,U.sceneId,U.elementId);if(xe){const me=xe.left+xe.width/2,be=xe.top+xe.height/2,Re=Math.hypot(L.clientX-me,L.clientY-be);if(Re>2){const ve=((ee=(J=r.doc.scenes[U.sceneId])==null?void 0:J.elements[U.elementId])==null?void 0:ee.scale)??1;A.current={sceneId:U.sceneId,elementId:U.elementId,cx:me,cy:be,startDist:Re,prior:ve,factor:1},$(1)}}return}if((Q=F.current)!=null&&Q.elementId&&((ue=P.current)!=null&&ue.contains(L.target))){D.current={x:L.clientX,y:L.clientY,dx:0,dy:0},I({dx:0,dy:0});return}const ie=L.target instanceof Element?L.target.closest("[data-box-handle]"):null,ce=F.current;if(ie&&ce&&!ce.elementId){const xe=X.querySelector(`[data-edit-scene="${ce.sceneId}"]`),me=K();if(xe&&me){const be=xe.getBoundingClientRect();C.current=null,b.current={sceneId:ce.sceneId,handle:ie.dataset.boxHandle,x:L.clientX,y:L.clientY,dx:0,dy:0,start:{x:(be.left-me.left)/me.w,y:(be.top-me.top)/me.h,w:be.width/me.w,h:be.height/me.h}},T(!0)}return}const ae=H(L.clientX,L.clientY),oe=bg(ae);if(!oe){const xe=ae==null?void 0:ae.closest("[data-edit-scene]");if(xe){O({sceneId:xe.dataset.editScene,elementId:null});return}const me=Sg(ae),be=X.getBoundingClientRect().bottom;if(me&&L.clientY<be-Rg){O({sceneId:me,elementId:null});const Re=p.find(_e=>_e.id===me);if((Re==null?void 0:Re.layout)==="pip-bubble"&&!L.altKey){const _e=Gr("pip-bubble",void 0,[],i).video.rect;g.current={sceneId:me,x:L.clientX,y:L.clientY,base:{x:((Ee=Re.pip)==null?void 0:Ee.x)??_e.x,y:((je=Re.pip)==null?void 0:je.y)??_e.y},slot:{w:_e.w,h:_e.h}};return}const ve=(Ce=r.doc.scenes[me])==null?void 0:Ce.video;k.current={sceneId:me,x:L.clientX,y:L.clientY,dx:0,dy:0,baseDx:(ve==null?void 0:ve.dx)??0,baseDy:(ve==null?void 0:ve.dy)??0};return}O(null);return}O({sceneId:oe.sceneId,elementId:oe.elementId}),D.current={x:L.clientX,y:L.clientY,dx:0,dy:0},I({dx:0,dy:0})};return window.addEventListener("mousedown",N),()=>window.removeEventListener("mousedown",N)},[e,O,r,K,p,i]),d.useEffect(()=>{const N=()=>{var U,ie;const Y=(U=s.current)==null?void 0:U.getScale(),V=(ie=e.current)==null?void 0:ie.getBoundingClientRect();return Y&&Y>0?1/Y:V&&V.width>0?i.width/V.width:1},L=Y=>{const V=e.current;if(V&&!(b.current||A.current))if(g.current)V.style.cursor="move";else if(k.current)V.style.cursor="grabbing";else{const J=Y.target instanceof Element?Y.target:null,ee=J!==null&&V.contains(J)&&!J.closest("button, input, select, textarea, [data-edit-id], [data-edit-scene], [data-caption-word]")&&Y.clientY<V.getBoundingClientRect().bottom-Rg,Q=ee&&(()=>{var Ee;const ue=Sg(J);return ue!==null&&((Ee=p.find(je=>je.id===ue))==null?void 0:Ee.layout)==="pip-bubble"})();V.style.cursor=ee?Q?"move":"grab":""}const U=A.current;if(U){const ee=Math.hypot(Y.clientX-U.cx,Y.clientY-U.cy)/U.startDist;U.factor=Math.min(4/U.prior,Math.max(.05/U.prior,ee)),$(U.factor);return}const ie=b.current;if(ie){ie.dx=Y.clientX-ie.x,ie.dy=Y.clientY-ie.y,C.current=Y.altKey,S.current||(S.current=requestAnimationFrame(()=>{S.current=0;const J=b.current,ee=K();if(!J||!ee)return;const Q=El(Tg(J.start,J.handle,J.dx/ee.w,J.dy/ee.h),i);if(Y.altKey)j([]),u({sceneId:J.sceneId,rect:Q});else{const ue=Cg(Q,J.handle,wn(i),Eg);j(ue.guides),u({sceneId:J.sceneId,rect:ue.rect})}}));return}if(g.current){w.current||(w.current=requestAnimationFrame(()=>{w.current=0;const J=g.current,ee=K();if(!J||!ee)return;const Q=(Y.clientX-J.x)/ee.w,ue=(Y.clientY-J.y)/ee.h;r.patchPip(J.sceneId,{x:go(Math.min(Math.max(J.base.x+Q,0),1-J.slot.w)),y:go(Math.min(Math.max(J.base.y+ue,0),1-J.slot.h))},`pip:${J.sceneId}:drag`)}));return}const ae=k.current;if(ae){ae.dx=Y.clientX-ae.x,ae.dy=Y.clientY-ae.y,y.current||(y.current=requestAnimationFrame(()=>{y.current=0;const J=k.current;if(!J)return;const ee=N();l({sceneId:J.sceneId,patch:{dx:J.baseDx+J.dx*ee,dy:J.baseDy+J.dy*ee}})}));return}const oe=D.current;oe&&(oe.dx=Y.clientX-oe.x,oe.dy=Y.clientY-oe.y,I({dx:oe.dx,dy:oe.dy}))},X=Y=>{const V=A.current;if(V){A.current=null,$(null),Math.abs(V.factor-1)>.001&&r.patchElement(V.sceneId,V.elementId,{scale:Math.round(V.prior*V.factor*1e3)/1e3});return}const U=b.current;if(U){if(b.current=null,T(!1),j([]),S.current&&(cancelAnimationFrame(S.current),S.current=0),U.dx!==0||U.dy!==0){const J=K();if(J){let ee=El(Tg(U.start,U.handle,U.dx/J.w,U.dy/J.h),i);(C.current??Y.altKey)||(ee=Cg(ee,U.handle,wn(i),Eg).rect),r.patchGraphicRect(U.sceneId,{x:go(ee.x),y:go(ee.y),w:go(ee.w),h:go(ee.h)})}}C.current=null,u(null);return}if(g.current){g.current=null,w.current&&(cancelAnimationFrame(w.current),w.current=0);return}const ce=k.current;if(ce){if(k.current=null,y.current&&(cancelAnimationFrame(y.current),y.current=0),ce.dx!==0||ce.dy!==0){const J=N();r.patchVideo(ce.sceneId,{dx:Sa(ce.baseDx+ce.dx*J),dy:Sa(ce.baseDy+ce.dy*J)})}l(null);return}const ae=D.current,oe=F.current;if(!ae||!(oe!=null&&oe.elementId)){D.current=null;return}if(ae.dx!==0||ae.dy!==0){const J=N(),ee=r.doc.scenes[oe.sceneId],Q=ee==null?void 0:ee.elements[oe.elementId];r.patchElement(oe.sceneId,oe.elementId,{dx:Sa(((Q==null?void 0:Q.dx)??0)+ae.dx*J),dy:Sa(((Q==null?void 0:Q.dy)??0)+ae.dy*J)})}D.current=null,I({dx:0,dy:0})};return window.addEventListener("mousemove",L),window.addEventListener("mouseup",X),()=>{window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",X)}},[r,e,i,s,l,u,K,p]),d.useEffect(()=>{const N=L=>{var ie;const X=e.current;if(!X||!X.contains(L.target))return;const Y=(ie=H(L.clientX,L.clientY))==null?void 0:ie.closest("[data-caption-word]");if(!Y)return;L.preventDefault();const V=Z$(Y.dataset.captionSrc),U=Y.dataset.captionText??"";V===null||!U||W({srcStart:V,was:U,draft:U,rect:Y.getBoundingClientRect()})};return window.addEventListener("dblclick",N),()=>window.removeEventListener("dblclick",N)},[e]),d.useEffect(()=>{const N=()=>{const V=document.activeElement;return V instanceof HTMLInputElement||V instanceof HTMLTextAreaElement||V instanceof HTMLSelectElement||V instanceof HTMLElement&&V.isContentEditable},L=()=>{const V=document.activeElement;return V instanceof HTMLTextAreaElement||V instanceof HTMLElement&&V.isContentEditable?!0:V instanceof HTMLInputElement&&!["range","checkbox","radio","button"].includes(V.type)},X=()=>{const V=document.activeElement;V instanceof HTMLElement&&!L()&&V.blur()},Y=V=>{var ie,ce,ae;if(M!==null)return;const U=V.metaKey||V.ctrlKey;if(V.key==="Escape"){if(N()){(ie=document.activeElement)==null||ie.blur();return}O(null)}else if(U&&V.key.toLowerCase()==="z")V.preventDefault(),V.shiftKey?r.redo():r.undo();else if(U&&V.key.toLowerCase()==="y")V.preventDefault(),r.redo();else if(U&&V.key.toLowerCase()==="s")V.preventDefault(),o();else if(V.key===" "&&!U){if(L())return;const oe=document.activeElement;if(oe instanceof HTMLElement&&oe.tagName==="BUTTON"&&((ce=e.current)!=null&&ce.contains(oe)))return;X(),V.preventDefault(),(ae=s.current)==null||ae.toggle()}else if(!U&&["j","k","l"].includes(V.key.toLowerCase())){if(L())return;X(),V.preventDefault(),a(V.key.toUpperCase())}else if(!U&&!V.altKey&&(V.key==="ArrowLeft"||V.key==="ArrowRight")){if(N())return;V.preventDefault();const oe=s.current;if(!oe)return;oe.seekTo(Math.max(0,oe.getCurrentFrame()+(V.key==="ArrowRight"?1:-1)))}else if(U&&V.key.toLowerCase()==="b"){if(L())return;V.preventDefault();const oe=s.current;if(!oe)return;const J=oe.getCurrentFrame()/i.fps;if(!p.find(Q=>J>=Q.startSec+kl&&J<=Q.endSec-kl))return;r.addSplit(Math.round(J*1e3)/1e3)}else if(!U&&V.altKey&&(V.key==="ArrowLeft"||V.key==="ArrowRight")){if(L())return;const oe=F.current,J=oe?(()=>{const ee=p.findIndex(Q=>Q.id===oe.sceneId);return ee===-1?void 0:p[ee+(V.key==="ArrowRight"?1:-1)]})():p[V.key==="ArrowRight"?0:p.length-1];if(!J)return;V.preventDefault(),O({sceneId:J.id,elementId:null})}else if(U&&(V.key==="ArrowLeft"||V.key==="ArrowRight")){if(L())return;V.preventDefault();const oe=s.current;if(!oe)return;const J=oe.getCurrentFrame()/i.fps,ee=p.findIndex(ue=>J>=ue.startSec&&J<ue.endSec),Q=p[(ee===-1?0:ee)+(V.key==="ArrowRight"?1:-1)];if(!Q)return;oe.seekTo(Math.round(Q.startSec*i.fps)),O({sceneId:Q.id,elementId:null})}else if(!U&&!V.altKey&&V.key==="?"){if(N())return;V.preventDefault(),m()}else if(!U&&(V.key==="Delete"||V.key==="Backspace")){if(N())return;const oe=F.current;if(!oe||oe.elementId!==null||!f||f.id!==oe.sceneId)return;const J=Y$(f,r.doc);if(!J)return;V.preventDefault(),h(J)}};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[O,r,M,o,s,e,a,f,p,i,m,h]),c.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[R.dx!==0||R.dy!==0||E?c.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,_.map(N=>c.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)),x&&t?c.jsxs("div",{ref:P,"data-testid":"overlay-box",style:{position:"fixed",pointerEvents:"auto",left:x.left+R.dx-ba/2+x.width*(1-(z??1))/2,top:x.top+R.dy-ba/2+x.height*(1-(z??1))/2,width:x.width*(z??1)+ba,height:x.height*(z??1)+ba,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?c.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=>c.jsx("div",{"data-el-handle":N,"data-testid":`el-handle-${N}`,style:{...K$,..._g[N]}},N)):null,!t.elementId&&f&&f.kind!=="plain"?c.jsxs(c.Fragment,{children:[["top","bottom","left","right"].map(N=>c.jsx("div",{"data-box-handle":"move","data-testid":N==="top"?"box-handle-move":`box-handle-move-${N}`,style:{...X$,...G$[N]}},N)),["nw","n","ne","e","se","s","sw","w"].map(N=>c.jsx("div",{"data-box-handle":N,"data-testid":`box-handle-${N}`,style:{...v1,..._g[N]}},N))]}):null]}):null,M?c.jsx("input",{autoFocus:!0,"data-testid":"caption-edit",value:M.draft,onChange:N=>W({...M,draft:N.target.value}),onBlur:()=>{const N=M.draft.trim();N&&r.patchCaption(M.srcStart,N,M.was),W(null)},onKeyDown:N=>{N.key==="Enter"&&N.target.blur(),N.key==="Escape"&&W(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},ji={display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},Me={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"#9A9AA3"},Gi={fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace",fontSize:13,background:"#0F0F14",border:"1px solid #2A2A33",borderRadius:6,color:"#fff",padding:"6px 8px",width:"100%"},Yd={...Gi,fontFamily:"'Inter', system-ui, sans-serif"},He={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)},eM=e=>String(Math.round(e*1e3)/1e3),It=({id:e,value:t,onCommit:n,min:r,max:o,dragStep:i})=>{const[s,a]=te.useState(null),[l,u]=te.useState(!1),f=te.useRef(null),p=te.useRef(null),m=r??-1/0,h=o??1/0,x=i??(r!==void 0&&o!==void 0?(o-r)/240:.5),v=s!==null;return c.jsxs("div",{style:on,children:[c.jsx("span",{style:Me,children:e}),c.jsx("input",{type:"text",inputMode:"decimal",ref:f,"data-testid":`field-${e}`,style:{...Gi,...v?{}:{cursor:"ew-resize",touchAction:"none"},...l?{borderColor:"#FFE14D",color:"#FFE14D"}:{}},value:s??(Number.isFinite(t)?eM(t):"0"),onFocus:k=>a(k.target.value),onBlur:()=>a(null),onPointerDown:k=>{v||(k.preventDefault(),p.current={x:k.clientX,v:Number.isFinite(t)?t:0,moved:!1},k.currentTarget.setPointerCapture(k.pointerId),u(!0))},onPointerMove:k=>{const y=p.current;if(!y)return;const g=k.clientX-y.x;if(!y.moved&&Math.abs(g)<=2)return;y.moved=!0;const w=Math.round(Math.min(h,Math.max(m,y.v+g*x))*1e3)/1e3;n(w)},onPointerUp:()=>{var y,g,w;const k=((y=p.current)==null?void 0:y.moved)===!0;p.current=null,u(!1),k||((g=f.current)==null||g.focus(),(w=f.current)==null||w.select())},onPointerCancel:()=>{p.current=null,u(!1)},onChange:k=>{a(k.target.value);const y=k.target.value.trim();if(y==="")return;const g=Number(y.replace(",","."));Number.isFinite(g)&&n(Math.min(h,Math.max(m,g)))}})]})},ka=({id:e,value:t,isColor:n,onCommit:r})=>c.jsxs("div",{style:on,children:[c.jsx("span",{style:Me,children:e}),c.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[n?c.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,c.jsx("input",{"data-testid":`theme-${e}`,style:{...Yd,flex:1},value:t,onChange:o=>r(o.target.value)})]})]}),tM=({selection:e,cue:t,frame:n,allSceneIds:r,edits:o,onSelect:i,resolvedTheme:s,anchorText:a,onVideoPreview:l,runInfo:u,captionsHiddenByFlag:f})=>{var y,g,w,b,S,C,E,T,_,j,A,z;if(e!=null&&e.elementId&&t){const $=e.elementId,M=((y=t.elements)==null?void 0:y[$])??{},W=t.props?Q$($,t.props):null,D=/^window-\d+$/.test($);return c.jsxs("div",{children:[c.jsxs("div",{style:He,children:[c.jsx("span",{style:Me,children:"Selected"}),c.jsx("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:$})]}),(()=>{var H;const R=/^line-(\d+)$/.exec($),I=(H=t.props)==null?void 0:H.lines;if(t.component!=="StrikethroughReveal"||!R||!Array.isArray(I))return null;const P=Number(R[1]),F=I[P];if(!F)return null;const O=F.struck?"struck":(F.mark??"none")!=="none"?F.mark:"plain";return c.jsx("div",{style:He,children:c.jsxs("div",{style:on,children:[c.jsx("span",{style:Me,children:"Line style"}),c.jsxs("select",{"data-testid":"line-style",style:Gi,value:O,onChange:K=>{const N=K.target.value,L=I.slice();L[P]={...L[P],struck:N==="struck",mark:N==="cross"||N==="check"?N:"none"},o.patchProps(e.sceneId,{lines:L})},children:[c.jsx("option",{value:"plain",children:"plain"}),c.jsx("option",{value:"struck",children:"struck through"}),c.jsx("option",{value:"cross",children:"✗ wrong"}),c.jsx("option",{value:"check",children:"✓ right"})]})]})})})(),W!==null?c.jsx("div",{style:He,children:c.jsxs("div",{style:on,children:[c.jsx("span",{style:Me,children:"Text"}),(()=>{const R=I=>{const P=t.props??{},F=/^(line|node|message|window|item)-\d+$/.test($)?q$($,P,I):{[$]:I};F&&o.patchProps(e.sceneId,F,`text:${e.sceneId}:${$}`)};return D?c.jsx("textarea",{style:{...Yd,resize:"vertical",fontFamily:"inherit"},"data-testid":"element-text",rows:Math.min(6,Math.max(2,W.split(`
162
+ `).length)),value:W,onChange:I=>R(I.target.value)}):c.jsx("input",{style:Yd,"data-testid":"element-text",value:W,onChange:I=>R(I.target.value)})})()]})}):null,c.jsxs("div",{style:He,children:[c.jsxs("div",{style:on,children:[c.jsxs("span",{style:Me,children:["scale"," ",c.jsxs("span",{style:{color:"#EDEDF2"},children:[(M.scale??1).toFixed(2),"×"]})]}),c.jsx("input",{type:"range","data-testid":"el-scale-slider",min:.1,max:3,step:.01,value:M.scale??1,onChange:R=>o.patchElement(e.sceneId,$,{scale:Number(R.target.value)},`element:${e.sceneId}:${$}:scale`)})]}),c.jsxs("div",{style:ji,children:[c.jsx(It,{id:"x",value:M.dx??0,dragStep:1,onCommit:R=>o.patchElement(e.sceneId,$,{dx:R},`element:${e.sceneId}:${$}:dx`)}),c.jsx(It,{id:"y",value:M.dy??0,dragStep:1,onCommit:R=>o.patchElement(e.sceneId,$,{dy:R},`element:${e.sceneId}:${$}:dy`)})]}),c.jsx(It,{id:"scale",value:M.scale??1,min:.05,max:4,dragStep:.01,onCommit:R=>o.patchElement(e.sceneId,$,{scale:R},`element:${e.sceneId}:${$}:scale`)})]}),c.jsxs("div",{style:He,children:[c.jsx("button",{style:Lt,onClick:()=>{zt(),o.clearElement(e.sceneId,$)},children:"Reset element"}),c.jsx("button",{"data-testid":"delete-element",style:{...Lt,marginTop:8},onClick:()=>{zt(),o.hideElement(e.sceneId,$),i({sceneId:e.sceneId,elementId:null})},children:"Delete element"})]})]})}if(e&&t){const $=t.kind==="plain";if(((g=o.doc.scenes[e.sceneId])==null?void 0:g.hidden)===!0)return c.jsx("div",{children:c.jsxs("div",{style:He,children:[c.jsx("span",{style:Me,children:"Scene"}),c.jsxs("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:[e.sceneId," ",c.jsx("span",{style:{color:"#9A9AA3",fontWeight:400},children:"(deleted)"})]}),c.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Its window plays as a plain take. Restore brings the graphic back."}),c.jsx("button",{"data-testid":"restore-scene",style:{...Lt,color:"#5FBF77",border:"1px solid #24402c"},onClick:()=>{zt(),o.restoreScene(e.sceneId)},children:"Restore scene"})]})});const M=o.doc.cuts.findIndex(D=>D.src===void 0&&D.startSec===t.startSec&&D.endSec===t.endSec);if(M!==-1)return c.jsx("div",{children:c.jsxs("div",{style:He,children:[c.jsx("span",{style:Me,children:$?"Take":"Scene"}),c.jsxs("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:[e.sceneId," ",c.jsx("span",{style:{color:"#9A9AA3",fontWeight:400},children:"(marked for removal)"})]}),c.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)."}),c.jsx("button",{"data-testid":"restore-chunk",style:{...Lt,color:"#5FBF77",border:"1px solid #24402c"},onClick:()=>{zt(),o.restoreChunk(M)},children:"Restore"})]})});const W=Object.entries(t.elements??{}).filter(([,D])=>D.hidden===!0).map(([D])=>{var P,F;const I=((F=(P=o.doc.scenes[e.sceneId])==null?void 0:P.elements[D])==null?void 0:F.hidden)===!0?e.sceneId:Zx(e.sceneId);return{id:D,owningSceneId:I}});return c.jsxs("div",{children:[c.jsxs("div",{style:He,children:[c.jsx("span",{style:Me,children:$?"Take":"Scene"}),c.jsx("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:e.sceneId}),$?c.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]}),c.jsxs("div",{style:He,children:[!$&&t.component?c.jsxs("div",{style:on,children:[c.jsx("span",{style:Me,children:"Component"}),c.jsx("select",{style:Gi,value:t.component,onChange:D=>o.patchComponent(e.sceneId,D.target.value),children:wu.options.map(D=>c.jsx("option",{value:D,children:D},D))})]}):null,c.jsxs("div",{style:on,children:[c.jsx("span",{style:Me,children:"Layout"}),c.jsx("select",{style:Gi,"data-testid":"layout-select",value:t.layout,onChange:D=>o.patchLayout(e.sceneId,D.target.value),children:yu.options.map(D=>c.jsx("option",{value:D,children:D},D))})]})]}),c.jsxs("div",{style:He,children:[c.jsx("span",{style:Me,children:"Video framing"}),c.jsxs("div",{style:on,children:[c.jsxs("span",{style:Me,children:["zoom"," ",c.jsxs("span",{style:{color:"#EDEDF2"},children:[(((w=t.video)==null?void 0:w.scale)??1).toFixed(2),"×"]})]}),c.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 I=Number(D.target.value);o.patchVideo(e.sceneId,{scale:I},`video:${e.sceneId}:scale`),l(null)}})]}),c.jsxs("label",{style:{display:"flex",gap:8,alignItems:"center",fontSize:12,color:"#9A9AA3",cursor:"pointer"},children:[c.jsx("input",{type:"checkbox","data-testid":"auto-zoom",checked:((S=t.video)==null?void 0:S.autoZoom)!==!1,onChange:D=>o.patchVideo(e.sceneId,{autoZoom:D.target.checked})}),"auto zoom (the slow push composes on top of your zoom)"]}),c.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Pan: drag the picture on the stage."}),c.jsx(It,{id:"scale",value:((C=t.video)==null?void 0:C.scale)??1,min:.05,max:4,dragStep:.01,onCommit:D=>o.patchVideo(e.sceneId,{scale:D},`video:${e.sceneId}:scale`)}),c.jsxs("div",{style:ji,children:[c.jsx(It,{id:"dx",value:((E=t.video)==null?void 0:E.dx)??0,dragStep:1,onCommit:D=>o.patchVideo(e.sceneId,{dx:D},`video:${e.sceneId}:dx`)}),c.jsx(It,{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?c.jsx("button",{style:Lt,onClick:()=>{zt(),o.clearVideo(e.sceneId)},children:"Reset framing"}):null]}),t.layout==="pip-bubble"?(()=>{const D=Gr("pip-bubble",void 0,[],n).video,R=t.pip??{},I=R.cornerRadius??D.cornerRadius;return c.jsxs("div",{style:He,children:[c.jsx("span",{style:Me,children:"PiP bubble"}),c.jsxs("div",{style:on,children:[c.jsxs("span",{style:Me,children:["roundness"," ",c.jsx("span",{style:{color:"#EDEDF2"},children:I.toFixed(2)})]}),c.jsx("input",{type:"range","data-testid":"pip-roundness",min:0,max:1,step:.01,value:I,onChange:P=>o.patchPip(e.sceneId,{cornerRadius:Number(P.target.value)},`pip:${e.sceneId}:cornerRadius`)})]}),c.jsxs("div",{style:ji,children:[c.jsx(It,{id:"pip-x",value:R.x??D.rect.x,min:0,max:1-D.rect.w,dragStep:.002,onCommit:P=>o.patchPip(e.sceneId,{x:P},`pip:${e.sceneId}:x`)}),c.jsx(It,{id:"pip-y",value:R.y??D.rect.y,min:0,max:1-D.rect.h,dragStep:.002,onCommit:P=>o.patchPip(e.sceneId,{y:P},`pip:${e.sceneId}:y`)})]}),t.pip?c.jsx("button",{"data-testid":"reset-pip",style:Lt,onClick:()=>{zt(),o.clearPip(e.sceneId)},children:"Reset bubble"}):null]})})():null,(()=>{var I;if($)return null;const D=qx(t,n),R=P=>F=>o.patchGraphicRect(e.sceneId,El({...D,[P]:F},n),`box:${e.sceneId}:${P}`);return c.jsxs("div",{style:He,children:[c.jsx("span",{style:Me,children:"Graphic box"}),c.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Frame fractions — or drag the handles on the stage."}),c.jsxs("div",{style:ji,children:[c.jsx(It,{id:"box-x",value:D.x,min:0,max:1,dragStep:.002,onCommit:R("x")}),c.jsx(It,{id:"box-y",value:D.y,min:0,max:1,dragStep:.002,onCommit:R("y")})]}),c.jsxs("div",{style:ji,children:[c.jsx(It,{id:"box-w",value:D.w,min:.08,max:1,dragStep:.002,onCommit:R("w")}),c.jsx(It,{id:"box-h",value:D.h,min:.05,max:1,dragStep:.002,onCommit:R("h")})]}),(I=o.doc.scenes[e.sceneId])!=null&&I.graphicRect?c.jsx("button",{"data-testid":"reset-box",style:Lt,onClick:()=>{zt(),o.clearGraphicRect(e.sceneId)},children:"Reset box"}):null]})})(),(()=>{const D=Gr(t.layout,void 0,[],n).captionAnchor,R=t.captionY??D,I=t.captionScale??1,P=o.doc.scenes[e.sceneId];return c.jsxs("div",{style:He,children:[c.jsx("span",{style:Me,children:"Captions"}),o.doc.captionsHidden===!0||f===!0?c.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,c.jsxs("div",{style:on,children:[c.jsxs("span",{style:Me,children:["position"," ",c.jsx("span",{style:{color:"#EDEDF2"},children:R.toFixed(2)})]}),c.jsx("input",{type:"range","data-testid":"caption-y-slider",min:.05,max:.95,step:.01,value:R,onChange:F=>o.patchCaptionY(e.sceneId,Number(F.target.value),`captionY:${e.sceneId}`)})]}),c.jsxs("div",{style:on,children:[c.jsxs("span",{style:Me,children:["scale"," ",c.jsxs("span",{style:{color:"#EDEDF2"},children:[I.toFixed(2),"×"]})]}),c.jsx("input",{type:"range","data-testid":"caption-scale-slider",min:.2,max:3,step:.01,value:I,onChange:F=>o.patchCaptionScale(e.sceneId,Number(F.target.value),`captionScale:${e.sceneId}`)})]}),c.jsx(It,{id:"caption-scale",value:I,min:.2,max:3,dragStep:.01,onCommit:F=>o.patchCaptionScale(e.sceneId,F,`captionScale:${e.sceneId}`)}),c.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:I})},children:"Apply to all scenes"}),(P==null?void 0:P.captionY)!==void 0||(P==null?void 0:P.captionScale)!==void 0?c.jsx("button",{"data-testid":"reset-caption-y",style:Lt,onClick:()=>{zt(),o.clearCaptionStyle(e.sceneId)},children:"Reset captions"}):null]})})(),c.jsxs("div",{style:He,children:[c.jsx("span",{style:Me,children:"Timing"}),c.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",c.jsxs("span",{style:{color:"#9A9AA3"},children:[" ","(",(t.endSec-t.startSec).toFixed(2),"s)"]})]}),c.jsx("div",{style:{fontSize:12,color:t.pinned?"#FFE14D":"#9A9AA3"},children:$?"Derived from the cut — not movable":t.pinned?"Pinned to these times":"Tracking transcript"}),!t.pinned&&a?c.jsxs("div",{style:{fontSize:12,color:"#9A9AA3",fontStyle:"italic"},children:["“",a,"”"]}):null,t.pinned?c.jsx("button",{style:Lt,onClick:()=>{zt(),o.clearTiming(e.sceneId)},children:"Un-pin (re-anchor to words)"}):null]}),$?null:c.jsx("div",{style:He,children:c.jsx("button",{"data-testid":"delete-scene",style:Lt,onClick:()=>{zt(),o.hideScene(e.sceneId)},children:"Delete scene"})}),W.length>0?c.jsxs("div",{style:He,children:[c.jsx("span",{style:Me,children:"Hidden elements"}),W.map(({id:D,owningSceneId:R})=>c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[c.jsx("span",{style:{fontSize:13,fontFamily:"ui-monospace, monospace",color:"#C9C9D4"},children:D}),c.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,c.jsxs("div",{style:He,children:[c.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."}),c.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.patchTheme({[$]:M}),h=$=>`${Math.floor($/60)}:${String(Math.floor($%60)).padStart(2,"0")}`,x=((_=u==null?void 0:u.usage)==null?void 0:_.totals)??null,v=((j=u==null?void 0:u.production)==null?void 0:j.producer)??null,k=((A=u==null?void 0:u.production)==null?void 0:A.clip)??null;return c.jsxs("div",{children:[c.jsxs("div",{style:He,children:[c.jsx("span",{style:Me,children:"Theme"}),c.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Nothing selected — global tokens."})]}),c.jsxs("div",{style:He,children:[c.jsx(ka,{id:"accent",value:p.accent??s.accent,isColor:!0,onCommit:$=>m("accent",$)}),c.jsx(ka,{id:"bg",value:p.bg??s.bg,isColor:!0,onCommit:$=>m("bg",$)}),c.jsx(ka,{id:"fg",value:p.fg??s.fg,isColor:!0,onCommit:$=>m("fg",$)}),c.jsx(It,{id:"radiusPx",value:p.radiusPx??s.radiusPx,min:0,dragStep:.5,onCommit:$=>m("radiusPx",$)}),c.jsx(ka,{id:"fontDisplay",value:p.fontDisplay??s.fontDisplay,isColor:!1,onCommit:$=>m("fontDisplay",$)})]}),c.jsxs("div",{style:He,children:[c.jsx("span",{style:Me,children:"Captions"}),c.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:"#EDEDF2",cursor:"pointer"},children:[c.jsx("input",{type:"checkbox","data-testid":"captions-visible-toggle",checked:o.doc.captionsHidden!==!0&&f!==!0,disabled:f===!0&&o.doc.captionsHidden!==!0,onChange:$=>o.setCaptionsHidden(!$.target.checked)}),"Show captions"]}),o.doc.captionsHidden===!0?c.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?c.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]}),v||x?c.jsxs("div",{style:He,"data-testid":"run-info",children:[c.jsx("span",{style:Me,children:"This video"}),v?c.jsxs("div",{style:{fontSize:12,color:"#C9C9D4"},children:["planned by ",c.jsx("span",{style:{color:"#EDEDF2"},children:v.provider}),v.models.length>0?` (${v.models.join(", ")})`:"",v.cached?" · reused from cache":"",v.at?` · ${new Date(v.at).toLocaleString()}`:""]}):null,x?c.jsxs("div",{style:{fontSize:12,color:"#C9C9D4"},children:[x.calls," LLM call",x.calls===1?"":"s"," ·"," ",x.inputTokens.toLocaleString()," in / ",x.outputTokens.toLocaleString()," out tokens",x.anyEstimated?" (partly estimated)":""]}):null,x&&x.equivalentUsd!==null?c.jsx("div",{style:{fontSize:12,color:"#C9C9D4"},children:x.allUnbilled?`~$${x.equivalentUsd.toFixed(2)} of API-rate work, covered by the subscription`:x.billedUsd!==null?`~$${x.billedUsd.toFixed(2)} charged at API rates`:`~$${x.equivalentUsd.toFixed(2)} at API rates`}):null,k?c.jsxs("div",{style:{fontSize:12,color:"#C9C9D4"},children:["clip: ",h(k.startSec),"–",h(k.endSec),(z=u==null?void 0:u.production)!=null&&z.sourceDuration?` of ${h(u.production.sourceDuration)}`:""," ","(--clip ",k.targetSec,")"]}):null]}):null,c.jsx("div",{style:He,children:c.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."})})]})},gc=1.2,Il=.05;function nM(e,t,n,r){return n<=0||r<=0?0:Math.min(1,Math.max(0,(e-t)/n))*r}const rM=16,oM=e=>Math.min(rM,Math.max(1,e));function iM(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 sM(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+Il:0,p=u?u.startSec-Il:r,m=Math.min(Math.max(s.startSec+n,f),Math.max(f,p-a));return{startSec:m,endSec:m+a}}function aM(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+Il:0,f=l?l.startSec-Il:o;let p=Math.min(Math.max(n,u),Math.max(u,f-gc)),m=Math.max(Math.min(r,f),p+gc);return m>f&&(m=f,p=Math.max(u,m-gc)),{startSec:p,endSec:m}}function Pg(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 Ea(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 lM(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 vc(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 uM=10,cM=4,jg=8,Fg=8,dM=300,fM=e=>{const t=Math.max(0,Math.round(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`},pM=(e,t)=>{const[n,r]=te.useState({}),o=te.useRef({}),i=t.map(s=>s.toFixed(1)).join(",");return te.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},mM=({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=d.useRef(null),h=d.useRef(null),x=d.useRef(!1),v=d.useRef(null),[k,y]=d.useState(0),g=d.useRef(k);g.current=k;const[w,b]=d.useState(null),[S,C]=d.useState(1),E=te.useMemo(()=>p?e.filter(R=>R.kind==="plain").map(R=>p((R.startSec+R.endSec)/2)):[],[e,p]),T=pM(f,E),_=d.useRef(null),j=d.useRef(null),A=d.useCallback((R,I)=>{const P=_.current;C(F=>{const O=oM(R);if(O===F||!P)return O;const H=P.getBoundingClientRect();return j.current={prevZoom:F,anchorX:I!==void 0?I-H.left:H.width/2},O})},[]);d.useLayoutEffect(()=>{const R=_.current,I=j.current;!R||!I||(j.current=null,R.scrollLeft=iM(I.prevZoom,S,R.clientWidth,R.scrollLeft,I.anchorX))},[S]);const z=d.useRef(S);z.current=S,d.useEffect(()=>{const R=_.current;if(!R)return;const I=P=>{P.ctrlKey||P.metaKey?(P.preventDefault(),A(z.current*Math.exp(-P.deltaY*.01),P.clientX)):R.scrollWidth>R.clientWidth&&(P.preventDefault(),R.scrollLeft+=P.deltaY+P.deltaX)};return R.addEventListener("wheel",I,{passive:!1}),()=>R.removeEventListener("wheel",I)},[A]),d.useEffect(()=>{const R=s.current;if(!R)return;y(R.getCurrentFrame());const I=P=>y(P.detail.frame);return R.addEventListener("frameupdate",I),()=>R.removeEventListener("frameupdate",I)},[s]),d.useEffect(()=>{const R=_.current;if(!R||o<=0||R.scrollWidth<=R.clientWidth)return;const I=k/i/o*R.scrollWidth,{scrollLeft:P,clientWidth:F}=R;(I<P||I>P+F)&&(R.scrollLeft=Math.max(0,Math.min(R.scrollWidth-F,I-F*.1)))},[k,i,o]),d.useEffect(()=>{var I,P;if(!a)return;const R=(I=_.current)==null?void 0:I.querySelector(`[data-testid="timeline-block-${a.sceneId}"]`);(P=R==null?void 0:R.scrollIntoView)==null||P.call(R,{inline:"nearest",block:"nearest"})},[a]);const $=d.useCallback(R=>{var F;const I=m.current;if(!I||o<=0)return;const P=I.getBoundingClientRect();(F=s.current)==null||F.seekTo(Math.round(nM(R,P.left,P.width,o)*i))},[s,o,i]),M=d.useCallback((R,I)=>P=>{P.stopPropagation(),P.preventDefault();const F=m.current;F&&(h.current={sceneId:R.id,edge:I,startContentX:P.clientX-F.getBoundingClientRect().left,origStart:R.startSec,origEnd:R.endSec},b({sceneId:R.id,startSec:R.startSec,endSec:R.endSec,snapped:null}))},[]),W=d.useRef(0);d.useEffect(()=>{const R=F=>{const O=_.current;if(!O||O.scrollWidth<=O.clientWidth)return;const H=Date.now();if(H-W.current<dM)return;const K=O.getBoundingClientRect(),N=O.scrollWidth-O.clientWidth;F>=K.right-Fg&&O.scrollLeft<N?(O.scrollLeft=Math.min(N,O.scrollLeft+O.clientWidth),W.current=H):F<=K.left+Fg&&O.scrollLeft>0&&(O.scrollLeft=Math.max(0,O.scrollLeft-O.clientWidth),W.current=H)},I=F=>{var ae;if((x.current||((ae=v.current)==null?void 0:ae.moved)===!0||h.current!==null)&&R(F.clientX),x.current){$(F.clientX);return}const H=v.current;if(H&&o>0){if(!H.moved&&Math.abs(F.clientX-H.startX)<cM)return;if(H.moved=!0,H.scrub){$(F.clientX);return}const oe=m.current,J=oe==null?void 0:oe.getBoundingClientRect(),ee=J?(F.clientX-J.left-H.startContentX)/J.width*o:0;let Q=ee,ue=null;const Ee=J&&J.width>0&&!F.altKey?e.find(Ce=>Ce.id===H.sceneId):void 0;if(Ee&&J){const Ce=jg/(J.width/o),xe=Pg(e,H.sceneId,g.current/i,o),me=Ee.startSec+ee,be=Ee.endSec+ee,Re=Ea(me,xe,Ce),ve=Ea(be,xe,Ce),_e=Re.snapped===null?1/0:Math.abs(Re.sec-me),it=ve.snapped===null?1/0:Math.abs(ve.sec-be);_e<=it&&Re.snapped!==null?(Q=ee+(Re.sec-me),ue=Re.snapped):ve.snapped!==null&&(Q=ee+(ve.sec-be),ue=ve.snapped)}const je=sM(e,H.sceneId,Q,o);if(je){const Ce=ue!==null&&(Math.abs(je.startSec-ue)<1e-6||Math.abs(je.endSec-ue)<1e-6)?ue:null;b({sceneId:H.sceneId,...je,snapped:Ce})}return}const K=h.current;if(!K||o<=0)return;const N=m.current;if(!N)return;const L=N.getBoundingClientRect(),X=(F.clientX-L.left-K.startContentX)/L.width*o;let Y=K.edge==="start"?K.origStart+X:K.origStart,V=K.edge==="end"?K.origEnd+X:K.origEnd,U=null;if(!F.altKey&&L.width>0){const oe=jg/(L.width/o),J=Pg(e,K.sceneId,g.current/i,o);if(K.edge==="start"){const ee=Ea(Y,J,oe);Y=ee.sec,U=ee.snapped}else{const ee=Ea(V,J,oe);V=ee.sec,U=ee.snapped}}const ie=aM(e,K.sceneId,Y,V,o),ce=U!==null&&(Math.abs(ie.startSec-U)<1e-6||Math.abs(ie.endSec-U)<1e-6)?U:null;b({sceneId:K.sceneId,...ie,snapped:ce})},P=F=>{x.current=!1;const O=v.current;if(O){v.current=null,O.moved&&!O.scrub&&b(K=>(K&&K.sceneId===O.sceneId&&u.patchTiming(O.sceneId,K.startSec,K.endSec),null));return}const H=h.current;H&&(b(K=>(K&&K.sceneId===H.sceneId&&(K.startSec!==H.origStart||K.endSec!==H.origEnd)&&u.patchTiming(H.sceneId,K.startSec,K.endSec),null)),h.current=null)};return window.addEventListener("mousemove",I),window.addEventListener("mouseup",P),()=>{window.removeEventListener("mousemove",I),window.removeEventListener("mouseup",P)}},[e,o,u,$,i]);const D=o>0?Math.min(1,k/i/o)*100:0;return c.jsxs("div",{style:hM,onMouseDownCapture:w1,children:[c.jsxs("div",{style:gM,children:[c.jsx("span",{style:yM,children:"ctrl+scroll to zoom"}),c.jsx("button",{"data-testid":"zoom-out",style:yc,onClick:()=>A(S/2),disabled:S<=1,title:"Zoom out (ctrl/cmd + scroll on the timeline)",children:"−"}),c.jsxs("span",{"data-testid":"zoom-level",style:vM,children:[Math.round(S*10)/10,"×"]}),c.jsx("button",{"data-testid":"zoom-in",style:yc,onClick:()=>A(S*2),disabled:S>=16,title:"Zoom in (ctrl/cmd + scroll on the timeline)",children:"+"}),c.jsx("button",{"data-testid":"zoom-fit",style:{...yc,width:"auto",padding:"0 8px"},onClick:()=>A(1),disabled:S<=1,title:"Fit the whole clip in view",children:"fit"})]}),c.jsx("div",{ref:_,"data-testid":"timeline-scroller",style:wM,children:c.jsxs("div",{style:{width:`${S*100}%`,minWidth:"100%",paddingBottom:6},children:[c.jsx("div",{"data-testid":"ruler",style:xM,onMouseDown:R=>{R.preventDefault(),$(R.clientX),x.current=!0},children:(()=>{var K;if(o<=0)return c.jsx("span",{style:wc,children:"0:00"});const I=(((K=_.current)==null?void 0:K.clientWidth)??1200)*S/o;let F=[.5,1,2,5,10,15,30,60,120,300,600].find(N=>N*I>=70)??600;for(;o/(F/5)>600;)F*=2;const O=F/5,H=[];for(let N=0;N<=o+1e-6;N+=O){const L=Math.round(N/O)%5===0,X=`${N/o*100}%`;H.push(c.jsx("div",{style:{position:"absolute",left:X,bottom:0,width:1,height:L?8:4,background:L?"#3A3A44":"#26262e",pointerEvents:"none"}},N.toFixed(3))),L&&N+O<=o&&H.push(c.jsx("span",{style:{...wc,position:"absolute",left:X,top:0,transform:N===0?void 0:"translateX(-50%)",pointerEvents:"none"},children:fM(N)},`l${N.toFixed(3)}`))}return c.jsxs(c.Fragment,{children:[H,c.jsx("span",{style:{...wc,position:"absolute",right:2,top:0,pointerEvents:"none"},children:vc(o,i)})]})})()}),c.jsxs("div",{ref:m,style:bM,onMouseDown:R=>{R.preventDefault(),$(R.clientX),x.current=!0},children:[e.map(R=>{const I=R.kind==="plain",P=(w==null?void 0:w.sceneId)===R.id,F=P?w.startSec:R.startSec,O=P?w.endSec:R.endSec,H=o>0?F/o*100:0,K=o>0?Math.max(0,(O-F)/o*100):0,N=(a==null?void 0:a.sceneId)===R.id,L=I&&p?T[p((R.startSec+R.endSec)/2).toFixed(1)]:void 0;return c.jsxs("div",{"data-testid":`timeline-block-${R.id}`,onMouseDown:X=>{var Y;X.stopPropagation(),X.preventDefault(),l({sceneId:R.id,elementId:null}),v.current={sceneId:R.id,startX:X.clientX,startContentX:X.clientX-(((Y=m.current)==null?void 0:Y.getBoundingClientRect().left)??0),moved:!1,scrub:I}},style:{...$g,left:`${H}%`,width:`${K}%`,zIndex:P?4:N?3:1,border:N?"2px solid #5b8cff":I?"1px solid #22222a":"1px solid #2A2A33",backgroundColor:N?"#1c2333":I?"#131318":"#1A1A21",...L?{backgroundImage:`linear-gradient(rgba(10,10,14,0.35), rgba(10,10,14,0.6)), url(${L})`,backgroundSize:"auto 100%, auto 100%",backgroundRepeat:"repeat-x"}:{}},children:[c.jsx("span",{style:I?L?{...Ca,color:"#D8D8DE",textShadow:"0 1px 2px rgba(0,0,0,0.9)"}:{...Ca,color:"#55555f"}:Ca,children:R.id}),!I&&R.pinned?c.jsx("span",{style:SM,children:"PIN"}):null,I?null:c.jsxs(c.Fragment,{children:[c.jsx("div",{onMouseDown:M(R,"start"),style:{...Mg,left:0,cursor:"ew-resize"}}),c.jsx("div",{onMouseDown:M(R,"end"),style:{...Mg,right:0,cursor:"ew-resize"}})]})]},R.id)}),t.map(R=>{const I=o>0?R.startSec/o*100:0,P=o>0?Math.max(0,(R.endSec-R.startSec)/o*100):0,F=(a==null?void 0:a.sceneId)===R.id;return c.jsx("div",{"data-testid":`timeline-block-${R.id}`,onMouseDown:O=>{O.stopPropagation(),O.preventDefault(),l({sceneId:R.id,elementId:null})},style:{...$g,left:`${I}%`,width:`${P}%`,zIndex:F?3:2,border:F?"2px dashed #5b8cff":"1px dashed #6a6a75",background:"transparent"},children:c.jsx("span",{style:{...Ca,color:"#6a6a75",textDecoration:"line-through"},children:R.id})},`ghost-${R.id}`)}),n.map((R,I)=>{const P=O=>o>0?Math.min(100,Math.max(0,O/o*100)):0;if(!R.src){const O=Math.min(Math.max(R.startSec,0),o),H=Math.min(Math.max(R.endSec,0),o),K=P(O),N=o>0?Math.max(0,(H-O)/o*100):0;return c.jsx("div",{"data-testid":`timeline-cut-${R.startSec}-${R.endSec}`,style:{...kM,left:`${K}%`,width:`${N}%`},children:c.jsx("div",{style:EM})},`cut-${I}-${R.startSec}-${R.endSec}`)}if(r.length===0)return null;const F=P(lM(r,R.src.startSec));return c.jsx("div",{"data-testid":`timeline-cut-seam-${R.startSec}-${R.endSec}`,title:"Restore cut — the material returns on the next produce/Render",onMouseDown:O=>{O.stopPropagation(),O.preventDefault(),u.restoreChunk(I)},style:{...CM,left:`${F}%`},children:c.jsx("div",{style:IM})},`cut-${I}-${R.startSec}-${R.endSec}`)}),w?c.jsxs("div",{"data-testid":"drag-readout",style:{...Ag,left:`${o>0?w.startSec/o*100:0}%`,transform:o>0&&w.startSec/o>.85?"translateX(-100%)":Ag.transform},children:[vc(w.startSec,i)," – ",vc(w.endSec,i)]}):null,(w==null?void 0:w.snapped)!==null&&(w==null?void 0:w.snapped)!==void 0?c.jsx("div",{"data-testid":"snap-tick",style:{...TM,left:`${o>0?w.snapped/o*100:0}%`}}):null,c.jsx("div",{"data-testid":"playhead",style:{...RM,left:`${D}%`},children:c.jsx("div",{"data-testid":"playhead-grab",onMouseDown:R=>{R.stopPropagation(),R.preventDefault(),x.current=!0},style:_M})})]})]})})]})},hM={flexShrink:0,borderTop:"1px solid #1E1E24",background:"#111116",padding:"6px 20px 8px"},gM={display:"flex",justifyContent:"flex-end",alignItems:"center",gap:6,marginBottom:4},yc={width:22,height:18,fontSize:12,lineHeight:1,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:4,cursor:"pointer",padding:0},vM={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3",minWidth:26,textAlign:"center"},yM={fontSize:10,color:"#55555f",marginRight:4,userSelect:"none"},wM={overflowX:"auto",overflowY:"hidden"},xM={position:"relative",height:18,padding:"0 2px",marginBottom:4,borderBottom:"1px solid #1E1E24",cursor:"ew-resize",userSelect:"none"},wc={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3"},bM={position:"relative",height:44,background:"#0F0F14",border:"1px solid #2A2A33",borderRadius:6,overflow:"visible",userSelect:"none"},$g={position:"absolute",top:3,bottom:3,borderRadius:4,boxSizing:"border-box",cursor:"pointer",display:"flex",alignItems:"center",overflow:"hidden"},Ca={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"},SM={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"},kM={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)"},EM={position:"absolute",left:0,right:0,top:"50%",height:2,background:"rgba(255,92,92,0.8)"},CM={position:"absolute",top:-4,bottom:-4,width:12,marginLeft:-6,zIndex:4,cursor:"pointer",pointerEvents:"auto"},IM={position:"absolute",left:"50%",top:0,bottom:0,width:2,background:"#FF5C5C",pointerEvents:"none"},Mg={position:"absolute",top:0,bottom:0,width:uM},TM={position:"absolute",top:-4,bottom:-4,width:1,zIndex:6,background:"#FFE14D",pointerEvents:"none"},Ag={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"},_M={position:"absolute",top:0,bottom:0,left:-4,width:10,pointerEvents:"auto",cursor:"ew-resize"},PM=({baseLines:e,liveLines:t,fps:n,playerRef:r,edits:o,width:i})=>{const[s,a]=d.useState(""),[l,u]=d.useState(null),[f,p]=d.useState(null),m=d.useRef(null),h=d.useMemo(()=>{var _;const E=[];let T=0;for(let j=0;j<t.length;j++){const A=t[j],z=e[j];for(let $=0;$<A.words.length;$++){const M=A.words[$];E.push({index:T,base:((_=z==null?void 0:z.words[$])==null?void 0:_.text)??M.text,live:M.text,start:M.start,end:M.end,lineStart:A.start,word:M}),T++}}return E},[e,t]);d.useEffect(()=>{const E=r.current;if(!E)return;const T=_=>{const j=_.detail.frame/n,A=h.find(z=>j>=z.start&&j<z.end);p(z=>A?A.index===z?z:A.index:z)};return E.addEventListener("frameupdate",T),()=>E.removeEventListener("frameupdate",T)},[r,n,h]),d.useEffect(()=>{var E,T,_;f!==null&&((_=(T=(E=m.current)==null?void 0:E.querySelector(`[data-testid="transcript-word-${f}"]`))==null?void 0:T.scrollIntoView)==null||_.call(T,{block:"nearest"}))},[f]);const x=s.trim().toLowerCase(),v=d.useMemo(()=>x?h.filter(E=>E.live.toLowerCase().includes(x)).map(E=>E.index):[],[x,h]),k=d.useMemo(()=>x?new Set(v):null,[x,v]),[y,g]=d.useState(0),w=E=>{var T,_,j;(j=(_=(T=m.current)==null?void 0:T.querySelector(`[data-testid="transcript-word-${E}"]`))==null?void 0:_.scrollIntoView)==null||j.call(_,{block:"center"})};d.useEffect(()=>{g(0),v.length>0&&w(v[0])},[v]);const b=E=>{if(v.length===0)return;const T=(y+E+v.length)%v.length;g(T),w(v[T])},S=E=>{const T=E.draft.trim();T&&o.patchCaption(E.srcStart,T,E.base),u(null)},C=E=>{Ns(E.word)!==null&&u({index:E.index,draft:E.live,srcStart:E.word.srcStart,base:E.base})};return c.jsxs("div",{"data-testid":"transcript-panel",style:{...jM,width:i},children:[c.jsxs("div",{style:FM,children:[c.jsx("span",{style:$M,children:"Transcript"}),c.jsx("div",{style:MM,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."}),c.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[c.jsx("input",{"data-testid":"transcript-search",style:{...AM,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))}}),c.jsx("button",{"data-testid":"transcript-prev",style:Ng,onClick:()=>b(-1),disabled:v.length===0,title:"Previous match (⇧Enter)","aria-label":"Previous match",children:"‹"}),c.jsx("button",{"data-testid":"transcript-next",style:Ng,onClick:()=>b(1),disabled:v.length===0,title:"Next match (Enter)","aria-label":"Next match",children:"›"})]}),k?c.jsx("div",{"data-testid":"transcript-match-count",style:{fontSize:11,color:"#9A9AA3"},children:v.length===0?"0 matches":`${y+1}/${v.length} match${v.length===1?"":"es"}`}):null]}),c.jsx("div",{style:NM,"data-testid":"transcript-body",ref:m,children:h.map((E,T)=>c.jsxs(te.Fragment,{children:[T>0?" ":null,(l==null?void 0:l.index)===E.index?c.jsx("input",{autoFocus:!0,"data-testid":"transcript-edit",style:VM,value:l.draft,onChange:_=>u({...l,draft:_.target.value}),onBlur:()=>S(l),onKeyDown:_=>{_.key==="Enter"&&_.target.blur(),_.key==="Escape"&&u(null)}}):c.jsx("span",{"data-testid":`transcript-word-${E.index}`,onClick:()=>{var _;return(_=r.current)==null?void 0:_.seekTo(Math.round(E.start*n))},onDoubleClick:()=>C(E),title:E.live!==E.base?`edited (was “${E.base}”) — double-click to retype`:"click to jump · double-click to retype",style:{...LM,...k!=null&&k.has(E.index)?zM:{},...v[y]===E.index?DM:{},...E.live!==E.base?OM:{},...f===E.index?BM:{}},children:E.live})]},E.index))})]})},jM={flexShrink:0,display:"flex",flexDirection:"column",background:"#111116",minHeight:0},FM={display:"flex",flexDirection:"column",gap:8,padding:"14px 14px 10px",borderBottom:"1px solid #1E1E24"},$M={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"#9A9AA3"},MM={fontSize:11,lineHeight:1.45,color:"#6a6a75"},AM={fontFamily:"'Inter', system-ui, sans-serif",fontSize:13,background:"#0F0F14",border:"1px solid #2A2A33",borderRadius:6,color:"#fff",padding:"6px 8px"},NM={flex:1,overflowY:"auto",overflowX:"hidden",overflowWrap:"break-word",padding:"10px 14px 16px",fontSize:13,lineHeight:2,color:"#C9C9D4"},LM={cursor:"pointer",borderRadius:3,padding:"1px 2px"},zM={background:"#2b2b1a",outline:"1px solid #6b6432"},DM={background:"#3d3a17",outline:"2px solid #FFE14D",color:"#fff"},Ng={width:26,height:30,fontSize:16,lineHeight:1,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:6,cursor:"pointer",padding:0},OM={color:"#FFE14D"},BM={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"},WM=[{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 — asks graphic or whole take (§139)"],["enter (in that dialog)","confirm the highlighted option"],["⌘/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"]]}],HM=({onClose:e})=>(d.useEffect(()=>{const t=n=>{n.key==="Escape"&&(n.stopPropagation(),e())};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e]),c.jsx("div",{style:UM,onMouseDown:e,children:c.jsxs("div",{"data-testid":"shortcuts-modal",style:ZM,onMouseDown:t=>t.stopPropagation(),children:[c.jsxs("div",{style:YM,children:[c.jsx("span",{style:KM,children:"keybinds"}),c.jsx("span",{style:GM,children:"esc close"})]}),c.jsx("div",{style:XM,children:"available commands and configured shortcuts"}),WM.map(t=>c.jsxs("div",{style:{marginTop:18},children:[c.jsx("div",{style:qM,children:t.title}),t.rows.map(([n,r])=>c.jsxs("div",{style:QM,children:[c.jsx("span",{style:JM,children:n}),c.jsx("span",{style:eA,children:r})]},n))]},t.title))]})})),UM={position:"fixed",inset:0,zIndex:30,background:"rgba(5,5,8,0.6)",display:"flex",alignItems:"center",justifyContent:"center"},ZM={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"},YM={display:"flex",justifyContent:"space-between",alignItems:"center"},KM={fontSize:18,fontWeight:700,color:"#EDEDF2"},GM={fontSize:13,fontWeight:700,color:"#0B0B0E",background:"#a8c7fa",borderRadius:4,padding:"3px 10px"},XM={fontSize:13,color:"#6a6a75",marginTop:4},qM={fontSize:14,fontWeight:700,color:"#8ab4f8",marginBottom:6},QM={display:"flex",gap:16,padding:"3px 0"},JM={width:290,flexShrink:0,color:"#c5a3ff",fontWeight:600,fontSize:13},eA={color:"#C9C9D4",fontSize:13},Lg={graphic:{label:"just the graphic",detail:e=>e.isSplitHalf?"this half only — the take underneath keeps playing":"the take underneath keeps playing"},take:{label:"the whole take",detail:e=>`cuts ${(e.endSec-e.startSec).toFixed(1)}s out of the video`}},tA=({plan:e,onConfirm:t,onCancel:n})=>{const[r,o]=d.useState(e.targets[0]),i=d.useRef(null),s=d.useRef(null);return d.useEffect(()=>{const a=l=>{if(l.key==="Escape"){l.stopPropagation(),n();return}if(l.key!=="Tab")return;const u=i.current;if(!u)return;const f=u.querySelectorAll("input, button"),p=f[0],m=f[f.length-1];!p||!m||(l.shiftKey&&document.activeElement===p?(l.preventDefault(),m.focus()):!l.shiftKey&&document.activeElement===m&&(l.preventDefault(),p.focus()))};return window.addEventListener("keydown",a,!0),()=>window.removeEventListener("keydown",a,!0)},[n]),d.useEffect(()=>{var l;const a=document.activeElement;return(l=s.current)==null||l.focus(),()=>{var u;return(u=a==null?void 0:a.focus)==null?void 0:u.call(a)}},[]),c.jsx("div",{style:nA,onMouseDown:n,children:c.jsxs("form",{ref:i,"data-testid":"delete-scene-modal",role:"dialog","aria-modal":"true","aria-label":`Delete ${e.rootId}`,style:rA,onMouseDown:a=>a.stopPropagation(),onSubmit:a=>{a.preventDefault(),t(r)},children:[c.jsxs("div",{style:oA,children:[c.jsxs("span",{style:iA,children:["delete ",e.rootId,e.isSplitHalf?c.jsx("span",{style:sA,children:"half"}):null,"?"]}),c.jsx("span",{style:aA,children:"esc cancel"})]}),c.jsx("div",{style:lA,children:"undoable with ⌘Z, like every other edit"}),c.jsx("div",{style:{marginTop:16},children:e.targets.map(a=>c.jsxs("label",{style:uA,"data-testid":`delete-option-${a}`,children:[c.jsx("input",{type:"radio",name:"delete-target",value:a,checked:r===a,onChange:()=>o(a),style:cA}),c.jsxs("span",{children:[c.jsx("span",{style:dA,children:Lg[a].label}),c.jsx("span",{style:fA,children:Lg[a].detail(e)})]})]},a))}),c.jsxs("div",{style:pA,children:[c.jsx("button",{type:"button","data-testid":"delete-cancel",style:x1,onClick:n,children:"Cancel"}),c.jsx("button",{ref:s,type:"submit","data-testid":"delete-confirm",style:mA,children:"Delete"})]})]})})},nA={position:"fixed",inset:0,zIndex:30,background:"rgba(5,5,8,0.6)",display:"flex",alignItems:"center",justifyContent:"center"},rA={width:420,maxWidth:"90vw",background:"#12121A",border:"1px solid #3A3A48",borderRadius:8,padding:"18px 22px 20px",fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace"},oA={display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},iA={fontSize:16,fontWeight:700,color:"#EDEDF2"},sA={fontSize:11,fontWeight:700,color:"#0B0B0E",background:"#c5a3ff",borderRadius:4,padding:"2px 6px",marginLeft:6},aA={fontSize:12,fontWeight:700,color:"#0B0B0E",background:"#a8c7fa",borderRadius:4,padding:"3px 10px",whiteSpace:"nowrap"},lA={fontSize:12,color:"#6a6a75",marginTop:4},uA={display:"flex",alignItems:"flex-start",gap:10,padding:"8px 0",cursor:"pointer"},cA={accentColor:"#8ab4f8",marginTop:2,cursor:"pointer"},dA={display:"block",fontSize:13,fontWeight:600,color:"#EDEDF2"},fA={display:"block",fontSize:12,color:"#9A9AA3",marginTop:2},pA={display:"flex",justifyContent:"flex-end",gap:8,marginTop:14},x1={fontSize:12,fontWeight:600,color:"#C9C9D4",background:"transparent",border:"1px solid #2A2A33",borderRadius:6,padding:"7px 12px",cursor:"pointer",fontFamily:"inherit"},mA={...x1,color:"#FF5C5C",border:"1px solid #452626"},hA=(e,t=3)=>{const n=e.split("/");if(n.length<=t)return{head:"",tail:e};const r=n.length-t;return{head:n.slice(0,r).join("/")||"/",tail:n.slice(r).join("/")}},zg=e=>e.scrollTop+e.clientHeight<e.scrollHeight-1,gA=(e,t,n)=>n<=0?-1:Math.max(0,Math.min(n-1,e+t)),Dg=({recent:e,required:t,onOpen:n,onClose:r})=>{const[o,i]=d.useState(null),[s,a]=d.useState(null),[l,u]=d.useState(!1),f=d.useRef(null),p=d.useRef(null),[m,h]=d.useState(!1),[x,v]=d.useState(!1),k=()=>{h(f.current?zg(f.current):!1)},y=()=>{v(p.current?zg(p.current):!1)},g=async S=>{try{const C=await fetch(`/api/fs${S?`?dir=${encodeURIComponent(S)}`:""}`),E=await C.json();if(!C.ok)throw new Error(E.error??`listing failed: ${C.status}`);i(E)}catch(C){a(C instanceof Error?C.message:String(C))}};d.useEffect(()=>{g()},[]),d.useEffect(()=>{const S=()=>{k(),y()};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[o,e]),d.useEffect(()=>{if(t)return;const S=C=>{C.key==="Escape"&&(C.stopPropagation(),r())};return window.addEventListener("keydown",S,!0),()=>window.removeEventListener("keydown",S,!0)},[t,r]);const w=S=>{var j;const C=S.key==="ArrowDown"?1:S.key==="ArrowUp"?-1:0;if(C===0&&S.key!=="Home"&&S.key!=="End")return;const E=Array.from(S.currentTarget.querySelectorAll("button"));if(E.length===0)return;const T=E.indexOf(document.activeElement),_=S.key==="Home"?0:S.key==="End"?E.length-1:gA(T,C,E.length);S.preventDefault(),(j=E[_])==null||j.focus()},b=S=>{u(!0),a(null),n(S).then(C=>{u(!1),C&&a(C)})};return c.jsx("div",{style:vA,onMouseDown:t?void 0:r,children:c.jsxs("div",{"data-testid":"project-picker",style:yA,onMouseDown:S=>S.stopPropagation(),children:[c.jsxs("div",{style:wA,children:[c.jsx("span",{style:xA,children:t?"open a project":"switch project"}),t?null:c.jsx("button",{"data-testid":"project-picker-close",style:bA,onClick:r,children:"esc close"})]}),c.jsx("div",{style:SA,children:"A project is a work directory a `ossclip produce` run wrote — the folder holding render-props.json."}),s?c.jsx("div",{"data-testid":"project-picker-error",style:kA,children:s}):null,e.length>0?c.jsxs("div",{style:{marginTop:16,flexShrink:0},children:[c.jsx("div",{style:Og,children:"recent"}),c.jsx("div",{ref:p,className:"ossclip-scroll-list",style:x?{...Bg,...Wg}:Bg,onScroll:y,onKeyDown:w,"data-testid":"project-recent-list",children:e.map(S=>{const{head:C,tail:E}=hA(S);return c.jsxs("button",{"data-testid":"project-recent",className:"ossclip-picker-row",style:{...xc,...RA},disabled:l,onClick:()=>b(S),title:S,children:[c.jsx("span",{style:{color:"#FFE14D",flexShrink:0},children:"▸"}),c.jsxs("span",{style:_A,children:[c.jsx("span",{style:PA,children:E}),C?c.jsx("span",{style:jA,children:C}):null]})]},S)})})]}):null,c.jsxs("div",{style:TA,children:[c.jsx("div",{style:Og,children:"browse"}),c.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 ",c.jsx("span",{style:{color:"#FFE14D"},children:"▸ .ossclip/…"})," entries."]}),o?c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:EA,children:[c.jsx("span",{style:CA,title:o.dir,children:o.dir}),o.isWorkdir?c.jsx("button",{"data-testid":"project-open-current",style:IA,disabled:l,onClick:()=>b(o.dir),children:"open this project"}):null]}),c.jsxs("div",{ref:f,className:"ossclip-scroll-list",style:m?{...Vg,...Wg}:Vg,onScroll:k,onKeyDown:w,"data-testid":"project-fs-list",children:[o.parent?c.jsxs("button",{"data-testid":"project-fs-up",className:"ossclip-picker-row",style:xc,disabled:l,onClick:()=>void g(o.parent),children:[c.jsx("span",{style:{color:"#6a6a75",flexShrink:0},children:"↑"}),c.jsx("span",{style:Hg,children:".."})]}):null,o.entries.map(S=>c.jsxs("button",{"data-testid":S.isWorkdir?"project-fs-workdir":"project-fs-dir",className:`ossclip-picker-row${S.isWorkdir?" is-workdir":""}`,style:xc,disabled:l,onClick:()=>S.isWorkdir?b(S.path):void g(S.path),title:S.path,children:[c.jsx("span",{style:{flexShrink:0,color:S.isWorkdir?"#FFE14D":"#6a6a75"},children:S.isWorkdir?"▸":"▪"}),c.jsxs("span",{style:Hg,children:[S.name,S.isWorkdir?null:c.jsx("span",{style:{color:"#55555f"},children:"/"})]}),S.isWorkdir?c.jsx("span",{style:FA,children:"project"}):null]},S.path)),o.entries.length===0?c.jsx("div",{style:{color:"#6a6a75",fontSize:12,padding:"6px 8px"},children:"no folders here"}):null]})]}):c.jsx("div",{style:{color:"#6a6a75",fontSize:13},children:"loading…"})]})]})})},vA={position:"fixed",inset:0,zIndex:30,background:"rgba(5,5,8,0.6)",display:"flex",alignItems:"center",justifyContent:"center"},yA={width:620,maxWidth:"90vw",maxHeight:"82vh",boxSizing:"border-box",display:"flex",flexDirection:"column",background:"#12121A",border:"1px solid #3A3A48",borderRadius:8,padding:"20px 26px 26px",fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace"},wA={display:"flex",justifyContent:"space-between",alignItems:"center"},xA={fontSize:18,fontWeight:700,color:"#EDEDF2"},bA={fontSize:13,fontWeight:700,color:"#0B0B0E",background:"#a8c7fa",border:"none",borderRadius:4,padding:"3px 10px",cursor:"pointer"},SA={fontSize:13,color:"#6a6a75",marginTop:4},kA={marginTop:12,fontSize:13,color:"#FF5C5C"},Og={fontSize:14,fontWeight:700,color:"#8ab4f8",marginBottom:6},EA={display:"flex",alignItems:"center",gap:10,marginBottom:6},CA={fontSize:12,color:"#9A9AA3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},IA={flexShrink:0,fontSize:12,fontWeight:700,color:"#0B0B0E",background:"#FFE14D",border:"1px solid #FFE14D",borderRadius:6,padding:"4px 10px",cursor:"pointer"},TA={marginTop:16,display:"flex",flexDirection:"column",flex:1,minHeight:0},Bg={maxHeight:218,overflowY:"auto",overscrollBehavior:"contain",flexShrink:0,display:"flex",flexDirection:"column",gap:2},Vg={flex:1,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",display:"flex",flexDirection:"column",gap:2},Wg={maskImage:"linear-gradient(to bottom, black calc(100% - 24px), transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black calc(100% - 24px), transparent 100%)"},xc={flexShrink:0,minHeight:34,display:"flex",alignItems:"center",gap:8,width:"100%",boxSizing:"border-box",textAlign:"left",fontFamily:"inherit",fontSize:13,lineHeight:1.4,borderRadius:6,padding:"6px 10px",cursor:"pointer",overflow:"hidden"},Hg={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},RA={minHeight:46,alignItems:"center"},_A={display:"flex",flexDirection:"column",minWidth:0},PA={color:"#EDEDF2",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},jA={fontSize:11,color:"#6a6a75",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},FA={marginLeft:10,fontSize:11,fontWeight:700,color:"#FFE14D"},$A=({defaultOutPath:e,onCancel:t,onConfirm:n})=>{const[r,o]=d.useState(e??""),[i,s]=d.useState(!1);d.useEffect(()=>{const l=u=>{u.key==="Escape"?(u.stopPropagation(),t()):u.key==="Enter"&&!i&&(u.preventDefault(),n(r.trim()?r.trim():void 0))};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[t,n,r,i]);const a=async()=>{s(!0);try{const l=await fetch("/api/pick-save-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({defaultPath:r||e})});if(l.ok){const u=await l.json();u.path&&o(u.path)}}catch{}finally{s(!1)}};return c.jsx("div",{style:MA,onMouseDown:t,children:c.jsxs("div",{"data-testid":"render-modal",style:AA,onMouseDown:l=>l.stopPropagation(),children:[c.jsxs("div",{style:NA,children:[c.jsx("div",{style:LA,children:"🎬 Render Master Video"}),c.jsx("button",{style:zA,onClick:t,children:"✕"})]}),c.jsx("div",{style:DA,children:"Choose where to export your rendered master cut, or keep the default location."}),c.jsxs("div",{style:{marginTop:20},children:[c.jsx("label",{style:OA,children:"Export File Destination"}),c.jsxs("div",{style:BA,children:[c.jsx("input",{"data-testid":"render-outpath-input",type:"text",value:r,onChange:l=>o(l.target.value),placeholder:"e.g. /Users/name/Movies/final-cut.mp4",style:VA,autoFocus:!0}),c.jsx("button",{"data-testid":"render-browse-btn",style:WA,onClick:a,disabled:i,title:"Open native file picker to choose destination",children:i?"Browsing…":"📁 Browse…"})]})]}),c.jsxs("div",{style:HA,children:[c.jsx("button",{style:UA,onClick:t,children:"Cancel"}),c.jsx("button",{"data-testid":"render-confirm-btn",style:ZA,onClick:()=>n(r.trim()?r.trim():void 0),children:"Start Render ⚡"})]})]})})},MA={position:"fixed",inset:0,zIndex:40,background:"rgba(5,5,8,0.75)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center"},AA={width:560,maxWidth:"92vw",background:"#12121A",border:"1px solid #3A3A48",borderRadius:10,padding:"24px 28px",boxShadow:"0 20px 40px rgba(0,0,0,0.6)",fontFamily:"ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},NA={display:"flex",justifyContent:"space-between",alignItems:"center"},LA={fontSize:18,fontWeight:700,color:"#EDEDF2",letterSpacing:"-0.01em"},zA={background:"transparent",border:"none",color:"#8B8B9E",fontSize:16,cursor:"pointer",padding:"4px 8px",borderRadius:4},DA={fontSize:13,color:"#8B8B9E",marginTop:6,lineHeight:1.4},OA={display:"block",fontSize:12,fontWeight:600,color:"#C9C9D4",marginBottom:8,textTransform:"uppercase",letterSpacing:"0.04em"},BA={display:"flex",gap:8},VA={flex:1,background:"#09090D",border:"1px solid #2C2C38",borderRadius:6,padding:"10px 14px",color:"#EDEDF2",fontSize:13,fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace",outline:"none"},WA={background:"#1E1E2A",border:"1px solid #3A3A48",borderRadius:6,color:"#EDEDF2",padding:"0 16px",fontSize:13,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"},HA={display:"flex",justifyContent:"flex-end",gap:12,marginTop:24},UA={background:"transparent",border:"1px solid #2C2C38",borderRadius:6,color:"#C9C9D4",padding:"9px 18px",fontSize:13,fontWeight:600,cursor:"pointer"},ZA={background:"#00E5A3",border:"none",borderRadius:6,color:"#051A13",padding:"9px 20px",fontSize:13,fontWeight:700,cursor:"pointer",boxShadow:"0 2px 10px rgba(0,229,163,0.3)"};function YA(e){switch(e){case"override":return"Project override";case"flag":case"config":return"Your default portrait"}}function KA(e){const t=/^data:([^;,]+);base64,(.+)$/s.exec(e);return t?{mimeType:t[1],data:t[2]}:null}function GA(e){switch(e){case"no-youtube":return'This project was produced without the YouTube pack. The AI thumbnail needs --youtube — run produce with it (or set "youtube": true in ~/.ossclip/config.json) and render once.';case"no-portrait":return'No portrait photo is configured — the thumbnail uses it as the likeness reference. Set "portrait" in ~/.ossclip/config.json or run produce with --portrait <path>.';case"no-key":return"GEMINI_API_KEY is not set in the environment the edit server runs in.";case"portrait-missing":return"The configured portrait photo no longer exists on disk.";default:return"The AI thumbnail is unavailable for this project."}}const Ug=60,XA=({onClose:e})=>{const[t,n]=d.useState(null),[r,o]=d.useState(null),[i,s]=d.useState(""),[a,l]=d.useState(""),[u,f]=d.useState(""),[p,m]=d.useState(null),[h,x]=d.useState(!1),[v,k]=d.useState(null),[y,g]=d.useState(null),w=d.useRef(null);d.useEffect(()=>{const _=j=>{j.key==="Escape"&&(j.stopPropagation(),e())};return window.addEventListener("keydown",_,!0),()=>window.removeEventListener("keydown",_,!0)},[e]),d.useEffect(()=>{(async()=>{try{const _=await fetch("/api/thumbnail"),j=await _.json();if(!_.ok)throw new Error(j.error??`GET /api/thumbnail failed: ${_.status}`);n(j),m(j.imageUrl),j.concept&&(s(j.concept.overlayText),l(j.concept.scene),f(j.concept.styleNotes))}catch(_){o(_ instanceof Error?_.message:String(_))}})()},[]);const b=async()=>{x(!0),k(null);try{const _=await fetch("/api/thumbnail/regenerate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({concept:{scene:a,overlayText:i,styleNotes:u}})}),j=await _.json();if(!_.ok||j.ok!==!0){k(j.error??`regenerate failed: ${_.status}`);return}m(j.imageUrl??null)}catch(_){k(_ instanceof Error?_.message:String(_))}finally{x(!1)}},S=_=>{n(j=>j&&{...j,portrait:_})},C=async _=>{g(null);try{const j=await new Promise((M,W)=>{const D=new FileReader;D.onload=()=>M(String(D.result)),D.onerror=()=>W(new Error("could not read the image file")),D.readAsDataURL(_)}),A=KA(j);if(A===null){g("could not read the image file");return}const z=await fetch("/api/thumbnail/portrait",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(A)}),$=await z.json();if(!z.ok||$.ok!==!0){g($.error??`swap failed: ${z.status}`);return}S($.portrait??null)}catch(j){g(j instanceof Error?j.message:String(j))}},E=async()=>{g(null);try{const _=await fetch("/api/thumbnail/portrait",{method:"DELETE"}),j=await _.json();if(!_.ok||j.ok!==!0){g(j.error??`reset failed: ${_.status}`);return}S(j.portrait??null)}catch(_){g(_ instanceof Error?_.message:String(_))}},T=(t==null?void 0:t.status)==="unavailable";return c.jsx("div",{style:qA,onMouseDown:e,children:c.jsxs("div",{"data-testid":"thumbnail-modal",style:QA,onMouseDown:_=>_.stopPropagation(),children:[c.jsxs("div",{style:JA,children:[c.jsx("div",{style:e5,children:"AI Thumbnail"}),c.jsx("button",{style:t5,onClick:e,"aria-label":"Close",children:"✕"})]}),r?c.jsxs("div",{"data-testid":"thumbnail-load-error",style:Ec,children:["Couldn't load the thumbnail state: ",r]}):t===null?c.jsx("div",{style:bc,children:"Loading…"}):T?c.jsx("div",{"data-testid":"thumbnail-unavailable",style:{...bc,marginTop:12},children:GA(t.reason)}):c.jsxs(c.Fragment,{children:[t.status==="skipped"?c.jsx("div",{"data-testid":"thumbnail-skipped-note",style:{...bc,marginTop:8},children:"Thumbnail was skipped at the concept approval prompt — regenerating replaces that decision."}):null,c.jsx("div",{style:n5,children:p?c.jsx("img",{"data-testid":"thumbnail-image",src:p,alt:"Current AI thumbnail",style:r5}):c.jsx("div",{"data-testid":"thumbnail-placeholder",style:o5,children:"No thumbnail generated yet — edit the concept and hit Regenerate."})}),t.portrait?c.jsxs("div",{"data-testid":"portrait-strip",style:i5,children:[c.jsx("img",{"data-testid":"portrait-preview",src:t.portrait.url,alt:"Portrait reference",style:s5}),c.jsxs("div",{style:{flex:1,minWidth:0},children:[c.jsx("div",{"data-testid":"portrait-source",style:a5,children:YA(t.portrait.source)}),c.jsx("div",{style:Yg,children:"The swap applies to this project only and is used by future renders too."})]}),c.jsx("button",{"data-testid":"portrait-swap-btn",style:Zg,onClick:()=>{var _;return(_=w.current)==null?void 0:_.click()},disabled:h,children:"Swap face…"}),t.portrait.source==="override"?c.jsx("button",{"data-testid":"portrait-reset-btn",style:Zg,onClick:()=>void E(),disabled:h,children:"Use default"}):null,c.jsx("input",{ref:w,"data-testid":"portrait-file-input",type:"file",accept:"image/png,image/jpeg,image/webp",style:{display:"none"},onChange:_=>{var A;const j=(A=_.target.files)==null?void 0:A[0];_.target.value="",j&&C(j)}})]}):null,y?c.jsx("div",{"data-testid":"portrait-error",style:Ec,children:y}):null,c.jsxs("div",{style:{marginTop:16},children:[c.jsxs("label",{style:Sc,children:["Overlay text — the words ON the image (",Ug," chars, 4–9 words)"]}),c.jsx("input",{"data-testid":"thumbnail-overlay-input",type:"text",maxLength:Ug,value:i,onChange:_=>s(_.target.value),style:kc})]}),c.jsxs("div",{style:{marginTop:12},children:[c.jsx("label",{style:Sc,children:"Scene — what the image shows"}),c.jsx("textarea",{"data-testid":"thumbnail-scene-input",value:a,onChange:_=>l(_.target.value),rows:3,style:{...kc,resize:"vertical"}})]}),c.jsxs("div",{style:{marginTop:12},children:[c.jsx("label",{style:Sc,children:"Style notes — palette, lighting, mood"}),c.jsx("textarea",{"data-testid":"thumbnail-style-input",value:u,onChange:_=>f(_.target.value),rows:3,style:{...kc,resize:"vertical"}})]}),v?c.jsx("div",{"data-testid":"thumbnail-error",style:Ec,children:v}):null,c.jsxs("div",{style:l5,children:[c.jsx("div",{style:Yg,children:"Regenerating replaces the video's .thumbnail.png and saves this concept for future renders."}),c.jsx("button",{"data-testid":"thumbnail-regenerate-btn",style:{...u5,...h?{opacity:.6,cursor:"default"}:{}},onClick:()=>void b(),disabled:h,children:h?"Generating…":"Regenerate"})]})]})]})})},qA={position:"fixed",inset:0,zIndex:40,background:"rgba(5,5,8,0.75)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center"},QA={width:560,maxWidth:"92vw",maxHeight:"90vh",overflowY:"auto",background:"#12121A",border:"1px solid #3A3A48",borderRadius:10,padding:"24px 28px",boxShadow:"0 20px 40px rgba(0,0,0,0.6)",fontFamily:"ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},JA={display:"flex",justifyContent:"space-between",alignItems:"center"},e5={fontSize:18,fontWeight:700,color:"#EDEDF2",letterSpacing:"-0.01em"},t5={background:"transparent",border:"none",color:"#8B8B9E",fontSize:16,cursor:"pointer",padding:"4px 8px",borderRadius:4},bc={fontSize:13,color:"#8B8B9E",marginTop:6,lineHeight:1.4},n5={marginTop:16,border:"1px solid #2C2C38",borderRadius:6,background:"#09090D",aspectRatio:"16 / 9",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},r5={width:"100%",height:"100%",objectFit:"contain"},o5={color:"#8B8B9E",fontSize:13,padding:16,textAlign:"center"},i5={display:"flex",alignItems:"center",gap:12,marginTop:12,padding:"10px 12px",border:"1px solid #2C2C38",borderRadius:6,background:"#09090D"},s5={width:44,height:44,borderRadius:6,objectFit:"cover",flexShrink:0,border:"1px solid #2C2C38"},a5={fontSize:12,fontWeight:600,color:"#C9C9D4",marginBottom:2},Zg={background:"transparent",border:"1px solid #3A3A48",borderRadius:6,color:"#C9C9D4",padding:"7px 12px",fontSize:12,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"},Sc={display:"block",fontSize:12,fontWeight:600,color:"#C9C9D4",marginBottom:8,textTransform:"uppercase",letterSpacing:"0.04em"},kc={width:"100%",boxSizing:"border-box",background:"#09090D",border:"1px solid #2C2C38",borderRadius:6,padding:"10px 14px",color:"#EDEDF2",fontSize:13,fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace",outline:"none"},Ec={marginTop:12,color:"#FF5C5C",fontSize:13,fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace",whiteSpace:"pre-wrap"},l5={display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,marginTop:20},Yg={fontSize:12,color:"#8B8B9E",lineHeight:1.4},u5={background:"#00E5A3",border:"none",borderRadius:6,color:"#051A13",padding:"9px 20px",fontSize:13,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap",boxShadow:"0 2px 10px rgba(0,229,163,0.3)"},Kg=3,Gg=5,Cc=500;function c5(e){return e.split(/\s+/).filter(t=>t.replace(/^#+/,"").length>0).map(t=>t.startsWith("#")?t:`#${t}`)}function d5(e){return e.map(t=>t.startsWith("#")?t:`#${t}`).join(" ")}function b1(e){return e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function S1(e){return e.join(", ")}function f5(e){return S1(b1(e)).length}function p5(e){const t=Math.max(0,Math.floor(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function m5(e){return`[${{browse:"Browse",search:"Search",benefit:"Benefit",alt:"Alt"}[e]}]`}const h5="This run never generated YouTube metadata. Run produce with --youtube (and an LLM provider) once — the pack lands here afterwards.",g5=({onClose:e})=>{var z;const[t,n]=d.useState(null),[r,o]=d.useState(null),[i,s]=d.useState([]),[a,l]=d.useState(null),[u,f]=d.useState(""),[p,m]=d.useState(""),[h,x]=d.useState(""),[v,k]=d.useState(null),[y,g]=d.useState(null),[w,b]=d.useState(null),[S,C]=d.useState(!1),[E,T]=d.useState(null);d.useEffect(()=>{const $=M=>{M.key==="Escape"&&(M.stopPropagation(),e())};return window.addEventListener("keydown",$,!0),()=>window.removeEventListener("keydown",$,!0)},[e]);const _=d.useCallback(async()=>{try{const $=await fetch("/api/youtube"),M=await $.json();if(!$.ok)throw new Error(M.error??`GET /api/youtube failed: ${$.status}`);n(M),M.pack&&(s(M.pack.titles),l(M.pack.titleAngles??null),f(M.pack.description),m(d5(M.pack.hashtags)),x(S1(M.pack.tags)),k(M.pack.hook60??null),g(M.pack.linkedinPost??null),b(M.pack.communityPost??null))}catch($){o($ instanceof Error?$.message:String($))}},[]);d.useEffect(()=>{_()},[_]);const j=async()=>{var $;C(!0),T(null);try{const M=await fetch("/api/youtube",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({pack:{titles:i,...a!==null?{titleAngles:a}:{},description:u,hashtags:c5(p),tags:b1(h),...($=t==null?void 0:t.pack)!=null&&$.chapters?{chapters:t.pack.chapters}:{},...v!==null?{hook60:v}:{},...y!==null?{linkedinPost:y}:{},...w!==null?{communityPost:w}:{}}})}),W=await M.json();if(!M.ok||W.ok!==!0){T(W.error??`save failed: ${M.status}`);return}await _()}catch(M){T(M instanceof Error?M.message:String(M))}finally{C(!1)}},A=f5(h);return c.jsx("div",{style:v5,onMouseDown:e,children:c.jsxs("div",{"data-testid":"youtube-modal",style:y5,onMouseDown:$=>$.stopPropagation(),children:[c.jsxs("div",{style:w5,children:[c.jsx("div",{style:x5,children:"YouTube SEO metadata"}),c.jsx("button",{style:b5,onClick:e,"aria-label":"Close",children:"✕"})]}),r?c.jsxs("div",{"data-testid":"youtube-load-error",style:Qg,children:["Couldn't load the YouTube pack: ",r]}):t===null?c.jsx("div",{style:Xg,children:"Loading…"}):t.available?c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:{marginTop:16},children:[c.jsxs("label",{style:er,children:["Title options (",Kg,"–",Gg,", up to 100 chars each)"]}),i.map(($,M)=>c.jsxs("div",{style:S5,children:[(a==null?void 0:a[M])!==void 0?c.jsx("span",{"data-testid":`youtube-title-angle-${M}`,style:k5,children:m5(a[M])}):null,c.jsx("input",{"data-testid":`youtube-title-input-${M}`,type:"text",maxLength:100,value:$,onChange:W=>s(D=>D.map((R,I)=>I===M?W.target.value:R)),style:$r}),c.jsx("button",{"data-testid":`youtube-title-remove-${M}`,style:qg,disabled:i.length<=Kg,onClick:()=>{s(W=>W.filter((D,R)=>R!==M)),l(W=>W&&W.filter((D,R)=>R!==M))},"aria-label":`Remove title ${M+1}`,children:"✕"})]},M)),c.jsx("button",{"data-testid":"youtube-title-add",style:qg,disabled:i.length>=Gg,onClick:()=>{s($=>[...$,""]),l($=>$&&[...$,"alt"])},children:"+ Add title"})]}),c.jsxs("div",{style:{marginTop:12},children:[c.jsx("label",{style:er,children:"Description"}),c.jsx("textarea",{"data-testid":"youtube-description-input",value:u,onChange:$=>f($.target.value),rows:6,style:{...$r,resize:"vertical"}})]}),c.jsxs("div",{style:{marginTop:12},children:[c.jsx("label",{style:er,children:"Hashtags — space-separated, # added if missing"}),c.jsx("input",{"data-testid":"youtube-hashtags-input",type:"text",value:p,onChange:$=>m($.target.value),style:$r})]}),c.jsxs("div",{style:{marginTop:12},children:[c.jsx("label",{style:er,children:"Tags — comma-separated"}),c.jsx("input",{"data-testid":"youtube-tags-input",type:"text",value:h,onChange:$=>x($.target.value),style:$r}),c.jsxs("div",{"data-testid":"youtube-tags-counter",style:{...E5,...A>Cc?{color:"#FFB84D"}:{}},children:[A," / ",Cc,A>Cc?" — tags past the budget are dropped on save":""]})]}),(z=t.pack)!=null&&z.chapters&&t.pack.chapters.length>0?c.jsxs("div",{style:{marginTop:12},children:[c.jsx("label",{style:er,children:"Chapters (read-only — embedded in the description on save/render)"}),c.jsx("div",{"data-testid":"youtube-chapters",style:C5,children:t.pack.chapters.map(($,M)=>c.jsxs("div",{children:[p5($.atSec)," ",$.title]},M))}),c.jsx("div",{style:Jg,children:"Timestamps are measured from the actual edit, so they are not hand-editable here; the .youtube.md splices them into the description's Timestamps block for you."})]}):null,v!==null?c.jsxs("div",{style:{marginTop:12},children:[c.jsx("label",{style:er,children:"First-60s hook strategy (for you — never uploaded)"}),c.jsx("textarea",{"data-testid":"youtube-hook60-input",value:v,onChange:$=>k($.target.value),rows:3,style:{...$r,resize:"vertical"}})]}):null,y!==null?c.jsxs("div",{style:{marginTop:12},children:[c.jsx("label",{style:er,children:"LinkedIn post"}),c.jsx("textarea",{"data-testid":"youtube-linkedin-input",value:y,onChange:$=>g($.target.value),rows:6,style:{...$r,resize:"vertical"}})]}):null,w!==null?c.jsxs("div",{style:{marginTop:12},children:[c.jsx("label",{style:er,children:"Community post"}),c.jsx("textarea",{"data-testid":"youtube-community-input",value:w,onChange:$=>b($.target.value),rows:3,style:{...$r,resize:"vertical"}})]}):null,E?c.jsx("div",{"data-testid":"youtube-error",style:Qg,children:E}):null,c.jsxs("div",{style:I5,children:[c.jsx("div",{style:Jg,children:"Saves for future renders and rewrites the .youtube.md file now. Delete youtube-pack-approved.json in the workdir to let the AI regenerate."}),c.jsx("button",{"data-testid":"youtube-save-btn",style:{...T5,...S?{opacity:.6,cursor:"default"}:{}},onClick:()=>void j(),disabled:S,children:S?"Saving…":"Save"})]})]}):c.jsx("div",{"data-testid":"youtube-unavailable",style:{...Xg,marginTop:12},children:h5})]})})},v5={position:"fixed",inset:0,zIndex:40,background:"rgba(5,5,8,0.75)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center"},y5={width:620,maxWidth:"92vw",maxHeight:"90vh",overflowY:"auto",background:"#12121A",border:"1px solid #3A3A48",borderRadius:10,padding:"24px 28px",boxShadow:"0 20px 40px rgba(0,0,0,0.6)",fontFamily:"ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},w5={display:"flex",justifyContent:"space-between",alignItems:"center"},x5={fontSize:18,fontWeight:700,color:"#EDEDF2",letterSpacing:"-0.01em"},b5={background:"transparent",border:"none",color:"#8B8B9E",fontSize:16,cursor:"pointer",padding:"4px 8px",borderRadius:4},Xg={fontSize:13,color:"#8B8B9E",marginTop:6,lineHeight:1.4},er={display:"block",fontSize:12,fontWeight:600,color:"#C9C9D4",marginBottom:8,textTransform:"uppercase",letterSpacing:"0.04em"},$r={width:"100%",boxSizing:"border-box",background:"#09090D",border:"1px solid #2C2C38",borderRadius:6,padding:"10px 14px",color:"#EDEDF2",fontSize:13,fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace",outline:"none"},S5={display:"flex",gap:8,alignItems:"center",marginBottom:8},k5={fontSize:11,fontWeight:700,color:"#8B8B9E",fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace",whiteSpace:"nowrap",minWidth:62},qg={fontSize:12,fontWeight:600,color:"#C9C9D4",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:6,padding:"6px 10px",cursor:"pointer",whiteSpace:"nowrap"},E5={marginTop:6,fontSize:12,color:"#8B8B9E",fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace"},C5={border:"1px solid #2C2C38",borderRadius:6,background:"#09090D",padding:"10px 14px",color:"#C9C9D4",fontSize:13,fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace",lineHeight:1.6},Qg={marginTop:12,color:"#FF5C5C",fontSize:13,fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace",whiteSpace:"pre-wrap"},I5={display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,marginTop:20},Jg={fontSize:12,color:"#8B8B9E",lineHeight:1.4,marginTop:6},T5={background:"#00E5A3",border:"none",borderRadius:6,color:"#051A13",padding:"9px 20px",fontSize:13,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap",boxShadow:"0 2px 10px rgba(0,229,163,0.3)"};function Ia(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 R5(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 _5(e,t){const n=Math.max(0,Math.floor((t-e)/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function P5(e,t){return e?{load:e,notifyDiscard:t}:{load:null,notifyDiscard:!1}}function j5(e){if(e.dirty){if(e.renderRunning){e.onBlocked();return}e.save().catch(t=>e.onSaveError(t instanceof Error?t.message:String(t)))}}function F5(e,t){const{cues:n}=Ud(e,t);return jp(n,t.splits).filter(o=>{var i;return((i=t.scenes[o.id])==null?void 0:i.hidden)===!0})}const ev=e=>({...e,...B$(e)}),tv=e=>{const t=g1(e);e.forEach((n,r)=>{console.warn(`ossclip §137: dropped caption edit ${JSON.stringify(n)} — ${t[r]}`)})},$5=()=>{const e=D$(),t=d.useRef(e.dirty);t.current=e.dirty;const[n,r]=d.useState(!1),[o,i]=d.useState(!1),[s,a]=d.useState([]),[l,u]=d.useState([]),f=d.useRef(e.doc.captions);f.current=e.doc.captions;const[p,m]=d.useState(null),[h,x]=d.useState(null),[v,k]=d.useState(null),[y,g]=d.useState(null),[w,b]=d.useState(null),[S,C]=d.useState(!1),[E,T]=d.useState(1),[_,j]=d.useState(null),[A,z]=d.useState(!1),[$,M]=d.useState([]),[W,D]=d.useState(null),[R,I]=d.useState(!1),[P,F]=d.useState(null),[O,H]=d.useState(!1),[K,N]=d.useState(),L=d.useRef(null);d.useEffect(()=>()=>{L.current!==null&&window.clearInterval(L.current)},[]);const[X,Y]=d.useState(null),V=d.useRef(null),U=d.useRef(null),ie=d.useRef(null),ce=d.useRef(null),[ae,oe]=d.useState(null),[J,ee]=d.useState(null),Q=d.useCallback(B=>{var Ie;if(ie.current=B,ee(B),(Ie=ce.current)==null||Ie.disconnect(),ce.current=null,!B)return;const G=()=>oe({w:Math.max(0,B.clientWidth-Tc*2),h:Math.max(0,B.clientHeight-Tc*2)});G();const ne=new ResizeObserver(G);ne.observe(B),ce.current=ne},[]),[ue,Ee]=d.useState(1),je=d.useRef(ue);je.current=ue;const Ce=d.useRef(null),xe=d.useCallback((B,G)=>{const ne=ie.current,Ie=Math.min(8,Math.max(.25,B)),At=je.current;if(ne&&Ie!==At){const wt=ne.getBoundingClientRect();Ce.current={prev:At,ax:((G==null?void 0:G.x)??wt.left+wt.width/2)-wt.left,ay:((G==null?void 0:G.y)??wt.top+wt.height/2)-wt.top,sl:ne.scrollLeft,st:ne.scrollTop}}Ee(Ie)},[]);d.useLayoutEffect(()=>{const B=ie.current,G=Ce.current;if(!B||!G)return;Ce.current=null;const ne=ue/G.prev;B.scrollLeft=(G.sl+G.ax)*ne-G.ax,B.scrollTop=(G.st+G.ay)*ne-G.ay},[ue]),d.useEffect(()=>{const B=J;if(!B)return;const G=ne=>{(ne.ctrlKey||ne.metaKey)&&(ne.preventDefault(),xe(je.current*Math.exp(-ne.deltaY*.01),{x:ne.clientX,y:ne.clientY}))};return B.addEventListener("wheel",G,{passive:!1}),()=>B.removeEventListener("wheel",G)},[J,xe]);const me=d.useRef(null);d.useEffect(()=>{const B=ne=>{const Ie=me.current,At=ie.current;!Ie||!At||(At.scrollLeft=Ie.sl-(ne.clientX-Ie.x),At.scrollTop=Ie.st-(ne.clientY-Ie.y))},G=()=>{me.current=null};return window.addEventListener("mousemove",B),window.addEventListener("mouseup",G),()=>{window.removeEventListener("mousemove",B),window.removeEventListener("mouseup",G)}},[]);const[be,Re]=d.useState(!1),[ve,_e]=d.useState(()=>{const B=Number(window.localStorage.getItem(rv));return Number.isFinite(B)&&B>0?ov(B):300}),it=d.useRef(null);d.useEffect(()=>{const B=ne=>{const Ie=it.current;Ie&&_e(ov(Ie.startW+(ne.clientX-Ie.startX)))},G=()=>{it.current&&(it.current=null,_e(ne=>(window.localStorage.setItem(rv,String(ne)),ne)))};return window.addEventListener("mousemove",B),window.addEventListener("mouseup",G),()=>{window.removeEventListener("mousemove",B),window.removeEventListener("mouseup",G)}},[]);const[en,Tn]=d.useState(!1),[tn,Rn]=d.useState(!1),[Yn,Mt]=d.useState(!1),[_n,Pr]=d.useState(!1);d.useEffect(()=>{if(!_n)return;const B=G=>{G.key==="Escape"&&(G.stopPropagation(),Pr(!1))};return window.addEventListener("keydown",B,!0),()=>window.removeEventListener("keydown",B,!0)},[_n]);const[Kn,ao]=d.useState(null),[di,bu]=d.useState(!0),zs=d.useCallback(B=>{const G=fR({rate:E,playing:S},B);T(G.rate);const ne=U.current;ne&&(G.playing&&!S&&ne.play(),!G.playing&&S&&ne.pause())},[E,S]);d.useEffect(()=>{const B=U.current;if(!B)return;const G=()=>C(!0),ne=()=>C(!1);return B.addEventListener("play",G),B.addEventListener("pause",ne),()=>{B.removeEventListener("play",G),B.removeEventListener("pause",ne)}});const jr=d.useCallback(()=>{if(L.current!==null)return;const B=window.setInterval(()=>{(async()=>{try{const ne=await(await fetch("/api/render/status")).json();if(ne.running||ne.exitCode===null){F(Ie=>({running:ne.running,lines:ne.lines??[],startedAt:ne.startedAt??(Ie==null?void 0:Ie.startedAt)}));return}if(L.current!==null&&(window.clearInterval(L.current),L.current=null),ne.exitCode===0){const At=await(await fetch("/api/production")).json(),wt=ev(At.renderProps);x(wt),I(!!At.canRender);const Gn=P5(At.overrides,t.current);if(Gn.load){const Vs=f.current,Xn=Ig(Gn.load,wt);e.load(Xn.doc),tv(Xn.unresolved),a(Xn.unresolved);const xt=H$(W$(Vs,Xn.doc.captions));for(const k1 of xt)console.warn(`ossclip §137: ${k1}`);u(xt)}else a([]),u([]);Gn.notifyDiscard&&r(!0),F(null)}else F({running:!1,lines:ne.lines??[],failed:ne.exitCode,cancelled:ne.cancelled})}catch{L.current===null&&jr()}})()},1e3);L.current=B},[]),fi=d.useCallback(async()=>{const B=await fetch("/api/production");if(!B.ok)throw new Error(`GET /api/production failed: ${B.status}`);const G=await B.json();if(G.defaultOutPath&&N(G.defaultOutPath),M(G.recent??[]),G.noWorkdir){a([]),u([]),z(!0);return}const ne=ev(G.renderProps);x(ne),D(G.workdir??null),I(!!G.canRender);const Ie=Ig(G.overrides,ne);e.load(Ie.doc),tv(Ie.unresolved),a(Ie.unresolved),u([]),fetch("/api/usage").then(async Gn=>k(Gn.ok?await Gn.json():null)).catch(()=>k(null));const wt=await(await fetch("/api/render/status")).json();wt.running&&(F({running:!0,lines:wt.lines??[],startedAt:wt.startedAt}),jr())},[jr]);d.useEffect(()=>{fi().catch(B=>g(B instanceof Error?B.message:String(B)))},[]);const Ds=d.useCallback(async B=>{if(e.dirty&&!window.confirm("Unsaved edits will be lost — switch projects anyway?"))return null;try{const G=await fetch("/api/workdir",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:B})}),ne=await G.json().catch(()=>({}));return G.ok?(b(null),j(null),Y(null),F(null),Ee(1),x(null),z(!1),await fi(),null):ne.error??`open failed: ${G.status}`}catch(G){return G instanceof Error?G.message:String(G)}},[e.dirty,fi]),lo=d.useMemo(()=>{if(!h)return{lines:[],dropped:[]};const B=h.baseCaptionLines??h.captionLines??[];return AF(B,V$(e.doc.captions))},[h,e.doc.captions]),Fr=d.useMemo(()=>g1(s),[s]),hn=d.useMemo(()=>U$(lo.dropped),[lo]),pi=hn.join(`
163
+ `),Su=hn.length>0&&pi!==p;d.useEffect(()=>{if(hn.length!==0)for(const B of hn)console.warn(`ossclip §137: ${B}`)},[pi]);const he=d.useMemo(()=>{if(!h)return null;const B=(h.baseSceneCues??h.sceneCues??[]).filter(xt=>xt.kind!=="plain"),G=h.baseTheme??h.theme??cF,{cues:ne}=Ud(B,e.doc),{cues:Ie}=PF(ne,e.doc),At=WF(Ie,{outputDurationSec:h.outputDurationSec,clipStarts:(h.spans??[]).map(xt=>xt.outIn)}),wt=jp(At,e.doc.splits),{cues:Gn}=Ud(wt,e.doc),{cues:Vs}=Hx(Gn,e.doc);let Xn=_?Vs.map(xt=>xt.id===_.sceneId?{...xt,video:{...xt.video,..._.patch}}:xt):Vs;return X&&(Xn=Xn.map(xt=>xt.id===X.sceneId?{...xt,graphicRect:X.rect}:xt)),{...h,sceneCues:Xn,captionLines:lo.lines,theme:NF(G,e.doc),captionsHidden:h.captionsHiddenByFlag===!0||e.doc.captionsHidden===!0,videoFileName:`/media/${h.videoFileName}`}},[h,e.doc,_,X,lo]),mi=()=>{j5({dirty:e.dirty,renderRunning:(P==null?void 0:P.running)===!0,save:e.save,onBlocked:()=>i(!0),onSaveError:B=>g(B)})},ku=d.useCallback(async B=>{try{e.dirty&&await e.save();const G=await fetch("/api/render",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(B?{out:B}:{})});if(!G.ok){const ne=await G.json().catch(()=>({}));throw new Error(ne.error??`render failed to start: ${G.status}`)}F({running:!0,lines:[],startedAt:Date.now()}),jr()}catch(G){g(G instanceof Error?G.message:String(G))}},[e,jr]),Os=d.useMemo(()=>{if(!h)return[];const B=(h.baseSceneCues??h.sceneCues??[]).filter(G=>G.kind!=="plain");return F5(B,e.doc)},[h,e.doc]),Pn=d.useMemo(()=>w?(he==null?void 0:he.sceneCues.find(B=>B.id===w.sceneId))??Os.find(B=>B.id===w.sceneId)??null:null,[he,w,Os]),Np=d.useMemo(()=>{if(!Pn||!he)return;const B=he.captionLines.filter(ne=>ne.start<Pn.endSec&&ne.end>Pn.startSec).flatMap(ne=>ne.words).filter(ne=>ne.start<Pn.endSec&&ne.end>Pn.startSec).map(ne=>ne.text);if(B.length===0)return;const G=B.join(" ");return G.length>90?`${G.slice(0,90)}…`:G},[Pn,he]);if(y)return c.jsx("div",{style:Ic,children:c.jsxs("div",{style:{padding:24,color:"#FF5C5C",fontFamily:"ui-monospace, monospace"},children:["Couldn't load the production: ",y]})});if(!he)return c.jsx("div",{style:Ic,children:A?c.jsx(Dg,{recent:$,required:!0,onOpen:Ds,onClose:()=>{}}):c.jsx("div",{style:{padding:24,color:"#9A9AA3"},children:"Loading production…"})});const Eu=he.settings.width/he.settings.height,Bs=ae?Math.max(220,Math.min(ae.w,ae.h*Eu)):380,ye=Math.round(Bs*ue);return c.jsxs("div",{style:Ic,children:[c.jsxs("div",{style:L5,children:[c.jsx("span",{style:z5,children:"ossclip"}),W?c.jsx("span",{"data-testid":"workdir-label",style:D5,title:W,children:W.split("/").filter(Boolean).slice(-2).join("/")}):null,c.jsxs("div",{style:{display:"flex",gap:8},children:[c.jsx("button",{"data-testid":"open-button",style:mt,onClick:()=>z(!0),title:W?`Open another project — currently ${W}`:"Open another project",children:"Open"}),c.jsx("button",{"data-testid":"undo-button",style:mt,onClick:()=>e.undo(),disabled:!e.canUndo,title:"Undo (⌘Z)","aria-label":"Undo",children:c.jsx(A5,{})}),c.jsx("button",{"data-testid":"redo-button",style:mt,onClick:()=>e.redo(),disabled:!e.canRedo,title:"Redo (⌘⇧Z)","aria-label":"Redo",children:c.jsx(N5,{})}),c.jsx("button",{"data-testid":"transcript-toggle",style:{...mt,...be?{borderColor:"#5b8cff"}:{}},onClick:()=>Re(B=>!B),title:"Find and retype caption words across the whole transcript",children:"Transcript"}),c.jsxs("div",{style:{position:"relative"},children:[c.jsx("button",{"data-testid":"youtube-menu",style:{...mt,..._n||tn||Yn?{borderColor:"#5b8cff"}:{}},onClick:()=>Pr(B=>!B),title:"AI thumbnail and SEO metadata for the YouTube upload","aria-haspopup":"menu","aria-expanded":_n,children:"YouTube ▾"}),_n?c.jsxs(c.Fragment,{children:[c.jsx("div",{style:V5,onMouseDown:()=>Pr(!1)}),c.jsxs("div",{style:W5,role:"menu",children:[c.jsx("button",{"data-testid":"youtube-menu-thumbnail",style:nv,role:"menuitem",onClick:()=>{Pr(!1),Rn(!0)},children:"Thumbnail"}),c.jsx("button",{"data-testid":"youtube-menu-seo",style:nv,role:"menuitem",onClick:()=>{Pr(!1),Mt(!0)},children:"SEO metadata"})]})]}):null]}),c.jsx("button",{style:{...mt,...e.dirty?B5:{}},onClick:mi,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"}),c.jsxs("div",{style:{display:"inline-flex",alignItems:"center"},children:[c.jsx("button",{"data-testid":"render-button",style:{...mt,borderTopRightRadius:0,borderBottomRightRadius:0,borderRight:"none"},onClick:()=>void ku(),disabled:!R||(P==null?void 0:P.running)===!0,title:R?"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"}),c.jsx("button",{"data-testid":"render-destination-button",style:{...mt,borderTopLeftRadius:0,borderBottomLeftRadius:0,padding:"7px 8px"},onClick:()=>H(!0),disabled:!R||(P==null?void 0:P.running)===!0,title:"Choose export file destination (Browse…)",children:"▾"})]})]}),c.jsx("span",{style:{...O5,color:e.dirty?"#FFE14D":"#5FBF77"},...e.dirty?{"data-testid":"dirty"}:{},children:e.dirty?"● Unsaved changes":"✓ Saved"}),c.jsx("button",{"data-testid":"shortcuts-button",style:{...mt,padding:"7px 10px"},onClick:()=>Tn(B=>!B),title:"Keyboard shortcuts (?)",children:"?"})]}),en?c.jsx(HM,{onClose:()=>Tn(!1)}):null,tn?c.jsx(XA,{onClose:()=>Rn(!1)}):null,Yn?c.jsx(g5,{onClose:()=>Mt(!1)}):null,O?c.jsx($A,{defaultOutPath:K,onCancel:()=>H(!1),onConfirm:B=>{H(!1),ku(B)}}):null,Kn?c.jsx(tA,{plan:Kn,onCancel:()=>ao(null),onConfirm:B=>{B==="graphic"?e.hideScene(Kn.sceneId):e.cutChunk(Kn.startSec,Kn.endSec),ao(null)}}):null,A?c.jsx(Dg,{recent:$,required:!1,onOpen:Ds,onClose:()=>z(!1)}):null,P?c.jsxs("div",{"data-testid":"render-log",style:{...Q5,borderColor:P.failed!==void 0?"#FF5C5C":"#2A2A33"},children:[P.failed!==void 0?c.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})`,c.jsx("button",{style:{...mt,marginLeft:10,padding:"2px 8px"},onClick:()=>F(null),children:"Dismiss"})]}):null,P.running?c.jsxs("div",{"data-testid":"render-status",style:J5,children:[c.jsx("style",{children:"@keyframes ossclip-spin { to { transform: rotate(360deg) } }"}),c.jsx("span",{style:e3,"aria-hidden":!0}),c.jsxs("span",{style:{color:"#EDEDF2"},children:["rendering",P.startedAt!=null?` · ${_5(P.startedAt,Date.now())}`:"",Ia(P.lines)!==null?` · ${Ia(P.lines)}%`:""]}),Ia(P.lines)!==null?c.jsx("div",{style:t3,children:c.jsx("div",{"data-testid":"render-progress-bar",style:{...n3,width:`${Ia(P.lines)}%`}})}):null,c.jsx("button",{"data-testid":"render-cancel",style:{...mt,padding:"2px 8px"},onClick:()=>void fetch("/api/render/cancel",{method:"POST"}),children:"Cancel"}),c.jsx("button",{"data-testid":"render-logs-toggle",style:{...mt,padding:"2px 8px"},onClick:()=>bu(B=>!B),title:di?"Collapse the log":"Expand the log",children:di?"▾ logs":"▸ logs"})]}):null,di?c.jsxs(c.Fragment,{children:[R5(P.lines).map(B=>c.jsx("div",{"data-testid":"render-pinned",style:{color:"#C9C9D4"},children:B},B)),c.jsx(M5,{lines:P.lines})]}):null]}):null,n?c.jsxs("div",{"data-testid":"reanchor-notice",style:Ta,children:["Render re-anchored your saved cuts and splits — edits made while it ran were dropped, not merged, to avoid overwriting that anchor.",c.jsx("button",{style:{...mt,marginLeft:10,padding:"2px 8px"},onClick:()=>r(!1),children:"Dismiss"})]}):null,Fr.length>0||l.length>0?c.jsxs("div",{"data-testid":"caption-migration-notice",style:Ta,children:[[...Fr,...l].map((B,G)=>c.jsx("div",{children:B},G)),c.jsx("button",{style:{...mt,marginLeft:10,padding:"2px 8px"},onClick:()=>{a([]),u([])},children:"Dismiss"})]}):null,Su?c.jsxs("div",{"data-testid":"caption-dropped-notice",style:Ta,children:[hn.map((B,G)=>c.jsx("div",{children:B},G)),c.jsx("button",{style:{...mt,marginLeft:10,padding:"2px 8px"},onClick:()=>m(pi),children:"Dismiss"})]}):null,o?c.jsxs("div",{"data-testid":"save-blocked-notice",style:Ta,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.",c.jsx("button",{style:{...mt,marginLeft:10,padding:"2px 8px"},onClick:()=>i(!1),children:"Dismiss"})]}):null,c.jsxs("div",{style:H5,children:[be?c.jsxs(c.Fragment,{children:[c.jsx(PM,{baseLines:(h==null?void 0:h.baseCaptionLines)??(h==null?void 0:h.captionLines)??[],liveLines:he.captionLines,fps:he.settings.fps,playerRef:U,edits:e,width:ve}),c.jsx("div",{"data-testid":"transcript-divider",style:U5,title:"Drag to resize the transcript pane",onMouseDown:B=>{B.preventDefault(),it.current={startX:B.clientX,startW:ve}}})]}):null,c.jsxs("div",{style:Z5,children:[c.jsx("div",{ref:Q,style:Y5,onMouseDown:B=>{if(B.altKey||B.button===1){B.preventDefault();const G=ie.current;G&&(me.current={x:B.clientX,y:B.clientY,sl:G.scrollLeft,st:G.scrollTop})}},children:c.jsx("div",{style:{margin:"auto",padding:Tc},children:c.jsxs("div",{ref:V,"data-testid":"stage","data-playing":S?"true":"false","data-rate":E,style:{position:"relative",display:"inline-block"},children:[c.jsx(iR,{ref:U,component:A$,inputProps:he,durationInFrames:Math.max(1,Math.round(he.outputDurationSec*he.settings.fps)),fps:he.settings.fps,compositionWidth:he.settings.width,compositionHeight:he.settings.height,style:{width:ye},controls:!0,clickToPlay:!1,playbackRate:E}),c.jsx(J$,{stageRef:V,selection:w,onSelect:b,edits:e,onSave:mi,settings:he.settings,cues:he.sceneCues,playerRef:U,cue:Pn,onTransport:zs,onVideoPreview:j,onGraphicPreview:Y,onToggleHelp:()=>Tn(B=>!B),onRequestDelete:ao}),c.jsx("button",{"data-testid":"rate-chip",onClick:()=>zs("L"),title:"Playback rate — click to speed up (J/K/L on the keyboard)",style:r3,children:E<0?`◂◂ ${Math.abs(E)}×`:`${E}×`})]})})}),c.jsxs("div",{style:K5,children:[c.jsx("button",{"data-testid":"view-zoom-out",style:Rc,onClick:()=>xe(ue/2),disabled:ue<=.25,title:"Zoom the preview out — below 100% shrinks under the fitted size",children:"−"}),c.jsxs("span",{"data-testid":"view-zoom-level",style:G5,children:[Math.round(ue*100),"%"]}),c.jsx("button",{"data-testid":"view-zoom-in",style:Rc,onClick:()=>xe(ue*2),disabled:ue>=8,title:"Zoom the preview in — a viewing magnifier, it never edits the video",children:"+"}),c.jsx("button",{"data-testid":"view-zoom-fit",style:{...Rc,width:"auto",padding:"0 8px"},onClick:()=>xe(1),disabled:Math.abs(ue-1)<.001,title:"Fit the preview to the window",children:"fit"}),c.jsx("span",{style:X5,children:"⌥-drag pans"})]})]}),c.jsx("div",{style:q5,children:c.jsx(tM,{selection:w,cue:Pn,frame:{width:he.settings.width,height:he.settings.height},allSceneIds:he.sceneCues.map(B=>B.id),edits:e,onSelect:b,resolvedTheme:he.theme,anchorText:Np,onVideoPreview:j,runInfo:v,captionsHiddenByFlag:(h==null?void 0:h.captionsHiddenByFlag)===!0})})]}),c.jsx(mM,{cues:he.sceneCues,ghosts:Os,cuts:e.doc.cuts,spans:he.spans??[],durationSec:he.outputDurationSec,fps:he.settings.fps,playerRef:U,selection:w,onSelect:b,edits:e,videoSrc:he.videoFileName,toSourceSec:B=>{var G;for(const ne of he.spans??[])if(B>=ne.outIn&&B<ne.outOut)return ne.srcIn+(B-ne.outIn);return((G=(he.spans??[])[0])==null?void 0:G.srcIn)??B}})]})},M5=({lines:e})=>{const t=d.useRef(null),n=d.useRef(!0);return d.useEffect(()=>{const r=t.current;r&&n.current&&(r.scrollTop=r.scrollHeight)},[e]),c.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)=>c.jsx("div",{children:r},o))})},A5=()=>c.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:[c.jsx("path",{d:"M9 14 4 9l5-5"}),c.jsx("path",{d:"M4 9h10.5a5.5 5.5 0 0 1 0 11H11"})]}),N5=()=>c.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:[c.jsx("path",{d:"m15 14 5-5-5-5"}),c.jsx("path",{d:"M20 9H9.5a5.5 5.5 0 0 0 0 11H13"})]}),Ic={fontFamily:"'Inter', system-ui, sans-serif",background:"#0B0B0E",color:"#EDEDF2",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column"},L5={display:"flex",alignItems:"center",gap:14,padding:"10px 20px",borderBottom:"1px solid #1E1E24",background:"#111116"},z5={fontWeight:800,fontSize:14,letterSpacing:"0.02em",color:"#FFE14D",marginRight:8},D5={fontSize:12,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#6a6a75",maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},O5={fontSize:12,fontFamily:"ui-monospace, 'SF Mono', monospace",marginLeft:"auto"},mt={fontSize:12,fontWeight:600,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:6,padding:"7px 12px",cursor:"pointer"},B5={background:"#FFE14D",color:"#0B0B0E",border:"1px solid #FFE14D"},V5={position:"fixed",inset:0,zIndex:30},W5={position:"absolute",top:"calc(100% + 4px)",left:0,zIndex:31,minWidth:150,background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:6,padding:4,boxShadow:"0 10px 24px rgba(0,0,0,0.5)",display:"flex",flexDirection:"column"},nv={fontSize:12,fontWeight:600,color:"#EDEDF2",background:"transparent",border:"none",borderRadius:4,padding:"8px 10px",cursor:"pointer",textAlign:"left"},H5={display:"flex",flex:1,minHeight:0},Tc=32,rv="ossclip.transcriptWidth",ov=e=>Math.min(640,Math.max(220,e)),U5={width:5,flexShrink:0,cursor:"col-resize",background:"#1E1E24",borderLeft:"1px solid #2A2A33"},Z5={position:"relative",flex:1,minWidth:0},Y5={position:"absolute",inset:0,display:"flex",overflow:"auto"},K5={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},Rc={width:22,height:18,fontSize:12,lineHeight:1,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:4,cursor:"pointer",padding:0},G5={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3",minWidth:34,textAlign:"center"},X5={fontSize:10,color:"#55555f",userSelect:"none"},q5={width:260,flexShrink:0,borderLeft:"1px solid #1E1E24",background:"#111116",overflowY:"auto"},Q5={fontSize:11,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3",background:"#0F0F14",borderBottom:"1px solid #2A2A33",padding:"6px 20px",whiteSpace:"pre-wrap",flexShrink:0},Ta={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},J5={display:"flex",alignItems:"center",gap:10,marginBottom:4},e3={width:12,height:12,flexShrink:0,border:"2px solid #2A2A33",borderTopColor:"#FFE14D",borderRadius:"50%",animation:"ossclip-spin 0.8s linear infinite"},t3={flex:1,maxWidth:260,height:4,background:"#1E1E24",borderRadius:2,overflow:"hidden"},n3={height:"100%",background:"#FFE14D",borderRadius:2,transition:"width 0.6s ease"},r3={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"};_c.createRoot(document.getElementById("root")).render(c.jsx(te.StrictMode,{children:c.jsx($5,{})}));