@cyca/react-timeline-editor 0.2.4-alpha.0 → 0.2.4-alpha.2

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.
@@ -1,13 +1,13 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),C=require("./index-HslTC57T.cjs"),fr=require("react-dom");function dr(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const g=dr(k);var Nt={exports:{}},At={};var ln;function hr(){if(ln)return At;ln=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var c in s)c!=="key"&&(o[c]=s[c])}else o=s;return s=o.ref,{$$typeof:n,type:r,key:i,ref:s!==void 0?s:null,props:o}}return At.Fragment=e,At.jsx=t,At.jsxs=t,At}var Ct={};var un;function mr(){return un||(un=1,process.env.NODE_ENV!=="production"&&(function(){function n(f){if(f==null)return null;if(typeof f=="function")return f.$$typeof===F?null:f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case p:return"Fragment";case b:return"Profiler";case R:return"StrictMode";case D:return"Suspense";case L:return"SuspenseList";case j:return"Activity"}if(typeof f=="object")switch(typeof f.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case v:return"Portal";case S:return f.displayName||"Context";case _:return(f._context.displayName||"Context")+".Consumer";case P:var y=f.render;return f=f.displayName,f||(f=y.displayName||y.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case H:return y=f.displayName||null,y!==null?y:n(f.type)||"Memo";case M:y=f._payload,f=f._init;try{return n(f(y))}catch{}}return null}function e(f){return""+f}function t(f){try{e(f);var y=!1}catch{y=!0}if(y){y=console;var I=y.error,Y=typeof Symbol=="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return I.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Y),e(f)}}function r(f){if(f===p)return"<>";if(typeof f=="object"&&f!==null&&f.$$typeof===M)return"<...>";try{var y=n(f);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function s(){var f=G.A;return f===null?null:f.getOwner()}function o(){return Error("react-stack-top-frame")}function i(f){if(x.call(f,"key")){var y=Object.getOwnPropertyDescriptor(f,"key").get;if(y&&y.isReactWarning)return!1}return f.key!==void 0}function c(f,y){function I(){E||(E=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}I.isReactWarning=!0,Object.defineProperty(f,"key",{get:I,configurable:!0})}function a(){var f=n(this.type);return A[f]||(A[f]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),f=this.props.ref,f!==void 0?f:null}function u(f,y,I,Y,te,q){var X=I.ref;return f={$$typeof:w,type:f,key:y,props:I,_owner:Y},(X!==void 0?X:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:a}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function l(f,y,I,Y,te,q){var X=y.children;if(X!==void 0)if(Y)if(U(X)){for(Y=0;Y<X.length;Y++)h(X[Y]);Object.freeze&&Object.freeze(X)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(X);if(x.call(y,"key")){X=n(f);var O=Object.keys(y).filter(function(B){return B!=="key"});Y=0<O.length?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}",ne[X+Y]||(O=0<O.length?"{"+O.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react"),A=require("./index-HslTC57T.cjs"),fr=require("react-dom");function dr(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const b=dr(L);var Nt={exports:{}},At={};var ln;function hr(){if(ln)return At;ln=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var c in s)c!=="key"&&(o[c]=s[c])}else o=s;return s=o.ref,{$$typeof:n,type:r,key:i,ref:s!==void 0?s:null,props:o}}return At.Fragment=e,At.jsx=t,At.jsxs=t,At}var Ct={};var un;function mr(){return un||(un=1,process.env.NODE_ENV!=="production"&&(function(){function n(d){if(d==null)return null;if(typeof d=="function")return d.$$typeof===H?null:d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case y:return"Fragment";case h:return"Profiler";case _:return"StrictMode";case E:return"Suspense";case C:return"SuspenseList";case j:return"Activity"}if(typeof d=="object")switch(typeof d.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),d.$$typeof){case S:return"Portal";case v:return d.displayName||"Context";case p:return(d._context.displayName||"Context")+".Consumer";case R:var x=d.render;return d=d.displayName,d||(d=x.displayName||x.name||"",d=d!==""?"ForwardRef("+d+")":"ForwardRef"),d;case z:return x=d.displayName||null,x!==null?x:n(d.type)||"Memo";case D:x=d._payload,d=d._init;try{return n(d(x))}catch{}}return null}function e(d){return""+d}function t(d){try{e(d);var x=!1}catch{x=!0}if(x){x=console;var M=x.error,$=typeof Symbol=="function"&&Symbol.toStringTag&&d[Symbol.toStringTag]||d.constructor.name||"Object";return M.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",$),e(d)}}function r(d){if(d===y)return"<>";if(typeof d=="object"&&d!==null&&d.$$typeof===D)return"<...>";try{var x=n(d);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function s(){var d=te.A;return d===null?null:d.getOwner()}function o(){return Error("react-stack-top-frame")}function i(d){if(B.call(d,"key")){var x=Object.getOwnPropertyDescriptor(d,"key").get;if(x&&x.isReactWarning)return!1}return d.key!==void 0}function c(d,x){function M(){P||(P=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",x))}M.isReactWarning=!0,Object.defineProperty(d,"key",{get:M,configurable:!0})}function a(){var d=n(this.type);return I[d]||(I[d]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),d=this.props.ref,d!==void 0?d:null}function u(d,x,M,$,fe,k){var U=M.ref;return d={$$typeof:w,type:d,key:x,props:M,_owner:$},(U!==void 0?U:null)!==null?Object.defineProperty(d,"ref",{enumerable:!1,get:a}):Object.defineProperty(d,"ref",{enumerable:!1,value:null}),d._store={},Object.defineProperty(d._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(d,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(d,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:fe}),Object.defineProperty(d,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:k}),Object.freeze&&(Object.freeze(d.props),Object.freeze(d)),d}function l(d,x,M,$,fe,k){var U=x.children;if(U!==void 0)if($)if(re(U)){for($=0;$<U.length;$++)m(U[$]);Object.freeze&&Object.freeze(U)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(U);if(B.call(x,"key")){U=n(d);var N=Object.keys(x).filter(function(O){return O!=="key"});$=0<N.length?"{key: someKey, "+N.join(": ..., ")+": ...}":"{key: someKey}",Q[U+$]||(N=0<N.length?"{"+N.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,Y,X,O,X),ne[X+Y]=!0)}if(X=null,I!==void 0&&(t(I),X=""+I),i(y)&&(t(y.key),X=""+y.key),"key"in y){I={};for(var z in y)z!=="key"&&(I[z]=y[z])}else I=y;return X&&c(I,typeof f=="function"?f.displayName||f.name||"Unknown":f),u(f,X,I,s(),te,q)}function h(f){d(f)?f._store&&(f._store.validated=1):typeof f=="object"&&f!==null&&f.$$typeof===M&&(f._payload.status==="fulfilled"?d(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function d(f){return typeof f=="object"&&f!==null&&f.$$typeof===w}var m=k,w=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),S=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),F=Symbol.for("react.client.reference"),G=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,x=Object.prototype.hasOwnProperty,U=Array.isArray,W=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(f){return f()}};var E,A={},N=m.react_stack_bottom_frame.bind(m,o)(),ee=W(r(o)),ne={};Ct.Fragment=p,Ct.jsx=function(f,y,I){var Y=1e4>G.recentlyCreatedOwnerStacks++;return l(f,y,I,!1,Y?Error("react-stack-top-frame"):N,Y?W(r(f)):ee)},Ct.jsxs=function(f,y,I){var Y=1e4>G.recentlyCreatedOwnerStacks++;return l(f,y,I,!0,Y?Error("react-stack-top-frame"):N,Y?W(r(f)):ee)}})()),Ct}var fn;function pr(){return fn||(fn=1,process.env.NODE_ENV==="production"?Nt.exports=hr():Nt.exports=mr()),Nt.exports}var T=pr();const qt={trace:0,debug:1,info:2,warn:3,error:4,silent:5},gr=["trace","debug","info","warn","error"];var vr=class Wn{s;ls=new Map;lvl;def;n;r;c=console;e;trace;debug;info;warn;error;constructor(e,t,r,s){this.s=e,this.e=t,this.n=r,this.r=s,this.bindMethods()}noop=()=>{};bindMethods(){gr.forEach(e=>{const t=this.e.bind(this.c,e,this.n);Object.defineProperty(this,e,{get:()=>qt[e]>=qt[this.currentLevel()]?t:this.noop,configurable:!0})})}storageKey(){return this.n?`loglevel:${String(this.n)}`:"loglevel"}currentLevel(){if(this.lvl)return this.lvl;const e=this.s.get(this.storageKey());return e&&e in qt?(this.lvl=e,this.lvl):this.def?this.def:this.r?this.r.currentLevel():"trace"}setLevel(e){return this.lvl=e,this.s.set(this.storageKey(),e),this}setDefaultLevel(e){return this.s.get(this.storageKey())||(this.def=e),this}resetLevel(){return this.lvl=void 0,this.s.del(this.storageKey()),this}getLogger(e){if(!e)throw new Error("Logger name required");if(!this.ls.has(e)){const t=new Wn(this.s,this.e,e,this.r||this);this.ls.set(e,zn(t))}return this.ls.get(e)}getLoggers(){const e={};return this.ls.forEach((t,r)=>{e[String(r)]=t}),e}use(e){this.c=e,this.bindMethods()}};function zn(n){return new Proxy(n,{get(e,t,r){if(t in e)return Reflect.get(e,t,r);const s=e.c[t];return typeof s=="function"?s.bind(e.c):s}})}var br=class{get(n){return localStorage.getItem(n)}set(n,e){localStorage.setItem(n,e)}del(n){localStorage.removeItem(n)}};const _r={trace:"#95bdb7",debug:"#ad95b8",info:"#b6bd73",warn:"#88a1bb",error:"#bf6c69"},dn={info:"⚡️",success:"✔",warn:"▲",error:"✖",log:"●",trace:"◔",debug:"◌"},Sr={bind(n,e,t){const r=t?`${dn[e]} ${String(t)}:`:`${dn[e]}`;return(n[e]||n.log).bind(n,`%c${r}%c`,`color: ${_r[e]}; font-weight: bold;`,"color: inherit")}},qe=zn(new vr(new br,Sr));function wr(n){let{editorData:e=[],effects:t={},scale:r=C.DEFAULT_SCALE,scaleSplitCount:s=C.DEFAULT_SCALE_SPLIT_COUNT,scaleWidth:o=C.DEFAULT_SCALE_WIDTH,startLeft:i=C.DEFAULT_START_LEFT,minScaleCount:c,maxScaleCount:a=1/0,rowHeight:u=C.DEFAULT_ROW_HEIGHT}=n;r<=0&&(qe.error("Error: scale must be greater than 0!"),r=C.DEFAULT_SCALE),s<=0&&(qe.warn("Warning: scaleSplitCount cannot be less than 1!"),s=1),o<=0&&(qe.warn("Warning: scaleWidth must be greater than 0!"),o=C.DEFAULT_SCALE_WIDTH),i<0&&(qe.warn("Warning: startLeft cannot be less than 0!"),i=0),c&&typeof c=="number"&&(c<1&&(qe.warn("Warning: minScaleCount must be greater than 1!"),c=C.MIN_SCALE_COUNT),c=parseInt(c+""),a<c&&(qe.warn("Warning: maxScaleCount cannot be less than minScaleCount!"),a=c)),a=a===1/0?1/0:parseInt(a+""),u<=0&&(qe.warn("Warning: rowHeight must be greater than 0!"),u=C.DEFAULT_ROW_HEIGHT);const l={...n};return delete l.style,{...l,editorData:e,effects:t,scale:r,scaleSplitCount:s,scaleWidth:o,startLeft:i,minScaleCount:c,maxScaleCount:a,rowHeight:u}}var It={exports:{}},Kt={};var hn;function Er(){if(hn)return Kt;hn=1;var n=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Kt.c=function(e){return n.H.useMemoCache(e)},Kt}var Jt={};var mn;function yr(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){var n=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;Jt.c=function(e){var t=n.H;return t===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
6
+ <%s key={someKey} {...props} />`,$,U,N,U),Q[U+$]=!0)}if(U=null,M!==void 0&&(t(M),U=""+M),i(x)&&(t(x.key),U=""+x.key),"key"in x){M={};for(var W in x)W!=="key"&&(M[W]=x[W])}else M=x;return U&&c(M,typeof d=="function"?d.displayName||d.name||"Unknown":d),u(d,U,M,s(),fe,k)}function m(d){f(d)?d._store&&(d._store.validated=1):typeof d=="object"&&d!==null&&d.$$typeof===D&&(d._payload.status==="fulfilled"?f(d._payload.value)&&d._payload.value._store&&(d._payload.value._store.validated=1):d._store&&(d._store.validated=1))}function f(d){return typeof d=="object"&&d!==null&&d.$$typeof===w}var g=L,w=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),v=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),H=Symbol.for("react.client.reference"),te=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=Object.prototype.hasOwnProperty,re=Array.isArray,q=console.createTask?console.createTask:function(){return null};g={react_stack_bottom_frame:function(d){return d()}};var P,I={},J=g.react_stack_bottom_frame.bind(g,o)(),Z=q(r(o)),Q={};Ct.Fragment=y,Ct.jsx=function(d,x,M){var $=1e4>te.recentlyCreatedOwnerStacks++;return l(d,x,M,!1,$?Error("react-stack-top-frame"):J,$?q(r(d)):Z)},Ct.jsxs=function(d,x,M){var $=1e4>te.recentlyCreatedOwnerStacks++;return l(d,x,M,!0,$?Error("react-stack-top-frame"):J,$?q(r(d)):Z)}})()),Ct}var fn;function pr(){return fn||(fn=1,process.env.NODE_ENV==="production"?Nt.exports=hr():Nt.exports=mr()),Nt.exports}var T=pr();const qt={trace:0,debug:1,info:2,warn:3,error:4,silent:5},gr=["trace","debug","info","warn","error"];var vr=class Wn{s;ls=new Map;lvl;def;n;r;c=console;e;trace;debug;info;warn;error;constructor(e,t,r,s){this.s=e,this.e=t,this.n=r,this.r=s,this.bindMethods()}noop=()=>{};bindMethods(){gr.forEach(e=>{const t=this.e.bind(this.c,e,this.n);Object.defineProperty(this,e,{get:()=>qt[e]>=qt[this.currentLevel()]?t:this.noop,configurable:!0})})}storageKey(){return this.n?`loglevel:${String(this.n)}`:"loglevel"}currentLevel(){if(this.lvl)return this.lvl;const e=this.s.get(this.storageKey());return e&&e in qt?(this.lvl=e,this.lvl):this.def?this.def:this.r?this.r.currentLevel():"trace"}setLevel(e){return this.lvl=e,this.s.set(this.storageKey(),e),this}setDefaultLevel(e){return this.s.get(this.storageKey())||(this.def=e),this}resetLevel(){return this.lvl=void 0,this.s.del(this.storageKey()),this}getLogger(e){if(!e)throw new Error("Logger name required");if(!this.ls.has(e)){const t=new Wn(this.s,this.e,e,this.r||this);this.ls.set(e,zn(t))}return this.ls.get(e)}getLoggers(){const e={};return this.ls.forEach((t,r)=>{e[String(r)]=t}),e}use(e){this.c=e,this.bindMethods()}};function zn(n){return new Proxy(n,{get(e,t,r){if(t in e)return Reflect.get(e,t,r);const s=e.c[t];return typeof s=="function"?s.bind(e.c):s}})}var br=class{get(n){return localStorage.getItem(n)}set(n,e){localStorage.setItem(n,e)}del(n){localStorage.removeItem(n)}};const Sr={trace:"#95bdb7",debug:"#ad95b8",info:"#b6bd73",warn:"#88a1bb",error:"#bf6c69"},dn={info:"⚡️",success:"✔",warn:"▲",error:"✖",log:"●",trace:"◔",debug:"◌"},_r={bind(n,e,t){const r=t?`${dn[e]} ${String(t)}:`:`${dn[e]}`;return(n[e]||n.log).bind(n,`%c${r}%c`,`color: ${Sr[e]}; font-weight: bold;`,"color: inherit")}},Qe=zn(new vr(new br,_r));function wr(n){let{editorData:e=[],effects:t={},scale:r=A.DEFAULT_SCALE,scaleSplitCount:s=A.DEFAULT_SCALE_SPLIT_COUNT,scaleWidth:o=A.DEFAULT_SCALE_WIDTH,startLeft:i=A.DEFAULT_START_LEFT,minScaleCount:c,maxScaleCount:a=1/0,rowHeight:u=A.DEFAULT_ROW_HEIGHT}=n;r<=0&&(Qe.error("Error: scale must be greater than 0!"),r=A.DEFAULT_SCALE),s<=0&&(Qe.warn("Warning: scaleSplitCount cannot be less than 1!"),s=1),o<=0&&(Qe.warn("Warning: scaleWidth must be greater than 0!"),o=A.DEFAULT_SCALE_WIDTH),i<0&&(Qe.warn("Warning: startLeft cannot be less than 0!"),i=0),c&&typeof c=="number"&&(c<1&&(Qe.warn("Warning: minScaleCount must be greater than 1!"),c=A.MIN_SCALE_COUNT),c=parseInt(c+""),a<c&&(Qe.warn("Warning: maxScaleCount cannot be less than minScaleCount!"),a=c)),a=a===1/0?1/0:parseInt(a+""),u<=0&&(Qe.warn("Warning: rowHeight must be greater than 0!"),u=A.DEFAULT_ROW_HEIGHT);const l={...n};return delete l.style,{...l,editorData:e,effects:t,scale:r,scaleSplitCount:s,scaleWidth:o,startLeft:i,minScaleCount:c,maxScaleCount:a,rowHeight:u}}function Er(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.map(function(r){return r.split(" ").map(function(s){return s?""+n+s:""}).join(" ")}).join(" ")}function ge(...n){return Er(`${A.PREFIX}-`,...n)}var It={exports:{}},Kt={};var hn;function yr(){if(hn)return Kt;hn=1;var n=L.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Kt.c=function(e){return n.H.useMemoCache(e)},Kt}var Jt={};var mn;function Tr(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){var n=L.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;Jt.c=function(e){var t=n.H;return t===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
7
7
  1. You might have mismatching versions of React and the renderer (such as React DOM)
8
8
  2. You might be breaking the Rules of Hooks
9
9
  3. You might have more than one copy of React in the same app
10
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),t.useMemoCache(e)}})()),Jt}var pn;function Tr(){return pn||(pn=1,process.env.NODE_ENV==="production"?It.exports=Er():It.exports=yr()),It.exports}var Pe=Tr();function Rr(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.map(function(r){return r.split(" ").map(function(s){return s?""+n+s:""}).join(" ")}).join(" ")}function de(...n){return Rr(`${C.PREFIX}-`,...n)}const xr=n=>{const e=Pe.c(11),{isMoving:t,movePositions:r,assistPositions:s}=n;let o,i;if(e[0]!==t||e[1]!==r||e[2]!==s){const a=r===void 0?[]:r;let u;e[5]!==s?(u=s===void 0?[]:s,e[5]=s,e[6]=u):u=e[6];const l=u;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=de("snap-line-container"),e[7]=o):o=e[7],i=t&&a.filter(h=>l.includes(h)).map(Ar),e[0]=t,e[1]=r,e[2]=s,e[3]=o,e[4]=i}else o=e[3],i=e[4];let c;return e[8]!==o||e[9]!==i?(c=T.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=c):c=e[10],c};function Ar(n,e){return T.jsx("div",{className:de("snap-line"),style:{left:n}},e)}const kt=1,gn=10,vn=10;function Cr(n){const e=Pe.c(7),t=k.useRef(Number.MIN_SAFE_INTEGER),r=k.useRef(Number.MAX_SAFE_INTEGER),s=k.useRef(kt),o=k.useRef(void 0);let i;e[0]!==n?(i=()=>{if(n?.current){const{left:v,width:p}=n.current.getBoundingClientRect();t.current=v,r.current=v+p}},e[0]=n,e[1]=i):i=e[1];const c=i;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(v,p)=>{if(v.clientX>=r.current||v.clientX<=t.current){o.current!==void 0&&cancelAnimationFrame(o.current);const R=Math.abs(v.clientX>=r.current?v.clientX-r.current:v.clientX-t.current);s.current=Math.min(Number((R/vn).toFixed(0))*kt,gn);const _=(v.clientX>=r.current?1:-1)*s.current,S=()=>{p&&p(_),o.current=requestAnimationFrame(S)};return o.current=requestAnimationFrame(S),!1}else o.current!==void 0&&cancelAnimationFrame(o.current);return!0},e[2]=a):a=e[2];const u=a;let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=(v,p,R)=>{if(v.clientX>=r.current||v.clientX<t.current){o.current!==void 0&&cancelAnimationFrame(o.current);const b=Math.abs(v.clientX>=r.current?v.clientX-r.current:v.clientX-t.current);s.current=Math.min(Number((b/vn).toFixed(0))*kt,gn);const S=(v.clientX>=r.current?1:-1)*s.current,P=()=>{R&&R(S),o.current=requestAnimationFrame(P)};return o.current=requestAnimationFrame(P),!1}else o.current!==void 0&&cancelAnimationFrame(o.current);return!0},e[3]=l):l=e[3];const h=l;let d;e[4]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{t.current=Number.MIN_SAFE_INTEGER,r.current=Number.MAX_SAFE_INTEGER,s.current=kt,o.current!==void 0&&cancelAnimationFrame(o.current)},e[4]=d):d=e[4];const m=d;let w;return e[5]!==c?(w={initAutoScroll:c,dealDragAutoScroll:u,dealResizeAutoScroll:h,stopAutoScroll:m},e[5]=c,e[6]=w):w=e[6],w}function Dr(n,e,t){return Math.max(e,Math.min(n,t))}const he={toVector(n,e){return n===void 0&&(n=e),Array.isArray(n)?n:[n,n]},add(n,e){return[n[0]+e[0],n[1]+e[1]]},sub(n,e){return[n[0]-e[0],n[1]-e[1]]},addTo(n,e){n[0]+=e[0],n[1]+=e[1]},subTo(n,e){n[0]-=e[0],n[1]-=e[1]}};function bn(n,e,t){return e===0||Math.abs(e)===1/0?Math.pow(n,t*5):n*e*t/(e+t*n)}function _n(n,e,t,r=.15){return r===0?Dr(n,e,t):n<e?-bn(e-n,t-e,r)+e:n>t?+bn(n-t,t-e,r)+t:n}function Pr(n,[e,t],[r,s]){const[[o,i],[c,a]]=n;return[_n(e,o,i,r),_n(t,c,a,s)]}function Lr(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Or(n){var e=Lr(n,"string");return typeof e=="symbol"?e:String(e)}function Se(n,e,t){return e=Or(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Sn(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function re(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Sn(Object(t),!0).forEach(function(r){Se(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Sn(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const jn={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function wn(n){return n?n[0].toUpperCase()+n.slice(1):""}const Mr=["enter","leave"];function Nr(n=!1,e){return n&&!Mr.includes(e)}function Ir(n,e="",t=!1){const r=jn[n],s=r&&r[e]||e;return"on"+wn(n)+wn(s)+(Nr(t,s)?"Capture":"")}const kr=["gotpointercapture","lostpointercapture"];function Wr(n){let e=n.substring(2).toLowerCase();const t=!!~e.indexOf("passive");t&&(e=e.replace("passive",""));const r=kr.includes(e)?"capturecapture":"capture",s=!!~e.indexOf(r);return s&&(e=e.replace("capture","")),{device:e,capture:s,passive:t}}function zr(n,e=""){const t=jn[n],r=t&&t[e]||e;return n+r}function Bt(n){return"touches"in n}function Fn(n){return Bt(n)?"touch":"pointerType"in n?n.pointerType:"mouse"}function jr(n){return Array.from(n.touches).filter(e=>{var t,r;return e.target===n.currentTarget||((t=n.currentTarget)===null||t===void 0||(r=t.contains)===null||r===void 0?void 0:r.call(t,e.target))})}function Fr(n){return n.type==="touchend"||n.type==="touchcancel"?n.changedTouches:n.targetTouches}function Un(n){return Bt(n)?Fr(n)[0]:n}function Ur(n){return jr(n).map(e=>e.identifier)}function Zt(n){const e=Un(n);return Bt(n)?e.identifier:e.pointerId}function En(n){const e=Un(n);return[e.clientX,e.clientY]}function Vr(n){const e={};if("buttons"in n&&(e.buttons=n.buttons),"shiftKey"in n){const{shiftKey:t,altKey:r,metaKey:s,ctrlKey:o}=n;Object.assign(e,{shiftKey:t,altKey:r,metaKey:s,ctrlKey:o})}return e}function Vt(n,...e){return typeof n=="function"?n(...e):n}function $r(){}function Hr(...n){return n.length===0?$r:n.length===1?n[0]:function(){let e;for(const t of n)e=t.apply(this,arguments)||e;return e}}function yn(n,e){return Object.assign({},e,n||{})}const Br=32;class Yr{constructor(e,t,r){this.ctrl=e,this.args=t,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:r,args:s}=this;t[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=s,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,r=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=r.from?Vt(r.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:r,shared:s}=this;t.args=this.args;let o=0;if(e&&(t.event=e,r.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,s.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,s.locked=!!document.pointerLockElement,Object.assign(s,Vr(e)),s.down=s.pressed=s.buttons%2===1||s.touches>0,o=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const D=t._delta.map(Math.abs);he.addTo(t._distance,D)}this.axisIntent&&this.axisIntent(e);const[i,c]=t._movement,[a,u]=r.threshold,{_step:l,values:h}=t;if(r.hasCustomTransform?(l[0]===!1&&(l[0]=Math.abs(i)>=a&&h[0]),l[1]===!1&&(l[1]=Math.abs(c)>=u&&h[1])):(l[0]===!1&&(l[0]=Math.abs(i)>=a&&Math.sign(i)*a),l[1]===!1&&(l[1]=Math.abs(c)>=u&&Math.sign(c)*u)),t.intentional=l[0]!==!1||l[1]!==!1,!t.intentional)return;const d=[0,0];if(r.hasCustomTransform){const[D,L]=h;d[0]=l[0]!==!1?D-l[0]:0,d[1]=l[1]!==!1?L-l[1]:0}else d[0]=l[0]!==!1?i-l[0]:0,d[1]=l[1]!==!1?c-l[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const m=t.offset,w=t._active&&!t._blocked||t.active;w&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=s[this.ingKey]=t._active,e&&(t.first&&("bounds"in r&&(t._bounds=Vt(r.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[v,p]=t.offset,[[R,b],[_,S]]=t._bounds;t.overflow=[v<R?-1:v>b?1:0,p<_?-1:p>S?1:0],t._movementBound[0]=t.overflow[0]?t._movementBound[0]===!1?t._movement[0]:t._movementBound[0]:!1,t._movementBound[1]=t.overflow[1]?t._movementBound[1]===!1?t._movement[1]:t._movementBound[1]:!1;const P=t._active?r.rubberband||[0,0]:[0,0];if(t.offset=Pr(t._bounds,t.offset,P),t.delta=he.sub(t.offset,m),this.computeMovement(),w&&(!t.last||o>Br)){t.delta=he.sub(t.offset,m);const D=t.delta.map(Math.abs);he.addTo(t.distance,D),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&o>0&&(t.velocity=[D[0]/o,D[1]/o],t.timeDelta=o)}}emit(){const e=this.state,t=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const s=this.handler(re(re(re({},t),e),{},{[this.aliasKey]:e.values}));s!==void 0&&(e.memo=s)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function Xr([n,e],t){const r=Math.abs(n),s=Math.abs(e);if(r>s&&r>t)return"x";if(s>r&&s>t)return"y"}class Gr extends Yr{constructor(...e){super(...e),Se(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=he.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=he.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,r=this.config;if(!t.axis&&e){const s=typeof r.axisThreshold=="object"?r.axisThreshold[Fn(e)]:r.axisThreshold;t.axis=Xr(t._movement,s)}t._blocked=(r.lockDirection||!!r.axis)&&!t.axis||!!r.axis&&r.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const Tn=n=>n,Rn=.15,sn={enabled(n=!0){return n},eventOptions(n,e,t){return re(re({},t.shared.eventOptions),n)},preventDefault(n=!1){return n},triggerAllEvents(n=!1){return n},rubberband(n=0){switch(n){case!0:return[Rn,Rn];case!1:return[0,0];default:return he.toVector(n)}},from(n){if(typeof n=="function")return n;if(n!=null)return he.toVector(n)},transform(n,e,t){const r=n||t.shared.transform;if(this.hasCustomTransform=!!r,process.env.NODE_ENV==="development"){const s=r||Tn;return o=>{const i=s(o);return(!isFinite(i[0])||!isFinite(i[1]))&&console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${i[0]},${[1]}]`),i}}return r||Tn},threshold(n){return he.toVector(n,0)}};process.env.NODE_ENV==="development"&&Object.assign(sn,{domTarget(n){if(n!==void 0)throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");return NaN},lockDirection(n){if(n!==void 0)throw Error("[@use-gesture]: `lockDirection` option has been merged with `axis`. Use it as in `{ axis: 'lock' }`");return NaN},initial(n){if(n!==void 0)throw Error("[@use-gesture]: `initial` option has been renamed to `from`.");return NaN}});const qr=0,Dt=re(re({},sn),{},{axis(n,e,{axis:t}){if(this.lockDirection=t==="lock",!this.lockDirection)return t},axisThreshold(n=qr){return n},bounds(n={}){if(typeof n=="function")return o=>Dt.bounds(n(o));if("current"in n)return()=>n.current;if(typeof HTMLElement=="function"&&n instanceof HTMLElement)return n;const{left:e=-1/0,right:t=1/0,top:r=-1/0,bottom:s=1/0}=n;return[[e,t],[r,s]]}}),xn={ArrowRight:(n,e=1)=>[n*e,0],ArrowLeft:(n,e=1)=>[-1*n*e,0],ArrowUp:(n,e=1)=>[0,-1*n*e],ArrowDown:(n,e=1)=>[0,n*e]};class Kr extends Gr{constructor(...e){super(...e),Se(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),s={left:t.left-r.left+e.offset[0],right:t.right-r.right+e.offset[0],top:t.top-r.top+e.offset[1],bottom:t.bottom-r.bottom+e.offset[1]};e._bounds=Dt.bounds(s)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,r=this.state;if(e.buttons!=null&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):t.pointerButtons!==-1&&t.pointerButtons!==e.buttons))return;const s=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(s&&s.size>1&&r._pointerActive)&&(this.start(e),this.setupPointer(e),r._pointerId=Zt(e),r._pointerActive=!0,this.computeValues(En(e)),this.computeInitial(),t.preventScrollAxis&&Fn(e)!=="mouse"?(r._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,r=this.config;if(!t._pointerActive)return;const s=Zt(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;const o=En(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=he.sub(o,t._values),this.computeValues(o)),he.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(r.preventScrollAxis&&!t._preventScroll)if(t.axis)if(t.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{process.env.NODE_ENV==="development"&&console.warn("[@use-gesture]: If you see this message, it's likely that you're using an outdated version of `@react-three/fiber`. \n\nPlease upgrade to the latest version.")}const t=this.state,r=this.config;if(!t._active||!t._pointerActive)return;const s=Zt(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[o,i]=t._distance;if(t.tap=o<=r.tapsThreshold&&i<=r.tapsThreshold,t.tap&&r.filterTaps)t._force=!0;else{const[c,a]=t._delta,[u,l]=t._movement,[h,d]=r.swipe.velocity,[m,w]=r.swipe.distance,v=r.swipe.duration;if(t.elapsedTime<v){const p=Math.abs(c/t.timeDelta),R=Math.abs(a/t.timeDelta);p>h&&Math.abs(u)>m&&(t.swipe[0]=Math.sign(c)),R>d&&Math.abs(l)>w&&(t.swipe[1]=Math.sign(a))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,r=t.device;if(process.env.NODE_ENV==="development")try{if(r==="pointer"&&t.preventScrollDelay===void 0){const s="uv"in e?e.sourceEvent.currentTarget:e.currentTarget;window.getComputedStyle(s).touchAction==="auto"&&console.warn("[@use-gesture]: The drag target has its `touch-action` style property set to `auto`. It is recommended to add `touch-action: 'none'` so that the drag gesture behaves correctly on touch-enabled devices. For more information read this: https://use-gesture.netlify.app/docs/extras/#touch-action.\n\nThis message will only show in development mode. It won't appear in production. If this is intended, you can ignore it.",s)}}catch{}t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,Jr(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=xn[e.key];if(t){const r=this.state,s=e.shiftKey?10:e.altKey?.1:1;this.start(e),r._delta=t(this.config.keyboardDisplacement,s),r._keyboardActive=!0,he.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in xn&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function Jr(n){"persist"in n&&typeof n.persist=="function"&&n.persist()}const Pt=typeof window<"u"&&window.document&&window.document.createElement;function Vn(){return Pt&&"ontouchstart"in window}function Zr(){return Vn()||Pt&&window.navigator.maxTouchPoints>1}function Qr(){return Pt&&"onpointerdown"in window}function es(){return Pt&&"exitPointerLock"in window.document}function ts(){try{return"constructor"in GestureEvent}catch{return!1}}const Ee={isBrowser:Pt,gesture:ts(),touch:Vn(),touchscreen:Zr(),pointer:Qr(),pointerLock:es()},ns=250,rs=180,ss=.5,os=50,is=250,cs=10,An={mouse:0,touch:0,pen:8},$n=re(re({},Dt),{},{device(n,e,{pointer:{touch:t=!1,lock:r=!1,mouse:s=!1}={}}){return this.pointerLock=r&&Ee.pointerLock,Ee.touch&&t?"touch":this.pointerLock?"mouse":Ee.pointer&&!s?"pointer":Ee.touch?"touch":"mouse"},preventScrollAxis(n,e,{preventScroll:t}){if(this.preventScrollDelay=typeof t=="number"?t:t||t===void 0&&n?ns:void 0,!(!Ee.touchscreen||t===!1))return n||(t!==void 0?"y":void 0)},pointerCapture(n,e,{pointer:{capture:t=!0,buttons:r=1,keys:s=!0}={}}){return this.pointerButtons=r,this.keys=s,!this.pointerLock&&this.device==="pointer"&&t},threshold(n,e,{filterTaps:t=!1,tapsThreshold:r=3,axis:s=void 0}){const o=he.toVector(n,t?r:s?1:0);return this.filterTaps=t,this.tapsThreshold=r,o},swipe({velocity:n=ss,distance:e=os,duration:t=is}={}){return{velocity:this.transform(he.toVector(n)),distance:this.transform(he.toVector(e)),duration:t}},delay(n=0){switch(n){case!0:return rs;case!1:return 0;default:return n}},axisThreshold(n){return n?re(re({},An),n):An},keyboardDisplacement(n=cs){return n}});process.env.NODE_ENV==="development"&&Object.assign($n,{useTouch(n){if(n!==void 0)throw Error("[@use-gesture]: `useTouch` option has been renamed to `pointer.touch`. Use it as in `{ pointer: { touch: true } }`.");return NaN},experimental_preventWindowScrollY(n){if(n!==void 0)throw Error("[@use-gesture]: `experimental_preventWindowScrollY` option has been renamed to `preventScroll`.");return NaN},swipeVelocity(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeVelocity` option has been renamed to `swipe.velocity`. Use it as in `{ swipe: { velocity: 0.5 } }`.");return NaN},swipeDistance(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeDistance` option has been renamed to `swipe.distance`. Use it as in `{ swipe: { distance: 50 } }`.");return NaN},swipeDuration(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeDuration` option has been renamed to `swipe.duration`. Use it as in `{ swipe: { duration: 250 } }`.");return NaN}});re(re({},sn),{},{device(n,e,{shared:t,pointer:{touch:r=!1}={}}){if(t.target&&!Ee.touch&&Ee.gesture)return"gesture";if(Ee.touch&&r)return"touch";if(Ee.touchscreen){if(Ee.pointer)return"pointer";if(Ee.touch)return"touch"}},bounds(n,e,{scaleBounds:t={},angleBounds:r={}}){const s=i=>{const c=yn(Vt(t,i),{min:-1/0,max:1/0});return[c.min,c.max]},o=i=>{const c=yn(Vt(r,i),{min:-1/0,max:1/0});return[c.min,c.max]};return typeof t!="function"&&typeof r!="function"?[s(),o()]:i=>[s(i),o(i)]},threshold(n,e,t){return this.lockDirection=t.axis==="lock",he.toVector(n,this.lockDirection?[.1,3]:0)},modifierKey(n){return n===void 0?"ctrlKey":n},pinchOnWheel(n=!0){return n}});re(re({},Dt),{},{mouseOnly:(n=!0)=>n});re(re({},Dt),{},{mouseOnly:(n=!0)=>n});const Hn=new Map,nn=new Map;function as(n){Hn.set(n.key,n.engine),nn.set(n.key,n.resolver)}const ls={key:"drag",engine:Kr,resolver:$n};function us(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o<r.length;o++)s=r[o],!(e.indexOf(s)>=0)&&(t[s]=n[s]);return t}function fs(n,e){if(n==null)return{};var t=us(n,e),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}const ds={target(n){if(n)return()=>"current"in n?n.current:n},enabled(n=!0){return n},window(n=Ee.isBrowser?window:void 0){return n},eventOptions({passive:n=!0,capture:e=!1}={}){return{passive:n,capture:e}},transform(n){return n}},hs=["target","eventOptions","window","enabled","transform"];function zt(n={},e){const t={};for(const[r,s]of Object.entries(e))switch(typeof s){case"function":if(process.env.NODE_ENV==="development"){const o=s.call(t,n[r],r,n);Number.isNaN(o)||(t[r]=o)}else t[r]=s.call(t,n[r],r,n);break;case"object":t[r]=zt(n[r],s);break;case"boolean":s&&(t[r]=n[r]);break}return t}function ms(n,e,t={}){const r=n,{target:s,eventOptions:o,window:i,enabled:c,transform:a}=r,u=fs(r,hs);if(t.shared=zt({target:s,eventOptions:o,window:i,enabled:c,transform:a},ds),e){const l=nn.get(e);t[e]=zt(re({shared:t.shared},u),l)}else for(const l in u){const h=nn.get(l);if(h)t[l]=zt(re({shared:t.shared},u[l]),h);else if(process.env.NODE_ENV==="development"&&!["drag","pinch","scroll","wheel","move","hover"].includes(l)){if(l==="domTarget")throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");console.warn(`[@use-gesture]: Unknown config key \`${l}\` was used. Please read the documentation for further information.`)}}return t}class Bn{constructor(e,t){Se(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,r,s,o){const i=this._listeners,c=zr(t,r),a=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},u=re(re({},a),o);e.addEventListener(c,s,u);const l=()=>{e.removeEventListener(c,s,u),i.delete(l)};return i.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class ps{constructor(){Se(this,"_timeouts",new Map)}add(e,t,r=140,...s){this.remove(e),this._timeouts.set(e,window.setTimeout(t,r,...s))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class gs{constructor(e){Se(this,"gestures",new Set),Se(this,"_targetEventStore",new Bn(this)),Se(this,"gestureEventStores",{}),Se(this,"gestureTimeoutStores",{}),Se(this,"handlers",{}),Se(this,"config",{}),Se(this,"pointerIds",new Set),Se(this,"touchIds",new Set),Se(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),vs(this,e)}setEventIds(e){if(Bt(e))return this.touchIds=new Set(Ur(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=ms(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,r={};let s;if(!(t.target&&(s=t.target(),!s))){if(t.enabled){for(const i of this.gestures){const c=this.config[i],a=Cn(r,c.eventOptions,!!s);if(c.enabled){const u=Hn.get(i);new u(this,e,i).bind(a)}}const o=Cn(r,t.eventOptions,!!s);for(const i in this.nativeHandlers)o(i,"",c=>this.nativeHandlers[i](re(re({},this.state.shared),{},{event:c,args:e})),void 0,!0)}for(const o in r)r[o]=Hr(...r[o]);if(!s)return r;for(const o in r){const{device:i,capture:c,passive:a}=Wr(o);this._targetEventStore.add(s,i,"",r[o],{capture:c,passive:a})}}}}function Et(n,e){n.gestures.add(e),n.gestureEventStores[e]=new Bn(n,e),n.gestureTimeoutStores[e]=new ps}function vs(n,e){e.drag&&Et(n,"drag"),e.wheel&&Et(n,"wheel"),e.scroll&&Et(n,"scroll"),e.move&&Et(n,"move"),e.pinch&&Et(n,"pinch"),e.hover&&Et(n,"hover")}const Cn=(n,e,t)=>(r,s,o,i={},c=!1)=>{var a,u;const l=(a=i.capture)!==null&&a!==void 0?a:e.capture,h=(u=i.passive)!==null&&u!==void 0?u:e.passive;let d=c?r:Ir(r,s,l);t&&h&&(d+="Passive"),n[d]=n[d]||[],n[d].push(o)};function bs(n,e={},t,r){const s=k.useMemo(()=>new gs(n),[]);if(s.applyHandlers(n,r),s.applyConfig(e,t),k.useEffect(s.effect.bind(s)),k.useEffect(()=>s.clean.bind(s),[]),e.target===void 0)return s.bind.bind(s)}function Qt(n,e){return as(ls),bs({drag:n},e||{},"drag")}function Dn(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function Yn(...n){return e=>{let t=!1;const r=n.map(s=>{const o=Dn(s,e);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Dn(n[s],null)}}}}function Ze(...n){return g.useCallback(Yn(...n),n)}function Xn(n){const e=Ss(n),t=g.forwardRef((r,s)=>{const{children:o,...i}=r,c=g.Children.toArray(o),a=c.find(Es);if(a){const u=a.props.children,l=c.map(h=>h===a?g.Children.count(u)>1?g.Children.only(null):g.isValidElement(u)?u.props.children:null:h);return T.jsx(e,{...i,ref:s,children:g.isValidElement(u)?g.cloneElement(u,void 0,l):null})}return T.jsx(e,{...i,ref:s,children:o})});return t.displayName=`${n}.Slot`,t}var _s=Xn("Slot");function Ss(n){const e=g.forwardRef((t,r)=>{const{children:s,...o}=t;if(g.isValidElement(s)){const i=Ts(s),c=ys(o,s.props);return s.type!==g.Fragment&&(c.ref=r?Yn(r,i):i),g.cloneElement(s,c)}return g.Children.count(s)>1?g.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var ws=Symbol("radix.slottable");function Es(n){return g.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===ws}function ys(n,e){const t={...e};for(const r in e){const s=n[r],o=e[r];/^on[A-Z]/.test(r)?s&&o?t[r]=(...c)=>{const a=o(...c);return s(...c),a}:s&&(t[r]=s):r==="style"?t[r]={...s,...o}:r==="className"&&(t[r]=[s,o].filter(Boolean).join(" "))}return{...n,...t}}function Ts(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var Rs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lt=Rs.reduce((n,e)=>{const t=Xn(`Primitive.${e}`),r=g.forwardRef((s,o)=>{const{asChild:i,...c}=s,a=i?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(a,{...c,ref:o})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{});function xs(n,e=[]){let t=[];function r(o,i){const c=g.createContext(i),a=t.length;t=[...t,i];const u=h=>{const{scope:d,children:m,...w}=h,v=d?.[n]?.[a]||c,p=g.useMemo(()=>w,Object.values(w));return T.jsx(v.Provider,{value:p,children:m})};u.displayName=o+"Provider";function l(h,d){const m=d?.[n]?.[a]||c,w=g.useContext(m);if(w)return w;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[u,l]}const s=()=>{const o=t.map(i=>g.createContext(i));return function(c){const a=c?.[n]||o;return g.useMemo(()=>({[`__scope${n}`]:{...c,[n]:a}}),[c,a])}};return s.scopeName=n,[r,As(s,...e)]}function As(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((c,{useScope:a,scopeName:u})=>{const h=a(o)[`__scope${u}`];return{...c,...h}},{});return g.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return t.scopeName=e.scopeName,t}function Je(n,e,{checkForDefaultPrevented:t=!0}={}){return function(s){if(n?.(s),t===!1||!s.defaultPrevented)return e?.(s)}}var rn=globalThis?.document?g.useLayoutEffect:()=>{};function Cs(n,e){return g.useReducer((t,r)=>e[t][r]??t,n)}var Ot=n=>{const{present:e,children:t}=n,r=Ds(e),s=typeof t=="function"?t({present:r.isPresent}):g.Children.only(t),o=Ze(r.ref,Ps(s));return typeof t=="function"||r.isPresent?g.cloneElement(s,{ref:o}):null};Ot.displayName="Presence";function Ds(n){const[e,t]=g.useState(),r=g.useRef(null),s=g.useRef(n),o=g.useRef("none"),i=n?"mounted":"unmounted",[c,a]=Cs(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=Wt(r.current);o.current=c==="mounted"?u:"none"},[c]),rn(()=>{const u=r.current,l=s.current;if(l!==n){const d=o.current,m=Wt(u);n?a("MOUNT"):m==="none"||u?.display==="none"?a("UNMOUNT"):a(l&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=n}},[n,a]),rn(()=>{if(e){let u;const l=e.ownerDocument.defaultView??window,h=m=>{const v=Wt(r.current).includes(CSS.escape(m.animationName));if(m.target===e&&v&&(a("ANIMATION_END"),!s.current)){const p=e.style.animationFillMode;e.style.animationFillMode="forwards",u=l.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=p)})}},d=m=>{m.target===e&&(o.current=Wt(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{l.clearTimeout(u),e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else a("ANIMATION_END")},[e,a]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:g.useCallback(u=>{r.current=u?getComputedStyle(u):null,t(u)},[])}}function Wt(n){return n?.animationName||"none"}function Ps(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var Ls=g.createContext(void 0);function Os(n){const e=g.useContext(Ls);return n||e||"ltr"}function Ke(n){const e=g.useRef(n);return g.useEffect(()=>{e.current=n}),g.useMemo(()=>(...t)=>e.current?.(...t),[])}function Ms(n,[e,t]){return Math.min(t,Math.max(e,n))}function Ns(n,e){return g.useReducer((t,r)=>e[t][r]??t,n)}var on="ScrollArea",[Gn]=xs(on),[Is,ye]=Gn(on),qn=g.forwardRef((n,e)=>{const{__scopeScrollArea:t,type:r="hover",dir:s,scrollHideDelay:o=600,...i}=n,[c,a]=g.useState(null),[u,l]=g.useState(null),[h,d]=g.useState(null),[m,w]=g.useState(null),[v,p]=g.useState(null),[R,b]=g.useState(0),[_,S]=g.useState(0),[P,D]=g.useState(!1),[L,H]=g.useState(!1),M=Ze(e,F=>a(F)),j=Os(s);return T.jsx(Is,{scope:t,type:r,dir:j,scrollHideDelay:o,scrollArea:c,viewport:u,onViewportChange:l,content:h,onContentChange:d,scrollbarX:m,onScrollbarXChange:w,scrollbarXEnabled:P,onScrollbarXEnabledChange:D,scrollbarY:v,onScrollbarYChange:p,scrollbarYEnabled:L,onScrollbarYEnabledChange:H,onCornerWidthChange:b,onCornerHeightChange:S,children:T.jsx(Lt.div,{dir:j,...i,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":R+"px","--radix-scroll-area-corner-height":_+"px",...n.style}})})});qn.displayName=on;var Kn="ScrollAreaViewport",Jn=g.forwardRef((n,e)=>{const{__scopeScrollArea:t,children:r,nonce:s,...o}=n,i=ye(Kn,t),c=g.useRef(null),a=Ze(e,c,i.onViewportChange);return T.jsxs(T.Fragment,{children:[T.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),T.jsx(Lt.div,{"data-radix-scroll-area-viewport":"",...o,ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...n.style},children:T.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Jn.displayName=Kn;var Le="ScrollAreaScrollbar",Zn=g.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=ye(Le,n.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,c=n.orientation==="horizontal";return g.useEffect(()=>(c?o(!0):i(!0),()=>{c?o(!1):i(!1)}),[c,o,i]),s.type==="hover"?T.jsx(ks,{...r,ref:e,forceMount:t}):s.type==="scroll"?T.jsx(Ws,{...r,ref:e,forceMount:t}):s.type==="auto"?T.jsx(Qn,{...r,ref:e,forceMount:t}):s.type==="always"?T.jsx(cn,{...r,ref:e}):null});Zn.displayName=Le;var ks=g.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=ye(Le,n.__scopeScrollArea),[o,i]=g.useState(!1);return g.useEffect(()=>{const c=s.scrollArea;let a=0;if(c){const u=()=>{window.clearTimeout(a),i(!0)},l=()=>{a=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",l),()=>{window.clearTimeout(a),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",l)}}},[s.scrollArea,s.scrollHideDelay]),T.jsx(Ot,{present:t||o,children:T.jsx(Qn,{"data-state":o?"visible":"hidden",...r,ref:e})})}),Ws=g.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=ye(Le,n.__scopeScrollArea),o=n.orientation==="horizontal",i=Xt(()=>a("SCROLL_END"),100),[c,a]=Ns("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return g.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>a("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,s.scrollHideDelay,a]),g.useEffect(()=>{const u=s.viewport,l=o?"scrollLeft":"scrollTop";if(u){let h=u[l];const d=()=>{const m=u[l];h!==m&&(a("SCROLL"),i()),h=m};return u.addEventListener("scroll",d),()=>u.removeEventListener("scroll",d)}},[s.viewport,o,a,i]),T.jsx(Ot,{present:t||c!=="hidden",children:T.jsx(cn,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:Je(n.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:Je(n.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),Qn=g.forwardRef((n,e)=>{const t=ye(Le,n.__scopeScrollArea),{forceMount:r,...s}=n,[o,i]=g.useState(!1),c=n.orientation==="horizontal",a=Xt(()=>{if(t.viewport){const u=t.viewport.offsetWidth<t.viewport.scrollWidth,l=t.viewport.offsetHeight<t.viewport.scrollHeight;i(c?u:l)}},10);return Rt(t.viewport,a),Rt(t.content,a),T.jsx(Ot,{present:r||o,children:T.jsx(cn,{"data-state":o?"visible":"hidden",...s,ref:e})})}),cn=g.forwardRef((n,e)=>{const{orientation:t="vertical",...r}=n,s=ye(Le,n.__scopeScrollArea),o=g.useRef(null),i=g.useRef(0),[c,a]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=sr(c.viewport,c.content),l={...r,sizes:c,onSizesChange:a,hasThumb:u>0&&u<1,onThumbChange:d=>o.current=d,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:d=>i.current=d};function h(d,m){return $s(d,i.current,c,m)}return t==="horizontal"?T.jsx(zs,{...l,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const d=s.viewport.scrollLeft,m=Pn(d,c,s.dir);o.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollLeft=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollLeft=h(d,s.dir))}}):t==="vertical"?T.jsx(js,{...l,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const d=s.viewport.scrollTop,m=Pn(d,c);o.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollTop=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollTop=h(d))}}):null}),zs=g.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=ye(Le,n.__scopeScrollArea),[i,c]=g.useState(),a=g.useRef(null),u=Ze(e,a,o.onScrollbarXChange);return g.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),T.jsx(tr,{"data-orientation":"horizontal",...s,ref:u,sizes:t,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Yt(t)+"px",...n.style},onThumbPointerDown:l=>n.onThumbPointerDown(l.x),onDragScroll:l=>n.onDragScroll(l.x),onWheelScroll:(l,h)=>{if(o.viewport){const d=o.viewport.scrollLeft+l.deltaX;n.onWheelScroll(d),ir(d,h)&&l.preventDefault()}},onResize:()=>{a.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:Ht(i.paddingLeft),paddingEnd:Ht(i.paddingRight)}})}})}),js=g.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=ye(Le,n.__scopeScrollArea),[i,c]=g.useState(),a=g.useRef(null),u=Ze(e,a,o.onScrollbarYChange);return g.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),T.jsx(tr,{"data-orientation":"vertical",...s,ref:u,sizes:t,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Yt(t)+"px",...n.style},onThumbPointerDown:l=>n.onThumbPointerDown(l.y),onDragScroll:l=>n.onDragScroll(l.y),onWheelScroll:(l,h)=>{if(o.viewport){const d=o.viewport.scrollTop+l.deltaY;n.onWheelScroll(d),ir(d,h)&&l.preventDefault()}},onResize:()=>{a.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:Ht(i.paddingTop),paddingEnd:Ht(i.paddingBottom)}})}})}),[Fs,er]=Gn(Le),tr=g.forwardRef((n,e)=>{const{__scopeScrollArea:t,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:c,onThumbPositionChange:a,onDragScroll:u,onWheelScroll:l,onResize:h,...d}=n,m=ye(Le,t),[w,v]=g.useState(null),p=Ze(e,M=>v(M)),R=g.useRef(null),b=g.useRef(""),_=m.viewport,S=r.content-r.viewport,P=Ke(l),D=Ke(a),L=Xt(h,10);function H(M){if(R.current){const j=M.clientX-R.current.left,F=M.clientY-R.current.top;u({x:j,y:F})}}return g.useEffect(()=>{const M=j=>{const F=j.target;w?.contains(F)&&P(j,S)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[_,w,S,P]),g.useEffect(D,[r,D]),Rt(w,L),Rt(m.content,L),T.jsx(Fs,{scope:t,scrollbar:w,hasThumb:s,onThumbChange:Ke(o),onThumbPointerUp:Ke(i),onThumbPositionChange:D,onThumbPointerDown:Ke(c),children:T.jsx(Lt.div,{...d,ref:p,style:{position:"absolute",...d.style},onPointerDown:Je(n.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),R.current=w.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),H(M))}),onPointerMove:Je(n.onPointerMove,H),onPointerUp:Je(n.onPointerUp,M=>{const j=M.target;j.hasPointerCapture(M.pointerId)&&j.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=b.current,m.viewport&&(m.viewport.style.scrollBehavior=""),R.current=null})})})}),$t="ScrollAreaThumb",nr=g.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=er($t,n.__scopeScrollArea);return T.jsx(Ot,{present:t||s.hasThumb,children:T.jsx(Us,{ref:e,...r})})}),Us=g.forwardRef((n,e)=>{const{__scopeScrollArea:t,style:r,...s}=n,o=ye($t,t),i=er($t,t),{onThumbPositionChange:c}=i,a=Ze(e,h=>i.onThumbChange(h)),u=g.useRef(void 0),l=Xt(()=>{u.current&&(u.current(),u.current=void 0)},100);return g.useEffect(()=>{const h=o.viewport;if(h){const d=()=>{if(l(),!u.current){const m=Hs(h,c);u.current=m,c()}};return c(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[o.viewport,l,c]),T.jsx(Lt.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Je(n.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),w=h.clientX-m.left,v=h.clientY-m.top;i.onThumbPointerDown({x:w,y:v})}),onPointerUp:Je(n.onPointerUp,i.onThumbPointerUp)})});nr.displayName=$t;var an="ScrollAreaCorner",rr=g.forwardRef((n,e)=>{const t=ye(an,n.__scopeScrollArea),r=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&r?T.jsx(Vs,{...n,ref:e}):null});rr.displayName=an;var Vs=g.forwardRef((n,e)=>{const{__scopeScrollArea:t,...r}=n,s=ye(an,t),[o,i]=g.useState(0),[c,a]=g.useState(0),u=!!(o&&c);return Rt(s.scrollbarX,()=>{const l=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(l),a(l)}),Rt(s.scrollbarY,()=>{const l=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(l),i(l)}),u?T.jsx(Lt.div,{...r,ref:e,style:{width:o,height:c,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null});function Ht(n){return n?parseInt(n,10):0}function sr(n,e){const t=n/e;return isNaN(t)?0:t}function Yt(n){const e=sr(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}function $s(n,e,t,r="ltr"){const s=Yt(t),o=s/2,i=e||o,c=s-i,a=t.scrollbar.paddingStart+i,u=t.scrollbar.size-t.scrollbar.paddingEnd-c,l=t.content-t.viewport,h=r==="ltr"?[0,l]:[l*-1,0];return or([a,u],h)(n)}function Pn(n,e,t="ltr"){const r=Yt(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-s,i=e.content-e.viewport,c=o-r,a=t==="ltr"?[0,i]:[i*-1,0],u=Ms(n,a);return or([0,i],[0,c])(u)}function or(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function ir(n,e){return n>0&&n<e}var Hs=(n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},r=0;return(function s(){const o={left:n.scrollLeft,top:n.scrollTop},i=t.left!==o.left,c=t.top!==o.top;(i||c)&&e(),t=o,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function Xt(n,e){const t=Ke(n),r=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),g.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}function Rt(n,e){const t=Ke(e);rn(()=>{let r=0;if(n){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)});return s.observe(n),()=>{window.cancelAnimationFrame(r),s.unobserve(n)}}},[n,t])}var Bs=qn,Ys=Jn,Xs=rr;const en=(n,e,t,r,s)=>({target:n,dx:e[0],dy:e[1],clientX:t[0],clientY:t[1],...r&&{edges:r},...s&&{deltaRect:s}}),Gs=(n,e,t)=>n?n===e||n===t||(e?.contains(n)??!1)||(t?.contains(n)??!1):!1,qs=n=>{const e=Pe.c(34),{children:t,style:r,draggable:s,resizable:o,draggableOptions:i,resizableOptions:c,ref:a}=n,u=k.useRef(void 0),l=k.useRef(void 0),h=k.useRef(null),d=k.useRef(null),m=k.useRef(void 0),w=k.useRef(void 0);let v,p;e[0]!==i||e[1]!==a||e[2]!==c?(v=()=>{if(u.current=i,l.current=c,!a?.current)return;const E=c?.edges?.left,A=c?.edges?.right;E&&E!==m.current&&(m.current=E,h.current=a.current.querySelector(E)),A&&A!==w.current&&(w.current=A,d.current=a.current.querySelector(A))},p=[i,a,c],e[0]=i,e[1]=a,e[2]=c,e[3]=v,e[4]=p):(v=e[3],p=e[4]),k.useEffect(v,p);let R;e[5]!==a?(R=E=>{const{active:A,delta:N,xy:ee,event:ne,first:f,last:y}=E,I=a?.current;if(!I||Gs(ne?.target,h.current,d.current))return;const Y=en(I,N,ee);f?u.current?.onstart?.(Y):y?u.current?.onend?.(Y):A&&u.current?.onmove?.(Y)},e[5]=a,e[6]=R):R=e[6];const b=i?.lockAxis==="x"?"x":void 0;let _;e[7]===Symbol.for("react.memo_cache_sentinel")?(_={capture:!0},e[7]=_):_=e[7];let S;e[8]!==s||e[9]!==a||e[10]!==b?(S={enabled:s,axis:b,pointer:_,target:a,threshold:0},e[8]=s,e[9]=a,e[10]=b,e[11]=S):S=e[11],Qt(R,S);let P;e[12]!==a?(P=E=>{const{active:A,delta:N,xy:ee,first:ne,last:f}=E,y=a?.current;if(!y)return;const I=en(y,N,ee,{left:!0},{left:N[0]});ne?l.current?.onstart?.(I):f?l.current?.onend?.(I):A&&l.current?.onmove?.(I)},e[12]=a,e[13]=P):P=e[13];let D;e[14]===Symbol.for("react.memo_cache_sentinel")?(D={capture:!0},e[14]=D):D=e[14];let L;e[15]!==o?(L={enabled:o,target:h,pointer:D,threshold:0},e[15]=o,e[16]=L):L=e[16],Qt(P,L);let H;e[17]!==a?(H=E=>{const{active:A,delta:N,xy:ee,first:ne,last:f}=E,y=a?.current;if(!y)return;const I=en(y,N,ee,{right:!0},{right:N[0]});ne?l.current?.onstart?.(I):f?l.current?.onend?.(I):A&&l.current?.onmove?.(I)},e[17]=a,e[18]=H):H=e[18];let M;e[19]===Symbol.for("react.memo_cache_sentinel")?(M={capture:!0},e[19]=M):M=e[19];let j;e[20]!==o?(j={enabled:o,target:d,pointer:M,threshold:0},e[20]=o,e[21]=j):j=e[21],Qt(H,j);let F,G;e[22]!==a?(F=()=>{const E=a?.current;if(!E)return;const A=l.current?.edges?.left,N=l.current?.edges?.right;A&&(h.current=E.querySelector(A)),N&&(d.current=E.querySelector(N))},G=[a],e[22]=a,e[23]=F,e[24]=G):(F=e[23],G=e[24]),k.useLayoutEffect(F,G);let x;e[25]!==s?(x=s?{touchAction:"none"}:{},e[25]=s,e[26]=x):x=e[26];let U;e[27]!==r||e[28]!==x?(U={...x,...r},e[27]=r,e[28]=x,e[29]=U):U=e[29];let W;return e[30]!==t||e[31]!==a||e[32]!==U?(W=T.jsx(_s,{ref:a,style:U,draggable:!1,children:t}),e[30]=t,e[31]=a,e[32]=U,e[33]=W):W=e[33],W},_e=(n,e=0)=>n?parseFloat(n):e,tn=(n,e,t,r=Number.MAX_SAFE_INTEGER)=>{let s=n,o=r;for(const i of e){const c=Math.abs(i-n);c<t&&c<o&&(s=i,o=c)}return{snap:s,minDis:o}},cr=k.forwardRef((n,e)=>{const t=Pe.c(68),{children:r,edges:s,left:o,width:i,start:c,grid:a,getBounds:u,enableResizing:l,enableDragging:h,snapDistance:d,snapPositions:m,onResizeStart:w,onResize:v,onResizeEnd:p,onDragStart:R,onDragEnd:b,onDrag:_,parentRef:S,autoScroll:P}=n,D=c===void 0?C.DEFAULT_START_LEFT:c,L=a===void 0?C.DEFAULT_MOVE_GRID:a,H=u===void 0?Ks:u,M=l===void 0?!0:l,j=h===void 0?!0:h,F=d===void 0?C.DEFAULT_SNAP_DISTANCE:d;let G;t[0]!==m?(G=m===void 0?[]:m,t[0]=m,t[1]=G):G=t[1];const x=G,U=P===void 0?!0:P,W=k.useRef(null),E=k.useRef(0),A=k.useRef(!1),{initAutoScroll:N,stopAutoScroll:ee,dealDragAutoScroll:ne,dealResizeAutoScroll:f}=Cr(S);let y;t[2]===Symbol.for("react.memo_cache_sentinel")?(y=($,Z)=>{const K=Z===void 0?!0:Z;if(!W.current)return;K&&(E.current=0);const J=W.current;J.style.left=`${$}px`,J.dataset.left=String($)},t[2]=y):y=t[2];const I=y;let Y;t[3]===Symbol.for("react.memo_cache_sentinel")?(Y=($,Z)=>{const K=Z===void 0?!0:Z;if(!W.current)return;K&&(E.current=0);const J=W.current;J.style.width=`${$}px`,J.dataset.width=String($)},t[3]=Y):Y=t[3];const te=Y;let q;t[4]===Symbol.for("react.memo_cache_sentinel")?(q=()=>W.current?_e(W.current.dataset.left):0,t[4]=q):q=t[4];const X=q;let O;t[5]===Symbol.for("react.memo_cache_sentinel")?(O=()=>W.current?_e(W.current.dataset.width):0,t[5]=O):O=t[5];const z=O;let B,Qe;t[6]!==i?(B=()=>{if(!W.current)return;const $=W.current;te(typeof i>"u"?$.offsetWidth:i,!1)},Qe=[i],t[6]=i,t[7]=B,t[8]=Qe):(B=t[7],Qe=t[8]),k.useEffect(B,Qe);let et,ze;t[9]!==o?(et=()=>{I(o||0,!1)},ze=[o],t[9]=o,t[10]=et,t[11]=ze):(et=t[10],ze=t[11]),k.useEffect(et,ze);let Oe;t[12]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>({updateLeft:$=>I($||0,!1),updateWidth:$=>te($,!1),getLeft:X,getWidth:z}),t[12]=Oe):Oe=t[12],k.useImperativeHandle(e,Oe);let xe;t[13]!==N||t[14]!==R?(xe=()=>{E.current=0,A.current=!1,N(),R?.()},t[13]=N,t[14]=R,t[15]=xe):xe=t[15];const Xe=xe;let Me;t[16]!==H||t[17]!==L||t[18]!==_||t[19]!==F||t[20]!==x||t[21]!==D?(Me=$=>{const{preLeft:Z,preWidth:K,scrollDelta:J}=$;J&&(E.current=E.current+J);const me=A.current?F:L;if(Math.abs(E.current)<me)return;const pe=Math.trunc(E.current/me);let Q=Z+pe*me;const oe=E.current>0,V=oe?Q+K:Q,{snap:se}=tn(V,x,F);if(se!==V)A.current=!0,Q=oe?se-K:se;else{const le=Q-D;le%L!==0&&(Q=D+L*Math.round(le/L)),A.current=!1}E.current=E.current%me;const ie=H();Q<ie.left?Q=ie.left:Q+K>ie.right&&(Q=ie.right-K),!(_&&_({lastLeft:Z,left:Q,lastWidth:K,width:K},J)===!1)&&I(Q,!1)},t[16]=H,t[17]=L,t[18]=_,t[19]=F,t[20]=x,t[21]=D,t[22]=Me):Me=t[22];const Ae=Me;let Ne;t[23]!==U||t[24]!==ne||t[25]!==Ae||t[26]!==S?(Ne=$=>{const Z=$.target,K=_e(Z.dataset.left),J=_e(Z.dataset.width);E.current=E.current+$.dx,!(U&&S?.current&&!ne($,Q=>{if(!S?.current||!W.current)return;S.current.scrollLeft=S.current.scrollLeft+Q;const oe=W.current,V=_e(oe.dataset.left),se=_e(oe.dataset.width);Ae({preLeft:V,preWidth:se,scrollDelta:Q})}))&&Ae({preLeft:K,preWidth:J})},t[23]=U,t[24]=ne,t[25]=Ae,t[26]=S,t[27]=Ne):Ne=t[27];const xt=Ne;let tt;t[28]!==b||t[29]!==ee?(tt=$=>{E.current=0,A.current=!1,ee();const Z=$.target;b?.({left:_e(Z.dataset.left),width:_e(Z.dataset.width)})},t[28]=b,t[29]=ee,t[30]=tt):tt=t[30];const je=tt;let we;t[31]!==N||t[32]!==w?(we=$=>{E.current=0,A.current=!1,N();const Z=$.edges?.right?"right":"left";w?.(Z)},t[31]=N,t[32]=w,t[33]=we):we=t[33];const Fe=we;let Ie;t[34]!==H||t[35]!==L||t[36]!==v||t[37]!==F||t[38]!==x||t[39]!==D?(Ie=$=>{const{dir:Z,preWidth:K,preLeft:J,scrollDelta:me}=$;me&&(E.current=E.current+me);const pe=A.current?F:L;if(Math.abs(E.current)<pe)return;const Q=H();if(Z==="left"){const oe=Math.trunc(E.current/pe);let V=J+oe*pe;const{snap:se}=tn(V,x,F);if(se!==V)A.current=!0,V=se;else{const ge=V-D;ge%L!==0&&(V=D+L*Math.round(ge/L)),A.current=!1}E.current=E.current%pe,V<Q.left&&(V=Q.left);const ie=J+K,le=ie-V;if(V>=ie||v&&v("left",{lastLeft:J,lastWidth:K,left:V,width:le})===!1)return;I(V,!1),te(le,!1)}else{const oe=Math.trunc(E.current/pe);let V=K+oe*pe;const se=J+V,{snap:ie}=tn(se,x,F);if(ie!==se)A.current=!0,V=ie-J;else{let le=J+V;const ge=le-D;ge%L!==0&&(le=D+L*Math.round(ge/L),V=le-J),A.current=!1}if(E.current=E.current%pe,J+V>Q.right&&(V=Q.right-J),V<=0||v&&v("right",{lastLeft:J,lastWidth:K,left:J,width:V})===!1)return;te(V,!1)}},t[34]=H,t[35]=L,t[36]=v,t[37]=F,t[38]=x,t[39]=D,t[40]=Ie):Ie=t[40];const Ue=Ie;let ke;t[41]!==U||t[42]!==f||t[43]!==S||t[44]!==Ue?(ke=$=>{const Z=$.target,K=$.edges?.left?"left":"right",J=_e(Z.dataset.left),me=_e(Z.dataset.width);E.current=E.current+(K==="left"?$.deltaRect?.left||0:$.deltaRect?.right||0),!(U&&S?.current&&!f($,K,oe=>{if(!S?.current||!W.current)return;S.current.scrollLeft=S.current.scrollLeft+oe;const V=W.current,se=_e(V.dataset.left),ie=_e(V.dataset.width);Ue({preLeft:se,preWidth:ie,dir:K,scrollDelta:oe})}))&&Ue({preLeft:J,preWidth:me,dir:K})},t[41]=U,t[42]=f,t[43]=S,t[44]=Ue,t[45]=ke):ke=t[45];const Ce=ke;let We;t[46]!==p||t[47]!==ee?(We=$=>{E.current=0,A.current=!1,ee();const Z=$.target,K=$.edges?.right?"right":"left";p?.(K,{left:_e(Z.dataset.left),width:_e(Z.dataset.width)})},t[46]=p,t[47]=ee,t[48]=We):We=t[48];const Ge=We;let Te;t[49]!==o||t[50]!==i?(Te={left:o,width:i},t[49]=o,t[50]=i,t[51]=Te):Te=t[51];let De;t[52]!==xt||t[53]!==Xe||t[54]!==je?(De={lockAxis:"x",onmove:xt,onstart:Xe,onend:je,cursorChecker:Js},t[52]=xt,t[53]=Xe,t[54]=je,t[55]=De):De=t[55];let Re;t[56]!==s||t[57]!==Ce||t[58]!==Fe||t[59]!==Ge?(Re={axis:"x",invert:"none",edges:s,onmove:Ce,onstart:Fe,onend:Ge},t[56]=s,t[57]=Ce,t[58]=Fe,t[59]=Ge,t[60]=Re):Re=t[60];let Ve;return t[61]!==r||t[62]!==j||t[63]!==M||t[64]!==Te||t[65]!==De||t[66]!==Re?(Ve=T.jsx(qs,{style:Te,ref:W,draggable:j,resizable:M,draggableOptions:De,resizableOptions:Re,children:r}),t[61]=r,t[62]=j,t[63]=M,t[64]=Te,t[65]=De,t[66]=Re,t[67]=Ve):Ve=t[67],Ve});function Ks(){return{left:Number.MIN_SAFE_INTEGER,right:Number.MAX_SAFE_INTEGER}}function Js(){return""}function Zs(){let n=0,e,t="",r=arguments.length;for(;n<r;n++)(e=arguments[n])&&typeof e=="string"&&(t+=(t&&" ")+e);return t}const Qs=n=>{const e=Pe.c(191),{editorData:t,row:r,action:s,effects:o,rowHeight:i,scale:c,scaleWidth:a,scaleSplitCount:u,startLeft:l,gridSnap:h,disableDrag:d,scaleCount:m,maxScaleCount:w,setScaleCount:v,onActionMoveStart:p,onActionMoving:R,onActionMoveEnd:b,onActionResizeStart:_,onActionResizeEnd:S,onActionResizing:P,snapData:D,setEditorData:L,onClickAction:H,onClickActionOnly:M,onDoubleClickAction:j,onContextMenuAction:F,getActionRender:G,handleTime:x,scrollContainerRef:U}=n,W=k.useRef(null),E=k.useRef(!1),{id:A,maxEnd:N,minStart:ee,end:ne,start:f,selected:y,flexible:I,movable:Y,effectId:te}=s,q=I===void 0?!0:I,X=Y===void 0?!0:Y,O=c??C.DEFAULT_SCALE,z=a??C.DEFAULT_SCALE_WIDTH,B=l??C.DEFAULT_START_LEFT,Qe=u??C.DEFAULT_SCALE_SPLIT_COUNT,et=w??Number.MAX_SAFE_INTEGER,ze=ee||0;let Oe;e[0]!==O||e[1]!==z||e[2]!==B||e[3]!==ze?(Oe=C.parserTimeToPixel(ze,{startLeft:B,scale:O,scaleWidth:z}),e[0]=O,e[1]=z,e[2]=B,e[3]=ze,e[4]=Oe):Oe=e[4];const xe=Oe,Xe=N||Number.MAX_VALUE;let Me;e[5]!==O||e[6]!==z||e[7]!==B||e[8]!==Xe?(Me=C.parserTimeToPixel(Xe,{startLeft:B,scale:O,scaleWidth:z}),e[5]=O,e[6]=z,e[7]=B,e[8]=Xe,e[9]=Me):Me=e[9];const Ae=Math.min(et*z+B,Me);let Ne;e[10]!==ne||e[11]!==O||e[12]!==z||e[13]!==B||e[14]!==f?(Ne=C.parserTimeToTransform({start:f,end:ne},{startLeft:B,scale:O,scaleWidth:z}),e[10]=ne,e[11]=O,e[12]=z,e[13]=B,e[14]=f,e[15]=Ne):Ne=e[15];const xt=Ne,[tt,je]=k.useState(null),we=tt??xt,Fe=z/Qe;let Ie;e[16]!==te||e[17]!==o||e[18]!==q||e[19]!==X||e[20]!==y?(Ie=de(Zs("action",X&&"action-movable",y&&"action-selected",q&&"action-flexible",o[te]&&`action-effect-${te}`)),e[16]=te,e[17]=o,e[18]=q,e[19]=X,e[20]=y,e[21]=Ie):Ie=e[21];const Ue=Ie;let ke;e[22]!==z||e[23]!==B||e[24]!==m||e[25]!==v?(ke=(ve,be)=>{console.log("handleScaleCount",ve,be);const ce=C.getScaleCountByPixel(ve+be,{startLeft:B,scaleCount:m,scaleWidth:z});ce!==m&&v(ce)},e[22]=z,e[23]=B,e[24]=m,e[25]=v,e[26]=ke):ke=e[26];const Ce=ke;let We;e[27]!==s||e[28]!==p||e[29]!==r?(We=()=>{p&&p({action:s,row:r})},e[27]=s,e[28]=p,e[29]=r,e[30]=We):We=e[30];const Ge=We;let Te;e[31]!==s||e[32]!==Ce||e[33]!==R||e[34]!==r||e[35]!==O||e[36]!==z||e[37]!==B?(Te=ve=>{const{left:be,width:ce}=ve;if(E.current=!0,R){const{start:fe,end:ae}=C.parserTransformToTime({left:be,width:ce},{scaleWidth:z,scale:O,startLeft:B});if(R({action:s,row:r,start:fe,end:ae})===!1)return!1}je({left:be,width:ce}),Ce(be,ce)},e[31]=s,e[32]=Ce,e[33]=R,e[34]=r,e[35]=O,e[36]=z,e[37]=B,e[38]=Te):Te=e[38];const De=Te;let Re;e[39]!==t||e[40]!==A||e[41]!==b||e[42]!==r||e[43]!==O||e[44]!==z||e[45]!==B||e[46]!==L?(Re=ve=>{const{left:be,width:ce}=ve,{start:fe,end:ae}=C.parserTransformToTime({left:be,width:ce},{scaleWidth:z,scale:O,startLeft:B}),ue=t.find(Ye=>Ye.id===r.id);if(!ue)return;const Be=ue.actions.find(Ye=>Ye.id===A);Be&&(Be.start=fe,Be.end=ae,L(t),b&&b({action:Be,row:r,start:fe,end:ae}),je(null))},e[39]=t,e[40]=A,e[41]=b,e[42]=r,e[43]=O,e[44]=z,e[45]=B,e[46]=L,e[47]=Re):Re=e[47];const Ve=Re;let $;e[48]!==s||e[49]!==_||e[50]!==r?($=ve=>{_&&_({action:s,row:r,dir:ve})},e[48]=s,e[49]=_,e[50]=r,e[51]=$):$=e[51];const Z=$;let K;e[52]!==s||e[53]!==Ce||e[54]!==P||e[55]!==r||e[56]!==O||e[57]!==z||e[58]!==B?(K=(ve,be)=>{const{left:ce,width:fe}=be;if(E.current=!0,P){const{start:ae,end:ue}=C.parserTransformToTime({left:ce,width:fe},{scaleWidth:z,scale:O,startLeft:B});if(P({action:s,row:r,start:ae,end:ue,dir:ve})===!1)return!1}je({left:ce,width:fe}),Ce(ce,fe)},e[52]=s,e[53]=Ce,e[54]=P,e[55]=r,e[56]=O,e[57]=z,e[58]=B,e[59]=K):K=e[59];const J=K;let me;e[60]!==t||e[61]!==A||e[62]!==S||e[63]!==r||e[64]!==O||e[65]!==z||e[66]!==B||e[67]!==L?(me=(ve,be)=>{const{left:ce,width:fe}=be,{start:ae,end:ue}=C.parserTransformToTime({left:ce,width:fe},{scaleWidth:z,scale:O,startLeft:B}),Be=t.find(Gt=>Gt.id===r.id);if(!Be)return;const Ye=Be.actions.find(Gt=>Gt.id===A);Ye&&(Ye.start=ae,Ye.end=ue,L(t),S&&S({action:Ye,row:r,start:ae,end:ue,dir:ve}),je(null))},e[60]=t,e[61]=A,e[62]=S,e[63]=r,e[64]=O,e[65]=z,e[66]=B,e[67]=L,e[68]=me):me=e[68];const pe=me;let Q,oe,V,se,ie,le,ge,nt,rt,st,ot,it,ct,at,lt,ut,$e,He,ft,dt,ht,mt,pt,gt,vt,bt;if(e[69]!==s||e[70]!==Ue||e[71]!==d||e[72]!==q||e[73]!==G||e[74]!==Fe||e[75]!==h||e[76]!==De||e[77]!==Ve||e[78]!==Ge||e[79]!==pe||e[80]!==Z||e[81]!==J||e[82]!==x||e[83]!==xe||e[84]!==X||e[85]!==H||e[86]!==M||e[87]!==F||e[88]!==j||e[89]!==Ae||e[90]!==r||e[91]!==i||e[92]!==O||e[93]!==z||e[94]!==B||e[95]!==U||e[96]!==D.assistPositions||e[97]!==we.left||e[98]!==we.width){const ve={...s,...C.parserTransformToTime({left:we.left,width:we.width},{startLeft:B,scaleWidth:z,scale:O})},be={...r,actions:[...r.actions]};r.actions.includes(s)&&(be.actions[r.actions.indexOf(s)]=ve),Q=cr,rt=W,st=U,ot=B,it=we.left,ct=we.width,at=h&&Fe||C.DEFAULT_MOVE_GRID,lt=h?Math.max((Fe||C.DEFAULT_MOVE_GRID)/2,C.DEFAULT_SNAP_DISTANCE):C.DEFAULT_SNAP_DISTANCE,ut=D.assistPositions,e[125]!==xe||e[126]!==Ae?($e=()=>({left:xe,right:Ae}),e[125]=xe,e[126]=Ae,e[127]=$e):$e=e[127];let ce;e[128]!==d||e[129]!==q?(ce=!d&&q&&`.${de("action-left-stretch")}`,e[128]=d,e[129]=q,e[130]=ce):ce=e[130];let fe;e[131]!==d||e[132]!==q?(fe=!d&&q&&`.${de("action-right-stretch")}`,e[131]=d,e[132]=q,e[133]=fe):fe=e[133],e[134]!==ce||e[135]!==fe?(He={left:ce,right:fe},e[134]=ce,e[135]=fe,e[136]=He):He=e[136],ft=!d&&X,dt=!d&&q,ht=Ge,mt=De,pt=Ve,gt=Z,vt=J,bt=pe,e[137]===Symbol.for("react.memo_cache_sentinel")?(oe=()=>{E.current=!1},e[137]=oe):oe=e[137],e[138]!==s||e[139]!==x||e[140]!==H||e[141]!==M||e[142]!==r?(V=ae=>{let ue;H&&(ue=x(ae),H(ae,{row:r,action:s,time:ue})),!E.current&&M&&(ue===void 0&&(ue=x(ae)),M(ae,{row:r,action:s,time:ue}))},e[138]=s,e[139]=x,e[140]=H,e[141]=M,e[142]=r,e[143]=V):V=e[143],e[144]!==s||e[145]!==x||e[146]!==j||e[147]!==r?(se=ae=>{if(j){const ue=x(ae);j(ae,{row:r,action:s,time:ue})}},e[144]=s,e[145]=x,e[146]=j,e[147]=r,e[148]=se):se=e[148],e[149]!==s||e[150]!==x||e[151]!==F||e[152]!==r?(ie=ae=>{if(F){const ue=x(ae);F(ae,{row:r,action:s,time:ue})}},e[149]=s,e[150]=x,e[151]=F,e[152]=r,e[153]=ie):ie=e[153],le=Ue,e[154]!==i?(ge={height:i},e[154]=i,e[155]=ge):ge=e[155],nt=G&&G(ve,be),e[69]=s,e[70]=Ue,e[71]=d,e[72]=q,e[73]=G,e[74]=Fe,e[75]=h,e[76]=De,e[77]=Ve,e[78]=Ge,e[79]=pe,e[80]=Z,e[81]=J,e[82]=x,e[83]=xe,e[84]=X,e[85]=H,e[86]=M,e[87]=F,e[88]=j,e[89]=Ae,e[90]=r,e[91]=i,e[92]=O,e[93]=z,e[94]=B,e[95]=U,e[96]=D.assistPositions,e[97]=we.left,e[98]=we.width,e[99]=Q,e[100]=oe,e[101]=V,e[102]=se,e[103]=ie,e[104]=le,e[105]=ge,e[106]=nt,e[107]=rt,e[108]=st,e[109]=ot,e[110]=it,e[111]=ct,e[112]=at,e[113]=lt,e[114]=ut,e[115]=$e,e[116]=He,e[117]=ft,e[118]=dt,e[119]=ht,e[120]=mt,e[121]=pt,e[122]=gt,e[123]=vt,e[124]=bt}else Q=e[99],oe=e[100],V=e[101],se=e[102],ie=e[103],le=e[104],ge=e[105],nt=e[106],rt=e[107],st=e[108],ot=e[109],it=e[110],ct=e[111],at=e[112],lt=e[113],ut=e[114],$e=e[115],He=e[116],ft=e[117],dt=e[118],ht=e[119],mt=e[120],pt=e[121],gt=e[122],vt=e[123],bt=e[124];let _t;e[156]!==q?(_t=q&&T.jsx("div",{className:de("action-left-stretch"),style:{touchAction:"none"}}),e[156]=q,e[157]=_t):_t=e[157];let St;e[158]!==q?(St=q&&T.jsx("div",{className:de("action-right-stretch"),style:{touchAction:"none"}}),e[158]=q,e[159]=St):St=e[159];let wt;e[160]!==oe||e[161]!==V||e[162]!==se||e[163]!==ie||e[164]!==le||e[165]!==ge||e[166]!==nt||e[167]!==_t||e[168]!==St?(wt=T.jsxs("div",{onMouseDown:oe,onClick:V,onDoubleClick:se,onContextMenu:ie,className:le,style:ge,children:[nt,_t,St]}),e[160]=oe,e[161]=V,e[162]=se,e[163]=ie,e[164]=le,e[165]=ge,e[166]=nt,e[167]=_t,e[168]=St,e[169]=wt):wt=e[169];let Mt;return e[170]!==Q||e[171]!==rt||e[172]!==st||e[173]!==ot||e[174]!==it||e[175]!==ct||e[176]!==at||e[177]!==lt||e[178]!==ut||e[179]!==$e||e[180]!==He||e[181]!==ft||e[182]!==dt||e[183]!==ht||e[184]!==mt||e[185]!==pt||e[186]!==gt||e[187]!==vt||e[188]!==bt||e[189]!==wt?(Mt=T.jsx(Q,{ref:rt,parentRef:st,start:ot,left:it,width:ct,grid:at,snapDistance:lt,snapPositions:ut,getBounds:$e,edges:He,enableDragging:ft,enableResizing:dt,onDragStart:ht,onDrag:mt,onDragEnd:pt,onResizeStart:gt,onResize:vt,onResizeEnd:bt,children:wt}),e[170]=Q,e[171]=rt,e[172]=st,e[173]=ot,e[174]=it,e[175]=ct,e[176]=at,e[177]=lt,e[178]=ut,e[179]=$e,e[180]=He,e[181]=ft,e[182]=dt,e[183]=ht,e[184]=mt,e[185]=pt,e[186]=gt,e[187]=vt,e[188]=bt,e[189]=wt,e[190]=Mt):Mt=e[190],Mt};function yt(n,e,t){let r=t.initialDeps??[],s;function o(){var i,c,a,u;let l;t.key&&((i=t.debug)!=null&&i.call(t))&&(l=Date.now());const h=n();if(!(h.length!==r.length||h.some((w,v)=>r[v]!==w)))return s;r=h;let m;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(m=Date.now()),s=e(...h),t.key&&((a=t.debug)!=null&&a.call(t))){const w=Math.round((Date.now()-l)*100)/100,v=Math.round((Date.now()-m)*100)/100,p=v/16,R=(b,_)=>{for(b=String(b);b.length<_;)b=" "+b;return b};console.info(`%c⏱ ${R(v,5)} /${R(w,5)} ms`,`
10
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),t.useMemoCache(e)}})()),Jt}var pn;function Rr(){return pn||(pn=1,process.env.NODE_ENV==="production"?It.exports=yr():It.exports=Tr()),It.exports}var Oe=Rr();const xr=n=>{const e=Oe.c(11),{isMoving:t,movePositions:r,assistPositions:s}=n;let o,i;if(e[0]!==t||e[1]!==r||e[2]!==s){const a=r===void 0?[]:r;let u;e[5]!==s?(u=s===void 0?[]:s,e[5]=s,e[6]=u):u=e[6];const l=u;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=ge("snap-line-container"),e[7]=o):o=e[7],i=t&&a.filter(m=>l.includes(m)).map(Ar),e[0]=t,e[1]=r,e[2]=s,e[3]=o,e[4]=i}else o=e[3],i=e[4];let c;return e[8]!==o||e[9]!==i?(c=T.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=c):c=e[10],c};function Ar(n,e){return T.jsx("div",{className:ge("snap-line"),style:{left:n}},e)}const kt=1,gn=10,vn=10;function Cr(n){const e=Oe.c(7),t=L.useRef(Number.MIN_SAFE_INTEGER),r=L.useRef(Number.MAX_SAFE_INTEGER),s=L.useRef(kt),o=L.useRef(void 0);let i;e[0]!==n?(i=()=>{if(n?.current){const{left:S,width:y}=n.current.getBoundingClientRect();t.current=S,r.current=S+y}},e[0]=n,e[1]=i):i=e[1];const c=i;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(S,y)=>{if(S.clientX>=r.current||S.clientX<=t.current){o.current!==void 0&&cancelAnimationFrame(o.current);const _=Math.abs(S.clientX>=r.current?S.clientX-r.current:S.clientX-t.current);s.current=Math.min(Number((_/vn).toFixed(0))*kt,gn);const p=(S.clientX>=r.current?1:-1)*s.current,v=()=>{y&&y(p),o.current=requestAnimationFrame(v)};return o.current=requestAnimationFrame(v),!1}else o.current!==void 0&&cancelAnimationFrame(o.current);return!0},e[2]=a):a=e[2];const u=a;let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=(S,y,_)=>{if(S.clientX>=r.current||S.clientX<t.current){o.current!==void 0&&cancelAnimationFrame(o.current);const h=Math.abs(S.clientX>=r.current?S.clientX-r.current:S.clientX-t.current);s.current=Math.min(Number((h/vn).toFixed(0))*kt,gn);const v=(S.clientX>=r.current?1:-1)*s.current,R=()=>{_&&_(v),o.current=requestAnimationFrame(R)};return o.current=requestAnimationFrame(R),!1}else o.current!==void 0&&cancelAnimationFrame(o.current);return!0},e[3]=l):l=e[3];const m=l;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{t.current=Number.MIN_SAFE_INTEGER,r.current=Number.MAX_SAFE_INTEGER,s.current=kt,o.current!==void 0&&cancelAnimationFrame(o.current)},e[4]=f):f=e[4];const g=f;let w;return e[5]!==c?(w={initAutoScroll:c,dealDragAutoScroll:u,dealResizeAutoScroll:m,stopAutoScroll:g},e[5]=c,e[6]=w):w=e[6],w}function Pr(n,e,t){return Math.max(e,Math.min(n,t))}const ve={toVector(n,e){return n===void 0&&(n=e),Array.isArray(n)?n:[n,n]},add(n,e){return[n[0]+e[0],n[1]+e[1]]},sub(n,e){return[n[0]-e[0],n[1]-e[1]]},addTo(n,e){n[0]+=e[0],n[1]+=e[1]},subTo(n,e){n[0]-=e[0],n[1]-=e[1]}};function bn(n,e,t){return e===0||Math.abs(e)===1/0?Math.pow(n,t*5):n*e*t/(e+t*n)}function Sn(n,e,t,r=.15){return r===0?Pr(n,e,t):n<e?-bn(e-n,t-e,r)+e:n>t?+bn(n-t,t-e,r)+t:n}function Lr(n,[e,t],[r,s]){const[[o,i],[c,a]]=n;return[Sn(e,o,i,r),Sn(t,c,a,s)]}function Dr(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Or(n){var e=Dr(n,"string");return typeof e=="symbol"?e:String(e)}function we(n,e,t){return e=Or(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _n(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function ee(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_n(Object(t),!0).forEach(function(r){we(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_n(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const jn={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function wn(n){return n?n[0].toUpperCase()+n.slice(1):""}const Mr=["enter","leave"];function Nr(n=!1,e){return n&&!Mr.includes(e)}function Ir(n,e="",t=!1){const r=jn[n],s=r&&r[e]||e;return"on"+wn(n)+wn(s)+(Nr(t,s)?"Capture":"")}const kr=["gotpointercapture","lostpointercapture"];function Wr(n){let e=n.substring(2).toLowerCase();const t=!!~e.indexOf("passive");t&&(e=e.replace("passive",""));const r=kr.includes(e)?"capturecapture":"capture",s=!!~e.indexOf(r);return s&&(e=e.replace("capture","")),{device:e,capture:s,passive:t}}function zr(n,e=""){const t=jn[n],r=t&&t[e]||e;return n+r}function Bt(n){return"touches"in n}function Fn(n){return Bt(n)?"touch":"pointerType"in n?n.pointerType:"mouse"}function jr(n){return Array.from(n.touches).filter(e=>{var t,r;return e.target===n.currentTarget||((t=n.currentTarget)===null||t===void 0||(r=t.contains)===null||r===void 0?void 0:r.call(t,e.target))})}function Fr(n){return n.type==="touchend"||n.type==="touchcancel"?n.changedTouches:n.targetTouches}function Un(n){return Bt(n)?Fr(n)[0]:n}function Ur(n){return jr(n).map(e=>e.identifier)}function Zt(n){const e=Un(n);return Bt(n)?e.identifier:e.pointerId}function En(n){const e=Un(n);return[e.clientX,e.clientY]}function Vr(n){const e={};if("buttons"in n&&(e.buttons=n.buttons),"shiftKey"in n){const{shiftKey:t,altKey:r,metaKey:s,ctrlKey:o}=n;Object.assign(e,{shiftKey:t,altKey:r,metaKey:s,ctrlKey:o})}return e}function Vt(n,...e){return typeof n=="function"?n(...e):n}function $r(){}function Hr(...n){return n.length===0?$r:n.length===1?n[0]:function(){let e;for(const t of n)e=t.apply(this,arguments)||e;return e}}function yn(n,e){return Object.assign({},e,n||{})}const Br=32;class Xr{constructor(e,t,r){this.ctrl=e,this.args=t,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:r,args:s}=this;t[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=s,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,r=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=r.from?Vt(r.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:r,shared:s}=this;t.args=this.args;let o=0;if(e&&(t.event=e,r.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,s.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,s.locked=!!document.pointerLockElement,Object.assign(s,Vr(e)),s.down=s.pressed=s.buttons%2===1||s.touches>0,o=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const E=t._delta.map(Math.abs);ve.addTo(t._distance,E)}this.axisIntent&&this.axisIntent(e);const[i,c]=t._movement,[a,u]=r.threshold,{_step:l,values:m}=t;if(r.hasCustomTransform?(l[0]===!1&&(l[0]=Math.abs(i)>=a&&m[0]),l[1]===!1&&(l[1]=Math.abs(c)>=u&&m[1])):(l[0]===!1&&(l[0]=Math.abs(i)>=a&&Math.sign(i)*a),l[1]===!1&&(l[1]=Math.abs(c)>=u&&Math.sign(c)*u)),t.intentional=l[0]!==!1||l[1]!==!1,!t.intentional)return;const f=[0,0];if(r.hasCustomTransform){const[E,C]=m;f[0]=l[0]!==!1?E-l[0]:0,f[1]=l[1]!==!1?C-l[1]:0}else f[0]=l[0]!==!1?i-l[0]:0,f[1]=l[1]!==!1?c-l[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(f);const g=t.offset,w=t._active&&!t._blocked||t.active;w&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=s[this.ingKey]=t._active,e&&(t.first&&("bounds"in r&&(t._bounds=Vt(r.bounds,t)),this.setup&&this.setup()),t.movement=f,this.computeOffset()));const[S,y]=t.offset,[[_,h],[p,v]]=t._bounds;t.overflow=[S<_?-1:S>h?1:0,y<p?-1:y>v?1:0],t._movementBound[0]=t.overflow[0]?t._movementBound[0]===!1?t._movement[0]:t._movementBound[0]:!1,t._movementBound[1]=t.overflow[1]?t._movementBound[1]===!1?t._movement[1]:t._movementBound[1]:!1;const R=t._active?r.rubberband||[0,0]:[0,0];if(t.offset=Lr(t._bounds,t.offset,R),t.delta=ve.sub(t.offset,g),this.computeMovement(),w&&(!t.last||o>Br)){t.delta=ve.sub(t.offset,g);const E=t.delta.map(Math.abs);ve.addTo(t.distance,E),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&o>0&&(t.velocity=[E[0]/o,E[1]/o],t.timeDelta=o)}}emit(){const e=this.state,t=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const s=this.handler(ee(ee(ee({},t),e),{},{[this.aliasKey]:e.values}));s!==void 0&&(e.memo=s)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function Yr([n,e],t){const r=Math.abs(n),s=Math.abs(e);if(r>s&&r>t)return"x";if(s>r&&s>t)return"y"}class Gr extends Xr{constructor(...e){super(...e),we(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=ve.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=ve.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,r=this.config;if(!t.axis&&e){const s=typeof r.axisThreshold=="object"?r.axisThreshold[Fn(e)]:r.axisThreshold;t.axis=Yr(t._movement,s)}t._blocked=(r.lockDirection||!!r.axis)&&!t.axis||!!r.axis&&r.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const Tn=n=>n,Rn=.15,sn={enabled(n=!0){return n},eventOptions(n,e,t){return ee(ee({},t.shared.eventOptions),n)},preventDefault(n=!1){return n},triggerAllEvents(n=!1){return n},rubberband(n=0){switch(n){case!0:return[Rn,Rn];case!1:return[0,0];default:return ve.toVector(n)}},from(n){if(typeof n=="function")return n;if(n!=null)return ve.toVector(n)},transform(n,e,t){const r=n||t.shared.transform;if(this.hasCustomTransform=!!r,process.env.NODE_ENV==="development"){const s=r||Tn;return o=>{const i=s(o);return(!isFinite(i[0])||!isFinite(i[1]))&&console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${i[0]},${[1]}]`),i}}return r||Tn},threshold(n){return ve.toVector(n,0)}};process.env.NODE_ENV==="development"&&Object.assign(sn,{domTarget(n){if(n!==void 0)throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");return NaN},lockDirection(n){if(n!==void 0)throw Error("[@use-gesture]: `lockDirection` option has been merged with `axis`. Use it as in `{ axis: 'lock' }`");return NaN},initial(n){if(n!==void 0)throw Error("[@use-gesture]: `initial` option has been renamed to `from`.");return NaN}});const qr=0,Pt=ee(ee({},sn),{},{axis(n,e,{axis:t}){if(this.lockDirection=t==="lock",!this.lockDirection)return t},axisThreshold(n=qr){return n},bounds(n={}){if(typeof n=="function")return o=>Pt.bounds(n(o));if("current"in n)return()=>n.current;if(typeof HTMLElement=="function"&&n instanceof HTMLElement)return n;const{left:e=-1/0,right:t=1/0,top:r=-1/0,bottom:s=1/0}=n;return[[e,t],[r,s]]}}),xn={ArrowRight:(n,e=1)=>[n*e,0],ArrowLeft:(n,e=1)=>[-1*n*e,0],ArrowUp:(n,e=1)=>[0,-1*n*e],ArrowDown:(n,e=1)=>[0,n*e]};class Kr extends Gr{constructor(...e){super(...e),we(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),r=e.currentTarget.getBoundingClientRect(),s={left:t.left-r.left+e.offset[0],right:t.right-r.right+e.offset[0],top:t.top-r.top+e.offset[1],bottom:t.bottom-r.bottom+e.offset[1]};e._bounds=Pt.bounds(s)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,r=this.state;if(e.buttons!=null&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):t.pointerButtons!==-1&&t.pointerButtons!==e.buttons))return;const s=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(s&&s.size>1&&r._pointerActive)&&(this.start(e),this.setupPointer(e),r._pointerId=Zt(e),r._pointerActive=!0,this.computeValues(En(e)),this.computeInitial(),t.preventScrollAxis&&Fn(e)!=="mouse"?(r._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,r=this.config;if(!t._pointerActive)return;const s=Zt(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;const o=En(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=ve.sub(o,t._values),this.computeValues(o)),ve.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(r.preventScrollAxis&&!t._preventScroll)if(t.axis)if(t.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{process.env.NODE_ENV==="development"&&console.warn("[@use-gesture]: If you see this message, it's likely that you're using an outdated version of `@react-three/fiber`. \n\nPlease upgrade to the latest version.")}const t=this.state,r=this.config;if(!t._active||!t._pointerActive)return;const s=Zt(e);if(t._pointerId!==void 0&&s!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[o,i]=t._distance;if(t.tap=o<=r.tapsThreshold&&i<=r.tapsThreshold,t.tap&&r.filterTaps)t._force=!0;else{const[c,a]=t._delta,[u,l]=t._movement,[m,f]=r.swipe.velocity,[g,w]=r.swipe.distance,S=r.swipe.duration;if(t.elapsedTime<S){const y=Math.abs(c/t.timeDelta),_=Math.abs(a/t.timeDelta);y>m&&Math.abs(u)>g&&(t.swipe[0]=Math.sign(c)),_>f&&Math.abs(l)>w&&(t.swipe[1]=Math.sign(a))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,r=t.device;if(process.env.NODE_ENV==="development")try{if(r==="pointer"&&t.preventScrollDelay===void 0){const s="uv"in e?e.sourceEvent.currentTarget:e.currentTarget;window.getComputedStyle(s).touchAction==="auto"&&console.warn("[@use-gesture]: The drag target has its `touch-action` style property set to `auto`. It is recommended to add `touch-action: 'none'` so that the drag gesture behaves correctly on touch-enabled devices. For more information read this: https://use-gesture.netlify.app/docs/extras/#touch-action.\n\nThis message will only show in development mode. It won't appear in production. If this is intended, you can ignore it.",s)}}catch{}t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,Jr(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=xn[e.key];if(t){const r=this.state,s=e.shiftKey?10:e.altKey?.1:1;this.start(e),r._delta=t(this.config.keyboardDisplacement,s),r._keyboardActive=!0,ve.addTo(r._movement,r._delta),this.compute(e),this.emit()}}keyUp(e){e.key in xn&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function Jr(n){"persist"in n&&typeof n.persist=="function"&&n.persist()}const Lt=typeof window<"u"&&window.document&&window.document.createElement;function Vn(){return Lt&&"ontouchstart"in window}function Zr(){return Vn()||Lt&&window.navigator.maxTouchPoints>1}function Qr(){return Lt&&"onpointerdown"in window}function es(){return Lt&&"exitPointerLock"in window.document}function ts(){try{return"constructor"in GestureEvent}catch{return!1}}const Re={isBrowser:Lt,gesture:ts(),touch:Vn(),touchscreen:Zr(),pointer:Qr(),pointerLock:es()},ns=250,rs=180,ss=.5,os=50,is=250,cs=10,An={mouse:0,touch:0,pen:8},$n=ee(ee({},Pt),{},{device(n,e,{pointer:{touch:t=!1,lock:r=!1,mouse:s=!1}={}}){return this.pointerLock=r&&Re.pointerLock,Re.touch&&t?"touch":this.pointerLock?"mouse":Re.pointer&&!s?"pointer":Re.touch?"touch":"mouse"},preventScrollAxis(n,e,{preventScroll:t}){if(this.preventScrollDelay=typeof t=="number"?t:t||t===void 0&&n?ns:void 0,!(!Re.touchscreen||t===!1))return n||(t!==void 0?"y":void 0)},pointerCapture(n,e,{pointer:{capture:t=!0,buttons:r=1,keys:s=!0}={}}){return this.pointerButtons=r,this.keys=s,!this.pointerLock&&this.device==="pointer"&&t},threshold(n,e,{filterTaps:t=!1,tapsThreshold:r=3,axis:s=void 0}){const o=ve.toVector(n,t?r:s?1:0);return this.filterTaps=t,this.tapsThreshold=r,o},swipe({velocity:n=ss,distance:e=os,duration:t=is}={}){return{velocity:this.transform(ve.toVector(n)),distance:this.transform(ve.toVector(e)),duration:t}},delay(n=0){switch(n){case!0:return rs;case!1:return 0;default:return n}},axisThreshold(n){return n?ee(ee({},An),n):An},keyboardDisplacement(n=cs){return n}});process.env.NODE_ENV==="development"&&Object.assign($n,{useTouch(n){if(n!==void 0)throw Error("[@use-gesture]: `useTouch` option has been renamed to `pointer.touch`. Use it as in `{ pointer: { touch: true } }`.");return NaN},experimental_preventWindowScrollY(n){if(n!==void 0)throw Error("[@use-gesture]: `experimental_preventWindowScrollY` option has been renamed to `preventScroll`.");return NaN},swipeVelocity(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeVelocity` option has been renamed to `swipe.velocity`. Use it as in `{ swipe: { velocity: 0.5 } }`.");return NaN},swipeDistance(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeDistance` option has been renamed to `swipe.distance`. Use it as in `{ swipe: { distance: 50 } }`.");return NaN},swipeDuration(n){if(n!==void 0)throw Error("[@use-gesture]: `swipeDuration` option has been renamed to `swipe.duration`. Use it as in `{ swipe: { duration: 250 } }`.");return NaN}});ee(ee({},sn),{},{device(n,e,{shared:t,pointer:{touch:r=!1}={}}){if(t.target&&!Re.touch&&Re.gesture)return"gesture";if(Re.touch&&r)return"touch";if(Re.touchscreen){if(Re.pointer)return"pointer";if(Re.touch)return"touch"}},bounds(n,e,{scaleBounds:t={},angleBounds:r={}}){const s=i=>{const c=yn(Vt(t,i),{min:-1/0,max:1/0});return[c.min,c.max]},o=i=>{const c=yn(Vt(r,i),{min:-1/0,max:1/0});return[c.min,c.max]};return typeof t!="function"&&typeof r!="function"?[s(),o()]:i=>[s(i),o(i)]},threshold(n,e,t){return this.lockDirection=t.axis==="lock",ve.toVector(n,this.lockDirection?[.1,3]:0)},modifierKey(n){return n===void 0?"ctrlKey":n},pinchOnWheel(n=!0){return n}});ee(ee({},Pt),{},{mouseOnly:(n=!0)=>n});ee(ee({},Pt),{},{mouseOnly:(n=!0)=>n});const Hn=new Map,nn=new Map;function as(n){Hn.set(n.key,n.engine),nn.set(n.key,n.resolver)}const ls={key:"drag",engine:Kr,resolver:$n};function us(n,e){if(n==null)return{};var t={},r=Object.keys(n),s,o;for(o=0;o<r.length;o++)s=r[o],!(e.indexOf(s)>=0)&&(t[s]=n[s]);return t}function fs(n,e){if(n==null)return{};var t=us(n,e),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}const ds={target(n){if(n)return()=>"current"in n?n.current:n},enabled(n=!0){return n},window(n=Re.isBrowser?window:void 0){return n},eventOptions({passive:n=!0,capture:e=!1}={}){return{passive:n,capture:e}},transform(n){return n}},hs=["target","eventOptions","window","enabled","transform"];function zt(n={},e){const t={};for(const[r,s]of Object.entries(e))switch(typeof s){case"function":if(process.env.NODE_ENV==="development"){const o=s.call(t,n[r],r,n);Number.isNaN(o)||(t[r]=o)}else t[r]=s.call(t,n[r],r,n);break;case"object":t[r]=zt(n[r],s);break;case"boolean":s&&(t[r]=n[r]);break}return t}function ms(n,e,t={}){const r=n,{target:s,eventOptions:o,window:i,enabled:c,transform:a}=r,u=fs(r,hs);if(t.shared=zt({target:s,eventOptions:o,window:i,enabled:c,transform:a},ds),e){const l=nn.get(e);t[e]=zt(ee({shared:t.shared},u),l)}else for(const l in u){const m=nn.get(l);if(m)t[l]=zt(ee({shared:t.shared},u[l]),m);else if(process.env.NODE_ENV==="development"&&!["drag","pinch","scroll","wheel","move","hover"].includes(l)){if(l==="domTarget")throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");console.warn(`[@use-gesture]: Unknown config key \`${l}\` was used. Please read the documentation for further information.`)}}return t}class Bn{constructor(e,t){we(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,r,s,o){const i=this._listeners,c=zr(t,r),a=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},u=ee(ee({},a),o);e.addEventListener(c,s,u);const l=()=>{e.removeEventListener(c,s,u),i.delete(l)};return i.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class ps{constructor(){we(this,"_timeouts",new Map)}add(e,t,r=140,...s){this.remove(e),this._timeouts.set(e,window.setTimeout(t,r,...s))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class gs{constructor(e){we(this,"gestures",new Set),we(this,"_targetEventStore",new Bn(this)),we(this,"gestureEventStores",{}),we(this,"gestureTimeoutStores",{}),we(this,"handlers",{}),we(this,"config",{}),we(this,"pointerIds",new Set),we(this,"touchIds",new Set),we(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),vs(this,e)}setEventIds(e){if(Bt(e))return this.touchIds=new Set(Ur(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=ms(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,r={};let s;if(!(t.target&&(s=t.target(),!s))){if(t.enabled){for(const i of this.gestures){const c=this.config[i],a=Cn(r,c.eventOptions,!!s);if(c.enabled){const u=Hn.get(i);new u(this,e,i).bind(a)}}const o=Cn(r,t.eventOptions,!!s);for(const i in this.nativeHandlers)o(i,"",c=>this.nativeHandlers[i](ee(ee({},this.state.shared),{},{event:c,args:e})),void 0,!0)}for(const o in r)r[o]=Hr(...r[o]);if(!s)return r;for(const o in r){const{device:i,capture:c,passive:a}=Wr(o);this._targetEventStore.add(s,i,"",r[o],{capture:c,passive:a})}}}}function Et(n,e){n.gestures.add(e),n.gestureEventStores[e]=new Bn(n,e),n.gestureTimeoutStores[e]=new ps}function vs(n,e){e.drag&&Et(n,"drag"),e.wheel&&Et(n,"wheel"),e.scroll&&Et(n,"scroll"),e.move&&Et(n,"move"),e.pinch&&Et(n,"pinch"),e.hover&&Et(n,"hover")}const Cn=(n,e,t)=>(r,s,o,i={},c=!1)=>{var a,u;const l=(a=i.capture)!==null&&a!==void 0?a:e.capture,m=(u=i.passive)!==null&&u!==void 0?u:e.passive;let f=c?r:Ir(r,s,l);t&&m&&(f+="Passive"),n[f]=n[f]||[],n[f].push(o)};function bs(n,e={},t,r){const s=L.useMemo(()=>new gs(n),[]);if(s.applyHandlers(n,r),s.applyConfig(e,t),L.useEffect(s.effect.bind(s)),L.useEffect(()=>s.clean.bind(s),[]),e.target===void 0)return s.bind.bind(s)}function Qt(n,e){return as(ls),bs({drag:n},e||{},"drag")}function Pn(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function Xn(...n){return e=>{let t=!1;const r=n.map(s=>{const o=Pn(s,e);return!t&&typeof o=="function"&&(t=!0),o});if(t)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():Pn(n[s],null)}}}}function nt(...n){return b.useCallback(Xn(...n),n)}function Yn(n){const e=_s(n),t=b.forwardRef((r,s)=>{const{children:o,...i}=r,c=b.Children.toArray(o),a=c.find(Es);if(a){const u=a.props.children,l=c.map(m=>m===a?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:m);return T.jsx(e,{...i,ref:s,children:b.isValidElement(u)?b.cloneElement(u,void 0,l):null})}return T.jsx(e,{...i,ref:s,children:o})});return t.displayName=`${n}.Slot`,t}var Ss=Yn("Slot");function _s(n){const e=b.forwardRef((t,r)=>{const{children:s,...o}=t;if(b.isValidElement(s)){const i=Ts(s),c=ys(o,s.props);return s.type!==b.Fragment&&(c.ref=r?Xn(r,i):i),b.cloneElement(s,c)}return b.Children.count(s)>1?b.Children.only(null):null});return e.displayName=`${n}.SlotClone`,e}var ws=Symbol("radix.slottable");function Es(n){return b.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===ws}function ys(n,e){const t={...e};for(const r in e){const s=n[r],o=e[r];/^on[A-Z]/.test(r)?s&&o?t[r]=(...c)=>{const a=o(...c);return s(...c),a}:s&&(t[r]=s):r==="style"?t[r]={...s,...o}:r==="className"&&(t[r]=[s,o].filter(Boolean).join(" "))}return{...n,...t}}function Ts(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var Rs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Dt=Rs.reduce((n,e)=>{const t=Yn(`Primitive.${e}`),r=b.forwardRef((s,o)=>{const{asChild:i,...c}=s,a=i?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(a,{...c,ref:o})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{});function xs(n,e=[]){let t=[];function r(o,i){const c=b.createContext(i),a=t.length;t=[...t,i];const u=m=>{const{scope:f,children:g,...w}=m,S=f?.[n]?.[a]||c,y=b.useMemo(()=>w,Object.values(w));return T.jsx(S.Provider,{value:y,children:g})};u.displayName=o+"Provider";function l(m,f){const g=f?.[n]?.[a]||c,w=b.useContext(g);if(w)return w;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[u,l]}const s=()=>{const o=t.map(i=>b.createContext(i));return function(c){const a=c?.[n]||o;return b.useMemo(()=>({[`__scope${n}`]:{...c,[n]:a}}),[c,a])}};return s.scopeName=n,[r,As(s,...e)]}function As(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((c,{useScope:a,scopeName:u})=>{const m=a(o)[`__scope${u}`];return{...c,...m}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:i}),[i])}};return t.scopeName=e.scopeName,t}function tt(n,e,{checkForDefaultPrevented:t=!0}={}){return function(s){if(n?.(s),t===!1||!s.defaultPrevented)return e?.(s)}}var rn=globalThis?.document?b.useLayoutEffect:()=>{};function Cs(n,e){return b.useReducer((t,r)=>e[t][r]??t,n)}var Ot=n=>{const{present:e,children:t}=n,r=Ps(e),s=typeof t=="function"?t({present:r.isPresent}):b.Children.only(t),o=nt(r.ref,Ls(s));return typeof t=="function"||r.isPresent?b.cloneElement(s,{ref:o}):null};Ot.displayName="Presence";function Ps(n){const[e,t]=b.useState(),r=b.useRef(null),s=b.useRef(n),o=b.useRef("none"),i=n?"mounted":"unmounted",[c,a]=Cs(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=Wt(r.current);o.current=c==="mounted"?u:"none"},[c]),rn(()=>{const u=r.current,l=s.current;if(l!==n){const f=o.current,g=Wt(u);n?a("MOUNT"):g==="none"||u?.display==="none"?a("UNMOUNT"):a(l&&f!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=n}},[n,a]),rn(()=>{if(e){let u;const l=e.ownerDocument.defaultView??window,m=g=>{const S=Wt(r.current).includes(CSS.escape(g.animationName));if(g.target===e&&S&&(a("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=l.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},f=g=>{g.target===e&&(o.current=Wt(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{l.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else a("ANIMATION_END")},[e,a]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:b.useCallback(u=>{r.current=u?getComputedStyle(u):null,t(u)},[])}}function Wt(n){return n?.animationName||"none"}function Ls(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}var Ds=b.createContext(void 0);function Os(n){const e=b.useContext(Ds);return n||e||"ltr"}function et(n){const e=b.useRef(n);return b.useEffect(()=>{e.current=n}),b.useMemo(()=>(...t)=>e.current?.(...t),[])}function Ms(n,[e,t]){return Math.min(t,Math.max(e,n))}function Ns(n,e){return b.useReducer((t,r)=>e[t][r]??t,n)}var on="ScrollArea",[Gn]=xs(on),[Is,xe]=Gn(on),qn=b.forwardRef((n,e)=>{const{__scopeScrollArea:t,type:r="hover",dir:s,scrollHideDelay:o=600,...i}=n,[c,a]=b.useState(null),[u,l]=b.useState(null),[m,f]=b.useState(null),[g,w]=b.useState(null),[S,y]=b.useState(null),[_,h]=b.useState(0),[p,v]=b.useState(0),[R,E]=b.useState(!1),[C,z]=b.useState(!1),D=nt(e,H=>a(H)),j=Os(s);return T.jsx(Is,{scope:t,type:r,dir:j,scrollHideDelay:o,scrollArea:c,viewport:u,onViewportChange:l,content:m,onContentChange:f,scrollbarX:g,onScrollbarXChange:w,scrollbarXEnabled:R,onScrollbarXEnabledChange:E,scrollbarY:S,onScrollbarYChange:y,scrollbarYEnabled:C,onScrollbarYEnabledChange:z,onCornerWidthChange:h,onCornerHeightChange:v,children:T.jsx(Dt.div,{dir:j,...i,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":_+"px","--radix-scroll-area-corner-height":p+"px",...n.style}})})});qn.displayName=on;var Kn="ScrollAreaViewport",Jn=b.forwardRef((n,e)=>{const{__scopeScrollArea:t,children:r,nonce:s,...o}=n,i=xe(Kn,t),c=b.useRef(null),a=nt(e,c,i.onViewportChange);return T.jsxs(T.Fragment,{children:[T.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),T.jsx(Dt.div,{"data-radix-scroll-area-viewport":"",...o,ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...n.style},children:T.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Jn.displayName=Kn;var Me="ScrollAreaScrollbar",Zn=b.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=xe(Me,n.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,c=n.orientation==="horizontal";return b.useEffect(()=>(c?o(!0):i(!0),()=>{c?o(!1):i(!1)}),[c,o,i]),s.type==="hover"?T.jsx(ks,{...r,ref:e,forceMount:t}):s.type==="scroll"?T.jsx(Ws,{...r,ref:e,forceMount:t}):s.type==="auto"?T.jsx(Qn,{...r,ref:e,forceMount:t}):s.type==="always"?T.jsx(cn,{...r,ref:e}):null});Zn.displayName=Me;var ks=b.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=xe(Me,n.__scopeScrollArea),[o,i]=b.useState(!1);return b.useEffect(()=>{const c=s.scrollArea;let a=0;if(c){const u=()=>{window.clearTimeout(a),i(!0)},l=()=>{a=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",l),()=>{window.clearTimeout(a),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",l)}}},[s.scrollArea,s.scrollHideDelay]),T.jsx(Ot,{present:t||o,children:T.jsx(Qn,{"data-state":o?"visible":"hidden",...r,ref:e})})}),Ws=b.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=xe(Me,n.__scopeScrollArea),o=n.orientation==="horizontal",i=Yt(()=>a("SCROLL_END"),100),[c,a]=Ns("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>a("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,s.scrollHideDelay,a]),b.useEffect(()=>{const u=s.viewport,l=o?"scrollLeft":"scrollTop";if(u){let m=u[l];const f=()=>{const g=u[l];m!==g&&(a("SCROLL"),i()),m=g};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[s.viewport,o,a,i]),T.jsx(Ot,{present:t||c!=="hidden",children:T.jsx(cn,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:tt(n.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:tt(n.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),Qn=b.forwardRef((n,e)=>{const t=xe(Me,n.__scopeScrollArea),{forceMount:r,...s}=n,[o,i]=b.useState(!1),c=n.orientation==="horizontal",a=Yt(()=>{if(t.viewport){const u=t.viewport.offsetWidth<t.viewport.scrollWidth,l=t.viewport.offsetHeight<t.viewport.scrollHeight;i(c?u:l)}},10);return Rt(t.viewport,a),Rt(t.content,a),T.jsx(Ot,{present:r||o,children:T.jsx(cn,{"data-state":o?"visible":"hidden",...s,ref:e})})}),cn=b.forwardRef((n,e)=>{const{orientation:t="vertical",...r}=n,s=xe(Me,n.__scopeScrollArea),o=b.useRef(null),i=b.useRef(0),[c,a]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=sr(c.viewport,c.content),l={...r,sizes:c,onSizesChange:a,hasThumb:u>0&&u<1,onThumbChange:f=>o.current=f,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:f=>i.current=f};function m(f,g){return $s(f,i.current,c,g)}return t==="horizontal"?T.jsx(zs,{...l,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollLeft,g=Ln(f,c,s.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollLeft=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollLeft=m(f,s.dir))}}):t==="vertical"?T.jsx(js,{...l,ref:e,onThumbPositionChange:()=>{if(s.viewport&&o.current){const f=s.viewport.scrollTop,g=Ln(f,c);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:f=>{s.viewport&&(s.viewport.scrollTop=f)},onDragScroll:f=>{s.viewport&&(s.viewport.scrollTop=m(f))}}):null}),zs=b.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=xe(Me,n.__scopeScrollArea),[i,c]=b.useState(),a=b.useRef(null),u=nt(e,a,o.onScrollbarXChange);return b.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),T.jsx(tr,{"data-orientation":"horizontal",...s,ref:u,sizes:t,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Xt(t)+"px",...n.style},onThumbPointerDown:l=>n.onThumbPointerDown(l.x),onDragScroll:l=>n.onDragScroll(l.x),onWheelScroll:(l,m)=>{if(o.viewport){const f=o.viewport.scrollLeft+l.deltaX;n.onWheelScroll(f),ir(f,m)&&l.preventDefault()}},onResize:()=>{a.current&&o.viewport&&i&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:Ht(i.paddingLeft),paddingEnd:Ht(i.paddingRight)}})}})}),js=b.forwardRef((n,e)=>{const{sizes:t,onSizesChange:r,...s}=n,o=xe(Me,n.__scopeScrollArea),[i,c]=b.useState(),a=b.useRef(null),u=nt(e,a,o.onScrollbarYChange);return b.useEffect(()=>{a.current&&c(getComputedStyle(a.current))},[a]),T.jsx(tr,{"data-orientation":"vertical",...s,ref:u,sizes:t,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Xt(t)+"px",...n.style},onThumbPointerDown:l=>n.onThumbPointerDown(l.y),onDragScroll:l=>n.onDragScroll(l.y),onWheelScroll:(l,m)=>{if(o.viewport){const f=o.viewport.scrollTop+l.deltaY;n.onWheelScroll(f),ir(f,m)&&l.preventDefault()}},onResize:()=>{a.current&&o.viewport&&i&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:Ht(i.paddingTop),paddingEnd:Ht(i.paddingBottom)}})}})}),[Fs,er]=Gn(Me),tr=b.forwardRef((n,e)=>{const{__scopeScrollArea:t,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:c,onThumbPositionChange:a,onDragScroll:u,onWheelScroll:l,onResize:m,...f}=n,g=xe(Me,t),[w,S]=b.useState(null),y=nt(e,D=>S(D)),_=b.useRef(null),h=b.useRef(""),p=g.viewport,v=r.content-r.viewport,R=et(l),E=et(a),C=Yt(m,10);function z(D){if(_.current){const j=D.clientX-_.current.left,H=D.clientY-_.current.top;u({x:j,y:H})}}return b.useEffect(()=>{const D=j=>{const H=j.target;w?.contains(H)&&R(j,v)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[p,w,v,R]),b.useEffect(E,[r,E]),Rt(w,C),Rt(g.content,C),T.jsx(Fs,{scope:t,scrollbar:w,hasThumb:s,onThumbChange:et(o),onThumbPointerUp:et(i),onThumbPositionChange:E,onThumbPointerDown:et(c),children:T.jsx(Dt.div,{...f,ref:y,style:{position:"absolute",...f.style},onPointerDown:tt(n.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),_.current=w.getBoundingClientRect(),h.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),z(D))}),onPointerMove:tt(n.onPointerMove,z),onPointerUp:tt(n.onPointerUp,D=>{const j=D.target;j.hasPointerCapture(D.pointerId)&&j.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=h.current,g.viewport&&(g.viewport.style.scrollBehavior=""),_.current=null})})})}),$t="ScrollAreaThumb",nr=b.forwardRef((n,e)=>{const{forceMount:t,...r}=n,s=er($t,n.__scopeScrollArea);return T.jsx(Ot,{present:t||s.hasThumb,children:T.jsx(Us,{ref:e,...r})})}),Us=b.forwardRef((n,e)=>{const{__scopeScrollArea:t,style:r,...s}=n,o=xe($t,t),i=er($t,t),{onThumbPositionChange:c}=i,a=nt(e,m=>i.onThumbChange(m)),u=b.useRef(void 0),l=Yt(()=>{u.current&&(u.current(),u.current=void 0)},100);return b.useEffect(()=>{const m=o.viewport;if(m){const f=()=>{if(l(),!u.current){const g=Hs(m,c);u.current=g,c()}};return c(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[o.viewport,l,c]),T.jsx(Dt.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:tt(n.onPointerDownCapture,m=>{const g=m.target.getBoundingClientRect(),w=m.clientX-g.left,S=m.clientY-g.top;i.onThumbPointerDown({x:w,y:S})}),onPointerUp:tt(n.onPointerUp,i.onThumbPointerUp)})});nr.displayName=$t;var an="ScrollAreaCorner",rr=b.forwardRef((n,e)=>{const t=xe(an,n.__scopeScrollArea),r=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&r?T.jsx(Vs,{...n,ref:e}):null});rr.displayName=an;var Vs=b.forwardRef((n,e)=>{const{__scopeScrollArea:t,...r}=n,s=xe(an,t),[o,i]=b.useState(0),[c,a]=b.useState(0),u=!!(o&&c);return Rt(s.scrollbarX,()=>{const l=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(l),a(l)}),Rt(s.scrollbarY,()=>{const l=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(l),i(l)}),u?T.jsx(Dt.div,{...r,ref:e,style:{width:o,height:c,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...n.style}}):null});function Ht(n){return n?parseInt(n,10):0}function sr(n,e){const t=n/e;return isNaN(t)?0:t}function Xt(n){const e=sr(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}function $s(n,e,t,r="ltr"){const s=Xt(t),o=s/2,i=e||o,c=s-i,a=t.scrollbar.paddingStart+i,u=t.scrollbar.size-t.scrollbar.paddingEnd-c,l=t.content-t.viewport,m=r==="ltr"?[0,l]:[l*-1,0];return or([a,u],m)(n)}function Ln(n,e,t="ltr"){const r=Xt(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-s,i=e.content-e.viewport,c=o-r,a=t==="ltr"?[0,i]:[i*-1,0],u=Ms(n,a);return or([0,i],[0,c])(u)}function or(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}function ir(n,e){return n>0&&n<e}var Hs=(n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},r=0;return(function s(){const o={left:n.scrollLeft,top:n.scrollTop},i=t.left!==o.left,c=t.top!==o.top;(i||c)&&e(),t=o,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function Yt(n,e){const t=et(n),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}function Rt(n,e){const t=et(e);rn(()=>{let r=0;if(n){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)});return s.observe(n),()=>{window.cancelAnimationFrame(r),s.unobserve(n)}}},[n,t])}var Bs=qn,Xs=Jn,Ys=rr;const en=(n,e,t,r,s)=>({target:n,dx:e[0],dy:e[1],clientX:t[0],clientY:t[1],...r&&{edges:r},...s&&{deltaRect:s}}),Gs=(n,e,t)=>n?n===e||n===t||(e?.contains(n)??!1)||(t?.contains(n)??!1):!1,qs=n=>{const e=Oe.c(34),{children:t,style:r,draggable:s,resizable:o,draggableOptions:i,resizableOptions:c,ref:a}=n,u=L.useRef(void 0),l=L.useRef(void 0),m=L.useRef(null),f=L.useRef(null),g=L.useRef(void 0),w=L.useRef(void 0);let S,y;e[0]!==i||e[1]!==a||e[2]!==c?(S=()=>{if(u.current=i,l.current=c,!a?.current)return;const P=c?.edges?.left,I=c?.edges?.right;P&&P!==g.current&&(g.current=P,m.current=a.current.querySelector(P)),I&&I!==w.current&&(w.current=I,f.current=a.current.querySelector(I))},y=[i,a,c],e[0]=i,e[1]=a,e[2]=c,e[3]=S,e[4]=y):(S=e[3],y=e[4]),L.useEffect(S,y);let _;e[5]!==a?(_=P=>{const{active:I,delta:J,xy:Z,event:Q,first:d,last:x}=P,M=a?.current;if(!M||Gs(Q?.target,m.current,f.current))return;const $=en(M,J,Z);d?u.current?.onstart?.($):x?u.current?.onend?.($):I&&u.current?.onmove?.($)},e[5]=a,e[6]=_):_=e[6];const h=i?.lockAxis==="x"?"x":void 0;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={capture:!0},e[7]=p):p=e[7];let v;e[8]!==s||e[9]!==a||e[10]!==h?(v={enabled:s,axis:h,pointer:p,target:a,threshold:0},e[8]=s,e[9]=a,e[10]=h,e[11]=v):v=e[11],Qt(_,v);let R;e[12]!==a?(R=P=>{const{active:I,delta:J,xy:Z,first:Q,last:d}=P,x=a?.current;if(!x)return;const M=en(x,J,Z,{left:!0},{left:J[0]});Q?l.current?.onstart?.(M):d?l.current?.onend?.(M):I&&l.current?.onmove?.(M)},e[12]=a,e[13]=R):R=e[13];let E;e[14]===Symbol.for("react.memo_cache_sentinel")?(E={capture:!0},e[14]=E):E=e[14];let C;e[15]!==o?(C={enabled:o,target:m,pointer:E,threshold:0},e[15]=o,e[16]=C):C=e[16],Qt(R,C);let z;e[17]!==a?(z=P=>{const{active:I,delta:J,xy:Z,first:Q,last:d}=P,x=a?.current;if(!x)return;const M=en(x,J,Z,{right:!0},{right:J[0]});Q?l.current?.onstart?.(M):d?l.current?.onend?.(M):I&&l.current?.onmove?.(M)},e[17]=a,e[18]=z):z=e[18];let D;e[19]===Symbol.for("react.memo_cache_sentinel")?(D={capture:!0},e[19]=D):D=e[19];let j;e[20]!==o?(j={enabled:o,target:f,pointer:D,threshold:0},e[20]=o,e[21]=j):j=e[21],Qt(z,j);let H,te;e[22]!==a?(H=()=>{const P=a?.current;if(!P)return;const I=l.current?.edges?.left,J=l.current?.edges?.right;I&&(m.current=P.querySelector(I)),J&&(f.current=P.querySelector(J))},te=[a],e[22]=a,e[23]=H,e[24]=te):(H=e[23],te=e[24]),L.useLayoutEffect(H,te);let B;e[25]!==s?(B=s?{touchAction:"none"}:{},e[25]=s,e[26]=B):B=e[26];let re;e[27]!==r||e[28]!==B?(re={...B,...r},e[27]=r,e[28]=B,e[29]=re):re=e[29];let q;return e[30]!==t||e[31]!==a||e[32]!==re?(q=T.jsx(Ss,{ref:a,style:re,draggable:!1,children:t}),e[30]=t,e[31]=a,e[32]=re,e[33]=q):q=e[33],q},_e=(n,e=0)=>n?parseFloat(n):e,tn=(n,e,t,r=Number.MAX_SAFE_INTEGER)=>{let s=n,o=r;for(const i of e){const c=Math.abs(i-n);c<t&&c<o&&(s=i,o=c)}return{snap:s,minDis:o}},cr=L.forwardRef((n,e)=>{const t=Oe.c(68),{children:r,edges:s,left:o,width:i,start:c,grid:a,getBounds:u,enableResizing:l,enableDragging:m,snapDistance:f,snapPositions:g,onResizeStart:w,onResize:S,onResizeEnd:y,onDragStart:_,onDragEnd:h,onDrag:p,parentRef:v,autoScroll:R}=n,E=c===void 0?A.DEFAULT_START_LEFT:c,C=a===void 0?A.DEFAULT_MOVE_GRID:a,z=u===void 0?Ks:u,D=l===void 0?!0:l,j=m===void 0?!0:m,H=f===void 0?A.DEFAULT_SNAP_DISTANCE:f;let te;t[0]!==g?(te=g===void 0?[]:g,t[0]=g,t[1]=te):te=t[1];const B=te,re=R===void 0?!0:R,q=L.useRef(null),P=L.useRef(0),I=L.useRef(!1),{initAutoScroll:J,stopAutoScroll:Z,dealDragAutoScroll:Q,dealResizeAutoScroll:d}=Cr(v);let x;t[2]===Symbol.for("react.memo_cache_sentinel")?(x=(V,K)=>{const X=K===void 0?!0:K;if(!q.current)return;X&&(P.current=0);const Y=q.current;Y.style.setProperty("--translate-x",`${V}px`),Y.dataset.left=String(V)},t[2]=x):x=t[2];const M=x;let $;t[3]===Symbol.for("react.memo_cache_sentinel")?($=(V,K)=>{const X=K===void 0?!0:K;if(!q.current)return;X&&(P.current=0);const Y=q.current;Y.style.width=`${V}px`,Y.dataset.width=String(V)},t[3]=$):$=t[3];const fe=$;let k;t[4]===Symbol.for("react.memo_cache_sentinel")?(k=()=>q.current?_e(q.current.dataset.left):0,t[4]=k):k=t[4];const U=k;let N;t[5]===Symbol.for("react.memo_cache_sentinel")?(N=()=>q.current?_e(q.current.dataset.width):0,t[5]=N):N=t[5];const W=N;let O,Ne;t[6]!==i?(O=()=>{if(!q.current)return;const V=q.current;fe(typeof i>"u"?V.offsetWidth:i,!1)},Ne=[i],t[6]=i,t[7]=O,t[8]=Ne):(O=t[7],Ne=t[8]),L.useEffect(O,Ne);let Ae,ne;t[9]!==o?(Ae=()=>{M(o||0,!1)},ne=[o],t[9]=o,t[10]=Ae,t[11]=ne):(Ae=t[10],ne=t[11]),L.useEffect(Ae,ne);let se;t[12]===Symbol.for("react.memo_cache_sentinel")?(se=()=>({updateLeft:V=>M(V||0,!1),updateWidth:V=>fe(V,!1),getLeft:U,getWidth:W}),t[12]=se):se=t[12],L.useImperativeHandle(e,se);let Ee;t[13]!==J||t[14]!==_?(Ee=()=>{P.current=0,I.current=!1,J(),_?.()},t[13]=J,t[14]=_,t[15]=Ee):Ee=t[15];const Fe=Ee;let Ie;t[16]!==z||t[17]!==C||t[18]!==p||t[19]!==H||t[20]!==B||t[21]!==E?(Ie=V=>{const{preLeft:K,preWidth:X,scrollDelta:Y}=V;Y&&(P.current=P.current+Y);const me=I.current?H:C;if(Math.abs(P.current)<me)return;const ae=Math.trunc(P.current/me);let G=K+ae*me;const oe=P.current>0,F=oe?G+X:G,{snap:le}=tn(F,B,H);if(le!==F)I.current=!0,G=oe?le-X:le;else{const de=G-E;de%C!==0&&(G=E+C*Math.round(de/C)),I.current=!1}P.current=P.current%me;const ie=z();G<ie.left?G=ie.left:G+X>ie.right&&(G=ie.right-X),!(p&&p({lastLeft:K,left:G,lastWidth:X,width:X},Y)===!1)&&M(G,!1)},t[16]=z,t[17]=C,t[18]=p,t[19]=H,t[20]=B,t[21]=E,t[22]=Ie):Ie=t[22];const Pe=Ie;let ke;t[23]!==re||t[24]!==Q||t[25]!==Pe||t[26]!==v?(ke=V=>{const K=V.target,X=_e(K.dataset.left),Y=_e(K.dataset.width);P.current=P.current+V.dx,!(re&&v?.current&&!Q(V,G=>{if(!v?.current||!q.current)return;v.current.scrollLeft=v.current.scrollLeft+G;const oe=q.current,F=_e(oe.dataset.left),le=_e(oe.dataset.width);Pe({preLeft:F,preWidth:le,scrollDelta:G})}))&&Pe({preLeft:X,preWidth:Y})},t[23]=re,t[24]=Q,t[25]=Pe,t[26]=v,t[27]=ke):ke=t[27];const xt=ke;let rt;t[28]!==h||t[29]!==Z?(rt=V=>{P.current=0,I.current=!1,Z();const K=V.target;h?.({left:_e(K.dataset.left),width:_e(K.dataset.width)})},t[28]=h,t[29]=Z,t[30]=rt):rt=t[30];const Ue=rt;let ye;t[31]!==J||t[32]!==w?(ye=V=>{P.current=0,I.current=!1,J();const K=V.edges?.right?"right":"left";w?.(K)},t[31]=J,t[32]=w,t[33]=ye):ye=t[33];const Ve=ye;let We;t[34]!==z||t[35]!==C||t[36]!==S||t[37]!==H||t[38]!==B||t[39]!==E?(We=V=>{const{dir:K,preWidth:X,preLeft:Y,scrollDelta:me}=V;me&&(P.current=P.current+me);const ae=I.current?H:C;if(Math.abs(P.current)<ae)return;const G=z();if(K==="left"){const oe=Math.trunc(P.current/ae);let F=Y+oe*ae;const{snap:le}=tn(F,B,H);if(le!==F)I.current=!0,F=le;else{const Te=F-E;Te%C!==0&&(F=E+C*Math.round(Te/C)),I.current=!1}P.current=P.current%ae,F<G.left&&(F=G.left);const ie=Y+X,de=ie-F;if(F>=ie||S&&S("left",{lastLeft:Y,lastWidth:X,left:F,width:de})===!1)return;M(F,!1),fe(de,!1)}else{const oe=Math.trunc(P.current/ae);let F=X+oe*ae;const le=Y+F,{snap:ie}=tn(le,B,H);if(ie!==le)I.current=!0,F=ie-Y;else{let de=Y+F;const Te=de-E;Te%C!==0&&(de=E+C*Math.round(Te/C),F=de-Y),I.current=!1}if(P.current=P.current%ae,Y+F>G.right&&(F=G.right-Y),F<=0||S&&S("right",{lastLeft:Y,lastWidth:X,left:Y,width:F})===!1)return;fe(F,!1)}},t[34]=z,t[35]=C,t[36]=S,t[37]=H,t[38]=B,t[39]=E,t[40]=We):We=t[40];const $e=We;let ze;t[41]!==re||t[42]!==d||t[43]!==v||t[44]!==$e?(ze=V=>{const K=V.target,X=V.edges?.left?"left":"right",Y=_e(K.dataset.left),me=_e(K.dataset.width);P.current=P.current+(X==="left"?V.deltaRect?.left||0:V.deltaRect?.right||0),!(re&&v?.current&&!d(V,X,oe=>{if(!v?.current||!q.current)return;v.current.scrollLeft=v.current.scrollLeft+oe;const F=q.current,le=_e(F.dataset.left),ie=_e(F.dataset.width);$e({preLeft:le,preWidth:ie,dir:X,scrollDelta:oe})}))&&$e({preLeft:Y,preWidth:me,dir:X})},t[41]=re,t[42]=d,t[43]=v,t[44]=$e,t[45]=ze):ze=t[45];const Le=ze;let je;t[46]!==y||t[47]!==Z?(je=V=>{P.current=0,I.current=!1,Z();const K=V.target,X=V.edges?.right?"right":"left";y?.(X,{left:_e(K.dataset.left),width:_e(K.dataset.width)})},t[46]=y,t[47]=Z,t[48]=je):je=t[48];const Ze=je,He=`${o||0}px`;let Be;t[49]!==He||t[50]!==i?(Be={"--translate-x":He,transform:"translateX(var(--translate-x)) scaleX(var(--scale-x,1))",width:i},t[49]=He,t[50]=i,t[51]=Be):Be=t[51];const Xe=Be;let De;t[52]!==xt||t[53]!==Fe||t[54]!==Ue?(De={lockAxis:"x",onmove:xt,onstart:Fe,onend:Ue,cursorChecker:Js},t[52]=xt,t[53]=Fe,t[54]=Ue,t[55]=De):De=t[55];let Ce;t[56]!==s||t[57]!==Le||t[58]!==Ve||t[59]!==Ze?(Ce={axis:"x",invert:"none",edges:s,onmove:Le,onstart:Ve,onend:Ze},t[56]=s,t[57]=Le,t[58]=Ve,t[59]=Ze,t[60]=Ce):Ce=t[60];let Ye;return t[61]!==r||t[62]!==j||t[63]!==D||t[64]!==Xe||t[65]!==De||t[66]!==Ce?(Ye=T.jsx(qs,{style:Xe,ref:q,draggable:j,resizable:D,draggableOptions:De,resizableOptions:Ce,children:r}),t[61]=r,t[62]=j,t[63]=D,t[64]=Xe,t[65]=De,t[66]=Ce,t[67]=Ye):Ye=t[67],Ye});function Ks(){return{left:Number.MIN_SAFE_INTEGER,right:Number.MAX_SAFE_INTEGER}}function Js(){return""}function Zs(){let n=0,e,t="",r=arguments.length;for(;n<r;n++)(e=arguments[n])&&typeof e=="string"&&(t+=(t&&" ")+e);return t}const Qs=n=>{const e=Oe.c(191),{editorData:t,row:r,action:s,effects:o,rowHeight:i,scale:c,scaleWidth:a,scaleSplitCount:u,startLeft:l,gridSnap:m,disableDrag:f,scaleCount:g,maxScaleCount:w,setScaleCount:S,onActionMoveStart:y,onActionMoving:_,onActionMoveEnd:h,onActionResizeStart:p,onActionResizeEnd:v,onActionResizing:R,snapData:E,setEditorData:C,onClickAction:z,onClickActionOnly:D,onDoubleClickAction:j,onContextMenuAction:H,getActionRender:te,handleTime:B,scrollContainerRef:re}=n,q=L.useRef(null),P=L.useRef(!1),{id:I,maxEnd:J,minStart:Z,end:Q,start:d,selected:x,flexible:M,movable:$,effectId:fe}=s,k=M===void 0?!0:M,U=$===void 0?!0:$,N=c??A.DEFAULT_SCALE,W=a??A.DEFAULT_SCALE_WIDTH,O=l??A.DEFAULT_START_LEFT,Ne=u??A.DEFAULT_SCALE_SPLIT_COUNT,Ae=w??Number.MAX_SAFE_INTEGER,ne=Z||0;let se;e[0]!==N||e[1]!==W||e[2]!==O||e[3]!==ne?(se=A.parserTimeToPixel(ne,{startLeft:O,scale:N,scaleWidth:W}),e[0]=N,e[1]=W,e[2]=O,e[3]=ne,e[4]=se):se=e[4];const Ee=se,Fe=J||Number.MAX_VALUE;let Ie;e[5]!==N||e[6]!==W||e[7]!==O||e[8]!==Fe?(Ie=A.parserTimeToPixel(Fe,{startLeft:O,scale:N,scaleWidth:W}),e[5]=N,e[6]=W,e[7]=O,e[8]=Fe,e[9]=Ie):Ie=e[9];const Pe=Math.min(Ae*W+O,Ie);let ke;e[10]!==Q||e[11]!==N||e[12]!==W||e[13]!==O||e[14]!==d?(ke=A.parserTimeToTransform({start:d,end:Q},{startLeft:O,scale:N,scaleWidth:W}),e[10]=Q,e[11]=N,e[12]=W,e[13]=O,e[14]=d,e[15]=ke):ke=e[15];const xt=ke,[rt,Ue]=L.useState(null),ye=rt??xt,Ve=W/Ne;let We;e[16]!==fe||e[17]!==o||e[18]!==k||e[19]!==U||e[20]!==x?(We=ge(Zs("action",U&&"action-movable",x&&"action-selected",k&&"action-flexible",o[fe]&&`action-effect-${fe}`)),e[16]=fe,e[17]=o,e[18]=k,e[19]=U,e[20]=x,e[21]=We):We=e[21];const $e=We;let ze;e[22]!==W||e[23]!==O||e[24]!==g||e[25]!==S?(ze=(be,Se)=>{const ce=A.getScaleCountByPixel(be+Se,{startLeft:O,scaleCount:g,scaleWidth:W});ce!==g&&S(ce)},e[22]=W,e[23]=O,e[24]=g,e[25]=S,e[26]=ze):ze=e[26];const Le=ze;let je;e[27]!==s||e[28]!==y||e[29]!==r?(je=()=>{y&&y({action:s,row:r})},e[27]=s,e[28]=y,e[29]=r,e[30]=je):je=e[30];const Ze=je;let He;e[31]!==s||e[32]!==Le||e[33]!==_||e[34]!==r||e[35]!==N||e[36]!==W||e[37]!==O?(He=be=>{const{left:Se,width:ce}=be;if(P.current=!0,_){const{start:pe,end:ue}=A.parserTransformToTime({left:Se,width:ce},{scaleWidth:W,scale:N,startLeft:O});if(_({action:s,row:r,start:pe,end:ue})===!1)return!1}Ue({left:Se,width:ce}),Le(Se,ce)},e[31]=s,e[32]=Le,e[33]=_,e[34]=r,e[35]=N,e[36]=W,e[37]=O,e[38]=He):He=e[38];const Be=He;let Xe;e[39]!==t||e[40]!==I||e[41]!==h||e[42]!==r||e[43]!==N||e[44]!==W||e[45]!==O||e[46]!==C?(Xe=be=>{const{left:Se,width:ce}=be,{start:pe,end:ue}=A.parserTransformToTime({left:Se,width:ce},{scaleWidth:W,scale:N,startLeft:O}),he=t.find(Je=>Je.id===r.id);if(!he)return;const Ke=he.actions.find(Je=>Je.id===I);Ke&&(Ke.start=pe,Ke.end=ue,C(t),h&&h({action:Ke,row:r,start:pe,end:ue}),Ue(null))},e[39]=t,e[40]=I,e[41]=h,e[42]=r,e[43]=N,e[44]=W,e[45]=O,e[46]=C,e[47]=Xe):Xe=e[47];const De=Xe;let Ce;e[48]!==s||e[49]!==p||e[50]!==r?(Ce=be=>{p&&p({action:s,row:r,dir:be})},e[48]=s,e[49]=p,e[50]=r,e[51]=Ce):Ce=e[51];const Ye=Ce;let V;e[52]!==s||e[53]!==Le||e[54]!==R||e[55]!==r||e[56]!==N||e[57]!==W||e[58]!==O?(V=(be,Se)=>{const{left:ce,width:pe}=Se;if(P.current=!0,R){const{start:ue,end:he}=A.parserTransformToTime({left:ce,width:pe},{scaleWidth:W,scale:N,startLeft:O});if(R({action:s,row:r,start:ue,end:he,dir:be})===!1)return!1}Ue({left:ce,width:pe}),Le(ce,pe)},e[52]=s,e[53]=Le,e[54]=R,e[55]=r,e[56]=N,e[57]=W,e[58]=O,e[59]=V):V=e[59];const K=V;let X;e[60]!==t||e[61]!==I||e[62]!==v||e[63]!==r||e[64]!==N||e[65]!==W||e[66]!==O||e[67]!==C?(X=(be,Se)=>{const{left:ce,width:pe}=Se,{start:ue,end:he}=A.parserTransformToTime({left:ce,width:pe},{scaleWidth:W,scale:N,startLeft:O}),Ke=t.find(Gt=>Gt.id===r.id);if(!Ke)return;const Je=Ke.actions.find(Gt=>Gt.id===I);Je&&(Je.start=ue,Je.end=he,C(t),v&&v({action:Je,row:r,start:ue,end:he,dir:be}),Ue(null))},e[60]=t,e[61]=I,e[62]=v,e[63]=r,e[64]=N,e[65]=W,e[66]=O,e[67]=C,e[68]=X):X=e[68];const Y=X;let me,ae,G,oe,F,le,ie,de,Te,st,ot,it,ct,at,lt,ut,Ge,qe,ft,dt,ht,mt,pt,gt,vt,bt;if(e[69]!==s||e[70]!==$e||e[71]!==f||e[72]!==k||e[73]!==te||e[74]!==Ve||e[75]!==m||e[76]!==Be||e[77]!==De||e[78]!==Ze||e[79]!==Y||e[80]!==Ye||e[81]!==K||e[82]!==B||e[83]!==Ee||e[84]!==U||e[85]!==z||e[86]!==D||e[87]!==H||e[88]!==j||e[89]!==Pe||e[90]!==r||e[91]!==i||e[92]!==N||e[93]!==W||e[94]!==O||e[95]!==re||e[96]!==E.assistPositions||e[97]!==ye.left||e[98]!==ye.width){const be={...s,...A.parserTransformToTime({left:ye.left,width:ye.width},{startLeft:O,scaleWidth:W,scale:N})},Se={...r,actions:[...r.actions]};r.actions.includes(s)&&(Se.actions[r.actions.indexOf(s)]=be),me=cr,Te=q,st=re,ot=O,it=ye.left,ct=ye.width,at=m&&Ve||A.DEFAULT_MOVE_GRID,lt=m?Math.max((Ve||A.DEFAULT_MOVE_GRID)/2,A.DEFAULT_SNAP_DISTANCE):A.DEFAULT_SNAP_DISTANCE,ut=E.assistPositions,e[125]!==Ee||e[126]!==Pe?(Ge=()=>({left:Ee,right:Pe}),e[125]=Ee,e[126]=Pe,e[127]=Ge):Ge=e[127];let ce;e[128]!==f||e[129]!==k?(ce=!f&&k&&`.${ge("action-left-stretch")}`,e[128]=f,e[129]=k,e[130]=ce):ce=e[130];let pe;e[131]!==f||e[132]!==k?(pe=!f&&k&&`.${ge("action-right-stretch")}`,e[131]=f,e[132]=k,e[133]=pe):pe=e[133],e[134]!==ce||e[135]!==pe?(qe={left:ce,right:pe},e[134]=ce,e[135]=pe,e[136]=qe):qe=e[136],ft=!f&&U,dt=!f&&k,ht=Ze,mt=Be,pt=De,gt=Ye,vt=K,bt=Y,e[137]===Symbol.for("react.memo_cache_sentinel")?(ae=()=>{P.current=!1},e[137]=ae):ae=e[137],e[138]!==s||e[139]!==B||e[140]!==z||e[141]!==D||e[142]!==r?(G=ue=>{let he;z&&(he=B(ue),z(ue,{row:r,action:s,time:he})),!P.current&&D&&(he===void 0&&(he=B(ue)),D(ue,{row:r,action:s,time:he}))},e[138]=s,e[139]=B,e[140]=z,e[141]=D,e[142]=r,e[143]=G):G=e[143],e[144]!==s||e[145]!==B||e[146]!==j||e[147]!==r?(oe=ue=>{if(j){const he=B(ue);j(ue,{row:r,action:s,time:he})}},e[144]=s,e[145]=B,e[146]=j,e[147]=r,e[148]=oe):oe=e[148],e[149]!==s||e[150]!==B||e[151]!==H||e[152]!==r?(F=ue=>{if(H){const he=B(ue);H(ue,{row:r,action:s,time:he})}},e[149]=s,e[150]=B,e[151]=H,e[152]=r,e[153]=F):F=e[153],le=$e,e[154]!==i?(ie={height:i},e[154]=i,e[155]=ie):ie=e[155],de=te&&te(be,Se),e[69]=s,e[70]=$e,e[71]=f,e[72]=k,e[73]=te,e[74]=Ve,e[75]=m,e[76]=Be,e[77]=De,e[78]=Ze,e[79]=Y,e[80]=Ye,e[81]=K,e[82]=B,e[83]=Ee,e[84]=U,e[85]=z,e[86]=D,e[87]=H,e[88]=j,e[89]=Pe,e[90]=r,e[91]=i,e[92]=N,e[93]=W,e[94]=O,e[95]=re,e[96]=E.assistPositions,e[97]=ye.left,e[98]=ye.width,e[99]=me,e[100]=ae,e[101]=G,e[102]=oe,e[103]=F,e[104]=le,e[105]=ie,e[106]=de,e[107]=Te,e[108]=st,e[109]=ot,e[110]=it,e[111]=ct,e[112]=at,e[113]=lt,e[114]=ut,e[115]=Ge,e[116]=qe,e[117]=ft,e[118]=dt,e[119]=ht,e[120]=mt,e[121]=pt,e[122]=gt,e[123]=vt,e[124]=bt}else me=e[99],ae=e[100],G=e[101],oe=e[102],F=e[103],le=e[104],ie=e[105],de=e[106],Te=e[107],st=e[108],ot=e[109],it=e[110],ct=e[111],at=e[112],lt=e[113],ut=e[114],Ge=e[115],qe=e[116],ft=e[117],dt=e[118],ht=e[119],mt=e[120],pt=e[121],gt=e[122],vt=e[123],bt=e[124];let St;e[156]!==k?(St=k&&T.jsx("div",{className:ge("action-left-stretch"),style:{touchAction:"none"}}),e[156]=k,e[157]=St):St=e[157];let _t;e[158]!==k?(_t=k&&T.jsx("div",{className:ge("action-right-stretch"),style:{touchAction:"none"}}),e[158]=k,e[159]=_t):_t=e[159];let wt;e[160]!==ae||e[161]!==G||e[162]!==oe||e[163]!==F||e[164]!==le||e[165]!==ie||e[166]!==de||e[167]!==St||e[168]!==_t?(wt=T.jsxs("div",{onMouseDown:ae,onClick:G,onDoubleClick:oe,onContextMenu:F,className:le,style:ie,children:[de,St,_t]}),e[160]=ae,e[161]=G,e[162]=oe,e[163]=F,e[164]=le,e[165]=ie,e[166]=de,e[167]=St,e[168]=_t,e[169]=wt):wt=e[169];let Mt;return e[170]!==me||e[171]!==Te||e[172]!==st||e[173]!==ot||e[174]!==it||e[175]!==ct||e[176]!==at||e[177]!==lt||e[178]!==ut||e[179]!==Ge||e[180]!==qe||e[181]!==ft||e[182]!==dt||e[183]!==ht||e[184]!==mt||e[185]!==pt||e[186]!==gt||e[187]!==vt||e[188]!==bt||e[189]!==wt?(Mt=T.jsx(me,{ref:Te,parentRef:st,start:ot,left:it,width:ct,grid:at,snapDistance:lt,snapPositions:ut,getBounds:Ge,edges:qe,enableDragging:ft,enableResizing:dt,onDragStart:ht,onDrag:mt,onDragEnd:pt,onResizeStart:gt,onResize:vt,onResizeEnd:bt,children:wt}),e[170]=me,e[171]=Te,e[172]=st,e[173]=ot,e[174]=it,e[175]=ct,e[176]=at,e[177]=lt,e[178]=ut,e[179]=Ge,e[180]=qe,e[181]=ft,e[182]=dt,e[183]=ht,e[184]=mt,e[185]=pt,e[186]=gt,e[187]=vt,e[188]=bt,e[189]=wt,e[190]=Mt):Mt=e[190],Mt};function yt(n,e,t){let r=t.initialDeps??[],s;function o(){var i,c,a,u;let l;t.key&&((i=t.debug)!=null&&i.call(t))&&(l=Date.now());const m=n();if(!(m.length!==r.length||m.some((w,S)=>r[S]!==w)))return s;r=m;let g;if(t.key&&((c=t.debug)!=null&&c.call(t))&&(g=Date.now()),s=e(...m),t.key&&((a=t.debug)!=null&&a.call(t))){const w=Math.round((Date.now()-l)*100)/100,S=Math.round((Date.now()-g)*100)/100,y=S/16,_=(h,p)=>{for(h=String(h);h.length<p;)h=" "+h;return h};console.info(`%c⏱ ${_(S,5)} /${_(w,5)} ms`,`
11
11
  font-size: .6rem;
12
12
  font-weight: bold;
13
- color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,t?.key)}return(u=t?.onChange)==null||u.call(t,s),s}return o.updateDeps=i=>{r=i},o}function Ln(n,e){if(n===void 0)throw new Error("Unexpected undefined");return n}const eo=(n,e)=>Math.abs(n-e)<1.01,to=(n,e,t)=>{let r;return function(...s){n.clearTimeout(r),r=n.setTimeout(()=>e.apply(this,s),t)}},On=n=>{const{offsetWidth:e,offsetHeight:t}=n;return{width:e,height:t}},no=n=>n,ro=n=>{const e=Math.max(n.startIndex-n.overscan,0),t=Math.min(n.endIndex+n.overscan,n.count-1),r=[];for(let s=e;s<=t;s++)r.push(s);return r},so=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;const s=i=>{const{width:c,height:a}=i;e({width:Math.round(c),height:Math.round(a)})};if(s(On(t)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const c=()=>{const a=i[0];if(a?.borderBoxSize){const u=a.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(On(t))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Mn={passive:!0},Nn=typeof window>"u"?!0:"onscrollend"in window,oo=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;let s=0;const o=n.options.useScrollendEvent&&Nn?()=>{}:to(r,()=>{e(s,!1)},n.options.isScrollingResetDelay),i=l=>()=>{const{horizontal:h,isRtl:d}=n.options;s=h?t.scrollLeft*(d&&-1||1):t.scrollTop,o(),e(s,l)},c=i(!0),a=i(!1);a(),t.addEventListener("scroll",c,Mn);const u=n.options.useScrollendEvent&&Nn;return u&&t.addEventListener("scrollend",a,Mn),()=>{t.removeEventListener("scroll",c),u&&t.removeEventListener("scrollend",a)}},io=(n,e,t)=>{if(e?.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return n[t.options.horizontal?"offsetWidth":"offsetHeight"]},co=(n,{adjustments:e=0,behavior:t},r)=>{var s,o;const i=n+e;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:i,behavior:t})};class ao{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const i=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var o;return(o=r())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=r())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,s])=>{typeof s>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:no,rangeExtractor:ro,onChange:()=>{},measureElement:io,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=yt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const s=new Map,o=new Map;for(let i=r-1;i>=0;i--){const c=t[i];if(s.has(c.lane))continue;const a=o.get(c.lane);if(a==null||c.end>a.end?o.set(c.lane,c):c.end<a.end&&s.set(c.lane,!0),s.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,c)=>i.end===c.end?i.index-c.index:i.end-c.end)[0]:void 0},this.getMeasurementOptions=yt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,r,s,o,i)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i}),{key:!1}),this.getMeasurements=yt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i},c)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(l=>{this.itemSizeCache.set(l.key,l.size)}));const a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,a);for(let l=a;l<t;l++){const h=o(l),d=this.options.lanes===1?u[l-1]:this.getFurthestMeasurement(u,l),m=d?d.end+this.options.gap:r+s,w=c.get(h),v=typeof w=="number"?w:this.options.estimateSize(l),p=m+v,R=d?d.lane:l%this.options.lanes;u[l]={index:l,start:m,size:v,end:p,key:h,lane:R}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=yt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,o)=>this.range=t.length>0&&r>0?lo({measurements:t,outerSize:r,scrollOffset:s,lanes:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=yt(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,o,i)=>o===null||i===null?[]:t({startIndex:o,endIndex:i,overscan:r,count:s}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const s=this.indexFromElement(t),o=this.measurementsCache[s];if(!o)return;const i=o.key,c=this.elementsCache.get(i);c!==t&&(c&&this.observer.unobserve(c),this.observer.observe(t),this.elementsCache.set(i,t)),t.isConnected&&this.resizeItem(s,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const s=this.measurementsCache[t];if(!s)return;const o=this.itemSizeCache.get(s.key)??s.size,i=r-o;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,i,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(t,void 0)},this.getVirtualItems=yt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let o=0,i=t.length;o<i;o++){const c=t[o],a=r[c];s.push(a)}return s},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return Ln(r[ar(0,r.length-1,s=>Ln(r[s]).start,t)])},this.getOffsetForAlignment=(t,r,s=0)=>{const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=t>=i+o?"end":"start"),r==="center"?t+=(s-o)/2:r==="end"&&(t-=o);const c=this.getTotalSize()+this.options.scrollMargin-o;return Math.max(Math.min(c,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.measurementsCache[t];if(!s)return;const o=this.getSize(),i=this.getScrollOffset();if(r==="auto")if(s.end>=i+o-this.options.scrollPaddingEnd)r="end";else if(s.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];const c=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:r="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(t,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let o=0;const i=10,c=u=>{if(!this.targetWindow)return;const l=this.getOffsetForIndex(t,u);if(!l){console.warn("Failed to get offset for index:",t);return}const[h,d]=l;this._scrollToOffset(h,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const m=this.getScrollOffset(),w=this.getOffsetForIndex(t,d);if(!w){console.warn("Failed to get offset for index:",t);return}eo(w[0],m)||a(d)})},a=u=>{this.targetWindow&&(o++,o<i?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",o,i),this.targetWindow.requestAnimationFrame(()=>c(u))):console.warn(`Failed to scroll to index ${t} after ${i} attempts.`))};c(r)},this.scrollBy=(t,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((t=r[r.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(c=>c===null);){const c=r[i];o[c.lane]===null&&(o[c.lane]=c.end),i--}s=Math.max(...o.filter(c=>c!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const ar=(n,e,t,r)=>{for(;n<=e;){const s=(n+e)/2|0,o=t(s);if(o<r)n=s+1;else if(o>r)e=s-1;else return s}return n>0?n-1:0};function lo({measurements:n,outerSize:e,scrollOffset:t,lanes:r}){const s=n.length-1,o=a=>n[a].start;if(n.length<=r)return{startIndex:0,endIndex:s};let i=ar(0,s,o,t),c=i;if(r===1)for(;c<s&&n[c].end<t+e;)c++;else if(r>1){const a=Array(r).fill(0);for(;c<s&&a.some(l=>l<t+e);){const l=n[c];a[l.lane]=l.end,c++}const u=Array(r).fill(t+e);for(;i>=0&&u.some(l=>l>=t);){const l=n[i];u[l.lane]=l.start,i--}i=Math.max(0,i-i%r),c=Math.min(s,c+(r-1-c%r))}return{startIndex:i,endIndex:c}}const In=typeof document<"u"?g.useLayoutEffect:g.useEffect;function uo(n){const e=g.useReducer(()=>({}),{})[1],t={...n,onChange:(s,o)=>{var i;o?fr.flushSync(e):e(),(i=n.onChange)==null||i.call(n,s,o)}},[r]=g.useState(()=>new ao(t));return r.setOptions(t),In(()=>r._didMount(),[]),In(()=>r._willUpdate()),r}function lr(n){return uo({observeElementRect:so,observeElementOffset:oo,scrollToFn:co,...n})}const fo=n=>{const{rowData:e,style:t={},onClickRow:r,onDoubleClickRow:s,onContextMenuRow:o,scrollContainerRef:i,startLeft:c,scale:a,scaleWidth:u}=n,l=["edit-row"];e?.selected&&l.push("edit-row-selected");const h=a??C.DEFAULT_SCALE,d=u??C.DEFAULT_SCALE_WIDTH,m=c??C.DEFAULT_START_LEFT,w=b=>{if(!i.current)return 0;const S=b.currentTarget.getBoundingClientRect(),D=b.clientX-S.x;return C.parserPixelToTime(D,{startLeft:m,scale:h,scaleWidth:d})},v=k.useMemo(()=>(e?.actions?[...e.actions]:[]).sort((b,_)=>b.start-_.start),[e]),p=k.useCallback(b=>v[b]?.id??b,[v]),R=lr({horizontal:!0,count:v.length,getItemKey:p,getScrollElement:()=>i.current,estimateSize:b=>{if(!v[b])return 0;let _=b>0?v[b-1].end:0,S=v[b].end;if(_>S)return 0;let{width:P}=C.parserTimeToTransform({start:_,end:S},{startLeft:m,scale:h,scaleWidth:d});return P},overscan:5});return k.useLayoutEffect(()=>{R.measure()},[u,c,R]),T.jsx("div",{className:`${de(...l)} ${(e?.classNames||[]).join(" ")}`,style:t,onClick:b=>{if(e&&r){const _=w(b);r(b,{row:e,time:_})}},onDoubleClick:b=>{if(e&&s){const _=w(b);s(b,{row:e,time:_})}},onContextMenu:b=>{if(e&&o){const _=w(b);o(b,{row:e,time:_})}},children:e&&R.getVirtualItems().map(b=>{const _=v[b.index];if(!_)throw new Error("Action not found");return T.jsx(Qs,{...n,handleTime:w,row:e,action:_},_.id)})})};function ho(){const n=Pe.c(7);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={isMoving:!1,movePositions:[],assistPositions:[]},n[0]=e):e=n[0];const[t,r]=k.useState(e),s=k.useRef(null),o=po,i=mo;let c;n[1]===Symbol.for("react.memo_cache_sentinel")?(c=p=>{const{movePositions:R,assistPositions:b,action:_,row:S,assistActionIds:P}=p;s.current={action:_,row:S,assistActionIds:P},r({isMoving:!0,movePositions:R||[],assistPositions:b||[]})},n[1]=c):c=n[1];const a=c;let u;n[2]===Symbol.for("react.memo_cache_sentinel")?(u=p=>{const{movePositions:R,assistPositions:b}=p;r(_=>({..._,movePositions:R||_.movePositions,assistPositions:b||_.assistPositions}))},n[2]=u):u=n[2];const l=u;let h;n[3]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{s.current=null,r({isMoving:!1,movePositions:[],assistPositions:[]})},n[3]=h):h=n[3];const d=h;let m;n[4]===Symbol.for("react.memo_cache_sentinel")?(m=()=>s.current,n[4]=m):m=n[4];const w=m;let v;return n[5]!==t?(v={initSnap:a,updateSnap:l,disposeSnap:d,snapData:t,getActiveDragState:w,defaultGetAssistPosition:o,defaultGetMovePosition:i},n[5]=t,n[6]=v):v=n[6],v}function mo(n){const{start:e,end:t,dir:r,scale:s,scaleWidth:o,startLeft:i}=n,{left:c,width:a}=C.parserTimeToTransform({start:e,end:t},{startLeft:i,scaleWidth:o,scale:s});return r?r==="right"?[c+a]:[c]:[c,c+a]}function po(n){const{editorData:e,assistActionIds:t,action:r,row:s,scale:o,scaleWidth:i,startLeft:c,cursorLeft:a,hideCursor:u}=n,l=[];t?e.forEach(d=>{d.actions.forEach(m=>{t.includes(m.id)&&l.push(m)})}):e.forEach(d=>{d.id!==s.id?l.push(...d.actions):d.actions.forEach(m=>{m.id!==r.id&&l.push(m)})});const h=C.parserActionsToPositions(l,{startLeft:c,scale:o,scaleWidth:i});return u||h.push(a),h}const go=n=>{const e=Pe.c(50);let t,r;e[0]!==n?({ref:r,...t}=n,e[0]=n,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const{snapData:s,initSnap:o,updateSnap:i,disposeSnap:c,getActiveDragState:a,defaultGetAssistPosition:u,defaultGetMovePosition:l}=ho();let h;e[3]!==u||e[4]!==a||e[5]!==t.cursorTime||e[6]!==t.editorData||e[7]!==t.hideCursor||e[8]!==t.scale||e[9]!==t.scaleWidth||e[10]!==t.snap||e[11]!==t.startLeft||e[12]!==s.isMoving||e[13]!==i?(h=()=>{const x=a();if(t.snap&&x&&s.isMoving){const U=t.scaleWidth??160,W=t.scale??1,E=t.startLeft??20,A=t.hideCursor??!1,N=C.parserTimeToPixel(t.cursorTime,{scaleWidth:U,scale:W,startLeft:E}),ee=u({editorData:t.editorData,assistActionIds:x.assistActionIds,action:x.action,row:x.row,scale:W,scaleWidth:U,startLeft:E,hideCursor:A,cursorLeft:N});i({assistPositions:ee})}else!t.snap&&s.isMoving&&i({assistPositions:[]})},e[3]=u,e[4]=a,e[5]=t.cursorTime,e[6]=t.editorData,e[7]=t.hideCursor,e[8]=t.scale,e[9]=t.scaleWidth,e[10]=t.snap,e[11]=t.startLeft,e[12]=s.isMoving,e[13]=i,e[14]=h):h=e[14];let d;e[15]!==t.snap||e[16]!==s.isMoving?(d=[t.snap,s.isMoving],e[15]=t.snap,e[16]=s.isMoving,e[17]=d):d=e[17],k.useEffect(h,d);let m;e[18]!==u||e[19]!==o||e[20]!==t?(m=x=>{const U=t.getAssistDragLineActionIds&&t.getAssistDragLineActionIds({action:x.action,row:x.row,editorData:t.editorData});if(t.snap){const W=t.scaleWidth??160,E=t.scale??1,A=t.startLeft??20,N=t.hideCursor??!1,ee=C.parserTimeToPixel(t.cursorTime,{scaleWidth:W,scale:E,startLeft:A}),ne=u({editorData:t.editorData,assistActionIds:U,action:x.action,row:x.row,scale:E,scaleWidth:W,startLeft:A,hideCursor:N,cursorLeft:ee});o({assistPositions:ne,action:x.action,row:x.row,assistActionIds:U})}else o({assistPositions:[],action:x.action,row:x.row,assistActionIds:U})},e[18]=u,e[19]=o,e[20]=t,e[21]=m):m=e[21];const w=m;let v;e[22]!==l||e[23]!==t.scale||e[24]!==t.scaleWidth||e[25]!==t.snap||e[26]!==t.startLeft||e[27]!==i?(v=x=>{if(t.snap){const U=t.scaleWidth??160,W=t.scale??1,E=t.startLeft??20,A=l({...x,startLeft:E,scaleWidth:U,scale:W});i({movePositions:A})}},e[22]=l,e[23]=t.scale,e[24]=t.scaleWidth,e[25]=t.snap,e[26]=t.startLeft,e[27]=i,e[28]=v):v=e[28];const p=v,R=t.rowHeight??32,b=t.scaleWidth??160,_=t.startLeft??20,S=Math.max(t.scaleCount*b+_,t.timelineWidth);let P;if(e[29]!==S||e[30]!==R||e[31]!==c||e[32]!==w||e[33]!==p||e[34]!==t||e[35]!==s){const x=[];let U=0;for(let W=0;W<t.editorData.length;W++){const E=t.editorData[W];if(!E)continue;const A=E.rowHeight||R;x.push(k.createElement(fo,{...t,key:E.id,rowData:E,snapData:s,scrollContainerRef:t.scrollElementRef,style:{position:"absolute",top:0,left:0,width:S,height:`${A}px`,transform:`translateY(${U}px)`},onActionMoveStart:N=>(w(N),t.onActionMoveStart&&t.onActionMoveStart(N)),onActionResizeStart:N=>(w(N),t.onActionResizeStart&&t.onActionResizeStart(N)),onActionMoving:N=>(p(N),t.onActionMoving&&t.onActionMoving(N)),onActionResizing:N=>(p(N),t.onActionResizing&&t.onActionResizing(N)),onActionResizeEnd:N=>(c(),t.onActionResizeEnd&&t.onActionResizeEnd(N)),onActionMoveEnd:N=>(c(),t.onActionMoveEnd&&t.onActionMoveEnd(N))})),U=U+A}P=[U,x],e[29]=S,e[30]=R,e[31]=c,e[32]=w,e[33]=p,e[34]=t,e[35]=s,e[36]=P}else P=e[36];const[D,L]=P,H=`0, ${t.startLeft??20}px`,M=`${t.startLeft??20}px, ${t.scaleWidth??160}px`;let j;e[37]!==S||e[38]!==H||e[39]!==M||e[40]!==D?(j={width:S,height:D,position:"relative",backgroundPositionX:H,backgroundSize:M},e[37]=S,e[38]=H,e[39]=M,e[40]=D,e[41]=j):j=e[41];let F;e[42]!==t.snap||e[43]!==s?(F=t.snap&&T.jsx(xr,{...s}),e[42]=t.snap,e[43]=s,e[44]=F):F=e[44];let G;return e[45]!==r||e[46]!==L||e[47]!==j||e[48]!==F?(G=T.jsxs("div",{ref:r,style:j,className:"timeline-editor-edit-area",children:[L,F]}),e[45]=r,e[46]=L,e[47]=j,e[48]=F,e[49]=G):G=e[49],G};function vo({scaleSplitCount:n,scaleWidth:e,startLeft:t,scaleCount:r,maxScaleCount:s,scale:o,scrollElementRef:i,onClickTimeArea:c,setCursor:a,getScaleRender:u}){const l=n??1,h=e??160,d=t??20,m=(n??0)>0,w=m?r*(n??1)+1:r,v=(m?h/l:h)*(w-1)+d,R=lr({horizontal:!0,count:w,getScrollElement:()=>i.current,estimateSize:b=>{switch(b){case 0:return d;default:return m?h/l:h}},overscan:10});return k.useEffect(()=>R.measure(),[e,t,R]),T.jsx("div",{style:{width:`${v}px`},className:de("time-area"),onClick:b=>{const _=t??20,S=e??160,P=o??1,D=s??1/0,L=b.currentTarget.getBoundingClientRect(),H=b.clientX-L.x,M=Math.max(H,_);if(M>D*S+_)return;const j=C.parserPixelToTime(M,{startLeft:_,scale:P,scaleWidth:S});c&&c(j,b),!b.defaultPrevented&&a({time:j})},children:R.getVirtualItems().map(b=>{const _=b.index,S=n??1,P=o??1,D=m?_%S===0:!0,L=[de("time-unit"),de(D?"time-unit-big":"time-unit-small")],H=(m?_/S:_)*P;return T.jsx("div",{"data-index":b.index,style:{width:`${b.size}px`,transform:`translateX(${b.start}px)`},className:L.join(" "),children:D&&T.jsx("div",{className:de("time-unit-scale"),children:u?.(H)??H})},b.key)})})}function bo(n){return typeof n=="object"&&n!==null}function _o(n,e,t){if(n instanceof EventTarget)return[n];if(typeof n=="string"){const s=document.querySelectorAll(n);return s?Array.from(s):[]}return Array.from(n)}function So(n){return bo(n)&&"ownerSVGElement"in n}const jt=new WeakMap;let Ft;const ur=(n,e,t)=>(r,s)=>s&&s[0]?s[0][n+"Size"]:So(r)&&"getBBox"in r?r.getBBox()[e]:r[t],wo=ur("inline","width","offsetWidth"),Eo=ur("block","height","offsetHeight");function yo({target:n,borderBoxSize:e}){jt.get(n)?.forEach(t=>{t(n,{get width(){return wo(n,e)},get height(){return Eo(n,e)}})})}function To(n){n.forEach(yo)}function Ro(){typeof ResizeObserver>"u"||(Ft=new ResizeObserver(To))}function xo(n,e){Ft||Ro();const t=_o(n);return t.forEach(r=>{let s=jt.get(r);s||(s=new Set,jt.set(r,s)),s.add(e),Ft?.observe(r)}),()=>{t.forEach(r=>{const s=jt.get(r);s?.delete(e),s?.size||Ft?.unobserve(r)})}}const Ut=new Set;let Tt;function Ao(){Tt=()=>{const n={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ut.forEach(e=>e(n))},window.addEventListener("resize",Tt)}function Co(n){return Ut.add(n),Tt||Ao(),()=>{Ut.delete(n),!Ut.size&&typeof Tt=="function"&&(window.removeEventListener("resize",Tt),Tt=void 0)}}function Do(n,e){return typeof n=="function"?Co(n):xo(n,e)}function Po(n){const e=Pe.c(4),{elementRef:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={width:0,height:0},e[0]=r):r=e[0];const[s,o]=k.useState(r);let i,c;return e[1]!==t?(i=()=>{t.current&&Do(t.current,(a,u)=>{o({width:u.width,height:u.height})})},c=[t],e[1]=t,e[2]=i,e[3]=c):(i=e[2],c=e[3]),k.useLayoutEffect(i,c),s}const Lo=n=>{const e=Pe.c(42),{disableDrag:t,cursorTime:r,setCursor:s,startLeft:o,scaleWidth:i,scale:c,scaleCount:a,scaleSplitCount:u,scrollElementRef:l,maxScaleCount:h,onCursorDragStart:d,onCursorDrag:m,onCursorDragEnd:w}=n,v=k.useRef(null),p=k.useRef(void 0);let R,b;e[0]!==r||e[1]!==c||e[2]!==i||e[3]!==o?(R=()=>{if(typeof p.current>"u"&&v.current){const f=o??20,y=i??160,I=c??1;v.current.updateLeft(C.parserTimeToPixel(r,{startLeft:f,scaleWidth:y,scale:I}))}},b=[r,o,i,c],e[0]=r,e[1]=c,e[2]=i,e[3]=o,e[4]=R,e[5]=b):(R=e[4],b=e[5]),k.useEffect(R,b);const _=o??20,S=i??160,P=c??1,D=h??1/0,L=(u??0)>0,H=u??1,M=L?a*(u??1)+1:a,j=o??20,F=(L?S/H:S)*(M-1)+j;let G;e[6]!==_||e[7]!==D||e[8]!==l||e[9]!==F||e[10]!==S?(G=()=>({left:0,right:Math.min(F,D*S+_-(l.current?.scrollLeft??0))}),e[6]=_,e[7]=D,e[8]=l,e[9]=F,e[10]=S,e[11]=G):G=e[11];const x=!t;let U;e[12]!==r||e[13]!==_||e[14]!==d||e[15]!==P||e[16]!==S?(U=()=>{const f=v.current?.getLeft()??C.parserTimeToPixel(r,{startLeft:_,scaleWidth:S,scale:P});p.current=f;const y=C.parserPixelToTime(f,{startLeft:_,scale:P,scaleWidth:S});d&&d(y),v.current?.updateLeft(f)},e[12]=r,e[13]=_,e[14]=d,e[15]=P,e[16]=S,e[17]=U):U=e[17];let W;e[18]!==_||e[19]!==w||e[20]!==P||e[21]!==s||e[22]!==S?(W=()=>{if(typeof p.current<"u"){const f=C.parserPixelToTime(p.current,{startLeft:_,scale:P,scaleWidth:S});s({time:f}),w&&w(f)}p.current=void 0},e[18]=_,e[19]=w,e[20]=P,e[21]=s,e[22]=S,e[23]=W):W=e[23];let E;e[24]!==_||e[25]!==m||e[26]!==P||e[27]!==l||e[28]!==s||e[29]!==S?(E=(f,y)=>{const{left:I}=f,Y=y===void 0?0:y,te=l.current?.scrollLeft??0,q=l.current,X=q?.clientWidth??0;if(Y!==0)if(typeof p.current<"u"){p.current=p.current+Y;const O=te,z=te+X;p.current<O+10?p.current=O+10:p.current>z-10&&(p.current=z-10),p.current<_-te&&(p.current=_-te)}else{p.current=I+Y;const O=te,z=te+X;p.current<O+10?p.current=O+10:p.current>z-10&&(p.current=z-10)}else if(I<_-te?p.current=_-te:p.current=I,q&&X>0){const O=te,z=te+X;p.current<O+10?p.current=O+10:p.current>z-10&&(p.current=z-10)}if(typeof p.current<"u"){v.current?.updateLeft(p.current);const O=C.parserPixelToTime(p.current,{startLeft:_,scale:P,scaleWidth:S});s({time:O}),m&&m(O)}return!1},e[24]=_,e[25]=m,e[26]=P,e[27]=l,e[28]=s,e[29]=S,e[30]=E):E=e[30];let A,N;e[31]===Symbol.for("react.memo_cache_sentinel")?(A=de("cursor"),N=de("cursor-top"),e[31]=A,e[32]=N):(A=e[31],N=e[32]);let ee;e[33]===Symbol.for("react.memo_cache_sentinel")?(ee=T.jsxs("div",{className:A,children:[T.jsx("svg",{className:N,width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",children:T.jsx("path",{d:"M0 1C0 0.447715 0.447715 0 1 0H7C7.55228 0 8 0.447715 8 1V9.38197C8 9.76074 7.786 10.107 7.44721 10.2764L4.44721 11.7764C4.16569 11.9172 3.83431 11.9172 3.55279 11.7764L0.552786 10.2764C0.214002 10.107 0 9.76074 0 9.38197V1Z",fill:"currentColor"})}),T.jsx("div",{className:de("cursor-area")})]}),e[33]=ee):ee=e[33];let ne;return e[34]!==_||e[35]!==l||e[36]!==G||e[37]!==x||e[38]!==U||e[39]!==W||e[40]!==E?(ne=T.jsx(cr,{start:_,ref:v,parentRef:l,getBounds:G,autoScroll:!0,enableDragging:x,enableResizing:!1,onDragStart:U,onDragEnd:W,onDrag:E,children:ee}),e[34]=_,e[35]=l,e[36]=G,e[37]=x,e[38]=U,e[39]=W,e[40]=E,e[41]=ne):ne=e[41],ne};function kn(n){const e=Pe.c(9);let t,r,s;e[0]!==n?({className:t,orientation:s,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);const o=s===void 0?"vertical":s;let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=T.jsx(nr,{"data-slot":"scroll-area-thumb"}),e[4]=i):i=e[4];let c;return e[5]!==t||e[6]!==o||e[7]!==r?(c=T.jsx(Zn,{"data-slot":"scroll-area-scrollbar",orientation:o,className:t,...r,children:i}),e[5]=t,e[6]=o,e[7]=r,e[8]=c):c=e[8],c}function Oo({ref:n,...e}){const t=wr(e),r=k.useRef(null),{width:s,height:o}=Po({elementRef:r}),i=Math.min(t.maxScaleCount,t.minScaleCount??Math.max(C.getScaleCountByRows(t.editorData,{scale:t.scale,pad:.2}),Math.ceil((s-t.startLeft)/t.scaleWidth))),[c,a]=k.useState(i),u=Math.max(i,c),[l,h]=k.useState(C.START_CURSOR_TIME),d=k.useRef(C.START_CURSOR_TIME),m=p=>{a(Math.min(t.maxScaleCount,Math.max(i,p)))},w=p=>{t.onChange?.(p)},v=p=>{let{left:R,time:b}=p;return typeof b<"u"?(h(b),d.current=b,!0):typeof R<"u"?(h(d.current=C.parserPixelToTime(R,{startLeft:t.startLeft,scale:t.scale,scaleWidth:t.scaleWidth})),!0):!1};return k.useImperativeHandle(n,()=>({get target(){return r.current},set time(p){v({time:p})},get time(){return d.current},setScrollLeft:p=>{r.current&&(r.current.scrollLeft=p)},setScrollTop:p=>{r.current&&(r.current.scrollTop=p)}})),T.jsxs(Bs,{style:t.style,className:`${C.PREFIX} ${t.disableDrag?C.PREFIX+"-disable":""}`,"data-slot":"scroll-area",children:[T.jsxs(Ys,{"data-slot":"scroll-area-viewport",ref:r,onScroll:p=>{t.onScroll?.(p.currentTarget)},children:[T.jsx(vo,{...t,setCursor:v,scaleCount:u,scrollElementRef:r}),T.jsx(go,{...t,scrollElementRef:r,timelineWidth:s,timelineHeight:o,disableDrag:t.disableDrag,editorData:t.editorData,cursorTime:l,scaleCount:u,setScaleCount:m,setEditorData:w}),!t.hideCursor&&T.jsx(Lo,{...t,timelineWidth:s,height:o,scaleCount:u,setScaleCount:m,setCursor:v,cursorTime:l,editorData:t.editorData,scrollElementRef:r})]}),T.jsx(kn,{orientation:"horizontal"}),T.jsx(kn,{orientation:"vertical"}),T.jsx(Xs,{})]})}exports.Timeline=Oo;
13
+ color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,t?.key)}return(u=t?.onChange)==null||u.call(t,s),s}return o.updateDeps=i=>{r=i},o}function Dn(n,e){if(n===void 0)throw new Error("Unexpected undefined");return n}const eo=(n,e)=>Math.abs(n-e)<1.01,to=(n,e,t)=>{let r;return function(...s){n.clearTimeout(r),r=n.setTimeout(()=>e.apply(this,s),t)}},On=n=>{const{offsetWidth:e,offsetHeight:t}=n;return{width:e,height:t}},no=n=>n,ro=n=>{const e=Math.max(n.startIndex-n.overscan,0),t=Math.min(n.endIndex+n.overscan,n.count-1),r=[];for(let s=e;s<=t;s++)r.push(s);return r},so=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;const s=i=>{const{width:c,height:a}=i;e({width:Math.round(c),height:Math.round(a)})};if(s(On(t)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const c=()=>{const a=i[0];if(a?.borderBoxSize){const u=a.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(On(t))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Mn={passive:!0},Nn=typeof window>"u"?!0:"onscrollend"in window,oo=(n,e)=>{const t=n.scrollElement;if(!t)return;const r=n.targetWindow;if(!r)return;let s=0;const o=n.options.useScrollendEvent&&Nn?()=>{}:to(r,()=>{e(s,!1)},n.options.isScrollingResetDelay),i=l=>()=>{const{horizontal:m,isRtl:f}=n.options;s=m?t.scrollLeft*(f&&-1||1):t.scrollTop,o(),e(s,l)},c=i(!0),a=i(!1);a(),t.addEventListener("scroll",c,Mn);const u=n.options.useScrollendEvent&&Nn;return u&&t.addEventListener("scrollend",a,Mn),()=>{t.removeEventListener("scroll",c),u&&t.removeEventListener("scrollend",a)}},io=(n,e,t)=>{if(e?.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return n[t.options.horizontal?"offsetWidth":"offsetHeight"]},co=(n,{adjustments:e=0,behavior:t},r)=>{var s,o;const i=n+e;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:i,behavior:t})};class ao{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const i=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var o;return(o=r())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=r())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,s])=>{typeof s>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:no,rangeExtractor:ro,onChange:()=>{},measureElement:io,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=yt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const s=new Map,o=new Map;for(let i=r-1;i>=0;i--){const c=t[i];if(s.has(c.lane))continue;const a=o.get(c.lane);if(a==null||c.end>a.end?o.set(c.lane,c):c.end<a.end&&s.set(c.lane,!0),s.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,c)=>i.end===c.end?i.index-c.index:i.end-c.end)[0]:void 0},this.getMeasurementOptions=yt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,r,s,o,i)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i}),{key:!1}),this.getMeasurements=yt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i},c)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(l=>{this.itemSizeCache.set(l.key,l.size)}));const a=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,a);for(let l=a;l<t;l++){const m=o(l),f=this.options.lanes===1?u[l-1]:this.getFurthestMeasurement(u,l),g=f?f.end+this.options.gap:r+s,w=c.get(m),S=typeof w=="number"?w:this.options.estimateSize(l),y=g+S,_=f?f.lane:l%this.options.lanes;u[l]={index:l,start:g,size:S,end:y,key:m,lane:_}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=yt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,o)=>this.range=t.length>0&&r>0?lo({measurements:t,outerSize:r,scrollOffset:s,lanes:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=yt(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,o,i)=>o===null||i===null?[]:t({startIndex:o,endIndex:i,overscan:r,count:s}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const s=this.indexFromElement(t),o=this.measurementsCache[s];if(!o)return;const i=o.key,c=this.elementsCache.get(i);c!==t&&(c&&this.observer.unobserve(c),this.observer.observe(t),this.elementsCache.set(i,t)),t.isConnected&&this.resizeItem(s,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const s=this.measurementsCache[t];if(!s)return;const o=this.itemSizeCache.get(s.key)??s.size,i=r-o;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,i,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(t,void 0)},this.getVirtualItems=yt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let o=0,i=t.length;o<i;o++){const c=t[o],a=r[c];s.push(a)}return s},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return Dn(r[ar(0,r.length-1,s=>Dn(r[s]).start,t)])},this.getOffsetForAlignment=(t,r,s=0)=>{const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=t>=i+o?"end":"start"),r==="center"?t+=(s-o)/2:r==="end"&&(t-=o);const c=this.getTotalSize()+this.options.scrollMargin-o;return Math.max(Math.min(c,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.measurementsCache[t];if(!s)return;const o=this.getSize(),i=this.getScrollOffset();if(r==="auto")if(s.end>=i+o-this.options.scrollPaddingEnd)r="end";else if(s.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];const c=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:r="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(t,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let o=0;const i=10,c=u=>{if(!this.targetWindow)return;const l=this.getOffsetForIndex(t,u);if(!l){console.warn("Failed to get offset for index:",t);return}const[m,f]=l;this._scrollToOffset(m,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const g=this.getScrollOffset(),w=this.getOffsetForIndex(t,f);if(!w){console.warn("Failed to get offset for index:",t);return}eo(w[0],g)||a(f)})},a=u=>{this.targetWindow&&(o++,o<i?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",o,i),this.targetWindow.requestAnimationFrame(()=>c(u))):console.warn(`Failed to scroll to index ${t} after ${i} attempts.`))};c(r)},this.scrollBy=(t,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((t=r[r.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(c=>c===null);){const c=r[i];o[c.lane]===null&&(o[c.lane]=c.end),i--}s=Math.max(...o.filter(c=>c!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const ar=(n,e,t,r)=>{for(;n<=e;){const s=(n+e)/2|0,o=t(s);if(o<r)n=s+1;else if(o>r)e=s-1;else return s}return n>0?n-1:0};function lo({measurements:n,outerSize:e,scrollOffset:t,lanes:r}){const s=n.length-1,o=a=>n[a].start;if(n.length<=r)return{startIndex:0,endIndex:s};let i=ar(0,s,o,t),c=i;if(r===1)for(;c<s&&n[c].end<t+e;)c++;else if(r>1){const a=Array(r).fill(0);for(;c<s&&a.some(l=>l<t+e);){const l=n[c];a[l.lane]=l.end,c++}const u=Array(r).fill(t+e);for(;i>=0&&u.some(l=>l>=t);){const l=n[i];u[l.lane]=l.start,i--}i=Math.max(0,i-i%r),c=Math.min(s,c+(r-1-c%r))}return{startIndex:i,endIndex:c}}const In=typeof document<"u"?b.useLayoutEffect:b.useEffect;function uo(n){const e=b.useReducer(()=>({}),{})[1],t={...n,onChange:(s,o)=>{var i;o?fr.flushSync(e):e(),(i=n.onChange)==null||i.call(n,s,o)}},[r]=b.useState(()=>new ao(t));return r.setOptions(t),In(()=>r._didMount(),[]),In(()=>r._willUpdate()),r}function lr(n){return uo({observeElementRect:so,observeElementOffset:oo,scrollToFn:co,...n})}const fo=n=>{const{rowData:e,style:t={},onClickRow:r,onDoubleClickRow:s,onContextMenuRow:o,scrollContainerRef:i,startLeft:c,scale:a,scaleWidth:u,unstable_rowActionsOverscan:l}=n,m=["edit-row"];e?.selected&&m.push("edit-row-selected");const f=a??A.DEFAULT_SCALE,g=u??A.DEFAULT_SCALE_WIDTH,w=c??A.DEFAULT_START_LEFT,S=p=>{if(!i.current)return 0;const R=p.currentTarget.getBoundingClientRect(),C=p.clientX-R.x;return A.parserPixelToTime(C,{startLeft:w,scale:f,scaleWidth:g})},y=L.useMemo(()=>(e?.actions?[...e.actions]:[]).sort((p,v)=>p.start-v.start),[e]),_=L.useCallback(p=>y[p]?.id??p,[y]),h=lr({horizontal:!0,count:y.length,getItemKey:_,getScrollElement:()=>i.current,estimateSize:p=>{if(!y[p])return 0;let v=p>0?y[p-1].end:0,R=y[p].end;if(v>R)return 0;let{width:E}=A.parserTimeToTransform({start:v,end:R},{startLeft:w,scale:f,scaleWidth:g});return E},overscan:l??5});return L.useEffect(()=>h.measure(),[f,g,w,h]),T.jsx("div",{className:`${ge(...m)} ${(e?.classNames||[]).join(" ")}`,style:t,onClick:p=>{if(e&&r){const v=S(p);r(p,{row:e,time:v})}},onDoubleClick:p=>{if(e&&s){const v=S(p);s(p,{row:e,time:v})}},onContextMenu:p=>{if(e&&o){const v=S(p);o(p,{row:e,time:v})}},children:e&&h.getVirtualItems().map(p=>{const v=y[p.index];if(!v)throw new Error("Action not found");return T.jsx(Qs,{...n,handleTime:S,row:e,action:v},v.id)})})};function ho(){const n=Oe.c(7);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e={isMoving:!1,movePositions:[],assistPositions:[]},n[0]=e):e=n[0];const[t,r]=L.useState(e),s=L.useRef(null),o=po,i=mo;let c;n[1]===Symbol.for("react.memo_cache_sentinel")?(c=y=>{const{movePositions:_,assistPositions:h,action:p,row:v,assistActionIds:R}=y;s.current={action:p,row:v,assistActionIds:R},r({isMoving:!0,movePositions:_||[],assistPositions:h||[]})},n[1]=c):c=n[1];const a=c;let u;n[2]===Symbol.for("react.memo_cache_sentinel")?(u=y=>{const{movePositions:_,assistPositions:h}=y;r(p=>({...p,movePositions:_||p.movePositions,assistPositions:h||p.assistPositions}))},n[2]=u):u=n[2];const l=u;let m;n[3]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{s.current=null,r({isMoving:!1,movePositions:[],assistPositions:[]})},n[3]=m):m=n[3];const f=m;let g;n[4]===Symbol.for("react.memo_cache_sentinel")?(g=()=>s.current,n[4]=g):g=n[4];const w=g;let S;return n[5]!==t?(S={initSnap:a,updateSnap:l,disposeSnap:f,snapData:t,getActiveDragState:w,defaultGetAssistPosition:o,defaultGetMovePosition:i},n[5]=t,n[6]=S):S=n[6],S}function mo(n){const{start:e,end:t,dir:r,scale:s,scaleWidth:o,startLeft:i}=n,{left:c,width:a}=A.parserTimeToTransform({start:e,end:t},{startLeft:i,scaleWidth:o,scale:s});return r?r==="right"?[c+a]:[c]:[c,c+a]}function po(n){const{editorData:e,assistActionIds:t,action:r,row:s,scale:o,scaleWidth:i,startLeft:c,cursorLeft:a,hideCursor:u}=n,l=[];t?e.forEach(f=>{f.actions.forEach(g=>{t.includes(g.id)&&l.push(g)})}):e.forEach(f=>{f.id!==s.id?l.push(...f.actions):f.actions.forEach(g=>{g.id!==r.id&&l.push(g)})});const m=A.parserActionsToPositions(l,{startLeft:c,scale:o,scaleWidth:i});return u||m.push(a),m}const go=({ref:n,...e})=>{const{snapData:t,initSnap:r,updateSnap:s,disposeSnap:o,getActiveDragState:i,defaultGetAssistPosition:c,defaultGetMovePosition:a}=ho();L.useEffect(()=>{const _=i();if(e.snap&&_&&t.isMoving){const h=e.scaleWidth??160,p=e.scale??1,v=e.startLeft??20,R=e.hideCursor??!1,E=A.parserTimeToPixel(e.cursorTime,{scaleWidth:h,scale:p,startLeft:v}),C=c({editorData:e.editorData,assistActionIds:_.assistActionIds,action:_.action,row:_.row,scale:p,scaleWidth:h,startLeft:v,hideCursor:R,cursorLeft:E});s({assistPositions:C})}else!e.snap&&t.isMoving&&s({assistPositions:[]})},[e.snap,t.isMoving]);const u=_=>{const h=e.getAssistDragLineActionIds&&e.getAssistDragLineActionIds({action:_.action,row:_.row,editorData:e.editorData});if(e.snap){const p=e.scaleWidth??160,v=e.scale??1,R=e.startLeft??20,E=e.hideCursor??!1,C=A.parserTimeToPixel(e.cursorTime,{scaleWidth:p,scale:v,startLeft:R}),z=c({editorData:e.editorData,assistActionIds:h,action:_.action,row:_.row,scale:v,scaleWidth:p,startLeft:R,hideCursor:E,cursorLeft:C});r({assistPositions:z,action:_.action,row:_.row,assistActionIds:h})}else r({assistPositions:[],action:_.action,row:_.row,assistActionIds:h})},l=_=>{if(e.snap){const h=e.scaleWidth??160,p=e.scale??1,v=e.startLeft??20,R=a({..._,startLeft:v,scaleWidth:h,scale:p});s({movePositions:R})}},m=e.rowHeight??32,f=e.scaleWidth??160,g=e.startLeft??20,w=Math.max(e.scaleCount*f+g,e.timelineWidth),[S,y]=(()=>{let _=[],h=0;for(let p=0;p<e.editorData.length;p++){const v=e.editorData[p];if(!v)continue;const R=v.rowHeight||m;_.push(L.createElement(fo,{...e,key:v.id,rowData:v,snapData:t,scrollContainerRef:e.scrollElementRef,style:{position:"absolute",top:0,left:0,width:w,height:`${R}px`,transform:`translateY(${h}px)`},onActionMoveStart:E=>(u(E),e.onActionMoveStart&&e.onActionMoveStart(E)),onActionResizeStart:E=>(u(E),e.onActionResizeStart&&e.onActionResizeStart(E)),onActionMoving:E=>(l(E),e.onActionMoving&&e.onActionMoving(E)),onActionResizing:E=>(l(E),e.onActionResizing&&e.onActionResizing(E)),onActionResizeEnd:E=>(o(),e.onActionResizeEnd&&e.onActionResizeEnd(E)),onActionMoveEnd:E=>(o(),e.onActionMoveEnd&&e.onActionMoveEnd(E))})),h+=R}return[h,_]})();return T.jsxs("div",{ref:n,style:{width:w,height:S,position:"relative",backgroundPositionX:`0, ${e.startLeft??20}px`,backgroundSize:`${e.startLeft??20}px, ${e.scaleWidth??160}px`},className:"timeline-editor-edit-area",children:[y,e.snap&&T.jsx(xr,{...t})]})};function vo({scaleSplitCount:n,scaleWidth:e,startLeft:t,scaleCount:r,maxScaleCount:s,scale:o,scrollElementRef:i,onClickTimeArea:c,setCursor:a,getScaleRender:u}){const l=n??1,m=e??160,f=t??20,g=(n??0)>0,w=g?r*(n??1)+1:r,S=(g?m/l:m)*(w-1)+f,_=lr({horizontal:!0,count:w,getScrollElement:()=>i.current,estimateSize:h=>{switch(h){case 0:return f;default:return g?m/l:m}},overscan:10});return L.useEffect(()=>_.measure(),[o,e,t,_]),T.jsx("div",{style:{width:`${S}px`},className:ge("time-area"),onClick:h=>{const p=t??20,v=e??160,R=o??1,E=s??1/0,C=h.currentTarget.getBoundingClientRect(),z=h.clientX-C.x,D=Math.max(z,p);if(D>E*v+p)return;const j=A.parserPixelToTime(D,{startLeft:p,scale:R,scaleWidth:v});c&&c(j,h),!h.defaultPrevented&&a({time:j})},children:_.getVirtualItems().map(h=>{const p=h.index,v=n??1,R=o??1,E=g?p%v===0:!0,C=[ge("time-unit"),ge(E?"time-unit-big":"time-unit-small")],z=(g?p/v:p)*R;return T.jsx("div",{"data-index":h.index,style:{width:`${h.size}px`,transform:`translateX(${h.start}px)`},className:C.join(" "),children:T.jsx(L.Activity,{mode:E?"visible":"hidden",children:T.jsx("div",{className:ge("time-unit-scale"),children:u?.(z)??z})})},h.key)})})}function bo(n){return typeof n=="object"&&n!==null}function So(n,e,t){if(n instanceof EventTarget)return[n];if(typeof n=="string"){const s=document.querySelectorAll(n);return s?Array.from(s):[]}return Array.from(n)}function _o(n){return bo(n)&&"ownerSVGElement"in n}const jt=new WeakMap;let Ft;const ur=(n,e,t)=>(r,s)=>s&&s[0]?s[0][n+"Size"]:_o(r)&&"getBBox"in r?r.getBBox()[e]:r[t],wo=ur("inline","width","offsetWidth"),Eo=ur("block","height","offsetHeight");function yo({target:n,borderBoxSize:e}){jt.get(n)?.forEach(t=>{t(n,{get width(){return wo(n,e)},get height(){return Eo(n,e)}})})}function To(n){n.forEach(yo)}function Ro(){typeof ResizeObserver>"u"||(Ft=new ResizeObserver(To))}function xo(n,e){Ft||Ro();const t=So(n);return t.forEach(r=>{let s=jt.get(r);s||(s=new Set,jt.set(r,s)),s.add(e),Ft?.observe(r)}),()=>{t.forEach(r=>{const s=jt.get(r);s?.delete(e),s?.size||Ft?.unobserve(r)})}}const Ut=new Set;let Tt;function Ao(){Tt=()=>{const n={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ut.forEach(e=>e(n))},window.addEventListener("resize",Tt)}function Co(n){return Ut.add(n),Tt||Ao(),()=>{Ut.delete(n),!Ut.size&&typeof Tt=="function"&&(window.removeEventListener("resize",Tt),Tt=void 0)}}function Po(n,e){return typeof n=="function"?Co(n):xo(n,e)}function Lo(n){const e=Oe.c(4),{elementRef:t}=n;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={width:0,height:0},e[0]=r):r=e[0];const[s,o]=L.useState(r);let i,c;return e[1]!==t?(i=()=>{t.current&&Po(t.current,(a,u)=>{o({width:u.width,height:u.height})})},c=[t],e[1]=t,e[2]=i,e[3]=c):(i=e[2],c=e[3]),L.useLayoutEffect(i,c),s}const Do=n=>{const e=Oe.c(47),{disableDrag:t,cursorTime:r,setCursor:s,startLeft:o,scaleWidth:i,scale:c,scaleCount:a,scaleSplitCount:u,scrollElementRef:l,maxScaleCount:m,onCursorDragStart:f,onCursorDrag:g,onCursorDragEnd:w,cursorSnap:S,editorData:y}=n,_=L.useRef(null),h=L.useRef(void 0),p=o??20,v=i??160,R=c??1;let E;e[0]!==S?(E=(k,U,N,W)=>{if(!S||!k)return[];const O=k.flatMap(Oo);return A.parserActionsToPositions(O,{startLeft:U,scale:W,scaleWidth:N})},e[0]=S,e[1]=E):E=e[1];const C=E,z=Mo;let D,j;e[2]!==r||e[3]!==c||e[4]!==i||e[5]!==o?(D=()=>{if(typeof h.current>"u"&&_.current){const k=o??20,U=i??160,N=c??1;_.current.updateLeft(A.parserTimeToPixel(r,{startLeft:k,scaleWidth:U,scale:N}))}},j=[r,o,i,c],e[2]=r,e[3]=c,e[4]=i,e[5]=o,e[6]=D,e[7]=j):(D=e[6],j=e[7]),L.useEffect(D,j);const H=m??1/0,te=(u??0)>0,B=u??1,re=te?a*(u??1)+1:a,q=o??20,P=(te?v/B:v)*(re-1)+q;let I;e[8]!==p||e[9]!==H||e[10]!==l||e[11]!==P||e[12]!==v?(I=()=>({left:0,right:Math.min(P,H*v+p-(l.current?.scrollLeft??0))}),e[8]=p,e[9]=H,e[10]=l,e[11]=P,e[12]=v,e[13]=I):I=e[13];const J=!t;let Z;e[14]!==r||e[15]!==p||e[16]!==f||e[17]!==R||e[18]!==v?(Z=()=>{const k=_.current?.getLeft()??A.parserTimeToPixel(r,{startLeft:p,scaleWidth:v,scale:R});h.current=k;const U=A.parserPixelToTime(k,{startLeft:p,scale:R,scaleWidth:v});f&&f(U),_.current?.updateLeft(k)},e[14]=r,e[15]=p,e[16]=f,e[17]=R,e[18]=v,e[19]=Z):Z=e[19];let Q;e[20]!==p||e[21]!==w||e[22]!==R||e[23]!==s||e[24]!==v?(Q=()=>{if(typeof h.current<"u"){const k=A.parserPixelToTime(h.current,{startLeft:p,scale:R,scaleWidth:v});s({time:k}),w&&w(k)}h.current=void 0},e[20]=p,e[21]=w,e[22]=R,e[23]=s,e[24]=v,e[25]=Q):Q=e[25];let d;e[26]!==S||e[27]!==y||e[28]!==C||e[29]!==p||e[30]!==g||e[31]!==R||e[32]!==l||e[33]!==s||e[34]!==v?(d=(k,U)=>{const{left:N}=k,W=U===void 0?0:U,O=l.current?.scrollLeft??0,Ne=l.current,Ae=Ne?.clientWidth??0;if(W!==0)if(typeof h.current<"u"){h.current=h.current+W;const ne=O,se=O+Ae;h.current<ne+10?h.current=ne+10:h.current>se-10&&(h.current=se-10),h.current<p-O&&(h.current=p-O)}else{h.current=N+W;const ne=O,se=O+Ae;h.current<ne+10?h.current=ne+10:h.current>se-10&&(h.current=se-10)}else if(N<p-O?h.current=p-O:h.current=N,Ne&&Ae>0){const ne=O,se=O+Ae;h.current<ne+10?h.current=ne+10:h.current>se-10&&(h.current=se-10)}if(typeof h.current<"u"){let ne=h.current;if(S){const Ee=C(y,p,v,R);Ee.length>0&&(ne=z(h.current,Ee,A.DEFAULT_SNAP_DISTANCE),h.current=ne)}_.current?.updateLeft(ne);const se=A.parserPixelToTime(ne,{startLeft:p,scale:R,scaleWidth:v});s({time:se}),g&&g(se)}return!1},e[26]=S,e[27]=y,e[28]=C,e[29]=p,e[30]=g,e[31]=R,e[32]=l,e[33]=s,e[34]=v,e[35]=d):d=e[35];let x,M;e[36]===Symbol.for("react.memo_cache_sentinel")?(M=ge("cursor"),x=ge("cursor-top"),e[36]=x,e[37]=M):(x=e[36],M=e[37]);let $;e[38]===Symbol.for("react.memo_cache_sentinel")?($=T.jsxs("div",{className:M,children:[T.jsx("svg",{className:x,width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",children:T.jsx("path",{d:"M0 1C0 0.447715 0.447715 0 1 0H7C7.55228 0 8 0.447715 8 1V9.38197C8 9.76074 7.786 10.107 7.44721 10.2764L4.44721 11.7764C4.16569 11.9172 3.83431 11.9172 3.55279 11.7764L0.552786 10.2764C0.214002 10.107 0 9.76074 0 9.38197V1Z",fill:"currentColor"})}),T.jsx("div",{className:ge("cursor-area")})]}),e[38]=$):$=e[38];let fe;return e[39]!==p||e[40]!==l||e[41]!==I||e[42]!==J||e[43]!==Z||e[44]!==Q||e[45]!==d?(fe=T.jsx(cr,{start:p,ref:_,parentRef:l,getBounds:I,autoScroll:!0,enableDragging:J,enableResizing:!1,onDragStart:Z,onDragEnd:Q,onDrag:d,children:$}),e[39]=p,e[40]=l,e[41]=I,e[42]=J,e[43]=Z,e[44]=Q,e[45]=d,e[46]=fe):fe=e[46],fe};function Oo(n){return n.actions}function Mo(n,e,t){let r=n,s=Number.MAX_SAFE_INTEGER;for(const o of e){const i=Math.abs(o-n);i<t&&i<s&&(r=o,s=i)}return r}function kn(n){const e=Oe.c(9);let t,r,s;e[0]!==n?({className:t,orientation:s,...r}=n,e[0]=n,e[1]=t,e[2]=r,e[3]=s):(t=e[1],r=e[2],s=e[3]);const o=s===void 0?"vertical":s;let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=T.jsx(nr,{"data-slot":"scroll-area-thumb"}),e[4]=i):i=e[4];let c;return e[5]!==t||e[6]!==o||e[7]!==r?(c=T.jsx(Zn,{"data-slot":"scroll-area-scrollbar",orientation:o,className:t,...r,children:i}),e[5]=t,e[6]=o,e[7]=r,e[8]=c):c=e[8],c}function No(n){const e=Oe.c(7),{scrollElementRef:t,scale:r,scaleWidth:s,startLeft:o,cursorTimeRef:i}=n,c=L.useRef(null),a=L.useRef(null);let u,l;e[0]!==i||e[1]!==r||e[2]!==s||e[3]!==t||e[4]!==o?(u=()=>{const m=t.current;if(c.current!==null&&a.current!==null&&m&&(c.current!==r||a.current!==s)){const f=m.scrollLeft,g=i.current,w=A.parserTimeToPixel(g,{startLeft:o,scale:c.current,scaleWidth:a.current}),S=A.parserTimeToPixel(g,{startLeft:o,scale:r,scaleWidth:s}),y=w-f,_=S-y;m.scrollLeft=_}c.current=r,a.current=s},l=[r,s,o,t,i],e[0]=i,e[1]=r,e[2]=s,e[3]=t,e[4]=o,e[5]=u,e[6]=l):(u=e[5],l=e[6]),L.useLayoutEffect(u,l)}function Io({ref:n,...e}){const t=wr(e),r=L.useRef(null),{width:s,height:o}=Lo({elementRef:r}),i=t.minScaleCount??Math.max(A.getScaleCountByRows(t.editorData,{scale:t.scale,pad:.1}),Math.ceil((s-t.startLeft)/t.scaleWidth)),c=Math.min(t.maxScaleCount,i),[a,u]=L.useState(null);L.useLayoutEffect(()=>{u(null)},[c]);const l=a??c,m=h=>{const p=Math.min(t.maxScaleCount,h);u(p)},[f,g]=L.useState(A.START_CURSOR_TIME),w=L.useRef(A.START_CURSOR_TIME);No({scrollElementRef:r,scale:t.scale,scaleWidth:t.scaleWidth,startLeft:t.startLeft,cursorTimeRef:w});const S=h=>{t.onChange?.(h)},y=h=>{let{left:p,time:v}=h;return typeof v<"u"?(g(v),w.current=v,!0):typeof p<"u"?(g(w.current=A.parserPixelToTime(p,{startLeft:t.startLeft,scale:t.scale,scaleWidth:t.scaleWidth})),!0):!1},_=(h,p={})=>{const v=r.current;if(!v)return;const{block:R="start",offset:E=0}=p,C=A.parserTimeToPixel(h,{startLeft:t.startLeft,scale:t.scale,scaleWidth:t.scaleWidth}),z=v.clientWidth;let D;R==="end"?D=C-z+E:R==="center"?D=C-z/2:D=C-E;const j=Math.max(0,v.scrollWidth-z);v.scrollLeft=Math.min(Math.max(D,0),j)};return L.useImperativeHandle(n,()=>({get target(){return r.current},set time(h){y({time:h})},get time(){return w.current},getTime(){return w.current},setTime(h){y({time:h})},setScrollLeft:h=>{r.current&&(r.current.scrollLeft=h)},setScrollTop:h=>{r.current&&(r.current.scrollTop=h)},get scrollLeft(){return r.current?r.current.scrollLeft:0},get scrollTop(){return r.current?r.current.scrollTop:0},set scrollLeft(h){r.current&&(r.current.scrollLeft=h)},set scrollTop(h){r.current&&(r.current.scrollTop=h)},scrollToTime:_})),T.jsxs(Bs,{style:t.style,className:`${A.PREFIX} ${t.disableDrag?A.PREFIX+"-disable":""}`,"data-slot":"scroll-area",children:[T.jsxs(Xs,{"data-slot":"scroll-area-viewport",ref:r,onScroll:h=>{t.onScroll?.(h.currentTarget)},children:[T.jsx(vo,{...t,setCursor:y,scaleCount:l,scrollElementRef:r}),T.jsx(go,{...t,scrollElementRef:r,timelineWidth:s,timelineHeight:o,disableDrag:t.disableDrag,editorData:t.editorData,cursorTime:f,scaleCount:l,setScaleCount:m,setEditorData:S}),!t.hideCursor&&T.jsx(Do,{...t,timelineWidth:s,height:o,scaleCount:l,setScaleCount:m,setCursor:y,cursorTime:f,editorData:t.editorData,scrollElementRef:r})]}),T.jsx(kn,{orientation:"horizontal"}),T.jsx(kn,{orientation:"vertical"}),T.jsx(Ys,{})]})}exports.Timeline=Io;