react-pro-messenger 1.0.38 → 1.0.39

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,21 +1,21 @@
1
- (function(he,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],x):(he=typeof globalThis<"u"?globalThis:he||self,x(he.ReactProMessenger={},he.React,he.ReactDOM))})(this,function(he,x,Ue){"use strict";var kd=Object.defineProperty;var _d=(he,x,Ue)=>x in he?kd(he,x,{enumerable:!0,configurable:!0,writable:!0,value:Ue}):he[x]=Ue;var we=(he,x,Ue)=>(_d(he,typeof x!="symbol"?x+"":x,Ue),Ue);function sa(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 rn=sa(x);var p={exports:{}},dt={};var Nr;function ia(){if(Nr)return dt;Nr=1;var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(a,l,c){var u,f={},h=null,m=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(m=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:h,ref:m,props:f,_owner:s.current}}return dt.Fragment=n,dt.jsx=o,dt.jsxs=o,dt}var ht={};var Fr;function oa(){return Fr||(Fr=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"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=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"),m=Symbol.for("react.offscreen"),v=Symbol.iterator,y="@@iterator";function S(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 P(d){{for(var w=arguments.length,j=new Array(w>1?w-1:0),$=1;$<w;$++)j[$-1]=arguments[$];C("error",d,j)}}function C(d,w,j){{var $=b.ReactDebugCurrentFrame,X=$.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 V=!1,g=!1,O=!1,_=!1,L=!1,k;k=Symbol.for("react.module.reference");function U(d){return!!(typeof d=="string"||typeof d=="function"||d===r||d===i||L||d===s||d===c||d===u||_||d===m||V||g||O||typeof d=="object"&&d!==null&&(d.$$typeof===h||d.$$typeof===f||d.$$typeof===o||d.$$typeof===a||d.$$typeof===l||d.$$typeof===k||d.getModuleId!==void 0))}function Q(d,w,j){var $=d.displayName;if($)return $;var X=w.displayName||w.name||"";return X!==""?j+"("+X+")":j}function de(d){return d.displayName||"Context"}function ce(d){if(d==null)return null;if(typeof d.tag=="number"&&P("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 i:return"Profiler";case s:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case a:var w=d;return de(w)+".Consumer";case o:var j=d;return de(j._context)+".Provider";case l:return Q(d,d.render,"ForwardRef");case f:var $=d.displayName||null;return $!==null?$:ce(d.type)||"Memo";case h:{var X=d,ee=X._payload,G=X._init;try{return ce(G(ee))}catch{return null}}}return null}var ie=Object.assign,K=0,ae,H,le,be,T,M,z;function D(){}D.__reactDisabledLog=!0;function E(){{if(K===0){ae=console.log,H=console.info,le=console.warn,be=console.error,T=console.group,M=console.groupCollapsed,z=console.groupEnd;var d={configurable:!0,enumerable:!0,value:D,writable:!0};Object.defineProperties(console,{info:d,log:d,warn:d,error:d,group:d,groupCollapsed:d,groupEnd:d})}K++}}function R(){{if(K--,K===0){var d={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ie({},d,{value:ae}),info:ie({},d,{value:H}),warn:ie({},d,{value:le}),error:ie({},d,{value:be}),group:ie({},d,{value:T}),groupCollapsed:ie({},d,{value:M}),groupEnd:ie({},d,{value:z})})}K<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var I=b.ReactCurrentDispatcher,N;function F(d,w,j){{if(N===void 0)try{throw Error()}catch(X){var $=X.stack.trim().match(/\n( *(at )?)/);N=$&&$[1]||""}return`
2
- `+N+d}}var Y=!1,W;{var ve=typeof WeakMap=="function"?WeakMap:Map;W=new ve}function A(d,w){if(!d||Y)return"";{var j=W.get(d);if(j!==void 0)return j}var $;Y=!0;var X=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ee;ee=I.current,I.current=null,E();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(ke){$=ke}Reflect.construct(d,[],G)}else{try{G.call()}catch(ke){$=ke}d.call(G.prototype)}}else{try{throw Error()}catch(ke){$=ke}d()}}catch(ke){if(ke&&$&&typeof ke.stack=="string"){for(var q=ke.stack.split(`
3
- `),Te=$.stack.split(`
4
- `),ue=q.length-1,fe=Te.length-1;ue>=1&&fe>=0&&q[ue]!==Te[fe];)fe--;for(;ue>=1&&fe>=0;ue--,fe--)if(q[ue]!==Te[fe]){if(ue!==1||fe!==1)do if(ue--,fe--,fe<0||q[ue]!==Te[fe]){var je=`
5
- `+q[ue].replace(" at new "," at ");return d.displayName&&je.includes("<anonymous>")&&(je=je.replace("<anonymous>",d.displayName)),typeof d=="function"&&W.set(d,je),je}while(ue>=1&&fe>=0);break}}}finally{Y=!1,I.current=ee,R(),Error.prepareStackTrace=X}var ft=d?d.displayName||d.name:"",ra=ft?F(ft):"";return typeof d=="function"&&W.set(d,ra),ra}function Ee(d,w,j){return A(d,!1)}function ut(d){var w=d.prototype;return!!(w&&w.isReactComponent)}function He(d,w,j){if(d==null)return"";if(typeof d=="function")return A(d,ut(d));if(typeof d=="string")return F(d);switch(d){case c:return F("Suspense");case u:return F("SuspenseList")}if(typeof d=="object")switch(d.$$typeof){case l:return Ee(d.render);case f:return He(d.type,w,j);case h:{var $=d,X=$._payload,ee=$._init;try{return He(ee(X),w,j)}catch{}}}return""}var tn=Object.prototype.hasOwnProperty,Yo={},Ko=b.ReactDebugCurrentFrame;function nn(d){if(d){var w=d._owner,j=He(d.type,d._source,w?w.type:null);Ko.setExtraStackFrame(j)}else Ko.setExtraStackFrame(null)}function md(d,w,j,$,X){{var ee=Function.call.bind(tn);for(var G in d)if(ee(d,G)){var q=void 0;try{if(typeof d[G]!="function"){var Te=Error(($||"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 Te.name="Invariant Violation",Te}q=d[G](w,G,$,j,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ue){q=ue}q&&!(q instanceof Error)&&(nn(X),P("%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).",$||"React class",j,G,typeof q),nn(null)),q instanceof Error&&!(q.message in Yo)&&(Yo[q.message]=!0,nn(X),P("Failed %s type: %s",j,q.message),nn(null))}}}var gd=Array.isArray;function Or(d){return gd(d)}function yd(d){{var w=typeof Symbol=="function"&&Symbol.toStringTag,j=w&&d[Symbol.toStringTag]||d.constructor.name||"Object";return j}}function vd(d){try{return qo(d),!1}catch{return!0}}function qo(d){return""+d}function Go(d){if(vd(d))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",yd(d)),qo(d)}var Lt=b.ReactCurrentOwner,xd={key:!0,ref:!0,__self:!0,__source:!0},Ho,Xo,Lr;Lr={};function bd(d){if(tn.call(d,"ref")){var w=Object.getOwnPropertyDescriptor(d,"ref").get;if(w&&w.isReactWarning)return!1}return d.ref!==void 0}function Td(d){if(tn.call(d,"key")){var w=Object.getOwnPropertyDescriptor(d,"key").get;if(w&&w.isReactWarning)return!1}return d.key!==void 0}function wd(d,w){if(typeof d.ref=="string"&&Lt.current&&w&&Lt.current.stateNode!==w){var j=ce(Lt.current.type);Lr[j]||(P('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',ce(Lt.current.type),d.ref),Lr[j]=!0)}}function Sd(d,w){{var j=function(){Ho||(Ho=!0,P("%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 Pd(d,w){{var j=function(){Xo||(Xo=!0,P("%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 Cd=function(d,w,j,$,X,ee,G){var q={$$typeof:t,type:d,key:w,ref:j,props:G,_owner:ee};return q._store={},Object.defineProperty(q._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(q,"_self",{configurable:!1,enumerable:!1,writable:!1,value:$}),Object.defineProperty(q,"_source",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.freeze&&(Object.freeze(q.props),Object.freeze(q)),q};function Ed(d,w,j,$,X){{var ee,G={},q=null,Te=null;j!==void 0&&(Go(j),q=""+j),Td(w)&&(Go(w.key),q=""+w.key),bd(w)&&(Te=w.ref,wd(w,X));for(ee in w)tn.call(w,ee)&&!xd.hasOwnProperty(ee)&&(G[ee]=w[ee]);if(d&&d.defaultProps){var ue=d.defaultProps;for(ee in ue)G[ee]===void 0&&(G[ee]=ue[ee])}if(q||Te){var fe=typeof d=="function"?d.displayName||d.name||"Unknown":d;q&&Sd(G,fe),Te&&Pd(G,fe)}return Cd(d,q,Te,X,$,Lt.current,G)}}var kr=b.ReactCurrentOwner,Zo=b.ReactDebugCurrentFrame;function ct(d){if(d){var w=d._owner,j=He(d.type,d._source,w?w.type:null);Zo.setExtraStackFrame(j)}else Zo.setExtraStackFrame(null)}var _r;_r=!1;function Ir(d){return typeof d=="object"&&d!==null&&d.$$typeof===t}function Jo(){{if(kr.current){var d=ce(kr.current.type);if(d)return`
1
+ (function(de,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],x):(de=typeof globalThis<"u"?globalThis:de||self,x(de.ReactProMessenger={},de.React,de.ReactDOM))})(this,function(de,x,Ue){"use strict";var kd=Object.defineProperty;var _d=(de,x,Ue)=>x in de?kd(de,x,{enumerable:!0,configurable:!0,writable:!0,value:Ue}):de[x]=Ue;var Te=(de,x,Ue)=>(_d(de,typeof x!="symbol"?x+"":x,Ue),Ue);function sa(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 rn=sa(x);var p={exports:{}},dt={};var Nr;function ia(){if(Nr)return dt;Nr=1;var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(l,a,c){var u,f={},h=null,m=null;c!==void 0&&(h=""+c),a.key!==void 0&&(h=""+a.key),a.ref!==void 0&&(m=a.ref);for(u in a)r.call(a,u)&&!i.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:m,props:f,_owner:s.current}}return dt.Fragment=n,dt.jsx=o,dt.jsxs=o,dt}var ht={};var Fr;function oa(){return Fr||(Fr=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"),s=Symbol.for("react.strict_mode"),i=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"),m=Symbol.for("react.offscreen"),v=Symbol.iterator,y="@@iterator";function S(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 P(d){{for(var w=arguments.length,j=new Array(w>1?w-1:0),B=1;B<w;B++)j[B-1]=arguments[B];C("error",d,j)}}function C(d,w,j){{var B=b.ReactDebugCurrentFrame,X=B.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 L=!1,g=!1,O=!1,Y=!1,A=!1,Q;Q=Symbol.for("react.module.reference");function F(d){return!!(typeof d=="string"||typeof d=="function"||d===r||d===i||A||d===s||d===c||d===u||Y||d===m||L||g||O||typeof d=="object"&&d!==null&&(d.$$typeof===h||d.$$typeof===f||d.$$typeof===o||d.$$typeof===l||d.$$typeof===a||d.$$typeof===Q||d.getModuleId!==void 0))}function q(d,w,j){var B=d.displayName;if(B)return B;var X=w.displayName||w.name||"";return X!==""?j+"("+X+")":j}function oe(d){return d.displayName||"Context"}function ne(d){if(d==null)return null;if(typeof d.tag=="number"&&P("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 i:return"Profiler";case s:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case l:var w=d;return oe(w)+".Consumer";case o:var j=d;return oe(j._context)+".Provider";case a:return q(d,d.render,"ForwardRef");case f:var B=d.displayName||null;return B!==null?B:ne(d.type)||"Memo";case h:{var X=d,ee=X._payload,G=X._init;try{return ne(G(ee))}catch{return null}}}return null}var ae=Object.assign,pe=0,W,H,le,Se,T,D,$;function R(){}R.__reactDisabledLog=!0;function E(){{if(pe===0){W=console.log,H=console.info,le=console.warn,Se=console.error,T=console.group,D=console.groupCollapsed,$=console.groupEnd;var d={configurable:!0,enumerable:!0,value:R,writable:!0};Object.defineProperties(console,{info:d,log:d,warn:d,error:d,group:d,groupCollapsed:d,groupEnd:d})}pe++}}function V(){{if(pe--,pe===0){var d={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ae({},d,{value:W}),info:ae({},d,{value:H}),warn:ae({},d,{value:le}),error:ae({},d,{value:Se}),group:ae({},d,{value:T}),groupCollapsed:ae({},d,{value:D}),groupEnd:ae({},d,{value:$})})}pe<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var k=b.ReactCurrentDispatcher,_;function I(d,w,j){{if(_===void 0)try{throw Error()}catch(X){var B=X.stack.trim().match(/\n( *(at )?)/);_=B&&B[1]||""}return`
2
+ `+_+d}}var z=!1,U;{var ve=typeof WeakMap=="function"?WeakMap:Map;U=new ve}function M(d,w){if(!d||z)return"";{var j=U.get(d);if(j!==void 0)return j}var B;z=!0;var X=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ee;ee=k.current,k.current=null,E();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(ke){B=ke}Reflect.construct(d,[],G)}else{try{G.call()}catch(ke){B=ke}d.call(G.prototype)}}else{try{throw Error()}catch(ke){B=ke}d()}}catch(ke){if(ke&&B&&typeof ke.stack=="string"){for(var K=ke.stack.split(`
3
+ `),be=B.stack.split(`
4
+ `),ce=K.length-1,fe=be.length-1;ce>=1&&fe>=0&&K[ce]!==be[fe];)fe--;for(;ce>=1&&fe>=0;ce--,fe--)if(K[ce]!==be[fe]){if(ce!==1||fe!==1)do if(ce--,fe--,fe<0||K[ce]!==be[fe]){var je=`
5
+ `+K[ce].replace(" at new "," at ");return d.displayName&&je.includes("<anonymous>")&&(je=je.replace("<anonymous>",d.displayName)),typeof d=="function"&&U.set(d,je),je}while(ce>=1&&fe>=0);break}}}finally{z=!1,k.current=ee,V(),Error.prepareStackTrace=X}var ft=d?d.displayName||d.name:"",ra=ft?I(ft):"";return typeof d=="function"&&U.set(d,ra),ra}function Ee(d,w,j){return M(d,!1)}function ut(d){var w=d.prototype;return!!(w&&w.isReactComponent)}function He(d,w,j){if(d==null)return"";if(typeof d=="function")return M(d,ut(d));if(typeof d=="string")return I(d);switch(d){case c:return I("Suspense");case u:return I("SuspenseList")}if(typeof d=="object")switch(d.$$typeof){case a:return Ee(d.render);case f:return He(d.type,w,j);case h:{var B=d,X=B._payload,ee=B._init;try{return He(ee(X),w,j)}catch{}}}return""}var tn=Object.prototype.hasOwnProperty,Yo={},Ko=b.ReactDebugCurrentFrame;function nn(d){if(d){var w=d._owner,j=He(d.type,d._source,w?w.type:null);Ko.setExtraStackFrame(j)}else Ko.setExtraStackFrame(null)}function md(d,w,j,B,X){{var ee=Function.call.bind(tn);for(var G in d)if(ee(d,G)){var K=void 0;try{if(typeof d[G]!="function"){var be=Error((B||"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 be.name="Invariant Violation",be}K=d[G](w,G,B,j,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ce){K=ce}K&&!(K instanceof Error)&&(nn(X),P("%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).",B||"React class",j,G,typeof K),nn(null)),K instanceof Error&&!(K.message in Yo)&&(Yo[K.message]=!0,nn(X),P("Failed %s type: %s",j,K.message),nn(null))}}}var gd=Array.isArray;function Or(d){return gd(d)}function yd(d){{var w=typeof Symbol=="function"&&Symbol.toStringTag,j=w&&d[Symbol.toStringTag]||d.constructor.name||"Object";return j}}function vd(d){try{return qo(d),!1}catch{return!0}}function qo(d){return""+d}function Go(d){if(vd(d))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",yd(d)),qo(d)}var Lt=b.ReactCurrentOwner,xd={key:!0,ref:!0,__self:!0,__source:!0},Ho,Xo,Lr;Lr={};function bd(d){if(tn.call(d,"ref")){var w=Object.getOwnPropertyDescriptor(d,"ref").get;if(w&&w.isReactWarning)return!1}return d.ref!==void 0}function Td(d){if(tn.call(d,"key")){var w=Object.getOwnPropertyDescriptor(d,"key").get;if(w&&w.isReactWarning)return!1}return d.key!==void 0}function wd(d,w){if(typeof d.ref=="string"&&Lt.current&&w&&Lt.current.stateNode!==w){var j=ne(Lt.current.type);Lr[j]||(P('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',ne(Lt.current.type),d.ref),Lr[j]=!0)}}function Sd(d,w){{var j=function(){Ho||(Ho=!0,P("%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 Pd(d,w){{var j=function(){Xo||(Xo=!0,P("%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 Cd=function(d,w,j,B,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:B}),Object.defineProperty(K,"_source",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.freeze&&(Object.freeze(K.props),Object.freeze(K)),K};function Ed(d,w,j,B,X){{var ee,G={},K=null,be=null;j!==void 0&&(Go(j),K=""+j),Td(w)&&(Go(w.key),K=""+w.key),bd(w)&&(be=w.ref,wd(w,X));for(ee in w)tn.call(w,ee)&&!xd.hasOwnProperty(ee)&&(G[ee]=w[ee]);if(d&&d.defaultProps){var ce=d.defaultProps;for(ee in ce)G[ee]===void 0&&(G[ee]=ce[ee])}if(K||be){var fe=typeof d=="function"?d.displayName||d.name||"Unknown":d;K&&Sd(G,fe),be&&Pd(G,fe)}return Cd(d,K,be,X,B,Lt.current,G)}}var kr=b.ReactCurrentOwner,Zo=b.ReactDebugCurrentFrame;function ct(d){if(d){var w=d._owner,j=He(d.type,d._source,w?w.type:null);Zo.setExtraStackFrame(j)}else Zo.setExtraStackFrame(null)}var _r;_r=!1;function Ir(d){return typeof d=="object"&&d!==null&&d.$$typeof===t}function Jo(){{if(kr.current){var d=ne(kr.current.type);if(d)return`
6
6
 
7
7
  Check the render method of \``+d+"`."}return""}}function jd(d){{if(d!==void 0){var w=d.fileName.replace(/^.*[\\\/]/,""),j=d.lineNumber;return`
8
8
 
9
9
  Check your code at `+w+":"+j+"."}return""}}var Qo={};function Ad(d){{var w=Jo();if(!w){var j=typeof d=="string"?d:d.displayName||d.name;j&&(w=`
10
10
 
11
- Check the top-level render call using <`+j+">.")}return w}}function ea(d,w){{if(!d._store||d._store.validated||d.key!=null)return;d._store.validated=!0;var j=Ad(w);if(Qo[j])return;Qo[j]=!0;var $="";d&&d._owner&&d._owner!==kr.current&&($=" It was passed a child from "+ce(d._owner.type)+"."),ct(d),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',j,$),ct(null)}}function ta(d,w){{if(typeof d!="object")return;if(Or(d))for(var j=0;j<d.length;j++){var $=d[j];Ir($)&&ea($,w)}else if(Ir(d))d._store&&(d._store.validated=!0);else if(d){var X=S(d);if(typeof X=="function"&&X!==d.entries)for(var ee=X.call(d),G;!(G=ee.next()).done;)Ir(G.value)&&ea(G.value,w)}}}function Md(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===l||w.$$typeof===f))j=w.propTypes;else return;if(j){var $=ce(w);md(j,d.props,"prop",$,d)}else if(w.PropTypes!==void 0&&!_r){_r=!0;var X=ce(w);P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",X||"Unknown")}typeof w.getDefaultProps=="function"&&!w.getDefaultProps.isReactClassApproved&&P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Dd(d){{for(var w=Object.keys(d.props),j=0;j<w.length;j++){var $=w[j];if($!=="children"&&$!=="key"){ct(d),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",$),ct(null);break}}d.ref!==null&&(ct(d),P("Invalid attribute `ref` supplied to `React.Fragment`."),ct(null))}}function na(d,w,j,$,X,ee){{var G=U(d);if(!G){var q="";(d===void 0||typeof d=="object"&&d!==null&&Object.keys(d).length===0)&&(q+=" 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 Te=jd(X);Te?q+=Te:q+=Jo();var ue;d===null?ue="null":Or(d)?ue="array":d!==void 0&&d.$$typeof===t?(ue="<"+(ce(d.type)||"Unknown")+" />",q=" Did you accidentally export a JSX literal instead of a component?"):ue=typeof d,P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ue,q)}var fe=Ed(d,w,j,X,ee);if(fe==null)return fe;if(G){var je=w.children;if(je!==void 0)if($)if(Or(je)){for(var ft=0;ft<je.length;ft++)ta(je[ft],d);Object.freeze&&Object.freeze(je)}else P("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 ta(je,d)}return d===r?Dd(fe):Md(fe),fe}}function Rd(d,w,j){return na(d,w,j,!0)}function Vd(d,w,j){return na(d,w,j,!1)}var Od=Vd,Ld=Rd;ht.Fragment=r,ht.jsx=Od,ht.jsxs=Ld}()),ht}(function(e){process.env.NODE_ENV==="production"?e.exports=ia():e.exports=oa()})(p);const Id="",aa=()=>{const e=x.useCallback(()=>{console.log("Vite + React + TypeScript + Tailwind = ❤️")},[]);return p.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 Xe{constructor({id:t,text:n,createdDate:r,attachmentUrl:s,attachmentType:i,attachmentFormat:o,attachmentBlob:a,user:l,isRightSided:c,symbols:u,isSending:f,isEdited:h}){we(this,"id","0");we(this,"text","");we(this,"createdDate","");we(this,"attachmentUrl","");we(this,"attachmentBlob");we(this,"attachmentType");we(this,"attachmentFormat","");we(this,"user",{id:""});we(this,"isRightSided",!1);we(this,"symbols");we(this,"isSending");we(this,"isEdited");we(this,"updateId",t=>{this.id=t});we(this,"updateIsSending",t=>{this.isSending=t});this.id=t,this.text=n,this.createdDate=r,this.attachmentUrl=s,this.attachmentType=i,this.attachmentFormat=o,this.attachmentBlob=a,this.user=l,this.isRightSided=c,this.symbols=u,this.isSending=f,this.isEdited=h}}const sn=x.createContext({});function on(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const kt=x.createContext(null),an=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class la extends rn.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=r instanceof HTMLElement&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=s-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function ua({children:e,isPresent:t,anchorX:n}){const r=x.useId(),s=x.useRef(null),i=x.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=x.useContext(an);return x.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u,right:f}=i.current;if(t||!s.current||!a||!l)return;const h=n==="left"?`left: ${u}`:`right: ${f}`;s.current.dataset.motionPopId=r;const m=document.createElement("style");return o&&(m.nonce=o),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(`
11
+ Check the top-level render call using <`+j+">.")}return w}}function ea(d,w){{if(!d._store||d._store.validated||d.key!=null)return;d._store.validated=!0;var j=Ad(w);if(Qo[j])return;Qo[j]=!0;var B="";d&&d._owner&&d._owner!==kr.current&&(B=" It was passed a child from "+ne(d._owner.type)+"."),ct(d),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',j,B),ct(null)}}function ta(d,w){{if(typeof d!="object")return;if(Or(d))for(var j=0;j<d.length;j++){var B=d[j];Ir(B)&&ea(B,w)}else if(Ir(d))d._store&&(d._store.validated=!0);else if(d){var X=S(d);if(typeof X=="function"&&X!==d.entries)for(var ee=X.call(d),G;!(G=ee.next()).done;)Ir(G.value)&&ea(G.value,w)}}}function Md(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 B=ne(w);md(j,d.props,"prop",B,d)}else if(w.PropTypes!==void 0&&!_r){_r=!0;var X=ne(w);P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",X||"Unknown")}typeof w.getDefaultProps=="function"&&!w.getDefaultProps.isReactClassApproved&&P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Dd(d){{for(var w=Object.keys(d.props),j=0;j<w.length;j++){var B=w[j];if(B!=="children"&&B!=="key"){ct(d),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",B),ct(null);break}}d.ref!==null&&(ct(d),P("Invalid attribute `ref` supplied to `React.Fragment`."),ct(null))}}function na(d,w,j,B,X,ee){{var G=F(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 be=jd(X);be?K+=be:K+=Jo();var ce;d===null?ce="null":Or(d)?ce="array":d!==void 0&&d.$$typeof===t?(ce="<"+(ne(d.type)||"Unknown")+" />",K=" Did you accidentally export a JSX literal instead of a component?"):ce=typeof d,P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ce,K)}var fe=Ed(d,w,j,X,ee);if(fe==null)return fe;if(G){var je=w.children;if(je!==void 0)if(B)if(Or(je)){for(var ft=0;ft<je.length;ft++)ta(je[ft],d);Object.freeze&&Object.freeze(je)}else P("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 ta(je,d)}return d===r?Dd(fe):Md(fe),fe}}function Rd(d,w,j){return na(d,w,j,!0)}function Vd(d,w,j){return na(d,w,j,!1)}var Od=Vd,Ld=Rd;ht.Fragment=r,ht.jsx=Od,ht.jsxs=Ld}()),ht}(function(e){process.env.NODE_ENV==="production"?e.exports=ia():e.exports=oa()})(p);const Id="",aa=()=>{const e=x.useCallback(()=>{console.log("Vite + React + TypeScript + Tailwind = ❤️")},[]);return p.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 Xe{constructor({id:t,text:n,createdDate:r,attachmentUrl:s,attachmentType:i,attachmentFormat:o,attachmentBlob:l,user:a,isRightSided:c,symbols:u,isSending:f,isEdited:h}){Te(this,"id","0");Te(this,"text","");Te(this,"createdDate","");Te(this,"attachmentUrl","");Te(this,"attachmentBlob");Te(this,"attachmentType");Te(this,"attachmentFormat","");Te(this,"user",{id:""});Te(this,"isRightSided",!1);Te(this,"symbols");Te(this,"isSending");Te(this,"isEdited");Te(this,"updateId",t=>{this.id=t});Te(this,"updateIsSending",t=>{this.isSending=t});this.id=t,this.text=n,this.createdDate=r,this.attachmentUrl=s,this.attachmentType=i,this.attachmentFormat=o,this.attachmentBlob=l,this.user=a,this.isRightSided=c,this.symbols=u,this.isSending=f,this.isEdited=h}}const sn=x.createContext({});function on(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const kt=x.createContext(null),an=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class la extends rn.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=r instanceof HTMLElement&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=s-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function ua({children:e,isPresent:t,anchorX:n}){const r=x.useId(),s=x.useRef(null),i=x.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=x.useContext(an);return x.useInsertionEffect(()=>{const{width:l,height:a,top:c,left:u,right:f}=i.current;if(t||!s.current||!l||!a)return;const h=n==="left"?`left: ${u}`:`right: ${f}`;s.current.dataset.motionPopId=r;const m=document.createElement("style");return o&&(m.nonce=o),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(`
12
12
  [data-motion-pop-id="${r}"] {
13
13
  position: absolute !important;
14
- width: ${a}px !important;
15
- height: ${l}px !important;
14
+ width: ${l}px !important;
15
+ height: ${a}px !important;
16
16
  ${h}px !important;
17
17
  top: ${c}px !important;
18
18
  }
19
- `),()=>{document.head.removeChild(m)}},[t]),p.exports.jsx(la,{isPresent:t,childRef:s,sizeRef:i,children:rn.cloneElement(e,{ref:s})})}const ca=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a})=>{const l=on(fa),c=x.useId(),u=x.useCallback(h=>{l.set(h,!0);for(const m of l.values())if(!m)return;r&&r()},[l,r]),f=x.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:h=>(l.set(h,!1),()=>l.delete(h))}),i?[Math.random(),u]:[n,u]);return x.useMemo(()=>{l.forEach((h,m)=>l.set(m,!1))},[n]),rn.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=p.exports.jsx(ua,{isPresent:n,anchorX:a,children:e})),p.exports.jsx(kt.Provider,{value:f,children:e})};function fa(){return new Map}function Br(e=!0){const t=x.useContext(kt);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=x.useId();x.useEffect(()=>{if(e)return s(i)},[e]);const o=x.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const _t=e=>e.key||"";function $r(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const ln=typeof window<"u",Ur=ln?x.useLayoutEffect:x.useEffect,Wr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,c]=Br(o),u=x.useMemo(()=>$r(e),[e]),f=o&&!l?[]:u.map(_t),h=x.useRef(!0),m=x.useRef(u),v=on(()=>new Map),[y,S]=x.useState(u),[b,P]=x.useState(u);Ur(()=>{h.current=!1,m.current=u;for(let g=0;g<b.length;g++){const O=_t(b[g]);f.includes(O)?v.delete(O):v.get(O)!==!0&&v.set(O,!1)}},[b,f.length,f.join("-")]);const C=[];if(u!==y){let g=[...u];for(let O=0;O<b.length;O++){const _=b[O],L=_t(_);f.includes(L)||(g.splice(O,0,_),C.push(_))}return i==="wait"&&C.length&&(g=C),P($r(g)),S(u),null}process.env.NODE_ENV!=="production"&&i==="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:V}=x.useContext(sn);return p.exports.jsx(p.exports.Fragment,{children:b.map(g=>{const O=_t(g),_=o&&!l?!1:u===b||f.includes(O),L=()=>{if(v.has(O))v.set(O,!0);else return;let k=!0;v.forEach(U=>{U||(k=!1)}),k&&(V==null||V(),P(m.current),o&&(c==null||c()),r&&r())};return p.exports.jsx(ca,{isPresent:_,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,onExitComplete:_?void 0:L,anchorX:a,children:g},O)})})},Se=e=>e;let Ze=Se,_e=Se;process.env.NODE_ENV!=="production"&&(Ze=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},_e=(e,t)=>{if(!e)throw new Error(t)});function un(e){let t;return()=>(t===void 0&&(t=e()),t)}const Je=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Me=e=>e*1e3,Oe=e=>e/1e3,zr={skipAnimations:!1,useManualTiming:!1},It=["read","resolveKeyframes","update","preRender","render","postRender"],Ie={value:null,addProjectionMetrics:null};function da(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(f){o.has(f)&&(u.schedule(f),e()),l++,f(a)}const u={schedule:(f,h=!1,m=!1)=>{const y=m&&s?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(a=f,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),t&&Ie.value&&Ie.value.frameloop[t].push(l),l=0,n.clear(),s=!1,i&&(i=!1,u.process(f))}};return u}const ha=40;function Yr(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=It.reduce((b,P)=>(b[P]=da(i,t?P:void 0),b),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:f,postRender:h}=o,m=()=>{const b=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(b-s.timestamp,ha),1),s.timestamp=b,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(m))},v=()=>{n=!0,r=!0,s.isProcessing||e(m)};return{schedule:It.reduce((b,P)=>{const C=o[P];return b[P]=(V,g=!1,O=!1)=>(n||v(),C.schedule(V,g,O)),b},{}),cancel:b=>{for(let P=0;P<It.length;P++)o[It[P]].cancel(b)},state:s,steps:o}}const{schedule:te,cancel:Ne,state:me,steps:cn}=Yr(typeof requestAnimationFrame<"u"?requestAnimationFrame:Se,!0),Kr=x.createContext({strict:!1}),qr={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"]},Qe={};for(const e in qr)Qe[e]={isEnabled:t=>qr[e].some(n=>!!t[n])};function pa(e){for(const t in e)Qe[t]={...Qe[t],...e[t]}}const ma=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 Nt(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ma.has(e)}let Gr=e=>!Nt(e);function ga(e){e&&(Gr=t=>t.startsWith("on")?!Nt(t):e(t))}try{ga(require("@emotion/is-prop-valid").default)}catch{}function ya(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Gr(s)||n===!0&&Nt(s)||!t&&!Nt(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Hr=new Set;function Ft(e,t,n){e||Hr.has(t)||(console.warn(t),n&&console.warn(n),Hr.add(t))}function va(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,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const Bt=x.createContext({});function $t(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function pt(e){return typeof e=="string"||Array.isArray(e)}const fn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dn=["initial",...fn];function Ut(e){return $t(e.animate)||dn.some(t=>pt(e[t]))}function Xr(e){return Boolean(Ut(e)||e.variants)}function xa(e,t){if(Ut(e)){const{initial:n,animate:r}=e;return{initial:n===!1||pt(n)?n:void 0,animate:pt(r)?r:void 0}}return e.inherit!==!1?t:{}}function ba(e){const{initial:t,animate:n}=xa(e,x.useContext(Bt));return x.useMemo(()=>({initial:t,animate:n}),[Zr(t),Zr(n)])}function Zr(e){return Array.isArray(e)?e.join(" "):e}const Ta=Symbol.for("motionComponentSymbol");function et(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wa(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):et(n)&&(n.current=r))},[t])}const hn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Jr="data-"+hn("framerAppearId"),{schedule:pn,cancel:Fd}=Yr(queueMicrotask,!1),Qr=x.createContext({});function Sa(e,t,n,r,s){var i,o;const{visualElement:a}=x.useContext(Bt),l=x.useContext(Kr),c=x.useContext(kt),u=x.useContext(an).reducedMotion,f=x.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=f.current,m=x.useContext(Qr);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&Pa(f.current,n,s,m);const v=x.useRef(!1);x.useInsertionEffect(()=>{h&&v.current&&h.update(n,c)});const y=n[Jr],S=x.useRef(Boolean(y)&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,y))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,y)));return Ur(()=>{h&&(v.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),pn.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 Pa(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:es(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:Boolean(o)||a&&et(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function es(e){if(e)return e.options.allowProjection!==!1?e.projection:es(e.parent)}function Ca({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,o;e&&pa(e);function a(c,u){let f;const h={...x.useContext(an),...c,layoutId:Ea(c)},{isStatic:m}=h,v=ba(c),y=r(c,m);if(!m&&ln){ja(h,e);const S=Aa(h);f=S.MeasureLayout,v.visualElement=Sa(s,y,h,t,S.ProjectionNode)}return p.exports.jsxs(Bt.Provider,{value:v,children:[f&&v.visualElement?p.exports.jsx(f,{visualElement:v.visualElement,...h}):null,n(s,c,wa(y,v.visualElement,u),y,m,v.visualElement)]})}a.displayName=`motion.${typeof s=="string"?s:`create(${(o=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&o!==void 0?o:""})`}`;const l=x.forwardRef(a);return l[Ta]=s,l}function Ea({layoutId:e}){const t=x.useContext(sn).id;return t&&e!==void 0?t+"-"+e:e}function ja(e,t){const n=x.useContext(Kr).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?Ze(!1,r):_e(!1,r)}}function Aa(e){const{drag:t,layout:n}=Qe;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 ts=e=>t=>typeof t=="string"&&t.startsWith(e),mn=ts("--"),Ma=ts("var(--"),gn=e=>Ma(e)?Da.test(e.split("/*")[0].trim()):!1,Da=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,mt={};function Ra(e){for(const t in e)mt[t]=e[t],mn(t)&&(mt[t].isCSSVariable=!0)}const tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],We=new Set(tt);function ns(e,{layout:t,layoutId:n}){return We.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!mt[e]||e==="opacity")}const ge=e=>Boolean(e&&e.getVelocity),rs=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Le=(e,t,n)=>n>t?t:n<e?e:n,nt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gt={...nt,transform:e=>Le(0,1,e)},Wt={...nt,default:1},yt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Fe=yt("deg"),De=yt("%"),B=yt("px"),Va=yt("vh"),Oa=yt("vw"),ss={...De,parse:e=>De.parse(e)/100,transform:e=>De.transform(e*100)},La={borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,radius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,top:B,right:B,bottom:B,left:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,backgroundPositionX:B,backgroundPositionY:B},ka={rotate:Fe,rotateX:Fe,rotateY:Fe,rotateZ:Fe,scale:Wt,scaleX:Wt,scaleY:Wt,scaleZ:Wt,skew:Fe,skewX:Fe,skewY:Fe,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,transformPerspective:B,opacity:gt,originX:ss,originY:ss,originZ:B},is={...nt,transform:Math.round},yn={...La,...ka,zIndex:is,size:B,fillOpacity:gt,strokeOpacity:gt,numOctaves:is},_a={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ia=tt.length;function Na(e,t,n){let r="",s=!0;for(let i=0;i<Ia;i++){const o=tt[i],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=rs(a,yn[o]);if(!l){s=!1;const u=_a[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function vn(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(We.has(l)){o=!0;continue}else if(mn(l)){s[l]=c;continue}else{const u=rs(c,yn[l]);l.startsWith("origin")?(a=!0,i[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=Na(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${l} ${c} ${u}`}}const xn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function os(e,t,n){for(const r in t)!ge(t[r])&&!ns(r,n)&&(e[r]=t[r])}function Fa({transformTemplate:e},t){return x.useMemo(()=>{const n=xn();return vn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ba(e,t){const n=e.style||{},r={};return os(r,n,e),Object.assign(r,Fa(e,t)),r}function $a(e,t){const n={},r=Ba(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 Ua=["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 bn(e){return typeof e!="string"||e.includes("-")?!1:!!(Ua.indexOf(e)>-1||/[A-Z]/u.test(e))}const Wa={offset:"stroke-dashoffset",array:"stroke-dasharray"},za={offset:"strokeDashoffset",array:"strokeDasharray"};function Ya(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Wa:za;e[i.offset]=B.transform(-r);const o=B.transform(t),a=B.transform(n);e[i.array]=`${o} ${a}`}function as(e,t,n){return typeof e=="string"?e:B.transform(t+n*e)}function Ka(e,t,n){const r=as(t,e.x,e.width),s=as(n,e.y,e.height);return`${r} ${s}`}function Tn(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,f){if(vn(e,c,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:v}=e;h.transform&&(v&&(m.transform=h.transform),delete h.transform),v&&(s!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=Ka(v,s!==void 0?s:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Ya(h,o,a,l,!1)}const ls=()=>({...xn(),attrs:{}}),wn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function qa(e,t,n,r){const s=x.useMemo(()=>{const i=ls();return Tn(i,t,wn(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};os(i,e.style,e),s.style={...i,...s.style}}return s}function Ga(e=!1){return(n,r,s,{latestValues:i},o)=>{const l=(bn(n)?qa:$a)(r,i,o,n),c=ya(r,typeof n=="string",e),u=n!==x.Fragment?{...c,...l,ref:s}:{},{children:f}=r,h=x.useMemo(()=>ge(f)?f.get():f,[f]);return x.createElement(n,{...u,children:h})}}function us(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Sn(e,t,n,r){if(typeof t=="function"){const[s,i]=us(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=us(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const Pn=e=>Array.isArray(e),Ha=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),Xa=e=>Pn(e)?e[e.length-1]||0:e;function zt(e){const t=ge(e)?e.get():e;return Ha(t)?t.toValue():t}function Za({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const o={latestValues:Ja(r,s,i,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const cs=e=>(t,n)=>{const r=x.useContext(Bt),s=x.useContext(kt),i=()=>Za(e,t,r,s);return n?i():on(i)};function Ja(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=zt(i[h]);let{initial:o,animate:a}=e;const l=Ut(e),c=Xr(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?a:o;if(f&&typeof f!="boolean"&&!$t(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const v=Sn(e,h[m]);if(v){const{transitionEnd:y,transition:S,...b}=v;for(const P in b){let C=b[P];if(Array.isArray(C)){const V=u?C.length-1:0;C=C[V]}C!==null&&(s[P]=C)}for(const P in y)s[P]=y[P]}}}return s}function Cn(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(ge(s[o])||t.style&&ge(t.style[o])||ns(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}const Qa={useVisualState:cs({scrapeMotionValuesFromProps:Cn,createRenderState:xn})};function fs(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 ds(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const hs=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 ps(e,t,n,r){ds(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(hs.has(s)?s:hn(s),t.attrs[s])}function ms(e,t,n){const r=Cn(e,t,n);for(const s in e)if(ge(e[s])||ge(t[s])){const i=tt.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}const gs=["x","y","width","height","cx","cy","r"],el={useVisualState:cs({scrapeMotionValuesFromProps:ms,createRenderState:ls,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const a in s)if(We.has(a)){i=!0;break}}if(!i)return;let o=!t;if(t)for(let a=0;a<gs.length;a++){const l=gs[a];e[l]!==t[l]&&(o=!0)}o&&te.read(()=>{fs(n,r),te.render(()=>{Tn(r,s,wn(n.tagName),e.transformTemplate),ps(n,r)})})}})};function tl(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...bn(r)?el:Qa,preloadedFeatures:e,useRender:Ga(s),createVisualElement:t,Component:r};return Ca(o)}}function vt(e,t,n){const r=e.getProps();return Sn(r,t,n!==void 0?n:r.custom,e)}const nl=un(()=>window.ScrollTimeline!==void 0);class rl{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(s=>{if(nl()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].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 sl extends rl{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function En(e,t){return e?e[t]||e.default||e:void 0}const jn=2e4;function ys(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<jn;)t+=n,r=e.next(t);return t>=jn?1/0:t}function An(e){return typeof e=="function"}function vs(e,t){e.timeline=t,e.onfinish=null}const Mn=e=>Array.isArray(e)&&typeof e[0]=="number",il={linearEasing:void 0};function ol(e,t){const n=un(e);return()=>{var r;return(r=il[t])!==null&&r!==void 0?r:n()}}const Yt=ol(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),xs=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=e(Je(0,s-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function bs(e){return Boolean(typeof e=="function"&&Yt()||!e||typeof e=="string"&&(e in Dn||Yt())||Mn(e)||Array.isArray(e)&&e.every(bs))}const xt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Dn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xt([0,.65,.55,1]),circOut:xt([.55,0,1,.45]),backIn:xt([.31,.01,.66,-.59]),backOut:xt([.33,1.53,.69,.99])};function Ts(e,t){if(e)return typeof e=="function"&&Yt()?xs(e,t):Mn(e)?xt(e):Array.isArray(e)?e.map(n=>Ts(n,t)||Dn.easeOut):Dn[e]}const Ae={x:!1,y:!1};function ws(){return Ae.x||Ae.y}function al(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;t&&(s=t.current);const i=(r=n==null?void 0:n[e])!==null&&r!==void 0?r:s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Ss(e,t){const n=al(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Ps(e){return!(e.pointerType==="touch"||ws())}function ll(e,t,n={}){const[r,s,i]=Ss(e,n),o=a=>{if(!Ps(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const u=f=>{Ps(f)&&(c(f),l.removeEventListener("pointerleave",u))};l.addEventListener("pointerleave",u,s)};return r.forEach(a=>{a.addEventListener("pointerenter",o,s)}),i}function Kt(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 Cs=(e,t)=>t?e===t?!0:Cs(e,t.parentElement):!1,Rn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,ul=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function cl(e){return ul.has(e.tagName)||e.tabIndex!==-1}const bt=new WeakSet;function Es(e){return t=>{t.key==="Enter"&&e(t)}}function Vn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const fl=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Es(()=>{if(bt.has(n))return;Vn(n,"down");const s=Es(()=>{Vn(n,"up")}),i=()=>Vn(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function js(e){return Rn(e)&&!ws()}function dl(e,t,n={}){const[r,s,i]=Ss(e,n),o=a=>{const l=a.currentTarget;if(!l||!js(a)||bt.has(l))return;bt.add(l),Kt(a,"set");const c=t(l,a),u=(m,v)=>{l.removeEventListener("pointerup",f),l.removeEventListener("pointercancel",h),Kt(m,"release"),!(!js(m)||!bt.has(l))&&(bt.delete(l),typeof c=="function"&&c(m,{success:v}))},f=m=>{(m.isTrusted?hl(m,l instanceof Element?l.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?u(m,!1):u(m,!(l instanceof Element)||Cs(l,m.target))},h=m=>{u(m,!1)};l.addEventListener("pointerup",f,s),l.addEventListener("pointercancel",h,s),l.addEventListener("lostpointercapture",h,s)};return r.forEach(a=>{a=n.useGlobalTarget?window:a;let l=!1;a instanceof HTMLElement&&(l=!0,!cl(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0)),a.addEventListener("pointerdown",o,s),l&&a.addEventListener("focus",c=>fl(c,s),s)}),i}function hl(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function pl(e){return e==="x"||e==="y"?Ae[e]?null:(Ae[e]=!0,()=>{Ae[e]=!1}):Ae.x||Ae.y?null:(Ae.x=Ae.y=!0,()=>{Ae.x=Ae.y=!1})}const As=new Set(["width","height","top","left","right","bottom",...tt]);let qt;function ml(){qt=void 0}const Re={now:()=>(qt===void 0&&Re.set(me.isProcessing||zr.useManualTiming?me.timestamp:performance.now()),qt),set:e=>{qt=e,queueMicrotask(ml)}};function On(e,t){e.indexOf(t)===-1&&e.push(t)}function Ln(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class kn{constructor(){this.subscriptions=[]}add(t){return On(this.subscriptions,t),()=>Ln(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Ms(e,t){return t?e*(1e3/t):0}const Ds=30,gl=e=>!isNaN(parseFloat(e));class yl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Re.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&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=Re.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=gl(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 kn);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=Re.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Ds)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ds);return Ms(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 Tt(e,t){return new yl(e,t)}function vl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Tt(n))}function xl(e,t){const n=vt(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=Xa(i[o]);vl(e,o,a)}}function bl(e){return Boolean(ge(e)&&e.add)}function _n(e,t){const n=e.getValue("willChange");if(bl(n))return n.add(t)}function Rs(e){return e.props[Jr]}const Tl={current:!1},Vs=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,wl=1e-7,Sl=12;function Pl(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=Vs(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>wl&&++a<Sl);return o}function wt(e,t,n,r){if(e===t&&n===r)return Se;const s=i=>Pl(i,0,1,e,n);return i=>i===0||i===1?i:Vs(s(i),t,r)}const Os=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ls=e=>t=>1-e(1-t),ks=wt(.33,1.53,.69,.99),In=Ls(ks),_s=Os(In),Is=e=>(e*=2)<1?.5*In(e):.5*(2-Math.pow(2,-10*(e-1))),Nn=e=>1-Math.sin(Math.acos(e)),Ns=Ls(Nn),Fs=Os(Nn),Bs=e=>/^0[^.\s]+$/u.test(e);function Cl(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Bs(e):!0}const St=e=>Math.round(e*1e5)/1e5,Fn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function El(e){return e==null}const jl=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bn=(e,t)=>n=>Boolean(typeof n=="string"&&jl.test(n)&&n.startsWith(e)||t&&!El(n)&&Object.prototype.hasOwnProperty.call(n,t)),$s=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Fn);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Al=e=>Le(0,255,e),$n={...nt,transform:e=>Math.round(Al(e))},ze={test:Bn("rgb","red"),parse:$s("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+$n.transform(e)+", "+$n.transform(t)+", "+$n.transform(n)+", "+St(gt.transform(r))+")"};function Ml(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Un={test:Bn("#"),parse:Ml,transform:ze.transform},rt={test:Bn("hsl","hue"),parse:$s("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+De.transform(St(t))+", "+De.transform(St(n))+", "+St(gt.transform(r))+")"},ye={test:e=>ze.test(e)||Un.test(e)||rt.test(e),parse:e=>ze.test(e)?ze.parse(e):rt.test(e)?rt.parse(e):Un.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ze.transform(e):rt.transform(e)},Dl=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Rl(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Fn))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Dl))===null||n===void 0?void 0:n.length)||0)>0}const Us="number",Ws="color",Vl="var",Ol="var(",zs="${}",Ll=/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 Pt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(Ll,l=>(ye.test(l)?(r.color.push(i),s.push(Ws),n.push(ye.parse(l))):l.startsWith(Ol)?(r.var.push(i),s.push(Vl),n.push(l)):(r.number.push(i),s.push(Us),n.push(parseFloat(l))),++i,zs)).split(zs);return{values:n,split:a,indexes:r,types:s}}function Ys(e){return Pt(e).values}function Ks(e){const{split:t,types:n}=Pt(e),r=t.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],s[o]!==void 0){const a=n[o];a===Us?i+=St(s[o]):a===Ws?i+=ye.transform(s[o]):i+=s[o]}return i}}const kl=e=>typeof e=="number"?0:e;function _l(e){const t=Ys(e);return Ks(e)(t.map(kl))}const Be={test:Rl,parse:Ys,createTransformer:Ks,getAnimatableNone:_l},Il=new Set(["brightness","contrast","saturate","opacity"]);function Nl(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Fn)||[];if(!r)return e;const s=n.replace(r,"");let i=Il.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const Fl=/\b([a-z-]*)\(.*?\)/gu,Wn={...Be,getAnimatableNone:e=>{const t=e.match(Fl);return t?t.map(Nl).join(" "):e}},Bl={...yn,color:ye,backgroundColor:ye,outlineColor:ye,fill:ye,stroke:ye,borderColor:ye,borderTopColor:ye,borderRightColor:ye,borderBottomColor:ye,borderLeftColor:ye,filter:Wn,WebkitFilter:Wn},zn=e=>Bl[e];function qs(e,t){let n=zn(e);return n!==Wn&&(n=Be),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const $l=new Set(["auto","none","0"]);function Ul(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!$l.has(i)&&Pt(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=qs(n,s)}const Gs=e=>e===nt||e===B,Hs=(e,t)=>parseFloat(e.split(", ")[t]),Xs=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Hs(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Hs(i[1],e):0}},Wl=new Set(["x","y","z"]),zl=tt.filter(e=>!Wl.has(e));function Yl(e){const t=[];return zl.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const st={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:Xs(4,13),y:Xs(5,14)};st.translateX=st.x,st.translateY=st.y;const Ye=new Set;let Yn=!1,Kn=!1;function Zs(){if(Kn){const e=Array.from(Ye).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Yl(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))===null||a===void 0||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Kn=!1,Yn=!1,Ye.forEach(e=>e.complete()),Ye.clear()}function Js(){Ye.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Kn=!0)})}function Kl(){Js(),Zs()}class qn{constructor(t,n,r,s,i,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=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ye.add(this),Yn||(Yn=!0,te.read(Js),te.resolveKeyframes(Zs))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const o=s==null?void 0:s.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),s&&o===void 0&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ye.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ye.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Qs=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ql=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Gl(e){const t=ql.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const Hl=4;function ei(e,t,n=1){_e(n<=Hl,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,s]=Gl(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Qs(o)?parseFloat(o):o}return gn(s)?ei(s,t,n+1):s}const ti=e=>t=>t.test(e),ni=[nt,B,De,Fe,Oa,Va,{test:e=>e==="auto",parse:e=>e}],ri=e=>ni.find(ti(e));class si extends qn{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),gn(c))){const u=ei(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!As.has(r)||t.length!==2)return;const[s,i]=t,o=ri(s),a=ri(i);if(o!==a)if(Gs(o)&&Gs(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)Cl(t[s])&&r.push(s);r.length&&Ul(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=st[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,a=s[o];s[o]=st[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const ii=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Be.test(e)||e==="0")&&!e.startsWith("url("));function Xl(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 Zl(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=ii(s,t),a=ii(i,t);return Ze(o===a,`You are trying to animate ${t} from "${s}" to "${i}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${i} via the \`style\` property.`),!o||!a?!1:Xl(e)||(n==="spring"||An(n))&&r}const Jl=e=>e!==null;function Gt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(Jl),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const Ql=40;class oi{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Re.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Ql?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Kl(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Re.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!Zl(t,r,s,i))if(o)this.options.duration=0;else{l&&l(Gt(t,this.options,n)),a&&a(),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 Ct={layout:0,mainThread:0,waapi:0},ne=(e,t,n)=>e+(t-e)*n;function Gn(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 eu({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Gn(l,a,e+1/3),i=Gn(l,a,e),o=Gn(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Ht(e,t){return n=>n>0?t:e}const Hn=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},tu=[Un,ze,rt],nu=e=>tu.find(t=>t.test(e));function ai(e){const t=nu(e);if(Ze(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===rt&&(n=eu(n)),n}const li=(e,t)=>{const n=ai(e),r=ai(t);if(!n||!r)return Ht(e,t);const s={...n};return i=>(s.red=Hn(n.red,r.red,i),s.green=Hn(n.green,r.green,i),s.blue=Hn(n.blue,r.blue,i),s.alpha=ne(n.alpha,r.alpha,i),ze.transform(s))},ru=(e,t)=>n=>t(e(n)),Et=(...e)=>e.reduce(ru),Xn=new Set(["none","hidden"]);function su(e,t){return Xn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function iu(e,t){return n=>ne(e,t,n)}function Zn(e){return typeof e=="number"?iu:typeof e=="string"?gn(e)?Ht:ye.test(e)?li:lu:Array.isArray(e)?ui:typeof e=="object"?ye.test(e)?li:ou:Ht}function ui(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Zn(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function ou(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Zn(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function au(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],a=e.indexes[o][s[o]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[i]=l,s[o]++}return r}const lu=(e,t)=>{const n=Be.createTransformer(t),r=Pt(e),s=Pt(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Xn.has(e)&&!s.values.length||Xn.has(t)&&!r.values.length?su(e,t):Et(ui(au(r,s),s.values),n):(Ze(!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.`),Ht(e,t))};function ci(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ne(e,t,n):Zn(e)(e,t)}const uu=5;function fi(e,t,n){const r=Math.max(t-uu,0);return Ms(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},Jn=.001;function cu({duration:e=re.duration,bounce:t=re.bounce,velocity:n=re.velocity,mass:r=re.mass}){let s,i;Ze(e<=Me(re.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Le(re.minDamping,re.maxDamping,o),e=Le(re.minDuration,re.maxDuration,Oe(e)),o<1?(s=c=>{const u=c*o,f=u*e,h=u-n,m=Qn(c,o),v=Math.exp(-f);return Jn-h/m*v},i=c=>{const f=c*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(c,2)*e,v=Math.exp(-f),y=Qn(Math.pow(c,2),o);return(-s(c)+Jn>0?-1:1)*((h-m)*v)/y}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Jn+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=du(s,i,a);if(e=Me(e),isNaN(l))return{stiffness:re.stiffness,damping:re.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const fu=12;function du(e,t,n){let r=n;for(let s=1;s<fu;s++)r=r-e(r)/t(r);return r}function Qn(e,t){return e*Math.sqrt(1-t*t)}const hu=["duration","bounce"],pu=["stiffness","damping","mass"];function di(e,t){return t.some(n=>e[n]!==void 0)}function mu(e){let t={velocity:re.velocity,stiffness:re.stiffness,damping:re.damping,mass:re.mass,isResolvedFromDuration:!1,...e};if(!di(e,pu)&&di(e,hu))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Le(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:re.mass,stiffness:s,damping:i}}else{const n=cu(e);t={...t,...n,mass:re.mass},t.isResolvedFromDuration=!0}return t}function hi(e=re.visualDuration,t=re.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:m}=mu({...n,velocity:-Oe(n.velocity||0)}),v=h||0,y=c/(2*Math.sqrt(l*u)),S=o-i,b=Oe(Math.sqrt(l/u)),P=Math.abs(S)<5;r||(r=P?re.restSpeed.granular:re.restSpeed.default),s||(s=P?re.restDelta.granular:re.restDelta.default);let C;if(y<1){const g=Qn(b,y);C=O=>{const _=Math.exp(-y*b*O);return o-_*((v+y*b*S)/g*Math.sin(g*O)+S*Math.cos(g*O))}}else if(y===1)C=g=>o-Math.exp(-b*g)*(S+(v+b*S)*g);else{const g=b*Math.sqrt(y*y-1);C=O=>{const _=Math.exp(-y*b*O),L=Math.min(g*O,300);return o-_*((v+y*b*S)*Math.sinh(L)+g*S*Math.cosh(L))/g}}const V={calculatedDuration:m&&f||null,next:g=>{const O=C(g);if(m)a.done=g>=f;else{let _=0;y<1&&(_=g===0?Me(v):fi(C,g,O));const L=Math.abs(_)<=r,k=Math.abs(o-O)<=s;a.done=L&&k}return a.value=a.done?o:O,a},toString:()=>{const g=Math.min(ys(V),jn),O=xs(_=>V.next(g*_).value,g,30);return g+"ms "+O}};return V}function pi({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},m=L=>a!==void 0&&L<a||l!==void 0&&L>l,v=L=>a===void 0?l:l===void 0||Math.abs(a-L)<Math.abs(l-L)?a:l;let y=n*t;const S=f+y,b=o===void 0?S:o(S);b!==S&&(y=b-f);const P=L=>-y*Math.exp(-L/r),C=L=>b+P(L),V=L=>{const k=P(L),U=C(L);h.done=Math.abs(k)<=c,h.value=h.done?b:U};let g,O;const _=L=>{m(h.value)&&(g=L,O=hi({keyframes:[h.value,v(h.value)],velocity:fi(C,L,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:L=>{let k=!1;return!O&&g===void 0&&(k=!0,V(L),_(L)),g!==void 0&&L>=g?O.next(L-g):(!k&&V(L),h)}}}const gu=wt(.42,0,1,1),yu=wt(0,0,.58,1),mi=wt(.42,0,.58,1),vu=e=>Array.isArray(e)&&typeof e[0]!="number",gi={linear:Se,easeIn:gu,easeInOut:mi,easeOut:yu,circIn:Nn,circInOut:Fs,circOut:Ns,backIn:In,backInOut:_s,backOut:ks,anticipate:Is},yi=e=>{if(Mn(e)){_e(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,s]=e;return wt(t,n,r,s)}else if(typeof e=="string")return _e(gi[e]!==void 0,`Invalid easing type '${e}'`),gi[e];return e};function xu(e,t,n){const r=[],s=n||ci,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Se:t;a=Et(l,a)}r.push(a)}return r}function bu(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(_e(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=xu(t,r,s),l=a.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=Je(e[f],e[f+1],u);return a[f](h)};return n?u=>c(Le(e[0],e[i-1],u)):c}function Tu(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Je(0,t,r);e.push(ne(n,1,s))}}function wu(e){const t=[0];return Tu(t,e.length-1),t}function Su(e,t){return e.map(n=>n*t)}function Pu(e,t){return e.map(()=>t||mi).splice(0,e.length-1)}function jt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=vu(r)?r.map(yi):yi(r),i={done:!1,value:t[0]},o=Su(n&&n.length===t.length?n:wu(t),e),a=bu(o,t,{ease:Array.isArray(s)?s:Pu(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const Cu=e=>{const t=({timestamp:n})=>e(n);return{start:()=>te.update(t,!0),stop:()=>Ne(t),now:()=>me.isProcessing?me.timestamp:Re.now()}},Eu={decay:pi,inertia:pi,tween:jt,keyframes:jt,spring:hi},ju=e=>e/100;class er extends oi{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:l}=this.options;l&&l()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,o=(s==null?void 0:s.KeyframeResolver)||qn,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(i,a,n,r,s),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:s=0,repeatType:i,velocity:o=0}=this.options,a=An(n)?n:Eu[n]||jt;let l,c;process.env.NODE_ENV!=="production"&&a!==jt&&_e(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),a!==jt&&typeof t[0]!="number"&&(l=Et(ju,ci(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});i==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ys(u));const{calculatedDuration:f}=u,h=f+s,m=h*(r+1)-s;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;Ct.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:L}=this.options;return{done:!0,value:L[L.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:m,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),P=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,V=i;if(m){const L=Math.min(this.currentTime,u)/f;let k=Math.floor(L),U=L%1;!U&&L>=1&&(U=1),U===1&&k--,k=Math.min(k,m+1),Boolean(k%2)&&(v==="reverse"?(U=1-U,y&&(U-=y/f)):v==="mirror"&&(V=o)),C=Le(0,1,U)*f}const g=P?{done:!1,value:l[0]}:V.next(C);a&&(g.value=a(g.value));let{done:O}=g;!P&&c!==null&&(O=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return _&&s!==void 0&&(g.value=Gt(l,this.options,s)),S&&S(g.value),_&&this.finish(),g}get duration(){const{resolved:t}=this;return t?Oe(t.calculatedDuration):0}get time(){return Oe(this.currentTime)}set time(t){t=Me(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=Oe(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Cu,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):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(),Ct.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Au=new Set(["opacity","clipPath","filter","transform"]);function Mu(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=Ts(a,s);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const Du=un(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Xt=10,Ru=2e4;function Vu(e){return An(e.type)||e.type==="spring"||!bs(e.ease)}function Ou(e,t){const n=new er({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let i=0;for(;!r.done&&i<Ru;)r=n.sample(i),s.push(r.value),i+=Xt;return{times:void 0,keyframes:s,duration:i-Xt,ease:"linear"}}const vi={anticipate:Is,backInOut:_s,circInOut:Fs};function Lu(e){return e in vi}class xi extends oi{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new si(i,(o,a)=>this.onKeyframesResolved(o,a),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof i=="string"&&Yt()&&Lu(i)&&(i=vi[i]),Vu(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:v,...y}=this.options,S=Ou(t,y);t=S.keyframes,t.length===1&&(t[1]=t[0]),r=S.duration,s=S.times,i=S.ease,o="keyframes"}const u=Mu(a.owner.current,l,t,{...this.options,duration:r,times:s,ease:i});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(vs(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;a.set(Gt(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:s,type:o,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Oe(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Oe(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Me(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 Se;const{animation:r}=n;vs(r,t)}return Se}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:s,type:i,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:f,element:h,...m}=this.options,v=new er({...m,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),y=Me(this.time);c.setWithVelocity(v.sample(y-Xt).value,v.sample(y).value,Xt)}const{onStop:l}=this.options;l&&l(),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:s,repeatType:i,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return Du()&&r&&Au.has(r)&&!l&&!c&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}const ku={type:"spring",stiffness:500,damping:25,restSpeed:10},_u=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Iu={type:"keyframes",duration:.8},Nu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fu=(e,{keyframes:t})=>t.length>2?Iu:We.has(e)?e.startsWith("scale")?_u(t[1]):ku:Nu;function Bu({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const tr=(e,t,n,r={},s,i)=>o=>{const a=En(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Me(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};Bu(a)||(u={...u,...Fu(e,u)}),u.duration&&(u.duration=Me(u.duration)),u.repeatDelay&&(u.repeatDelay=Me(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)),(Tl.current||zr.skipAnimations)&&(f=!0,u.duration=0,u.delay=0),f&&!i&&t.get()!==void 0){const h=Gt(u.keyframes,a);if(h!==void 0)return te.update(()=>{u.onUpdate(h),u.onComplete()}),new sl([])}return!i&&xi.supports(u)?new xi(u):new er(u)};function $u({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function bi(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(o=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const f in l){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),m=l[f];if(m===void 0||u&&$u(u,f))continue;const v={delay:n,...En(o||{},f)};let y=!1;if(window.MotionHandoffAnimation){const b=Rs(e);if(b){const P=window.MotionHandoffAnimation(b,f,te);P!==null&&(v.startTime=P,y=!0)}}_n(e,f),h.start(tr(f,h,m,e.shouldReduceMotion&&As.has(f)?{type:!1}:v,e,y));const S=h.animation;S&&c.push(S)}return a&&Promise.all(c).then(()=>{te.update(()=>{a&&xl(e,a)})}),c}function nr(e,t,n={}){var r;const s=vt(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(bi(e,s,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=i;return Uu(e,t,u+c,f,h,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[c,u]=l==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function Uu(e,t,n=0,r=0,s=1,i){const o=[],a=(e.variantChildren.size-1)*r,l=s===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(Wu).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(nr(c,t,{...i,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function Wu(e,t){return e.sortNodePosition(t)}function zu(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>nr(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=nr(e,t,n);else{const s=typeof t=="function"?vt(e,t,n.custom):t;r=Promise.all(bi(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Ti(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 Yu=dn.length;function wi(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?wi(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Yu;n++){const r=dn[n],s=e.props[r];(pt(s)||s===!1)&&(t[r]=s)}return t}const Ku=[...fn].reverse(),qu=fn.length;function Gu(e){return t=>Promise.all(t.map(({animation:n,options:r})=>zu(e,n,r)))}function Hu(e){let t=Gu(e),n=Si(),r=!0;const s=l=>(c,u)=>{var f;const h=vt(e,u,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:v,...y}=h;c={...c,...y,...v}}return c};function i(l){t=l(e)}function o(l){const{props:c}=e,u=wi(e.parent)||{},f=[],h=new Set;let m={},v=1/0;for(let S=0;S<qu;S++){const b=Ku[S],P=n[b],C=c[b]!==void 0?c[b]:u[b],V=pt(C),g=b===l?P.isActive:null;g===!1&&(v=S);let O=C===u[b]&&C!==c[b]&&V;if(O&&r&&e.manuallyAnimateOnMount&&(O=!1),P.protectedKeys={...m},!P.isActive&&g===null||!C&&!P.prevProp||$t(C)||typeof C=="boolean")continue;const _=Xu(P.prevProp,C);let L=_||b===l&&P.isActive&&!O&&V||S>v&&V,k=!1;const U=Array.isArray(C)?C:[C];let Q=U.reduce(s(b),{});g===!1&&(Q={});const{prevResolvedValues:de={}}=P,ce={...de,...Q},ie=H=>{L=!0,h.has(H)&&(k=!0,h.delete(H)),P.needsAnimating[H]=!0;const le=e.getValue(H);le&&(le.liveStyle=!1)};for(const H in ce){const le=Q[H],be=de[H];if(m.hasOwnProperty(H))continue;let T=!1;Pn(le)&&Pn(be)?T=!Ti(le,be):T=le!==be,T?le!=null?ie(H):h.add(H):le!==void 0&&h.has(H)?ie(H):P.protectedKeys[H]=!0}P.prevProp=C,P.prevResolvedValues=Q,P.isActive&&(m={...m,...Q}),r&&e.blockInitialAnimation&&(L=!1),L&&(!(O&&_)||k)&&f.push(...U.map(H=>({animation:H,options:{type:b}})))}if(h.size){const S={};if(typeof c.initial!="boolean"){const b=vt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);b&&b.transition&&(S.transition=b.transition)}h.forEach(b=>{const P=e.getBaseTarget(b),C=e.getValue(b);C&&(C.liveStyle=!0),S[b]=P??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 a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(l,c)}),n[l].isActive=c;const f=o(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Si(),r=!0}}}function Xu(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ti(t,e):!1}function Ke(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Si(){return{animate:Ke(!0),whileInView:Ke(),whileHover:Ke(),whileTap:Ke(),whileDrag:Ke(),whileFocus:Ke(),exit:Ke()}}class $e{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Zu extends $e{constructor(t){super(t),t.animationState||(t.animationState=Hu(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();$t(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 Ju=0;class Qu extends $e{constructor(){super(...arguments),this.id=Ju++}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 s=this.node.animationState.setActive("exit",!t);n&&!t&&s.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 ec={animation:{Feature:Zu},exit:{Feature:Qu}};function At(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Mt(e){return{point:{x:e.pageX,y:e.pageY}}}const tc=e=>t=>Rn(t)&&e(t,Mt(t));function it(e,t,n,r){return At(e,t,tc(n),r)}function Pi({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function nc({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function rc(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 Ci=1e-4,sc=1-Ci,ic=1+Ci,Ei=.01,oc=0-Ei,ac=0+Ei;function xe(e){return e.max-e.min}function lc(e,t,n){return Math.abs(e-t)<=n}function ji(e,t,n,r=.5){e.origin=r,e.originPoint=ne(t.min,t.max,e.origin),e.scale=xe(n)/xe(t),e.translate=ne(n.min,n.max,e.origin)-e.originPoint,(e.scale>=sc&&e.scale<=ic||isNaN(e.scale))&&(e.scale=1),(e.translate>=oc&&e.translate<=ac||isNaN(e.translate))&&(e.translate=0)}function Dt(e,t,n,r){ji(e.x,t.x,n.x,r?r.originX:void 0),ji(e.y,t.y,n.y,r?r.originY:void 0)}function Ai(e,t,n){e.min=n.min+t.min,e.max=e.min+xe(t)}function uc(e,t,n){Ai(e.x,t.x,n.x),Ai(e.y,t.y,n.y)}function Mi(e,t,n){e.min=t.min-n.min,e.max=e.min+xe(t)}function Rt(e,t,n){Mi(e.x,t.x,n.x),Mi(e.y,t.y,n.y)}const Di=()=>({translate:0,scale:1,origin:0,originPoint:0}),ot=()=>({x:Di(),y:Di()}),Ri=()=>({min:0,max:0}),oe=()=>({x:Ri(),y:Ri()});function Pe(e){return[e("x"),e("y")]}function rr(e){return e===void 0||e===1}function sr({scale:e,scaleX:t,scaleY:n}){return!rr(e)||!rr(t)||!rr(n)}function qe(e){return sr(e)||Vi(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Vi(e){return Oi(e.x)||Oi(e.y)}function Oi(e){return e&&e!=="0%"}function Zt(e,t,n){const r=e-n,s=t*r;return n+s}function Li(e,t,n,r,s){return s!==void 0&&(e=Zt(e,s,r)),Zt(e,n,r)+t}function ir(e,t=0,n=1,r,s){e.min=Li(e.min,t,n,r,s),e.max=Li(e.max,t,n,r,s)}function ki(e,{x:t,y:n}){ir(e.x,t.translate,t.scale,t.originPoint),ir(e.y,n.translate,n.scale,n.originPoint)}const _i=.999999999999,Ii=1.0000000000001;function cc(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&lt(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ki(e,o)),r&&qe(i.latestValues)&&lt(e,i.latestValues))}t.x<Ii&&t.x>_i&&(t.x=1),t.y<Ii&&t.y>_i&&(t.y=1)}function at(e,t){e.min=e.min+t,e.max=e.max+t}function Ni(e,t,n,r,s=.5){const i=ne(e.min,e.max,s);ir(e,t,n,i,r)}function lt(e,t){Ni(e.x,t.x,t.scaleX,t.scale,t.originX),Ni(e.y,t.y,t.scaleY,t.scale,t.originY)}function Fi(e,t){return Pi(rc(e.getBoundingClientRect(),t))}function fc(e,t,n){const r=Fi(e,n),{scroll:s}=t;return s&&(at(r.x,s.offset.x),at(r.y,s.offset.y)),r}const Bi=(e,t)=>Math.abs(e-t);function dc(e,t){const n=Bi(e.x,t.x),r=Bi(e.y,t.y);return Math.sqrt(n**2+r**2)}class $i{constructor(t,n,{transformPagePoint:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=ar(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=dc(u.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=u,{timestamp:v}=me;this.history.push({...m,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=or(f,this.transformPagePoint),te.update(this.updatePoint,!0)},this.handlePointerUp=(u,f)=>{Kt(u,"release"),this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ar(u.type==="pointercancel"||u.type==="lostpointercapture"?this.lastMoveEventInfo:or(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,y),m&&m(u,y)},!Rn(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r;const i=Mt(t),o=or(i,this.transformPagePoint),{point:a}=o,{timestamp:l}=me;this.history=[{...a,timestamp:l}];const{onSessionStart:c}=n;c&&c(t,ar(o,this.history)),Kt(t,"set"),this.removeListeners=Et(it(t.currentTarget,"pointermove",this.handlePointerMove),it(t.currentTarget,"pointerup",this.handlePointerUp),it(t.currentTarget,"pointercancel",this.handlePointerUp),it(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ne(this.updatePoint)}}function or(e,t){return t?{point:t(e.point)}:e}function Ui(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ar({point:e},t){return{point:e,delta:Ui(e,Wi(t)),offset:Ui(e,hc(t)),velocity:pc(t,.1)}}function hc(e){return e[0]}function Wi(e){return e[e.length-1]}function pc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=Wi(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Me(t)));)n--;if(!r)return{x:0,y:0};const i=Oe(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function mc(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 zi(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 gc(e,{top:t,left:n,bottom:r,right:s}){return{x:zi(e.x,n,s),y:zi(e.y,t,r)}}function Yi(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 yc(e,t){return{x:Yi(e.x,t.x),y:Yi(e.y,t.y)}}function vc(e,t){let n=.5;const r=xe(e),s=xe(t);return s>r?n=Je(t.min,t.max-r,e.min):r>s&&(n=Je(e.min,e.max-s,t.min)),Le(0,1,n)}function xc(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 lr=.35;function bc(e=lr){return e===!1?e=0:e===!0&&(e=lr),{x:Ki(e,"left","right"),y:Ki(e,"top","bottom")}}function Ki(e,t,n){return{min:qi(e,t),max:qi(e,n)}}function qi(e,t){return typeof e=="number"?e:e[t]||0}const Tc=new WeakMap;class wc{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=oe(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Mt(u).point)},i=(u,f)=>{const{drag:h,dragPropagation:m,onDragStart:v}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=pl(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),Pe(S=>{let b=this.getAxisMotionValue(S).get()||0;if(De.test(b)){const{projection:P}=this.visualElement;if(P&&P.layout){const C=P.layout.layoutBox[S];C&&(b=xe(C)*(parseFloat(b)/100))}}this.originPoint[S]=b}),v&&te.postRender(()=>v(u,f)),_n(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:v,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:S}=f;if(m&&this.currentDirection===null){this.currentDirection=Sc(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)},a=(u,f)=>this.stop(u,f),l=()=>Pe(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 $i(t,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&te.postRender(()=>i(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:s}=this.getProps();if(!r||!Jt(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=mc(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&et(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=gc(s.layoutBox,n):this.constraints=!1,this.elastic=bc(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Pe(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=xc(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!et(t))return!1;const r=t.current;_e(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=fc(r,s.root,this.visualElement.getTransformPagePoint());let o=yc(s.layout.layoutBox,i);if(n){const a=n(nc(o));this.hasMutatedConstraints=!!a,a&&(o=Pi(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Pe(u=>{if(!Jt(u,n,this.currentDirection))return;let f=l&&l[u]||{};o&&(f={min:0,max:0});const h=s?200:1e6,m=s?40:1e7,v={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,v)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return _n(this.visualElement,t),r.start(tr(t,r,0,n,this.visualElement,!1))}stopAnimation(){Pe(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Pe(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(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Pe(n=>{const{drag:r}=this.getProps();if(!Jt(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];i.set(t[n]-ne(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!et(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Pe(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=vc({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Pe(o=>{if(!Jt(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(ne(l,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;Tc.set(this.visualElement,this);const t=this.visualElement.current,n=it(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();et(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),te.read(r);const o=At(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Pe(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=lr,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function Jt(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Sc(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Pc extends $e{constructor(t){super(t),this.removeGroupControls=Se,this.removeListeners=Se,this.controls=new wc(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Se}unmount(){this.removeGroupControls(),this.removeListeners()}}const Gi=e=>(t,n)=>{e&&te.postRender(()=>e(t,n))};class Cc extends $e{constructor(){super(...arguments),this.removePointerDownListener=Se}onPointerDown(t){this.session=new $i(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Gi(t),onStart:Gi(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&te.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=it(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 Qt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Hi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Vt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(B.test(e))e=parseFloat(e);else return e;const n=Hi(e,t.target.x),r=Hi(e,t.target.y);return`${n}% ${r}%`}},Ec={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Be.parse(e);if(s.length>5)return r;const i=Be.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=ne(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}};class jc extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;Ra(Ac),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Qt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||te.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),pn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Xi(e){const[t,n]=Br(),r=x.useContext(sn);return p.exports.jsx(jc,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(Qr),isPresent:t,safeToRemove:n})}const Ac={borderRadius:{...Vt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vt,borderTopRightRadius:Vt,borderBottomLeftRadius:Vt,borderBottomRightRadius:Vt,boxShadow:Ec};function Mc(e,t,n){const r=ge(e)?e:Tt(e);return r.start(tr("",r,t,n)),r.animation}function Dc(e){return e instanceof SVGElement&&e.tagName!=="svg"}const Rc=(e,t)=>e.depth-t.depth;class Vc{constructor(){this.children=[],this.isDirty=!1}add(t){On(this.children,t),this.isDirty=!0}remove(t){Ln(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Rc),this.isDirty=!1,this.children.forEach(t)}}function Oc(e,t){const n=Re.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Ne(r),e(i-t))};return te.read(r,!0),()=>Ne(r)}const Zi=["TopLeft","TopRight","BottomLeft","BottomRight"],Lc=Zi.length,Ji=e=>typeof e=="string"?parseFloat(e):e,Qi=e=>typeof e=="number"||B.test(e);function kc(e,t,n,r,s,i){s?(e.opacity=ne(0,n.opacity!==void 0?n.opacity:1,_c(r)),e.opacityExit=ne(t.opacity!==void 0?t.opacity:1,0,Ic(r))):i&&(e.opacity=ne(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Lc;o++){const a=`border${Zi[o]}Radius`;let l=eo(t,a),c=eo(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Qi(l)===Qi(c)?(e[a]=Math.max(ne(Ji(l),Ji(c),r),0),(De.test(c)||De.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=ne(t.rotate||0,n.rotate||0,r))}function eo(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const _c=to(0,.5,Ns),Ic=to(.5,.95,Se);function to(e,t,n){return r=>r<e?0:r>t?1:n(Je(e,t,r))}function no(e,t){e.min=t.min,e.max=t.max}function Ce(e,t){no(e.x,t.x),no(e.y,t.y)}function ro(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function so(e,t,n,r,s){return e-=t,e=Zt(e,1/n,r),s!==void 0&&(e=Zt(e,1/s,r)),e}function Nc(e,t=0,n=1,r=.5,s,i=e,o=e){if(De.test(t)&&(t=parseFloat(t),t=ne(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=ne(i.min,i.max,r);e===i&&(a-=t),e.min=so(e.min,t,n,a,s),e.max=so(e.max,t,n,a,s)}function io(e,t,[n,r,s],i,o){Nc(e,t[n],t[r],t[s],t.scale,i,o)}const Fc=["x","scaleX","originX"],Bc=["y","scaleY","originY"];function oo(e,t,n,r){io(e.x,t,Fc,n?n.x:void 0,r?r.x:void 0),io(e.y,t,Bc,n?n.y:void 0,r?r.y:void 0)}function ao(e){return e.translate===0&&e.scale===1}function lo(e){return ao(e.x)&&ao(e.y)}function uo(e,t){return e.min===t.min&&e.max===t.max}function $c(e,t){return uo(e.x,t.x)&&uo(e.y,t.y)}function co(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function fo(e,t){return co(e.x,t.x)&&co(e.y,t.y)}function ho(e){return xe(e.x)/xe(e.y)}function po(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Uc{constructor(){this.members=[]}add(t){On(this.members,t),t.scheduleRender()}remove(t){if(Ln(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(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;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:s}=t.options;s===!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 Wc(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}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:m,skewY:v}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),v&&(r+=`skewY(${v}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Ge={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ur=["","X","Y","Z"],zc={visibility:"hidden"},mo=1e3;let Yc=0;function cr(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function go(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Rs(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",te,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&go(r)}function yo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Yc++,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,Ie.value&&(Ge.nodes=Ge.calculatedTargetDeltas=Ge.calculatedProjections=0),this.nodes.forEach(Gc),this.nodes.forEach(Qc),this.nodes.forEach(ef),this.nodes.forEach(Hc),Ie.addProjectionMetrics&&Ie.addProjectionMetrics(Ge)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Vc)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new kn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Dc(o),this.instance=o;const{layoutId:l,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),a&&(c||l)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Oc(h,250),Qt.hasAnimatedSinceResize&&(Qt.hasAnimatedSinceResize=!1,this.nodes.forEach(xo))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||of,{onLayoutAnimationStart:S,onLayoutAnimationComplete:b}=u.getProps(),P=!this.targetLayout||!fo(this.targetLayout,v),C=!h&&m;if(this.options.layoutRoot||this.resumeFrom||C||h&&(P||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,C);const V={...En(y,"layout"),onPlay:S,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(V.delay=0,V.type=!1),this.startAnimation(V)}else h||xo(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,Ne(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(tf),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&&go(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:a,layout:l}=this.options;if(a===void 0&&!l)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(vo);return}this.isUpdating||this.nodes.forEach(Zc),this.isUpdating=!1,this.nodes.forEach(Jc),this.nodes.forEach(Kc),this.nodes.forEach(qc),this.clearAllSnapshots();const a=Re.now();me.delta=Le(0,1e3/60,a-me.timestamp),me.timestamp=a,me.isProcessing=!0,cn.update.process(me),cn.preRender.process(me),cn.render.process(me),me.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,pn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Xc),this.sharedNodes.forEach(nf)}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&&!xe(this.snapshot.measuredBox.x)&&!xe(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=oe(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!lo(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(a||qe(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),af(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return oe();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(lf))){const{scroll:u}=this.root;u&&(at(l.x,u.offset.x),at(l.y,u.offset.y))}return l}removeElementScroll(o){var a;const l=oe();if(Ce(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;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&&Ce(l,o),at(l.x,f.offset.x),at(l.y,f.offset.y))}return l}applyTransform(o,a=!1){const l=oe();Ce(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&lt(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),qe(u.latestValues)&&lt(l,u.latestValues)}return qe(this.latestValues)&&lt(l,this.latestValues),l}removeTransform(o){const a=oe();Ce(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!qe(c.latestValues))continue;sr(c.latestValues)&&c.updateSnapshot();const u=oe(),f=c.measurePageBox();Ce(u,f),oo(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return qe(this.latestValues)&&oo(a,this.latestValues),a}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!==me.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=Boolean(this.resumingFrom)||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=me.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=oe(),this.relativeTargetOrigin=oe(),Rt(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),Ce(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=oe(),this.targetWithTransforms=oe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),uc(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Ce(this.target,this.layout.layoutBox),ki(this.target,this.targetDelta)):Ce(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&Boolean(m.resumingFrom)===Boolean(this.resumingFrom)&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=oe(),this.relativeTargetOrigin=oe(),Rt(this.relativeTargetOrigin,this.target,m.target),Ce(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ie.value&&Ge.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||sr(this.parent.latestValues)||Vi(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 a=this.getLead(),l=Boolean(this.resumingFrom)||this!==a;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===me.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;Ce(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;cc(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=oe());const{target:v}=a;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ro(this.prevProjectionDelta.x,this.projectionDelta.x),ro(this.prevProjectionDelta.y,this.projectionDelta.y)),Dt(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!po(this.projectionDelta.x,this.prevProjectionDelta.x)||!po(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),Ie.value&&Ge.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ot(),this.projectionDelta=ot(),this.projectionDeltaWithTransform=ot()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=ot();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=oe(),m=l?l.source:void 0,v=this.layout?this.layout.source:void 0,y=m!==v,S=this.getStack(),b=!S||S.members.length<=1,P=Boolean(y&&!b&&this.options.crossfade===!0&&!this.path.some(sf));this.animationProgress=0;let C;this.mixTargetDelta=V=>{const g=V/1e3;bo(f.x,o.x,g),bo(f.y,o.y,g),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Rt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),rf(this.relativeTarget,this.relativeTargetOrigin,h,g),C&&$c(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=oe()),Ce(C,this.relativeTarget)),y&&(this.animationValues=u,kc(u,c,this.latestValues,g,P,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=g},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&&(Ne(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=te.update(()=>{Qt.hasAnimatedSinceResize=!0,Ct.layout++,this.currentAnimation=Mc(0,mo,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{Ct.layout--},onComplete:()=>{Ct.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(mo),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Co(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||oe();const f=xe(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=xe(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Ce(a,l),lt(a,u),Dt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Uc),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(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:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&cr("z",o,c,this.animationValues);for(let u=0;u<ur.length;u++)cr(`rotate${ur[u]}`,o,c,this.animationValues),cr(`skew${ur[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 a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return zc;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=zt(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=zt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!qe(this.latestValues)&&(y.transform=u?u({},""):"none",this.hasProjected=!1),y}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=Wc(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:m,y:v}=this.projectionDelta;c.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,f.animationValues?c.opacity=f===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l: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 mt){if(h[y]===void 0)continue;const{correct:S,applyTo:b,isCSSVariable:P}=mt[y],C=c.transform==="none"?h[y]:S(h[y],f);if(b){const V=b.length;for(let g=0;g<V;g++)c[b[g]]=C}else P?this.options.visualElement.renderState.vars[y]=C:c[y]=C}return this.options.layoutId&&(c.pointerEvents=f===this?zt(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(vo),this.root.sharedNodes.clear()}}}function Kc(e){e.updateLayout()}function qc(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:s}=e.layout,{animationType:i}=e.options,o=n.source!==e.layout.source;i==="size"?Pe(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=xe(h);h.min=r[f].min,h.max=h.min+m}):Co(i,n.layoutBox,r)&&Pe(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=xe(r[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const a=ot();Dt(a,r,n.layoutBox);const l=ot();o?Dt(l,e.applyTransform(s,!0),n.measuredBox):Dt(l,r,n.layoutBox);const c=!lo(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const v=oe();Rt(v,n.layoutBox,h.layoutBox);const y=oe();Rt(y,r,m.layoutBox),fo(v,y)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=v,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Gc(e){Ie.value&&Ge.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 Hc(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Xc(e){e.clearSnapshot()}function vo(e){e.clearMeasurements()}function Zc(e){e.isLayoutDirty=!1}function Jc(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function xo(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Qc(e){e.resolveTargetDelta()}function ef(e){e.calcProjection()}function tf(e){e.resetSkewAndRotation()}function nf(e){e.removeLeadSnapshot()}function bo(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 To(e,t,n,r){e.min=ne(t.min,n.min,r),e.max=ne(t.max,n.max,r)}function rf(e,t,n,r){To(e.x,t.x,n.x,r),To(e.y,t.y,n.y,r)}function sf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const of={duration:.45,ease:[.4,0,.1,1]},wo=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),So=wo("applewebkit/")&&!wo("chrome/")?Math.round:Se;function Po(e){e.min=So(e.min),e.max=So(e.max)}function af(e){Po(e.x),Po(e.y)}function Co(e,t,n){return e==="position"||e==="preserve-aspect"&&!lc(ho(t),ho(n),.2)}function lf(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const uf=yo({attachResizeListener:(e,t)=>At(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),fr={current:void 0},Eo=yo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!fr.current){const e=new uf({});e.mount(window),e.setOptions({layoutScroll:!0}),fr.current=e}return fr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),cf={pan:{Feature:Cc},drag:{Feature:Pc,ProjectionNode:Eo,MeasureLayout:Xi}};function jo(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&te.postRender(()=>i(t,Mt(t)))}class ff extends $e{mount(){const{current:t}=this.node;t&&(this.unmount=ll(t,(n,r)=>(jo(this.node,r,"Start"),s=>jo(this.node,s,"End"))))}unmount(){}}class df extends $e{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=Et(At(this.node.current,"focus",()=>this.onFocus()),At(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ao(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 s="onTap"+(n==="End"?"":n),i=r[s];i&&te.postRender(()=>i(t,Mt(t)))}class hf extends $e{mount(){const{current:t}=this.node;t&&(this.unmount=dl(t,(n,r)=>(Ao(this.node,r,"Start"),(s,{success:i})=>Ao(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const dr=new WeakMap,hr=new WeakMap,pf=e=>{const t=dr.get(e.target);t&&t(e)},mf=e=>{e.forEach(pf)};function gf({root:e,...t}){const n=e||document;hr.has(n)||hr.set(n,{});const r=hr.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(mf,{root:e,...t})),r[s]}function yf(e,t,n){const r=gf(t);return dr.set(e,n),r.observe(e),()=>{dr.delete(e),r.unobserve(e)}}const vf={some:0,all:1};class xf extends $e{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:vf[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,i&&!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(l)};return yf(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(bf(t,n))&&this.startObserver()}unmount(){}}function bf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Tf={inView:{Feature:xf},tap:{Feature:hf},focus:{Feature:df},hover:{Feature:ff}},wf={layout:{ProjectionNode:Eo,MeasureLayout:Xi}},pr={current:null},Mo={current:!1};function Sf(){if(Mo.current=!0,!!ln)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>pr.current=e.matches;e.addListener(t),t()}else pr.current=!1}const Pf=[...ni,ye,Be],Cf=e=>Pf.find(ti(e)),Ef=new WeakMap;function jf(e,t,n){for(const r in t){const s=t[r],i=n[r];if(ge(s))e.addValue(r,s),process.env.NODE_ENV==="development"&&Ft(s.version==="12.4.7",`Attempting to mix Motion versions ${s.version} with 12.4.7 may not work as expected.`);else if(ge(i))e.addValue(r,Tt(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,Tt(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Do=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Af{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=qn,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 m=Re.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,te.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=Ut(n),this.isVariantNode=Xr(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const v=h[m];l[m]!==void 0&&ge(v)&&v.set(l[m],!1)}}mount(t){this.current=t,Ef.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)),Mo.current||Sf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:pr.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(),Ne(this.notifyUpdate),Ne(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=We.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&te.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),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 Qe){const n=Qe[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):oe()}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<Do.length;r++){const s=Do[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=jf(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=Tt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=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 s!=null&&(typeof s=="string"&&(Qs(s)||Bs(s))?s=parseFloat(s):!Cf(s)&&Be.test(n)&&(s=qs(t,n)),this.setBaseTarget(t,ge(s)?s.get():s)),ge(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=Sn(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ge(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new kn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Ro extends Af{constructor(){super(...arguments),this.KeyframeResolver=si}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;ge(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Mf(e){return window.getComputedStyle(e)}class Df extends Ro{constructor(){super(...arguments),this.type="html",this.renderInstance=ds}readValueFromInstance(t,n){if(We.has(n)){const r=zn(n);return r&&r.default||0}else{const r=Mf(t),s=(mn(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Fi(t,n)}build(t,n,r){vn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Cn(t,n,r)}}class Rf extends Ro{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=oe,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&fs(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(We.has(n)){const r=zn(n);return r&&r.default||0}return n=hs.has(n)?n:hn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return ms(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&te.postRender(this.updateDimensions)}build(t,n,r){Tn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){ps(t,n,r,s)}mount(t){this.isSVGTag=wn(t.tagName),super.mount(t)}}const Vf=(e,t)=>bn(e)?new Rf(t):new Df(t,{allowProjection:e!==x.Fragment}),Of=tl({...ec,...Tf,...cf,...wf},Vf),mr=va(Of),Lf=({isOpen:e,onClose:t,onConfirm:n,header:r,question:s})=>e?p.exports.jsx("div",{id:"default-modal",tabIndex:-1,"aria-hidden":"true",className:"absolute 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:p.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:p.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[p.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:[p.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),p.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:[p.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:p.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),p.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),p.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:p.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[s," "]})}),p.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[p.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 "}),p.exports.jsx("button",{onClick:t,type:"button",className:"py-2.5 px-5 ml-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,kf=({items:e,isVisible:t,position:n,messageId:r,isCurrentUserMessage:s})=>{const i=x.useRef(null),[o,a]=x.useState(!1);return x.useEffect(()=>(i.current||(i.current=document.createElement("div"),i.current.style.zIndex="1500",i.current.style.position="fixed",i.current.style.top="0",i.current.style.left="0",i.current.style.width="100%",i.current.style.height="100%",i.current.style.pointerEvents="none",document.body.appendChild(i.current)),a(!0),()=>{i.current&&!t&&(document.body.removeChild(i.current),i.current=null)}),[t]),!i.current||!o?null:Ue.createPortal(p.exports.jsx(Wr,{children:t&&p.exports.jsx(mr.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-50 bg-white shadow-lg rounded-md p-2 px-1 w-42 pointer-events-auto",style:{top:n.y,left:n.x},children:e.map((l,c)=>l!=null&&l.onlyCurrentUserMessage&&!s?null:p.exports.jsxs("button",{disabled:l==null?void 0:l.disabled,className:"cursor-pointer flex items-center gap-2 w-full rounded-md text-left px-2 py-1 disabled:opacity-20 hover:bg-gray-200",onClick:()=>l.onClick(r),children:[x.cloneElement(l.icon,{className:"text-black",size:18}),p.exports.jsx("span",{className:"ml-2 text-black",children:l.name})]},c))})}),i.current)},_f=e=>{const t=Math.floor(e/60),n=e%60;return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},If=()=>p.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.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"})}),Nf=()=>p.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.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"})}),gr=()=>p.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.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"})}),en=e=>p.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:p.exports.jsxs("g",{fill:"none",children:[p.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"}),p.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"}),p.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"}),p.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"})]})}),Ff=({onSendMessage:e,onEditMessage:t,onSendVoice:n,onImageSend:r,onVideoSend:s,onFileSend:i,dynamicSymbolAssignments:o,messageToEdit:a,setMessageToEdit:l})=>{const[c,u]=x.useState(""),[f,h]=x.useState(!1),[m,v]=x.useState(0),[y,S]=x.useState(null),[b,P]=x.useState(null),[C,V]=x.useState(0),g=x.useRef(null),O=x.useRef([]),_=x.useRef(null),L=x.useRef(null),k=x.useRef(null),[U,Q]=x.useState(!1),de=D=>{const E=D.target.value;console.log("Input",E),a?l(I=>I?new Xe({...I,text:E,isEdited:!0}):void 0):u(E);const R=E.match(/(\S+)$/);ce(R)},ce=D=>{if(D){const E=D[0];if(y){const R=D[0].split(y)[1];P(R)}o!=null&&o.some(R=>R.symbol===E)&&S(E)}else S(null)},ie=(D,E)=>{a?l(R=>R?new Xe({...R,text:R.text+E+" "}):void 0):u(R=>R+E+" "),S(null),L.current.focus()},K=()=>{if(a){if(a.text.trim()==="")return;t(a),l(void 0)}else{if(c.trim()==="")return;e(c),u("")}S(null)},ae=async()=>{h(!0),v(0),O.current=[],_.current=setInterval(()=>{v(R=>R+1)},1e3);const D=await navigator.mediaDevices.getUserMedia({audio:!0}),E=new MediaRecorder(D);g.current=E,E.ondataavailable=R=>{R.data.size>0&&O.current.push(R.data)},E.onstop=()=>{clearInterval(_.current);const R=new Blob(O.current,{type:"audio/mp3"});n(R),h(!1)},E.start()},H=()=>{var D;(D=g.current)==null||D.stop()},le=D=>{const{scrollTop:E,scrollHeight:R,clientHeight:I}=D.currentTarget;if(E>C){if(E+I>=R-1){const F=o==null?void 0:o.find(Y=>Y.symbol===y);F&&(F!=null&&F.updatePageNumber)&&(Q(!0),F==null||F.updatePageNumber(F.pagNumber+1),V(E),setTimeout(()=>{Q(!1)},500))}}else V(E)},be=new Set(["jpeg","png","gif","webp","bmp","svg+xml","tiff","x-icon"]),T=new Set(["mp4","webm","ogg","mpeg","quicktime","x-msvideo","x-ms-wmv","3gpp","3gpp2"]),M=()=>{var D;(D=k.current)==null||D.click()},z=D=>{var I,N;const E=(I=D.target.files)==null?void 0:I[0];if(!E)return;let R="";if(E.type){const F=E.type.split("/");F.length===2&&(R=F[1])}R||(R=((N=E.name.split(".").pop())==null?void 0:N.toLowerCase())||""),be.has(R)?r(E):T.has(R)?s(E):i(E)};return p.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[f?p.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[p.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:_f(m)}),p.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:H,children:p.exports.jsx(gr,{})})]}):a?p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] relative ",children:[p.exports.jsxs("div",{className:"flex justify-between items-center px-2 h-12 bottom-10 absolute w-full border-t border-x border-gray-300 bg-white rounded-t-lg ",children:[p.exports.jsx("span",{className:"text-gray-400 whitespace-nowrap truncate",children:a.text}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700 -mt-4",onClick:()=>l(void 0),children:"✕"})]}),p.exports.jsx("input",{type:"text",ref:L,className:"w-full bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-bl-3xl ",placeholder:"Type a message...",value:a.text,onChange:de,onKeyDown:D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),K())}}),p.exports.jsx(en,{className:"rotate-180 absolute -right-[11.4px] top-5"})]}),p.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:K,children:p.exports.jsx(gr,{})})]}):p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] relative ",children:[p.exports.jsx("div",{onClick:M,className:"cursor-pointer absolute right-4 top-[11px]",children:p.exports.jsx(If,{})}),p.exports.jsx("input",{type:"file",ref:k,style:{display:"none"},onChange:z}),p.exports.jsx("input",{type:"text",ref:L,className:"w-full bg-white flex-1 p-2 pr-10 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl ",placeholder:"Type a message...",value:c,onChange:de,onKeyDown:D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),K())}}),p.exports.jsx(en,{className:"rotate-180 absolute -right-[11.4px] top-5"})]}),p.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:c?K:ae,children:c?p.exports.jsx(gr,{}):p.exports.jsx(Nf,{})})]}),y&&p.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:le,children:[p.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[p.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",p.exports.jsx("span",{className:"text-blue-500",children:y})]}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>S(null),children:"✕"})]}),p.exports.jsxs("div",{className:"space-y-2",children:[o?o.filter(D=>D.symbol===y).map(D=>{var I;const{component:E,lists:R}=D;return E?b?(I=R==null?void 0:R.filter(N=>N==null?void 0:N.name.includes(b)))==null?void 0:I.map((N,F)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(E,{listsProps:N,onClick:(Y,W)=>ie(Y,W)})},F)):R==null?void 0:R.map((N,F)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(E,{listsProps:N,onClick:(Y,W)=>ie(Y,W)})},F)):null}):null,p.exports.jsx("div",{className:"h-8",children:U&&"Loading more items..."})]})]})]})};var Ve=(e=>(e[e.File=0]="File",e[e.Voice=1]="Voice",e[e.Video=2]="Video",e[e.Image=3]="Image",e))(Ve||{}),se=(e=>(e[e.Telegram=0]="Telegram",e[e.Simple=1]="Simple",e))(se||{});const Vo=({fileName:e,fileSize:t,format:n,src:r,them:s})=>{const i=()=>{const a={rar:p.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:p.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:p.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:p.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:p.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),txt:p.exports.jsx("p",{className:"p-2 text-purple-500 font-bold",children:n}),xls:p.exports.jsx("p",{className:"p-2 text-green-400 font-bold",children:n}),ppt:p.exports.jsx("p",{className:"p-2 text-yellow-500 font-bold",children:n}),png:p.exports.jsx("p",{className:"p-2 text-pink-500 font-bold",children:n}),jpg:p.exports.jsx("p",{className:"p-2 text-indigo-500 font-bold",children:n}),mp3:p.exports.jsx("p",{className:"p-2 text-teal-500 font-bold",children:n}),mp4:p.exports.jsx("p",{className:"p-2 text-gray-500 font-bold",children:n}),exe:p.exports.jsx("p",{className:"p-2 text-red-400 font-bold",children:n}),html:p.exports.jsx("p",{className:"p-2 text-orange-500 font-bold",children:n}),css:p.exports.jsx("p",{className:"p-2 text-blue-300 font-bold",children:n}),js:p.exports.jsx("p",{className:"p-2 text-yellow-400 font-bold",children:n}),json:p.exports.jsx("p",{className:"p-2 text-purple-400 font-bold",children:n}),xml:p.exports.jsx("p",{className:"p-2 text-green-300 font-bold",children:n}),svg:p.exports.jsx("p",{className:"p-2 text-pink-400 font-bold",children:n}),gif:p.exports.jsx("p",{className:"p-2 text-indigo-400 font-bold",children:n}),csv:p.exports.jsx("p",{className:"p-2 text-teal-400 font-bold",children:n}),sql:p.exports.jsx("p",{className:"p-2 text-gray-400 font-bold",children:n})};return n&&a[n]?a[n]:p.exports.jsx("p",{className:"p-2 text-black ",children:n??"UN"})},o=a=>a>1048576?(a/1048576).toFixed(1)+" MB":(a/1024).toFixed(1)+" KB";return p.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[p.exports.jsx("div",{className:` border ${s===se.Simple?" border-white ":s===se.Telegram?" border-green-900":""} w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3`,children:i()}),p.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[p.exports.jsx("a",{href:r,download:e,className:`${s===se.Simple?"text-white":s===se.Telegram?"text-gray-900":""} font-medium hover:underline`,children:e}),p.exports.jsx("span",{className:`${s===se.Simple?"text-gray-800":s===se.Telegram?"text-gray-900":""} text-sm`,children:o(t)})]}),p.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"})]})},Bf=e=>p.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:p.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),$f=e=>p.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:[p.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),p.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let Ot=null;const Uf=({src:e,className:t})=>{const[n,r]=x.useState(!1),[s,i]=x.useState(0),o=x.useRef(null);x.useEffect(()=>{const l=o.current;if(!l)return;const c=()=>{i(l.currentTime/l.duration*100)},u=()=>r(!0),f=()=>r(!1),h=()=>{r(!1),i(0)};return l.addEventListener("timeupdate",c),l.addEventListener("play",u),l.addEventListener("pause",f),l.addEventListener("ended",h),()=>{l.removeEventListener("timeupdate",c),l.removeEventListener("play",u),l.removeEventListener("pause",f),l.removeEventListener("ended",h)}},[]);const a=()=>{const l=o.current;l&&(n?l.pause():(Ot&&Ot!==l&&(Ot.pause(),Ot.currentTime=0),l.play(),Ot=l))};return p.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[p.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:a,children:n?p.exports.jsx($f,{}):p.exports.jsx(Bf,{})}),p.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:p.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${s}%`}})}),p.exports.jsx("audio",{ref:o,src:e})]})},Wf=({attachmentUrl:e,attachmentType:t,attachmentFormat:n,them:r})=>e?t===Ve.Voice?p.exports.jsx("div",{className:"w-full",children:p.exports.jsx(Uf,{src:e})}):t===Ve.Image?p.exports.jsx("div",{className:"w-full",children:p.exports.jsx("img",{src:e})}):t===Ve.File?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Vo,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e})}):t===Ve.Video?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Vo,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e})}):null:null,zf=({message:e,showUserProfile:t,handleContextMenu:n,media:r,them:s})=>{var i,o,a,l,c,u,f,h,m,v;return p.exports.jsxs(p.exports.Fragment,{children:[t?p.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,p.exports.jsxs(mr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:y=>n(y,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 ${s===se.Simple?"bg-[#f8fbff]":s===se.Telegram?"bg-blue-200 ":""} `,children:[p.exports.jsx("span",{title:(i=e.user)!=null&&i.fullName&&((a=(o=e.user)==null?void 0:o.fullName)==null?void 0:a.length)>16?(l=e.user)==null?void 0:l.firstName:(c=e.user)==null?void 0:c.fullName,className:"relative -top-3 h-4 -mb-3 overflow-y-visible text-xs text-orange-700 whitespace-nowrap truncate max-w-[100px] overflow-visible",children:(u=e.user)!=null&&u.fullName&&((h=(f=e.user)==null?void 0:f.fullName)==null?void 0:h.length)>16?(m=e.user)==null?void 0:m.firstName:(v=e.user)==null?void 0:v.fullName}),r||null,p.exports.jsx("span",{children:e.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]}),e.isEdited?p.exports.jsx("span",{className:`text-xs italic ${s===se.Simple?"text-gray-700":s===se.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(en,{className:` ${s===se.Simple?"[&>g>path]:fill-[#f8fbff]":s===se.Telegram?"[&>g>path]:fill-blue-200":""} -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 `})]})]})},Yf=({className:e})=>p.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[p.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"}),p.exports.jsx("path",{fillRule:"evenodd",clipRule:"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"})]}),Oo=({size:e=24,color:t="text-current",className:n})=>p.exports.jsx("div",{className:` ${n} animate-spin inline-flex items-center justify-center`,children:p.exports.jsxs("svg",{width:e,height:e,viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[p.exports.jsx("defs",{children:p.exports.jsxs("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:"linearGradient-1",children:[p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),p.exports.jsx("stop",{stopColor:"currentColor",offset:"100%"})]})}),p.exports.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[p.exports.jsx("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),p.exports.jsx("path",{d:"M34,18 C34,9.163444 26.836556,2 18,2 C11.6597233,2 6.18078805,5.68784135 3.59122325,11.0354951",stroke:"url(#linearGradient-1)",strokeWidth:"4",strokeLinecap:"round"})]})]})}),Kf=({handleContextMenu:e,media:t,message:n,them:r})=>p.exports.jsxs(mr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:s=>e(s,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 ${r===se.Telegram?" bg-green-200":se.Simple?" bg-[#4F46E5] text-white":""}`,children:[t||null,p.exports.jsx("span",{className:"",children:n.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),n.isSending?p.exports.jsx(Oo,{size:13,color:"text-black"}):p.exports.jsx(Yf,{className:r===se.Telegram?" ":se.Simple?" [&>path]:fill-white":""}),n.isEdited?p.exports.jsx("span",{className:`text-xs italic ${r===se.Simple?"text-gray-200":r===se.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(en,{className:`fill-blue-200 rotate-180 absolute -right-2 bottom-0 ${r===se.Telegram?"[&>g>path]:fill-green-200":se.Simple?"[&>g>path]:fill-[#4F46E5]":""} `})]});var pe={exports:{}},yr={exports:{}},Z={};var Lo;function qf(){if(Lo)return Z;Lo=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,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=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,m=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,P=e?Symbol.for("react.scope"):60119;function C(g){if(typeof g=="object"&&g!==null){var O=g.$$typeof;switch(O){case t:switch(g=g.type,g){case l:case c:case r:case i:case s:case f:return g;default:switch(g=g&&g.$$typeof,g){case a:case u:case v:case m:case o:return g;default:return O}}case n:return O}}}function V(g){return C(g)===c}return Z.AsyncMode=l,Z.ConcurrentMode=c,Z.ContextConsumer=a,Z.ContextProvider=o,Z.Element=t,Z.ForwardRef=u,Z.Fragment=r,Z.Lazy=v,Z.Memo=m,Z.Portal=n,Z.Profiler=i,Z.StrictMode=s,Z.Suspense=f,Z.isAsyncMode=function(g){return V(g)||C(g)===l},Z.isConcurrentMode=V,Z.isContextConsumer=function(g){return C(g)===a},Z.isContextProvider=function(g){return C(g)===o},Z.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===t},Z.isForwardRef=function(g){return C(g)===u},Z.isFragment=function(g){return C(g)===r},Z.isLazy=function(g){return C(g)===v},Z.isMemo=function(g){return C(g)===m},Z.isPortal=function(g){return C(g)===n},Z.isProfiler=function(g){return C(g)===i},Z.isStrictMode=function(g){return C(g)===s},Z.isSuspense=function(g){return C(g)===f},Z.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===r||g===c||g===i||g===s||g===f||g===h||typeof g=="object"&&g!==null&&(g.$$typeof===v||g.$$typeof===m||g.$$typeof===o||g.$$typeof===a||g.$$typeof===u||g.$$typeof===S||g.$$typeof===b||g.$$typeof===P||g.$$typeof===y)},Z.typeOf=C,Z}var J={};var ko;function Gf(){return ko||(ko=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,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=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,m=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,P=e?Symbol.for("react.scope"):60119;function C(A){return typeof A=="string"||typeof A=="function"||A===r||A===c||A===i||A===s||A===f||A===h||typeof A=="object"&&A!==null&&(A.$$typeof===v||A.$$typeof===m||A.$$typeof===o||A.$$typeof===a||A.$$typeof===u||A.$$typeof===S||A.$$typeof===b||A.$$typeof===P||A.$$typeof===y)}function V(A){if(typeof A=="object"&&A!==null){var Ee=A.$$typeof;switch(Ee){case t:var ut=A.type;switch(ut){case l:case c:case r:case i:case s:case f:return ut;default:var He=ut&&ut.$$typeof;switch(He){case a:case u:case v:case m:case o:return He;default:return Ee}}case n:return Ee}}}var g=l,O=c,_=a,L=o,k=t,U=u,Q=r,de=v,ce=m,ie=n,K=i,ae=s,H=f,le=!1;function be(A){return le||(le=!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(A)||V(A)===l}function T(A){return V(A)===c}function M(A){return V(A)===a}function z(A){return V(A)===o}function D(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function E(A){return V(A)===u}function R(A){return V(A)===r}function I(A){return V(A)===v}function N(A){return V(A)===m}function F(A){return V(A)===n}function Y(A){return V(A)===i}function W(A){return V(A)===s}function ve(A){return V(A)===f}J.AsyncMode=g,J.ConcurrentMode=O,J.ContextConsumer=_,J.ContextProvider=L,J.Element=k,J.ForwardRef=U,J.Fragment=Q,J.Lazy=de,J.Memo=ce,J.Portal=ie,J.Profiler=K,J.StrictMode=ae,J.Suspense=H,J.isAsyncMode=be,J.isConcurrentMode=T,J.isContextConsumer=M,J.isContextProvider=z,J.isElement=D,J.isForwardRef=E,J.isFragment=R,J.isLazy=I,J.isMemo=N,J.isPortal=F,J.isProfiler=Y,J.isStrictMode=W,J.isSuspense=ve,J.isValidElementType=C,J.typeOf=V}()),J}var _o;function Io(){return _o||(_o=1,function(e){process.env.NODE_ENV==="production"?e.exports=qf():e.exports=Gf()}(yr)),yr.exports}var vr,No;function Hf(){if(No)return vr;No=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function s(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var o={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(u){return o[u]});if(l.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 vr=s()?Object.assign:function(i,o){for(var a,l=r(i),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){c=e(a);for(var h=0;h<c.length;h++)n.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},vr}var xr,Fo;function br(){if(Fo)return xr;Fo=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return xr=e,xr}var Tr,Bo;function $o(){return Bo||(Bo=1,Tr=Function.call.bind(Object.prototype.hasOwnProperty)),Tr}var wr,Uo;function Xf(){if(Uo)return wr;Uo=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=br(),n={},r=$o();e=function(i){var o="Warning: "+i;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(i,o,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var f;try{if(typeof i[u]!="function"){var h=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=i[u](o,u,l,a,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+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 m=c?c():"";e("Failed "+a+" type: "+f.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},wr=s,wr}var Sr,Wo;function Zf(){if(Wo)return Sr;Wo=1;var e=Io(),t=Hf(),n=br(),r=$o(),s=Xf(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return Sr=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(T){var M=T&&(c&&T[c]||T[u]);if(typeof M=="function")return M}var h="<<anonymous>>",m={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:P(),arrayOf:C,element:V(),elementType:g(),instanceOf:O,node:U(),objectOf:L,oneOf:_,oneOfType:k,shape:de,exact:ce};function v(T,M){return T===M?T!==0||1/T===1/M:T!==T&&M!==M}function y(T,M){this.message=T,this.data=M&&typeof M=="object"?M:{},this.stack=""}y.prototype=Error.prototype;function S(T){if(process.env.NODE_ENV!=="production")var M={},z=0;function D(R,I,N,F,Y,W,ve){if(F=F||h,W=W||N,ve!==n){if(l){var A=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 A.name="Invariant Violation",A}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Ee=F+":"+N;!M[Ee]&&z<3&&(i("You are manually calling a React.PropTypes validation function for the `"+W+"` prop on `"+F+"`. 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."),M[Ee]=!0,z++)}}return I[N]==null?R?I[N]===null?new y("The "+Y+" `"+W+"` is marked as required "+("in `"+F+"`, but its value is `null`.")):new y("The "+Y+" `"+W+"` is marked as required in "+("`"+F+"`, but its value is `undefined`.")):null:T(I,N,F,Y,W)}var E=D.bind(null,!1);return E.isRequired=D.bind(null,!0),E}function b(T){function M(z,D,E,R,I,N){var F=z[D],Y=ae(F);if(Y!==T){var W=H(F);return new y("Invalid "+R+" `"+I+"` of type "+("`"+W+"` supplied to `"+E+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return S(M)}function P(){return S(o)}function C(T){function M(z,D,E,R,I){if(typeof T!="function")return new y("Property `"+I+"` of component `"+E+"` has invalid PropType notation inside arrayOf.");var N=z[D];if(!Array.isArray(N)){var F=ae(N);return new y("Invalid "+R+" `"+I+"` of type "+("`"+F+"` supplied to `"+E+"`, expected an array."))}for(var Y=0;Y<N.length;Y++){var W=T(N,Y,E,R,I+"["+Y+"]",n);if(W instanceof Error)return W}return null}return S(M)}function V(){function T(M,z,D,E,R){var I=M[z];if(!a(I)){var N=ae(I);return new y("Invalid "+E+" `"+R+"` of type "+("`"+N+"` supplied to `"+D+"`, expected a single ReactElement."))}return null}return S(T)}function g(){function T(M,z,D,E,R){var I=M[z];if(!e.isValidElementType(I)){var N=ae(I);return new y("Invalid "+E+" `"+R+"` of type "+("`"+N+"` supplied to `"+D+"`, expected a single ReactElement type."))}return null}return S(T)}function O(T){function M(z,D,E,R,I){if(!(z[D]instanceof T)){var N=T.name||h,F=be(z[D]);return new y("Invalid "+R+" `"+I+"` of type "+("`"+F+"` supplied to `"+E+"`, expected ")+("instance of `"+N+"`."))}return null}return S(M)}function _(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("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])."):i("Invalid argument supplied to oneOf, expected an array.")),o;function M(z,D,E,R,I){for(var N=z[D],F=0;F<T.length;F++)if(v(N,T[F]))return null;var Y=JSON.stringify(T,function(ve,A){var Ee=H(A);return Ee==="symbol"?String(A):A});return new y("Invalid "+R+" `"+I+"` of value `"+String(N)+"` "+("supplied to `"+E+"`, expected one of "+Y+"."))}return S(M)}function L(T){function M(z,D,E,R,I){if(typeof T!="function")return new y("Property `"+I+"` of component `"+E+"` has invalid PropType notation inside objectOf.");var N=z[D],F=ae(N);if(F!=="object")return new y("Invalid "+R+" `"+I+"` of type "+("`"+F+"` supplied to `"+E+"`, expected an object."));for(var Y in N)if(r(N,Y)){var W=T(N,Y,E,R,I+"."+Y,n);if(W instanceof Error)return W}return null}return S(M)}function k(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var M=0;M<T.length;M++){var z=T[M];if(typeof z!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+le(z)+" at index "+M+"."),o}function D(E,R,I,N,F){for(var Y=[],W=0;W<T.length;W++){var ve=T[W],A=ve(E,R,I,N,F,n);if(A==null)return null;A.data&&r(A.data,"expectedType")&&Y.push(A.data.expectedType)}var Ee=Y.length>0?", expected one of type ["+Y.join(", ")+"]":"";return new y("Invalid "+N+" `"+F+"` supplied to "+("`"+I+"`"+Ee+"."))}return S(D)}function U(){function T(M,z,D,E,R){return ie(M[z])?null:new y("Invalid "+E+" `"+R+"` supplied to "+("`"+D+"`, expected a ReactNode."))}return S(T)}function Q(T,M,z,D,E){return new y((T||"React class")+": "+M+" type `"+z+"."+D+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+E+"`.")}function de(T){function M(z,D,E,R,I){var N=z[D],F=ae(N);if(F!=="object")return new y("Invalid "+R+" `"+I+"` of type `"+F+"` "+("supplied to `"+E+"`, expected `object`."));for(var Y in T){var W=T[Y];if(typeof W!="function")return Q(E,R,I,Y,H(W));var ve=W(N,Y,E,R,I+"."+Y,n);if(ve)return ve}return null}return S(M)}function ce(T){function M(z,D,E,R,I){var N=z[D],F=ae(N);if(F!=="object")return new y("Invalid "+R+" `"+I+"` of type `"+F+"` "+("supplied to `"+E+"`, expected `object`."));var Y=t({},z[D],T);for(var W in Y){var ve=T[W];if(r(T,W)&&typeof ve!="function")return Q(E,R,I,W,H(ve));if(!ve)return new y("Invalid "+R+" `"+I+"` key `"+W+"` supplied to `"+E+"`.\nBad object: "+JSON.stringify(z[D],null," ")+`
20
- Valid keys: `+JSON.stringify(Object.keys(T),null," "));var A=ve(N,W,E,R,I+"."+W,n);if(A)return A}return null}return S(M)}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||a(T))return!0;var M=f(T);if(M){var z=M.call(T),D;if(M!==T.entries){for(;!(D=z.next()).done;)if(!ie(D.value))return!1}else for(;!(D=z.next()).done;){var E=D.value;if(E&&!ie(E[1]))return!1}}else return!1;return!0;default:return!1}}function K(T,M){return T==="symbol"?!0:M?M["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&M instanceof Symbol:!1}function ae(T){var M=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":K(M,T)?"symbol":M}function H(T){if(typeof T>"u"||T===null)return""+T;var M=ae(T);if(M==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return M}function le(T){var M=H(T);switch(M){case"array":case"object":return"an "+M;case"boolean":case"date":case"regexp":return"a "+M;default:return M}}function be(T){return!T.constructor||!T.constructor.name?h:T.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},Sr}var Pr,zo;function Jf(){if(zo)return Pr;zo=1;var e=br();function t(){}function n(){}return n.resetWarningCache=t,Pr=function(){function r(o,a,l,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 s(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Pr}if(process.env.NODE_ENV!=="production"){var Qf=Io(),ed=!0;pe.exports=Zf()(Qf.isElement,ed)}else pe.exports=Jf()();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 td(e,t){if(e==null)return{};var n=nd(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nd(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Er=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=td(e,["color","size"]);return x.createElement("svg",Cr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,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"}))});Er.propTypes={color:pe.exports.string,size:pe.exports.oneOfType([pe.exports.string,pe.exports.number])},Er.displayName="Check";const rd=Er;function jr(){return jr=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},jr.apply(this,arguments)}function sd(e,t){if(e==null)return{};var n=id(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(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),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Ar=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=sd(e,["color","size"]);return x.createElement("svg",jr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,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"}))});Ar.propTypes={color:pe.exports.string,size:pe.exports.oneOfType([pe.exports.string,pe.exports.number])},Ar.displayName="Copy";const od=Ar;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 ad(e,t){if(e==null)return{};var n=ld(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ld(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Dr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=ad(e,["color","size"]);return x.createElement("svg",Mr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,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"}))});Dr.propTypes={color:pe.exports.string,size:pe.exports.oneOfType([pe.exports.string,pe.exports.number])},Dr.displayName="Edit";const ud=Dr;function Rr(){return Rr=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},Rr.apply(this,arguments)}function cd(e,t){if(e==null)return{};var n=fd(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fd(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Vr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=cd(e,["color","size"]);return x.createElement("svg",Rr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,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"}))});Vr.propTypes={color:pe.exports.string,size:pe.exports.oneOfType([pe.exports.string,pe.exports.number])},Vr.displayName="Trash";const dd=Vr,hd=({user:e,messages:t,updateMessages:n,onMessageSent:r,onEditMessage:s,isSendingDefultForNewMessage:i,onDeleteMessage:o})=>{const a=x.useRef(null),[l,c]=x.useState(!1),[u,f]=x.useState(null),[h,m]=x.useState(),[v,y]=x.useState(null),S=()=>{setTimeout(()=>{a.current&&(a.current.scrollTop=a.current.scrollHeight)},100)};x.useEffect(()=>{const k=()=>{y(null)};return window.addEventListener("scroll",k,!0),()=>{window.removeEventListener("scroll",k,!0)}},[y]);const b=(k,U)=>{k.preventDefault();const Q=window.scrollX,de=window.scrollY;y({x:k.clientX+Q,y:k.clientY+de,message:U})},P=()=>{y(null)},C=k=>{const U=new Xe({id:new Date().toString(),text:k,user:e,isRightSided:!0,isSending:i,createdDate:new Date().toString()});n([...t,U]),r(U),S()},V=k=>{n(t.map(U=>U.id===k.id?k:U)),s(k)},g=k=>{const U=URL.createObjectURL(k),Q=new Xe({id:new Date().toString(),text:"",attachmentUrl:U,attachmentType:Ve.Voice,attachmentBlob:k,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,Q]),r(Q),S()},O=(k,U)=>{const Q=URL.createObjectURL(k),de=new Xe({id:new Date().toString(),text:"",attachmentUrl:Q,attachmentBlob:k,attachmentType:U,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,de]),r(de),S()};return{handleDeleteConfirmation:()=>{u&&(o(u),f(null)),c(!1)},handleCloseContextMenu:P,contextMenuItems:[{name:"Edit",icon:p.exports.jsx(ud,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:k=>{m(t.find(U=>U.id===k)),P()}},{name:"Delete",icon:p.exports.jsx(dd,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:k=>{f(k),c(!0),P()}},{name:"Select",icon:p.exports.jsx(rd,{className:"text-green-600"}),disabled:!0,onClick:()=>{console.log("Select clicked"),P()}},{name:"Copy",icon:p.exports.jsx(od,{className:"text-blue-600"}),onClick:k=>{const U=t.find(Q=>Q.id===k);U&&navigator.clipboard.writeText(U.text),P()}}],handleSendFile:O,handleSendVoice:g,handleSendMessage:C,handleContextMenu:b,isModalOpen:l,contextMenu:v,chatRef:a,setIsModalOpen:c,messageToEdit:h,setMessageToEdit:m,handleEditMessage:V}},pd=({width:e="400px",height:t="600px",isLoadingChat:n,className:r,style:s,messages:i,user:o,updateMessages:a,onMessageSent:l,onDeleteMessage:c,onEditMessage:u,dynamicSymbolAssignments:f,isSendingDefultForNewMessage:h,backgroundImage:m,them:v=se.Telegram})=>{var ce,ie;const{handleDeleteConfirmation:y,handleCloseContextMenu:S,handleSendFile:b,handleSendVoice:P,handleSendMessage:C,handleContextMenu:V,contextMenuItems:g,isModalOpen:O,contextMenu:_,chatRef:L,setIsModalOpen:k,messageToEdit:U,setMessageToEdit:Q,handleEditMessage:de}=hd({user:o,messages:i,updateMessages:a,onMessageSent:l,onEditMessage:u,onDeleteMessage:c,isSendingDefultForNewMessage:h});return p.exports.jsxs("div",{className:`flex flex-col !bg-cover ${r}`,style:{width:e,height:t,background:"url("+m+")",...s},onClick:S,children:[p.exports.jsx("div",{ref:L,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${_?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:n?p.exports.jsx(Oo,{className:"mt-3",size:27,color:"text-gray-800"}):p.exports.jsx(Wr,{children:i.length>0?i.map((K,ae)=>{var be,T,M;const H=K!=null&&K.attachmentUrl?p.exports.jsx(Wf,{attachmentUrl:K.attachmentUrl,attachmentType:K==null?void 0:K.attachmentType,attachmentFormat:K==null?void 0:K.attachmentFormat},ae):null;if(K.isRightSided)return p.exports.jsx(Kf,{media:H,handleContextMenu:V,message:K,them:v},ae);const le=((T=(be=i[ae-1])==null?void 0:be.user)==null?void 0:T.id)!==((M=K==null?void 0:K.user)==null?void 0:M.id);return p.exports.jsx(zf,{showUserProfile:le,media:H,handleContextMenu:V,message:K,them:v},ae)}):null})}),p.exports.jsx(Lf,{isOpen:O,onClose:()=>k(!1),onConfirm:y,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),_&&((ce=_==null?void 0:_.message)!=null&&ce.id)?p.exports.jsx(kf,{items:g,isVisible:Boolean(_),messageId:String(_==null?void 0:_.message.id),isCurrentUserMessage:((ie=_==null?void 0:_.message)==null?void 0:ie.user.id)===o.id,position:{x:_==null?void 0:_.x,y:_==null?void 0:_.y}}):null,p.exports.jsx(Ff,{onSendVoice:P,onSendMessage:C,onFileSend:K=>b(K,Ve.File),onImageSend:K=>b(K,Ve.Image),onVideoSend:K=>b(K,Ve.Video),dynamicSymbolAssignments:f,messageToEdit:U,setMessageToEdit:Q,onEditMessage:de})]})};he.AttachmentTypeEnum=Ve,he.Button=aa,he.Chat=pd,he.ChatThemEntity=se,he.MessageEntity=Xe,Object.defineProperty(he,Symbol.toStringTag,{value:"Module"})});
19
+ `),()=>{document.head.removeChild(m)}},[t]),p.exports.jsx(la,{isPresent:t,childRef:s,sizeRef:i,children:rn.cloneElement(e,{ref:s})})}const ca=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l})=>{const a=on(fa),c=x.useId(),u=x.useCallback(h=>{a.set(h,!0);for(const m of a.values())if(!m)return;r&&r()},[a,r]),f=x.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:h=>(a.set(h,!1),()=>a.delete(h))}),i?[Math.random(),u]:[n,u]);return x.useMemo(()=>{a.forEach((h,m)=>a.set(m,!1))},[n]),rn.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),o==="popLayout"&&(e=p.exports.jsx(ua,{isPresent:n,anchorX:l,children:e})),p.exports.jsx(kt.Provider,{value:f,children:e})};function fa(){return new Map}function Br(e=!0){const t=x.useContext(kt);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=x.useId();x.useEffect(()=>{if(e)return s(i)},[e]);const o=x.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const _t=e=>e.key||"";function $r(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const ln=typeof window<"u",Ur=ln?x.useLayoutEffect:x.useEffect,Wr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left"})=>{const[a,c]=Br(o),u=x.useMemo(()=>$r(e),[e]),f=o&&!a?[]:u.map(_t),h=x.useRef(!0),m=x.useRef(u),v=on(()=>new Map),[y,S]=x.useState(u),[b,P]=x.useState(u);Ur(()=>{h.current=!1,m.current=u;for(let g=0;g<b.length;g++){const O=_t(b[g]);f.includes(O)?v.delete(O):v.get(O)!==!0&&v.set(O,!1)}},[b,f.length,f.join("-")]);const C=[];if(u!==y){let g=[...u];for(let O=0;O<b.length;O++){const Y=b[O],A=_t(Y);f.includes(A)||(g.splice(O,0,Y),C.push(Y))}return i==="wait"&&C.length&&(g=C),P($r(g)),S(u),null}process.env.NODE_ENV!=="production"&&i==="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:L}=x.useContext(sn);return p.exports.jsx(p.exports.Fragment,{children:b.map(g=>{const O=_t(g),Y=o&&!a?!1:u===b||f.includes(O),A=()=>{if(v.has(O))v.set(O,!0);else return;let Q=!0;v.forEach(F=>{F||(Q=!1)}),Q&&(L==null||L(),P(m.current),o&&(c==null||c()),r&&r())};return p.exports.jsx(ca,{isPresent:Y,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,onExitComplete:Y?void 0:A,anchorX:l,children:g},O)})})},we=e=>e;let Ze=we,_e=we;process.env.NODE_ENV!=="production"&&(Ze=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},_e=(e,t)=>{if(!e)throw new Error(t)});function un(e){let t;return()=>(t===void 0&&(t=e()),t)}const Je=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Me=e=>e*1e3,Oe=e=>e/1e3,zr={skipAnimations:!1,useManualTiming:!1},It=["read","resolveKeyframes","update","preRender","render","postRender"],Ie={value:null,addProjectionMetrics:null};function da(e,t){let n=new Set,r=new Set,s=!1,i=!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,m=!1)=>{const y=m&&s?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,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),t&&Ie.value&&Ie.value.frameloop[t].push(a),a=0,n.clear(),s=!1,i&&(i=!1,u.process(f))}};return u}const ha=40;function Yr(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=It.reduce((b,P)=>(b[P]=da(i,t?P:void 0),b),{}),{read:l,resolveKeyframes:a,update:c,preRender:u,render:f,postRender:h}=o,m=()=>{const b=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(b-s.timestamp,ha),1),s.timestamp=b,s.isProcessing=!0,l.process(s),a.process(s),c.process(s),u.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(m))},v=()=>{n=!0,r=!0,s.isProcessing||e(m)};return{schedule:It.reduce((b,P)=>{const C=o[P];return b[P]=(L,g=!1,O=!1)=>(n||v(),C.schedule(L,g,O)),b},{}),cancel:b=>{for(let P=0;P<It.length;P++)o[It[P]].cancel(b)},state:s,steps:o}}const{schedule:te,cancel:Ne,state:me,steps:cn}=Yr(typeof requestAnimationFrame<"u"?requestAnimationFrame:we,!0),Kr=x.createContext({strict:!1}),qr={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"]},Qe={};for(const e in qr)Qe[e]={isEnabled:t=>qr[e].some(n=>!!t[n])};function pa(e){for(const t in e)Qe[t]={...Qe[t],...e[t]}}const ma=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 Nt(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ma.has(e)}let Gr=e=>!Nt(e);function ga(e){e&&(Gr=t=>t.startsWith("on")?!Nt(t):e(t))}try{ga(require("@emotion/is-prop-valid").default)}catch{}function ya(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Gr(s)||n===!0&&Nt(s)||!t&&!Nt(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Hr=new Set;function Ft(e,t,n){e||Hr.has(t)||(console.warn(t),n&&console.warn(n),Hr.add(t))}function va(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,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const Bt=x.createContext({});function $t(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function pt(e){return typeof e=="string"||Array.isArray(e)}const fn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dn=["initial",...fn];function Ut(e){return $t(e.animate)||dn.some(t=>pt(e[t]))}function Xr(e){return Boolean(Ut(e)||e.variants)}function xa(e,t){if(Ut(e)){const{initial:n,animate:r}=e;return{initial:n===!1||pt(n)?n:void 0,animate:pt(r)?r:void 0}}return e.inherit!==!1?t:{}}function ba(e){const{initial:t,animate:n}=xa(e,x.useContext(Bt));return x.useMemo(()=>({initial:t,animate:n}),[Zr(t),Zr(n)])}function Zr(e){return Array.isArray(e)?e.join(" "):e}const Ta=Symbol.for("motionComponentSymbol");function et(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wa(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):et(n)&&(n.current=r))},[t])}const hn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Jr="data-"+hn("framerAppearId"),{schedule:pn,cancel:Fd}=Yr(queueMicrotask,!1),Qr=x.createContext({});function Sa(e,t,n,r,s){var i,o;const{visualElement:l}=x.useContext(Bt),a=x.useContext(Kr),c=x.useContext(kt),u=x.useContext(an).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,m=x.useContext(Qr);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&Pa(f.current,n,s,m);const v=x.useRef(!1);x.useInsertionEffect(()=>{h&&v.current&&h.update(n,c)});const y=n[Jr],S=x.useRef(Boolean(y)&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,y))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,y)));return Ur(()=>{h&&(v.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),pn.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 Pa(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:a,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:es(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:Boolean(o)||l&&et(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:a,layoutRoot:c})}function es(e){if(e)return e.options.allowProjection!==!1?e.projection:es(e.parent)}function Ca({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,o;e&&pa(e);function l(c,u){let f;const h={...x.useContext(an),...c,layoutId:Ea(c)},{isStatic:m}=h,v=ba(c),y=r(c,m);if(!m&&ln){ja(h,e);const S=Aa(h);f=S.MeasureLayout,v.visualElement=Sa(s,y,h,t,S.ProjectionNode)}return p.exports.jsxs(Bt.Provider,{value:v,children:[f&&v.visualElement?p.exports.jsx(f,{visualElement:v.visualElement,...h}):null,n(s,c,wa(y,v.visualElement,u),y,m,v.visualElement)]})}l.displayName=`motion.${typeof s=="string"?s:`create(${(o=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&o!==void 0?o:""})`}`;const a=x.forwardRef(l);return a[Ta]=s,a}function Ea({layoutId:e}){const t=x.useContext(sn).id;return t&&e!==void 0?t+"-"+e:e}function ja(e,t){const n=x.useContext(Kr).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?Ze(!1,r):_e(!1,r)}}function Aa(e){const{drag:t,layout:n}=Qe;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 ts=e=>t=>typeof t=="string"&&t.startsWith(e),mn=ts("--"),Ma=ts("var(--"),gn=e=>Ma(e)?Da.test(e.split("/*")[0].trim()):!1,Da=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,mt={};function Ra(e){for(const t in e)mt[t]=e[t],mn(t)&&(mt[t].isCSSVariable=!0)}const tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],We=new Set(tt);function ns(e,{layout:t,layoutId:n}){return We.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!mt[e]||e==="opacity")}const ge=e=>Boolean(e&&e.getVelocity),rs=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Le=(e,t,n)=>n>t?t:n<e?e:n,nt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gt={...nt,transform:e=>Le(0,1,e)},Wt={...nt,default:1},yt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Fe=yt("deg"),De=yt("%"),N=yt("px"),Va=yt("vh"),Oa=yt("vw"),ss={...De,parse:e=>De.parse(e)/100,transform:e=>De.transform(e*100)},La={borderWidth:N,borderTopWidth:N,borderRightWidth:N,borderBottomWidth:N,borderLeftWidth:N,borderRadius:N,radius:N,borderTopLeftRadius:N,borderTopRightRadius:N,borderBottomRightRadius:N,borderBottomLeftRadius:N,width:N,maxWidth:N,height:N,maxHeight:N,top:N,right:N,bottom:N,left:N,padding:N,paddingTop:N,paddingRight:N,paddingBottom:N,paddingLeft:N,margin:N,marginTop:N,marginRight:N,marginBottom:N,marginLeft:N,backgroundPositionX:N,backgroundPositionY:N},ka={rotate:Fe,rotateX:Fe,rotateY:Fe,rotateZ:Fe,scale:Wt,scaleX:Wt,scaleY:Wt,scaleZ:Wt,skew:Fe,skewX:Fe,skewY:Fe,distance:N,translateX:N,translateY:N,translateZ:N,x:N,y:N,z:N,perspective:N,transformPerspective:N,opacity:gt,originX:ss,originY:ss,originZ:N},is={...nt,transform:Math.round},yn={...La,...ka,zIndex:is,size:N,fillOpacity:gt,strokeOpacity:gt,numOctaves:is},_a={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ia=tt.length;function Na(e,t,n){let r="",s=!0;for(let i=0;i<Ia;i++){const o=tt[i],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=rs(l,yn[o]);if(!a){s=!1;const u=_a[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function vn(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,l=!1;for(const a in t){const c=t[a];if(We.has(a)){o=!0;continue}else if(mn(a)){s[a]=c;continue}else{const u=rs(c,yn[a]);a.startsWith("origin")?(l=!0,i[a]=u):r[a]=u}}if(t.transform||(o||n?r.transform=Na(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:a="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${a} ${c} ${u}`}}const xn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function os(e,t,n){for(const r in t)!ge(t[r])&&!ns(r,n)&&(e[r]=t[r])}function Fa({transformTemplate:e},t){return x.useMemo(()=>{const n=xn();return vn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ba(e,t){const n=e.style||{},r={};return os(r,n,e),Object.assign(r,Fa(e,t)),r}function $a(e,t){const n={},r=Ba(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 Ua=["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 bn(e){return typeof e!="string"||e.includes("-")?!1:!!(Ua.indexOf(e)>-1||/[A-Z]/u.test(e))}const Wa={offset:"stroke-dashoffset",array:"stroke-dasharray"},za={offset:"strokeDashoffset",array:"strokeDasharray"};function Ya(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Wa:za;e[i.offset]=N.transform(-r);const o=N.transform(t),l=N.transform(n);e[i.array]=`${o} ${l}`}function as(e,t,n){return typeof e=="string"?e:N.transform(t+n*e)}function Ka(e,t,n){const r=as(t,e.x,e.width),s=as(n,e.y,e.height);return`${r} ${s}`}function Tn(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:l=1,pathOffset:a=0,...c},u,f){if(vn(e,c,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:v}=e;h.transform&&(v&&(m.transform=h.transform),delete h.transform),v&&(s!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=Ka(v,s!==void 0?s:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&Ya(h,o,l,a,!1)}const ls=()=>({...xn(),attrs:{}}),wn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function qa(e,t,n,r){const s=x.useMemo(()=>{const i=ls();return Tn(i,t,wn(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};os(i,e.style,e),s.style={...i,...s.style}}return s}function Ga(e=!1){return(n,r,s,{latestValues:i},o)=>{const a=(bn(n)?qa:$a)(r,i,o,n),c=ya(r,typeof n=="string",e),u=n!==x.Fragment?{...c,...a,ref:s}:{},{children:f}=r,h=x.useMemo(()=>ge(f)?f.get():f,[f]);return x.createElement(n,{...u,children:h})}}function us(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Sn(e,t,n,r){if(typeof t=="function"){const[s,i]=us(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=us(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const Pn=e=>Array.isArray(e),Ha=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),Xa=e=>Pn(e)?e[e.length-1]||0:e;function zt(e){const t=ge(e)?e.get():e;return Ha(t)?t.toValue():t}function Za({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const o={latestValues:Ja(r,s,i,e),renderState:t()};return n&&(o.onMount=l=>n({props:r,current:l,...o}),o.onUpdate=l=>n(l)),o}const cs=e=>(t,n)=>{const r=x.useContext(Bt),s=x.useContext(kt),i=()=>Za(e,t,r,s);return n?i():on(i)};function Ja(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=zt(i[h]);let{initial:o,animate:l}=e;const a=Ut(e),c=Xr(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"&&!$t(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const v=Sn(e,h[m]);if(v){const{transitionEnd:y,transition:S,...b}=v;for(const P in b){let C=b[P];if(Array.isArray(C)){const L=u?C.length-1:0;C=C[L]}C!==null&&(s[P]=C)}for(const P in y)s[P]=y[P]}}}return s}function Cn(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(ge(s[o])||t.style&&ge(t.style[o])||ns(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}const Qa={useVisualState:cs({scrapeMotionValuesFromProps:Cn,createRenderState:xn})};function fs(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 ds(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const hs=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 ps(e,t,n,r){ds(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(hs.has(s)?s:hn(s),t.attrs[s])}function ms(e,t,n){const r=Cn(e,t,n);for(const s in e)if(ge(e[s])||ge(t[s])){const i=tt.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}const gs=["x","y","width","height","cx","cy","r"],el={useVisualState:cs({scrapeMotionValuesFromProps:ms,createRenderState:ls,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in s)if(We.has(l)){i=!0;break}}if(!i)return;let o=!t;if(t)for(let l=0;l<gs.length;l++){const a=gs[l];e[a]!==t[a]&&(o=!0)}o&&te.read(()=>{fs(n,r),te.render(()=>{Tn(r,s,wn(n.tagName),e.transformTemplate),ps(n,r)})})}})};function tl(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...bn(r)?el:Qa,preloadedFeatures:e,useRender:Ga(s),createVisualElement:t,Component:r};return Ca(o)}}function vt(e,t,n){const r=e.getProps();return Sn(r,t,n!==void 0?n:r.custom,e)}const nl=un(()=>window.ScrollTimeline!==void 0);class rl{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(s=>{if(nl()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].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 sl extends rl{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function En(e,t){return e?e[t]||e.default||e:void 0}const jn=2e4;function ys(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<jn;)t+=n,r=e.next(t);return t>=jn?1/0:t}function An(e){return typeof e=="function"}function vs(e,t){e.timeline=t,e.onfinish=null}const Mn=e=>Array.isArray(e)&&typeof e[0]=="number",il={linearEasing:void 0};function ol(e,t){const n=un(e);return()=>{var r;return(r=il[t])!==null&&r!==void 0?r:n()}}const Yt=ol(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),xs=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=e(Je(0,s-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function bs(e){return Boolean(typeof e=="function"&&Yt()||!e||typeof e=="string"&&(e in Dn||Yt())||Mn(e)||Array.isArray(e)&&e.every(bs))}const xt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Dn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xt([0,.65,.55,1]),circOut:xt([.55,0,1,.45]),backIn:xt([.31,.01,.66,-.59]),backOut:xt([.33,1.53,.69,.99])};function Ts(e,t){if(e)return typeof e=="function"&&Yt()?xs(e,t):Mn(e)?xt(e):Array.isArray(e)?e.map(n=>Ts(n,t)||Dn.easeOut):Dn[e]}const Ae={x:!1,y:!1};function ws(){return Ae.x||Ae.y}function al(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;t&&(s=t.current);const i=(r=n==null?void 0:n[e])!==null&&r!==void 0?r:s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Ss(e,t){const n=al(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Ps(e){return!(e.pointerType==="touch"||ws())}function ll(e,t,n={}){const[r,s,i]=Ss(e,n),o=l=>{if(!Ps(l))return;const{target:a}=l,c=t(a,l);if(typeof c!="function"||!a)return;const u=f=>{Ps(f)&&(c(f),a.removeEventListener("pointerleave",u))};a.addEventListener("pointerleave",u,s)};return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),i}function Kt(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 Cs=(e,t)=>t?e===t?!0:Cs(e,t.parentElement):!1,Rn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,ul=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function cl(e){return ul.has(e.tagName)||e.tabIndex!==-1}const bt=new WeakSet;function Es(e){return t=>{t.key==="Enter"&&e(t)}}function Vn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const fl=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Es(()=>{if(bt.has(n))return;Vn(n,"down");const s=Es(()=>{Vn(n,"up")}),i=()=>Vn(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function js(e){return Rn(e)&&!ws()}function dl(e,t,n={}){const[r,s,i]=Ss(e,n),o=l=>{const a=l.currentTarget;if(!a||!js(l)||bt.has(a))return;bt.add(a),Kt(l,"set");const c=t(a,l),u=(m,v)=>{a.removeEventListener("pointerup",f),a.removeEventListener("pointercancel",h),Kt(m,"release"),!(!js(m)||!bt.has(a))&&(bt.delete(a),typeof c=="function"&&c(m,{success:v}))},f=m=>{(m.isTrusted?hl(m,a instanceof Element?a.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?u(m,!1):u(m,!(a instanceof Element)||Cs(a,m.target))},h=m=>{u(m,!1)};a.addEventListener("pointerup",f,s),a.addEventListener("pointercancel",h,s),a.addEventListener("lostpointercapture",h,s)};return r.forEach(l=>{l=n.useGlobalTarget?window:l;let a=!1;l instanceof HTMLElement&&(a=!0,!cl(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0)),l.addEventListener("pointerdown",o,s),a&&l.addEventListener("focus",c=>fl(c,s),s)}),i}function hl(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function pl(e){return e==="x"||e==="y"?Ae[e]?null:(Ae[e]=!0,()=>{Ae[e]=!1}):Ae.x||Ae.y?null:(Ae.x=Ae.y=!0,()=>{Ae.x=Ae.y=!1})}const As=new Set(["width","height","top","left","right","bottom",...tt]);let qt;function ml(){qt=void 0}const Re={now:()=>(qt===void 0&&Re.set(me.isProcessing||zr.useManualTiming?me.timestamp:performance.now()),qt),set:e=>{qt=e,queueMicrotask(ml)}};function On(e,t){e.indexOf(t)===-1&&e.push(t)}function Ln(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class kn{constructor(){this.subscriptions=[]}add(t){return On(this.subscriptions,t),()=>Ln(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Ms(e,t){return t?e*(1e3/t):0}const Ds=30,gl=e=>!isNaN(parseFloat(e));class yl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Re.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&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=Re.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=gl(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 kn);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=Re.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Ds)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ds);return Ms(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 Tt(e,t){return new yl(e,t)}function vl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Tt(n))}function xl(e,t){const n=vt(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=Xa(i[o]);vl(e,o,l)}}function bl(e){return Boolean(ge(e)&&e.add)}function _n(e,t){const n=e.getValue("willChange");if(bl(n))return n.add(t)}function Rs(e){return e.props[Jr]}const Tl={current:!1},Vs=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,wl=1e-7,Sl=12;function Pl(e,t,n,r,s){let i,o,l=0;do o=t+(n-t)/2,i=Vs(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>wl&&++l<Sl);return o}function wt(e,t,n,r){if(e===t&&n===r)return we;const s=i=>Pl(i,0,1,e,n);return i=>i===0||i===1?i:Vs(s(i),t,r)}const Os=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ls=e=>t=>1-e(1-t),ks=wt(.33,1.53,.69,.99),In=Ls(ks),_s=Os(In),Is=e=>(e*=2)<1?.5*In(e):.5*(2-Math.pow(2,-10*(e-1))),Nn=e=>1-Math.sin(Math.acos(e)),Ns=Ls(Nn),Fs=Os(Nn),Bs=e=>/^0[^.\s]+$/u.test(e);function Cl(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Bs(e):!0}const St=e=>Math.round(e*1e5)/1e5,Fn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function El(e){return e==null}const jl=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bn=(e,t)=>n=>Boolean(typeof n=="string"&&jl.test(n)&&n.startsWith(e)||t&&!El(n)&&Object.prototype.hasOwnProperty.call(n,t)),$s=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(Fn);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Al=e=>Le(0,255,e),$n={...nt,transform:e=>Math.round(Al(e))},ze={test:Bn("rgb","red"),parse:$s("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+$n.transform(e)+", "+$n.transform(t)+", "+$n.transform(n)+", "+St(gt.transform(r))+")"};function Ml(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Un={test:Bn("#"),parse:Ml,transform:ze.transform},rt={test:Bn("hsl","hue"),parse:$s("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+De.transform(St(t))+", "+De.transform(St(n))+", "+St(gt.transform(r))+")"},ye={test:e=>ze.test(e)||Un.test(e)||rt.test(e),parse:e=>ze.test(e)?ze.parse(e):rt.test(e)?rt.parse(e):Un.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ze.transform(e):rt.transform(e)},Dl=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Rl(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Fn))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Dl))===null||n===void 0?void 0:n.length)||0)>0}const Us="number",Ws="color",Vl="var",Ol="var(",zs="${}",Ll=/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 Pt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(Ll,a=>(ye.test(a)?(r.color.push(i),s.push(Ws),n.push(ye.parse(a))):a.startsWith(Ol)?(r.var.push(i),s.push(Vl),n.push(a)):(r.number.push(i),s.push(Us),n.push(parseFloat(a))),++i,zs)).split(zs);return{values:n,split:l,indexes:r,types:s}}function Ys(e){return Pt(e).values}function Ks(e){const{split:t,types:n}=Pt(e),r=t.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],s[o]!==void 0){const l=n[o];l===Us?i+=St(s[o]):l===Ws?i+=ye.transform(s[o]):i+=s[o]}return i}}const kl=e=>typeof e=="number"?0:e;function _l(e){const t=Ys(e);return Ks(e)(t.map(kl))}const Be={test:Rl,parse:Ys,createTransformer:Ks,getAnimatableNone:_l},Il=new Set(["brightness","contrast","saturate","opacity"]);function Nl(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Fn)||[];if(!r)return e;const s=n.replace(r,"");let i=Il.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const Fl=/\b([a-z-]*)\(.*?\)/gu,Wn={...Be,getAnimatableNone:e=>{const t=e.match(Fl);return t?t.map(Nl).join(" "):e}},Bl={...yn,color:ye,backgroundColor:ye,outlineColor:ye,fill:ye,stroke:ye,borderColor:ye,borderTopColor:ye,borderRightColor:ye,borderBottomColor:ye,borderLeftColor:ye,filter:Wn,WebkitFilter:Wn},zn=e=>Bl[e];function qs(e,t){let n=zn(e);return n!==Wn&&(n=Be),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const $l=new Set(["auto","none","0"]);function Ul(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!$l.has(i)&&Pt(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=qs(n,s)}const Gs=e=>e===nt||e===N,Hs=(e,t)=>parseFloat(e.split(", ")[t]),Xs=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Hs(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Hs(i[1],e):0}},Wl=new Set(["x","y","z"]),zl=tt.filter(e=>!Wl.has(e));function Yl(e){const t=[];return zl.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const st={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:Xs(4,13),y:Xs(5,14)};st.translateX=st.x,st.translateY=st.y;const Ye=new Set;let Yn=!1,Kn=!1;function Zs(){if(Kn){const e=Array.from(Ye).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Yl(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var l;(l=r.getValue(i))===null||l===void 0||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Kn=!1,Yn=!1,Ye.forEach(e=>e.complete()),Ye.clear()}function Js(){Ye.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Kn=!0)})}function Kl(){Js(),Zs()}class qn{constructor(t,n,r,s,i,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=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ye.add(this),Yn||(Yn=!0,te.read(Js),te.resolveKeyframes(Zs))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const o=s==null?void 0:s.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),s&&o===void 0&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ye.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ye.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Qs=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),ql=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Gl(e){const t=ql.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const Hl=4;function ei(e,t,n=1){_e(n<=Hl,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,s]=Gl(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Qs(o)?parseFloat(o):o}return gn(s)?ei(s,t,n+1):s}const ti=e=>t=>t.test(e),ni=[nt,N,De,Fe,Oa,Va,{test:e=>e==="auto",parse:e=>e}],ri=e=>ni.find(ti(e));class si extends qn{constructor(t,n,r,s,i){super(t,n,r,s,i,!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(),gn(c))){const u=ei(c,n.current);u!==void 0&&(t[a]=u),a===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!As.has(r)||t.length!==2)return;const[s,i]=t,o=ri(s),l=ri(i);if(o!==l)if(Gs(o)&&Gs(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 s=0;s<t.length;s++)Cl(t[s])&&r.push(s);r.length&&Ul(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=st[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,l=s[o];s[o]=st[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 ii=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Be.test(e)||e==="0")&&!e.startsWith("url("));function Xl(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 Zl(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=ii(s,t),l=ii(i,t);return Ze(o===l,`You are trying to animate ${t} from "${s}" to "${i}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${i} via the \`style\` property.`),!o||!l?!1:Xl(e)||(n==="spring"||An(n))&&r}const Jl=e=>e!==null;function Gt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(Jl),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const Ql=40;class oi{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Re.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Ql?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Kl(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Re.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:l,onUpdate:a,isGenerator:c}=this.options;if(!c&&!Zl(t,r,s,i))if(o)this.options.duration=0;else{a&&a(Gt(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 Ct={layout:0,mainThread:0,waapi:0},re=(e,t,n)=>e+(t-e)*n;function Gn(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 eu({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,a=2*n-l;s=Gn(a,l,e+1/3),i=Gn(a,l,e),o=Gn(a,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Ht(e,t){return n=>n>0?t:e}const Hn=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},tu=[Un,ze,rt],nu=e=>tu.find(t=>t.test(e));function ai(e){const t=nu(e);if(Ze(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===rt&&(n=eu(n)),n}const li=(e,t)=>{const n=ai(e),r=ai(t);if(!n||!r)return Ht(e,t);const s={...n};return i=>(s.red=Hn(n.red,r.red,i),s.green=Hn(n.green,r.green,i),s.blue=Hn(n.blue,r.blue,i),s.alpha=re(n.alpha,r.alpha,i),ze.transform(s))},ru=(e,t)=>n=>t(e(n)),Et=(...e)=>e.reduce(ru),Xn=new Set(["none","hidden"]);function su(e,t){return Xn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function iu(e,t){return n=>re(e,t,n)}function Zn(e){return typeof e=="number"?iu:typeof e=="string"?gn(e)?Ht:ye.test(e)?li:lu:Array.isArray(e)?ui:typeof e=="object"?ye.test(e)?li:ou:Ht}function ui(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Zn(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function ou(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Zn(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function au(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],l=e.indexes[o][s[o]],a=(n=e.values[l])!==null&&n!==void 0?n:0;r[i]=a,s[o]++}return r}const lu=(e,t)=>{const n=Be.createTransformer(t),r=Pt(e),s=Pt(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Xn.has(e)&&!s.values.length||Xn.has(t)&&!r.values.length?su(e,t):Et(ui(au(r,s),s.values),n):(Ze(!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.`),Ht(e,t))};function ci(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?re(e,t,n):Zn(e)(e,t)}const uu=5;function fi(e,t,n){const r=Math.max(t-uu,0);return Ms(n-e(r),t-r)}const se={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},Jn=.001;function cu({duration:e=se.duration,bounce:t=se.bounce,velocity:n=se.velocity,mass:r=se.mass}){let s,i;Ze(e<=Me(se.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Le(se.minDamping,se.maxDamping,o),e=Le(se.minDuration,se.maxDuration,Oe(e)),o<1?(s=c=>{const u=c*o,f=u*e,h=u-n,m=Qn(c,o),v=Math.exp(-f);return Jn-h/m*v},i=c=>{const f=c*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(c,2)*e,v=Math.exp(-f),y=Qn(Math.pow(c,2),o);return(-s(c)+Jn>0?-1:1)*((h-m)*v)/y}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Jn+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const l=5/e,a=du(s,i,l);if(e=Me(e),isNaN(a))return{stiffness:se.stiffness,damping:se.damping,duration:e};{const c=Math.pow(a,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const fu=12;function du(e,t,n){let r=n;for(let s=1;s<fu;s++)r=r-e(r)/t(r);return r}function Qn(e,t){return e*Math.sqrt(1-t*t)}const hu=["duration","bounce"],pu=["stiffness","damping","mass"];function di(e,t){return t.some(n=>e[n]!==void 0)}function mu(e){let t={velocity:se.velocity,stiffness:se.stiffness,damping:se.damping,mass:se.mass,isResolvedFromDuration:!1,...e};if(!di(e,pu)&&di(e,hu))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Le(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:se.mass,stiffness:s,damping:i}}else{const n=cu(e);t={...t,...n,mass:se.mass},t.isResolvedFromDuration=!0}return t}function hi(e=se.visualDuration,t=se.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:a,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:m}=mu({...n,velocity:-Oe(n.velocity||0)}),v=h||0,y=c/(2*Math.sqrt(a*u)),S=o-i,b=Oe(Math.sqrt(a/u)),P=Math.abs(S)<5;r||(r=P?se.restSpeed.granular:se.restSpeed.default),s||(s=P?se.restDelta.granular:se.restDelta.default);let C;if(y<1){const g=Qn(b,y);C=O=>{const Y=Math.exp(-y*b*O);return o-Y*((v+y*b*S)/g*Math.sin(g*O)+S*Math.cos(g*O))}}else if(y===1)C=g=>o-Math.exp(-b*g)*(S+(v+b*S)*g);else{const g=b*Math.sqrt(y*y-1);C=O=>{const Y=Math.exp(-y*b*O),A=Math.min(g*O,300);return o-Y*((v+y*b*S)*Math.sinh(A)+g*S*Math.cosh(A))/g}}const L={calculatedDuration:m&&f||null,next:g=>{const O=C(g);if(m)l.done=g>=f;else{let Y=0;y<1&&(Y=g===0?Me(v):fi(C,g,O));const A=Math.abs(Y)<=r,Q=Math.abs(o-O)<=s;l.done=A&&Q}return l.value=l.done?o:O,l},toString:()=>{const g=Math.min(ys(L),jn),O=xs(Y=>L.next(g*Y).value,g,30);return g+"ms "+O}};return L}function pi({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:a,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},m=A=>l!==void 0&&A<l||a!==void 0&&A>a,v=A=>l===void 0?a:a===void 0||Math.abs(l-A)<Math.abs(a-A)?l:a;let y=n*t;const S=f+y,b=o===void 0?S:o(S);b!==S&&(y=b-f);const P=A=>-y*Math.exp(-A/r),C=A=>b+P(A),L=A=>{const Q=P(A),F=C(A);h.done=Math.abs(Q)<=c,h.value=h.done?b:F};let g,O;const Y=A=>{m(h.value)&&(g=A,O=hi({keyframes:[h.value,v(h.value)],velocity:fi(C,A,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return Y(0),{calculatedDuration:null,next:A=>{let Q=!1;return!O&&g===void 0&&(Q=!0,L(A),Y(A)),g!==void 0&&A>=g?O.next(A-g):(!Q&&L(A),h)}}}const gu=wt(.42,0,1,1),yu=wt(0,0,.58,1),mi=wt(.42,0,.58,1),vu=e=>Array.isArray(e)&&typeof e[0]!="number",gi={linear:we,easeIn:gu,easeInOut:mi,easeOut:yu,circIn:Nn,circInOut:Fs,circOut:Ns,backIn:In,backInOut:_s,backOut:ks,anticipate:Is},yi=e=>{if(Mn(e)){_e(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,s]=e;return wt(t,n,r,s)}else if(typeof e=="string")return _e(gi[e]!==void 0,`Invalid easing type '${e}'`),gi[e];return e};function xu(e,t,n){const r=[],s=n||ci,i=e.length-1;for(let o=0;o<i;o++){let l=s(e[o],e[o+1]);if(t){const a=Array.isArray(t)?t[o]||we:t;l=Et(a,l)}r.push(l)}return r}function bu(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(_e(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=xu(t,r,s),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=Je(e[f],e[f+1],u);return l[f](h)};return n?u=>c(Le(e[0],e[i-1],u)):c}function Tu(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Je(0,t,r);e.push(re(n,1,s))}}function wu(e){const t=[0];return Tu(t,e.length-1),t}function Su(e,t){return e.map(n=>n*t)}function Pu(e,t){return e.map(()=>t||mi).splice(0,e.length-1)}function jt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=vu(r)?r.map(yi):yi(r),i={done:!1,value:t[0]},o=Su(n&&n.length===t.length?n:wu(t),e),l=bu(o,t,{ease:Array.isArray(s)?s:Pu(t,s)});return{calculatedDuration:e,next:a=>(i.value=l(a),i.done=a>=e,i)}}const Cu=e=>{const t=({timestamp:n})=>e(n);return{start:()=>te.update(t,!0),stop:()=>Ne(t),now:()=>me.isProcessing?me.timestamp:Re.now()}},Eu={decay:pi,inertia:pi,tween:jt,keyframes:jt,spring:hi},ju=e=>e/100;class er extends oi{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:s,keyframes:i}=this.options,o=(s==null?void 0:s.KeyframeResolver)||qn,l=(a,c)=>this.onKeyframesResolved(a,c);this.resolver=new o(i,l,n,r,s),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:s=0,repeatType:i,velocity:o=0}=this.options,l=An(n)?n:Eu[n]||jt;let a,c;process.env.NODE_ENV!=="production"&&l!==jt&&_e(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l!==jt&&typeof t[0]!="number"&&(a=Et(ju,ci(t[0],t[1])),t=[0,100]);const u=l({...this.options,keyframes:t});i==="mirror"&&(c=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ys(u));const{calculatedDuration:f}=u,h=f+s,m=h*(r+1)-s;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:a,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;Ct.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:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:a,calculatedDuration:c,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:m,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),P=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,L=i;if(m){const A=Math.min(this.currentTime,u)/f;let Q=Math.floor(A),F=A%1;!F&&A>=1&&(F=1),F===1&&Q--,Q=Math.min(Q,m+1),Boolean(Q%2)&&(v==="reverse"?(F=1-F,y&&(F-=y/f)):v==="mirror"&&(L=o)),C=Le(0,1,F)*f}const g=P?{done:!1,value:a[0]}:L.next(C);l&&(g.value=l(g.value));let{done:O}=g;!P&&c!==null&&(O=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const Y=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return Y&&s!==void 0&&(g.value=Gt(a,this.options,s)),S&&S(g.value),Y&&this.finish(),g}get duration(){const{resolved:t}=this;return t?Oe(t.calculatedDuration):0}get time(){return Oe(this.currentTime)}set time(t){t=Me(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=Oe(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Cu,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):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(),Ct.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Au=new Set(["opacity","clipPath","filter","transform"]);function Mu(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeInOut",times:a}={}){const c={[t]:n};a&&(c.offset=a);const u=Ts(l,s);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const Du=un(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Xt=10,Ru=2e4;function Vu(e){return An(e.type)||e.type==="spring"||!bs(e.ease)}function Ou(e,t){const n=new er({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let i=0;for(;!r.done&&i<Ru;)r=n.sample(i),s.push(r.value),i+=Xt;return{times:void 0,keyframes:s,duration:i-Xt,ease:"linear"}}const vi={anticipate:Is,backInOut:_s,circInOut:Fs};function Lu(e){return e in vi}class xi extends oi{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new si(i,(o,l)=>this.onKeyframesResolved(o,l),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:o,motionValue:l,name:a,startTime:c}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&Yt()&&Lu(i)&&(i=vi[i]),Vu(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:v,...y}=this.options,S=Ou(t,y);t=S.keyframes,t.length===1&&(t[1]=t[0]),r=S.duration,s=S.times,i=S.ease,o="keyframes"}const u=Mu(l.owner.current,a,t,{...this.options,duration:r,times:s,ease:i});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(vs(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;l.set(Gt(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:s,type:o,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Oe(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Oe(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Me(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 we;const{animation:r}=n;vs(r,t)}return we}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:s,type:i,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,...m}=this.options,v=new er({...m,keyframes:r,duration:s,type:i,ease:o,times:l,isGenerator:!0}),y=Me(this.time);c.setWithVelocity(v.sample(y-Xt).value,v.sample(y).value,Xt)}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:s,repeatType:i,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 Du()&&r&&Au.has(r)&&!a&&!c&&!s&&i!=="mirror"&&o!==0&&l!=="inertia"}}const ku={type:"spring",stiffness:500,damping:25,restSpeed:10},_u=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Iu={type:"keyframes",duration:.8},Nu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fu=(e,{keyframes:t})=>t.length>2?Iu:We.has(e)?e.startsWith("scale")?_u(t[1]):ku:Nu;function Bu({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:l,from:a,elapsed:c,...u}){return!!Object.keys(u).length}const tr=(e,t,n,r={},s,i)=>o=>{const l=En(r,e)||{},a=l.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Me(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:i?void 0:s};Bu(l)||(u={...u,...Fu(e,u)}),u.duration&&(u.duration=Me(u.duration)),u.repeatDelay&&(u.repeatDelay=Me(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)),(Tl.current||zr.skipAnimations)&&(f=!0,u.duration=0,u.delay=0),f&&!i&&t.get()!==void 0){const h=Gt(u.keyframes,l);if(h!==void 0)return te.update(()=>{u.onUpdate(h),u.onComplete()}),new sl([])}return!i&&xi.supports(u)?new xi(u):new er(u)};function $u({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function bi(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...a}=t;r&&(o=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const f in a){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),m=a[f];if(m===void 0||u&&$u(u,f))continue;const v={delay:n,...En(o||{},f)};let y=!1;if(window.MotionHandoffAnimation){const b=Rs(e);if(b){const P=window.MotionHandoffAnimation(b,f,te);P!==null&&(v.startTime=P,y=!0)}}_n(e,f),h.start(tr(f,h,m,e.shouldReduceMotion&&As.has(f)?{type:!1}:v,e,y));const S=h.animation;S&&c.push(S)}return l&&Promise.all(c).then(()=>{te.update(()=>{l&&xl(e,l)})}),c}function nr(e,t,n={}){var r;const s=vt(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(bi(e,s,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=i;return Uu(e,t,u+c,f,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[o,l]:[l,o];return c().then(()=>u())}else return Promise.all([o(),l(n.delay)])}function Uu(e,t,n=0,r=0,s=1,i){const o=[],l=(e.variantChildren.size-1)*r,a=s===1?(c=0)=>c*r:(c=0)=>l-c*r;return Array.from(e.variantChildren).sort(Wu).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(nr(c,t,{...i,delay:n+a(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function Wu(e,t){return e.sortNodePosition(t)}function zu(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>nr(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=nr(e,t,n);else{const s=typeof t=="function"?vt(e,t,n.custom):t;r=Promise.all(bi(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Ti(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 Yu=dn.length;function wi(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?wi(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Yu;n++){const r=dn[n],s=e.props[r];(pt(s)||s===!1)&&(t[r]=s)}return t}const Ku=[...fn].reverse(),qu=fn.length;function Gu(e){return t=>Promise.all(t.map(({animation:n,options:r})=>zu(e,n,r)))}function Hu(e){let t=Gu(e),n=Si(),r=!0;const s=a=>(c,u)=>{var f;const h=vt(e,u,a==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:v,...y}=h;c={...c,...y,...v}}return c};function i(a){t=a(e)}function o(a){const{props:c}=e,u=wi(e.parent)||{},f=[],h=new Set;let m={},v=1/0;for(let S=0;S<qu;S++){const b=Ku[S],P=n[b],C=c[b]!==void 0?c[b]:u[b],L=pt(C),g=b===a?P.isActive:null;g===!1&&(v=S);let O=C===u[b]&&C!==c[b]&&L;if(O&&r&&e.manuallyAnimateOnMount&&(O=!1),P.protectedKeys={...m},!P.isActive&&g===null||!C&&!P.prevProp||$t(C)||typeof C=="boolean")continue;const Y=Xu(P.prevProp,C);let A=Y||b===a&&P.isActive&&!O&&L||S>v&&L,Q=!1;const F=Array.isArray(C)?C:[C];let q=F.reduce(s(b),{});g===!1&&(q={});const{prevResolvedValues:oe={}}=P,ne={...oe,...q},ae=H=>{A=!0,h.has(H)&&(Q=!0,h.delete(H)),P.needsAnimating[H]=!0;const le=e.getValue(H);le&&(le.liveStyle=!1)};for(const H in ne){const le=q[H],Se=oe[H];if(m.hasOwnProperty(H))continue;let T=!1;Pn(le)&&Pn(Se)?T=!Ti(le,Se):T=le!==Se,T?le!=null?ae(H):h.add(H):le!==void 0&&h.has(H)?ae(H):P.protectedKeys[H]=!0}P.prevProp=C,P.prevResolvedValues=q,P.isActive&&(m={...m,...q}),r&&e.blockInitialAnimation&&(A=!1),A&&(!(O&&Y)||Q)&&f.push(...F.map(H=>({animation:H,options:{type:b}})))}if(h.size){const S={};if(typeof c.initial!="boolean"){const b=vt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);b&&b.transition&&(S.transition=b.transition)}h.forEach(b=>{const P=e.getBaseTarget(b),C=e.getValue(b);C&&(C.liveStyle=!0),S[b]=P??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 m;return(m=h.animationState)===null||m===void 0?void 0:m.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:i,getState:()=>n,reset:()=>{n=Si(),r=!0}}}function Xu(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ti(t,e):!1}function Ke(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Si(){return{animate:Ke(!0),whileInView:Ke(),whileHover:Ke(),whileTap:Ke(),whileDrag:Ke(),whileFocus:Ke(),exit:Ke()}}class $e{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Zu extends $e{constructor(t){super(t),t.animationState||(t.animationState=Hu(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();$t(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 Ju=0;class Qu extends $e{constructor(){super(...arguments),this.id=Ju++}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 s=this.node.animationState.setActive("exit",!t);n&&!t&&s.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 ec={animation:{Feature:Zu},exit:{Feature:Qu}};function At(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Mt(e){return{point:{x:e.pageX,y:e.pageY}}}const tc=e=>t=>Rn(t)&&e(t,Mt(t));function it(e,t,n,r){return At(e,t,tc(n),r)}function Pi({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function nc({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function rc(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 Ci=1e-4,sc=1-Ci,ic=1+Ci,Ei=.01,oc=0-Ei,ac=0+Ei;function xe(e){return e.max-e.min}function lc(e,t,n){return Math.abs(e-t)<=n}function ji(e,t,n,r=.5){e.origin=r,e.originPoint=re(t.min,t.max,e.origin),e.scale=xe(n)/xe(t),e.translate=re(n.min,n.max,e.origin)-e.originPoint,(e.scale>=sc&&e.scale<=ic||isNaN(e.scale))&&(e.scale=1),(e.translate>=oc&&e.translate<=ac||isNaN(e.translate))&&(e.translate=0)}function Dt(e,t,n,r){ji(e.x,t.x,n.x,r?r.originX:void 0),ji(e.y,t.y,n.y,r?r.originY:void 0)}function Ai(e,t,n){e.min=n.min+t.min,e.max=e.min+xe(t)}function uc(e,t,n){Ai(e.x,t.x,n.x),Ai(e.y,t.y,n.y)}function Mi(e,t,n){e.min=t.min-n.min,e.max=e.min+xe(t)}function Rt(e,t,n){Mi(e.x,t.x,n.x),Mi(e.y,t.y,n.y)}const Di=()=>({translate:0,scale:1,origin:0,originPoint:0}),ot=()=>({x:Di(),y:Di()}),Ri=()=>({min:0,max:0}),ue=()=>({x:Ri(),y:Ri()});function Pe(e){return[e("x"),e("y")]}function rr(e){return e===void 0||e===1}function sr({scale:e,scaleX:t,scaleY:n}){return!rr(e)||!rr(t)||!rr(n)}function qe(e){return sr(e)||Vi(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Vi(e){return Oi(e.x)||Oi(e.y)}function Oi(e){return e&&e!=="0%"}function Zt(e,t,n){const r=e-n,s=t*r;return n+s}function Li(e,t,n,r,s){return s!==void 0&&(e=Zt(e,s,r)),Zt(e,n,r)+t}function ir(e,t=0,n=1,r,s){e.min=Li(e.min,t,n,r,s),e.max=Li(e.max,t,n,r,s)}function ki(e,{x:t,y:n}){ir(e.x,t.translate,t.scale,t.originPoint),ir(e.y,n.translate,n.scale,n.originPoint)}const _i=.999999999999,Ii=1.0000000000001;function cc(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let l=0;l<s;l++){i=n[l],o=i.projectionDelta;const{visualElement:a}=i.options;a&&a.props.style&&a.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&lt(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ki(e,o)),r&&qe(i.latestValues)&&lt(e,i.latestValues))}t.x<Ii&&t.x>_i&&(t.x=1),t.y<Ii&&t.y>_i&&(t.y=1)}function at(e,t){e.min=e.min+t,e.max=e.max+t}function Ni(e,t,n,r,s=.5){const i=re(e.min,e.max,s);ir(e,t,n,i,r)}function lt(e,t){Ni(e.x,t.x,t.scaleX,t.scale,t.originX),Ni(e.y,t.y,t.scaleY,t.scale,t.originY)}function Fi(e,t){return Pi(rc(e.getBoundingClientRect(),t))}function fc(e,t,n){const r=Fi(e,n),{scroll:s}=t;return s&&(at(r.x,s.offset.x),at(r.y,s.offset.y)),r}const Bi=(e,t)=>Math.abs(e-t);function dc(e,t){const n=Bi(e.x,t.x),r=Bi(e.y,t.y);return Math.sqrt(n**2+r**2)}class $i{constructor(t,n,{transformPagePoint:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=ar(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=dc(u.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=u,{timestamp:v}=me;this.history.push({...m,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=or(f,this.transformPagePoint),te.update(this.updatePoint,!0)},this.handlePointerUp=(u,f)=>{Kt(u,"release"),this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ar(u.type==="pointercancel"||u.type==="lostpointercapture"?this.lastMoveEventInfo:or(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,y),m&&m(u,y)},!Rn(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r;const i=Mt(t),o=or(i,this.transformPagePoint),{point:l}=o,{timestamp:a}=me;this.history=[{...l,timestamp:a}];const{onSessionStart:c}=n;c&&c(t,ar(o,this.history)),Kt(t,"set"),this.removeListeners=Et(it(t.currentTarget,"pointermove",this.handlePointerMove),it(t.currentTarget,"pointerup",this.handlePointerUp),it(t.currentTarget,"pointercancel",this.handlePointerUp),it(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ne(this.updatePoint)}}function or(e,t){return t?{point:t(e.point)}:e}function Ui(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ar({point:e},t){return{point:e,delta:Ui(e,Wi(t)),offset:Ui(e,hc(t)),velocity:pc(t,.1)}}function hc(e){return e[0]}function Wi(e){return e[e.length-1]}function pc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=Wi(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Me(t)));)n--;if(!r)return{x:0,y:0};const i=Oe(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function mc(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?re(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?re(n,e,r.max):Math.min(e,n)),e}function zi(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 gc(e,{top:t,left:n,bottom:r,right:s}){return{x:zi(e.x,n,s),y:zi(e.y,t,r)}}function Yi(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 yc(e,t){return{x:Yi(e.x,t.x),y:Yi(e.y,t.y)}}function vc(e,t){let n=.5;const r=xe(e),s=xe(t);return s>r?n=Je(t.min,t.max-r,e.min):r>s&&(n=Je(e.min,e.max-s,t.min)),Le(0,1,n)}function xc(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 lr=.35;function bc(e=lr){return e===!1?e=0:e===!0&&(e=lr),{x:Ki(e,"left","right"),y:Ki(e,"top","bottom")}}function Ki(e,t,n){return{min:qi(e,t),max:qi(e,n)}}function qi(e,t){return typeof e=="number"?e:e[t]||0}const Tc=new WeakMap;class wc{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=ue(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Mt(u).point)},i=(u,f)=>{const{drag:h,dragPropagation:m,onDragStart:v}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=pl(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),Pe(S=>{let b=this.getAxisMotionValue(S).get()||0;if(De.test(b)){const{projection:P}=this.visualElement;if(P&&P.layout){const C=P.layout.layoutBox[S];C&&(b=xe(C)*(parseFloat(b)/100))}}this.originPoint[S]=b}),v&&te.postRender(()=>v(u,f)),_n(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:v,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:S}=f;if(m&&this.currentDirection===null){this.currentDirection=Sc(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=()=>Pe(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 $i(t,{onSessionStart:s,onStart:i,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:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&te.postRender(()=>i(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:s}=this.getProps();if(!r||!Jt(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=mc(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&et(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=gc(s.layoutBox,n):this.constraints=!1,this.elastic=bc(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Pe(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=xc(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!et(t))return!1;const r=t.current;_e(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=fc(r,s.root,this.visualElement.getTransformPagePoint());let o=yc(s.layout.layoutBox,i);if(n){const l=n(nc(o));this.hasMutatedConstraints=!!l,l&&(o=Pi(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),a=this.constraints||{},c=Pe(u=>{if(!Jt(u,n,this.currentDirection))return;let f=a&&a[u]||{};o&&(f={min:0,max:0});const h=s?200:1e6,m=s?40:1e7,v={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,v)});return Promise.all(c).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return _n(this.visualElement,t),r.start(tr(t,r,0,n,this.visualElement,!1))}stopAnimation(){Pe(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Pe(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(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Pe(n=>{const{drag:r}=this.getProps();if(!Jt(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n];i.set(t[n]-re(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!et(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Pe(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const a=l.get();s[o]=vc({min:a,max:a},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Pe(o=>{if(!Jt(o,t,null))return;const l=this.getAxisMotionValue(o),{min:a,max:c}=this.constraints[o];l.set(re(a,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;Tc.set(this.visualElement,this);const t=this.visualElement.current,n=it(t,"pointerdown",a=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(a)}),r=()=>{const{dragConstraints:a}=this.getProps();et(a)&&a.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),te.read(r);const o=At(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:a,hasLayoutChanged:c})=>{this.isDragging&&c&&(Pe(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(),i(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=lr,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function Jt(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Sc(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Pc extends $e{constructor(t){super(t),this.removeGroupControls=we,this.removeListeners=we,this.controls=new wc(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||we}unmount(){this.removeGroupControls(),this.removeListeners()}}const Gi=e=>(t,n)=>{e&&te.postRender(()=>e(t,n))};class Cc extends $e{constructor(){super(...arguments),this.removePointerDownListener=we}onPointerDown(t){this.session=new $i(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Gi(t),onStart:Gi(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&te.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=it(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 Qt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Hi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Vt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(N.test(e))e=parseFloat(e);else return e;const n=Hi(e,t.target.x),r=Hi(e,t.target.y);return`${n}% ${r}%`}},Ec={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Be.parse(e);if(s.length>5)return r;const i=Be.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,a=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=a;const c=re(l,a,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}};class jc extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;Ra(Ac),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Qt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?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(),pn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Xi(e){const[t,n]=Br(),r=x.useContext(sn);return p.exports.jsx(jc,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(Qr),isPresent:t,safeToRemove:n})}const Ac={borderRadius:{...Vt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vt,borderTopRightRadius:Vt,borderBottomLeftRadius:Vt,borderBottomRightRadius:Vt,boxShadow:Ec};function Mc(e,t,n){const r=ge(e)?e:Tt(e);return r.start(tr("",r,t,n)),r.animation}function Dc(e){return e instanceof SVGElement&&e.tagName!=="svg"}const Rc=(e,t)=>e.depth-t.depth;class Vc{constructor(){this.children=[],this.isDirty=!1}add(t){On(this.children,t),this.isDirty=!0}remove(t){Ln(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Rc),this.isDirty=!1,this.children.forEach(t)}}function Oc(e,t){const n=Re.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Ne(r),e(i-t))};return te.read(r,!0),()=>Ne(r)}const Zi=["TopLeft","TopRight","BottomLeft","BottomRight"],Lc=Zi.length,Ji=e=>typeof e=="string"?parseFloat(e):e,Qi=e=>typeof e=="number"||N.test(e);function kc(e,t,n,r,s,i){s?(e.opacity=re(0,n.opacity!==void 0?n.opacity:1,_c(r)),e.opacityExit=re(t.opacity!==void 0?t.opacity:1,0,Ic(r))):i&&(e.opacity=re(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Lc;o++){const l=`border${Zi[o]}Radius`;let a=eo(t,l),c=eo(n,l);if(a===void 0&&c===void 0)continue;a||(a=0),c||(c=0),a===0||c===0||Qi(a)===Qi(c)?(e[l]=Math.max(re(Ji(a),Ji(c),r),0),(De.test(c)||De.test(a))&&(e[l]+="%")):e[l]=c}(t.rotate||n.rotate)&&(e.rotate=re(t.rotate||0,n.rotate||0,r))}function eo(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const _c=to(0,.5,Ns),Ic=to(.5,.95,we);function to(e,t,n){return r=>r<e?0:r>t?1:n(Je(e,t,r))}function no(e,t){e.min=t.min,e.max=t.max}function Ce(e,t){no(e.x,t.x),no(e.y,t.y)}function ro(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function so(e,t,n,r,s){return e-=t,e=Zt(e,1/n,r),s!==void 0&&(e=Zt(e,1/s,r)),e}function Nc(e,t=0,n=1,r=.5,s,i=e,o=e){if(De.test(t)&&(t=parseFloat(t),t=re(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=re(i.min,i.max,r);e===i&&(l-=t),e.min=so(e.min,t,n,l,s),e.max=so(e.max,t,n,l,s)}function io(e,t,[n,r,s],i,o){Nc(e,t[n],t[r],t[s],t.scale,i,o)}const Fc=["x","scaleX","originX"],Bc=["y","scaleY","originY"];function oo(e,t,n,r){io(e.x,t,Fc,n?n.x:void 0,r?r.x:void 0),io(e.y,t,Bc,n?n.y:void 0,r?r.y:void 0)}function ao(e){return e.translate===0&&e.scale===1}function lo(e){return ao(e.x)&&ao(e.y)}function uo(e,t){return e.min===t.min&&e.max===t.max}function $c(e,t){return uo(e.x,t.x)&&uo(e.y,t.y)}function co(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function fo(e,t){return co(e.x,t.x)&&co(e.y,t.y)}function ho(e){return xe(e.x)/xe(e.y)}function po(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Uc{constructor(){this.members=[]}add(t){On(this.members,t),t.scheduleRender()}remove(t){if(Ln(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(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;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:s}=t.options;s===!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 Wc(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}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:m,skewY:v}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}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 Ge={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ur=["","X","Y","Z"],zc={visibility:"hidden"},mo=1e3;let Yc=0;function cr(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function go(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Rs(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",te,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&go(r)}function yo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=Yc++,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,Ie.value&&(Ge.nodes=Ge.calculatedTargetDeltas=Ge.calculatedProjections=0),this.nodes.forEach(Gc),this.nodes.forEach(Qc),this.nodes.forEach(ef),this.nodes.forEach(Hc),Ie.addProjectionMetrics&&Ie.addProjectionMetrics(Ge)},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 Vc)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new kn),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=Dc(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=Oc(h,250),Qt.hasAnimatedSinceResize&&(Qt.hasAnimatedSinceResize=!1,this.nodes.forEach(xo))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||of,{onLayoutAnimationStart:S,onLayoutAnimationComplete:b}=u.getProps(),P=!this.targetLayout||!fo(this.targetLayout,v),C=!h&&m;if(this.options.layoutRoot||this.resumeFrom||C||h&&(P||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,C);const L={...En(y,"layout"),onPlay:S,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else h||xo(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,Ne(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(tf),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&&go(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(vo);return}this.isUpdating||this.nodes.forEach(Zc),this.isUpdating=!1,this.nodes.forEach(Jc),this.nodes.forEach(Kc),this.nodes.forEach(qc),this.clearAllSnapshots();const l=Re.now();me.delta=Le(0,1e3/60,l-me.timestamp),me.timestamp=l,me.isProcessing=!0,cn.update.process(me),cn.preRender.process(me),cn.render.process(me),me.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,pn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Xc),this.sharedNodes.forEach(nf)}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&&!xe(this.snapshot.measuredBox.x)&&!xe(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=ue(),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(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!lo(this.projectionDelta),a=this.getTransformTemplate(),c=a?a(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(l||qe(this.latestValues)||u)&&(s(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)),af(a),{animationId:this.root.animationId,measuredBox:l,layoutBox:a,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:l}=this.options;if(!l)return ue();const a=l.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(lf))){const{scroll:u}=this.root;u&&(at(a.x,u.offset.x),at(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=ue();if(Ce(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&&Ce(a,o),at(a.x,f.offset.x),at(a.y,f.offset.y))}return a}applyTransform(o,l=!1){const a=ue();Ce(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&&lt(a,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),qe(u.latestValues)&&lt(a,u.latestValues)}return qe(this.latestValues)&&lt(a,this.latestValues),a}removeTransform(o){const l=ue();Ce(l,o);for(let a=0;a<this.path.length;a++){const c=this.path[a];if(!c.instance||!qe(c.latestValues))continue;sr(c.latestValues)&&c.updateSnapshot();const u=ue(),f=c.measurePageBox();Ce(u,f),oo(l,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return qe(this.latestValues)&&oo(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!==me.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=me.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ue(),this.relativeTargetOrigin=ue(),Rt(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),Ce(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=ue(),this.targetWithTransforms=ue()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),uc(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Ce(this.target,this.layout.layoutBox),ki(this.target,this.targetDelta)):Ce(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&Boolean(m.resumingFrom)===Boolean(this.resumingFrom)&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ue(),this.relativeTargetOrigin=ue(),Rt(this.relativeTargetOrigin,this.target,m.target),Ce(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ie.value&&Ge.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||sr(this.parent.latestValues)||Vi(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===me.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;Ce(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;cc(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=ue());const{target:v}=l;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ro(this.prevProjectionDelta.x,this.projectionDelta.x),ro(this.prevProjectionDelta.y,this.projectionDelta.y)),Dt(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!po(this.projectionDelta.x,this.prevProjectionDelta.x)||!po(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),Ie.value&&Ge.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=ot(),this.projectionDelta=ot(),this.projectionDeltaWithTransform=ot()}setAnimationOrigin(o,l=!1){const a=this.snapshot,c=a?a.latestValues:{},u={...this.latestValues},f=ot();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const h=ue(),m=a?a.source:void 0,v=this.layout?this.layout.source:void 0,y=m!==v,S=this.getStack(),b=!S||S.members.length<=1,P=Boolean(y&&!b&&this.options.crossfade===!0&&!this.path.some(sf));this.animationProgress=0;let C;this.mixTargetDelta=L=>{const g=L/1e3;bo(f.x,o.x,g),bo(f.y,o.y,g),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Rt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),rf(this.relativeTarget,this.relativeTargetOrigin,h,g),C&&$c(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=ue()),Ce(C,this.relativeTarget)),y&&(this.animationValues=u,kc(u,c,this.latestValues,g,P,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=g},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&&(Ne(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=te.update(()=>{Qt.hasAnimatedSinceResize=!0,Ct.layout++,this.currentAnimation=Mc(0,mo,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onStop:()=>{Ct.layout--},onComplete:()=>{Ct.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(mo),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&&Co(this.options.animationType,this.layout.layoutBox,c.layoutBox)){a=this.target||ue();const f=xe(this.layout.layoutBox.x);a.x.min=o.target.x.min,a.x.max=a.x.min+f;const h=xe(this.layout.layoutBox.y);a.y.min=o.target.y.min,a.y.max=a.y.min+h}Ce(l,a),lt(l,u),Dt(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Uc),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&&cr("z",o,c,this.animationValues);for(let u=0;u<ur.length;u++)cr(`rotate${ur[u]}`,o,c,this.animationValues),cr(`skew${ur[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 zc;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=zt(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=zt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!qe(this.latestValues)&&(y.transform=u?u({},""):"none",this.hasProjected=!1),y}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=Wc(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:m,y:v}=this.projectionDelta;c.transformOrigin=`${m.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 mt){if(h[y]===void 0)continue;const{correct:S,applyTo:b,isCSSVariable:P}=mt[y],C=c.transform==="none"?h[y]:S(h[y],f);if(b){const L=b.length;for(let g=0;g<L;g++)c[b[g]]=C}else P?this.options.visualElement.renderState.vars[y]=C:c[y]=C}return this.options.layoutId&&(c.pointerEvents=f===this?zt(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(vo),this.root.sharedNodes.clear()}}}function Kc(e){e.updateLayout()}function qc(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:s}=e.layout,{animationType:i}=e.options,o=n.source!==e.layout.source;i==="size"?Pe(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=xe(h);h.min=r[f].min,h.max=h.min+m}):Co(i,n.layoutBox,r)&&Pe(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=xe(r[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const l=ot();Dt(l,r,n.layoutBox);const a=ot();o?Dt(a,e.applyTransform(s,!0),n.measuredBox):Dt(a,r,n.layoutBox);const c=!lo(l);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const v=ue();Rt(v,n.layoutBox,h.layoutBox);const y=ue();Rt(y,r,m.layoutBox),fo(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 Gc(e){Ie.value&&Ge.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 Hc(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Xc(e){e.clearSnapshot()}function vo(e){e.clearMeasurements()}function Zc(e){e.isLayoutDirty=!1}function Jc(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function xo(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Qc(e){e.resolveTargetDelta()}function ef(e){e.calcProjection()}function tf(e){e.resetSkewAndRotation()}function nf(e){e.removeLeadSnapshot()}function bo(e,t,n){e.translate=re(t.translate,0,n),e.scale=re(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function To(e,t,n,r){e.min=re(t.min,n.min,r),e.max=re(t.max,n.max,r)}function rf(e,t,n,r){To(e.x,t.x,n.x,r),To(e.y,t.y,n.y,r)}function sf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const of={duration:.45,ease:[.4,0,.1,1]},wo=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),So=wo("applewebkit/")&&!wo("chrome/")?Math.round:we;function Po(e){e.min=So(e.min),e.max=So(e.max)}function af(e){Po(e.x),Po(e.y)}function Co(e,t,n){return e==="position"||e==="preserve-aspect"&&!lc(ho(t),ho(n),.2)}function lf(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const uf=yo({attachResizeListener:(e,t)=>At(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),fr={current:void 0},Eo=yo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!fr.current){const e=new uf({});e.mount(window),e.setOptions({layoutScroll:!0}),fr.current=e}return fr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),cf={pan:{Feature:Cc},drag:{Feature:Pc,ProjectionNode:Eo,MeasureLayout:Xi}};function jo(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&te.postRender(()=>i(t,Mt(t)))}class ff extends $e{mount(){const{current:t}=this.node;t&&(this.unmount=ll(t,(n,r)=>(jo(this.node,r,"Start"),s=>jo(this.node,s,"End"))))}unmount(){}}class df extends $e{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=Et(At(this.node.current,"focus",()=>this.onFocus()),At(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ao(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 s="onTap"+(n==="End"?"":n),i=r[s];i&&te.postRender(()=>i(t,Mt(t)))}class hf extends $e{mount(){const{current:t}=this.node;t&&(this.unmount=dl(t,(n,r)=>(Ao(this.node,r,"Start"),(s,{success:i})=>Ao(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const dr=new WeakMap,hr=new WeakMap,pf=e=>{const t=dr.get(e.target);t&&t(e)},mf=e=>{e.forEach(pf)};function gf({root:e,...t}){const n=e||document;hr.has(n)||hr.set(n,{});const r=hr.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(mf,{root:e,...t})),r[s]}function yf(e,t,n){const r=gf(t);return dr.set(e,n),r.observe(e),()=>{dr.delete(e),r.unobserve(e)}}const vf={some:0,all:1};class xf extends $e{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:vf[s]},l=a=>{const{isIntersecting:c}=a;if(this.isInView===c||(this.isInView=c,i&&!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 yf(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(bf(t,n))&&this.startObserver()}unmount(){}}function bf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Tf={inView:{Feature:xf},tap:{Feature:hf},focus:{Feature:df},hover:{Feature:ff}},wf={layout:{ProjectionNode:Eo,MeasureLayout:Xi}},pr={current:null},Mo={current:!1};function Sf(){if(Mo.current=!0,!!ln)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>pr.current=e.matches;e.addListener(t),t()}else pr.current=!1}const Pf=[...ni,ye,Be],Cf=e=>Pf.find(ti(e)),Ef=new WeakMap;function jf(e,t,n){for(const r in t){const s=t[r],i=n[r];if(ge(s))e.addValue(r,s),process.env.NODE_ENV==="development"&&Ft(s.version==="12.4.7",`Attempting to mix Motion versions ${s.version} with 12.4.7 may not work as expected.`);else if(ge(i))e.addValue(r,Tt(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,Tt(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Do=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Af{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,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=qn,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 m=Re.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,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=s,this.options=l,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=Ut(n),this.isVariantNode=Xr(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const v=h[m];a[m]!==void 0&&ge(v)&&v.set(a[m],!1)}}mount(t){this.current=t,Ef.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)),Mo.current||Sf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:pr.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(),Ne(this.notifyUpdate),Ne(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=We.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&te.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),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 Qe){const n=Qe[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ue()}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<Do.length;r++){const s=Do[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=jf(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=Tt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=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 s!=null&&(typeof s=="string"&&(Qs(s)||Bs(s))?s=parseFloat(s):!Cf(s)&&Be.test(n)&&(s=qs(t,n)),this.setBaseTarget(t,ge(s)?s.get():s)),ge(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=Sn(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ge(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new kn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Ro extends Af{constructor(){super(...arguments),this.KeyframeResolver=si}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;ge(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Mf(e){return window.getComputedStyle(e)}class Df extends Ro{constructor(){super(...arguments),this.type="html",this.renderInstance=ds}readValueFromInstance(t,n){if(We.has(n)){const r=zn(n);return r&&r.default||0}else{const r=Mf(t),s=(mn(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Fi(t,n)}build(t,n,r){vn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Cn(t,n,r)}}class Rf extends Ro{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ue,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&fs(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(We.has(n)){const r=zn(n);return r&&r.default||0}return n=hs.has(n)?n:hn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return ms(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&te.postRender(this.updateDimensions)}build(t,n,r){Tn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){ps(t,n,r,s)}mount(t){this.isSVGTag=wn(t.tagName),super.mount(t)}}const Vf=(e,t)=>bn(e)?new Rf(t):new Df(t,{allowProjection:e!==x.Fragment}),Of=tl({...ec,...Tf,...cf,...wf},Vf),mr=va(Of),Lf=({isOpen:e,onClose:t,onConfirm:n,header:r,question:s})=>e?p.exports.jsx("div",{id:"default-modal",tabIndex:-1,"aria-hidden":"true",className:"absolute 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:p.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:p.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[p.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:[p.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),p.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:[p.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:p.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),p.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),p.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:p.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[s," "]})}),p.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[p.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 "}),p.exports.jsx("button",{onClick:t,type:"button",className:"py-2.5 px-5 ml-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,kf=({items:e,isVisible:t,position:n,messageId:r,isCurrentUserMessage:s})=>{const i=x.useRef(null),[o,l]=x.useState(!1);return x.useEffect(()=>(i.current||(i.current=document.createElement("div"),i.current.style.zIndex="1500",i.current.style.position="fixed",i.current.style.top="0",i.current.style.left="0",i.current.style.width="100%",i.current.style.height="100%",i.current.style.pointerEvents="none",document.body.appendChild(i.current)),l(!0),()=>{i.current&&!t&&(document.body.removeChild(i.current),i.current=null)}),[t]),!i.current||!o?null:Ue.createPortal(p.exports.jsx(Wr,{children:t&&p.exports.jsx(mr.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-50 bg-white shadow-lg rounded-md p-2 px-1 w-42 pointer-events-auto",style:{top:n.y,left:n.x},children:e.map((a,c)=>a!=null&&a.onlyCurrentUserMessage&&!s?null:p.exports.jsxs("button",{disabled:a==null?void 0:a.disabled,className:"cursor-pointer flex items-center gap-2 w-full rounded-md text-left px-2 py-1 disabled:opacity-20 hover:bg-gray-200",onClick:()=>a.onClick(r),children:[x.cloneElement(a.icon,{className:"text-black",size:18}),p.exports.jsx("span",{className:"ml-2 text-black",children:a.name})]},c))})}),i.current)},_f=e=>{const t=Math.floor(e/60),n=e%60;return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},If=()=>p.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.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"})}),Nf=()=>p.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.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"})}),gr=()=>p.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.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"})}),en=e=>p.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:p.exports.jsxs("g",{fill:"none",children:[p.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"}),p.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"}),p.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"}),p.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"})]})}),Ff=({onSendMessage:e,onEditMessage:t,onSendVoice:n,onImageSend:r,onVideoSend:s,onFileSend:i,dynamicSymbolAssignments:o,messageToEdit:l,setMessageToEdit:a})=>{const[c,u]=x.useState(""),[f,h]=x.useState(!1),[m,v]=x.useState(0),[y,S]=x.useState(null),[b,P]=x.useState(null),[C,L]=x.useState(0),g=x.useRef(null),O=x.useRef([]),Y=x.useRef(null),A=x.useRef(null),Q=x.useRef(null),[F,q]=x.useState(!1),oe=R=>{const E=R.target.value;console.log("Input",E),l?a(k=>k?new Xe({...k,text:E,isEdited:!0}):void 0):u(E);const V=E.match(/(\S+)$/);ne(V)},ne=R=>{if(R){const E=R[0];if(y){const V=R[0].split(y)[1];P(V)}o!=null&&o.some(V=>V.symbol===E)&&S(E)}else S(null)},ae=(R,E)=>{l?a(V=>V?new Xe({...V,text:V.text+E+" "}):void 0):u(V=>V+E+" "),S(null),A.current.focus()},pe=()=>{if(l){if(l.text.trim()==="")return;t(l),a(void 0)}else{if(c.trim()==="")return;e(c),u("")}S(null)},W=async()=>{h(!0),v(0),O.current=[],Y.current=setInterval(()=>{v(V=>V+1)},1e3);const R=await navigator.mediaDevices.getUserMedia({audio:!0}),E=new MediaRecorder(R);g.current=E,E.ondataavailable=V=>{V.data.size>0&&O.current.push(V.data)},E.onstop=()=>{clearInterval(Y.current);const V=new Blob(O.current,{type:"audio/mp3"});n(V),h(!1)},E.start()},H=()=>{var R;(R=g.current)==null||R.stop()},le=R=>{const{scrollTop:E,scrollHeight:V,clientHeight:k}=R.currentTarget;if(E>C){if(E+k>=V-1){const I=o==null?void 0:o.find(z=>z.symbol===y);I&&(I!=null&&I.updatePageNumber)&&(q(!0),I==null||I.updatePageNumber(I.pagNumber+1),L(E),setTimeout(()=>{q(!1)},500))}}else L(E)},Se=new Set(["jpeg","png","gif","webp","bmp","svg+xml","tiff","x-icon"]),T=new Set(["mp4","webm","ogg","mpeg","quicktime","x-msvideo","x-ms-wmv","3gpp","3gpp2"]),D=()=>{var R;(R=Q.current)==null||R.click()},$=R=>{var k,_;const E=(k=R.target.files)==null?void 0:k[0];if(!E)return;let V="";if(E.type){const I=E.type.split("/");I.length===2&&(V=I[1])}V||(V=((_=E.name.split(".").pop())==null?void 0:_.toLowerCase())||""),Se.has(V)?r(E):T.has(V)?s(E):i(E)};return p.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[f?p.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[p.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:_f(m)}),p.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:H,children:p.exports.jsx(gr,{})})]}):l?p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] relative ",children:[p.exports.jsxs("div",{className:"flex justify-between items-center px-2 h-12 bottom-10 absolute w-full border-t border-x border-gray-300 bg-white rounded-t-lg ",children:[p.exports.jsx("span",{className:"text-gray-400 whitespace-nowrap truncate",children:l.text}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700 -mt-4",onClick:()=>a(void 0),children:"✕"})]}),p.exports.jsx("input",{type:"text",ref:A,className:"w-full bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-bl-3xl ",placeholder:"Type a message...",value:l.text,onChange:oe,onKeyDown:R=>{R.key==="Enter"&&!R.shiftKey&&(R.preventDefault(),pe())}}),p.exports.jsx(en,{className:"rotate-180 absolute -right-[11.4px] top-5"})]}),p.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:pe,children:p.exports.jsx(gr,{})})]}):p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] relative ",children:[p.exports.jsx("div",{onClick:D,className:"cursor-pointer absolute right-4 top-[11px]",children:p.exports.jsx(If,{})}),p.exports.jsx("input",{type:"file",ref:Q,style:{display:"none"},onChange:$}),p.exports.jsx("input",{type:"text",ref:A,className:"w-full bg-white flex-1 p-2 pr-10 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl ",placeholder:"Type a message...",value:c,onChange:oe,onKeyDown:R=>{R.key==="Enter"&&!R.shiftKey&&(R.preventDefault(),pe())}}),p.exports.jsx(en,{className:"rotate-180 absolute -right-[11.4px] top-5"})]}),p.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:c?pe:W,children:c?p.exports.jsx(gr,{}):p.exports.jsx(Nf,{})})]}),y&&p.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:le,children:[p.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[p.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",p.exports.jsx("span",{className:"text-blue-500",children:y})]}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>S(null),children:"✕"})]}),p.exports.jsxs("div",{className:"space-y-2",children:[o?o.filter(R=>R.symbol===y).map(R=>{var k;const{component:E,lists:V}=R;return E?b?(k=V==null?void 0:V.filter(_=>_==null?void 0:_.name.includes(b)))==null?void 0:k.map((_,I)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(E,{listsProps:_,onClick:(z,U)=>ae(z,U)})},I)):V==null?void 0:V.map((_,I)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(E,{listsProps:_,onClick:(z,U)=>ae(z,U)})},I)):null}):null,p.exports.jsx("div",{className:"h-8",children:F&&"Loading more items..."})]})]})]})};var Ve=(e=>(e[e.File=0]="File",e[e.Voice=1]="Voice",e[e.Video=2]="Video",e[e.Image=3]="Image",e))(Ve||{}),ie=(e=>(e[e.Telegram=0]="Telegram",e[e.Simple=1]="Simple",e))(ie||{});const Vo=({fileName:e,fileSize:t,format:n,src:r,them:s})=>{const i=()=>{const l={rar:p.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:p.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:p.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:p.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:p.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),txt:p.exports.jsx("p",{className:"p-2 text-purple-500 font-bold",children:n}),xls:p.exports.jsx("p",{className:"p-2 text-green-400 font-bold",children:n}),ppt:p.exports.jsx("p",{className:"p-2 text-yellow-500 font-bold",children:n}),png:p.exports.jsx("p",{className:"p-2 text-pink-500 font-bold",children:n}),jpg:p.exports.jsx("p",{className:"p-2 text-indigo-500 font-bold",children:n}),mp3:p.exports.jsx("p",{className:"p-2 text-teal-500 font-bold",children:n}),mp4:p.exports.jsx("p",{className:"p-2 text-gray-500 font-bold",children:n}),exe:p.exports.jsx("p",{className:"p-2 text-red-400 font-bold",children:n}),html:p.exports.jsx("p",{className:"p-2 text-orange-500 font-bold",children:n}),css:p.exports.jsx("p",{className:"p-2 text-blue-300 font-bold",children:n}),js:p.exports.jsx("p",{className:"p-2 text-yellow-400 font-bold",children:n}),json:p.exports.jsx("p",{className:"p-2 text-purple-400 font-bold",children:n}),xml:p.exports.jsx("p",{className:"p-2 text-green-300 font-bold",children:n}),svg:p.exports.jsx("p",{className:"p-2 text-pink-400 font-bold",children:n}),gif:p.exports.jsx("p",{className:"p-2 text-indigo-400 font-bold",children:n}),csv:p.exports.jsx("p",{className:"p-2 text-teal-400 font-bold",children:n}),sql:p.exports.jsx("p",{className:"p-2 text-gray-400 font-bold",children:n})};return n&&l[n]?l[n]:p.exports.jsx("p",{className:"p-2 text-black ",children:n??"UN"})},o=l=>l>1048576?(l/1048576).toFixed(1)+" MB":(l/1024).toFixed(1)+" KB";return p.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[p.exports.jsx("div",{className:` border ${s===ie.Simple?" border-white ":s===ie.Telegram?" border-green-900":""} w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3`,children:i()}),p.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[p.exports.jsx("a",{href:r,download:e,className:`${s===ie.Simple?"text-white":s===ie.Telegram?"text-gray-900":""} font-medium hover:underline`,children:e}),p.exports.jsx("span",{className:`${s===ie.Simple?"text-gray-800":s===ie.Telegram?"text-gray-900":""} text-sm`,children:o(t)})]}),p.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"})]})},Bf=e=>p.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:p.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),$f=e=>p.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:[p.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),p.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let Ot=null;const Uf=({src:e,className:t})=>{const[n,r]=x.useState(!1),[s,i]=x.useState(0),o=x.useRef(null);x.useEffect(()=>{const a=o.current;if(!a)return;const c=()=>{i(a.currentTime/a.duration*100)},u=()=>r(!0),f=()=>r(!1),h=()=>{r(!1),i(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():(Ot&&Ot!==a&&(Ot.pause(),Ot.currentTime=0),a.play(),Ot=a))};return p.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[p.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?p.exports.jsx($f,{}):p.exports.jsx(Bf,{})}),p.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:p.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${s}%`}})}),p.exports.jsx("audio",{ref:o,src:e})]})},Wf=({attachmentUrl:e,attachmentType:t,attachmentFormat:n,them:r})=>e?t===Ve.Voice?p.exports.jsx("div",{className:"w-full",children:p.exports.jsx(Uf,{src:e})}):t===Ve.Image?p.exports.jsx("div",{className:"w-full",children:p.exports.jsx("img",{src:e})}):t===Ve.File?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Vo,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e})}):t===Ve.Video?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Vo,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e})}):null:null,zf=({message:e,showUserProfile:t,handleContextMenu:n,media:r,them:s})=>{var i,o,l,a,c,u,f,h,m,v;return p.exports.jsxs(p.exports.Fragment,{children:[t?p.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,p.exports.jsxs(mr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:y=>n(y,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 ${s===ie.Simple?"bg-[#f8fbff]":s===ie.Telegram?"bg-blue-200 ":""} `,children:[p.exports.jsx("span",{title:(i=e.user)!=null&&i.fullName&&((l=(o=e.user)==null?void 0:o.fullName)==null?void 0:l.length)>16?(a=e.user)==null?void 0:a.firstName:(c=e.user)==null?void 0:c.fullName,className:"relative -top-3 h-4 -mb-3 overflow-y-visible text-xs text-orange-700 whitespace-nowrap truncate max-w-[100px] overflow-visible",children:(u=e.user)!=null&&u.fullName&&((h=(f=e.user)==null?void 0:f.fullName)==null?void 0:h.length)>16?(m=e.user)==null?void 0:m.firstName:(v=e.user)==null?void 0:v.fullName}),r||null,p.exports.jsx("span",{children:e.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]}),e.isEdited?p.exports.jsx("span",{className:`text-xs italic ${s===ie.Simple?"text-gray-700":s===ie.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(en,{className:` ${s===ie.Simple?"[&>g>path]:fill-[#f8fbff]":s===ie.Telegram?"[&>g>path]:fill-blue-200":""} -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 `})]})]})},Yf=({className:e})=>p.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[p.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"}),p.exports.jsx("path",{fillRule:"evenodd",clipRule:"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"})]}),Oo=({size:e=24,color:t="text-current",className:n})=>p.exports.jsx("div",{className:` ${n} animate-spin inline-flex items-center justify-center`,children:p.exports.jsxs("svg",{width:e,height:e,viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[p.exports.jsx("defs",{children:p.exports.jsxs("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:"linearGradient-1",children:[p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),p.exports.jsx("stop",{stopColor:"currentColor",offset:"100%"})]})}),p.exports.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[p.exports.jsx("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),p.exports.jsx("path",{d:"M34,18 C34,9.163444 26.836556,2 18,2 C11.6597233,2 6.18078805,5.68784135 3.59122325,11.0354951",stroke:"url(#linearGradient-1)",strokeWidth:"4",strokeLinecap:"round"})]})]})}),Kf=({handleContextMenu:e,media:t,message:n,them:r})=>p.exports.jsxs(mr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:s=>e(s,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 ${r===ie.Telegram?" bg-green-200":ie.Simple?" bg-[#4F46E5] text-white":""}`,children:[t||null,p.exports.jsx("span",{className:"",children:n.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),n.isSending?p.exports.jsx(Oo,{size:13,color:"text-black"}):p.exports.jsx(Yf,{className:r===ie.Telegram?" ":ie.Simple?" [&>path]:fill-white":""}),n.isEdited?p.exports.jsx("span",{className:`text-xs italic ${r===ie.Simple?"text-gray-200":r===ie.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(en,{className:`fill-blue-200 rotate-180 absolute -right-2 bottom-0 ${r===ie.Telegram?"[&>g>path]:fill-green-200":ie.Simple?"[&>g>path]:fill-[#4F46E5]":""} `})]});var he={exports:{}},yr={exports:{}},Z={};var Lo;function qf(){if(Lo)return Z;Lo=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,s=e?Symbol.for("react.strict_mode"):60108,i=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,m=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,P=e?Symbol.for("react.scope"):60119;function C(g){if(typeof g=="object"&&g!==null){var O=g.$$typeof;switch(O){case t:switch(g=g.type,g){case a:case c:case r:case i:case s:case f:return g;default:switch(g=g&&g.$$typeof,g){case l:case u:case v:case m:case o:return g;default:return O}}case n:return O}}}function L(g){return C(g)===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=m,Z.Portal=n,Z.Profiler=i,Z.StrictMode=s,Z.Suspense=f,Z.isAsyncMode=function(g){return L(g)||C(g)===a},Z.isConcurrentMode=L,Z.isContextConsumer=function(g){return C(g)===l},Z.isContextProvider=function(g){return C(g)===o},Z.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===t},Z.isForwardRef=function(g){return C(g)===u},Z.isFragment=function(g){return C(g)===r},Z.isLazy=function(g){return C(g)===v},Z.isMemo=function(g){return C(g)===m},Z.isPortal=function(g){return C(g)===n},Z.isProfiler=function(g){return C(g)===i},Z.isStrictMode=function(g){return C(g)===s},Z.isSuspense=function(g){return C(g)===f},Z.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===r||g===c||g===i||g===s||g===f||g===h||typeof g=="object"&&g!==null&&(g.$$typeof===v||g.$$typeof===m||g.$$typeof===o||g.$$typeof===l||g.$$typeof===u||g.$$typeof===S||g.$$typeof===b||g.$$typeof===P||g.$$typeof===y)},Z.typeOf=C,Z}var J={};var ko;function Gf(){return ko||(ko=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,s=e?Symbol.for("react.strict_mode"):60108,i=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,m=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,P=e?Symbol.for("react.scope"):60119;function C(M){return typeof M=="string"||typeof M=="function"||M===r||M===c||M===i||M===s||M===f||M===h||typeof M=="object"&&M!==null&&(M.$$typeof===v||M.$$typeof===m||M.$$typeof===o||M.$$typeof===l||M.$$typeof===u||M.$$typeof===S||M.$$typeof===b||M.$$typeof===P||M.$$typeof===y)}function L(M){if(typeof M=="object"&&M!==null){var Ee=M.$$typeof;switch(Ee){case t:var ut=M.type;switch(ut){case a:case c:case r:case i:case s:case f:return ut;default:var He=ut&&ut.$$typeof;switch(He){case l:case u:case v:case m:case o:return He;default:return Ee}}case n:return Ee}}}var g=a,O=c,Y=l,A=o,Q=t,F=u,q=r,oe=v,ne=m,ae=n,pe=i,W=s,H=f,le=!1;function Se(M){return le||(le=!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)||L(M)===a}function T(M){return L(M)===c}function D(M){return L(M)===l}function $(M){return L(M)===o}function R(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function E(M){return L(M)===u}function V(M){return L(M)===r}function k(M){return L(M)===v}function _(M){return L(M)===m}function I(M){return L(M)===n}function z(M){return L(M)===i}function U(M){return L(M)===s}function ve(M){return L(M)===f}J.AsyncMode=g,J.ConcurrentMode=O,J.ContextConsumer=Y,J.ContextProvider=A,J.Element=Q,J.ForwardRef=F,J.Fragment=q,J.Lazy=oe,J.Memo=ne,J.Portal=ae,J.Profiler=pe,J.StrictMode=W,J.Suspense=H,J.isAsyncMode=Se,J.isConcurrentMode=T,J.isContextConsumer=D,J.isContextProvider=$,J.isElement=R,J.isForwardRef=E,J.isFragment=V,J.isLazy=k,J.isMemo=_,J.isPortal=I,J.isProfiler=z,J.isStrictMode=U,J.isSuspense=ve,J.isValidElementType=C,J.typeOf=L}()),J}var _o;function Io(){return _o||(_o=1,function(e){process.env.NODE_ENV==="production"?e.exports=qf():e.exports=Gf()}(yr)),yr.exports}var vr,No;function Hf(){if(No)return vr;No=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function s(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[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 vr=s()?Object.assign:function(i,o){for(var l,a=r(i),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},vr}var xr,Fo;function br(){if(Fo)return xr;Fo=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return xr=e,xr}var Tr,Bo;function $o(){return Bo||(Bo=1,Tr=Function.call.bind(Object.prototype.hasOwnProperty)),Tr}var wr,Uo;function Xf(){if(Uo)return wr;Uo=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=br(),n={},r=$o();e=function(i){var o="Warning: "+i;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(i,o,l,a,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var f;try{if(typeof i[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 i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=i[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 m=c?c():"";e("Failed "+l+" type: "+f.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},wr=s,wr}var Sr,Wo;function Zf(){if(Wo)return Sr;Wo=1;var e=Io(),t=Hf(),n=br(),r=$o(),s=Xf(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(l){var a="Warning: "+l;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}});function o(){return null}return Sr=function(l,a){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(T){var D=T&&(c&&T[c]||T[u]);if(typeof D=="function")return D}var h="<<anonymous>>",m={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:P(),arrayOf:C,element:L(),elementType:g(),instanceOf:O,node:F(),objectOf:A,oneOf:Y,oneOfType:Q,shape:oe,exact:ne};function v(T,D){return T===D?T!==0||1/T===1/D:T!==T&&D!==D}function y(T,D){this.message=T,this.data=D&&typeof D=="object"?D:{},this.stack=""}y.prototype=Error.prototype;function S(T){if(process.env.NODE_ENV!=="production")var D={},$=0;function R(V,k,_,I,z,U,ve){if(I=I||h,U=U||_,ve!==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 Ee=I+":"+_;!D[Ee]&&$<3&&(i("You are manually calling a React.PropTypes validation function for the `"+U+"` prop on `"+I+"`. 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."),D[Ee]=!0,$++)}}return k[_]==null?V?k[_]===null?new y("The "+z+" `"+U+"` is marked as required "+("in `"+I+"`, but its value is `null`.")):new y("The "+z+" `"+U+"` is marked as required in "+("`"+I+"`, but its value is `undefined`.")):null:T(k,_,I,z,U)}var E=R.bind(null,!1);return E.isRequired=R.bind(null,!0),E}function b(T){function D($,R,E,V,k,_){var I=$[R],z=W(I);if(z!==T){var U=H(I);return new y("Invalid "+V+" `"+k+"` of type "+("`"+U+"` supplied to `"+E+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return S(D)}function P(){return S(o)}function C(T){function D($,R,E,V,k){if(typeof T!="function")return new y("Property `"+k+"` of component `"+E+"` has invalid PropType notation inside arrayOf.");var _=$[R];if(!Array.isArray(_)){var I=W(_);return new y("Invalid "+V+" `"+k+"` of type "+("`"+I+"` supplied to `"+E+"`, expected an array."))}for(var z=0;z<_.length;z++){var U=T(_,z,E,V,k+"["+z+"]",n);if(U instanceof Error)return U}return null}return S(D)}function L(){function T(D,$,R,E,V){var k=D[$];if(!l(k)){var _=W(k);return new y("Invalid "+E+" `"+V+"` of type "+("`"+_+"` supplied to `"+R+"`, expected a single ReactElement."))}return null}return S(T)}function g(){function T(D,$,R,E,V){var k=D[$];if(!e.isValidElementType(k)){var _=W(k);return new y("Invalid "+E+" `"+V+"` of type "+("`"+_+"` supplied to `"+R+"`, expected a single ReactElement type."))}return null}return S(T)}function O(T){function D($,R,E,V,k){if(!($[R]instanceof T)){var _=T.name||h,I=Se($[R]);return new y("Invalid "+V+" `"+k+"` of type "+("`"+I+"` supplied to `"+E+"`, expected ")+("instance of `"+_+"`."))}return null}return S(D)}function Y(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("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])."):i("Invalid argument supplied to oneOf, expected an array.")),o;function D($,R,E,V,k){for(var _=$[R],I=0;I<T.length;I++)if(v(_,T[I]))return null;var z=JSON.stringify(T,function(ve,M){var Ee=H(M);return Ee==="symbol"?String(M):M});return new y("Invalid "+V+" `"+k+"` of value `"+String(_)+"` "+("supplied to `"+E+"`, expected one of "+z+"."))}return S(D)}function A(T){function D($,R,E,V,k){if(typeof T!="function")return new y("Property `"+k+"` of component `"+E+"` has invalid PropType notation inside objectOf.");var _=$[R],I=W(_);if(I!=="object")return new y("Invalid "+V+" `"+k+"` of type "+("`"+I+"` supplied to `"+E+"`, expected an object."));for(var z in _)if(r(_,z)){var U=T(_,z,E,V,k+"."+z,n);if(U instanceof Error)return U}return null}return S(D)}function Q(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var D=0;D<T.length;D++){var $=T[D];if(typeof $!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+le($)+" at index "+D+"."),o}function R(E,V,k,_,I){for(var z=[],U=0;U<T.length;U++){var ve=T[U],M=ve(E,V,k,_,I,n);if(M==null)return null;M.data&&r(M.data,"expectedType")&&z.push(M.data.expectedType)}var Ee=z.length>0?", expected one of type ["+z.join(", ")+"]":"";return new y("Invalid "+_+" `"+I+"` supplied to "+("`"+k+"`"+Ee+"."))}return S(R)}function F(){function T(D,$,R,E,V){return ae(D[$])?null:new y("Invalid "+E+" `"+V+"` supplied to "+("`"+R+"`, expected a ReactNode."))}return S(T)}function q(T,D,$,R,E){return new y((T||"React class")+": "+D+" type `"+$+"."+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+E+"`.")}function oe(T){function D($,R,E,V,k){var _=$[R],I=W(_);if(I!=="object")return new y("Invalid "+V+" `"+k+"` of type `"+I+"` "+("supplied to `"+E+"`, expected `object`."));for(var z in T){var U=T[z];if(typeof U!="function")return q(E,V,k,z,H(U));var ve=U(_,z,E,V,k+"."+z,n);if(ve)return ve}return null}return S(D)}function ne(T){function D($,R,E,V,k){var _=$[R],I=W(_);if(I!=="object")return new y("Invalid "+V+" `"+k+"` of type `"+I+"` "+("supplied to `"+E+"`, expected `object`."));var z=t({},$[R],T);for(var U in z){var ve=T[U];if(r(T,U)&&typeof ve!="function")return q(E,V,k,U,H(ve));if(!ve)return new y("Invalid "+V+" `"+k+"` key `"+U+"` supplied to `"+E+"`.\nBad object: "+JSON.stringify($[R],null," ")+`
20
+ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var M=ve(_,U,E,V,k+"."+U,n);if(M)return M}return null}return S(D)}function ae(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(ae);if(T===null||l(T))return!0;var D=f(T);if(D){var $=D.call(T),R;if(D!==T.entries){for(;!(R=$.next()).done;)if(!ae(R.value))return!1}else for(;!(R=$.next()).done;){var E=R.value;if(E&&!ae(E[1]))return!1}}else return!1;return!0;default:return!1}}function pe(T,D){return T==="symbol"?!0:D?D["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&D instanceof Symbol:!1}function W(T){var D=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":pe(D,T)?"symbol":D}function H(T){if(typeof T>"u"||T===null)return""+T;var D=W(T);if(D==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return D}function le(T){var D=H(T);switch(D){case"array":case"object":return"an "+D;case"boolean":case"date":case"regexp":return"a "+D;default:return D}}function Se(T){return!T.constructor||!T.constructor.name?h:T.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},Sr}var Pr,zo;function Jf(){if(zo)return Pr;zo=1;var e=br();function t(){}function n(){}return n.resetWarningCache=t,Pr=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 s(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Pr}if(process.env.NODE_ENV!=="production"){var Qf=Io(),ed=!0;he.exports=Zf()(Qf.isElement,ed)}else he.exports=Jf()();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 td(e,t){if(e==null)return{};var n=nd(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nd(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Er=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=td(e,["color","size"]);return x.createElement("svg",Cr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,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"}))});Er.propTypes={color:he.exports.string,size:he.exports.oneOfType([he.exports.string,he.exports.number])},Er.displayName="Check";const rd=Er;function jr(){return jr=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},jr.apply(this,arguments)}function sd(e,t){if(e==null)return{};var n=id(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(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),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Ar=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=sd(e,["color","size"]);return x.createElement("svg",jr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,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"}))});Ar.propTypes={color:he.exports.string,size:he.exports.oneOfType([he.exports.string,he.exports.number])},Ar.displayName="Copy";const od=Ar;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 ad(e,t){if(e==null)return{};var n=ld(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ld(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Dr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=ad(e,["color","size"]);return x.createElement("svg",Mr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,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"}))});Dr.propTypes={color:he.exports.string,size:he.exports.oneOfType([he.exports.string,he.exports.number])},Dr.displayName="Edit";const ud=Dr;function Rr(){return Rr=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},Rr.apply(this,arguments)}function cd(e,t){if(e==null)return{};var n=fd(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fd(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Vr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=cd(e,["color","size"]);return x.createElement("svg",Rr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,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"}))});Vr.propTypes={color:he.exports.string,size:he.exports.oneOfType([he.exports.string,he.exports.number])},Vr.displayName="Trash";const dd=Vr,hd=({user:e,messages:t,updateMessages:n,onMessageSent:r,onEditMessage:s,isSendingDefultForNewMessage:i,isSendingDefultForEdited:o,onDeleteMessage:l})=>{const a=x.useRef(null),[c,u]=x.useState(!1),[f,h]=x.useState(null),[m,v]=x.useState(),[y,S]=x.useState(null),b=()=>{setTimeout(()=>{a.current&&(a.current.scrollTop=a.current.scrollHeight)},100)};x.useEffect(()=>{const F=()=>{S(null)};return window.addEventListener("scroll",F,!0),()=>{window.removeEventListener("scroll",F,!0)}},[S]);const P=(F,q)=>{F.preventDefault();const oe=window.scrollX,ne=window.scrollY;S({x:F.clientX+oe,y:F.clientY+ne,message:q})},C=()=>{S(null)},L=F=>{const q=new Xe({id:new Date().toString(),text:F,user:e,isRightSided:!0,isSending:i,createdDate:new Date().toString()});n([...t,q]),r(q),b()},g=F=>{n(t.map(q=>q.id===F.id?(F.updateIsSending(Boolean(o)),F):q)),s(F)},O=F=>{const q=URL.createObjectURL(F),oe=new Xe({id:new Date().toString(),text:"",attachmentUrl:q,attachmentType:Ve.Voice,attachmentBlob:F,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,oe]),r(oe),b()},Y=(F,q)=>{const oe=URL.createObjectURL(F),ne=new Xe({id:new Date().toString(),text:"",attachmentUrl:oe,attachmentBlob:F,attachmentType:q,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,ne]),r(ne),b()};return{handleDeleteConfirmation:()=>{f&&(l(f),h(null)),u(!1)},handleCloseContextMenu:C,contextMenuItems:[{name:"Edit",icon:p.exports.jsx(ud,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:F=>{v(t.find(q=>q.id===F)),C()}},{name:"Delete",icon:p.exports.jsx(dd,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:F=>{h(F),u(!0),C()}},{name:"Select",icon:p.exports.jsx(rd,{className:"text-green-600"}),disabled:!0,onClick:()=>{console.log("Select clicked"),C()}},{name:"Copy",icon:p.exports.jsx(od,{className:"text-blue-600"}),onClick:F=>{const q=t.find(oe=>oe.id===F);q&&navigator.clipboard.writeText(q.text),C()}}],handleSendFile:Y,handleSendVoice:O,handleSendMessage:L,handleContextMenu:P,isModalOpen:c,contextMenu:y,chatRef:a,setIsModalOpen:u,messageToEdit:m,setMessageToEdit:v,handleEditMessage:g}},pd=({width:e="400px",height:t="600px",isLoadingChat:n,className:r,style:s,messages:i,user:o,updateMessages:l,onMessageSent:a,onDeleteMessage:c,onEditMessage:u,dynamicSymbolAssignments:f,isSendingDefultForNewMessage:h,isSendingDefultForEdited:m,backgroundImage:v,them:y=ie.Telegram})=>{var ae,pe;const{handleDeleteConfirmation:S,handleCloseContextMenu:b,handleSendFile:P,handleSendVoice:C,handleSendMessage:L,handleContextMenu:g,contextMenuItems:O,isModalOpen:Y,contextMenu:A,chatRef:Q,setIsModalOpen:F,messageToEdit:q,setMessageToEdit:oe,handleEditMessage:ne}=hd({user:o,messages:i,updateMessages:l,onMessageSent:a,onEditMessage:u,onDeleteMessage:c,isSendingDefultForNewMessage:h,isSendingDefultForEdited:m});return p.exports.jsxs("div",{className:`flex flex-col !bg-cover ${r}`,style:{width:e,height:t,background:"url("+v+")",...s},onClick:b,children:[p.exports.jsx("div",{ref:Q,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${A?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:n?p.exports.jsx(Oo,{className:"mt-3",size:27,color:"text-gray-800"}):p.exports.jsx(Wr,{children:i.length>0?i.map((W,H)=>{var T,D,$;const le=W!=null&&W.attachmentUrl?p.exports.jsx(Wf,{attachmentUrl:W.attachmentUrl,attachmentType:W==null?void 0:W.attachmentType,attachmentFormat:W==null?void 0:W.attachmentFormat},H):null;if(W.isRightSided)return p.exports.jsx(Kf,{media:le,handleContextMenu:g,message:W,them:y},H);const Se=((D=(T=i[H-1])==null?void 0:T.user)==null?void 0:D.id)!==(($=W==null?void 0:W.user)==null?void 0:$.id);return p.exports.jsx(zf,{showUserProfile:Se,media:le,handleContextMenu:g,message:W,them:y},H)}):null})}),p.exports.jsx(Lf,{isOpen:Y,onClose:()=>F(!1),onConfirm:S,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),A&&((ae=A==null?void 0:A.message)!=null&&ae.id)?p.exports.jsx(kf,{items:O,isVisible:Boolean(A),messageId:String(A==null?void 0:A.message.id),isCurrentUserMessage:((pe=A==null?void 0:A.message)==null?void 0:pe.user.id)===o.id,position:{x:A==null?void 0:A.x,y:A==null?void 0:A.y}}):null,p.exports.jsx(Ff,{onSendVoice:C,onSendMessage:L,onFileSend:W=>P(W,Ve.File),onImageSend:W=>P(W,Ve.Image),onVideoSend:W=>P(W,Ve.Video),dynamicSymbolAssignments:f,messageToEdit:q,setMessageToEdit:oe,onEditMessage:ne})]})};de.AttachmentTypeEnum=Ve,de.Button=aa,de.Chat=pd,de.ChatThemEntity=ie,de.MessageEntity=Xe,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});
21
21
  //# sourceMappingURL=index.umd.js.map