react-pro-messenger 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,14 +1,14 @@
1
- (function(he,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],x):(he=typeof globalThis<"u"?globalThis:he||self,x(he.ReactProMessenger={},he.React))})(this,function(he,x){"use strict";var Dd=Object.defineProperty;var Vd=(he,x,$e)=>x in he?Dd(he,x,{enumerable:!0,configurable:!0,writable:!0,value:$e}):he[x]=$e;var Oe=(he,x,$e)=>(Vd(he,typeof x!="symbol"?x+"":x,$e),$e);function $e(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const tn=$e(x);var g={exports:{}},ct={};var _r;function na(){if(_r)return ct;_r=1;var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(l,a,c){var u,f={},h=null,p=null;c!==void 0&&(h=""+c),a.key!==void 0&&(h=""+a.key),a.ref!==void 0&&(p=a.ref);for(u in a)r.call(a,u)&&!s.hasOwnProperty(u)&&(f[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)f[u]===void 0&&(f[u]=a[u]);return{$$typeof:t,type:l,key:h,ref:p,props:f,_owner:i.current}}return ct.Fragment=n,ct.jsx=o,ct.jsxs=o,ct}var ft={};var Ir;function ra(){return Ir||(Ir=1,process.env.NODE_ENV!=="production"&&function(){var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),v=Symbol.iterator,y="@@iterator";function S(d){if(d===null||typeof d!="object")return null;var P=v&&d[v]||d[y];return typeof P=="function"?P:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(d){{for(var P=arguments.length,A=new Array(P>1?P-1:0),L=1;L<P;L++)A[L-1]=arguments[L];w("error",d,A)}}function w(d,P,A){{var L=b.ReactDebugCurrentFrame,X=L.getStackAddendum();X!==""&&(P+="%s",A=A.concat([X]));var Q=A.map(function(q){return String(q)});Q.unshift("Warning: "+P),Function.prototype.apply.call(console[d],console,Q)}}var D=!1,m=!1,M=!1,N=!1,R=!1,H;H=Symbol.for("react.module.reference");function te(d){return!!(typeof d=="string"||typeof d=="function"||d===r||d===s||R||d===i||d===c||d===u||N||d===p||D||m||M||typeof d=="object"&&d!==null&&(d.$$typeof===h||d.$$typeof===f||d.$$typeof===o||d.$$typeof===l||d.$$typeof===a||d.$$typeof===H||d.getModuleId!==void 0))}function de(d,P,A){var L=d.displayName;if(L)return L;var X=P.displayName||P.name||"";return X!==""?A+"("+X+")":A}function be(d){return d.displayName||"Context"}function ae(d){if(d==null)return null;if(typeof d.tag=="number"&&C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case l:var P=d;return be(P)+".Consumer";case o:var A=d;return be(A._context)+".Provider";case a:return de(d,d.render,"ForwardRef");case f:var L=d.displayName||null;return L!==null?L:ae(d.type)||"Memo";case h:{var X=d,Q=X._payload,q=X._init;try{return ae(q(Q))}catch{return null}}}return null}var ie=Object.assign,Pe=0,$,O,k,le,T,E,_;function I(){}I.__reactDisabledLog=!0;function F(){{if(Pe===0){$=console.log,O=console.info,k=console.warn,le=console.error,T=console.group,E=console.groupCollapsed,_=console.groupEnd;var d={configurable:!0,enumerable:!0,value:I,writable:!0};Object.defineProperties(console,{info:d,log:d,warn:d,error:d,group:d,groupCollapsed:d,groupEnd:d})}Pe++}}function K(){{if(Pe--,Pe===0){var d={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ie({},d,{value:$}),info:ie({},d,{value:O}),warn:ie({},d,{value:k}),error:ie({},d,{value:le}),group:ie({},d,{value:T}),groupCollapsed:ie({},d,{value:E}),groupEnd:ie({},d,{value:_})})}Pe<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var B=b.ReactCurrentDispatcher,U;function W(d,P,A){{if(U===void 0)try{throw Error()}catch(X){var L=X.stack.trim().match(/\n( *(at )?)/);U=L&&L[1]||""}return`
2
- `+U+d}}var G=!1,z;{var ge=typeof WeakMap=="function"?WeakMap:Map;z=new ge}function j(d,P){if(!d||G)return"";{var A=z.get(d);if(A!==void 0)return A}var L;G=!0;var X=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Q;Q=B.current,B.current=null,F();try{if(P){var q=function(){throw Error()};if(Object.defineProperty(q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(q,[])}catch(Ve){L=Ve}Reflect.construct(d,[],q)}else{try{q.call()}catch(Ve){L=Ve}d.call(q.prototype)}}else{try{throw Error()}catch(Ve){L=Ve}d()}}catch(Ve){if(Ve&&L&&typeof Ve.stack=="string"){for(var Y=Ve.stack.split(`
3
- `),ve=L.stack.split(`
4
- `),oe=Y.length-1,ue=ve.length-1;oe>=1&&ue>=0&&Y[oe]!==ve[ue];)ue--;for(;oe>=1&&ue>=0;oe--,ue--)if(Y[oe]!==ve[ue]){if(oe!==1||ue!==1)do if(oe--,ue--,ue<0||Y[oe]!==ve[ue]){var Ce=`
5
- `+Y[oe].replace(" at new "," at ");return d.displayName&&Ce.includes("<anonymous>")&&(Ce=Ce.replace("<anonymous>",d.displayName)),typeof d=="function"&&z.set(d,Ce),Ce}while(oe>=1&&ue>=0);break}}}finally{G=!1,B.current=Q,K(),Error.prepareStackTrace=X}var ut=d?d.displayName||d.name:"",ta=ut?W(ut):"";return typeof d=="function"&&z.set(d,ta),ta}function Se(d,P,A){return j(d,!1)}function at(d){var P=d.prototype;return!!(P&&P.isReactComponent)}function Ge(d,P,A){if(d==null)return"";if(typeof d=="function")return j(d,at(d));if(typeof d=="string")return W(d);switch(d){case c:return W("Suspense");case u:return W("SuspenseList")}if(typeof d=="object")switch(d.$$typeof){case a:return Se(d.render);case f:return Ge(d.type,P,A);case h:{var L=d,X=L._payload,Q=L._init;try{return Ge(Q(X),P,A)}catch{}}}return""}var Qt=Object.prototype.hasOwnProperty,Wo={},zo=b.ReactDebugCurrentFrame;function en(d){if(d){var P=d._owner,A=Ge(d.type,d._source,P?P.type:null);zo.setExtraStackFrame(A)}else zo.setExtraStackFrame(null)}function fd(d,P,A,L,X){{var Q=Function.call.bind(Qt);for(var q in d)if(Q(d,q)){var Y=void 0;try{if(typeof d[q]!="function"){var ve=Error((L||"React class")+": "+A+" type `"+q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof d[q]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ve.name="Invariant Violation",ve}Y=d[q](P,q,L,A,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(oe){Y=oe}Y&&!(Y instanceof Error)&&(en(X),C("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",L||"React class",A,q,typeof Y),en(null)),Y instanceof Error&&!(Y.message in Wo)&&(Wo[Y.message]=!0,en(X),C("Failed %s type: %s",A,Y.message),en(null))}}}var dd=Array.isArray;function Dr(d){return dd(d)}function hd(d){{var P=typeof Symbol=="function"&&Symbol.toStringTag,A=P&&d[Symbol.toStringTag]||d.constructor.name||"Object";return A}}function pd(d){try{return Yo(d),!1}catch{return!0}}function Yo(d){return""+d}function Ko(d){if(pd(d))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",hd(d)),Yo(d)}var Vt=b.ReactCurrentOwner,md={key:!0,ref:!0,__self:!0,__source:!0},qo,Go,Vr;Vr={};function gd(d){if(Qt.call(d,"ref")){var P=Object.getOwnPropertyDescriptor(d,"ref").get;if(P&&P.isReactWarning)return!1}return d.ref!==void 0}function yd(d){if(Qt.call(d,"key")){var P=Object.getOwnPropertyDescriptor(d,"key").get;if(P&&P.isReactWarning)return!1}return d.key!==void 0}function vd(d,P){if(typeof d.ref=="string"&&Vt.current&&P&&Vt.current.stateNode!==P){var A=ae(Vt.current.type);Vr[A]||(C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',ae(Vt.current.type),d.ref),Vr[A]=!0)}}function xd(d,P){{var A=function(){qo||(qo=!0,C("%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://reactjs.org/link/special-props)",P))};A.isReactWarning=!0,Object.defineProperty(d,"key",{get:A,configurable:!0})}}function bd(d,P){{var A=function(){Go||(Go=!0,C("%s: `ref` 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://reactjs.org/link/special-props)",P))};A.isReactWarning=!0,Object.defineProperty(d,"ref",{get:A,configurable:!0})}}var Td=function(d,P,A,L,X,Q,q){var Y={$$typeof:t,type:d,key:P,ref:A,props:q,_owner:Q};return Y._store={},Object.defineProperty(Y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Y,"_self",{configurable:!1,enumerable:!1,writable:!1,value:L}),Object.defineProperty(Y,"_source",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.freeze&&(Object.freeze(Y.props),Object.freeze(Y)),Y};function wd(d,P,A,L,X){{var Q,q={},Y=null,ve=null;A!==void 0&&(Ko(A),Y=""+A),yd(P)&&(Ko(P.key),Y=""+P.key),gd(P)&&(ve=P.ref,vd(P,X));for(Q in P)Qt.call(P,Q)&&!md.hasOwnProperty(Q)&&(q[Q]=P[Q]);if(d&&d.defaultProps){var oe=d.defaultProps;for(Q in oe)q[Q]===void 0&&(q[Q]=oe[Q])}if(Y||ve){var ue=typeof d=="function"?d.displayName||d.name||"Unknown":d;Y&&xd(q,ue),ve&&bd(q,ue)}return Td(d,Y,ve,X,L,Vt.current,q)}}var Or=b.ReactCurrentOwner,Ho=b.ReactDebugCurrentFrame;function lt(d){if(d){var P=d._owner,A=Ge(d.type,d._source,P?P.type:null);Ho.setExtraStackFrame(A)}else Ho.setExtraStackFrame(null)}var Lr;Lr=!1;function kr(d){return typeof d=="object"&&d!==null&&d.$$typeof===t}function Xo(){{if(Or.current){var d=ae(Or.current.type);if(d)return`
1
+ (function(he,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],x):(he=typeof globalThis<"u"?globalThis:he||self,x(he.ReactProMessenger={},he.React))})(this,function(he,x){"use strict";var Dd=Object.defineProperty;var Vd=(he,x,$e)=>x in he?Dd(he,x,{enumerable:!0,configurable:!0,writable:!0,value:$e}):he[x]=$e;var Oe=(he,x,$e)=>(Vd(he,typeof x!="symbol"?x+"":x,$e),$e);function $e(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const tn=$e(x);var g={exports:{}},ct={};var _r;function na(){if(_r)return ct;_r=1;var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(l,a,c){var u,f={},h=null,p=null;c!==void 0&&(h=""+c),a.key!==void 0&&(h=""+a.key),a.ref!==void 0&&(p=a.ref);for(u in a)r.call(a,u)&&!s.hasOwnProperty(u)&&(f[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)f[u]===void 0&&(f[u]=a[u]);return{$$typeof:t,type:l,key:h,ref:p,props:f,_owner:i.current}}return ct.Fragment=n,ct.jsx=o,ct.jsxs=o,ct}var ft={};var Ir;function ra(){return Ir||(Ir=1,process.env.NODE_ENV!=="production"&&function(){var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),v=Symbol.iterator,y="@@iterator";function P(d){if(d===null||typeof d!="object")return null;var w=v&&d[v]||d[y];return typeof w=="function"?w:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(d){{for(var w=arguments.length,j=new Array(w>1?w-1:0),L=1;L<w;L++)j[L-1]=arguments[L];C("error",d,j)}}function C(d,w,j){{var L=b.ReactDebugCurrentFrame,X=L.getStackAddendum();X!==""&&(w+="%s",j=j.concat([X]));var ee=j.map(function(G){return String(G)});ee.unshift("Warning: "+w),Function.prototype.apply.call(console[d],console,ee)}}var A=!1,m=!1,R=!1,N=!1,D=!1,B;B=Symbol.for("react.module.reference");function Q(d){return!!(typeof d=="string"||typeof d=="function"||d===r||d===s||D||d===i||d===c||d===u||N||d===p||A||m||R||typeof d=="object"&&d!==null&&(d.$$typeof===h||d.$$typeof===f||d.$$typeof===o||d.$$typeof===l||d.$$typeof===a||d.$$typeof===B||d.getModuleId!==void 0))}function fe(d,w,j){var L=d.displayName;if(L)return L;var X=w.displayName||w.name||"";return X!==""?j+"("+X+")":j}function Te(d){return d.displayName||"Context"}function ae(d){if(d==null)return null;if(typeof d.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case l:var w=d;return Te(w)+".Consumer";case o:var j=d;return Te(j._context)+".Provider";case a:return fe(d,d.render,"ForwardRef");case f:var L=d.displayName||null;return L!==null?L:ae(d.type)||"Memo";case h:{var X=d,ee=X._payload,G=X._init;try{return ae(G(ee))}catch{return null}}}return null}var ie=Object.assign,ve=0,U,O,k,le,T,E,_;function I(){}I.__reactDisabledLog=!0;function F(){{if(ve===0){U=console.log,O=console.info,k=console.warn,le=console.error,T=console.group,E=console.groupCollapsed,_=console.groupEnd;var d={configurable:!0,enumerable:!0,value:I,writable:!0};Object.defineProperties(console,{info:d,log:d,warn:d,error:d,group:d,groupCollapsed:d,groupEnd:d})}ve++}}function q(){{if(ve--,ve===0){var d={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ie({},d,{value:U}),info:ie({},d,{value:O}),warn:ie({},d,{value:k}),error:ie({},d,{value:le}),group:ie({},d,{value:T}),groupCollapsed:ie({},d,{value:E}),groupEnd:ie({},d,{value:_})})}ve<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var $=b.ReactCurrentDispatcher,W;function z(d,w,j){{if(W===void 0)try{throw Error()}catch(X){var L=X.stack.trim().match(/\n( *(at )?)/);W=L&&L[1]||""}return`
2
+ `+W+d}}var H=!1,Y;{var ge=typeof WeakMap=="function"?WeakMap:Map;Y=new ge}function M(d,w){if(!d||H)return"";{var j=Y.get(d);if(j!==void 0)return j}var L;H=!0;var X=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ee;ee=$.current,$.current=null,F();try{if(w){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(Ve){L=Ve}Reflect.construct(d,[],G)}else{try{G.call()}catch(Ve){L=Ve}d.call(G.prototype)}}else{try{throw Error()}catch(Ve){L=Ve}d()}}catch(Ve){if(Ve&&L&&typeof Ve.stack=="string"){for(var K=Ve.stack.split(`
3
+ `),xe=L.stack.split(`
4
+ `),oe=K.length-1,ue=xe.length-1;oe>=1&&ue>=0&&K[oe]!==xe[ue];)ue--;for(;oe>=1&&ue>=0;oe--,ue--)if(K[oe]!==xe[ue]){if(oe!==1||ue!==1)do if(oe--,ue--,ue<0||K[oe]!==xe[ue]){var Ce=`
5
+ `+K[oe].replace(" at new "," at ");return d.displayName&&Ce.includes("<anonymous>")&&(Ce=Ce.replace("<anonymous>",d.displayName)),typeof d=="function"&&Y.set(d,Ce),Ce}while(oe>=1&&ue>=0);break}}}finally{H=!1,$.current=ee,q(),Error.prepareStackTrace=X}var ut=d?d.displayName||d.name:"",ta=ut?z(ut):"";return typeof d=="function"&&Y.set(d,ta),ta}function Se(d,w,j){return M(d,!1)}function at(d){var w=d.prototype;return!!(w&&w.isReactComponent)}function Ge(d,w,j){if(d==null)return"";if(typeof d=="function")return M(d,at(d));if(typeof d=="string")return z(d);switch(d){case c:return z("Suspense");case u:return z("SuspenseList")}if(typeof d=="object")switch(d.$$typeof){case a:return Se(d.render);case f:return Ge(d.type,w,j);case h:{var L=d,X=L._payload,ee=L._init;try{return Ge(ee(X),w,j)}catch{}}}return""}var Qt=Object.prototype.hasOwnProperty,Wo={},zo=b.ReactDebugCurrentFrame;function en(d){if(d){var w=d._owner,j=Ge(d.type,d._source,w?w.type:null);zo.setExtraStackFrame(j)}else zo.setExtraStackFrame(null)}function fd(d,w,j,L,X){{var ee=Function.call.bind(Qt);for(var G in d)if(ee(d,G)){var K=void 0;try{if(typeof d[G]!="function"){var xe=Error((L||"React class")+": "+j+" type `"+G+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof d[G]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw xe.name="Invariant Violation",xe}K=d[G](w,G,L,j,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(oe){K=oe}K&&!(K instanceof Error)&&(en(X),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",L||"React class",j,G,typeof K),en(null)),K instanceof Error&&!(K.message in Wo)&&(Wo[K.message]=!0,en(X),S("Failed %s type: %s",j,K.message),en(null))}}}var dd=Array.isArray;function Dr(d){return dd(d)}function hd(d){{var w=typeof Symbol=="function"&&Symbol.toStringTag,j=w&&d[Symbol.toStringTag]||d.constructor.name||"Object";return j}}function pd(d){try{return Yo(d),!1}catch{return!0}}function Yo(d){return""+d}function Ko(d){if(pd(d))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",hd(d)),Yo(d)}var Vt=b.ReactCurrentOwner,md={key:!0,ref:!0,__self:!0,__source:!0},qo,Go,Vr;Vr={};function gd(d){if(Qt.call(d,"ref")){var w=Object.getOwnPropertyDescriptor(d,"ref").get;if(w&&w.isReactWarning)return!1}return d.ref!==void 0}function yd(d){if(Qt.call(d,"key")){var w=Object.getOwnPropertyDescriptor(d,"key").get;if(w&&w.isReactWarning)return!1}return d.key!==void 0}function vd(d,w){if(typeof d.ref=="string"&&Vt.current&&w&&Vt.current.stateNode!==w){var j=ae(Vt.current.type);Vr[j]||(S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',ae(Vt.current.type),d.ref),Vr[j]=!0)}}function xd(d,w){{var j=function(){qo||(qo=!0,S("%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://reactjs.org/link/special-props)",w))};j.isReactWarning=!0,Object.defineProperty(d,"key",{get:j,configurable:!0})}}function bd(d,w){{var j=function(){Go||(Go=!0,S("%s: `ref` 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://reactjs.org/link/special-props)",w))};j.isReactWarning=!0,Object.defineProperty(d,"ref",{get:j,configurable:!0})}}var Td=function(d,w,j,L,X,ee,G){var K={$$typeof:t,type:d,key:w,ref:j,props:G,_owner:ee};return K._store={},Object.defineProperty(K._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(K,"_self",{configurable:!1,enumerable:!1,writable:!1,value:L}),Object.defineProperty(K,"_source",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.freeze&&(Object.freeze(K.props),Object.freeze(K)),K};function wd(d,w,j,L,X){{var ee,G={},K=null,xe=null;j!==void 0&&(Ko(j),K=""+j),yd(w)&&(Ko(w.key),K=""+w.key),gd(w)&&(xe=w.ref,vd(w,X));for(ee in w)Qt.call(w,ee)&&!md.hasOwnProperty(ee)&&(G[ee]=w[ee]);if(d&&d.defaultProps){var oe=d.defaultProps;for(ee in oe)G[ee]===void 0&&(G[ee]=oe[ee])}if(K||xe){var ue=typeof d=="function"?d.displayName||d.name||"Unknown":d;K&&xd(G,ue),xe&&bd(G,ue)}return Td(d,K,xe,X,L,Vt.current,G)}}var Or=b.ReactCurrentOwner,Ho=b.ReactDebugCurrentFrame;function lt(d){if(d){var w=d._owner,j=Ge(d.type,d._source,w?w.type:null);Ho.setExtraStackFrame(j)}else Ho.setExtraStackFrame(null)}var Lr;Lr=!1;function kr(d){return typeof d=="object"&&d!==null&&d.$$typeof===t}function Xo(){{if(Or.current){var d=ae(Or.current.type);if(d)return`
6
6
 
7
- Check the render method of \``+d+"`."}return""}}function Pd(d){{if(d!==void 0){var P=d.fileName.replace(/^.*[\\\/]/,""),A=d.lineNumber;return`
7
+ Check the render method of \``+d+"`."}return""}}function Pd(d){{if(d!==void 0){var w=d.fileName.replace(/^.*[\\\/]/,""),j=d.lineNumber;return`
8
8
 
9
- Check your code at `+P+":"+A+"."}return""}}var Zo={};function Sd(d){{var P=Xo();if(!P){var A=typeof d=="string"?d:d.displayName||d.name;A&&(P=`
9
+ Check your code at `+w+":"+j+"."}return""}}var Zo={};function Sd(d){{var w=Xo();if(!w){var j=typeof d=="string"?d:d.displayName||d.name;j&&(w=`
10
10
 
11
- Check the top-level render call using <`+A+">.")}return P}}function Jo(d,P){{if(!d._store||d._store.validated||d.key!=null)return;d._store.validated=!0;var A=Sd(P);if(Zo[A])return;Zo[A]=!0;var L="";d&&d._owner&&d._owner!==Or.current&&(L=" It was passed a child from "+ae(d._owner.type)+"."),lt(d),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',A,L),lt(null)}}function Qo(d,P){{if(typeof d!="object")return;if(Dr(d))for(var A=0;A<d.length;A++){var L=d[A];kr(L)&&Jo(L,P)}else if(kr(d))d._store&&(d._store.validated=!0);else if(d){var X=S(d);if(typeof X=="function"&&X!==d.entries)for(var Q=X.call(d),q;!(q=Q.next()).done;)kr(q.value)&&Jo(q.value,P)}}}function Cd(d){{var P=d.type;if(P==null||typeof P=="string")return;var A;if(typeof P=="function")A=P.propTypes;else if(typeof P=="object"&&(P.$$typeof===a||P.$$typeof===f))A=P.propTypes;else return;if(A){var L=ae(P);fd(A,d.props,"prop",L,d)}else if(P.PropTypes!==void 0&&!Lr){Lr=!0;var X=ae(P);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",X||"Unknown")}typeof P.getDefaultProps=="function"&&!P.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ed(d){{for(var P=Object.keys(d.props),A=0;A<P.length;A++){var L=P[A];if(L!=="children"&&L!=="key"){lt(d),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",L),lt(null);break}}d.ref!==null&&(lt(d),C("Invalid attribute `ref` supplied to `React.Fragment`."),lt(null))}}function ea(d,P,A,L,X,Q){{var q=te(d);if(!q){var Y="";(d===void 0||typeof d=="object"&&d!==null&&Object.keys(d).length===0)&&(Y+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ve=Pd(X);ve?Y+=ve:Y+=Xo();var oe;d===null?oe="null":Dr(d)?oe="array":d!==void 0&&d.$$typeof===t?(oe="<"+(ae(d.type)||"Unknown")+" />",Y=" Did you accidentally export a JSX literal instead of a component?"):oe=typeof d,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",oe,Y)}var ue=wd(d,P,A,X,Q);if(ue==null)return ue;if(q){var Ce=P.children;if(Ce!==void 0)if(L)if(Dr(Ce)){for(var ut=0;ut<Ce.length;ut++)Qo(Ce[ut],d);Object.freeze&&Object.freeze(Ce)}else C("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 Qo(Ce,d)}return d===r?Ed(ue):Cd(ue),ue}}function Ad(d,P,A){return ea(d,P,A,!0)}function jd(d,P,A){return ea(d,P,A,!1)}var Md=jd,Rd=Ad;ft.Fragment=r,ft.jsx=Md,ft.jsxs=Rd}()),ft}(function(e){process.env.NODE_ENV==="production"?e.exports=na():e.exports=ra()})(g);const Od="",ia=()=>{const e=x.useCallback(()=>{console.log("Vite + React + TypeScript + Tailwind = ❤️")},[]);return g.exports.jsx("button",{onClick:e,className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded",children:"Vite is better than Webpack"})};class Ot{constructor({id:t,text:n,createdDate:r,attachment:i,attachmentType:s,user:o,isRightSided:l,symbols:a}){Oe(this,"id","0");Oe(this,"text","");Oe(this,"createdDate","");Oe(this,"attachment","");Oe(this,"attachmentType");Oe(this,"user",{id:""});Oe(this,"isRightSided",!1);Oe(this,"symbols");this.id=t,this.text=n,this.createdDate=r,this.attachment=i,this.attachmentType=s,this.user=o,this.isRightSided=l,this.symbols=a}}const nn=x.createContext({});function rn(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const Lt=x.createContext(null),sn=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class sa extends tn.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=r instanceof HTMLElement&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function oa({children:e,isPresent:t,anchorX:n}){const r=x.useId(),i=x.useRef(null),s=x.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=x.useContext(sn);return x.useInsertionEffect(()=>{const{width:l,height:a,top:c,left:u,right:f}=s.current;if(t||!i.current||!l||!a)return;const h=n==="left"?`left: ${u}`:`right: ${f}`;i.current.dataset.motionPopId=r;const p=document.createElement("style");return o&&(p.nonce=o),document.head.appendChild(p),p.sheet&&p.sheet.insertRule(`
11
+ Check the top-level render call using <`+j+">.")}return w}}function Jo(d,w){{if(!d._store||d._store.validated||d.key!=null)return;d._store.validated=!0;var j=Sd(w);if(Zo[j])return;Zo[j]=!0;var L="";d&&d._owner&&d._owner!==Or.current&&(L=" It was passed a child from "+ae(d._owner.type)+"."),lt(d),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',j,L),lt(null)}}function Qo(d,w){{if(typeof d!="object")return;if(Dr(d))for(var j=0;j<d.length;j++){var L=d[j];kr(L)&&Jo(L,w)}else if(kr(d))d._store&&(d._store.validated=!0);else if(d){var X=P(d);if(typeof X=="function"&&X!==d.entries)for(var ee=X.call(d),G;!(G=ee.next()).done;)kr(G.value)&&Jo(G.value,w)}}}function Cd(d){{var w=d.type;if(w==null||typeof w=="string")return;var j;if(typeof w=="function")j=w.propTypes;else if(typeof w=="object"&&(w.$$typeof===a||w.$$typeof===f))j=w.propTypes;else return;if(j){var L=ae(w);fd(j,d.props,"prop",L,d)}else if(w.PropTypes!==void 0&&!Lr){Lr=!0;var X=ae(w);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",X||"Unknown")}typeof w.getDefaultProps=="function"&&!w.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ed(d){{for(var w=Object.keys(d.props),j=0;j<w.length;j++){var L=w[j];if(L!=="children"&&L!=="key"){lt(d),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",L),lt(null);break}}d.ref!==null&&(lt(d),S("Invalid attribute `ref` supplied to `React.Fragment`."),lt(null))}}function ea(d,w,j,L,X,ee){{var G=Q(d);if(!G){var K="";(d===void 0||typeof d=="object"&&d!==null&&Object.keys(d).length===0)&&(K+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var xe=Pd(X);xe?K+=xe:K+=Xo();var oe;d===null?oe="null":Dr(d)?oe="array":d!==void 0&&d.$$typeof===t?(oe="<"+(ae(d.type)||"Unknown")+" />",K=" Did you accidentally export a JSX literal instead of a component?"):oe=typeof d,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",oe,K)}var ue=wd(d,w,j,X,ee);if(ue==null)return ue;if(G){var Ce=w.children;if(Ce!==void 0)if(L)if(Dr(Ce)){for(var ut=0;ut<Ce.length;ut++)Qo(Ce[ut],d);Object.freeze&&Object.freeze(Ce)}else S("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 Qo(Ce,d)}return d===r?Ed(ue):Cd(ue),ue}}function Ad(d,w,j){return ea(d,w,j,!0)}function jd(d,w,j){return ea(d,w,j,!1)}var Md=jd,Rd=Ad;ft.Fragment=r,ft.jsx=Md,ft.jsxs=Rd}()),ft}(function(e){process.env.NODE_ENV==="production"?e.exports=na():e.exports=ra()})(g);const Od="",ia=()=>{const e=x.useCallback(()=>{console.log("Vite + React + TypeScript + Tailwind = ❤️")},[]);return g.exports.jsx("button",{onClick:e,className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded",children:"Vite is better than Webpack"})};class Ot{constructor({id:t,text:n,createdDate:r,attachment:i,attachmentType:s,user:o,isRightSided:l,symbols:a}){Oe(this,"id","0");Oe(this,"text","");Oe(this,"createdDate","");Oe(this,"attachment","");Oe(this,"attachmentType");Oe(this,"user",{id:""});Oe(this,"isRightSided",!1);Oe(this,"symbols");this.id=t,this.text=n,this.createdDate=r,this.attachment=i,this.attachmentType=s,this.user=o,this.isRightSided=l,this.symbols=a}}const nn=x.createContext({});function rn(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const Lt=x.createContext(null),sn=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class sa extends tn.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=r instanceof HTMLElement&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function oa({children:e,isPresent:t,anchorX:n}){const r=x.useId(),i=x.useRef(null),s=x.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=x.useContext(sn);return x.useInsertionEffect(()=>{const{width:l,height:a,top:c,left:u,right:f}=s.current;if(t||!i.current||!l||!a)return;const h=n==="left"?`left: ${u}`:`right: ${f}`;i.current.dataset.motionPopId=r;const p=document.createElement("style");return o&&(p.nonce=o),document.head.appendChild(p),p.sheet&&p.sheet.insertRule(`
12
12
  [data-motion-pop-id="${r}"] {
13
13
  position: absolute !important;
14
14
  width: ${l}px !important;
@@ -16,6 +16,6 @@ Check the top-level render call using <`+A+">.")}return P}}function Jo(d,P){{if(
16
16
  ${h}px !important;
17
17
  top: ${c}px !important;
18
18
  }
19
- `),()=>{document.head.removeChild(p)}},[t]),g.exports.jsx(sa,{isPresent:t,childRef:i,sizeRef:s,children:tn.cloneElement(e,{ref:i})})}const aa=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:l})=>{const a=rn(la),c=x.useId(),u=x.useCallback(h=>{a.set(h,!0);for(const p of a.values())if(!p)return;r&&r()},[a,r]),f=x.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:u,register:h=>(a.set(h,!1),()=>a.delete(h))}),s?[Math.random(),u]:[n,u]);return x.useMemo(()=>{a.forEach((h,p)=>a.set(p,!1))},[n]),tn.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),o==="popLayout"&&(e=g.exports.jsx(oa,{isPresent:n,anchorX:l,children:e})),g.exports.jsx(Lt.Provider,{value:f,children:e})};function la(){return new Map}function Fr(e=!0){const t=x.useContext(Lt);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=x.useId();x.useEffect(()=>{if(e)return i(s)},[e]);const o=x.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const kt=e=>e.key||"";function Nr(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const on=typeof window<"u",Br=on?x.useLayoutEffect:x.useEffect,$r=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:l="left"})=>{const[a,c]=Fr(o),u=x.useMemo(()=>Nr(e),[e]),f=o&&!a?[]:u.map(kt),h=x.useRef(!0),p=x.useRef(u),v=rn(()=>new Map),[y,S]=x.useState(u),[b,C]=x.useState(u);Br(()=>{h.current=!1,p.current=u;for(let m=0;m<b.length;m++){const M=kt(b[m]);f.includes(M)?v.delete(M):v.get(M)!==!0&&v.set(M,!1)}},[b,f.length,f.join("-")]);const w=[];if(u!==y){let m=[...u];for(let M=0;M<b.length;M++){const N=b[M],R=kt(N);f.includes(R)||(m.splice(M,0,N),w.push(N))}return s==="wait"&&w.length&&(m=w),C(Nr(m)),S(u),null}process.env.NODE_ENV!=="production"&&s==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:D}=x.useContext(nn);return g.exports.jsx(g.exports.Fragment,{children:b.map(m=>{const M=kt(m),N=o&&!a?!1:u===b||f.includes(M),R=()=>{if(v.has(M))v.set(M,!0);else return;let H=!0;v.forEach(te=>{te||(H=!1)}),H&&(D==null||D(),C(p.current),o&&(c==null||c()),r&&r())};return g.exports.jsx(aa,{isPresent:N,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,onExitComplete:N?void 0:R,anchorX:l,children:m},M)})})},xe=e=>e;let He=xe,Le=xe;process.env.NODE_ENV!=="production"&&(He=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Le=(e,t)=>{if(!e)throw new Error(t)});function an(e){let t;return()=>(t===void 0&&(t=e()),t)}const Xe=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Ae=e=>e*1e3,Re=e=>e/1e3,Ur={skipAnimations:!1,useManualTiming:!1},_t=["read","resolveKeyframes","update","preRender","render","postRender"],ke={value:null,addProjectionMetrics:null};function ua(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},a=0;function c(f){o.has(f)&&(u.schedule(f),e()),a++,f(l)}const u={schedule:(f,h=!1,p=!1)=>{const y=p&&i?n:r;return h&&o.add(f),y.has(f)||y.add(f),f},cancel:f=>{r.delete(f),o.delete(f)},process:f=>{if(l=f,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(c),t&&ke.value&&ke.value.frameloop[t].push(a),a=0,n.clear(),i=!1,s&&(s=!1,u.process(f))}};return u}const ca=40;function Wr(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=_t.reduce((b,C)=>(b[C]=ua(s,t?C:void 0),b),{}),{read:l,resolveKeyframes:a,update:c,preRender:u,render:f,postRender:h}=o,p=()=>{const b=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(b-i.timestamp,ca),1),i.timestamp=b,i.isProcessing=!0,l.process(i),a.process(i),c.process(i),u.process(i),f.process(i),h.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},v=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:_t.reduce((b,C)=>{const w=o[C];return b[C]=(D,m=!1,M=!1)=>(n||v(),w.schedule(D,m,M)),b},{}),cancel:b=>{for(let C=0;C<_t.length;C++)o[_t[C]].cancel(b)},state:i,steps:o}}const{schedule:ee,cancel:_e,state:fe,steps:ln}=Wr(typeof requestAnimationFrame<"u"?requestAnimationFrame:xe,!0),zr=x.createContext({strict:!1}),Yr={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ze={};for(const e in Yr)Ze[e]={isEnabled:t=>Yr[e].some(n=>!!t[n])};function fa(e){for(const t in e)Ze[t]={...Ze[t],...e[t]}}const da=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function It(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||da.has(e)}let Kr=e=>!It(e);function ha(e){e&&(Kr=t=>t.startsWith("on")?!It(t):e(t))}try{ha(require("@emotion/is-prop-valid").default)}catch{}function pa(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Kr(i)||n===!0&&It(i)||!t&&!It(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const qr=new Set;function Ft(e,t,n){e||qr.has(t)||(console.warn(t),n&&console.warn(n),qr.add(t))}function ma(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Ft(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Nt=x.createContext({});function Bt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function dt(e){return typeof e=="string"||Array.isArray(e)}const un=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cn=["initial",...un];function $t(e){return Bt(e.animate)||cn.some(t=>dt(e[t]))}function Gr(e){return Boolean($t(e)||e.variants)}function ga(e,t){if($t(e)){const{initial:n,animate:r}=e;return{initial:n===!1||dt(n)?n:void 0,animate:dt(r)?r:void 0}}return e.inherit!==!1?t:{}}function ya(e){const{initial:t,animate:n}=ga(e,x.useContext(Nt));return x.useMemo(()=>({initial:t,animate:n}),[Hr(t),Hr(n)])}function Hr(e){return Array.isArray(e)?e.join(" "):e}const va=Symbol.for("motionComponentSymbol");function Je(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function xa(e,t,n){return x.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Je(n)&&(n.current=r))},[t])}const fn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Xr="data-"+fn("framerAppearId"),{schedule:dn,cancel:kd}=Wr(queueMicrotask,!1),Zr=x.createContext({});function ba(e,t,n,r,i){var s,o;const{visualElement:l}=x.useContext(Nt),a=x.useContext(zr),c=x.useContext(Lt),u=x.useContext(sn).reducedMotion,f=x.useRef(null);r=r||a.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=f.current,p=x.useContext(Zr);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&Ta(f.current,n,i,p);const v=x.useRef(!1);x.useInsertionEffect(()=>{h&&v.current&&h.update(n,c)});const y=n[Xr],S=x.useRef(Boolean(y)&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,y))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,y)));return Br(()=>{h&&(v.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),dn.render(h.render),S.current&&h.animationState&&h.animationState.animateChanges())}),x.useEffect(()=>{h&&(!S.current&&h.animationState&&h.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,y)}),S.current=!1))}),h}function Ta(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:l,layoutScroll:a,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Jr(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:Boolean(o)||l&&Je(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:a,layoutRoot:c})}function Jr(e){if(e)return e.options.allowProjection!==!1?e.projection:Jr(e.parent)}function wa({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var s,o;e&&fa(e);function l(c,u){let f;const h={...x.useContext(sn),...c,layoutId:Pa(c)},{isStatic:p}=h,v=ya(c),y=r(c,p);if(!p&&on){Sa(h,e);const S=Ca(h);f=S.MeasureLayout,v.visualElement=ba(i,y,h,t,S.ProjectionNode)}return g.exports.jsxs(Nt.Provider,{value:v,children:[f&&v.visualElement?g.exports.jsx(f,{visualElement:v.visualElement,...h}):null,n(i,c,xa(y,v.visualElement,u),y,p,v.visualElement)]})}l.displayName=`motion.${typeof i=="string"?i:`create(${(o=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&o!==void 0?o:""})`}`;const a=x.forwardRef(l);return a[va]=i,a}function Pa({layoutId:e}){const t=x.useContext(nn).id;return t&&e!==void 0?t+"-"+e:e}function Sa(e,t){const n=x.useContext(zr).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?He(!1,r):Le(!1,r)}}function Ca(e){const{drag:t,layout:n}=Ze;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Qr=e=>t=>typeof t=="string"&&t.startsWith(e),hn=Qr("--"),Ea=Qr("var(--"),pn=e=>Ea(e)?Aa.test(e.split("/*")[0].trim()):!1,Aa=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ht={};function ja(e){for(const t in e)ht[t]=e[t],hn(t)&&(ht[t].isCSSVariable=!0)}const Qe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ue=new Set(Qe);function ei(e,{layout:t,layoutId:n}){return Ue.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ht[e]||e==="opacity")}const pe=e=>Boolean(e&&e.getVelocity),ti=(e,t)=>t&&typeof e=="number"?t.transform(e):e,De=(e,t,n)=>n>t?t:n<e?e:n,et={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},pt={...et,transform:e=>De(0,1,e)},Ut={...et,default:1},mt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ie=mt("deg"),je=mt("%"),V=mt("px"),Ma=mt("vh"),Ra=mt("vw"),ni={...je,parse:e=>je.parse(e)/100,transform:e=>je.transform(e*100)},Da={borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,radius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,top:V,right:V,bottom:V,left:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,backgroundPositionX:V,backgroundPositionY:V},Va={rotate:Ie,rotateX:Ie,rotateY:Ie,rotateZ:Ie,scale:Ut,scaleX:Ut,scaleY:Ut,scaleZ:Ut,skew:Ie,skewX:Ie,skewY:Ie,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,transformPerspective:V,opacity:pt,originX:ni,originY:ni,originZ:V},ri={...et,transform:Math.round},mn={...Da,...Va,zIndex:ri,size:V,fillOpacity:pt,strokeOpacity:pt,numOctaves:ri},Oa={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},La=Qe.length;function ka(e,t,n){let r="",i=!0;for(let s=0;s<La;s++){const o=Qe[s],l=e[o];if(l===void 0)continue;let a=!0;if(typeof l=="number"?a=l===(o.startsWith("scale")?1:0):a=parseFloat(l)===0,!a||n){const c=ti(l,mn[o]);if(!a){i=!1;const u=Oa[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function gn(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,l=!1;for(const a in t){const c=t[a];if(Ue.has(a)){o=!0;continue}else if(hn(a)){i[a]=c;continue}else{const u=ti(c,mn[a]);a.startsWith("origin")?(l=!0,s[a]=u):r[a]=u}}if(t.transform||(o||n?r.transform=ka(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:a="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${a} ${c} ${u}`}}const yn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ii(e,t,n){for(const r in t)!pe(t[r])&&!ei(r,n)&&(e[r]=t[r])}function _a({transformTemplate:e},t){return x.useMemo(()=>{const n=yn();return gn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ia(e,t){const n=e.style||{},r={};return ii(r,n,e),Object.assign(r,_a(e,t)),r}function Fa(e,t){const n={},r=Ia(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Na=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function vn(e){return typeof e!="string"||e.includes("-")?!1:!!(Na.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ba={offset:"stroke-dashoffset",array:"stroke-dasharray"},$a={offset:"strokeDashoffset",array:"strokeDasharray"};function Ua(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?Ba:$a;e[s.offset]=V.transform(-r);const o=V.transform(t),l=V.transform(n);e[s.array]=`${o} ${l}`}function si(e,t,n){return typeof e=="string"?e:V.transform(t+n*e)}function Wa(e,t,n){const r=si(t,e.x,e.width),i=si(n,e.y,e.height);return`${r} ${i}`}function xn(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:l=1,pathOffset:a=0,...c},u,f){if(gn(e,c,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:v}=e;h.transform&&(v&&(p.transform=h.transform),delete h.transform),v&&(i!==void 0||s!==void 0||p.transform)&&(p.transformOrigin=Wa(v,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Ua(h,o,l,a,!1)}const oi=()=>({...yn(),attrs:{}}),bn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function za(e,t,n,r){const i=x.useMemo(()=>{const s=oi();return xn(s,t,bn(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};ii(s,e.style,e),i.style={...s,...i.style}}return i}function Ya(e=!1){return(n,r,i,{latestValues:s},o)=>{const a=(vn(n)?za:Fa)(r,s,o,n),c=pa(r,typeof n=="string",e),u=n!==x.Fragment?{...c,...a,ref:i}:{},{children:f}=r,h=x.useMemo(()=>pe(f)?f.get():f,[f]);return x.createElement(n,{...u,children:h})}}function ai(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Tn(e,t,n,r){if(typeof t=="function"){const[i,s]=ai(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=ai(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const wn=e=>Array.isArray(e),Ka=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),qa=e=>wn(e)?e[e.length-1]||0:e;function Wt(e){const t=pe(e)?e.get():e;return Ka(t)?t.toValue():t}function Ga({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:Ha(r,i,s,e),renderState:t()};return n&&(o.onMount=l=>n({props:r,current:l,...o}),o.onUpdate=l=>n(l)),o}const li=e=>(t,n)=>{const r=x.useContext(Nt),i=x.useContext(Lt),s=()=>Ga(e,t,r,i);return n?s():rn(s)};function Ha(e,t,n,r){const i={},s=r(e,{});for(const h in s)i[h]=Wt(s[h]);let{initial:o,animate:l}=e;const a=$t(e),c=Gr(e);t&&c&&!a&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?l:o;if(f&&typeof f!="boolean"&&!Bt(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const v=Tn(e,h[p]);if(v){const{transitionEnd:y,transition:S,...b}=v;for(const C in b){let w=b[C];if(Array.isArray(w)){const D=u?w.length-1:0;w=w[D]}w!==null&&(i[C]=w)}for(const C in y)i[C]=y[C]}}}return i}function Pn(e,t,n){var r;const{style:i}=e,s={};for(const o in i)(pe(i[o])||t.style&&pe(t.style[o])||ei(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[o]=i[o]);return s}const Xa={useVisualState:li({scrapeMotionValuesFromProps:Pn,createRenderState:yn})};function ui(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function ci(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const fi=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function di(e,t,n,r){ci(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(fi.has(i)?i:fn(i),t.attrs[i])}function hi(e,t,n){const r=Pn(e,t,n);for(const i in e)if(pe(e[i])||pe(t[i])){const s=Qe.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const pi=["x","y","width","height","cx","cy","r"],Za={useVisualState:li({scrapeMotionValuesFromProps:hi,createRenderState:oi,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const l in i)if(Ue.has(l)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let l=0;l<pi.length;l++){const a=pi[l];e[a]!==t[a]&&(o=!0)}o&&ee.read(()=>{ui(n,r),ee.render(()=>{xn(r,i,bn(n.tagName),e.transformTemplate),di(n,r)})})}})};function Ja(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...vn(r)?Za:Xa,preloadedFeatures:e,useRender:Ya(i),createVisualElement:t,Component:r};return wa(o)}}function gt(e,t,n){const r=e.getProps();return Tn(r,t,n!==void 0?n:r.custom,e)}const Qa=an(()=>window.ScrollTimeline!==void 0);class el{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(Qa()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class tl extends el{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Sn(e,t){return e?e[t]||e.default||e:void 0}const Cn=2e4;function mi(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Cn;)t+=n,r=e.next(t);return t>=Cn?1/0:t}function En(e){return typeof e=="function"}function gi(e,t){e.timeline=t,e.onfinish=null}const An=e=>Array.isArray(e)&&typeof e[0]=="number",nl={linearEasing:void 0};function rl(e,t){const n=an(e);return()=>{var r;return(r=nl[t])!==null&&r!==void 0?r:n()}}const zt=rl(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),yi=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(Xe(0,i-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function vi(e){return Boolean(typeof e=="function"&&zt()||!e||typeof e=="string"&&(e in jn||zt())||An(e)||Array.isArray(e)&&e.every(vi))}const yt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,jn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yt([0,.65,.55,1]),circOut:yt([.55,0,1,.45]),backIn:yt([.31,.01,.66,-.59]),backOut:yt([.33,1.53,.69,.99])};function xi(e,t){if(e)return typeof e=="function"&&zt()?yi(e,t):An(e)?yt(e):Array.isArray(e)?e.map(n=>xi(n,t)||jn.easeOut):jn[e]}const Ee={x:!1,y:!1};function bi(){return Ee.x||Ee.y}function il(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;t&&(i=t.current);const s=(r=n==null?void 0:n[e])!==null&&r!==void 0?r:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function Ti(e,t){const n=il(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function wi(e){return!(e.pointerType==="touch"||bi())}function sl(e,t,n={}){const[r,i,s]=Ti(e,n),o=l=>{if(!wi(l))return;const{target:a}=l,c=t(a,l);if(typeof c!="function"||!a)return;const u=f=>{wi(f)&&(c(f),a.removeEventListener("pointerleave",u))};a.addEventListener("pointerleave",u,i)};return r.forEach(l=>{l.addEventListener("pointerenter",o,i)}),s}function Yt(e,t){const n=`${t}PointerCapture`;if(e.target instanceof Element&&n in e.target&&e.pointerId!==void 0)try{e.target[n](e.pointerId)}catch{}}const Pi=(e,t)=>t?e===t?!0:Pi(e,t.parentElement):!1,Mn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,ol=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function al(e){return ol.has(e.tagName)||e.tabIndex!==-1}const vt=new WeakSet;function Si(e){return t=>{t.key==="Enter"&&e(t)}}function Rn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const ll=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Si(()=>{if(vt.has(n))return;Rn(n,"down");const i=Si(()=>{Rn(n,"up")}),s=()=>Rn(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Ci(e){return Mn(e)&&!bi()}function ul(e,t,n={}){const[r,i,s]=Ti(e,n),o=l=>{const a=l.currentTarget;if(!a||!Ci(l)||vt.has(a))return;vt.add(a),Yt(l,"set");const c=t(a,l),u=(p,v)=>{a.removeEventListener("pointerup",f),a.removeEventListener("pointercancel",h),Yt(p,"release"),!(!Ci(p)||!vt.has(a))&&(vt.delete(a),typeof c=="function"&&c(p,{success:v}))},f=p=>{(p.isTrusted?cl(p,a instanceof Element?a.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?u(p,!1):u(p,!(a instanceof Element)||Pi(a,p.target))},h=p=>{u(p,!1)};a.addEventListener("pointerup",f,i),a.addEventListener("pointercancel",h,i),a.addEventListener("lostpointercapture",h,i)};return r.forEach(l=>{l=n.useGlobalTarget?window:l;let a=!1;l instanceof HTMLElement&&(a=!0,!al(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0)),l.addEventListener("pointerdown",o,i),a&&l.addEventListener("focus",c=>ll(c,i),i)}),s}function cl(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function fl(e){return e==="x"||e==="y"?Ee[e]?null:(Ee[e]=!0,()=>{Ee[e]=!1}):Ee.x||Ee.y?null:(Ee.x=Ee.y=!0,()=>{Ee.x=Ee.y=!1})}const Ei=new Set(["width","height","top","left","right","bottom",...Qe]);let Kt;function dl(){Kt=void 0}const Me={now:()=>(Kt===void 0&&Me.set(fe.isProcessing||Ur.useManualTiming?fe.timestamp:performance.now()),Kt),set:e=>{Kt=e,queueMicrotask(dl)}};function Dn(e,t){e.indexOf(t)===-1&&e.push(t)}function Vn(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class On{constructor(){this.subscriptions=[]}add(t){return Dn(this.subscriptions,t),()=>Vn(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Ai(e,t){return t?e*(1e3/t):0}const ji=30,hl=e=>!isNaN(parseFloat(e));class pl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=Me.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Me.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=hl(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ft(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new On);const r=this.events[t].add(n);return t==="change"?()=>{r(),ee.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Me.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ji)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ji);return Ai(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function xt(e,t){return new pl(e,t)}function ml(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,xt(n))}function gl(e,t){const n=gt(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const l=qa(s[o]);ml(e,o,l)}}function yl(e){return Boolean(pe(e)&&e.add)}function Ln(e,t){const n=e.getValue("willChange");if(yl(n))return n.add(t)}function Mi(e){return e.props[Xr]}const vl={current:!1},Ri=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,xl=1e-7,bl=12;function Tl(e,t,n,r,i){let s,o,l=0;do o=t+(n-t)/2,s=Ri(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>xl&&++l<bl);return o}function bt(e,t,n,r){if(e===t&&n===r)return xe;const i=s=>Tl(s,0,1,e,n);return s=>s===0||s===1?s:Ri(i(s),t,r)}const Di=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Vi=e=>t=>1-e(1-t),Oi=bt(.33,1.53,.69,.99),kn=Vi(Oi),Li=Di(kn),ki=e=>(e*=2)<1?.5*kn(e):.5*(2-Math.pow(2,-10*(e-1))),_n=e=>1-Math.sin(Math.acos(e)),_i=Vi(_n),Ii=Di(_n),Fi=e=>/^0[^.\s]+$/u.test(e);function wl(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Fi(e):!0}const Tt=e=>Math.round(e*1e5)/1e5,In=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Pl(e){return e==null}const Sl=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Fn=(e,t)=>n=>Boolean(typeof n=="string"&&Sl.test(n)&&n.startsWith(e)||t&&!Pl(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ni=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,l]=r.match(In);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Cl=e=>De(0,255,e),Nn={...et,transform:e=>Math.round(Cl(e))},We={test:Fn("rgb","red"),parse:Ni("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Nn.transform(e)+", "+Nn.transform(t)+", "+Nn.transform(n)+", "+Tt(pt.transform(r))+")"};function El(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Bn={test:Fn("#"),parse:El,transform:We.transform},tt={test:Fn("hsl","hue"),parse:Ni("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+je.transform(Tt(t))+", "+je.transform(Tt(n))+", "+Tt(pt.transform(r))+")"},me={test:e=>We.test(e)||Bn.test(e)||tt.test(e),parse:e=>We.test(e)?We.parse(e):tt.test(e)?tt.parse(e):Bn.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?We.transform(e):tt.transform(e)},Al=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function jl(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(In))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Al))===null||n===void 0?void 0:n.length)||0)>0}const Bi="number",$i="color",Ml="var",Rl="var(",Ui="${}",Dl=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function wt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const l=t.replace(Dl,a=>(me.test(a)?(r.color.push(s),i.push($i),n.push(me.parse(a))):a.startsWith(Rl)?(r.var.push(s),i.push(Ml),n.push(a)):(r.number.push(s),i.push(Bi),n.push(parseFloat(a))),++s,Ui)).split(Ui);return{values:n,split:l,indexes:r,types:i}}function Wi(e){return wt(e).values}function zi(e){const{split:t,types:n}=wt(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const l=n[o];l===Bi?s+=Tt(i[o]):l===$i?s+=me.transform(i[o]):s+=i[o]}return s}}const Vl=e=>typeof e=="number"?0:e;function Ol(e){const t=Wi(e);return zi(e)(t.map(Vl))}const Fe={test:jl,parse:Wi,createTransformer:zi,getAnimatableNone:Ol},Ll=new Set(["brightness","contrast","saturate","opacity"]);function kl(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(In)||[];if(!r)return e;const i=n.replace(r,"");let s=Ll.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const _l=/\b([a-z-]*)\(.*?\)/gu,$n={...Fe,getAnimatableNone:e=>{const t=e.match(_l);return t?t.map(kl).join(" "):e}},Il={...mn,color:me,backgroundColor:me,outlineColor:me,fill:me,stroke:me,borderColor:me,borderTopColor:me,borderRightColor:me,borderBottomColor:me,borderLeftColor:me,filter:$n,WebkitFilter:$n},Un=e=>Il[e];function Yi(e,t){let n=Un(e);return n!==$n&&(n=Fe),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Fl=new Set(["auto","none","0"]);function Nl(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!Fl.has(s)&&wt(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=Yi(n,i)}const Ki=e=>e===et||e===V,qi=(e,t)=>parseFloat(e.split(", ")[t]),Gi=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return qi(i[1],t);{const s=r.match(/^matrix\((.+)\)$/u);return s?qi(s[1],e):0}},Bl=new Set(["x","y","z"]),$l=Qe.filter(e=>!Bl.has(e));function Ul(e){const t=[];return $l.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const nt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Gi(4,13),y:Gi(5,14)};nt.translateX=nt.x,nt.translateY=nt.y;const ze=new Set;let Wn=!1,zn=!1;function Hi(){if(zn){const e=Array.from(ze).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=Ul(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var l;(l=r.getValue(s))===null||l===void 0||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}zn=!1,Wn=!1,ze.forEach(e=>e.complete()),ze.clear()}function Xi(){ze.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zn=!0)})}function Wl(){Xi(),Hi()}class Yn{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ze.add(this),Wn||(Wn=!0,ee.read(Xi),ee.resolveKeyframes(Hi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=i==null?void 0:i.get(),l=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const a=r.readValue(n,l);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=l),i&&o===void 0&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ze.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ze.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Zi=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),zl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Yl(e){const t=zl.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const Kl=4;function Ji(e,t,n=1){Le(n<=Kl,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,i]=Yl(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return Zi(o)?parseFloat(o):o}return pn(i)?Ji(i,t,n+1):i}const Qi=e=>t=>t.test(e),es=[et,V,je,Ie,Ra,Ma,{test:e=>e==="auto",parse:e=>e}],ts=e=>es.find(Qi(e));class ns extends Yn{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let a=0;a<t.length;a++){let c=t[a];if(typeof c=="string"&&(c=c.trim(),pn(c))){const u=Ji(c,n.current);u!==void 0&&(t[a]=u),a===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Ei.has(r)||t.length!==2)return;const[i,s]=t,o=ts(i),l=ts(s);if(o!==l)if(Ki(o)&&Ki(l))for(let a=0;a<t.length;a++){const c=t[a];typeof c=="string"&&(t[a]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)wl(t[i])&&r.push(i);r.length&&Nl(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=nt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,l=i[o];i[o]=nt[r](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([a,c])=>{n.getValue(a).set(c)}),this.resolveNoneKeyframes()}}const rs=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Fe.test(e)||e==="0")&&!e.startsWith("url("));function ql(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Gl(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=rs(i,t),l=rs(s,t);return He(o===l,`You are trying to animate ${t} from "${i}" to "${s}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${s} via the \`style\` property.`),!o||!l?!1:ql(e)||(n==="spring"||En(n))&&r}const Hl=e=>e!==null;function qt(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(Hl),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const Xl=40;class is{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Me.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Xl?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Wl(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Me.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:l,onUpdate:a,isGenerator:c}=this.options;if(!c&&!Gl(t,r,i,s))if(o)this.options.duration=0;else{a&&a(qt(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Pt={layout:0,mainThread:0,waapi:0},ne=(e,t,n)=>e+(t-e)*n;function Kn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Zl({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,a=2*n-l;i=Kn(a,l,e+1/3),s=Kn(a,l,e),o=Kn(a,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function Gt(e,t){return n=>n>0?t:e}const qn=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Jl=[Bn,We,tt],Ql=e=>Jl.find(t=>t.test(e));function ss(e){const t=Ql(e);if(He(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===tt&&(n=Zl(n)),n}const os=(e,t)=>{const n=ss(e),r=ss(t);if(!n||!r)return Gt(e,t);const i={...n};return s=>(i.red=qn(n.red,r.red,s),i.green=qn(n.green,r.green,s),i.blue=qn(n.blue,r.blue,s),i.alpha=ne(n.alpha,r.alpha,s),We.transform(i))},eu=(e,t)=>n=>t(e(n)),St=(...e)=>e.reduce(eu),Gn=new Set(["none","hidden"]);function tu(e,t){return Gn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function nu(e,t){return n=>ne(e,t,n)}function Hn(e){return typeof e=="number"?nu:typeof e=="string"?pn(e)?Gt:me.test(e)?os:su:Array.isArray(e)?as:typeof e=="object"?me.test(e)?os:ru:Gt}function as(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Hn(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function ru(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Hn(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function iu(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],l=e.indexes[o][i[o]],a=(n=e.values[l])!==null&&n!==void 0?n:0;r[s]=a,i[o]++}return r}const su=(e,t)=>{const n=Fe.createTransformer(t),r=wt(e),i=wt(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Gn.has(e)&&!i.values.length||Gn.has(t)&&!r.values.length?tu(e,t):St(as(iu(r,i),i.values),n):(He(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Gt(e,t))};function ls(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ne(e,t,n):Hn(e)(e,t)}const ou=5;function us(e,t,n){const r=Math.max(t-ou,0);return Ai(n-e(r),t-r)}const re={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Xn=.001;function au({duration:e=re.duration,bounce:t=re.bounce,velocity:n=re.velocity,mass:r=re.mass}){let i,s;He(e<=Ae(re.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=De(re.minDamping,re.maxDamping,o),e=De(re.minDuration,re.maxDuration,Re(e)),o<1?(i=c=>{const u=c*o,f=u*e,h=u-n,p=Zn(c,o),v=Math.exp(-f);return Xn-h/p*v},s=c=>{const f=c*o*e,h=f*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,v=Math.exp(-f),y=Zn(Math.pow(c,2),o);return(-i(c)+Xn>0?-1:1)*((h-p)*v)/y}):(i=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Xn+u*f},s=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const l=5/e,a=uu(i,s,l);if(e=Ae(e),isNaN(a))return{stiffness:re.stiffness,damping:re.damping,duration:e};{const c=Math.pow(a,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const lu=12;function uu(e,t,n){let r=n;for(let i=1;i<lu;i++)r=r-e(r)/t(r);return r}function Zn(e,t){return e*Math.sqrt(1-t*t)}const cu=["duration","bounce"],fu=["stiffness","damping","mass"];function cs(e,t){return t.some(n=>e[n]!==void 0)}function du(e){let t={velocity:re.velocity,stiffness:re.stiffness,damping:re.damping,mass:re.mass,isResolvedFromDuration:!1,...e};if(!cs(e,fu)&&cs(e,cu))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*De(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:re.mass,stiffness:i,damping:s}}else{const n=au(e);t={...t,...n,mass:re.mass},t.isResolvedFromDuration=!0}return t}function fs(e=re.visualDuration,t=re.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:a,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:p}=du({...n,velocity:-Re(n.velocity||0)}),v=h||0,y=c/(2*Math.sqrt(a*u)),S=o-s,b=Re(Math.sqrt(a/u)),C=Math.abs(S)<5;r||(r=C?re.restSpeed.granular:re.restSpeed.default),i||(i=C?re.restDelta.granular:re.restDelta.default);let w;if(y<1){const m=Zn(b,y);w=M=>{const N=Math.exp(-y*b*M);return o-N*((v+y*b*S)/m*Math.sin(m*M)+S*Math.cos(m*M))}}else if(y===1)w=m=>o-Math.exp(-b*m)*(S+(v+b*S)*m);else{const m=b*Math.sqrt(y*y-1);w=M=>{const N=Math.exp(-y*b*M),R=Math.min(m*M,300);return o-N*((v+y*b*S)*Math.sinh(R)+m*S*Math.cosh(R))/m}}const D={calculatedDuration:p&&f||null,next:m=>{const M=w(m);if(p)l.done=m>=f;else{let N=0;y<1&&(N=m===0?Ae(v):us(w,m,M));const R=Math.abs(N)<=r,H=Math.abs(o-M)<=i;l.done=R&&H}return l.value=l.done?o:M,l},toString:()=>{const m=Math.min(mi(D),Cn),M=yi(N=>D.next(m*N).value,m,30);return m+"ms "+M}};return D}function ds({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:l,max:a,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},p=R=>l!==void 0&&R<l||a!==void 0&&R>a,v=R=>l===void 0?a:a===void 0||Math.abs(l-R)<Math.abs(a-R)?l:a;let y=n*t;const S=f+y,b=o===void 0?S:o(S);b!==S&&(y=b-f);const C=R=>-y*Math.exp(-R/r),w=R=>b+C(R),D=R=>{const H=C(R),te=w(R);h.done=Math.abs(H)<=c,h.value=h.done?b:te};let m,M;const N=R=>{p(h.value)&&(m=R,M=fs({keyframes:[h.value,v(h.value)],velocity:us(w,R,h.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return N(0),{calculatedDuration:null,next:R=>{let H=!1;return!M&&m===void 0&&(H=!0,D(R),N(R)),m!==void 0&&R>=m?M.next(R-m):(!H&&D(R),h)}}}const hu=bt(.42,0,1,1),pu=bt(0,0,.58,1),hs=bt(.42,0,.58,1),mu=e=>Array.isArray(e)&&typeof e[0]!="number",ps={linear:xe,easeIn:hu,easeInOut:hs,easeOut:pu,circIn:_n,circInOut:Ii,circOut:_i,backIn:kn,backInOut:Li,backOut:Oi,anticipate:ki},ms=e=>{if(An(e)){Le(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,i]=e;return bt(t,n,r,i)}else if(typeof e=="string")return Le(ps[e]!==void 0,`Invalid easing type '${e}'`),ps[e];return e};function gu(e,t,n){const r=[],i=n||ls,s=e.length-1;for(let o=0;o<s;o++){let l=i(e[o],e[o+1]);if(t){const a=Array.isArray(t)?t[o]||xe:t;l=St(a,l)}r.push(l)}return r}function yu(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(Le(s===t.length,"Both input and output ranges must be the same length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=gu(t,r,i),a=l.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(a>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=Xe(e[f],e[f+1],u);return l[f](h)};return n?u=>c(De(e[0],e[s-1],u)):c}function vu(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Xe(0,t,r);e.push(ne(n,1,i))}}function xu(e){const t=[0];return vu(t,e.length-1),t}function bu(e,t){return e.map(n=>n*t)}function Tu(e,t){return e.map(()=>t||hs).splice(0,e.length-1)}function Ct({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=mu(r)?r.map(ms):ms(r),s={done:!1,value:t[0]},o=bu(n&&n.length===t.length?n:xu(t),e),l=yu(o,t,{ease:Array.isArray(i)?i:Tu(t,i)});return{calculatedDuration:e,next:a=>(s.value=l(a),s.done=a>=e,s)}}const wu=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ee.update(t,!0),stop:()=>_e(t),now:()=>fe.isProcessing?fe.timestamp:Me.now()}},Pu={decay:ds,inertia:ds,tween:Ct,keyframes:Ct,spring:fs},Su=e=>e/100;class Jn extends is{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:a}=this.options;a&&a()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Yn,l=(a,c)=>this.onKeyframesResolved(a,c);this.resolver=new o(s,l,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,l=En(n)?n:Pu[n]||Ct;let a,c;process.env.NODE_ENV!=="production"&&l!==Ct&&Le(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l!==Ct&&typeof t[0]!="number"&&(a=St(Su,ls(t[0],t[1])),t=[0,100]);const u=l({...this.options,keyframes:t});s==="mirror"&&(c=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=mi(u));const{calculatedDuration:f}=u,h=f+i,p=h*(r+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:a,calculatedDuration:f,resolvedDuration:h,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;Pt.mainThread++,this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:R}=this.options;return{done:!0,value:R[R.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:a,calculatedDuration:c,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return s.next(0);const{delay:h,repeat:p,repeatType:v,repeatDelay:y,onUpdate:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const b=this.currentTime-h*(this.speed>=0?1:-1),C=this.speed>=0?b<0:b>u;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let w=this.currentTime,D=s;if(p){const R=Math.min(this.currentTime,u)/f;let H=Math.floor(R),te=R%1;!te&&R>=1&&(te=1),te===1&&H--,H=Math.min(H,p+1),Boolean(H%2)&&(v==="reverse"?(te=1-te,y&&(te-=y/f)):v==="mirror"&&(D=o)),w=De(0,1,te)*f}const m=C?{done:!1,value:a[0]}:D.next(w);l&&(m.value=l(m.value));let{done:M}=m;!C&&c!==null&&(M=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return N&&i!==void 0&&(m.value=qt(a,this.options,i)),S&&S(m.value),N&&this.finish(),m}get duration(){const{resolved:t}=this;return t?Re(t.calculatedDuration):0}get time(){return Re(this.currentTime)}set time(t){t=Ae(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Re(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=wu,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel(),Pt.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Cu=new Set(["opacity","clipPath","filter","transform"]);function Eu(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:l="easeInOut",times:a}={}){const c={[t]:n};a&&(c.offset=a);const u=xi(l,i);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const Au=an(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Ht=10,ju=2e4;function Mu(e){return En(e.type)||e.type==="spring"||!vi(e.ease)}function Ru(e,t){const n=new Jn({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<ju;)r=n.sample(s),i.push(r.value),s+=Ht;return{times:void 0,keyframes:i,duration:s-Ht,ease:"linear"}}const gs={anticipate:ki,backInOut:Li,circInOut:Ii};function Du(e){return e in gs}class ys extends is{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new ns(s,(o,l)=>this.onKeyframesResolved(o,l),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:l,name:a,startTime:c}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof s=="string"&&zt()&&Du(s)&&(s=gs[s]),Mu(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:v,...y}=this.options,S=Ru(t,y);t=S.keyframes,t.length===1&&(t[1]=t[0]),r=S.duration,i=S.times,s=S.ease,o="keyframes"}const u=Eu(l.owner.current,a,t,{...this.options,duration:r,times:i,ease:s});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(gi(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;l.set(qt(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Re(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Re(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Ae(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return xe;const{animation:r}=n;gi(r,t)}return xe}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:f,element:h,...p}=this.options,v=new Jn({...p,keyframes:r,duration:i,type:s,ease:o,times:l,isGenerator:!0}),y=Ae(this.time);c.setWithVelocity(v.sample(y-Ht).value,v.sample(y).value,Ht)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:c}=n.owner.getProps();return Au()&&r&&Cu.has(r)&&!a&&!c&&!i&&s!=="mirror"&&o!==0&&l!=="inertia"}}const Vu={type:"spring",stiffness:500,damping:25,restSpeed:10},Ou=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Lu={type:"keyframes",duration:.8},ku={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},_u=(e,{keyframes:t})=>t.length>2?Lu:Ue.has(e)?e.startsWith("scale")?Ou(t[1]):Vu:ku;function Iu({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:l,from:a,elapsed:c,...u}){return!!Object.keys(u).length}const Qn=(e,t,n,r={},i,s)=>o=>{const l=Sn(r,e)||{},a=l.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Ae(a);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-c,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:s?void 0:i};Iu(l)||(u={...u,..._u(e,u)}),u.duration&&(u.duration=Ae(u.duration)),u.repeatDelay&&(u.repeatDelay=Ae(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(f=!0)),(vl.current||Ur.skipAnimations)&&(f=!0,u.duration=0,u.delay=0),f&&!s&&t.get()!==void 0){const h=qt(u.keyframes,l);if(h!==void 0)return ee.update(()=>{u.onUpdate(h),u.onComplete()}),new tl([])}return!s&&ys.supports(u)?new ys(u):new Jn(u)};function Fu({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function vs(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...a}=t;r&&(o=r);const c=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const f in a){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),p=a[f];if(p===void 0||u&&Fu(u,f))continue;const v={delay:n,...Sn(o||{},f)};let y=!1;if(window.MotionHandoffAnimation){const b=Mi(e);if(b){const C=window.MotionHandoffAnimation(b,f,ee);C!==null&&(v.startTime=C,y=!0)}}Ln(e,f),h.start(Qn(f,h,p,e.shouldReduceMotion&&Ei.has(f)?{type:!1}:v,e,y));const S=h.animation;S&&c.push(S)}return l&&Promise.all(c).then(()=>{ee.update(()=>{l&&gl(e,l)})}),c}function er(e,t,n={}){var r;const i=gt(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(vs(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=s;return Nu(e,t,u+c,f,h,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[c,u]=a==="beforeChildren"?[o,l]:[l,o];return c().then(()=>u())}else return Promise.all([o(),l(n.delay)])}function Nu(e,t,n=0,r=0,i=1,s){const o=[],l=(e.variantChildren.size-1)*r,a=i===1?(c=0)=>c*r:(c=0)=>l-c*r;return Array.from(e.variantChildren).sort(Bu).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(er(c,t,{...s,delay:n+a(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function Bu(e,t){return e.sortNodePosition(t)}function $u(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>er(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=er(e,t,n);else{const i=typeof t=="function"?gt(e,t,n.custom):t;r=Promise.all(vs(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function xs(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Uu=cn.length;function bs(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?bs(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Uu;n++){const r=cn[n],i=e.props[r];(dt(i)||i===!1)&&(t[r]=i)}return t}const Wu=[...un].reverse(),zu=un.length;function Yu(e){return t=>Promise.all(t.map(({animation:n,options:r})=>$u(e,n,r)))}function Ku(e){let t=Yu(e),n=Ts(),r=!0;const i=a=>(c,u)=>{var f;const h=gt(e,u,a==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:v,...y}=h;c={...c,...y,...v}}return c};function s(a){t=a(e)}function o(a){const{props:c}=e,u=bs(e.parent)||{},f=[],h=new Set;let p={},v=1/0;for(let S=0;S<zu;S++){const b=Wu[S],C=n[b],w=c[b]!==void 0?c[b]:u[b],D=dt(w),m=b===a?C.isActive:null;m===!1&&(v=S);let M=w===u[b]&&w!==c[b]&&D;if(M&&r&&e.manuallyAnimateOnMount&&(M=!1),C.protectedKeys={...p},!C.isActive&&m===null||!w&&!C.prevProp||Bt(w)||typeof w=="boolean")continue;const N=qu(C.prevProp,w);let R=N||b===a&&C.isActive&&!M&&D||S>v&&D,H=!1;const te=Array.isArray(w)?w:[w];let de=te.reduce(i(b),{});m===!1&&(de={});const{prevResolvedValues:be={}}=C,ae={...be,...de},ie=O=>{R=!0,h.has(O)&&(H=!0,h.delete(O)),C.needsAnimating[O]=!0;const k=e.getValue(O);k&&(k.liveStyle=!1)};for(const O in ae){const k=de[O],le=be[O];if(p.hasOwnProperty(O))continue;let T=!1;wn(k)&&wn(le)?T=!xs(k,le):T=k!==le,T?k!=null?ie(O):h.add(O):k!==void 0&&h.has(O)?ie(O):C.protectedKeys[O]=!0}C.prevProp=w,C.prevResolvedValues=de,C.isActive&&(p={...p,...de}),r&&e.blockInitialAnimation&&(R=!1),R&&(!(M&&N)||H)&&f.push(...te.map(O=>({animation:O,options:{type:b}})))}if(h.size){const S={};if(typeof c.initial!="boolean"){const b=gt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);b&&b.transition&&(S.transition=b.transition)}h.forEach(b=>{const C=e.getBaseTarget(b),w=e.getValue(b);w&&(w.liveStyle=!0),S[b]=C??null}),f.push({animation:S})}let y=Boolean(f.length);return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function l(a,c){var u;if(n[a].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(a,c)}),n[a].isActive=c;const f=o(a);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Ts(),r=!0}}}function qu(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!xs(t,e):!1}function Ye(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ts(){return{animate:Ye(!0),whileInView:Ye(),whileHover:Ye(),whileTap:Ye(),whileDrag:Ye(),whileFocus:Ye(),exit:Ye()}}class Ne{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Gu extends Ne{constructor(t){super(t),t.animationState||(t.animationState=Ku(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Bt(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let Hu=0;class Xu extends Ne{constructor(){super(...arguments),this.id=Hu++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Zu={animation:{Feature:Gu},exit:{Feature:Xu}};function Et(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function At(e){return{point:{x:e.pageX,y:e.pageY}}}const Ju=e=>t=>Mn(t)&&e(t,At(t));function rt(e,t,n,r){return Et(e,t,Ju(n),r)}function ws({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Qu({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ec(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Ps=1e-4,tc=1-Ps,nc=1+Ps,Ss=.01,rc=0-Ss,ic=0+Ss;function ye(e){return e.max-e.min}function sc(e,t,n){return Math.abs(e-t)<=n}function Cs(e,t,n,r=.5){e.origin=r,e.originPoint=ne(t.min,t.max,e.origin),e.scale=ye(n)/ye(t),e.translate=ne(n.min,n.max,e.origin)-e.originPoint,(e.scale>=tc&&e.scale<=nc||isNaN(e.scale))&&(e.scale=1),(e.translate>=rc&&e.translate<=ic||isNaN(e.translate))&&(e.translate=0)}function jt(e,t,n,r){Cs(e.x,t.x,n.x,r?r.originX:void 0),Cs(e.y,t.y,n.y,r?r.originY:void 0)}function Es(e,t,n){e.min=n.min+t.min,e.max=e.min+ye(t)}function oc(e,t,n){Es(e.x,t.x,n.x),Es(e.y,t.y,n.y)}function As(e,t,n){e.min=t.min-n.min,e.max=e.min+ye(t)}function Mt(e,t,n){As(e.x,t.x,n.x),As(e.y,t.y,n.y)}const js=()=>({translate:0,scale:1,origin:0,originPoint:0}),it=()=>({x:js(),y:js()}),Ms=()=>({min:0,max:0}),se=()=>({x:Ms(),y:Ms()});function Te(e){return[e("x"),e("y")]}function tr(e){return e===void 0||e===1}function nr({scale:e,scaleX:t,scaleY:n}){return!tr(e)||!tr(t)||!tr(n)}function Ke(e){return nr(e)||Rs(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Rs(e){return Ds(e.x)||Ds(e.y)}function Ds(e){return e&&e!=="0%"}function Xt(e,t,n){const r=e-n,i=t*r;return n+i}function Vs(e,t,n,r,i){return i!==void 0&&(e=Xt(e,i,r)),Xt(e,n,r)+t}function rr(e,t=0,n=1,r,i){e.min=Vs(e.min,t,n,r,i),e.max=Vs(e.max,t,n,r,i)}function Os(e,{x:t,y:n}){rr(e.x,t.translate,t.scale,t.originPoint),rr(e.y,n.translate,n.scale,n.originPoint)}const Ls=.999999999999,ks=1.0000000000001;function ac(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let l=0;l<i;l++){s=n[l],o=s.projectionDelta;const{visualElement:a}=s.options;a&&a.props.style&&a.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&ot(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Os(e,o)),r&&Ke(s.latestValues)&&ot(e,s.latestValues))}t.x<ks&&t.x>Ls&&(t.x=1),t.y<ks&&t.y>Ls&&(t.y=1)}function st(e,t){e.min=e.min+t,e.max=e.max+t}function _s(e,t,n,r,i=.5){const s=ne(e.min,e.max,i);rr(e,t,n,s,r)}function ot(e,t){_s(e.x,t.x,t.scaleX,t.scale,t.originX),_s(e.y,t.y,t.scaleY,t.scale,t.originY)}function Is(e,t){return ws(ec(e.getBoundingClientRect(),t))}function lc(e,t,n){const r=Is(e,n),{scroll:i}=t;return i&&(st(r.x,i.offset.x),st(r.y,i.offset.y)),r}const Fs=(e,t)=>Math.abs(e-t);function uc(e,t){const n=Fs(e.x,t.x),r=Fs(e.y,t.y);return Math.sqrt(n**2+r**2)}class Ns{constructor(t,n,{transformPagePoint:r,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=sr(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=uc(u.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:p}=u,{timestamp:v}=fe;this.history.push({...p,timestamp:v});const{onStart:y,onMove:S}=this.handlers;f||(y&&y(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,u)},this.handlePointerMove=(u,f)=>{if(u.target instanceof Element&&u.target.hasPointerCapture&&u.pointerId!==void 0)try{if(!u.target.hasPointerCapture(u.pointerId))return}catch{}this.lastMoveEvent=u,this.lastMoveEventInfo=ir(f,this.transformPagePoint),ee.update(this.updatePoint,!0)},this.handlePointerUp=(u,f)=>{Yt(u,"release"),this.end();const{onEnd:h,onSessionEnd:p,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=sr(u.type==="pointercancel"||u.type==="lostpointercapture"?this.lastMoveEventInfo:ir(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,y),p&&p(u,y)},!Mn(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r;const s=At(t),o=ir(s,this.transformPagePoint),{point:l}=o,{timestamp:a}=fe;this.history=[{...l,timestamp:a}];const{onSessionStart:c}=n;c&&c(t,sr(o,this.history)),Yt(t,"set"),this.removeListeners=St(rt(t.currentTarget,"pointermove",this.handlePointerMove),rt(t.currentTarget,"pointerup",this.handlePointerUp),rt(t.currentTarget,"pointercancel",this.handlePointerUp),rt(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),_e(this.updatePoint)}}function ir(e,t){return t?{point:t(e.point)}:e}function Bs(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sr({point:e},t){return{point:e,delta:Bs(e,$s(t)),offset:Bs(e,cc(t)),velocity:fc(t,.1)}}function cc(e){return e[0]}function $s(e){return e[e.length-1]}function fc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=$s(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ae(t)));)n--;if(!r)return{x:0,y:0};const s=Re(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function dc(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ne(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ne(n,e,r.max):Math.min(e,n)),e}function Us(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function hc(e,{top:t,left:n,bottom:r,right:i}){return{x:Us(e.x,n,i),y:Us(e.y,t,r)}}function Ws(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function pc(e,t){return{x:Ws(e.x,t.x),y:Ws(e.y,t.y)}}function mc(e,t){let n=.5;const r=ye(e),i=ye(t);return i>r?n=Xe(t.min,t.max-r,e.min):r>i&&(n=Xe(e.min,e.max-i,t.min)),De(0,1,n)}function gc(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const or=.35;function yc(e=or){return e===!1?e=0:e===!0&&(e=or),{x:zs(e,"left","right"),y:zs(e,"top","bottom")}}function zs(e,t,n){return{min:Ys(e,t),max:Ys(e,n)}}function Ys(e,t){return typeof e=="number"?e:e[t]||0}const vc=new WeakMap;class xc{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=se(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(At(u).point)},s=(u,f)=>{const{drag:h,dragPropagation:p,onDragStart:v}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=fl(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Te(S=>{let b=this.getAxisMotionValue(S).get()||0;if(je.test(b)){const{projection:C}=this.visualElement;if(C&&C.layout){const w=C.layout.layoutBox[S];w&&(b=ye(w)*(parseFloat(b)/100))}}this.originPoint[S]=b}),v&&ee.postRender(()=>v(u,f)),Ln(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:v,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:S}=f;if(p&&this.currentDirection===null){this.currentDirection=bc(S),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",f.point,S),this.updateAxis("y",f.point,S),this.visualElement.render(),y&&y(u,f)},l=(u,f)=>this.stop(u,f),a=()=>Te(u=>{var f;return this.getAnimationState(u)==="paused"&&((f=this.getAxisMotionValue(u).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Ns(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:l,resumeAnimation:a},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&ee.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Zt(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=dc(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&Je(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=hc(i.layoutBox,n):this.constraints=!1,this.elastic=yc(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Te(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=gc(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Je(t))return!1;const r=t.current;Le(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=lc(r,i.root,this.visualElement.getTransformPagePoint());let o=pc(i.layout.layoutBox,s);if(n){const l=n(Qu(o));this.hasMutatedConstraints=!!l,l&&(o=ws(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),a=this.constraints||{},c=Te(u=>{if(!Zt(u,n,this.currentDirection))return;let f=a&&a[u]||{};o&&(f={min:0,max:0});const h=i?200:1e6,p=i?40:1e7,v={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(u,v)});return Promise.all(c).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ln(this.visualElement,t),r.start(Qn(t,r,0,n,this.visualElement,!1))}stopAnimation(){Te(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Te(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Te(n=>{const{drag:r}=this.getProps();if(!Zt(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:l}=i.layout.layoutBox[n];s.set(t[n]-ne(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Je(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Te(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const a=l.get();i[o]=mc({min:a,max:a},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Te(o=>{if(!Zt(o,t,null))return;const l=this.getAxisMotionValue(o),{min:a,max:c}=this.constraints[o];l.set(ne(a,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;vc.set(this.visualElement,this);const t=this.visualElement.current,n=rt(t,"pointerdown",a=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(a)}),r=()=>{const{dragConstraints:a}=this.getProps();Je(a)&&a.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ee.read(r);const o=Et(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:a,hasLayoutChanged:c})=>{this.isDragging&&c&&(Te(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=a[u].translate,f.set(f.get()+a[u].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=or,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:l}}}function Zt(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function bc(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Tc extends Ne{constructor(t){super(t),this.removeGroupControls=xe,this.removeListeners=xe,this.controls=new xc(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||xe}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ks=e=>(t,n)=>{e&&ee.postRender(()=>e(t,n))};class wc extends Ne{constructor(){super(...arguments),this.removePointerDownListener=xe}onPointerDown(t){this.session=new Ns(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ks(t),onStart:Ks(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&ee.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=rt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Jt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function qs(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Rt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(V.test(e))e=parseFloat(e);else return e;const n=qs(e,t.target.x),r=qs(e,t.target.y);return`${n}% ${r}%`}},Pc={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Fe.parse(e);if(i.length>5)return r;const s=Fe.createTransformer(e),o=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,a=n.y.scale*t.y;i[0+o]/=l,i[1+o]/=a;const c=ne(l,a,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};class Sc extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;ja(Cc),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Jt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||ee.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),dn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Gs(e){const[t,n]=Fr(),r=x.useContext(nn);return g.exports.jsx(Sc,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(Zr),isPresent:t,safeToRemove:n})}const Cc={borderRadius:{...Rt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Rt,borderTopRightRadius:Rt,borderBottomLeftRadius:Rt,borderBottomRightRadius:Rt,boxShadow:Pc};function Ec(e,t,n){const r=pe(e)?e:xt(e);return r.start(Qn("",r,t,n)),r.animation}function Ac(e){return e instanceof SVGElement&&e.tagName!=="svg"}const jc=(e,t)=>e.depth-t.depth;class Mc{constructor(){this.children=[],this.isDirty=!1}add(t){Dn(this.children,t),this.isDirty=!0}remove(t){Vn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(jc),this.isDirty=!1,this.children.forEach(t)}}function Rc(e,t){const n=Me.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(_e(r),e(s-t))};return ee.read(r,!0),()=>_e(r)}const Hs=["TopLeft","TopRight","BottomLeft","BottomRight"],Dc=Hs.length,Xs=e=>typeof e=="string"?parseFloat(e):e,Zs=e=>typeof e=="number"||V.test(e);function Vc(e,t,n,r,i,s){i?(e.opacity=ne(0,n.opacity!==void 0?n.opacity:1,Oc(r)),e.opacityExit=ne(t.opacity!==void 0?t.opacity:1,0,Lc(r))):s&&(e.opacity=ne(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Dc;o++){const l=`border${Hs[o]}Radius`;let a=Js(t,l),c=Js(n,l);if(a===void 0&&c===void 0)continue;a||(a=0),c||(c=0),a===0||c===0||Zs(a)===Zs(c)?(e[l]=Math.max(ne(Xs(a),Xs(c),r),0),(je.test(c)||je.test(a))&&(e[l]+="%")):e[l]=c}(t.rotate||n.rotate)&&(e.rotate=ne(t.rotate||0,n.rotate||0,r))}function Js(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Oc=Qs(0,.5,_i),Lc=Qs(.5,.95,xe);function Qs(e,t,n){return r=>r<e?0:r>t?1:n(Xe(e,t,r))}function eo(e,t){e.min=t.min,e.max=t.max}function we(e,t){eo(e.x,t.x),eo(e.y,t.y)}function to(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function no(e,t,n,r,i){return e-=t,e=Xt(e,1/n,r),i!==void 0&&(e=Xt(e,1/i,r)),e}function kc(e,t=0,n=1,r=.5,i,s=e,o=e){if(je.test(t)&&(t=parseFloat(t),t=ne(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=ne(s.min,s.max,r);e===s&&(l-=t),e.min=no(e.min,t,n,l,i),e.max=no(e.max,t,n,l,i)}function ro(e,t,[n,r,i],s,o){kc(e,t[n],t[r],t[i],t.scale,s,o)}const _c=["x","scaleX","originX"],Ic=["y","scaleY","originY"];function io(e,t,n,r){ro(e.x,t,_c,n?n.x:void 0,r?r.x:void 0),ro(e.y,t,Ic,n?n.y:void 0,r?r.y:void 0)}function so(e){return e.translate===0&&e.scale===1}function oo(e){return so(e.x)&&so(e.y)}function ao(e,t){return e.min===t.min&&e.max===t.max}function Fc(e,t){return ao(e.x,t.x)&&ao(e.y,t.y)}function lo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function uo(e,t){return lo(e.x,t.x)&&lo(e.y,t.y)}function co(e){return ye(e.x)/ye(e.y)}function fo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Nc{constructor(){this.members=[]}add(t){Dn(this.members,t),t.scheduleRender()}remove(t){if(Vn(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Bc(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:h,skewX:p,skewY:v}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),v&&(r+=`skewY(${v}deg) `)}const l=e.x.scale*t.x,a=e.y.scale*t.y;return(l!==1||a!==1)&&(r+=`scale(${l}, ${a})`),r||"none"}const qe={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ar=["","X","Y","Z"],$c={visibility:"hidden"},ho=1e3;let Uc=0;function lr(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function po(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Mi(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ee,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&po(r)}function mo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},l=t==null?void 0:t()){this.id=Uc++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,ke.value&&(qe.nodes=qe.calculatedTargetDeltas=qe.calculatedProjections=0),this.nodes.forEach(Yc),this.nodes.forEach(Xc),this.nodes.forEach(Zc),this.nodes.forEach(Kc),ke.addProjectionMetrics&&ke.addProjectionMetrics(qe)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let a=0;a<this.path.length;a++)this.path[a].shouldResetTransform=!0;this.root===this&&(this.nodes=new Mc)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new On),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const a=this.eventHandlers.get(o);a&&a.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ac(o),this.instance=o;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(c||a)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Rc(h,250),Jt.hasAnimatedSinceResize&&(Jt.hasAnimatedSinceResize=!1,this.nodes.forEach(yo))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:p,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||nf,{onLayoutAnimationStart:S,onLayoutAnimationComplete:b}=u.getProps(),C=!this.targetLayout||!uo(this.targetLayout,v),w=!h&&p;if(this.options.layoutRoot||this.resumeFrom||w||h&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,w);const D={...Sn(y,"layout"),onPlay:S,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D)}else h||yo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,_e(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Jc),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&po(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:a}=this.options;if(l===void 0&&!a)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(go);return}this.isUpdating||this.nodes.forEach(Gc),this.isUpdating=!1,this.nodes.forEach(Hc),this.nodes.forEach(Wc),this.nodes.forEach(zc),this.clearAllSnapshots();const l=Me.now();fe.delta=De(0,1e3/60,l-fe.timestamp),fe.timestamp=l,fe.isProcessing=!0,ln.update.process(fe),ln.preRender.process(fe),ln.render.process(fe),fe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,dn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(qc),this.sharedNodes.forEach(Qc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ee.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ee.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ye(this.snapshot.measuredBox.x)&&!ye(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let a=0;a<this.path.length;a++)this.path[a].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=se(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l){const a=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:a,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:a}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!oo(this.projectionDelta),a=this.getTransformTemplate(),c=a?a(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(l||Ke(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let a=this.removeElementScroll(l);return o&&(a=this.removeTransform(a)),rf(a),{animationId:this.root.animationId,measuredBox:l,layoutBox:a,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:l}=this.options;if(!l)return se();const a=l.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(sf))){const{scroll:u}=this.root;u&&(st(a.x,u.offset.x),st(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=se();if(we(a,o),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&we(a,o),st(a.x,f.offset.x),st(a.y,f.offset.y))}return a}applyTransform(o,l=!1){const a=se();we(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ot(a,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ke(u.latestValues)&&ot(a,u.latestValues)}return Ke(this.latestValues)&&ot(a,this.latestValues),a}removeTransform(o){const l=se();we(l,o);for(let a=0;a<this.path.length;a++){const c=this.path[a];if(!c.instance||!Ke(c.latestValues))continue;nr(c.latestValues)&&c.updateSnapshot();const u=se(),f=c.measurePageBox();we(u,f),io(l,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Ke(this.latestValues)&&io(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==fe.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var l;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=Boolean(this.resumingFrom)||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=fe.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=se(),this.relativeTargetOrigin=se(),Mt(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),we(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=se(),this.targetWithTransforms=se()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),oc(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):we(this.target,this.layout.layoutBox),Os(this.target,this.targetDelta)):we(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&Boolean(p.resumingFrom)===Boolean(this.resumingFrom)&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=se(),this.relativeTargetOrigin=se(),Mt(this.relativeTargetOrigin,this.target,p.target),we(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ke.value&&qe.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||nr(this.parent.latestValues)||Rs(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const l=this.getLead(),a=Boolean(this.resumingFrom)||this!==l;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===fe.timestamp&&(c=!1),c)return;const{layout:u,layoutId:f}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||f))return;we(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;ac(this.layoutCorrected,this.treeScale,this.path,a),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=se());const{target:v}=l;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(to(this.prevProjectionDelta.x,this.projectionDelta.x),to(this.prevProjectionDelta.y,this.projectionDelta.y)),jt(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!fo(this.projectionDelta.x,this.prevProjectionDelta.x)||!fo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),ke.value&&qe.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=it(),this.projectionDelta=it(),this.projectionDeltaWithTransform=it()}setAnimationOrigin(o,l=!1){const a=this.snapshot,c=a?a.latestValues:{},u={...this.latestValues},f=it();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const h=se(),p=a?a.source:void 0,v=this.layout?this.layout.source:void 0,y=p!==v,S=this.getStack(),b=!S||S.members.length<=1,C=Boolean(y&&!b&&this.options.crossfade===!0&&!this.path.some(tf));this.animationProgress=0;let w;this.mixTargetDelta=D=>{const m=D/1e3;vo(f.x,o.x,m),vo(f.y,o.y,m),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Mt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ef(this.relativeTarget,this.relativeTargetOrigin,h,m),w&&Fc(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=se()),we(w,this.relativeTarget)),y&&(this.animationValues=u,Vc(u,c,this.latestValues,m,C,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=m},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(_e(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ee.update(()=>{Jt.hasAnimatedSinceResize=!0,Pt.layout++,this.currentAnimation=Ec(0,ho,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onStop:()=>{Pt.layout--},onComplete:()=>{Pt.layout--,o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ho),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:a,layout:c,latestValues:u}=o;if(!(!l||!a||!c)){if(this!==o&&this.layout&&c&&Po(this.options.animationType,this.layout.layoutBox,c.layoutBox)){a=this.target||se();const f=ye(this.layout.layoutBox.x);a.x.min=o.target.x.min,a.x.max=a.x.min+f;const h=ye(this.layout.layoutBox.y);a.y.min=o.target.y.min,a.y.max=a.y.min+h}we(l,a),ot(l,u),jt(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Nc),this.sharedNodes.get(o).add(l);const c=l.options.initialPromotionConfig;l.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:a}={}){const c=this.getStack();c&&c.promote(this,a),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:a}=o;if((a.z||a.rotate||a.rotateX||a.rotateY||a.rotateZ||a.skewX||a.skewY)&&(l=!0),!l)return;const c={};a.z&&lr("z",o,c,this.animationValues);for(let u=0;u<ar.length;u++)lr(`rotate${ar[u]}`,o,c,this.animationValues),lr(`skew${ar[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}getProjectionStyles(o){var l,a;if(!this.instance||this.isSVG)return;if(!this.isVisible)return $c;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Wt(o==null?void 0:o.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=Wt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ke(this.latestValues)&&(y.transform=u?u({},""):"none",this.hasProjected=!1),y}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=Bc(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:p,y:v}=this.projectionDelta;c.transformOrigin=`${p.origin*100}% ${v.origin*100}% 0`,f.animationValues?c.opacity=f===this?(a=(l=h.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&a!==void 0?a:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:c.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const y in ht){if(h[y]===void 0)continue;const{correct:S,applyTo:b,isCSSVariable:C}=ht[y],w=c.transform==="none"?h[y]:S(h[y],f);if(b){const D=b.length;for(let m=0;m<D;m++)c[b[m]]=w}else C?this.options.visualElement.renderState.vars[y]=w:c[y]=w}return this.options.layoutId&&(c.pointerEvents=f===this?Wt(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(go),this.root.sharedNodes.clear()}}}function Wc(e){e.updateLayout()}function zc(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?Te(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],p=ye(h);h.min=r[f].min,h.max=h.min+p}):Po(s,n.layoutBox,r)&&Te(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],p=ye(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const l=it();jt(l,r,n.layoutBox);const a=it();o?jt(a,e.applyTransform(i,!0),n.measuredBox):jt(a,r,n.layoutBox);const c=!oo(l);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const v=se();Mt(v,n.layoutBox,h.layoutBox);const y=se();Mt(y,r,p.layoutBox),uo(v,y)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=v,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:a,layoutDelta:l,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Yc(e){ke.value&&qe.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Kc(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function qc(e){e.clearSnapshot()}function go(e){e.clearMeasurements()}function Gc(e){e.isLayoutDirty=!1}function Hc(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function yo(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Xc(e){e.resolveTargetDelta()}function Zc(e){e.calcProjection()}function Jc(e){e.resetSkewAndRotation()}function Qc(e){e.removeLeadSnapshot()}function vo(e,t,n){e.translate=ne(t.translate,0,n),e.scale=ne(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function xo(e,t,n,r){e.min=ne(t.min,n.min,r),e.max=ne(t.max,n.max,r)}function ef(e,t,n,r){xo(e.x,t.x,n.x,r),xo(e.y,t.y,n.y,r)}function tf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const nf={duration:.45,ease:[.4,0,.1,1]},bo=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),To=bo("applewebkit/")&&!bo("chrome/")?Math.round:xe;function wo(e){e.min=To(e.min),e.max=To(e.max)}function rf(e){wo(e.x),wo(e.y)}function Po(e,t,n){return e==="position"||e==="preserve-aspect"&&!sc(co(t),co(n),.2)}function sf(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const of=mo({attachResizeListener:(e,t)=>Et(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ur={current:void 0},So=mo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ur.current){const e=new of({});e.mount(window),e.setOptions({layoutScroll:!0}),ur.current=e}return ur.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),af={pan:{Feature:wc},drag:{Feature:Tc,ProjectionNode:So,MeasureLayout:Gs}};function Co(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&ee.postRender(()=>s(t,At(t)))}class lf extends Ne{mount(){const{current:t}=this.node;t&&(this.unmount=sl(t,(n,r)=>(Co(this.node,r,"Start"),i=>Co(this.node,i,"End"))))}unmount(){}}class uf extends Ne{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=St(Et(this.node.current,"focus",()=>this.onFocus()),Et(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Eo(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&ee.postRender(()=>s(t,At(t)))}class cf extends Ne{mount(){const{current:t}=this.node;t&&(this.unmount=ul(t,(n,r)=>(Eo(this.node,r,"Start"),(i,{success:s})=>Eo(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const cr=new WeakMap,fr=new WeakMap,ff=e=>{const t=cr.get(e.target);t&&t(e)},df=e=>{e.forEach(ff)};function hf({root:e,...t}){const n=e||document;fr.has(n)||fr.set(n,{});const r=fr.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(df,{root:e,...t})),r[i]}function pf(e,t,n){const r=hf(t);return cr.set(e,n),r.observe(e),()=>{cr.delete(e),r.unobserve(e)}}const mf={some:0,all:1};class gf extends Ne{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:mf[i]},l=a=>{const{isIntersecting:c}=a;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),h=c?u:f;h&&h(a)};return pf(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(yf(t,n))&&this.startObserver()}unmount(){}}function yf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const vf={inView:{Feature:gf},tap:{Feature:cf},focus:{Feature:uf},hover:{Feature:lf}},xf={layout:{ProjectionNode:So,MeasureLayout:Gs}},dr={current:null},Ao={current:!1};function bf(){if(Ao.current=!0,!!on)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>dr.current=e.matches;e.addListener(t),t()}else dr.current=!1}const Tf=[...es,me,Fe],wf=e=>Tf.find(Qi(e)),Pf=new WeakMap;function Sf(e,t,n){for(const r in t){const i=t[r],s=n[r];if(pe(i))e.addValue(r,i),process.env.NODE_ENV==="development"&&Ft(i.version==="12.4.7",`Attempting to mix Motion versions ${i.version} with 12.4.7 may not work as expected.`);else if(pe(s))e.addValue(r,xt(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,xt(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const jo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Cf{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Yn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Me.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ee.render(this.render,!1,!0))};const{latestValues:a,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=l,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=$t(n),this.isVariantNode=Gr(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const v=h[p];a[p]!==void 0&&pe(v)&&v.set(a[p],!1)}}mount(t){this.current=t,Pf.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Ao.current||bf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:dr.current,process.env.NODE_ENV!=="production"&&Ft(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),_e(this.notifyUpdate),_e(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Ue.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&ee.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ze){const n=Ze[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):se()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<jo.length;r++){const i=jo[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Sf(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=xt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Zi(i)||Fi(i))?i=parseFloat(i):!wf(i)&&Fe.test(n)&&(i=Yi(t,n)),this.setBaseTarget(t,pe(i)?i.get():i)),pe(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=Tn(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!pe(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new On),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Mo extends Cf{constructor(){super(...arguments),this.KeyframeResolver=ns}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;pe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Ef(e){return window.getComputedStyle(e)}class Af extends Mo{constructor(){super(...arguments),this.type="html",this.renderInstance=ci}readValueFromInstance(t,n){if(Ue.has(n)){const r=Un(n);return r&&r.default||0}else{const r=Ef(t),i=(hn(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Is(t,n)}build(t,n,r){gn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Pn(t,n,r)}}class jf extends Mo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=se,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&ui(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ue.has(n)){const r=Un(n);return r&&r.default||0}return n=fi.has(n)?n:fn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return hi(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&ee.postRender(this.updateDimensions)}build(t,n,r){xn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){di(t,n,r,i)}mount(t){this.isSVGTag=bn(t.tagName),super.mount(t)}}const Mf=(e,t)=>vn(e)?new jf(t):new Af(t,{allowProjection:e!==x.Fragment}),Rf=Ja({...Zu,...vf,...af,...xf},Mf),hr=ma(Rf),Df=({isOpen:e,onClose:t,onConfirm:n,header:r,question:i})=>e?g.exports.jsx("div",{id:"default-modal",tabIndex:-1,"aria-hidden":"true",className:"fixed top-0 right-0 left-0 z-10 w-full md:inset-0 h-full max-h-full overflow-y-auto overflow-x-hidden flex justify-center items-center bg-[rgb(0,0,0,0.6)]",children:g.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:g.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[g.exports.jsxs("div",{className:"flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600 border-gray-200",children:[g.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),g.exports.jsxs("button",{type:"button",className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 inline-flex justify-center items-center",onClick:t,children:[g.exports.jsx("svg",{className:"w-3 h-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 14",children:g.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),g.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),g.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:g.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[i," "]})}),g.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[g.exports.jsx("button",{onClick:()=>{n(),t()},type:"button",className:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",children:"Yes "}),g.exports.jsx("button",{onClick:t,type:"button",className:"py-2.5 px-5 ms-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700",children:"Cancel"})]})]})})}):null,Vf=({items:e,isVisible:t,position:n,messageId:r,isCurrentUserMessage:i})=>g.exports.jsx($r,{children:t&&g.exports.jsx(hr.div,{initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:-10},transition:{duration:.2,ease:"easeOut"},className:"absolute z-20 bg-white shadow-lg rounded-md p-2 px-1 w-42",style:{top:n.y,left:n.x},children:e.map((s,o)=>s!=null&&s.onlyCurrentUserMessage&&!i?null:g.exports.jsxs("button",{className:"cursor-pointer flex items-center gap-2 w-full rounded-md text-left px-2 py-1 hover:bg-gray-200",onClick:()=>s.onClick(r),children:[x.cloneElement(s.icon,{className:"text-black",size:18})," ",g.exports.jsx("span",{className:"ml-2 text-black",children:s.name})]},o))})}),Of=()=>g.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.exports.jsx("path",{d:"M9.77169 2.74358C12.1132 0.399998 15.9121 0.399998 18.2553 2.74314C20.5384 5.02621 20.5969 8.69142 18.4309 11.0454L18.2428 11.2427L9.44273 20.0409L9.40616 20.0712C7.94492 21.3879 5.69092 21.3432 4.28355 19.9358C2.96453 18.6168 2.84241 16.5541 3.9172 15.0974C3.94054 15.0521 3.96879 15.0083 4.002 14.9672L4.05556 14.9075L4.14247 14.8198L4.28355 14.6719L4.28647 14.6748L11.7222 7.22047C11.9881 6.95385 12.4047 6.92909 12.6986 7.14656L12.7829 7.21906C13.0495 7.48497 13.0742 7.9016 12.8568 8.19551L12.7843 8.27972L5.18966 15.8928C4.47202 16.7684 4.5219 18.0627 5.3393 18.8801C6.16836 19.7091 7.48801 19.7486 8.3638 18.9985L17.1965 10.1681C18.952 8.41041 18.952 5.56116 17.1946 3.8038C15.4922 2.10136 12.765 2.04816 10.9986 3.6442L10.8307 3.8038L10.8181 3.81812L1.28179 13.3544C0.988902 13.6473 0.514028 13.6473 0.221135 13.3544C-0.0451319 13.0882 -0.0693378 12.6715 0.148517 12.3779L0.221135 12.2938L9.77001 2.74314L9.77169 2.74358Z",fill:"#8A8A8A"})}),Lf=()=>g.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.exports.jsx("path",{d:"M13.25 9C13.6297 9 13.9435 9.28215 13.9932 9.64823L14 9.75V10.25C14 13.8094 11.245 16.7254 7.75098 16.9817L7.75 19.25C7.75 19.6642 7.41421 20 7 20C6.6203 20 6.30651 19.7178 6.25685 19.3518L6.25 19.25L6.25002 16.9818C2.83323 16.7316 0.122835 13.938 0.00406027 10.4863L0 10.25V9.75C0 9.33579 0.335786 9 0.75 9C1.1297 9 1.44349 9.28215 1.49315 9.64823L1.5 9.75V10.25C1.5 13.077 3.73445 15.3821 6.5336 15.4956L6.75 15.5H7.25C10.077 15.5 12.3821 13.2656 12.4956 10.4664L12.5 10.25V9.75C12.5 9.33579 12.8358 9 13.25 9ZM7 0C9.20914 0 11 1.79086 11 4V10C11 12.2091 9.20914 14 7 14C4.79086 14 3 12.2091 3 10V4C3 1.79086 4.79086 0 7 0ZM7 1.5C5.61929 1.5 4.5 2.61929 4.5 4V10C4.5 11.3807 5.61929 12.5 7 12.5C8.38071 12.5 9.5 11.3807 9.5 10V4C9.5 2.61929 8.38071 1.5 7 1.5Z",fill:"#fff"})}),Ro=()=>g.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.exports.jsx("path",{d:"M10.8147 10.1974L3.28344 11.4526C3.10705 11.482 2.95979 11.6034 2.89723 11.7709L0.299335 18.7283C0.0506615 19.3678 0.720085 19.9778 1.33375 19.671L19.3337 10.671C19.8865 10.3946 19.8865 9.60573 19.3337 9.32933L1.33375 0.329334C0.720085 0.0225017 0.0506615 0.632543 0.299335 1.27199L2.89723 8.22938C2.95979 8.39691 3.10705 8.51827 3.28344 8.54767L10.8147 9.80287C10.9236 9.82103 10.9972 9.92408 10.9791 10.033C10.965 10.1173 10.899 10.1834 10.8147 10.1974Z",fill:"#fff"})}),pr=e=>g.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:g.exports.jsxs("g",{fill:"none",children:[g.exports.jsx("path",{className:"background",fill:"#ffffff",d:"M8,1 L9,1 L9,20 L8,20 L8,18 C7.807,15.161 7.124,12.233 5.950,9.218 C5.046,6.893 3.504,4.733 1.325,2.738 L1.325,2.738 C0.917,2.365 0.89,1.732 1.263,1.325 C1.452,1.118 1.72,1 2,1 L8,1 Z"}),g.exports.jsx("path",{className:" fill-gray-200",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0 L9,0 L9,20 L7,20 L7,20 L7.002,18.068 C6.816,15.333 6.156,12.504 5.018,9.58 C4.172,7.406 2.72,5.371 0.649,3.475 C-0.165,2.729 -0.221,1.464 0.525,0.649 C0.904,0.236 1.439,0 2,0 Z"}),g.exports.jsx("path",{className:"border_2x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.5 L9,0.5 L9,20 L7.5,20 L7.5,20 L7.501,18.034 C7.312,15.247 6.64,12.369 5.484,9.399 C4.609,7.15 3.112,5.052 0.987,3.106 C0.376,2.547 0.334,1.598 0.894,0.987 C1.178,0.677 1.579,0.5 2,0.5 Z"}),g.exports.jsx("path",{className:"border_3x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.667 L9,0.667 L9,20 L7.667,20 L7.667,20 L7.668,18.023 C7.477,15.218 6.802,12.324 5.64,9.338 C4.755,7.064 3.243,4.946 1.1,2.983 C0.557,2.486 0.52,1.643 1.017,1.1 C1.269,0.824 1.626,0.667 2,0.667 Z"})]})}),kf=({onSendMessage:e,onSendVoice:t,onFileSend:n,dynamicSymbolAssignments:r})=>{const[i,s]=x.useState(""),[o,l]=x.useState(!1),[a,c]=x.useState(0),[u,f]=x.useState(null),[h,p]=x.useState(null),[v,y]=x.useState(0),S=x.useRef(null),b=x.useRef([]),C=x.useRef(null),w=x.useRef(null),D=x.useRef(null),[m,M]=x.useState(!1),N=$=>{const O=$.target.value;s(O);const k=O.match(/(\S+)$/);if(k){const le=k[0];if(u){const T=k[0].split(u)[1];p(T)}r!=null&&r.some(T=>T.symbol===le)&&f(le)}else f(null)},R=($,O)=>{s(k=>k+O+" "),f(null),w.current.focus()},H=()=>{i.trim()!==""&&(e(i),s(""),f(null))},te=async()=>{l(!0),c(0),b.current=[],C.current=setInterval(()=>{c(k=>k+1)},1e3);const $=await navigator.mediaDevices.getUserMedia({audio:!0}),O=new MediaRecorder($);S.current=O,O.ondataavailable=k=>{k.data.size>0&&b.current.push(k.data)},O.onstop=()=>{clearInterval(C.current);const k=new Blob(b.current,{type:"audio/mp3"}),le=URL.createObjectURL(k);t(le),l(!1)},O.start()},de=()=>{var $;($=S.current)==null||$.stop()},be=()=>{var $;($=D.current)==null||$.click()},ae=$=>{var k;const O=(k=$.target.files)==null?void 0:k[0];O&&n(O)},ie=$=>{const O=Math.floor($/60),k=$%60;return`${O.toString().padStart(2,"0")}:${k.toString().padStart(2,"0")}`},Pe=$=>{const{scrollTop:O,scrollHeight:k,clientHeight:le}=$.currentTarget;if(O>v){if(O+le>=k-1){const E=r==null?void 0:r.find(_=>_.symbol===u);E&&(E!=null&&E.updatePageNumber)&&(M(!0),E==null||E.updatePageNumber(E.pagNumber+1),y(O),setTimeout(()=>{M(!1)},500))}}else y(O)};return g.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[o?g.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[g.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:ie(a)}),g.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:de,children:g.exports.jsx(Ro,{})})]}):g.exports.jsxs(g.exports.Fragment,{children:[g.exports.jsxs("div",{className:"w-[90%] relative ",children:[g.exports.jsx("div",{onClick:be,className:"cursor-pointer absolute right-4 top-[11px]",children:g.exports.jsx(Of,{})}),g.exports.jsx("input",{type:"file",ref:D,style:{display:"none"},onChange:ae}),g.exports.jsx("input",{type:"text",ref:w,className:"w-full bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl ",placeholder:"Type a message...",value:i,onChange:N,onKeyDown:$=>{$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),H())}}),g.exports.jsx(pr,{className:"rotate-180 absolute -right-[11.4px] top-5"})]}),g.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:i?H:te,children:i?g.exports.jsx(Ro,{}):g.exports.jsx(Lf,{})})]}),u&&g.exports.jsxs("div",{className:"absolute bottom-full left-0 w-full bg-white shadow-xl rounded-lg border border-gray-200 p-4 z-50 max-h-60 overflow-y-auto",onScroll:Pe,children:[g.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[g.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",g.exports.jsx("span",{className:"text-blue-500",children:u})]}),g.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>f(null),children:"✕"})]}),g.exports.jsxs("div",{className:"space-y-2",children:[r?r.filter($=>$.symbol===u).map($=>{var le;const{component:O,lists:k}=$;return O?h?(le=k==null?void 0:k.filter(T=>T==null?void 0:T.name.includes(h)))==null?void 0:le.map((T,E)=>g.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:g.exports.jsx(O,{listsProps:T,onClick:(_,I)=>R(_,I)})},E)):k==null?void 0:k.map((T,E)=>g.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:g.exports.jsx(O,{listsProps:T,onClick:(_,I)=>R(_,I)})},E)):null}):null,g.exports.jsx("div",{className:"h-8",children:m&&"Loading more items..."})]})]})]})};var Be=(e=>(e[e.File=0]="File",e[e.Voice=1]="Voice",e[e.Video=2]="Video",e[e.Image=3]="Image",e))(Be||{});const Do=({fileName:e,fileSize:t,format:n,src:r})=>{const i=()=>({rar:g.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:g.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:g.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:g.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:g.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),"":g.exports.jsx("p",{className:"p-2 text-black font-bold",children:n})})[n||""],s=o=>o>1048576?(o/1048576).toFixed(1)+" MB":(o/1024).toFixed(1)+" KB";return g.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[g.exports.jsx("div",{className:"mr-3 relative border border-green-950 rounded-md p-3",children:i()}),g.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[g.exports.jsx("a",{href:r,download:e,className:"text-gray-900 font-medium hover:underline",children:e}),g.exports.jsx("span",{className:"text-gray-600 text-sm",children:s(t)})]}),g.exports.jsx("a",{href:r,download:e,className:"ml-2 bg-green-500 text-white px-2 py-1 text-sm rounded hover:bg-green-600",children:"Download"})]})},_f=e=>g.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-play",...e,children:g.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),If=e=>g.exports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-pause",...e,children:[g.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),g.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let Dt=null;const Ff=({src:e,className:t})=>{const[n,r]=x.useState(!1),[i,s]=x.useState(0),o=x.useRef(null);x.useEffect(()=>{const a=o.current;if(!a)return;const c=()=>{s(a.currentTime/a.duration*100)},u=()=>r(!0),f=()=>r(!1),h=()=>{r(!1),s(0)};return a.addEventListener("timeupdate",c),a.addEventListener("play",u),a.addEventListener("pause",f),a.addEventListener("ended",h),()=>{a.removeEventListener("timeupdate",c),a.removeEventListener("play",u),a.removeEventListener("pause",f),a.removeEventListener("ended",h)}},[]);const l=()=>{const a=o.current;a&&(n?a.pause():(Dt&&Dt!==a&&(Dt.pause(),Dt.currentTime=0),a.play(),Dt=a))};return g.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[g.exports.jsx("button",{className:"w-9 h-9 cursor-pointer flex items-center justify-center pl-[1.5px] bg-gray-700 rounded-full hover:bg-gray-600",onClick:l,children:n?g.exports.jsx(If,{}):g.exports.jsx(_f,{})}),g.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:g.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${i}%`}})}),g.exports.jsx("audio",{ref:o,src:e})]})},Nf=({attachment:e,attachmentType:t})=>e?t===Be.Voice?g.exports.jsx("div",{className:"w-full",children:g.exports.jsx(Ff,{src:e})}):t===Be.Image?g.exports.jsx("div",{className:"w-full",children:g.exports.jsx("img",{src:e})}):t===Be.File?g.exports.jsx("div",{className:"w-full mt-1",children:g.exports.jsx(Do,{fileName:"productivity",fileSize:23e3,format:"rar",src:e})}):t===Be.Video?g.exports.jsx("div",{className:"w-full mt-1",children:g.exports.jsx(Do,{fileName:"productivity",fileSize:23e3,format:"rar",src:e})}):null:null,Bf=({message:e,showUserProfile:t,handleContextMenu:n,media:r})=>{var i,s,o,l,a;return g.exports.jsxs(g.exports.Fragment,{children:[t?g.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,g.exports.jsxs(hr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:c=>n(c,e),className:`relative ${r?"w-3/4":"w-fit max-w-3/4"}flex flex-col gap-1 md:max-w-[400px] p-2 pt-5 rounded-lg bg-green-200`,children:[g.exports.jsx("span",{className:"absolute top-1 text-xs text-orange-700",children:(i=e.user)!=null&&i.fullName&&((o=(s=e.user)==null?void 0:s.fullName)==null?void 0:o.length)>16?(l=e.user)==null?void 0:l.firstName:(a=e.user)==null?void 0:a.fullName}),r||null,g.exports.jsx("span",{children:e.text}),g.exports.jsx("div",{className:"w-full flex gap- items-center justify-end",children:g.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]})}),g.exports.jsx(pr,{className:"fill-blue-200 -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 [&>g>path]:fill-green-200"})]})]})},$f=()=>g.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.exports.jsx("path",{d:"M11.6619 4.6478C11.8358 4.83691 11.8272 5.1347 11.6427 5.31294L4.36284 12.3463C4.14493 12.5568 3.80285 12.5503 3.59268 12.3317L1.13205 9.77168C0.954124 9.58658 0.956276 9.28866 1.13686 9.10628C1.31743 8.92389 1.60806 8.9261 1.78598 9.1112L3.99455 11.4089L11.013 4.62812C11.1975 4.44988 11.488 4.4587 11.6619 4.6478Z",fill:"gray"}),g.exports.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.8759 4.64963C15.0492 4.83921 15.0399 5.13698 14.8549 5.31471L7.51066 12.3726C7.32572 12.5503 7.03524 12.5407 6.86185 12.3511C6.68847 12.1616 6.69784 11.8638 6.88278 11.6861L14.227 4.62818C14.412 4.45045 14.7025 4.46005 14.8759 4.64963Z",fill:"gray"})]}),Uf=({handleContextMenu:e,media:t,message:n})=>g.exports.jsxs(hr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:r=>e(r,n),className:`relative self-end ${t?"w-3/4":"max-w-3/4"} flex flex-col justify-center md:max-w-[400px] p-2 rounded-lg bg-blue-200`,children:[t||null,g.exports.jsx("span",{children:n.text}),g.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[g.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),g.exports.jsx($f,{})]}),g.exports.jsx(pr,{className:"fill-blue-200 rotate-180 absolute -right-2 bottom-0 [&>g>path]:fill-blue-200"})]});var ce={exports:{}},mr={exports:{}},Z={};var Vo;function Wf(){if(Vo)return Z;Vo=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function w(m){if(typeof m=="object"&&m!==null){var M=m.$$typeof;switch(M){case t:switch(m=m.type,m){case a:case c:case r:case s:case i:case f:return m;default:switch(m=m&&m.$$typeof,m){case l:case u:case v:case p:case o:return m;default:return M}}case n:return M}}}function D(m){return w(m)===c}return Z.AsyncMode=a,Z.ConcurrentMode=c,Z.ContextConsumer=l,Z.ContextProvider=o,Z.Element=t,Z.ForwardRef=u,Z.Fragment=r,Z.Lazy=v,Z.Memo=p,Z.Portal=n,Z.Profiler=s,Z.StrictMode=i,Z.Suspense=f,Z.isAsyncMode=function(m){return D(m)||w(m)===a},Z.isConcurrentMode=D,Z.isContextConsumer=function(m){return w(m)===l},Z.isContextProvider=function(m){return w(m)===o},Z.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===t},Z.isForwardRef=function(m){return w(m)===u},Z.isFragment=function(m){return w(m)===r},Z.isLazy=function(m){return w(m)===v},Z.isMemo=function(m){return w(m)===p},Z.isPortal=function(m){return w(m)===n},Z.isProfiler=function(m){return w(m)===s},Z.isStrictMode=function(m){return w(m)===i},Z.isSuspense=function(m){return w(m)===f},Z.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===r||m===c||m===s||m===i||m===f||m===h||typeof m=="object"&&m!==null&&(m.$$typeof===v||m.$$typeof===p||m.$$typeof===o||m.$$typeof===l||m.$$typeof===u||m.$$typeof===S||m.$$typeof===b||m.$$typeof===C||m.$$typeof===y)},Z.typeOf=w,Z}var J={};var Oo;function zf(){return Oo||(Oo=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function w(j){return typeof j=="string"||typeof j=="function"||j===r||j===c||j===s||j===i||j===f||j===h||typeof j=="object"&&j!==null&&(j.$$typeof===v||j.$$typeof===p||j.$$typeof===o||j.$$typeof===l||j.$$typeof===u||j.$$typeof===S||j.$$typeof===b||j.$$typeof===C||j.$$typeof===y)}function D(j){if(typeof j=="object"&&j!==null){var Se=j.$$typeof;switch(Se){case t:var at=j.type;switch(at){case a:case c:case r:case s:case i:case f:return at;default:var Ge=at&&at.$$typeof;switch(Ge){case l:case u:case v:case p:case o:return Ge;default:return Se}}case n:return Se}}}var m=a,M=c,N=l,R=o,H=t,te=u,de=r,be=v,ae=p,ie=n,Pe=s,$=i,O=f,k=!1;function le(j){return k||(k=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),T(j)||D(j)===a}function T(j){return D(j)===c}function E(j){return D(j)===l}function _(j){return D(j)===o}function I(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function F(j){return D(j)===u}function K(j){return D(j)===r}function B(j){return D(j)===v}function U(j){return D(j)===p}function W(j){return D(j)===n}function G(j){return D(j)===s}function z(j){return D(j)===i}function ge(j){return D(j)===f}J.AsyncMode=m,J.ConcurrentMode=M,J.ContextConsumer=N,J.ContextProvider=R,J.Element=H,J.ForwardRef=te,J.Fragment=de,J.Lazy=be,J.Memo=ae,J.Portal=ie,J.Profiler=Pe,J.StrictMode=$,J.Suspense=O,J.isAsyncMode=le,J.isConcurrentMode=T,J.isContextConsumer=E,J.isContextProvider=_,J.isElement=I,J.isForwardRef=F,J.isFragment=K,J.isLazy=B,J.isMemo=U,J.isPortal=W,J.isProfiler=G,J.isStrictMode=z,J.isSuspense=ge,J.isValidElementType=w,J.typeOf=D}()),J}var Lo;function ko(){return Lo||(Lo=1,function(e){process.env.NODE_ENV==="production"?e.exports=Wf():e.exports=zf()}(mr)),mr.exports}var gr,_o;function Yf(){if(_o)return gr;_o=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var o={},l=0;l<10;l++)o["_"+String.fromCharCode(l)]=l;var a=Object.getOwnPropertyNames(o).map(function(u){return o[u]});if(a.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return gr=i()?Object.assign:function(s,o){for(var l,a=r(s),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var f in l)t.call(l,f)&&(a[f]=l[f]);if(e){c=e(l);for(var h=0;h<c.length;h++)n.call(l,c[h])&&(a[c[h]]=l[c[h]])}}return a},gr}var yr,Io;function vr(){if(Io)return yr;Io=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return yr=e,yr}var xr,Fo;function No(){return Fo||(Fo=1,xr=Function.call.bind(Object.prototype.hasOwnProperty)),xr}var br,Bo;function Kf(){if(Bo)return br;Bo=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=vr(),n={},r=No();e=function(s){var o="Warning: "+s;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function i(s,o,l,a,c){if(process.env.NODE_ENV!=="production"){for(var u in s)if(r(s,u)){var f;try{if(typeof s[u]!="function"){var h=Error((a||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=s[u](o,u,a,l,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((a||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var p=c?c():"";e("Failed "+l+" type: "+f.message+(p??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},br=i,br}var Tr,$o;function qf(){if($o)return Tr;$o=1;var e=ko(),t=Yf(),n=vr(),r=No(),i=Kf(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(l){var a="Warning: "+l;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}});function o(){return null}return Tr=function(l,a){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(T){var E=T&&(c&&T[c]||T[u]);if(typeof E=="function")return E}var h="<<anonymous>>",p={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:C(),arrayOf:w,element:D(),elementType:m(),instanceOf:M,node:te(),objectOf:R,oneOf:N,oneOfType:H,shape:be,exact:ae};function v(T,E){return T===E?T!==0||1/T===1/E:T!==T&&E!==E}function y(T,E){this.message=T,this.data=E&&typeof E=="object"?E:{},this.stack=""}y.prototype=Error.prototype;function S(T){if(process.env.NODE_ENV!=="production")var E={},_=0;function I(K,B,U,W,G,z,ge){if(W=W||h,z=z||U,ge!==n){if(a){var j=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw j.name="Invariant Violation",j}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Se=W+":"+U;!E[Se]&&_<3&&(s("You are manually calling a React.PropTypes validation function for the `"+z+"` prop on `"+W+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),E[Se]=!0,_++)}}return B[U]==null?K?B[U]===null?new y("The "+G+" `"+z+"` is marked as required "+("in `"+W+"`, but its value is `null`.")):new y("The "+G+" `"+z+"` is marked as required in "+("`"+W+"`, but its value is `undefined`.")):null:T(B,U,W,G,z)}var F=I.bind(null,!1);return F.isRequired=I.bind(null,!0),F}function b(T){function E(_,I,F,K,B,U){var W=_[I],G=$(W);if(G!==T){var z=O(W);return new y("Invalid "+K+" `"+B+"` of type "+("`"+z+"` supplied to `"+F+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return S(E)}function C(){return S(o)}function w(T){function E(_,I,F,K,B){if(typeof T!="function")return new y("Property `"+B+"` of component `"+F+"` has invalid PropType notation inside arrayOf.");var U=_[I];if(!Array.isArray(U)){var W=$(U);return new y("Invalid "+K+" `"+B+"` of type "+("`"+W+"` supplied to `"+F+"`, expected an array."))}for(var G=0;G<U.length;G++){var z=T(U,G,F,K,B+"["+G+"]",n);if(z instanceof Error)return z}return null}return S(E)}function D(){function T(E,_,I,F,K){var B=E[_];if(!l(B)){var U=$(B);return new y("Invalid "+F+" `"+K+"` of type "+("`"+U+"` supplied to `"+I+"`, expected a single ReactElement."))}return null}return S(T)}function m(){function T(E,_,I,F,K){var B=E[_];if(!e.isValidElementType(B)){var U=$(B);return new y("Invalid "+F+" `"+K+"` of type "+("`"+U+"` supplied to `"+I+"`, expected a single ReactElement type."))}return null}return S(T)}function M(T){function E(_,I,F,K,B){if(!(_[I]instanceof T)){var U=T.name||h,W=le(_[I]);return new y("Invalid "+K+" `"+B+"` of type "+("`"+W+"` supplied to `"+F+"`, expected ")+("instance of `"+U+"`."))}return null}return S(E)}function N(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),o;function E(_,I,F,K,B){for(var U=_[I],W=0;W<T.length;W++)if(v(U,T[W]))return null;var G=JSON.stringify(T,function(ge,j){var Se=O(j);return Se==="symbol"?String(j):j});return new y("Invalid "+K+" `"+B+"` of value `"+String(U)+"` "+("supplied to `"+F+"`, expected one of "+G+"."))}return S(E)}function R(T){function E(_,I,F,K,B){if(typeof T!="function")return new y("Property `"+B+"` of component `"+F+"` has invalid PropType notation inside objectOf.");var U=_[I],W=$(U);if(W!=="object")return new y("Invalid "+K+" `"+B+"` of type "+("`"+W+"` supplied to `"+F+"`, expected an object."));for(var G in U)if(r(U,G)){var z=T(U,G,F,K,B+"."+G,n);if(z instanceof Error)return z}return null}return S(E)}function H(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var E=0;E<T.length;E++){var _=T[E];if(typeof _!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+k(_)+" at index "+E+"."),o}function I(F,K,B,U,W){for(var G=[],z=0;z<T.length;z++){var ge=T[z],j=ge(F,K,B,U,W,n);if(j==null)return null;j.data&&r(j.data,"expectedType")&&G.push(j.data.expectedType)}var Se=G.length>0?", expected one of type ["+G.join(", ")+"]":"";return new y("Invalid "+U+" `"+W+"` supplied to "+("`"+B+"`"+Se+"."))}return S(I)}function te(){function T(E,_,I,F,K){return ie(E[_])?null:new y("Invalid "+F+" `"+K+"` supplied to "+("`"+I+"`, expected a ReactNode."))}return S(T)}function de(T,E,_,I,F){return new y((T||"React class")+": "+E+" type `"+_+"."+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+F+"`.")}function be(T){function E(_,I,F,K,B){var U=_[I],W=$(U);if(W!=="object")return new y("Invalid "+K+" `"+B+"` of type `"+W+"` "+("supplied to `"+F+"`, expected `object`."));for(var G in T){var z=T[G];if(typeof z!="function")return de(F,K,B,G,O(z));var ge=z(U,G,F,K,B+"."+G,n);if(ge)return ge}return null}return S(E)}function ae(T){function E(_,I,F,K,B){var U=_[I],W=$(U);if(W!=="object")return new y("Invalid "+K+" `"+B+"` of type `"+W+"` "+("supplied to `"+F+"`, expected `object`."));var G=t({},_[I],T);for(var z in G){var ge=T[z];if(r(T,z)&&typeof ge!="function")return de(F,K,B,z,O(ge));if(!ge)return new y("Invalid "+K+" `"+B+"` key `"+z+"` supplied to `"+F+"`.\nBad object: "+JSON.stringify(_[I],null," ")+`
20
- Valid keys: `+JSON.stringify(Object.keys(T),null," "));var j=ge(U,z,F,K,B+"."+z,n);if(j)return j}return null}return S(E)}function ie(T){switch(typeof T){case"number":case"string":case"undefined":return!0;case"boolean":return!T;case"object":if(Array.isArray(T))return T.every(ie);if(T===null||l(T))return!0;var E=f(T);if(E){var _=E.call(T),I;if(E!==T.entries){for(;!(I=_.next()).done;)if(!ie(I.value))return!1}else for(;!(I=_.next()).done;){var F=I.value;if(F&&!ie(F[1]))return!1}}else return!1;return!0;default:return!1}}function Pe(T,E){return T==="symbol"?!0:E?E["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&E instanceof Symbol:!1}function $(T){var E=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":Pe(E,T)?"symbol":E}function O(T){if(typeof T>"u"||T===null)return""+T;var E=$(T);if(E==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return E}function k(T){var E=O(T);switch(E){case"array":case"object":return"an "+E;case"boolean":case"date":case"regexp":return"a "+E;default:return E}}function le(T){return!T.constructor||!T.constructor.name?h:T.constructor.name}return p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},Tr}var wr,Uo;function Gf(){if(Uo)return wr;Uo=1;var e=vr();function t(){}function n(){}return n.resetWarningCache=t,wr=function(){function r(o,l,a,c,u,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},wr}if(process.env.NODE_ENV!=="production"){var Hf=ko(),Xf=!0;ce.exports=qf()(Hf.isElement,Xf)}else ce.exports=Gf()();function Pr(){return Pr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pr.apply(this,arguments)}function Zf(e,t){if(e==null)return{};var n=Jf(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Jf(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Sr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=e.size,s=i===void 0?24:i,o=Zf(e,["color","size"]);return x.createElement("svg",Pr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("polyline",{points:"20 6 9 17 4 12"}))});Sr.propTypes={color:ce.exports.string,size:ce.exports.oneOfType([ce.exports.string,ce.exports.number])},Sr.displayName="Check";const Qf=Sr;function Cr(){return Cr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cr.apply(this,arguments)}function ed(e,t){if(e==null)return{};var n=td(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function td(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Er=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=e.size,s=i===void 0?24:i,o=ed(e,["color","size"]);return x.createElement("svg",Cr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),x.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))});Er.propTypes={color:ce.exports.string,size:ce.exports.oneOfType([ce.exports.string,ce.exports.number])},Er.displayName="Copy";const nd=Er;function Ar(){return Ar=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ar.apply(this,arguments)}function rd(e,t){if(e==null)return{};var n=id(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function id(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var jr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=e.size,s=i===void 0?24:i,o=rd(e,["color","size"]);return x.createElement("svg",Ar({ref:t,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),x.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});jr.propTypes={color:ce.exports.string,size:ce.exports.oneOfType([ce.exports.string,ce.exports.number])},jr.displayName="Edit";const sd=jr;function Mr(){return Mr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mr.apply(this,arguments)}function od(e,t){if(e==null)return{};var n=ad(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ad(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Rr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=e.size,s=i===void 0?24:i,o=od(e,["color","size"]);return x.createElement("svg",Mr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("polyline",{points:"3 6 5 6 21 6"}),x.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}))});Rr.propTypes={color:ce.exports.string,size:ce.exports.oneOfType([ce.exports.string,ce.exports.number])},Rr.displayName="Trash";const ld=Rr,ud=({user:e,messages:t,updateMessages:n,onMessageSent:r,onEditMessage:i,onDeleteMessage:s})=>{const o=x.useRef(null),[l,a]=x.useState(!1),[c,u]=x.useState(null),[f,h]=x.useState(null),p=()=>{setTimeout(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},100)},v=(m,M)=>{if(m.preventDefault(),!o.current)return;const N=o.current.getBoundingClientRect();h({x:m.clientX-N.left,y:m.clientY-N.top,message:M})},y=()=>{h(null)},S=m=>{const M=new Ot({id:new Date().toString(),text:m,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,M]),r(M),p()},b=m=>{const M=new Ot({id:new Date().toString(),text:"",attachment:m,attachmentType:Be.Voice,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,M]),r(M),p()},C=m=>{const M=URL.createObjectURL(m),N=new Ot({id:new Date().toString(),text:"",attachment:M,attachmentType:Be.File,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,N]),r(N),p()};return{handleDeleteConfirmation:()=>{c&&(s(c),u(null)),a(!1)},handleCloseContextMenu:y,contextMenuItems:[{name:"Edit",icon:g.exports.jsx(sd,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:m=>{console.log("Edit clicked"),y(),i(m)}},{name:"Delete",icon:g.exports.jsx(ld,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:m=>{u(m),a(!0),y()}},{name:"Select",icon:g.exports.jsx(Qf,{className:"text-green-600"}),onClick:()=>{console.log("Select clicked"),y()}},{name:"Copy",icon:g.exports.jsx(nd,{className:"text-blue-600"}),onClick:()=>{console.log("Copy clicked"),y()}}],handleSendFile:C,handleSendVoice:b,handleSendMessage:S,handleContextMenu:v,isModalOpen:l,contextMenu:f,chatRef:o,setIsModalOpen:a}},cd=({width:e="400px",height:t="600px",className:n,style:r,messages:i,user:s,updateMessages:o,onMessageSent:l,onDeleteMessage:a,onEditMessage:c,dynamicSymbolAssignments:u})=>{var M,N;const{handleDeleteConfirmation:f,handleCloseContextMenu:h,handleSendFile:p,handleSendVoice:v,handleSendMessage:y,handleContextMenu:S,contextMenuItems:b,isModalOpen:C,contextMenu:w,chatRef:D,setIsModalOpen:m}=ud({user:s,messages:i,updateMessages:o,onMessageSent:l,onEditMessage:c,onDeleteMessage:a});return g.exports.jsxs("div",{className:`flex flex-col !bg-cover ${n}`,style:{width:e,height:t,background:"url(./chat-bg-1.jpg)",...r},onClick:h,children:[g.exports.jsx("div",{ref:D,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${w?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:g.exports.jsx($r,{children:i.map((R,H)=>{var be,ae,ie;const te=R!=null&&R.attachment?g.exports.jsx(Nf,{attachment:R.attachment,attachmentType:R==null?void 0:R.attachmentType},H):null;if(R.isRightSided)return g.exports.jsx(Uf,{media:te,handleContextMenu:S,message:R},H);const de=((ae=(be=i[H-1])==null?void 0:be.user)==null?void 0:ae.id)!==((ie=R==null?void 0:R.user)==null?void 0:ie.id);return g.exports.jsx(Bf,{showUserProfile:de,media:te,handleContextMenu:S,message:R},H)})})}),g.exports.jsx(Df,{isOpen:C,onClose:()=>m(!1),onConfirm:f,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),w&&((M=w==null?void 0:w.message)!=null&&M.id)?g.exports.jsx(Vf,{items:b,isVisible:Boolean(w),messageId:String(w==null?void 0:w.message.id),isCurrentUserMessage:((N=w==null?void 0:w.message)==null?void 0:N.user.id)===s.id,position:{x:w==null?void 0:w.x,y:w==null?void 0:w.y}}):null,g.exports.jsx(kf,{onSendVoice:v,onSendMessage:y,onFileSend:p,dynamicSymbolAssignments:u})]})};he.AttachmentTypeEnum=Be,he.Button=ia,he.Chat=cd,he.MessageEntity=Ot,Object.defineProperty(he,Symbol.toStringTag,{value:"Module"})});
19
+ `),()=>{document.head.removeChild(p)}},[t]),g.exports.jsx(sa,{isPresent:t,childRef:i,sizeRef:s,children:tn.cloneElement(e,{ref:i})})}const aa=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:l})=>{const a=rn(la),c=x.useId(),u=x.useCallback(h=>{a.set(h,!0);for(const p of a.values())if(!p)return;r&&r()},[a,r]),f=x.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:u,register:h=>(a.set(h,!1),()=>a.delete(h))}),s?[Math.random(),u]:[n,u]);return x.useMemo(()=>{a.forEach((h,p)=>a.set(p,!1))},[n]),tn.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),o==="popLayout"&&(e=g.exports.jsx(oa,{isPresent:n,anchorX:l,children:e})),g.exports.jsx(Lt.Provider,{value:f,children:e})};function la(){return new Map}function Fr(e=!0){const t=x.useContext(Lt);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=x.useId();x.useEffect(()=>{if(e)return i(s)},[e]);const o=x.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const kt=e=>e.key||"";function Nr(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const on=typeof window<"u",Br=on?x.useLayoutEffect:x.useEffect,$r=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:l="left"})=>{const[a,c]=Fr(o),u=x.useMemo(()=>Nr(e),[e]),f=o&&!a?[]:u.map(kt),h=x.useRef(!0),p=x.useRef(u),v=rn(()=>new Map),[y,P]=x.useState(u),[b,S]=x.useState(u);Br(()=>{h.current=!1,p.current=u;for(let m=0;m<b.length;m++){const R=kt(b[m]);f.includes(R)?v.delete(R):v.get(R)!==!0&&v.set(R,!1)}},[b,f.length,f.join("-")]);const C=[];if(u!==y){let m=[...u];for(let R=0;R<b.length;R++){const N=b[R],D=kt(N);f.includes(D)||(m.splice(R,0,N),C.push(N))}return s==="wait"&&C.length&&(m=C),S(Nr(m)),P(u),null}process.env.NODE_ENV!=="production"&&s==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:A}=x.useContext(nn);return g.exports.jsx(g.exports.Fragment,{children:b.map(m=>{const R=kt(m),N=o&&!a?!1:u===b||f.includes(R),D=()=>{if(v.has(R))v.set(R,!0);else return;let B=!0;v.forEach(Q=>{Q||(B=!1)}),B&&(A==null||A(),S(p.current),o&&(c==null||c()),r&&r())};return g.exports.jsx(aa,{isPresent:N,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,onExitComplete:N?void 0:D,anchorX:l,children:m},R)})})},be=e=>e;let He=be,Le=be;process.env.NODE_ENV!=="production"&&(He=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Le=(e,t)=>{if(!e)throw new Error(t)});function an(e){let t;return()=>(t===void 0&&(t=e()),t)}const Xe=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Ae=e=>e*1e3,Re=e=>e/1e3,Ur={skipAnimations:!1,useManualTiming:!1},_t=["read","resolveKeyframes","update","preRender","render","postRender"],ke={value:null,addProjectionMetrics:null};function ua(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},a=0;function c(f){o.has(f)&&(u.schedule(f),e()),a++,f(l)}const u={schedule:(f,h=!1,p=!1)=>{const y=p&&i?n:r;return h&&o.add(f),y.has(f)||y.add(f),f},cancel:f=>{r.delete(f),o.delete(f)},process:f=>{if(l=f,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(c),t&&ke.value&&ke.value.frameloop[t].push(a),a=0,n.clear(),i=!1,s&&(s=!1,u.process(f))}};return u}const ca=40;function Wr(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=_t.reduce((b,S)=>(b[S]=ua(s,t?S:void 0),b),{}),{read:l,resolveKeyframes:a,update:c,preRender:u,render:f,postRender:h}=o,p=()=>{const b=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(b-i.timestamp,ca),1),i.timestamp=b,i.isProcessing=!0,l.process(i),a.process(i),c.process(i),u.process(i),f.process(i),h.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},v=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:_t.reduce((b,S)=>{const C=o[S];return b[S]=(A,m=!1,R=!1)=>(n||v(),C.schedule(A,m,R)),b},{}),cancel:b=>{for(let S=0;S<_t.length;S++)o[_t[S]].cancel(b)},state:i,steps:o}}const{schedule:te,cancel:_e,state:de,steps:ln}=Wr(typeof requestAnimationFrame<"u"?requestAnimationFrame:be,!0),zr=x.createContext({strict:!1}),Yr={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ze={};for(const e in Yr)Ze[e]={isEnabled:t=>Yr[e].some(n=>!!t[n])};function fa(e){for(const t in e)Ze[t]={...Ze[t],...e[t]}}const da=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function It(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||da.has(e)}let Kr=e=>!It(e);function ha(e){e&&(Kr=t=>t.startsWith("on")?!It(t):e(t))}try{ha(require("@emotion/is-prop-valid").default)}catch{}function pa(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Kr(i)||n===!0&&It(i)||!t&&!It(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const qr=new Set;function Ft(e,t,n){e||qr.has(t)||(console.warn(t),n&&console.warn(n),qr.add(t))}function ma(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Ft(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Nt=x.createContext({});function Bt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function dt(e){return typeof e=="string"||Array.isArray(e)}const un=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cn=["initial",...un];function $t(e){return Bt(e.animate)||cn.some(t=>dt(e[t]))}function Gr(e){return Boolean($t(e)||e.variants)}function ga(e,t){if($t(e)){const{initial:n,animate:r}=e;return{initial:n===!1||dt(n)?n:void 0,animate:dt(r)?r:void 0}}return e.inherit!==!1?t:{}}function ya(e){const{initial:t,animate:n}=ga(e,x.useContext(Nt));return x.useMemo(()=>({initial:t,animate:n}),[Hr(t),Hr(n)])}function Hr(e){return Array.isArray(e)?e.join(" "):e}const va=Symbol.for("motionComponentSymbol");function Je(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function xa(e,t,n){return x.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Je(n)&&(n.current=r))},[t])}const fn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Xr="data-"+fn("framerAppearId"),{schedule:dn,cancel:kd}=Wr(queueMicrotask,!1),Zr=x.createContext({});function ba(e,t,n,r,i){var s,o;const{visualElement:l}=x.useContext(Nt),a=x.useContext(zr),c=x.useContext(Lt),u=x.useContext(sn).reducedMotion,f=x.useRef(null);r=r||a.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=f.current,p=x.useContext(Zr);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&Ta(f.current,n,i,p);const v=x.useRef(!1);x.useInsertionEffect(()=>{h&&v.current&&h.update(n,c)});const y=n[Xr],P=x.useRef(Boolean(y)&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,y))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,y)));return Br(()=>{h&&(v.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),dn.render(h.render),P.current&&h.animationState&&h.animationState.animateChanges())}),x.useEffect(()=>{h&&(!P.current&&h.animationState&&h.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,y)}),P.current=!1))}),h}function Ta(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:l,layoutScroll:a,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Jr(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:Boolean(o)||l&&Je(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:a,layoutRoot:c})}function Jr(e){if(e)return e.options.allowProjection!==!1?e.projection:Jr(e.parent)}function wa({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var s,o;e&&fa(e);function l(c,u){let f;const h={...x.useContext(sn),...c,layoutId:Pa(c)},{isStatic:p}=h,v=ya(c),y=r(c,p);if(!p&&on){Sa(h,e);const P=Ca(h);f=P.MeasureLayout,v.visualElement=ba(i,y,h,t,P.ProjectionNode)}return g.exports.jsxs(Nt.Provider,{value:v,children:[f&&v.visualElement?g.exports.jsx(f,{visualElement:v.visualElement,...h}):null,n(i,c,xa(y,v.visualElement,u),y,p,v.visualElement)]})}l.displayName=`motion.${typeof i=="string"?i:`create(${(o=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&o!==void 0?o:""})`}`;const a=x.forwardRef(l);return a[va]=i,a}function Pa({layoutId:e}){const t=x.useContext(nn).id;return t&&e!==void 0?t+"-"+e:e}function Sa(e,t){const n=x.useContext(zr).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?He(!1,r):Le(!1,r)}}function Ca(e){const{drag:t,layout:n}=Ze;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Qr=e=>t=>typeof t=="string"&&t.startsWith(e),hn=Qr("--"),Ea=Qr("var(--"),pn=e=>Ea(e)?Aa.test(e.split("/*")[0].trim()):!1,Aa=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ht={};function ja(e){for(const t in e)ht[t]=e[t],hn(t)&&(ht[t].isCSSVariable=!0)}const Qe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ue=new Set(Qe);function ei(e,{layout:t,layoutId:n}){return Ue.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ht[e]||e==="opacity")}const pe=e=>Boolean(e&&e.getVelocity),ti=(e,t)=>t&&typeof e=="number"?t.transform(e):e,De=(e,t,n)=>n>t?t:n<e?e:n,et={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},pt={...et,transform:e=>De(0,1,e)},Ut={...et,default:1},mt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ie=mt("deg"),je=mt("%"),V=mt("px"),Ma=mt("vh"),Ra=mt("vw"),ni={...je,parse:e=>je.parse(e)/100,transform:e=>je.transform(e*100)},Da={borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,radius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,top:V,right:V,bottom:V,left:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,backgroundPositionX:V,backgroundPositionY:V},Va={rotate:Ie,rotateX:Ie,rotateY:Ie,rotateZ:Ie,scale:Ut,scaleX:Ut,scaleY:Ut,scaleZ:Ut,skew:Ie,skewX:Ie,skewY:Ie,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,transformPerspective:V,opacity:pt,originX:ni,originY:ni,originZ:V},ri={...et,transform:Math.round},mn={...Da,...Va,zIndex:ri,size:V,fillOpacity:pt,strokeOpacity:pt,numOctaves:ri},Oa={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},La=Qe.length;function ka(e,t,n){let r="",i=!0;for(let s=0;s<La;s++){const o=Qe[s],l=e[o];if(l===void 0)continue;let a=!0;if(typeof l=="number"?a=l===(o.startsWith("scale")?1:0):a=parseFloat(l)===0,!a||n){const c=ti(l,mn[o]);if(!a){i=!1;const u=Oa[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function gn(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,l=!1;for(const a in t){const c=t[a];if(Ue.has(a)){o=!0;continue}else if(hn(a)){i[a]=c;continue}else{const u=ti(c,mn[a]);a.startsWith("origin")?(l=!0,s[a]=u):r[a]=u}}if(t.transform||(o||n?r.transform=ka(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:a="50%",originY:c="50%",originZ:u=0}=s;r.transformOrigin=`${a} ${c} ${u}`}}const yn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ii(e,t,n){for(const r in t)!pe(t[r])&&!ei(r,n)&&(e[r]=t[r])}function _a({transformTemplate:e},t){return x.useMemo(()=>{const n=yn();return gn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ia(e,t){const n=e.style||{},r={};return ii(r,n,e),Object.assign(r,_a(e,t)),r}function Fa(e,t){const n={},r=Ia(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Na=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function vn(e){return typeof e!="string"||e.includes("-")?!1:!!(Na.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ba={offset:"stroke-dashoffset",array:"stroke-dasharray"},$a={offset:"strokeDashoffset",array:"strokeDasharray"};function Ua(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?Ba:$a;e[s.offset]=V.transform(-r);const o=V.transform(t),l=V.transform(n);e[s.array]=`${o} ${l}`}function si(e,t,n){return typeof e=="string"?e:V.transform(t+n*e)}function Wa(e,t,n){const r=si(t,e.x,e.width),i=si(n,e.y,e.height);return`${r} ${i}`}function xn(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:l=1,pathOffset:a=0,...c},u,f){if(gn(e,c,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:v}=e;h.transform&&(v&&(p.transform=h.transform),delete h.transform),v&&(i!==void 0||s!==void 0||p.transform)&&(p.transformOrigin=Wa(v,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Ua(h,o,l,a,!1)}const oi=()=>({...yn(),attrs:{}}),bn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function za(e,t,n,r){const i=x.useMemo(()=>{const s=oi();return xn(s,t,bn(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};ii(s,e.style,e),i.style={...s,...i.style}}return i}function Ya(e=!1){return(n,r,i,{latestValues:s},o)=>{const a=(vn(n)?za:Fa)(r,s,o,n),c=pa(r,typeof n=="string",e),u=n!==x.Fragment?{...c,...a,ref:i}:{},{children:f}=r,h=x.useMemo(()=>pe(f)?f.get():f,[f]);return x.createElement(n,{...u,children:h})}}function ai(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Tn(e,t,n,r){if(typeof t=="function"){const[i,s]=ai(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=ai(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const wn=e=>Array.isArray(e),Ka=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),qa=e=>wn(e)?e[e.length-1]||0:e;function Wt(e){const t=pe(e)?e.get():e;return Ka(t)?t.toValue():t}function Ga({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:Ha(r,i,s,e),renderState:t()};return n&&(o.onMount=l=>n({props:r,current:l,...o}),o.onUpdate=l=>n(l)),o}const li=e=>(t,n)=>{const r=x.useContext(Nt),i=x.useContext(Lt),s=()=>Ga(e,t,r,i);return n?s():rn(s)};function Ha(e,t,n,r){const i={},s=r(e,{});for(const h in s)i[h]=Wt(s[h]);let{initial:o,animate:l}=e;const a=$t(e),c=Gr(e);t&&c&&!a&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?l:o;if(f&&typeof f!="boolean"&&!Bt(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const v=Tn(e,h[p]);if(v){const{transitionEnd:y,transition:P,...b}=v;for(const S in b){let C=b[S];if(Array.isArray(C)){const A=u?C.length-1:0;C=C[A]}C!==null&&(i[S]=C)}for(const S in y)i[S]=y[S]}}}return i}function Pn(e,t,n){var r;const{style:i}=e,s={};for(const o in i)(pe(i[o])||t.style&&pe(t.style[o])||ei(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[o]=i[o]);return s}const Xa={useVisualState:li({scrapeMotionValuesFromProps:Pn,createRenderState:yn})};function ui(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function ci(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const fi=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function di(e,t,n,r){ci(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(fi.has(i)?i:fn(i),t.attrs[i])}function hi(e,t,n){const r=Pn(e,t,n);for(const i in e)if(pe(e[i])||pe(t[i])){const s=Qe.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const pi=["x","y","width","height","cx","cy","r"],Za={useVisualState:li({scrapeMotionValuesFromProps:hi,createRenderState:oi,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const l in i)if(Ue.has(l)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let l=0;l<pi.length;l++){const a=pi[l];e[a]!==t[a]&&(o=!0)}o&&te.read(()=>{ui(n,r),te.render(()=>{xn(r,i,bn(n.tagName),e.transformTemplate),di(n,r)})})}})};function Ja(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...vn(r)?Za:Xa,preloadedFeatures:e,useRender:Ya(i),createVisualElement:t,Component:r};return wa(o)}}function gt(e,t,n){const r=e.getProps();return Tn(r,t,n!==void 0?n:r.custom,e)}const Qa=an(()=>window.ScrollTimeline!==void 0);class el{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(Qa()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class tl extends el{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Sn(e,t){return e?e[t]||e.default||e:void 0}const Cn=2e4;function mi(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Cn;)t+=n,r=e.next(t);return t>=Cn?1/0:t}function En(e){return typeof e=="function"}function gi(e,t){e.timeline=t,e.onfinish=null}const An=e=>Array.isArray(e)&&typeof e[0]=="number",nl={linearEasing:void 0};function rl(e,t){const n=an(e);return()=>{var r;return(r=nl[t])!==null&&r!==void 0?r:n()}}const zt=rl(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),yi=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(Xe(0,i-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function vi(e){return Boolean(typeof e=="function"&&zt()||!e||typeof e=="string"&&(e in jn||zt())||An(e)||Array.isArray(e)&&e.every(vi))}const yt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,jn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yt([0,.65,.55,1]),circOut:yt([.55,0,1,.45]),backIn:yt([.31,.01,.66,-.59]),backOut:yt([.33,1.53,.69,.99])};function xi(e,t){if(e)return typeof e=="function"&&zt()?yi(e,t):An(e)?yt(e):Array.isArray(e)?e.map(n=>xi(n,t)||jn.easeOut):jn[e]}const Ee={x:!1,y:!1};function bi(){return Ee.x||Ee.y}function il(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;t&&(i=t.current);const s=(r=n==null?void 0:n[e])!==null&&r!==void 0?r:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function Ti(e,t){const n=il(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function wi(e){return!(e.pointerType==="touch"||bi())}function sl(e,t,n={}){const[r,i,s]=Ti(e,n),o=l=>{if(!wi(l))return;const{target:a}=l,c=t(a,l);if(typeof c!="function"||!a)return;const u=f=>{wi(f)&&(c(f),a.removeEventListener("pointerleave",u))};a.addEventListener("pointerleave",u,i)};return r.forEach(l=>{l.addEventListener("pointerenter",o,i)}),s}function Yt(e,t){const n=`${t}PointerCapture`;if(e.target instanceof Element&&n in e.target&&e.pointerId!==void 0)try{e.target[n](e.pointerId)}catch{}}const Pi=(e,t)=>t?e===t?!0:Pi(e,t.parentElement):!1,Mn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,ol=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function al(e){return ol.has(e.tagName)||e.tabIndex!==-1}const vt=new WeakSet;function Si(e){return t=>{t.key==="Enter"&&e(t)}}function Rn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const ll=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Si(()=>{if(vt.has(n))return;Rn(n,"down");const i=Si(()=>{Rn(n,"up")}),s=()=>Rn(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Ci(e){return Mn(e)&&!bi()}function ul(e,t,n={}){const[r,i,s]=Ti(e,n),o=l=>{const a=l.currentTarget;if(!a||!Ci(l)||vt.has(a))return;vt.add(a),Yt(l,"set");const c=t(a,l),u=(p,v)=>{a.removeEventListener("pointerup",f),a.removeEventListener("pointercancel",h),Yt(p,"release"),!(!Ci(p)||!vt.has(a))&&(vt.delete(a),typeof c=="function"&&c(p,{success:v}))},f=p=>{(p.isTrusted?cl(p,a instanceof Element?a.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?u(p,!1):u(p,!(a instanceof Element)||Pi(a,p.target))},h=p=>{u(p,!1)};a.addEventListener("pointerup",f,i),a.addEventListener("pointercancel",h,i),a.addEventListener("lostpointercapture",h,i)};return r.forEach(l=>{l=n.useGlobalTarget?window:l;let a=!1;l instanceof HTMLElement&&(a=!0,!al(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0)),l.addEventListener("pointerdown",o,i),a&&l.addEventListener("focus",c=>ll(c,i),i)}),s}function cl(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function fl(e){return e==="x"||e==="y"?Ee[e]?null:(Ee[e]=!0,()=>{Ee[e]=!1}):Ee.x||Ee.y?null:(Ee.x=Ee.y=!0,()=>{Ee.x=Ee.y=!1})}const Ei=new Set(["width","height","top","left","right","bottom",...Qe]);let Kt;function dl(){Kt=void 0}const Me={now:()=>(Kt===void 0&&Me.set(de.isProcessing||Ur.useManualTiming?de.timestamp:performance.now()),Kt),set:e=>{Kt=e,queueMicrotask(dl)}};function Dn(e,t){e.indexOf(t)===-1&&e.push(t)}function Vn(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class On{constructor(){this.subscriptions=[]}add(t){return Dn(this.subscriptions,t),()=>Vn(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Ai(e,t){return t?e*(1e3/t):0}const ji=30,hl=e=>!isNaN(parseFloat(e));class pl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=Me.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Me.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=hl(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ft(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new On);const r=this.events[t].add(n);return t==="change"?()=>{r(),te.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Me.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ji)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ji);return Ai(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function xt(e,t){return new pl(e,t)}function ml(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,xt(n))}function gl(e,t){const n=gt(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const l=qa(s[o]);ml(e,o,l)}}function yl(e){return Boolean(pe(e)&&e.add)}function Ln(e,t){const n=e.getValue("willChange");if(yl(n))return n.add(t)}function Mi(e){return e.props[Xr]}const vl={current:!1},Ri=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,xl=1e-7,bl=12;function Tl(e,t,n,r,i){let s,o,l=0;do o=t+(n-t)/2,s=Ri(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>xl&&++l<bl);return o}function bt(e,t,n,r){if(e===t&&n===r)return be;const i=s=>Tl(s,0,1,e,n);return s=>s===0||s===1?s:Ri(i(s),t,r)}const Di=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Vi=e=>t=>1-e(1-t),Oi=bt(.33,1.53,.69,.99),kn=Vi(Oi),Li=Di(kn),ki=e=>(e*=2)<1?.5*kn(e):.5*(2-Math.pow(2,-10*(e-1))),_n=e=>1-Math.sin(Math.acos(e)),_i=Vi(_n),Ii=Di(_n),Fi=e=>/^0[^.\s]+$/u.test(e);function wl(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Fi(e):!0}const Tt=e=>Math.round(e*1e5)/1e5,In=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Pl(e){return e==null}const Sl=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Fn=(e,t)=>n=>Boolean(typeof n=="string"&&Sl.test(n)&&n.startsWith(e)||t&&!Pl(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ni=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,l]=r.match(In);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Cl=e=>De(0,255,e),Nn={...et,transform:e=>Math.round(Cl(e))},We={test:Fn("rgb","red"),parse:Ni("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Nn.transform(e)+", "+Nn.transform(t)+", "+Nn.transform(n)+", "+Tt(pt.transform(r))+")"};function El(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Bn={test:Fn("#"),parse:El,transform:We.transform},tt={test:Fn("hsl","hue"),parse:Ni("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+je.transform(Tt(t))+", "+je.transform(Tt(n))+", "+Tt(pt.transform(r))+")"},me={test:e=>We.test(e)||Bn.test(e)||tt.test(e),parse:e=>We.test(e)?We.parse(e):tt.test(e)?tt.parse(e):Bn.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?We.transform(e):tt.transform(e)},Al=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function jl(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(In))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Al))===null||n===void 0?void 0:n.length)||0)>0}const Bi="number",$i="color",Ml="var",Rl="var(",Ui="${}",Dl=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function wt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const l=t.replace(Dl,a=>(me.test(a)?(r.color.push(s),i.push($i),n.push(me.parse(a))):a.startsWith(Rl)?(r.var.push(s),i.push(Ml),n.push(a)):(r.number.push(s),i.push(Bi),n.push(parseFloat(a))),++s,Ui)).split(Ui);return{values:n,split:l,indexes:r,types:i}}function Wi(e){return wt(e).values}function zi(e){const{split:t,types:n}=wt(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const l=n[o];l===Bi?s+=Tt(i[o]):l===$i?s+=me.transform(i[o]):s+=i[o]}return s}}const Vl=e=>typeof e=="number"?0:e;function Ol(e){const t=Wi(e);return zi(e)(t.map(Vl))}const Fe={test:jl,parse:Wi,createTransformer:zi,getAnimatableNone:Ol},Ll=new Set(["brightness","contrast","saturate","opacity"]);function kl(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(In)||[];if(!r)return e;const i=n.replace(r,"");let s=Ll.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const _l=/\b([a-z-]*)\(.*?\)/gu,$n={...Fe,getAnimatableNone:e=>{const t=e.match(_l);return t?t.map(kl).join(" "):e}},Il={...mn,color:me,backgroundColor:me,outlineColor:me,fill:me,stroke:me,borderColor:me,borderTopColor:me,borderRightColor:me,borderBottomColor:me,borderLeftColor:me,filter:$n,WebkitFilter:$n},Un=e=>Il[e];function Yi(e,t){let n=Un(e);return n!==$n&&(n=Fe),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Fl=new Set(["auto","none","0"]);function Nl(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!Fl.has(s)&&wt(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=Yi(n,i)}const Ki=e=>e===et||e===V,qi=(e,t)=>parseFloat(e.split(", ")[t]),Gi=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return qi(i[1],t);{const s=r.match(/^matrix\((.+)\)$/u);return s?qi(s[1],e):0}},Bl=new Set(["x","y","z"]),$l=Qe.filter(e=>!Bl.has(e));function Ul(e){const t=[];return $l.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const nt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Gi(4,13),y:Gi(5,14)};nt.translateX=nt.x,nt.translateY=nt.y;const ze=new Set;let Wn=!1,zn=!1;function Hi(){if(zn){const e=Array.from(ze).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=Ul(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var l;(l=r.getValue(s))===null||l===void 0||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}zn=!1,Wn=!1,ze.forEach(e=>e.complete()),ze.clear()}function Xi(){ze.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zn=!0)})}function Wl(){Xi(),Hi()}class Yn{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ze.add(this),Wn||(Wn=!0,te.read(Xi),te.resolveKeyframes(Hi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=i==null?void 0:i.get(),l=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const a=r.readValue(n,l);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=l),i&&o===void 0&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ze.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ze.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Zi=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),zl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Yl(e){const t=zl.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const Kl=4;function Ji(e,t,n=1){Le(n<=Kl,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,i]=Yl(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return Zi(o)?parseFloat(o):o}return pn(i)?Ji(i,t,n+1):i}const Qi=e=>t=>t.test(e),es=[et,V,je,Ie,Ra,Ma,{test:e=>e==="auto",parse:e=>e}],ts=e=>es.find(Qi(e));class ns extends Yn{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let a=0;a<t.length;a++){let c=t[a];if(typeof c=="string"&&(c=c.trim(),pn(c))){const u=Ji(c,n.current);u!==void 0&&(t[a]=u),a===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Ei.has(r)||t.length!==2)return;const[i,s]=t,o=ts(i),l=ts(s);if(o!==l)if(Ki(o)&&Ki(l))for(let a=0;a<t.length;a++){const c=t[a];typeof c=="string"&&(t[a]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)wl(t[i])&&r.push(i);r.length&&Nl(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=nt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,l=i[o];i[o]=nt[r](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([a,c])=>{n.getValue(a).set(c)}),this.resolveNoneKeyframes()}}const rs=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Fe.test(e)||e==="0")&&!e.startsWith("url("));function ql(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Gl(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=rs(i,t),l=rs(s,t);return He(o===l,`You are trying to animate ${t} from "${i}" to "${s}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${s} via the \`style\` property.`),!o||!l?!1:ql(e)||(n==="spring"||En(n))&&r}const Hl=e=>e!==null;function qt(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(Hl),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const Xl=40;class is{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Me.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Xl?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Wl(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Me.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:l,onUpdate:a,isGenerator:c}=this.options;if(!c&&!Gl(t,r,i,s))if(o)this.options.duration=0;else{a&&a(qt(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Pt={layout:0,mainThread:0,waapi:0},ne=(e,t,n)=>e+(t-e)*n;function Kn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Zl({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,a=2*n-l;i=Kn(a,l,e+1/3),s=Kn(a,l,e),o=Kn(a,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function Gt(e,t){return n=>n>0?t:e}const qn=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Jl=[Bn,We,tt],Ql=e=>Jl.find(t=>t.test(e));function ss(e){const t=Ql(e);if(He(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===tt&&(n=Zl(n)),n}const os=(e,t)=>{const n=ss(e),r=ss(t);if(!n||!r)return Gt(e,t);const i={...n};return s=>(i.red=qn(n.red,r.red,s),i.green=qn(n.green,r.green,s),i.blue=qn(n.blue,r.blue,s),i.alpha=ne(n.alpha,r.alpha,s),We.transform(i))},eu=(e,t)=>n=>t(e(n)),St=(...e)=>e.reduce(eu),Gn=new Set(["none","hidden"]);function tu(e,t){return Gn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function nu(e,t){return n=>ne(e,t,n)}function Hn(e){return typeof e=="number"?nu:typeof e=="string"?pn(e)?Gt:me.test(e)?os:su:Array.isArray(e)?as:typeof e=="object"?me.test(e)?os:ru:Gt}function as(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Hn(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function ru(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Hn(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function iu(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],l=e.indexes[o][i[o]],a=(n=e.values[l])!==null&&n!==void 0?n:0;r[s]=a,i[o]++}return r}const su=(e,t)=>{const n=Fe.createTransformer(t),r=wt(e),i=wt(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Gn.has(e)&&!i.values.length||Gn.has(t)&&!r.values.length?tu(e,t):St(as(iu(r,i),i.values),n):(He(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Gt(e,t))};function ls(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ne(e,t,n):Hn(e)(e,t)}const ou=5;function us(e,t,n){const r=Math.max(t-ou,0);return Ai(n-e(r),t-r)}const re={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Xn=.001;function au({duration:e=re.duration,bounce:t=re.bounce,velocity:n=re.velocity,mass:r=re.mass}){let i,s;He(e<=Ae(re.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=De(re.minDamping,re.maxDamping,o),e=De(re.minDuration,re.maxDuration,Re(e)),o<1?(i=c=>{const u=c*o,f=u*e,h=u-n,p=Zn(c,o),v=Math.exp(-f);return Xn-h/p*v},s=c=>{const f=c*o*e,h=f*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,v=Math.exp(-f),y=Zn(Math.pow(c,2),o);return(-i(c)+Xn>0?-1:1)*((h-p)*v)/y}):(i=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Xn+u*f},s=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const l=5/e,a=uu(i,s,l);if(e=Ae(e),isNaN(a))return{stiffness:re.stiffness,damping:re.damping,duration:e};{const c=Math.pow(a,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const lu=12;function uu(e,t,n){let r=n;for(let i=1;i<lu;i++)r=r-e(r)/t(r);return r}function Zn(e,t){return e*Math.sqrt(1-t*t)}const cu=["duration","bounce"],fu=["stiffness","damping","mass"];function cs(e,t){return t.some(n=>e[n]!==void 0)}function du(e){let t={velocity:re.velocity,stiffness:re.stiffness,damping:re.damping,mass:re.mass,isResolvedFromDuration:!1,...e};if(!cs(e,fu)&&cs(e,cu))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*De(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:re.mass,stiffness:i,damping:s}}else{const n=au(e);t={...t,...n,mass:re.mass},t.isResolvedFromDuration=!0}return t}function fs(e=re.visualDuration,t=re.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:s},{stiffness:a,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:p}=du({...n,velocity:-Re(n.velocity||0)}),v=h||0,y=c/(2*Math.sqrt(a*u)),P=o-s,b=Re(Math.sqrt(a/u)),S=Math.abs(P)<5;r||(r=S?re.restSpeed.granular:re.restSpeed.default),i||(i=S?re.restDelta.granular:re.restDelta.default);let C;if(y<1){const m=Zn(b,y);C=R=>{const N=Math.exp(-y*b*R);return o-N*((v+y*b*P)/m*Math.sin(m*R)+P*Math.cos(m*R))}}else if(y===1)C=m=>o-Math.exp(-b*m)*(P+(v+b*P)*m);else{const m=b*Math.sqrt(y*y-1);C=R=>{const N=Math.exp(-y*b*R),D=Math.min(m*R,300);return o-N*((v+y*b*P)*Math.sinh(D)+m*P*Math.cosh(D))/m}}const A={calculatedDuration:p&&f||null,next:m=>{const R=C(m);if(p)l.done=m>=f;else{let N=0;y<1&&(N=m===0?Ae(v):us(C,m,R));const D=Math.abs(N)<=r,B=Math.abs(o-R)<=i;l.done=D&&B}return l.value=l.done?o:R,l},toString:()=>{const m=Math.min(mi(A),Cn),R=yi(N=>A.next(m*N).value,m,30);return m+"ms "+R}};return A}function ds({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:l,max:a,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},p=D=>l!==void 0&&D<l||a!==void 0&&D>a,v=D=>l===void 0?a:a===void 0||Math.abs(l-D)<Math.abs(a-D)?l:a;let y=n*t;const P=f+y,b=o===void 0?P:o(P);b!==P&&(y=b-f);const S=D=>-y*Math.exp(-D/r),C=D=>b+S(D),A=D=>{const B=S(D),Q=C(D);h.done=Math.abs(B)<=c,h.value=h.done?b:Q};let m,R;const N=D=>{p(h.value)&&(m=D,R=fs({keyframes:[h.value,v(h.value)],velocity:us(C,D,h.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return N(0),{calculatedDuration:null,next:D=>{let B=!1;return!R&&m===void 0&&(B=!0,A(D),N(D)),m!==void 0&&D>=m?R.next(D-m):(!B&&A(D),h)}}}const hu=bt(.42,0,1,1),pu=bt(0,0,.58,1),hs=bt(.42,0,.58,1),mu=e=>Array.isArray(e)&&typeof e[0]!="number",ps={linear:be,easeIn:hu,easeInOut:hs,easeOut:pu,circIn:_n,circInOut:Ii,circOut:_i,backIn:kn,backInOut:Li,backOut:Oi,anticipate:ki},ms=e=>{if(An(e)){Le(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,i]=e;return bt(t,n,r,i)}else if(typeof e=="string")return Le(ps[e]!==void 0,`Invalid easing type '${e}'`),ps[e];return e};function gu(e,t,n){const r=[],i=n||ls,s=e.length-1;for(let o=0;o<s;o++){let l=i(e[o],e[o+1]);if(t){const a=Array.isArray(t)?t[o]||be:t;l=St(a,l)}r.push(l)}return r}function yu(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(Le(s===t.length,"Both input and output ranges must be the same length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=gu(t,r,i),a=l.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(a>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=Xe(e[f],e[f+1],u);return l[f](h)};return n?u=>c(De(e[0],e[s-1],u)):c}function vu(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Xe(0,t,r);e.push(ne(n,1,i))}}function xu(e){const t=[0];return vu(t,e.length-1),t}function bu(e,t){return e.map(n=>n*t)}function Tu(e,t){return e.map(()=>t||hs).splice(0,e.length-1)}function Ct({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=mu(r)?r.map(ms):ms(r),s={done:!1,value:t[0]},o=bu(n&&n.length===t.length?n:xu(t),e),l=yu(o,t,{ease:Array.isArray(i)?i:Tu(t,i)});return{calculatedDuration:e,next:a=>(s.value=l(a),s.done=a>=e,s)}}const wu=e=>{const t=({timestamp:n})=>e(n);return{start:()=>te.update(t,!0),stop:()=>_e(t),now:()=>de.isProcessing?de.timestamp:Me.now()}},Pu={decay:ds,inertia:ds,tween:Ct,keyframes:Ct,spring:fs},Su=e=>e/100;class Jn extends is{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:a}=this.options;a&&a()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Yn,l=(a,c)=>this.onKeyframesResolved(a,c);this.resolver=new o(s,l,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,l=En(n)?n:Pu[n]||Ct;let a,c;process.env.NODE_ENV!=="production"&&l!==Ct&&Le(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l!==Ct&&typeof t[0]!="number"&&(a=St(Su,ls(t[0],t[1])),t=[0,100]);const u=l({...this.options,keyframes:t});s==="mirror"&&(c=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=mi(u));const{calculatedDuration:f}=u,h=f+i,p=h*(r+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:a,calculatedDuration:f,resolvedDuration:h,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;Pt.mainThread++,this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:D}=this.options;return{done:!0,value:D[D.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:a,calculatedDuration:c,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return s.next(0);const{delay:h,repeat:p,repeatType:v,repeatDelay:y,onUpdate:P}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const b=this.currentTime-h*(this.speed>=0?1:-1),S=this.speed>=0?b<0:b>u;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let C=this.currentTime,A=s;if(p){const D=Math.min(this.currentTime,u)/f;let B=Math.floor(D),Q=D%1;!Q&&D>=1&&(Q=1),Q===1&&B--,B=Math.min(B,p+1),Boolean(B%2)&&(v==="reverse"?(Q=1-Q,y&&(Q-=y/f)):v==="mirror"&&(A=o)),C=De(0,1,Q)*f}const m=S?{done:!1,value:a[0]}:A.next(C);l&&(m.value=l(m.value));let{done:R}=m;!S&&c!==null&&(R=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return N&&i!==void 0&&(m.value=qt(a,this.options,i)),P&&P(m.value),N&&this.finish(),m}get duration(){const{resolved:t}=this;return t?Re(t.calculatedDuration):0}get time(){return Re(this.currentTime)}set time(t){t=Ae(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Re(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=wu,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel(),Pt.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Cu=new Set(["opacity","clipPath","filter","transform"]);function Eu(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:l="easeInOut",times:a}={}){const c={[t]:n};a&&(c.offset=a);const u=xi(l,i);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const Au=an(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Ht=10,ju=2e4;function Mu(e){return En(e.type)||e.type==="spring"||!vi(e.ease)}function Ru(e,t){const n=new Jn({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<ju;)r=n.sample(s),i.push(r.value),s+=Ht;return{times:void 0,keyframes:i,duration:s-Ht,ease:"linear"}}const gs={anticipate:ki,backInOut:Li,circInOut:Ii};function Du(e){return e in gs}class ys extends is{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new ns(s,(o,l)=>this.onKeyframesResolved(o,l),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:l,name:a,startTime:c}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof s=="string"&&zt()&&Du(s)&&(s=gs[s]),Mu(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:v,...y}=this.options,P=Ru(t,y);t=P.keyframes,t.length===1&&(t[1]=t[0]),r=P.duration,i=P.times,s=P.ease,o="keyframes"}const u=Eu(l.owner.current,a,t,{...this.options,duration:r,times:i,ease:s});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(gi(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;l.set(qt(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Re(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Re(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Ae(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return be;const{animation:r}=n;gi(r,t)}return be}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:f,element:h,...p}=this.options,v=new Jn({...p,keyframes:r,duration:i,type:s,ease:o,times:l,isGenerator:!0}),y=Ae(this.time);c.setWithVelocity(v.sample(y-Ht).value,v.sample(y).value,Ht)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:c}=n.owner.getProps();return Au()&&r&&Cu.has(r)&&!a&&!c&&!i&&s!=="mirror"&&o!==0&&l!=="inertia"}}const Vu={type:"spring",stiffness:500,damping:25,restSpeed:10},Ou=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Lu={type:"keyframes",duration:.8},ku={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},_u=(e,{keyframes:t})=>t.length>2?Lu:Ue.has(e)?e.startsWith("scale")?Ou(t[1]):Vu:ku;function Iu({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:l,from:a,elapsed:c,...u}){return!!Object.keys(u).length}const Qn=(e,t,n,r={},i,s)=>o=>{const l=Sn(r,e)||{},a=l.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Ae(a);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-c,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:s?void 0:i};Iu(l)||(u={...u,..._u(e,u)}),u.duration&&(u.duration=Ae(u.duration)),u.repeatDelay&&(u.repeatDelay=Ae(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(f=!0)),(vl.current||Ur.skipAnimations)&&(f=!0,u.duration=0,u.delay=0),f&&!s&&t.get()!==void 0){const h=qt(u.keyframes,l);if(h!==void 0)return te.update(()=>{u.onUpdate(h),u.onComplete()}),new tl([])}return!s&&ys.supports(u)?new ys(u):new Jn(u)};function Fu({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function vs(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...a}=t;r&&(o=r);const c=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const f in a){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),p=a[f];if(p===void 0||u&&Fu(u,f))continue;const v={delay:n,...Sn(o||{},f)};let y=!1;if(window.MotionHandoffAnimation){const b=Mi(e);if(b){const S=window.MotionHandoffAnimation(b,f,te);S!==null&&(v.startTime=S,y=!0)}}Ln(e,f),h.start(Qn(f,h,p,e.shouldReduceMotion&&Ei.has(f)?{type:!1}:v,e,y));const P=h.animation;P&&c.push(P)}return l&&Promise.all(c).then(()=>{te.update(()=>{l&&gl(e,l)})}),c}function er(e,t,n={}){var r;const i=gt(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(vs(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=s;return Nu(e,t,u+c,f,h,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[c,u]=a==="beforeChildren"?[o,l]:[l,o];return c().then(()=>u())}else return Promise.all([o(),l(n.delay)])}function Nu(e,t,n=0,r=0,i=1,s){const o=[],l=(e.variantChildren.size-1)*r,a=i===1?(c=0)=>c*r:(c=0)=>l-c*r;return Array.from(e.variantChildren).sort(Bu).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(er(c,t,{...s,delay:n+a(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function Bu(e,t){return e.sortNodePosition(t)}function $u(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>er(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=er(e,t,n);else{const i=typeof t=="function"?gt(e,t,n.custom):t;r=Promise.all(vs(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function xs(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Uu=cn.length;function bs(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?bs(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Uu;n++){const r=cn[n],i=e.props[r];(dt(i)||i===!1)&&(t[r]=i)}return t}const Wu=[...un].reverse(),zu=un.length;function Yu(e){return t=>Promise.all(t.map(({animation:n,options:r})=>$u(e,n,r)))}function Ku(e){let t=Yu(e),n=Ts(),r=!0;const i=a=>(c,u)=>{var f;const h=gt(e,u,a==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:v,...y}=h;c={...c,...y,...v}}return c};function s(a){t=a(e)}function o(a){const{props:c}=e,u=bs(e.parent)||{},f=[],h=new Set;let p={},v=1/0;for(let P=0;P<zu;P++){const b=Wu[P],S=n[b],C=c[b]!==void 0?c[b]:u[b],A=dt(C),m=b===a?S.isActive:null;m===!1&&(v=P);let R=C===u[b]&&C!==c[b]&&A;if(R&&r&&e.manuallyAnimateOnMount&&(R=!1),S.protectedKeys={...p},!S.isActive&&m===null||!C&&!S.prevProp||Bt(C)||typeof C=="boolean")continue;const N=qu(S.prevProp,C);let D=N||b===a&&S.isActive&&!R&&A||P>v&&A,B=!1;const Q=Array.isArray(C)?C:[C];let fe=Q.reduce(i(b),{});m===!1&&(fe={});const{prevResolvedValues:Te={}}=S,ae={...Te,...fe},ie=O=>{D=!0,h.has(O)&&(B=!0,h.delete(O)),S.needsAnimating[O]=!0;const k=e.getValue(O);k&&(k.liveStyle=!1)};for(const O in ae){const k=fe[O],le=Te[O];if(p.hasOwnProperty(O))continue;let T=!1;wn(k)&&wn(le)?T=!xs(k,le):T=k!==le,T?k!=null?ie(O):h.add(O):k!==void 0&&h.has(O)?ie(O):S.protectedKeys[O]=!0}S.prevProp=C,S.prevResolvedValues=fe,S.isActive&&(p={...p,...fe}),r&&e.blockInitialAnimation&&(D=!1),D&&(!(R&&N)||B)&&f.push(...Q.map(O=>({animation:O,options:{type:b}})))}if(h.size){const P={};if(typeof c.initial!="boolean"){const b=gt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);b&&b.transition&&(P.transition=b.transition)}h.forEach(b=>{const S=e.getBaseTarget(b),C=e.getValue(b);C&&(C.liveStyle=!0),P[b]=S??null}),f.push({animation:P})}let y=Boolean(f.length);return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function l(a,c){var u;if(n[a].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(a,c)}),n[a].isActive=c;const f=o(a);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Ts(),r=!0}}}function qu(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!xs(t,e):!1}function Ye(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ts(){return{animate:Ye(!0),whileInView:Ye(),whileHover:Ye(),whileTap:Ye(),whileDrag:Ye(),whileFocus:Ye(),exit:Ye()}}class Ne{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Gu extends Ne{constructor(t){super(t),t.animationState||(t.animationState=Ku(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Bt(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let Hu=0;class Xu extends Ne{constructor(){super(...arguments),this.id=Hu++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Zu={animation:{Feature:Gu},exit:{Feature:Xu}};function Et(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function At(e){return{point:{x:e.pageX,y:e.pageY}}}const Ju=e=>t=>Mn(t)&&e(t,At(t));function rt(e,t,n,r){return Et(e,t,Ju(n),r)}function ws({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Qu({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ec(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Ps=1e-4,tc=1-Ps,nc=1+Ps,Ss=.01,rc=0-Ss,ic=0+Ss;function ye(e){return e.max-e.min}function sc(e,t,n){return Math.abs(e-t)<=n}function Cs(e,t,n,r=.5){e.origin=r,e.originPoint=ne(t.min,t.max,e.origin),e.scale=ye(n)/ye(t),e.translate=ne(n.min,n.max,e.origin)-e.originPoint,(e.scale>=tc&&e.scale<=nc||isNaN(e.scale))&&(e.scale=1),(e.translate>=rc&&e.translate<=ic||isNaN(e.translate))&&(e.translate=0)}function jt(e,t,n,r){Cs(e.x,t.x,n.x,r?r.originX:void 0),Cs(e.y,t.y,n.y,r?r.originY:void 0)}function Es(e,t,n){e.min=n.min+t.min,e.max=e.min+ye(t)}function oc(e,t,n){Es(e.x,t.x,n.x),Es(e.y,t.y,n.y)}function As(e,t,n){e.min=t.min-n.min,e.max=e.min+ye(t)}function Mt(e,t,n){As(e.x,t.x,n.x),As(e.y,t.y,n.y)}const js=()=>({translate:0,scale:1,origin:0,originPoint:0}),it=()=>({x:js(),y:js()}),Ms=()=>({min:0,max:0}),se=()=>({x:Ms(),y:Ms()});function we(e){return[e("x"),e("y")]}function tr(e){return e===void 0||e===1}function nr({scale:e,scaleX:t,scaleY:n}){return!tr(e)||!tr(t)||!tr(n)}function Ke(e){return nr(e)||Rs(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Rs(e){return Ds(e.x)||Ds(e.y)}function Ds(e){return e&&e!=="0%"}function Xt(e,t,n){const r=e-n,i=t*r;return n+i}function Vs(e,t,n,r,i){return i!==void 0&&(e=Xt(e,i,r)),Xt(e,n,r)+t}function rr(e,t=0,n=1,r,i){e.min=Vs(e.min,t,n,r,i),e.max=Vs(e.max,t,n,r,i)}function Os(e,{x:t,y:n}){rr(e.x,t.translate,t.scale,t.originPoint),rr(e.y,n.translate,n.scale,n.originPoint)}const Ls=.999999999999,ks=1.0000000000001;function ac(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let l=0;l<i;l++){s=n[l],o=s.projectionDelta;const{visualElement:a}=s.options;a&&a.props.style&&a.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&ot(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Os(e,o)),r&&Ke(s.latestValues)&&ot(e,s.latestValues))}t.x<ks&&t.x>Ls&&(t.x=1),t.y<ks&&t.y>Ls&&(t.y=1)}function st(e,t){e.min=e.min+t,e.max=e.max+t}function _s(e,t,n,r,i=.5){const s=ne(e.min,e.max,i);rr(e,t,n,s,r)}function ot(e,t){_s(e.x,t.x,t.scaleX,t.scale,t.originX),_s(e.y,t.y,t.scaleY,t.scale,t.originY)}function Is(e,t){return ws(ec(e.getBoundingClientRect(),t))}function lc(e,t,n){const r=Is(e,n),{scroll:i}=t;return i&&(st(r.x,i.offset.x),st(r.y,i.offset.y)),r}const Fs=(e,t)=>Math.abs(e-t);function uc(e,t){const n=Fs(e.x,t.x),r=Fs(e.y,t.y);return Math.sqrt(n**2+r**2)}class Ns{constructor(t,n,{transformPagePoint:r,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=sr(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=uc(u.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:p}=u,{timestamp:v}=de;this.history.push({...p,timestamp:v});const{onStart:y,onMove:P}=this.handlers;f||(y&&y(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,u)},this.handlePointerMove=(u,f)=>{if(u.target instanceof Element&&u.target.hasPointerCapture&&u.pointerId!==void 0)try{if(!u.target.hasPointerCapture(u.pointerId))return}catch{}this.lastMoveEvent=u,this.lastMoveEventInfo=ir(f,this.transformPagePoint),te.update(this.updatePoint,!0)},this.handlePointerUp=(u,f)=>{Yt(u,"release"),this.end();const{onEnd:h,onSessionEnd:p,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=sr(u.type==="pointercancel"||u.type==="lostpointercapture"?this.lastMoveEventInfo:ir(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,y),p&&p(u,y)},!Mn(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r;const s=At(t),o=ir(s,this.transformPagePoint),{point:l}=o,{timestamp:a}=de;this.history=[{...l,timestamp:a}];const{onSessionStart:c}=n;c&&c(t,sr(o,this.history)),Yt(t,"set"),this.removeListeners=St(rt(t.currentTarget,"pointermove",this.handlePointerMove),rt(t.currentTarget,"pointerup",this.handlePointerUp),rt(t.currentTarget,"pointercancel",this.handlePointerUp),rt(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),_e(this.updatePoint)}}function ir(e,t){return t?{point:t(e.point)}:e}function Bs(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sr({point:e},t){return{point:e,delta:Bs(e,$s(t)),offset:Bs(e,cc(t)),velocity:fc(t,.1)}}function cc(e){return e[0]}function $s(e){return e[e.length-1]}function fc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=$s(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ae(t)));)n--;if(!r)return{x:0,y:0};const s=Re(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function dc(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ne(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ne(n,e,r.max):Math.min(e,n)),e}function Us(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function hc(e,{top:t,left:n,bottom:r,right:i}){return{x:Us(e.x,n,i),y:Us(e.y,t,r)}}function Ws(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function pc(e,t){return{x:Ws(e.x,t.x),y:Ws(e.y,t.y)}}function mc(e,t){let n=.5;const r=ye(e),i=ye(t);return i>r?n=Xe(t.min,t.max-r,e.min):r>i&&(n=Xe(e.min,e.max-i,t.min)),De(0,1,n)}function gc(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const or=.35;function yc(e=or){return e===!1?e=0:e===!0&&(e=or),{x:zs(e,"left","right"),y:zs(e,"top","bottom")}}function zs(e,t,n){return{min:Ys(e,t),max:Ys(e,n)}}function Ys(e,t){return typeof e=="number"?e:e[t]||0}const vc=new WeakMap;class xc{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=se(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(At(u).point)},s=(u,f)=>{const{drag:h,dragPropagation:p,onDragStart:v}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=fl(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),we(P=>{let b=this.getAxisMotionValue(P).get()||0;if(je.test(b)){const{projection:S}=this.visualElement;if(S&&S.layout){const C=S.layout.layoutBox[P];C&&(b=ye(C)*(parseFloat(b)/100))}}this.originPoint[P]=b}),v&&te.postRender(()=>v(u,f)),Ln(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:v,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:P}=f;if(p&&this.currentDirection===null){this.currentDirection=bc(P),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",f.point,P),this.updateAxis("y",f.point,P),this.visualElement.render(),y&&y(u,f)},l=(u,f)=>this.stop(u,f),a=()=>we(u=>{var f;return this.getAnimationState(u)==="paused"&&((f=this.getAxisMotionValue(u).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Ns(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:l,resumeAnimation:a},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&te.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Zt(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=dc(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&Je(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=hc(i.layoutBox,n):this.constraints=!1,this.elastic=yc(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&we(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=gc(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Je(t))return!1;const r=t.current;Le(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=lc(r,i.root,this.visualElement.getTransformPagePoint());let o=pc(i.layout.layoutBox,s);if(n){const l=n(Qu(o));this.hasMutatedConstraints=!!l,l&&(o=ws(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),a=this.constraints||{},c=we(u=>{if(!Zt(u,n,this.currentDirection))return;let f=a&&a[u]||{};o&&(f={min:0,max:0});const h=i?200:1e6,p=i?40:1e7,v={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(u,v)});return Promise.all(c).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ln(this.visualElement,t),r.start(Qn(t,r,0,n,this.visualElement,!1))}stopAnimation(){we(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){we(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){we(n=>{const{drag:r}=this.getProps();if(!Zt(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:l}=i.layout.layoutBox[n];s.set(t[n]-ne(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Je(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};we(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const a=l.get();i[o]=mc({min:a,max:a},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),we(o=>{if(!Zt(o,t,null))return;const l=this.getAxisMotionValue(o),{min:a,max:c}=this.constraints[o];l.set(ne(a,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;vc.set(this.visualElement,this);const t=this.visualElement.current,n=rt(t,"pointerdown",a=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(a)}),r=()=>{const{dragConstraints:a}=this.getProps();Je(a)&&a.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),te.read(r);const o=Et(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:a,hasLayoutChanged:c})=>{this.isDragging&&c&&(we(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=a[u].translate,f.set(f.get()+a[u].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=or,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:l}}}function Zt(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function bc(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Tc extends Ne{constructor(t){super(t),this.removeGroupControls=be,this.removeListeners=be,this.controls=new xc(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||be}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ks=e=>(t,n)=>{e&&te.postRender(()=>e(t,n))};class wc extends Ne{constructor(){super(...arguments),this.removePointerDownListener=be}onPointerDown(t){this.session=new Ns(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ks(t),onStart:Ks(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&te.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=rt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Jt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function qs(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Rt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(V.test(e))e=parseFloat(e);else return e;const n=qs(e,t.target.x),r=qs(e,t.target.y);return`${n}% ${r}%`}},Pc={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Fe.parse(e);if(i.length>5)return r;const s=Fe.createTransformer(e),o=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,a=n.y.scale*t.y;i[0+o]/=l,i[1+o]/=a;const c=ne(l,a,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};class Sc extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;ja(Cc),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Jt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||te.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),dn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Gs(e){const[t,n]=Fr(),r=x.useContext(nn);return g.exports.jsx(Sc,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(Zr),isPresent:t,safeToRemove:n})}const Cc={borderRadius:{...Rt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Rt,borderTopRightRadius:Rt,borderBottomLeftRadius:Rt,borderBottomRightRadius:Rt,boxShadow:Pc};function Ec(e,t,n){const r=pe(e)?e:xt(e);return r.start(Qn("",r,t,n)),r.animation}function Ac(e){return e instanceof SVGElement&&e.tagName!=="svg"}const jc=(e,t)=>e.depth-t.depth;class Mc{constructor(){this.children=[],this.isDirty=!1}add(t){Dn(this.children,t),this.isDirty=!0}remove(t){Vn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(jc),this.isDirty=!1,this.children.forEach(t)}}function Rc(e,t){const n=Me.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(_e(r),e(s-t))};return te.read(r,!0),()=>_e(r)}const Hs=["TopLeft","TopRight","BottomLeft","BottomRight"],Dc=Hs.length,Xs=e=>typeof e=="string"?parseFloat(e):e,Zs=e=>typeof e=="number"||V.test(e);function Vc(e,t,n,r,i,s){i?(e.opacity=ne(0,n.opacity!==void 0?n.opacity:1,Oc(r)),e.opacityExit=ne(t.opacity!==void 0?t.opacity:1,0,Lc(r))):s&&(e.opacity=ne(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Dc;o++){const l=`border${Hs[o]}Radius`;let a=Js(t,l),c=Js(n,l);if(a===void 0&&c===void 0)continue;a||(a=0),c||(c=0),a===0||c===0||Zs(a)===Zs(c)?(e[l]=Math.max(ne(Xs(a),Xs(c),r),0),(je.test(c)||je.test(a))&&(e[l]+="%")):e[l]=c}(t.rotate||n.rotate)&&(e.rotate=ne(t.rotate||0,n.rotate||0,r))}function Js(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Oc=Qs(0,.5,_i),Lc=Qs(.5,.95,be);function Qs(e,t,n){return r=>r<e?0:r>t?1:n(Xe(e,t,r))}function eo(e,t){e.min=t.min,e.max=t.max}function Pe(e,t){eo(e.x,t.x),eo(e.y,t.y)}function to(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function no(e,t,n,r,i){return e-=t,e=Xt(e,1/n,r),i!==void 0&&(e=Xt(e,1/i,r)),e}function kc(e,t=0,n=1,r=.5,i,s=e,o=e){if(je.test(t)&&(t=parseFloat(t),t=ne(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=ne(s.min,s.max,r);e===s&&(l-=t),e.min=no(e.min,t,n,l,i),e.max=no(e.max,t,n,l,i)}function ro(e,t,[n,r,i],s,o){kc(e,t[n],t[r],t[i],t.scale,s,o)}const _c=["x","scaleX","originX"],Ic=["y","scaleY","originY"];function io(e,t,n,r){ro(e.x,t,_c,n?n.x:void 0,r?r.x:void 0),ro(e.y,t,Ic,n?n.y:void 0,r?r.y:void 0)}function so(e){return e.translate===0&&e.scale===1}function oo(e){return so(e.x)&&so(e.y)}function ao(e,t){return e.min===t.min&&e.max===t.max}function Fc(e,t){return ao(e.x,t.x)&&ao(e.y,t.y)}function lo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function uo(e,t){return lo(e.x,t.x)&&lo(e.y,t.y)}function co(e){return ye(e.x)/ye(e.y)}function fo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Nc{constructor(){this.members=[]}add(t){Dn(this.members,t),t.scheduleRender()}remove(t){if(Vn(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Bc(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:h,skewX:p,skewY:v}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),v&&(r+=`skewY(${v}deg) `)}const l=e.x.scale*t.x,a=e.y.scale*t.y;return(l!==1||a!==1)&&(r+=`scale(${l}, ${a})`),r||"none"}const qe={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ar=["","X","Y","Z"],$c={visibility:"hidden"},ho=1e3;let Uc=0;function lr(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function po(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Mi(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",te,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&po(r)}function mo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},l=t==null?void 0:t()){this.id=Uc++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,ke.value&&(qe.nodes=qe.calculatedTargetDeltas=qe.calculatedProjections=0),this.nodes.forEach(Yc),this.nodes.forEach(Xc),this.nodes.forEach(Zc),this.nodes.forEach(Kc),ke.addProjectionMetrics&&ke.addProjectionMetrics(qe)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let a=0;a<this.path.length;a++)this.path[a].shouldResetTransform=!0;this.root===this&&(this.nodes=new Mc)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new On),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const a=this.eventHandlers.get(o);a&&a.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ac(o),this.instance=o;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(c||a)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Rc(h,250),Jt.hasAnimatedSinceResize&&(Jt.hasAnimatedSinceResize=!1,this.nodes.forEach(yo))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:p,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||nf,{onLayoutAnimationStart:P,onLayoutAnimationComplete:b}=u.getProps(),S=!this.targetLayout||!uo(this.targetLayout,v),C=!h&&p;if(this.options.layoutRoot||this.resumeFrom||C||h&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,C);const A={...Sn(y,"layout"),onPlay:P,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A)}else h||yo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,_e(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Jc),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&po(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:a}=this.options;if(l===void 0&&!a)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(go);return}this.isUpdating||this.nodes.forEach(Gc),this.isUpdating=!1,this.nodes.forEach(Hc),this.nodes.forEach(Wc),this.nodes.forEach(zc),this.clearAllSnapshots();const l=Me.now();de.delta=De(0,1e3/60,l-de.timestamp),de.timestamp=l,de.isProcessing=!0,ln.update.process(de),ln.preRender.process(de),ln.render.process(de),de.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,dn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(qc),this.sharedNodes.forEach(Qc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,te.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){te.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ye(this.snapshot.measuredBox.x)&&!ye(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let a=0;a<this.path.length;a++)this.path[a].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=se(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l){const a=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:a,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:a}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!oo(this.projectionDelta),a=this.getTransformTemplate(),c=a?a(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(l||Ke(this.latestValues)||u)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let a=this.removeElementScroll(l);return o&&(a=this.removeTransform(a)),rf(a),{animationId:this.root.animationId,measuredBox:l,layoutBox:a,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:l}=this.options;if(!l)return se();const a=l.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(sf))){const{scroll:u}=this.root;u&&(st(a.x,u.offset.x),st(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=se();if(Pe(a,o),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Pe(a,o),st(a.x,f.offset.x),st(a.y,f.offset.y))}return a}applyTransform(o,l=!1){const a=se();Pe(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ot(a,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ke(u.latestValues)&&ot(a,u.latestValues)}return Ke(this.latestValues)&&ot(a,this.latestValues),a}removeTransform(o){const l=se();Pe(l,o);for(let a=0;a<this.path.length;a++){const c=this.path[a];if(!c.instance||!Ke(c.latestValues))continue;nr(c.latestValues)&&c.updateSnapshot();const u=se(),f=c.measurePageBox();Pe(u,f),io(l,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Ke(this.latestValues)&&io(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==de.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var l;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=Boolean(this.resumingFrom)||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=de.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=se(),this.relativeTargetOrigin=se(),Mt(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Pe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=se(),this.targetWithTransforms=se()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),oc(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Pe(this.target,this.layout.layoutBox),Os(this.target,this.targetDelta)):Pe(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&Boolean(p.resumingFrom)===Boolean(this.resumingFrom)&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=se(),this.relativeTargetOrigin=se(),Mt(this.relativeTargetOrigin,this.target,p.target),Pe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ke.value&&qe.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||nr(this.parent.latestValues)||Rs(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const l=this.getLead(),a=Boolean(this.resumingFrom)||this!==l;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===de.timestamp&&(c=!1),c)return;const{layout:u,layoutId:f}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||f))return;Pe(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;ac(this.layoutCorrected,this.treeScale,this.path,a),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=se());const{target:v}=l;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(to(this.prevProjectionDelta.x,this.projectionDelta.x),to(this.prevProjectionDelta.y,this.projectionDelta.y)),jt(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!fo(this.projectionDelta.x,this.prevProjectionDelta.x)||!fo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),ke.value&&qe.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=it(),this.projectionDelta=it(),this.projectionDeltaWithTransform=it()}setAnimationOrigin(o,l=!1){const a=this.snapshot,c=a?a.latestValues:{},u={...this.latestValues},f=it();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const h=se(),p=a?a.source:void 0,v=this.layout?this.layout.source:void 0,y=p!==v,P=this.getStack(),b=!P||P.members.length<=1,S=Boolean(y&&!b&&this.options.crossfade===!0&&!this.path.some(tf));this.animationProgress=0;let C;this.mixTargetDelta=A=>{const m=A/1e3;vo(f.x,o.x,m),vo(f.y,o.y,m),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Mt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ef(this.relativeTarget,this.relativeTargetOrigin,h,m),C&&Fc(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=se()),Pe(C,this.relativeTarget)),y&&(this.animationValues=u,Vc(u,c,this.latestValues,m,S,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=m},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(_e(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=te.update(()=>{Jt.hasAnimatedSinceResize=!0,Pt.layout++,this.currentAnimation=Ec(0,ho,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onStop:()=>{Pt.layout--},onComplete:()=>{Pt.layout--,o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ho),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:a,layout:c,latestValues:u}=o;if(!(!l||!a||!c)){if(this!==o&&this.layout&&c&&Po(this.options.animationType,this.layout.layoutBox,c.layoutBox)){a=this.target||se();const f=ye(this.layout.layoutBox.x);a.x.min=o.target.x.min,a.x.max=a.x.min+f;const h=ye(this.layout.layoutBox.y);a.y.min=o.target.y.min,a.y.max=a.y.min+h}Pe(l,a),ot(l,u),jt(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Nc),this.sharedNodes.get(o).add(l);const c=l.options.initialPromotionConfig;l.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:a}={}){const c=this.getStack();c&&c.promote(this,a),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:a}=o;if((a.z||a.rotate||a.rotateX||a.rotateY||a.rotateZ||a.skewX||a.skewY)&&(l=!0),!l)return;const c={};a.z&&lr("z",o,c,this.animationValues);for(let u=0;u<ar.length;u++)lr(`rotate${ar[u]}`,o,c,this.animationValues),lr(`skew${ar[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}getProjectionStyles(o){var l,a;if(!this.instance||this.isSVG)return;if(!this.isVisible)return $c;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Wt(o==null?void 0:o.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=Wt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ke(this.latestValues)&&(y.transform=u?u({},""):"none",this.hasProjected=!1),y}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=Bc(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:p,y:v}=this.projectionDelta;c.transformOrigin=`${p.origin*100}% ${v.origin*100}% 0`,f.animationValues?c.opacity=f===this?(a=(l=h.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&a!==void 0?a:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:c.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const y in ht){if(h[y]===void 0)continue;const{correct:P,applyTo:b,isCSSVariable:S}=ht[y],C=c.transform==="none"?h[y]:P(h[y],f);if(b){const A=b.length;for(let m=0;m<A;m++)c[b[m]]=C}else S?this.options.visualElement.renderState.vars[y]=C:c[y]=C}return this.options.layoutId&&(c.pointerEvents=f===this?Wt(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(go),this.root.sharedNodes.clear()}}}function Wc(e){e.updateLayout()}function zc(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?we(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],p=ye(h);h.min=r[f].min,h.max=h.min+p}):Po(s,n.layoutBox,r)&&we(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],p=ye(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const l=it();jt(l,r,n.layoutBox);const a=it();o?jt(a,e.applyTransform(i,!0),n.measuredBox):jt(a,r,n.layoutBox);const c=!oo(l);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const v=se();Mt(v,n.layoutBox,h.layoutBox);const y=se();Mt(y,r,p.layoutBox),uo(v,y)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=v,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:a,layoutDelta:l,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Yc(e){ke.value&&qe.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Kc(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function qc(e){e.clearSnapshot()}function go(e){e.clearMeasurements()}function Gc(e){e.isLayoutDirty=!1}function Hc(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function yo(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Xc(e){e.resolveTargetDelta()}function Zc(e){e.calcProjection()}function Jc(e){e.resetSkewAndRotation()}function Qc(e){e.removeLeadSnapshot()}function vo(e,t,n){e.translate=ne(t.translate,0,n),e.scale=ne(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function xo(e,t,n,r){e.min=ne(t.min,n.min,r),e.max=ne(t.max,n.max,r)}function ef(e,t,n,r){xo(e.x,t.x,n.x,r),xo(e.y,t.y,n.y,r)}function tf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const nf={duration:.45,ease:[.4,0,.1,1]},bo=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),To=bo("applewebkit/")&&!bo("chrome/")?Math.round:be;function wo(e){e.min=To(e.min),e.max=To(e.max)}function rf(e){wo(e.x),wo(e.y)}function Po(e,t,n){return e==="position"||e==="preserve-aspect"&&!sc(co(t),co(n),.2)}function sf(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const of=mo({attachResizeListener:(e,t)=>Et(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ur={current:void 0},So=mo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ur.current){const e=new of({});e.mount(window),e.setOptions({layoutScroll:!0}),ur.current=e}return ur.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),af={pan:{Feature:wc},drag:{Feature:Tc,ProjectionNode:So,MeasureLayout:Gs}};function Co(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&te.postRender(()=>s(t,At(t)))}class lf extends Ne{mount(){const{current:t}=this.node;t&&(this.unmount=sl(t,(n,r)=>(Co(this.node,r,"Start"),i=>Co(this.node,i,"End"))))}unmount(){}}class uf extends Ne{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=St(Et(this.node.current,"focus",()=>this.onFocus()),Et(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Eo(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&te.postRender(()=>s(t,At(t)))}class cf extends Ne{mount(){const{current:t}=this.node;t&&(this.unmount=ul(t,(n,r)=>(Eo(this.node,r,"Start"),(i,{success:s})=>Eo(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const cr=new WeakMap,fr=new WeakMap,ff=e=>{const t=cr.get(e.target);t&&t(e)},df=e=>{e.forEach(ff)};function hf({root:e,...t}){const n=e||document;fr.has(n)||fr.set(n,{});const r=fr.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(df,{root:e,...t})),r[i]}function pf(e,t,n){const r=hf(t);return cr.set(e,n),r.observe(e),()=>{cr.delete(e),r.unobserve(e)}}const mf={some:0,all:1};class gf extends Ne{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:mf[i]},l=a=>{const{isIntersecting:c}=a;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),h=c?u:f;h&&h(a)};return pf(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(yf(t,n))&&this.startObserver()}unmount(){}}function yf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const vf={inView:{Feature:gf},tap:{Feature:cf},focus:{Feature:uf},hover:{Feature:lf}},xf={layout:{ProjectionNode:So,MeasureLayout:Gs}},dr={current:null},Ao={current:!1};function bf(){if(Ao.current=!0,!!on)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>dr.current=e.matches;e.addListener(t),t()}else dr.current=!1}const Tf=[...es,me,Fe],wf=e=>Tf.find(Qi(e)),Pf=new WeakMap;function Sf(e,t,n){for(const r in t){const i=t[r],s=n[r];if(pe(i))e.addValue(r,i),process.env.NODE_ENV==="development"&&Ft(i.version==="12.4.7",`Attempting to mix Motion versions ${i.version} with 12.4.7 may not work as expected.`);else if(pe(s))e.addValue(r,xt(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,xt(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const jo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Cf{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Yn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Me.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,te.render(this.render,!1,!0))};const{latestValues:a,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=l,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=$t(n),this.isVariantNode=Gr(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const v=h[p];a[p]!==void 0&&pe(v)&&v.set(a[p],!1)}}mount(t){this.current=t,Pf.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Ao.current||bf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:dr.current,process.env.NODE_ENV!=="production"&&Ft(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),_e(this.notifyUpdate),_e(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Ue.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&te.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ze){const n=Ze[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):se()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<jo.length;r++){const i=jo[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Sf(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=xt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Zi(i)||Fi(i))?i=parseFloat(i):!wf(i)&&Fe.test(n)&&(i=Yi(t,n)),this.setBaseTarget(t,pe(i)?i.get():i)),pe(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=Tn(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!pe(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new On),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Mo extends Cf{constructor(){super(...arguments),this.KeyframeResolver=ns}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;pe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Ef(e){return window.getComputedStyle(e)}class Af extends Mo{constructor(){super(...arguments),this.type="html",this.renderInstance=ci}readValueFromInstance(t,n){if(Ue.has(n)){const r=Un(n);return r&&r.default||0}else{const r=Ef(t),i=(hn(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Is(t,n)}build(t,n,r){gn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Pn(t,n,r)}}class jf extends Mo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=se,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&ui(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ue.has(n)){const r=Un(n);return r&&r.default||0}return n=fi.has(n)?n:fn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return hi(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&te.postRender(this.updateDimensions)}build(t,n,r){xn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){di(t,n,r,i)}mount(t){this.isSVGTag=bn(t.tagName),super.mount(t)}}const Mf=(e,t)=>vn(e)?new jf(t):new Af(t,{allowProjection:e!==x.Fragment}),Rf=Ja({...Zu,...vf,...af,...xf},Mf),hr=ma(Rf),Df=({isOpen:e,onClose:t,onConfirm:n,header:r,question:i})=>e?g.exports.jsx("div",{id:"default-modal",tabIndex:-1,"aria-hidden":"true",className:"fixed top-0 right-0 left-0 z-10 w-full md:inset-0 h-full max-h-full overflow-y-auto overflow-x-hidden flex justify-center items-center bg-[rgb(0,0,0,0.6)]",children:g.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:g.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[g.exports.jsxs("div",{className:"flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600 border-gray-200",children:[g.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),g.exports.jsxs("button",{type:"button",className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 inline-flex justify-center items-center",onClick:t,children:[g.exports.jsx("svg",{className:"w-3 h-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 14",children:g.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),g.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),g.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:g.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[i," "]})}),g.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[g.exports.jsx("button",{onClick:()=>{n(),t()},type:"button",className:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",children:"Yes "}),g.exports.jsx("button",{onClick:t,type:"button",className:"py-2.5 px-5 ms-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700",children:"Cancel"})]})]})})}):null,Vf=({items:e,isVisible:t,position:n,messageId:r,isCurrentUserMessage:i})=>g.exports.jsx($r,{children:t&&g.exports.jsx(hr.div,{initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:-10},transition:{duration:.2,ease:"easeOut"},className:"absolute z-20 bg-white shadow-lg rounded-md p-2 px-1 w-42",style:{top:n.y,left:n.x},children:e.map((s,o)=>s!=null&&s.onlyCurrentUserMessage&&!i?null:g.exports.jsxs("button",{className:"cursor-pointer flex items-center gap-2 w-full rounded-md text-left px-2 py-1 hover:bg-gray-200",onClick:()=>s.onClick(r),children:[x.cloneElement(s.icon,{className:"text-black",size:18})," ",g.exports.jsx("span",{className:"ml-2 text-black",children:s.name})]},o))})}),Of=()=>g.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.exports.jsx("path",{d:"M9.77169 2.74358C12.1132 0.399998 15.9121 0.399998 18.2553 2.74314C20.5384 5.02621 20.5969 8.69142 18.4309 11.0454L18.2428 11.2427L9.44273 20.0409L9.40616 20.0712C7.94492 21.3879 5.69092 21.3432 4.28355 19.9358C2.96453 18.6168 2.84241 16.5541 3.9172 15.0974C3.94054 15.0521 3.96879 15.0083 4.002 14.9672L4.05556 14.9075L4.14247 14.8198L4.28355 14.6719L4.28647 14.6748L11.7222 7.22047C11.9881 6.95385 12.4047 6.92909 12.6986 7.14656L12.7829 7.21906C13.0495 7.48497 13.0742 7.9016 12.8568 8.19551L12.7843 8.27972L5.18966 15.8928C4.47202 16.7684 4.5219 18.0627 5.3393 18.8801C6.16836 19.7091 7.48801 19.7486 8.3638 18.9985L17.1965 10.1681C18.952 8.41041 18.952 5.56116 17.1946 3.8038C15.4922 2.10136 12.765 2.04816 10.9986 3.6442L10.8307 3.8038L10.8181 3.81812L1.28179 13.3544C0.988902 13.6473 0.514028 13.6473 0.221135 13.3544C-0.0451319 13.0882 -0.0693378 12.6715 0.148517 12.3779L0.221135 12.2938L9.77001 2.74314L9.77169 2.74358Z",fill:"#8A8A8A"})}),Lf=()=>g.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.exports.jsx("path",{d:"M13.25 9C13.6297 9 13.9435 9.28215 13.9932 9.64823L14 9.75V10.25C14 13.8094 11.245 16.7254 7.75098 16.9817L7.75 19.25C7.75 19.6642 7.41421 20 7 20C6.6203 20 6.30651 19.7178 6.25685 19.3518L6.25 19.25L6.25002 16.9818C2.83323 16.7316 0.122835 13.938 0.00406027 10.4863L0 10.25V9.75C0 9.33579 0.335786 9 0.75 9C1.1297 9 1.44349 9.28215 1.49315 9.64823L1.5 9.75V10.25C1.5 13.077 3.73445 15.3821 6.5336 15.4956L6.75 15.5H7.25C10.077 15.5 12.3821 13.2656 12.4956 10.4664L12.5 10.25V9.75C12.5 9.33579 12.8358 9 13.25 9ZM7 0C9.20914 0 11 1.79086 11 4V10C11 12.2091 9.20914 14 7 14C4.79086 14 3 12.2091 3 10V4C3 1.79086 4.79086 0 7 0ZM7 1.5C5.61929 1.5 4.5 2.61929 4.5 4V10C4.5 11.3807 5.61929 12.5 7 12.5C8.38071 12.5 9.5 11.3807 9.5 10V4C9.5 2.61929 8.38071 1.5 7 1.5Z",fill:"#fff"})}),Ro=()=>g.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.exports.jsx("path",{d:"M10.8147 10.1974L3.28344 11.4526C3.10705 11.482 2.95979 11.6034 2.89723 11.7709L0.299335 18.7283C0.0506615 19.3678 0.720085 19.9778 1.33375 19.671L19.3337 10.671C19.8865 10.3946 19.8865 9.60573 19.3337 9.32933L1.33375 0.329334C0.720085 0.0225017 0.0506615 0.632543 0.299335 1.27199L2.89723 8.22938C2.95979 8.39691 3.10705 8.51827 3.28344 8.54767L10.8147 9.80287C10.9236 9.82103 10.9972 9.92408 10.9791 10.033C10.965 10.1173 10.899 10.1834 10.8147 10.1974Z",fill:"#fff"})}),pr=e=>g.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:g.exports.jsxs("g",{fill:"none",children:[g.exports.jsx("path",{className:"background",fill:"#ffffff",d:"M8,1 L9,1 L9,20 L8,20 L8,18 C7.807,15.161 7.124,12.233 5.950,9.218 C5.046,6.893 3.504,4.733 1.325,2.738 L1.325,2.738 C0.917,2.365 0.89,1.732 1.263,1.325 C1.452,1.118 1.72,1 2,1 L8,1 Z"}),g.exports.jsx("path",{className:" fill-gray-200",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0 L9,0 L9,20 L7,20 L7,20 L7.002,18.068 C6.816,15.333 6.156,12.504 5.018,9.58 C4.172,7.406 2.72,5.371 0.649,3.475 C-0.165,2.729 -0.221,1.464 0.525,0.649 C0.904,0.236 1.439,0 2,0 Z"}),g.exports.jsx("path",{className:"border_2x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.5 L9,0.5 L9,20 L7.5,20 L7.5,20 L7.501,18.034 C7.312,15.247 6.64,12.369 5.484,9.399 C4.609,7.15 3.112,5.052 0.987,3.106 C0.376,2.547 0.334,1.598 0.894,0.987 C1.178,0.677 1.579,0.5 2,0.5 Z"}),g.exports.jsx("path",{className:"border_3x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.667 L9,0.667 L9,20 L7.667,20 L7.667,20 L7.668,18.023 C7.477,15.218 6.802,12.324 5.64,9.338 C4.755,7.064 3.243,4.946 1.1,2.983 C0.557,2.486 0.52,1.643 1.017,1.1 C1.269,0.824 1.626,0.667 2,0.667 Z"})]})}),kf=({onSendMessage:e,onSendVoice:t,onFileSend:n,dynamicSymbolAssignments:r})=>{const[i,s]=x.useState(""),[o,l]=x.useState(!1),[a,c]=x.useState(0),[u,f]=x.useState(null),[h,p]=x.useState(null),[v,y]=x.useState(0),P=x.useRef(null),b=x.useRef([]),S=x.useRef(null),C=x.useRef(null),A=x.useRef(null),[m,R]=x.useState(!1),N=U=>{const O=U.target.value;s(O);const k=O.match(/(\S+)$/);if(k){const le=k[0];if(u){const T=k[0].split(u)[1];p(T)}r!=null&&r.some(T=>T.symbol===le)&&f(le)}else f(null)},D=(U,O)=>{s(k=>k+O+" "),f(null),C.current.focus()},B=()=>{i.trim()!==""&&(e(i),s(""),f(null))},Q=async()=>{l(!0),c(0),b.current=[],S.current=setInterval(()=>{c(k=>k+1)},1e3);const U=await navigator.mediaDevices.getUserMedia({audio:!0}),O=new MediaRecorder(U);P.current=O,O.ondataavailable=k=>{k.data.size>0&&b.current.push(k.data)},O.onstop=()=>{clearInterval(S.current);const k=new Blob(b.current,{type:"audio/mp3"}),le=URL.createObjectURL(k);t(le),l(!1)},O.start()},fe=()=>{var U;(U=P.current)==null||U.stop()},Te=()=>{var U;(U=A.current)==null||U.click()},ae=U=>{var k;const O=(k=U.target.files)==null?void 0:k[0];O&&n(O)},ie=U=>{const O=Math.floor(U/60),k=U%60;return`${O.toString().padStart(2,"0")}:${k.toString().padStart(2,"0")}`},ve=U=>{const{scrollTop:O,scrollHeight:k,clientHeight:le}=U.currentTarget;if(O>v){if(O+le>=k-1){const E=r==null?void 0:r.find(_=>_.symbol===u);E&&(E!=null&&E.updatePageNumber)&&(R(!0),E==null||E.updatePageNumber(E.pagNumber+1),y(O),setTimeout(()=>{R(!1)},500))}}else y(O)};return g.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[o?g.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[g.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:ie(a)}),g.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:fe,children:g.exports.jsx(Ro,{})})]}):g.exports.jsxs(g.exports.Fragment,{children:[g.exports.jsxs("div",{className:"w-[90%] relative ",children:[g.exports.jsx("div",{onClick:Te,className:"cursor-pointer absolute right-4 top-[11px]",children:g.exports.jsx(Of,{})}),g.exports.jsx("input",{type:"file",ref:A,style:{display:"none"},onChange:ae}),g.exports.jsx("input",{type:"text",ref:C,className:"w-full bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl ",placeholder:"Type a message...",value:i,onChange:N,onKeyDown:U=>{U.key==="Enter"&&!U.shiftKey&&(U.preventDefault(),B())}}),g.exports.jsx(pr,{className:"rotate-180 absolute -right-[11.4px] top-5"})]}),g.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:i?B:Q,children:i?g.exports.jsx(Ro,{}):g.exports.jsx(Lf,{})})]}),u&&g.exports.jsxs("div",{className:"absolute bottom-full left-0 w-full bg-white shadow-xl rounded-lg border border-gray-200 p-4 z-50 max-h-60 overflow-y-auto",onScroll:ve,children:[g.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[g.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",g.exports.jsx("span",{className:"text-blue-500",children:u})]}),g.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>f(null),children:"✕"})]}),g.exports.jsxs("div",{className:"space-y-2",children:[r?r.filter(U=>U.symbol===u).map(U=>{var le;const{component:O,lists:k}=U;return O?h?(le=k==null?void 0:k.filter(T=>T==null?void 0:T.name.includes(h)))==null?void 0:le.map((T,E)=>g.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:g.exports.jsx(O,{listsProps:T,onClick:(_,I)=>D(_,I)})},E)):k==null?void 0:k.map((T,E)=>g.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:g.exports.jsx(O,{listsProps:T,onClick:(_,I)=>D(_,I)})},E)):null}):null,g.exports.jsx("div",{className:"h-8",children:m&&"Loading more items..."})]})]})]})};var Be=(e=>(e[e.File=0]="File",e[e.Voice=1]="Voice",e[e.Video=2]="Video",e[e.Image=3]="Image",e))(Be||{});const Do=({fileName:e,fileSize:t,format:n,src:r})=>{const i=()=>({rar:g.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:g.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:g.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:g.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:g.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),"":g.exports.jsx("p",{className:"p-2 text-black font-bold",children:n})})[n||""],s=o=>o>1048576?(o/1048576).toFixed(1)+" MB":(o/1024).toFixed(1)+" KB";return g.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[g.exports.jsx("div",{className:"mr-3 relative border border-green-950 rounded-md p-3",children:i()}),g.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[g.exports.jsx("a",{href:r,download:e,className:"text-gray-900 font-medium hover:underline",children:e}),g.exports.jsx("span",{className:"text-gray-600 text-sm",children:s(t)})]}),g.exports.jsx("a",{href:r,download:e,className:"ml-2 bg-green-500 text-white px-2 py-1 text-sm rounded hover:bg-green-600",children:"Download"})]})},_f=e=>g.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-play",...e,children:g.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),If=e=>g.exports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-pause",...e,children:[g.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),g.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let Dt=null;const Ff=({src:e,className:t})=>{const[n,r]=x.useState(!1),[i,s]=x.useState(0),o=x.useRef(null);x.useEffect(()=>{const a=o.current;if(!a)return;const c=()=>{s(a.currentTime/a.duration*100)},u=()=>r(!0),f=()=>r(!1),h=()=>{r(!1),s(0)};return a.addEventListener("timeupdate",c),a.addEventListener("play",u),a.addEventListener("pause",f),a.addEventListener("ended",h),()=>{a.removeEventListener("timeupdate",c),a.removeEventListener("play",u),a.removeEventListener("pause",f),a.removeEventListener("ended",h)}},[]);const l=()=>{const a=o.current;a&&(n?a.pause():(Dt&&Dt!==a&&(Dt.pause(),Dt.currentTime=0),a.play(),Dt=a))};return g.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[g.exports.jsx("button",{className:"w-9 h-9 cursor-pointer flex items-center justify-center pl-[1.5px] bg-gray-700 rounded-full hover:bg-gray-600",onClick:l,children:n?g.exports.jsx(If,{}):g.exports.jsx(_f,{})}),g.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:g.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${i}%`}})}),g.exports.jsx("audio",{ref:o,src:e})]})},Nf=({attachment:e,attachmentType:t})=>e?t===Be.Voice?g.exports.jsx("div",{className:"w-full",children:g.exports.jsx(Ff,{src:e})}):t===Be.Image?g.exports.jsx("div",{className:"w-full",children:g.exports.jsx("img",{src:e})}):t===Be.File?g.exports.jsx("div",{className:"w-full mt-1",children:g.exports.jsx(Do,{fileName:"productivity",fileSize:23e3,format:"rar",src:e})}):t===Be.Video?g.exports.jsx("div",{className:"w-full mt-1",children:g.exports.jsx(Do,{fileName:"productivity",fileSize:23e3,format:"rar",src:e})}):null:null,Bf=({message:e,showUserProfile:t,handleContextMenu:n,media:r})=>{var i,s,o,l,a;return g.exports.jsxs(g.exports.Fragment,{children:[t?g.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,g.exports.jsxs(hr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:c=>n(c,e),className:`relative ${r?"w-3/4":"w-fit max-w-3/4"}flex flex-col gap-1 md:max-w-[400px] p-2 pt-5 rounded-lg bg-green-200`,children:[g.exports.jsx("span",{className:"absolute top-1 text-xs text-orange-700",children:(i=e.user)!=null&&i.fullName&&((o=(s=e.user)==null?void 0:s.fullName)==null?void 0:o.length)>16?(l=e.user)==null?void 0:l.firstName:(a=e.user)==null?void 0:a.fullName}),r||null,g.exports.jsx("span",{children:e.text}),g.exports.jsx("div",{className:"w-full flex gap- items-center justify-end",children:g.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]})}),g.exports.jsx(pr,{className:"fill-blue-200 -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 [&>g>path]:fill-green-200"})]})]})},$f=()=>g.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.exports.jsx("path",{d:"M11.6619 4.6478C11.8358 4.83691 11.8272 5.1347 11.6427 5.31294L4.36284 12.3463C4.14493 12.5568 3.80285 12.5503 3.59268 12.3317L1.13205 9.77168C0.954124 9.58658 0.956276 9.28866 1.13686 9.10628C1.31743 8.92389 1.60806 8.9261 1.78598 9.1112L3.99455 11.4089L11.013 4.62812C11.1975 4.44988 11.488 4.4587 11.6619 4.6478Z",fill:"gray"}),g.exports.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.8759 4.64963C15.0492 4.83921 15.0399 5.13698 14.8549 5.31471L7.51066 12.3726C7.32572 12.5503 7.03524 12.5407 6.86185 12.3511C6.68847 12.1616 6.69784 11.8638 6.88278 11.6861L14.227 4.62818C14.412 4.45045 14.7025 4.46005 14.8759 4.64963Z",fill:"gray"})]}),Uf=({handleContextMenu:e,media:t,message:n})=>g.exports.jsxs(hr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:r=>e(r,n),className:`relative self-end ${t?"w-3/4":"max-w-3/4"} flex flex-col justify-center md:max-w-[400px] p-2 rounded-lg bg-blue-200`,children:[t||null,g.exports.jsx("span",{children:n.text}),g.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[g.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),g.exports.jsx($f,{})]}),g.exports.jsx(pr,{className:"fill-blue-200 rotate-180 absolute -right-2 bottom-0 [&>g>path]:fill-blue-200"})]});var ce={exports:{}},mr={exports:{}},Z={};var Vo;function Wf(){if(Vo)return Z;Vo=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,P=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function C(m){if(typeof m=="object"&&m!==null){var R=m.$$typeof;switch(R){case t:switch(m=m.type,m){case a:case c:case r:case s:case i:case f:return m;default:switch(m=m&&m.$$typeof,m){case l:case u:case v:case p:case o:return m;default:return R}}case n:return R}}}function A(m){return C(m)===c}return Z.AsyncMode=a,Z.ConcurrentMode=c,Z.ContextConsumer=l,Z.ContextProvider=o,Z.Element=t,Z.ForwardRef=u,Z.Fragment=r,Z.Lazy=v,Z.Memo=p,Z.Portal=n,Z.Profiler=s,Z.StrictMode=i,Z.Suspense=f,Z.isAsyncMode=function(m){return A(m)||C(m)===a},Z.isConcurrentMode=A,Z.isContextConsumer=function(m){return C(m)===l},Z.isContextProvider=function(m){return C(m)===o},Z.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===t},Z.isForwardRef=function(m){return C(m)===u},Z.isFragment=function(m){return C(m)===r},Z.isLazy=function(m){return C(m)===v},Z.isMemo=function(m){return C(m)===p},Z.isPortal=function(m){return C(m)===n},Z.isProfiler=function(m){return C(m)===s},Z.isStrictMode=function(m){return C(m)===i},Z.isSuspense=function(m){return C(m)===f},Z.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===r||m===c||m===s||m===i||m===f||m===h||typeof m=="object"&&m!==null&&(m.$$typeof===v||m.$$typeof===p||m.$$typeof===o||m.$$typeof===l||m.$$typeof===u||m.$$typeof===P||m.$$typeof===b||m.$$typeof===S||m.$$typeof===y)},Z.typeOf=C,Z}var J={};var Oo;function zf(){return Oo||(Oo=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,P=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function C(M){return typeof M=="string"||typeof M=="function"||M===r||M===c||M===s||M===i||M===f||M===h||typeof M=="object"&&M!==null&&(M.$$typeof===v||M.$$typeof===p||M.$$typeof===o||M.$$typeof===l||M.$$typeof===u||M.$$typeof===P||M.$$typeof===b||M.$$typeof===S||M.$$typeof===y)}function A(M){if(typeof M=="object"&&M!==null){var Se=M.$$typeof;switch(Se){case t:var at=M.type;switch(at){case a:case c:case r:case s:case i:case f:return at;default:var Ge=at&&at.$$typeof;switch(Ge){case l:case u:case v:case p:case o:return Ge;default:return Se}}case n:return Se}}}var m=a,R=c,N=l,D=o,B=t,Q=u,fe=r,Te=v,ae=p,ie=n,ve=s,U=i,O=f,k=!1;function le(M){return k||(k=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),T(M)||A(M)===a}function T(M){return A(M)===c}function E(M){return A(M)===l}function _(M){return A(M)===o}function I(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function F(M){return A(M)===u}function q(M){return A(M)===r}function $(M){return A(M)===v}function W(M){return A(M)===p}function z(M){return A(M)===n}function H(M){return A(M)===s}function Y(M){return A(M)===i}function ge(M){return A(M)===f}J.AsyncMode=m,J.ConcurrentMode=R,J.ContextConsumer=N,J.ContextProvider=D,J.Element=B,J.ForwardRef=Q,J.Fragment=fe,J.Lazy=Te,J.Memo=ae,J.Portal=ie,J.Profiler=ve,J.StrictMode=U,J.Suspense=O,J.isAsyncMode=le,J.isConcurrentMode=T,J.isContextConsumer=E,J.isContextProvider=_,J.isElement=I,J.isForwardRef=F,J.isFragment=q,J.isLazy=$,J.isMemo=W,J.isPortal=z,J.isProfiler=H,J.isStrictMode=Y,J.isSuspense=ge,J.isValidElementType=C,J.typeOf=A}()),J}var Lo;function ko(){return Lo||(Lo=1,function(e){process.env.NODE_ENV==="production"?e.exports=Wf():e.exports=zf()}(mr)),mr.exports}var gr,_o;function Yf(){if(_o)return gr;_o=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var o={},l=0;l<10;l++)o["_"+String.fromCharCode(l)]=l;var a=Object.getOwnPropertyNames(o).map(function(u){return o[u]});if(a.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return gr=i()?Object.assign:function(s,o){for(var l,a=r(s),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var f in l)t.call(l,f)&&(a[f]=l[f]);if(e){c=e(l);for(var h=0;h<c.length;h++)n.call(l,c[h])&&(a[c[h]]=l[c[h]])}}return a},gr}var yr,Io;function vr(){if(Io)return yr;Io=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return yr=e,yr}var xr,Fo;function No(){return Fo||(Fo=1,xr=Function.call.bind(Object.prototype.hasOwnProperty)),xr}var br,Bo;function Kf(){if(Bo)return br;Bo=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=vr(),n={},r=No();e=function(s){var o="Warning: "+s;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function i(s,o,l,a,c){if(process.env.NODE_ENV!=="production"){for(var u in s)if(r(s,u)){var f;try{if(typeof s[u]!="function"){var h=Error((a||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=s[u](o,u,a,l,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((a||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var p=c?c():"";e("Failed "+l+" type: "+f.message+(p??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},br=i,br}var Tr,$o;function qf(){if($o)return Tr;$o=1;var e=ko(),t=Yf(),n=vr(),r=No(),i=Kf(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(l){var a="Warning: "+l;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}});function o(){return null}return Tr=function(l,a){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(T){var E=T&&(c&&T[c]||T[u]);if(typeof E=="function")return E}var h="<<anonymous>>",p={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:S(),arrayOf:C,element:A(),elementType:m(),instanceOf:R,node:Q(),objectOf:D,oneOf:N,oneOfType:B,shape:Te,exact:ae};function v(T,E){return T===E?T!==0||1/T===1/E:T!==T&&E!==E}function y(T,E){this.message=T,this.data=E&&typeof E=="object"?E:{},this.stack=""}y.prototype=Error.prototype;function P(T){if(process.env.NODE_ENV!=="production")var E={},_=0;function I(q,$,W,z,H,Y,ge){if(z=z||h,Y=Y||W,ge!==n){if(a){var M=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw M.name="Invariant Violation",M}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Se=z+":"+W;!E[Se]&&_<3&&(s("You are manually calling a React.PropTypes validation function for the `"+Y+"` prop on `"+z+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),E[Se]=!0,_++)}}return $[W]==null?q?$[W]===null?new y("The "+H+" `"+Y+"` is marked as required "+("in `"+z+"`, but its value is `null`.")):new y("The "+H+" `"+Y+"` is marked as required in "+("`"+z+"`, but its value is `undefined`.")):null:T($,W,z,H,Y)}var F=I.bind(null,!1);return F.isRequired=I.bind(null,!0),F}function b(T){function E(_,I,F,q,$,W){var z=_[I],H=U(z);if(H!==T){var Y=O(z);return new y("Invalid "+q+" `"+$+"` of type "+("`"+Y+"` supplied to `"+F+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return P(E)}function S(){return P(o)}function C(T){function E(_,I,F,q,$){if(typeof T!="function")return new y("Property `"+$+"` of component `"+F+"` has invalid PropType notation inside arrayOf.");var W=_[I];if(!Array.isArray(W)){var z=U(W);return new y("Invalid "+q+" `"+$+"` of type "+("`"+z+"` supplied to `"+F+"`, expected an array."))}for(var H=0;H<W.length;H++){var Y=T(W,H,F,q,$+"["+H+"]",n);if(Y instanceof Error)return Y}return null}return P(E)}function A(){function T(E,_,I,F,q){var $=E[_];if(!l($)){var W=U($);return new y("Invalid "+F+" `"+q+"` of type "+("`"+W+"` supplied to `"+I+"`, expected a single ReactElement."))}return null}return P(T)}function m(){function T(E,_,I,F,q){var $=E[_];if(!e.isValidElementType($)){var W=U($);return new y("Invalid "+F+" `"+q+"` of type "+("`"+W+"` supplied to `"+I+"`, expected a single ReactElement type."))}return null}return P(T)}function R(T){function E(_,I,F,q,$){if(!(_[I]instanceof T)){var W=T.name||h,z=le(_[I]);return new y("Invalid "+q+" `"+$+"` of type "+("`"+z+"` supplied to `"+F+"`, expected ")+("instance of `"+W+"`."))}return null}return P(E)}function N(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),o;function E(_,I,F,q,$){for(var W=_[I],z=0;z<T.length;z++)if(v(W,T[z]))return null;var H=JSON.stringify(T,function(ge,M){var Se=O(M);return Se==="symbol"?String(M):M});return new y("Invalid "+q+" `"+$+"` of value `"+String(W)+"` "+("supplied to `"+F+"`, expected one of "+H+"."))}return P(E)}function D(T){function E(_,I,F,q,$){if(typeof T!="function")return new y("Property `"+$+"` of component `"+F+"` has invalid PropType notation inside objectOf.");var W=_[I],z=U(W);if(z!=="object")return new y("Invalid "+q+" `"+$+"` of type "+("`"+z+"` supplied to `"+F+"`, expected an object."));for(var H in W)if(r(W,H)){var Y=T(W,H,F,q,$+"."+H,n);if(Y instanceof Error)return Y}return null}return P(E)}function B(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var E=0;E<T.length;E++){var _=T[E];if(typeof _!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+k(_)+" at index "+E+"."),o}function I(F,q,$,W,z){for(var H=[],Y=0;Y<T.length;Y++){var ge=T[Y],M=ge(F,q,$,W,z,n);if(M==null)return null;M.data&&r(M.data,"expectedType")&&H.push(M.data.expectedType)}var Se=H.length>0?", expected one of type ["+H.join(", ")+"]":"";return new y("Invalid "+W+" `"+z+"` supplied to "+("`"+$+"`"+Se+"."))}return P(I)}function Q(){function T(E,_,I,F,q){return ie(E[_])?null:new y("Invalid "+F+" `"+q+"` supplied to "+("`"+I+"`, expected a ReactNode."))}return P(T)}function fe(T,E,_,I,F){return new y((T||"React class")+": "+E+" type `"+_+"."+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+F+"`.")}function Te(T){function E(_,I,F,q,$){var W=_[I],z=U(W);if(z!=="object")return new y("Invalid "+q+" `"+$+"` of type `"+z+"` "+("supplied to `"+F+"`, expected `object`."));for(var H in T){var Y=T[H];if(typeof Y!="function")return fe(F,q,$,H,O(Y));var ge=Y(W,H,F,q,$+"."+H,n);if(ge)return ge}return null}return P(E)}function ae(T){function E(_,I,F,q,$){var W=_[I],z=U(W);if(z!=="object")return new y("Invalid "+q+" `"+$+"` of type `"+z+"` "+("supplied to `"+F+"`, expected `object`."));var H=t({},_[I],T);for(var Y in H){var ge=T[Y];if(r(T,Y)&&typeof ge!="function")return fe(F,q,$,Y,O(ge));if(!ge)return new y("Invalid "+q+" `"+$+"` key `"+Y+"` supplied to `"+F+"`.\nBad object: "+JSON.stringify(_[I],null," ")+`
20
+ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var M=ge(W,Y,F,q,$+"."+Y,n);if(M)return M}return null}return P(E)}function ie(T){switch(typeof T){case"number":case"string":case"undefined":return!0;case"boolean":return!T;case"object":if(Array.isArray(T))return T.every(ie);if(T===null||l(T))return!0;var E=f(T);if(E){var _=E.call(T),I;if(E!==T.entries){for(;!(I=_.next()).done;)if(!ie(I.value))return!1}else for(;!(I=_.next()).done;){var F=I.value;if(F&&!ie(F[1]))return!1}}else return!1;return!0;default:return!1}}function ve(T,E){return T==="symbol"?!0:E?E["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&E instanceof Symbol:!1}function U(T){var E=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":ve(E,T)?"symbol":E}function O(T){if(typeof T>"u"||T===null)return""+T;var E=U(T);if(E==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return E}function k(T){var E=O(T);switch(E){case"array":case"object":return"an "+E;case"boolean":case"date":case"regexp":return"a "+E;default:return E}}function le(T){return!T.constructor||!T.constructor.name?h:T.constructor.name}return p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},Tr}var wr,Uo;function Gf(){if(Uo)return wr;Uo=1;var e=vr();function t(){}function n(){}return n.resetWarningCache=t,wr=function(){function r(o,l,a,c,u,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},wr}if(process.env.NODE_ENV!=="production"){var Hf=ko(),Xf=!0;ce.exports=qf()(Hf.isElement,Xf)}else ce.exports=Gf()();function Pr(){return Pr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pr.apply(this,arguments)}function Zf(e,t){if(e==null)return{};var n=Jf(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Jf(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Sr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=e.size,s=i===void 0?24:i,o=Zf(e,["color","size"]);return x.createElement("svg",Pr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("polyline",{points:"20 6 9 17 4 12"}))});Sr.propTypes={color:ce.exports.string,size:ce.exports.oneOfType([ce.exports.string,ce.exports.number])},Sr.displayName="Check";const Qf=Sr;function Cr(){return Cr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cr.apply(this,arguments)}function ed(e,t){if(e==null)return{};var n=td(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function td(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Er=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=e.size,s=i===void 0?24:i,o=ed(e,["color","size"]);return x.createElement("svg",Cr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),x.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))});Er.propTypes={color:ce.exports.string,size:ce.exports.oneOfType([ce.exports.string,ce.exports.number])},Er.displayName="Copy";const nd=Er;function Ar(){return Ar=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ar.apply(this,arguments)}function rd(e,t){if(e==null)return{};var n=id(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function id(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var jr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=e.size,s=i===void 0?24:i,o=rd(e,["color","size"]);return x.createElement("svg",Ar({ref:t,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),x.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});jr.propTypes={color:ce.exports.string,size:ce.exports.oneOfType([ce.exports.string,ce.exports.number])},jr.displayName="Edit";const sd=jr;function Mr(){return Mr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mr.apply(this,arguments)}function od(e,t){if(e==null)return{};var n=ad(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ad(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Rr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=e.size,s=i===void 0?24:i,o=od(e,["color","size"]);return x.createElement("svg",Mr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("polyline",{points:"3 6 5 6 21 6"}),x.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}))});Rr.propTypes={color:ce.exports.string,size:ce.exports.oneOfType([ce.exports.string,ce.exports.number])},Rr.displayName="Trash";const ld=Rr,ud=({user:e,messages:t,updateMessages:n,onMessageSent:r,onEditMessage:i,onDeleteMessage:s})=>{const o=x.useRef(null),[l,a]=x.useState(!1),[c,u]=x.useState(null),[f,h]=x.useState(null),p=()=>{setTimeout(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},100)},v=(m,R)=>{if(m.preventDefault(),!o.current)return;const N=o.current.getBoundingClientRect();h({x:m.clientX-N.left,y:m.clientY-N.top,message:R})},y=()=>{h(null)},P=m=>{const R=new Ot({id:new Date().toString(),text:m,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,R]),r(R),p()},b=m=>{const R=new Ot({id:new Date().toString(),text:"",attachment:m,attachmentType:Be.Voice,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,R]),r(R),p()},S=m=>{const R=URL.createObjectURL(m),N=new Ot({id:new Date().toString(),text:"",attachment:R,attachmentType:Be.File,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,N]),r(N),p()};return{handleDeleteConfirmation:()=>{c&&(s(c),u(null)),a(!1)},handleCloseContextMenu:y,contextMenuItems:[{name:"Edit",icon:g.exports.jsx(sd,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:m=>{console.log("Edit clicked"),y(),i(m)}},{name:"Delete",icon:g.exports.jsx(ld,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:m=>{u(m),a(!0),y()}},{name:"Select",icon:g.exports.jsx(Qf,{className:"text-green-600"}),onClick:()=>{console.log("Select clicked"),y()}},{name:"Copy",icon:g.exports.jsx(nd,{className:"text-blue-600"}),onClick:()=>{console.log("Copy clicked"),y()}}],handleSendFile:S,handleSendVoice:b,handleSendMessage:P,handleContextMenu:v,isModalOpen:l,contextMenu:f,chatRef:o,setIsModalOpen:a}},cd=({width:e="400px",height:t="600px",className:n,style:r,messages:i,user:s,updateMessages:o,onMessageSent:l,onDeleteMessage:a,onEditMessage:c,dynamicSymbolAssignments:u,backgroundImage:f})=>{var N,D;const{handleDeleteConfirmation:h,handleCloseContextMenu:p,handleSendFile:v,handleSendVoice:y,handleSendMessage:P,handleContextMenu:b,contextMenuItems:S,isModalOpen:C,contextMenu:A,chatRef:m,setIsModalOpen:R}=ud({user:s,messages:i,updateMessages:o,onMessageSent:l,onEditMessage:c,onDeleteMessage:a});return g.exports.jsxs("div",{className:`flex flex-col !bg-cover ${n}`,style:{width:e,height:t,background:"url("+f+")",...r},onClick:p,children:[g.exports.jsx("div",{ref:m,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${A?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:g.exports.jsx($r,{children:i.map((B,Q)=>{var ae,ie,ve;const fe=B!=null&&B.attachment?g.exports.jsx(Nf,{attachment:B.attachment,attachmentType:B==null?void 0:B.attachmentType},Q):null;if(B.isRightSided)return g.exports.jsx(Uf,{media:fe,handleContextMenu:b,message:B},Q);const Te=((ie=(ae=i[Q-1])==null?void 0:ae.user)==null?void 0:ie.id)!==((ve=B==null?void 0:B.user)==null?void 0:ve.id);return g.exports.jsx(Bf,{showUserProfile:Te,media:fe,handleContextMenu:b,message:B},Q)})})}),g.exports.jsx(Df,{isOpen:C,onClose:()=>R(!1),onConfirm:h,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),A&&((N=A==null?void 0:A.message)!=null&&N.id)?g.exports.jsx(Vf,{items:S,isVisible:Boolean(A),messageId:String(A==null?void 0:A.message.id),isCurrentUserMessage:((D=A==null?void 0:A.message)==null?void 0:D.user.id)===s.id,position:{x:A==null?void 0:A.x,y:A==null?void 0:A.y}}):null,g.exports.jsx(kf,{onSendVoice:y,onSendMessage:P,onFileSend:v,dynamicSymbolAssignments:u})]})};he.AttachmentTypeEnum=Be,he.Button=ia,he.Chat=cd,he.MessageEntity=Ot,Object.defineProperty(he,Symbol.toStringTag,{value:"Module"})});
21
21
  //# sourceMappingURL=index.umd.js.map