Some checks failed
CI/CD - Francia Ocupada (La Resistencia) / build-and-deploy (push) Failing after 8s
9 lines
143 KiB
JavaScript
9 lines
143 KiB
JavaScript
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[59],{2601:function(t,e,i){"use strict";var r,s;t.exports=(null==(r=i.g.process)?void 0:r.env)&&"object"==typeof(null==(s=i.g.process)?void 0:s.env)?i.g.process:i(8960)},8960:function(t){!function(){var e={229:function(t){var e,i,r,s=t.exports={};function n(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(i){try{return e.call(null,t,0)}catch(i){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:n}catch(t){e=n}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var l=[],h=!1,u=-1;function c(){h&&r&&(h=!1,r.length?l=r.concat(l):u=-1,l.length&&p())}function p(){if(!h){var t=a(c);h=!0;for(var e=l.length;e;){for(r=l,l=[];++u<e;)r&&r[u].run();u=-1,e=l.length}r=null,h=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function f(){}s.nextTick=function(t){var e=Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];l.push(new d(t,e)),1!==l.length||h||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=f,s.addListener=f,s.once=f,s.off=f,s.removeListener=f,s.removeAllListeners=f,s.emit=f,s.prependListener=f,s.prependOnceListener=f,s.listeners=function(t){return[]},s.binding=function(t){throw Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw Error("process.chdir is not supported")},s.umask=function(){return 0}}},i={};function r(t){var s=i[t];if(void 0!==s)return s.exports;var n=i[t]={exports:{}},o=!0;try{e[t](n,n.exports,r),o=!1}finally{o&&delete i[t]}return n.exports}r.ab="//";var s=r(229);t.exports=s}()},622:function(t,e,i){"use strict";var r=i(2265),s=Symbol.for("react.element"),n=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function h(t,e,i){var r,n={},h=null,u=null;for(r in void 0!==i&&(h=""+i),void 0!==e.key&&(h=""+e.key),void 0!==e.ref&&(u=e.ref),e)o.call(e,r)&&!l.hasOwnProperty(r)&&(n[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps)void 0===n[r]&&(n[r]=e[r]);return{$$typeof:s,type:t,key:h,ref:u,props:n,_owner:a.current}}e.Fragment=n,e.jsx=h,e.jsxs=h},7437:function(t,e,i){"use strict";t.exports=i(622)},2167:function(t,e,i){"use strict";i.d(e,{M:function(){return g}});var r=i(2265),s=i(538);function n(){let t=(0,r.useRef)(!1);return(0,s.L)(()=>(t.current=!0,()=>{t.current=!1}),[]),t}var o=i(2363),a=i(8243),l=i(961);class h extends r.Component{getSnapshotBeforeUpdate(t){let e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){let t=this.props.sizeRef.current;t.height=e.offsetHeight||0,t.width=e.offsetWidth||0,t.top=e.offsetTop,t.left=e.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function u({children:t,isPresent:e}){let i=(0,r.useId)(),s=(0,r.useRef)(null),n=(0,r.useRef)({width:0,height:0,top:0,left:0});return(0,r.useInsertionEffect)(()=>{let{width:t,height:r,top:o,left:a}=n.current;if(e||!s.current||!t||!r)return;s.current.dataset.motionPopId=i;let l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`
|
|
[data-motion-pop-id="${i}"] {
|
|
position: absolute !important;
|
|
width: ${t}px !important;
|
|
height: ${r}px !important;
|
|
top: ${o}px !important;
|
|
left: ${a}px !important;
|
|
}
|
|
`),()=>{document.head.removeChild(l)}},[e]),r.createElement(h,{isPresent:e,childRef:s,sizeRef:n},r.cloneElement(t,{ref:s}))}let c=({children:t,initial:e,isPresent:i,onExitComplete:s,custom:n,presenceAffectsLayout:o,mode:h})=>{let c=(0,l.h)(p),d=(0,r.useId)(),f=(0,r.useMemo)(()=>({id:d,initial:e,isPresent:i,custom:n,onExitComplete:t=>{for(let e of(c.set(t,!0),c.values()))if(!e)return;s&&s()},register:t=>(c.set(t,!1),()=>c.delete(t))}),o?void 0:[i]);return(0,r.useMemo)(()=>{c.forEach((t,e)=>c.set(e,!1))},[i]),r.useEffect(()=>{i||c.size||!s||s()},[i]),"popLayout"===h&&(t=r.createElement(u,{isPresent:i},t)),r.createElement(a.O.Provider,{value:f},t)};function p(){return new Map}var d=i(781),f=i(6567);let m=t=>t.key||"",g=({children:t,custom:e,initial:i=!0,onExitComplete:a,exitBeforeEnter:l,presenceAffectsLayout:h=!0,mode:u="sync"})=>{var p;(0,f.k)(!l,"Replace exitBeforeEnter with mode='wait'");let g=(0,r.useContext)(d.p).forceRender||function(){let t=n(),[e,i]=(0,r.useState)(0),s=(0,r.useCallback)(()=>{t.current&&i(e+1)},[e]),a=(0,r.useCallback)(()=>o.Wi.postRender(s),[s]);return[a,e]}()[0],y=n(),v=function(t){let e=[];return r.Children.forEach(t,t=>{(0,r.isValidElement)(t)&&e.push(t)}),e}(t),b=v,x=(0,r.useRef)(new Map).current,w=(0,r.useRef)(b),T=(0,r.useRef)(new Map).current,P=(0,r.useRef)(!0);if((0,s.L)(()=>{P.current=!1,function(t,e){t.forEach(t=>{let i=m(t);e.set(i,t)})}(v,T),w.current=b}),p=()=>{P.current=!0,T.clear(),x.clear()},(0,r.useEffect)(()=>()=>p(),[]),P.current)return r.createElement(r.Fragment,null,b.map(t=>r.createElement(c,{key:m(t),isPresent:!0,initial:!!i&&void 0,presenceAffectsLayout:h,mode:u},t)));b=[...b];let A=w.current.map(m),E=v.map(m),k=A.length;for(let t=0;t<k;t++){let e=A[t];-1!==E.indexOf(e)||x.has(e)||x.set(e,void 0)}return"wait"===u&&x.size&&(b=[]),x.forEach((t,i)=>{if(-1!==E.indexOf(i))return;let s=T.get(i);if(!s)return;let n=A.indexOf(i),o=t;o||(o=r.createElement(c,{key:m(s),isPresent:!1,onExitComplete:()=>{x.delete(i);let t=Array.from(T.keys()).filter(t=>!E.includes(t));if(t.forEach(t=>T.delete(t)),w.current=v.filter(e=>{let r=m(e);return r===i||t.includes(r)}),!x.size){if(!1===y.current)return;g(),a&&a()}},custom:e,presenceAffectsLayout:h,mode:u},s),x.set(i,o)),b.splice(n,0,o)}),b=b.map(t=>{let e=t.key;return x.has(e)?t:r.createElement(c,{key:m(t),isPresent:!0,presenceAffectsLayout:h,mode:u},t)}),r.createElement(r.Fragment,null,x.size?b:b.map(t=>(0,r.cloneElement)(t)))}},781:function(t,e,i){"use strict";i.d(e,{p:function(){return s}});var r=i(2265);let s=(0,r.createContext)({})},8243:function(t,e,i){"use strict";i.d(e,{O:function(){return s}});var r=i(2265);let s=(0,r.createContext)(null)},2363:function(t,e,i){"use strict";i.d(e,{Pn:function(){return a},Wi:function(){return o},frameData:function(){return l},S6:function(){return h}});var r=i(9588);class s{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){let e=this.order.indexOf(t);-1!==e&&(this.order.splice(e,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}let n=["prepare","read","update","preRender","render","postRender"],{schedule:o,cancel:a,state:l,steps:h}=function(t,e){let i=!1,r=!0,o={delta:0,timestamp:0,isProcessing:!1},a=n.reduce((t,e)=>(t[e]=function(t){let e=new s,i=new s,r=0,n=!1,o=!1,a=new WeakSet,l={schedule:(t,s=!1,o=!1)=>{let l=o&&n,h=l?e:i;return s&&a.add(t),h.add(t)&&l&&n&&(r=e.order.length),t},cancel:t=>{i.remove(t),a.delete(t)},process:s=>{if(n){o=!0;return}if(n=!0,[e,i]=[i,e],i.clear(),r=e.order.length)for(let i=0;i<r;i++){let r=e.order[i];r(s),a.has(r)&&(l.schedule(r),t())}n=!1,o&&(o=!1,l.process(s))}};return l}(()=>i=!0),t),{}),l=t=>a[t].process(o),h=()=>{let s=performance.now();i=!1,o.delta=r?1e3/60:Math.max(Math.min(s-o.timestamp,40),1),o.timestamp=s,o.isProcessing=!0,n.forEach(l),o.isProcessing=!1,i&&e&&(r=!1,t(h))},u=()=>{i=!0,r=!0,o.isProcessing||t(h)},c=n.reduce((t,e)=>{let r=a[e];return t[e]=(t,e=!1,s=!1)=>(i||u(),r.schedule(t,e,s)),t},{});return{schedule:c,cancel:t=>n.forEach(e=>a[e].cancel(t)),state:o,steps:a}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:r.Z,!0)},5251:function(t,e,i){"use strict";let r;i.d(e,{E:function(){return sY}});var s,n,o=i(2265);let a=(0,o.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),l=(0,o.createContext)({});var h=i(8243),u=i(538);let c=(0,o.createContext)({strict:!1}),p=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),d="data-"+p("framerAppearId");function f(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function m(t){return"string"==typeof t||Array.isArray(t)}function g(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}let y=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],v=["initial",...y];function b(t){return g(t.animate)||v.some(e=>m(t[e]))}function x(t){return!!(b(t)||t.variants)}function w(t){return Array.isArray(t)?t.join(" "):t}let T={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"]},P={};for(let t in T)P[t]={isEnabled:e=>T[t].some(t=>!!e[t])};var A=i(6613),E=i(781);let k=(0,o.createContext)({}),S=Symbol.for("motionComponentSymbol"),_=["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 C(t){if("string"!=typeof t||t.includes("-"));else if(_.indexOf(t)>-1||/[A-Z]/.test(t))return!0;return!1}let R={},V=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],L=new Set(V);function D(t,{layout:e,layoutId:i}){return L.has(t)||t.startsWith("origin")||(e||void 0!==i)&&(!!R[t]||"opacity"===t)}let O=t=>!!(t&&t.getVelocity),M={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},B=V.length,j=t=>e=>"string"==typeof e&&e.startsWith(t),F=j("--"),N=j("var(--"),U=(t,e)=>e&&"number"==typeof t?e.transform(t):t,I=(t,e,i)=>Math.min(Math.max(i,t),e),W={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},q={...W,transform:t=>I(0,1,t)},$={...W,default:1},H=t=>Math.round(1e5*t)/1e5,z=/(-)?([\d]*\.?[\d])+/g,Y=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Z=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function X(t){return"string"==typeof t}let K=t=>({test:e=>X(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),G=K("deg"),J=K("%"),Q=K("px"),tt=K("vh"),te=K("vw"),ti={...J,parse:t=>J.parse(t)/100,transform:t=>J.transform(100*t)},tr={...W,transform:Math.round},ts={borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,radius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,size:Q,top:Q,right:Q,bottom:Q,left:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,rotate:G,rotateX:G,rotateY:G,rotateZ:G,scale:$,scaleX:$,scaleY:$,scaleZ:$,skew:G,skewX:G,skewY:G,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:q,originX:ti,originY:ti,originZ:Q,zIndex:tr,fillOpacity:q,strokeOpacity:q,numOctaves:tr};function tn(t,e,i,r){let{style:s,vars:n,transform:o,transformOrigin:a}=t,l=!1,h=!1,u=!0;for(let t in e){let i=e[t];if(F(t)){n[t]=i;continue}let r=ts[t],c=U(i,r);if(L.has(t)){if(l=!0,o[t]=c,!u)continue;i!==(r.default||0)&&(u=!1)}else t.startsWith("origin")?(h=!0,a[t]=c):s[t]=c}if(!e.transform&&(l||r?s.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:i=!0},r,s){let n="";for(let e=0;e<B;e++){let i=V[e];if(void 0!==t[i]){let e=M[i]||i;n+=`${e}(${t[i]}) `}}return e&&!t.z&&(n+="translateZ(0)"),n=n.trim(),s?n=s(t,r?"":n):i&&r&&(n="none"),n}(t.transform,i,u,r):s.transform&&(s.transform="none")),h){let{originX:t="50%",originY:e="50%",originZ:i=0}=a;s.transformOrigin=`${t} ${e} ${i}`}}let to=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ta(t,e,i){for(let r in e)O(e[r])||D(r,i)||(t[r]=e[r])}function tl(t,e,i){let r={},s=function(t,e,i){let r=t.style||{},s={};return ta(s,r,t),Object.assign(s,function({transformTemplate:t},e,i){return(0,o.useMemo)(()=>{let r=to();return tn(r,e,{enableHardwareAcceleration:!i},t),Object.assign({},r.vars,r.style)},[e])}(t,e,i)),t.transformValues?t.transformValues(s):s}(t,e,i);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=!0===t.drag?"none":`pan-${"x"===t.drag?"y":"x"}`),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=s,r}let th=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function tu(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||th.has(t)}let tc=t=>!tu(t);try{(s=require("@emotion/is-prop-valid").default)&&(tc=t=>t.startsWith("on")?!tu(t):s(t))}catch(t){}function tp(t,e,i){return"string"==typeof t?t:Q.transform(e+i*t)}let td={offset:"stroke-dashoffset",array:"stroke-dasharray"},tf={offset:"strokeDashoffset",array:"strokeDasharray"};function tm(t,{attrX:e,attrY:i,attrScale:r,originX:s,originY:n,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...h},u,c,p){if(tn(t,h,u,p),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};let{attrs:d,style:f,dimensions:m}=t;d.transform&&(m&&(f.transform=d.transform),delete d.transform),m&&(void 0!==s||void 0!==n||f.transform)&&(f.transformOrigin=function(t,e,i){let r=tp(e,t.x,t.width),s=tp(i,t.y,t.height);return`${r} ${s}`}(m,void 0!==s?s:.5,void 0!==n?n:.5)),void 0!==e&&(d.x=e),void 0!==i&&(d.y=i),void 0!==r&&(d.scale=r),void 0!==o&&function(t,e,i=1,r=0,s=!0){t.pathLength=1;let n=s?td:tf;t[n.offset]=Q.transform(-r);let o=Q.transform(e),a=Q.transform(i);t[n.array]=`${o} ${a}`}(d,o,a,l,!1)}let tg=()=>({...to(),attrs:{}}),ty=t=>"string"==typeof t&&"svg"===t.toLowerCase();function tv(t,e,i,r){let s=(0,o.useMemo)(()=>{let i=tg();return tm(i,e,{enableHardwareAcceleration:!1},ty(r),t.transformTemplate),{...i.attrs,style:{...i.style}}},[e]);if(t.style){let e={};ta(e,t.style,t),s.style={...e,...s.style}}return s}function tb(t,{style:e,vars:i},r,s){for(let n in Object.assign(t.style,e,s&&s.getProjectionStyles(r)),i)t.style.setProperty(n,i[n])}let tx=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 tw(t,e,i,r){for(let i in tb(t,e,void 0,r),e.attrs)t.setAttribute(tx.has(i)?i:p(i),e.attrs[i])}function tT(t,e){let{style:i}=t,r={};for(let s in i)(O(i[s])||e.style&&O(e.style[s])||D(s,t))&&(r[s]=i[s]);return r}function tP(t,e){let i=tT(t,e);for(let r in t)if(O(t[r])||O(e[r])){let e=-1!==V.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[e]=t[r]}return i}function tA(t,e,i,r={},s={}){return"function"==typeof e&&(e=e(void 0!==i?i:t.custom,r,s)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==i?i:t.custom,r,s)),e}var tE=i(961);let tk=t=>Array.isArray(t),tS=t=>!!(t&&"object"==typeof t&&t.mix&&t.toValue),t_=t=>tk(t)?t[t.length-1]||0:t;function tC(t){let e=O(t)?t.get():t;return tS(e)?e.toValue():e}let tR=t=>(e,i)=>{let r=(0,o.useContext)(l),s=(0,o.useContext)(h.O),n=()=>(function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:i},r,s,n){let o={latestValues:function(t,e,i,r){let s={},n=r(t,{});for(let t in n)s[t]=tC(n[t]);let{initial:o,animate:a}=t,l=b(t),h=x(t);e&&h&&!l&&!1!==t.inherit&&(void 0===o&&(o=e.initial),void 0===a&&(a=e.animate));let u=!!i&&!1===i.initial;u=u||!1===o;let c=u?a:o;if(c&&"boolean"!=typeof c&&!g(c)){let e=Array.isArray(c)?c:[c];e.forEach(e=>{let i=tA(t,e);if(!i)return;let{transitionEnd:r,transition:n,...o}=i;for(let t in o){let e=o[t];if(Array.isArray(e)){let t=u?e.length-1:0;e=e[t]}null!==e&&(s[t]=e)}for(let t in r)s[t]=r[t]})}return s}(r,s,n,t),renderState:e()};return i&&(o.mount=t=>i(r,t,o)),o})(t,e,r,s);return i?n():(0,tE.h)(n)};var tV=i(2363);let tL={useVisualState:tR({scrapeMotionValuesFromProps:tP,createRenderState:tg,onMount:(t,e,{renderState:i,latestValues:r})=>{tV.Wi.read(()=>{try{i.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){i.dimensions={x:0,y:0,width:0,height:0}}}),tV.Wi.render(()=>{tm(i,r,{enableHardwareAcceleration:!1},ty(e.tagName),t.transformTemplate),tw(e,i)})}})},tD={useVisualState:tR({scrapeMotionValuesFromProps:tT,createRenderState:to})};function tO(t,e,i,r={passive:!0}){return t.addEventListener(e,i,r),()=>t.removeEventListener(e,i)}let tM=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function tB(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}let tj=t=>e=>tM(e)&&t(e,tB(e));function tF(t,e,i,r){return tO(t,e,tj(i),r)}let tN=(t,e)=>i=>e(t(i)),tU=(...t)=>t.reduce(tN);function tI(t){let e=null;return()=>null===e&&(e=t,()=>{e=null})}let tW=tI("dragHorizontal"),tq=tI("dragVertical");function t$(t){let e=!1;if("y"===t)e=tq();else if("x"===t)e=tW();else{let t=tW(),i=tq();t&&i?e=()=>{t(),i()}:(t&&t(),i&&i())}return e}function tH(){let t=t$(!0);return!t||(t(),!1)}class tz{constructor(t){this.isMounted=!1,this.node=t}update(){}}function tY(t,e){let i="onHover"+(e?"Start":"End");return tF(t.current,"pointer"+(e?"enter":"leave"),(r,s)=>{if("touch"===r.pointerType||tH())return;let n=t.getProps();t.animationState&&n.whileHover&&t.animationState.setActive("whileHover",e),n[i]&&tV.Wi.update(()=>n[i](r,s))},{passive:!t.getProps()[i]})}class tZ extends tz{mount(){this.unmount=tU(tY(this.node,!0),tY(this.node,!1))}unmount(){}}class tX extends tz{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){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=tU(tO(this.node.current,"focus",()=>this.onFocus()),tO(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}let tK=(t,e)=>!!e&&(t===e||tK(t,e.parentElement));var tG=i(9588);function tJ(t,e){if(!e)return;let i=new PointerEvent("pointer"+t);e(i,tB(i))}class tQ extends tz{constructor(){super(...arguments),this.removeStartListeners=tG.Z,this.removeEndListeners=tG.Z,this.removeAccessibleListeners=tG.Z,this.startPointerPress=(t,e)=>{if(this.isPressing)return;this.removeEndListeners();let i=this.node.getProps(),r=tF(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;let{onTap:i,onTapCancel:r,globalTapTarget:s}=this.node.getProps();tV.Wi.update(()=>{s||tK(this.node.current,t.target)?i&&i(t,e):r&&r(t,e)})},{passive:!(i.onTap||i.onPointerUp)}),s=tF(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=tU(r,s),this.startPress(t,e)},this.startAccessiblePress=()=>{let t=tO(this.node.current,"keydown",t=>{"Enter"!==t.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=tO(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&tJ("up",(t,e)=>{let{onTap:i}=this.node.getProps();i&&tV.Wi.update(()=>i(t,e))})}),tJ("down",(t,e)=>{this.startPress(t,e)}))}),e=tO(this.node.current,"blur",()=>{this.isPressing&&tJ("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=tU(t,e)}}startPress(t,e){this.isPressing=!0;let{onTapStart:i,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&tV.Wi.update(()=>i(t,e))}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;let t=this.node.getProps();return t.whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!tH()}cancelPress(t,e){if(!this.checkPressEnd())return;let{onTapCancel:i}=this.node.getProps();i&&tV.Wi.update(()=>i(t,e))}mount(){let t=this.node.getProps(),e=tF(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),i=tO(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=tU(e,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}let t0=new WeakMap,t1=new WeakMap,t2=t=>{let e=t0.get(t.target);e&&e(t)},t5=t=>{t.forEach(t2)},t3={some:0,all:1};class t6 extends tz{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:e,margin:i,amount:r="some",once:s}=t,n={root:e?e.current:void 0,rootMargin:i,threshold:"number"==typeof r?r:t3[r]};return function(t,e,i){let r=function({root:t,...e}){let i=t||document;t1.has(i)||t1.set(i,{});let r=t1.get(i),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(t5,{root:t,...e})),r[s]}(e);return t0.set(t,i),r.observe(t),()=>{t0.delete(t),r.unobserve(t)}}(this.node.current,n,t=>{let{isIntersecting:e}=t;if(this.isInView===e||(this.isInView=e,s&&!e&&this.hasEnteredView))return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);let{onViewportEnter:i,onViewportLeave:r}=this.node.getProps(),n=e?i:r;n&&n(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;let{props:t,prevProps:e}=this.node,i=["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e));i&&this.startObserver()}unmount(){}}function t4(t,e){if(!Array.isArray(e))return!1;let i=e.length;if(i!==t.length)return!1;for(let r=0;r<i;r++)if(e[r]!==t[r])return!1;return!0}function t8(t,e,i){let r=t.getProps();return tA(r,e,void 0!==i?i:r.custom,function(t){let e={};return t.values.forEach((t,i)=>e[i]=t.get()),e}(t),function(t){let e={};return t.values.forEach((t,i)=>e[i]=t.getVelocity()),e}(t))}var t9=i(6567);let t7=t=>1e3*t,et=t=>t/1e3,ee={current:!1},ei=t=>Array.isArray(t)&&"number"==typeof t[0],er=([t,e,i,r])=>`cubic-bezier(${t}, ${e}, ${i}, ${r})`,es={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:er([0,.65,.55,1]),circOut:er([.55,0,1,.45]),backIn:er([.31,.01,.66,-.59]),backOut:er([.33,1.53,.69,.99])},en=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function eo(t,e,i,r){if(t===e&&i===r)return tG.Z;let s=e=>(function(t,e,i,r,s){let n,o;let a=0;do(n=en(o=e+(i-e)/2,r,s)-t)>0?i=o:e=o;while(Math.abs(n)>1e-7&&++a<12);return o})(e,0,1,t,i);return t=>0===t||1===t?t:en(s(t),e,r)}let ea=eo(.42,0,1,1),el=eo(0,0,.58,1),eh=eo(.42,0,.58,1),eu=t=>Array.isArray(t)&&"number"!=typeof t[0],ec=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ep=t=>e=>1-t(1-e),ed=t=>1-Math.sin(Math.acos(t)),ef=ep(ed),em=ec(ed),eg=eo(.33,1.53,.69,.99),ey=ep(eg),ev=ec(ey),eb={linear:tG.Z,easeIn:ea,easeInOut:eh,easeOut:el,circIn:ed,circInOut:em,circOut:ef,backIn:ey,backInOut:ev,backOut:eg,anticipate:t=>(t*=2)<1?.5*ey(t):.5*(2-Math.pow(2,-10*(t-1)))},ex=t=>{if(Array.isArray(t)){(0,t9.k)(4===t.length,"Cubic bezier arrays must contain four numerical values.");let[e,i,r,s]=t;return eo(e,i,r,s)}return"string"==typeof t?((0,t9.k)(void 0!==eb[t],`Invalid easing type '${t}'`),eb[t]):t},ew=(t,e)=>i=>!!(X(i)&&Z.test(i)&&i.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(i,e)),eT=(t,e,i)=>r=>{if(!X(r))return r;let[s,n,o,a]=r.match(z);return{[t]:parseFloat(s),[e]:parseFloat(n),[i]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},eP=t=>I(0,255,t),eA={...W,transform:t=>Math.round(eP(t))},eE={test:ew("rgb","red"),parse:eT("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:r=1})=>"rgba("+eA.transform(t)+", "+eA.transform(e)+", "+eA.transform(i)+", "+H(q.transform(r))+")"},ek={test:ew("#"),parse:function(t){let e="",i="",r="",s="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,i+=i,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}},transform:eE.transform},eS={test:ew("hsl","hue"),parse:eT("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:r=1})=>"hsla("+Math.round(t)+", "+J.transform(H(e))+", "+J.transform(H(i))+", "+H(q.transform(r))+")"},e_={test:t=>eE.test(t)||ek.test(t)||eS.test(t),parse:t=>eE.test(t)?eE.parse(t):eS.test(t)?eS.parse(t):ek.parse(t),transform:t=>X(t)?t:t.hasOwnProperty("red")?eE.transform(t):eS.transform(t)},eC=(t,e,i)=>-i*t+i*e+t;function eR(t,e,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?t+(e-t)*6*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}let eV=(t,e,i)=>{let r=t*t;return Math.sqrt(Math.max(0,i*(e*e-r)+r))},eL=[ek,eE,eS],eD=t=>eL.find(e=>e.test(t));function eO(t){let e=eD(t);(0,t9.k)(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`);let i=e.parse(t);return e===eS&&(i=function({hue:t,saturation:e,lightness:i,alpha:r}){t/=360,i/=100;let s=0,n=0,o=0;if(e/=100){let r=i<.5?i*(1+e):i+e-i*e,a=2*i-r;s=eR(a,r,t+1/3),n=eR(a,r,t),o=eR(a,r,t-1/3)}else s=n=o=i;return{red:Math.round(255*s),green:Math.round(255*n),blue:Math.round(255*o),alpha:r}}(i)),i}let eM=(t,e)=>{let i=eO(t),r=eO(e),s={...i};return t=>(s.red=eV(i.red,r.red,t),s.green=eV(i.green,r.green,t),s.blue=eV(i.blue,r.blue,t),s.alpha=eC(i.alpha,r.alpha,t),eE.transform(s))},eB={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:tG.Z},ej={regex:Y,countKey:"Colors",token:"${c}",parse:e_.parse},eF={regex:z,countKey:"Numbers",token:"${n}",parse:W.parse};function eN(t,{regex:e,countKey:i,token:r,parse:s}){let n=t.tokenised.match(e);n&&(t["num"+i]=n.length,t.tokenised=t.tokenised.replace(e,r),t.values.push(...n.map(s)))}function eU(t){let e=t.toString(),i={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return i.value.includes("var(--")&&eN(i,eB),eN(i,ej),eN(i,eF),i}function eI(t){return eU(t).values}function eW(t){let{values:e,numColors:i,numVars:r,tokenised:s}=eU(t),n=e.length;return t=>{let e=s;for(let s=0;s<n;s++)e=s<r?e.replace(eB.token,t[s]):s<r+i?e.replace(ej.token,e_.transform(t[s])):e.replace(eF.token,H(t[s]));return e}}let eq=t=>"number"==typeof t?0:t,e$={test:function(t){var e,i;return isNaN(t)&&X(t)&&((null===(e=t.match(z))||void 0===e?void 0:e.length)||0)+((null===(i=t.match(Y))||void 0===i?void 0:i.length)||0)>0},parse:eI,createTransformer:eW,getAnimatableNone:function(t){let e=eI(t),i=eW(t);return i(e.map(eq))}},eH=(t,e)=>i=>`${i>0?e:t}`;function ez(t,e){return"number"==typeof t?i=>eC(t,e,i):e_.test(t)?eM(t,e):t.startsWith("var(")?eH(t,e):eX(t,e)}let eY=(t,e)=>{let i=[...t],r=i.length,s=t.map((t,i)=>ez(t,e[i]));return t=>{for(let e=0;e<r;e++)i[e]=s[e](t);return i}},eZ=(t,e)=>{let i={...t,...e},r={};for(let s in i)void 0!==t[s]&&void 0!==e[s]&&(r[s]=ez(t[s],e[s]));return t=>{for(let e in r)i[e]=r[e](t);return i}},eX=(t,e)=>{let i=e$.createTransformer(e),r=eU(t),s=eU(e),n=r.numVars===s.numVars&&r.numColors===s.numColors&&r.numNumbers>=s.numNumbers;return n?tU(eY(r.values,s.values),i):((0,t9.K)(!0,`Complex values '${t}' and '${e}' 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.`),eH(t,e))},eK=(t,e,i)=>{let r=e-t;return 0===r?1:(i-t)/r},eG=(t,e)=>i=>eC(t,e,i);function eJ(t,e,{clamp:i=!0,ease:r,mixer:s}={}){let n=t.length;if((0,t9.k)(n===e.length,"Both input and output ranges must be the same length"),1===n)return()=>e[0];t[0]>t[n-1]&&(t=[...t].reverse(),e=[...e].reverse());let o=function(t,e,i){let r=[],s=i||function(t){if("number"==typeof t);else if("string"==typeof t)return e_.test(t)?eM:eX;else if(Array.isArray(t))return eY;else if("object"==typeof t)return eZ;return eG}(t[0]),n=t.length-1;for(let i=0;i<n;i++){let n=s(t[i],t[i+1]);if(e){let t=Array.isArray(e)?e[i]||tG.Z:e;n=tU(t,n)}r.push(n)}return r}(e,r,s),a=o.length,l=e=>{let i=0;if(a>1)for(;i<t.length-2&&!(e<t[i+1]);i++);let r=eK(t[i],t[i+1],e);return o[i](r)};return i?e=>l(I(t[0],t[n-1],e)):l}function eQ({duration:t=300,keyframes:e,times:i,ease:r="easeInOut"}){let s=eu(r)?r.map(ex):ex(r),n={done:!1,value:e[0]},o=(i&&i.length===e.length?i:function(t){let e=[0];return function(t,e){let i=t[t.length-1];for(let r=1;r<=e;r++){let s=eK(0,e,r);t.push(eC(i,1,s))}}(e,t.length-1),e}(e)).map(e=>e*t),a=eJ(o,e,{ease:Array.isArray(s)?s:e.map(()=>s||eh).splice(0,e.length-1)});return{calculatedDuration:t,next:e=>(n.value=a(e),n.done=e>=t,n)}}function e0(t,e,i){var r,s;let n=Math.max(e-5,0);return r=i-t(n),(s=e-n)?r*(1e3/s):0}function e1(t,e){return t*Math.sqrt(1-e*e)}let e2=["duration","bounce"],e5=["stiffness","damping","mass"];function e3(t,e){return e.some(e=>void 0!==t[e])}function e6({keyframes:t,restDelta:e,restSpeed:i,...r}){let s;let n=t[0],o=t[t.length-1],a={done:!1,value:n},{stiffness:l,damping:h,mass:u,duration:c,velocity:p,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!e3(t,e5)&&e3(t,e2)){let i=function({duration:t=800,bounce:e=.25,velocity:i=0,mass:r=1}){let s,n;(0,t9.K)(t<=t7(10),"Spring duration must be 10 seconds or less");let o=1-e;o=I(.05,1,o),t=I(.01,10,et(t)),o<1?(s=e=>{let r=e*o,s=r*t,n=e1(e,o);return .001-(r-i)/n*Math.exp(-s)},n=e=>{let r=e*o,n=r*t,a=Math.pow(o,2)*Math.pow(e,2)*t,l=e1(Math.pow(e,2),o),h=-s(e)+.001>0?-1:1;return h*((n*i+i-a)*Math.exp(-n))/l}):(s=e=>{let r=Math.exp(-e*t),s=(e-i)*t+1;return -.001+r*s},n=e=>{let r=Math.exp(-e*t),s=(i-e)*(t*t);return r*s});let a=5/t,l=function(t,e,i){let r=i;for(let i=1;i<12;i++)r-=t(r)/e(r);return r}(s,n,a);if(t=t7(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{let e=Math.pow(l,2)*r;return{stiffness:e,damping:2*o*Math.sqrt(r*e),duration:t}}}(t);(e={...e,...i,mass:1}).isResolvedFromDuration=!0}return e}({...r,velocity:-et(r.velocity||0)}),f=p||0,m=h/(2*Math.sqrt(l*u)),g=o-n,y=et(Math.sqrt(l/u)),v=5>Math.abs(g);if(i||(i=v?.01:2),e||(e=v?.005:.5),m<1){let t=e1(y,m);s=e=>{let i=Math.exp(-m*y*e);return o-i*((f+m*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===m)s=t=>o-Math.exp(-y*t)*(g+(f+y*g)*t);else{let t=y*Math.sqrt(m*m-1);s=e=>{let i=Math.exp(-m*y*e),r=Math.min(t*e,300);return o-i*((f+m*y*g)*Math.sinh(r)+t*g*Math.cosh(r))/t}}return{calculatedDuration:d&&c||null,next:t=>{let r=s(t);if(d)a.done=t>=c;else{let n=f;0!==t&&(n=m<1?e0(s,t,r):0);let l=Math.abs(n)<=i,h=Math.abs(o-r)<=e;a.done=l&&h}return a.value=a.done?o:r,a}}}function e4({keyframes:t,velocity:e=0,power:i=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:n=500,modifyTarget:o,min:a,max:l,restDelta:h=.5,restSpeed:u}){let c,p;let d=t[0],f={done:!1,value:d},m=t=>void 0!==a&&t<a||void 0!==l&&t>l,g=t=>void 0===a?l:void 0===l?a:Math.abs(a-t)<Math.abs(l-t)?a:l,y=i*e,v=d+y,b=void 0===o?v:o(v);b!==v&&(y=b-d);let x=t=>-y*Math.exp(-t/r),w=t=>b+x(t),T=t=>{let e=x(t),i=w(t);f.done=Math.abs(e)<=h,f.value=f.done?b:i},P=t=>{m(f.value)&&(c=t,p=e6({keyframes:[f.value,g(f.value)],velocity:e0(w,t,f.value),damping:s,stiffness:n,restDelta:h,restSpeed:u}))};return P(0),{calculatedDuration:null,next:t=>{let e=!1;return(p||void 0!==c||(e=!0,T(t),P(t)),void 0!==c&&t>c)?p.next(t-c):(e||T(t),f)}}}let e8=t=>{let e=({timestamp:e})=>t(e);return{start:()=>tV.Wi.update(e,!0),stop:()=>(0,tV.Pn)(e),now:()=>tV.frameData.isProcessing?tV.frameData.timestamp:performance.now()}};function e9(t){let e=0,i=t.next(e);for(;!i.done&&e<2e4;)e+=50,i=t.next(e);return e>=2e4?1/0:e}let e7={decay:e4,inertia:e4,tween:eQ,keyframes:eQ,spring:e6};function it({autoplay:t=!0,delay:e=0,driver:i=e8,keyframes:r,type:s="keyframes",repeat:n=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:h,onComplete:u,onUpdate:c,...p}){let d,f,m,g,y,v=1,b=!1,x=()=>{f=new Promise(t=>{d=t})};x();let w=e7[s]||eQ;w!==eQ&&"number"!=typeof r[0]&&(g=eJ([0,100],r,{clamp:!1}),r=[0,100]);let T=w({...p,keyframes:r});"mirror"===a&&(y=w({...p,keyframes:[...r].reverse(),velocity:-(p.velocity||0)}));let P="idle",A=null,E=null,k=null;null===T.calculatedDuration&&n&&(T.calculatedDuration=e9(T));let{calculatedDuration:S}=T,_=1/0,C=1/0;null!==S&&(C=(_=S+o)*(n+1)-o);let R=0,V=t=>{if(null===E)return;v>0&&(E=Math.min(E,t)),v<0&&(E=Math.min(t-C/v,E)),R=null!==A?A:Math.round(t-E)*v;let i=R-e*(v>=0?1:-1),s=v>=0?i<0:i>C;R=Math.max(i,0),"finished"===P&&null===A&&(R=C);let l=R,h=T;if(n){let t=Math.min(R,C)/_,e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,e=Math.min(e,n+1);let r=!!(e%2);r&&("reverse"===a?(i=1-i,o&&(i-=o/_)):"mirror"===a&&(h=y)),l=I(0,1,i)*_}let u=s?{done:!1,value:r[0]}:h.next(l);g&&(u.value=g(u.value));let{done:p}=u;s||null===S||(p=v>=0?R>=C:R<=0);let d=null===A&&("finished"===P||"running"===P&&p);return c&&c(u.value),d&&O(),u},L=()=>{m&&m.stop(),m=void 0},D=()=>{P="idle",L(),d(),x(),E=k=null},O=()=>{P="finished",u&&u(),L(),d()},M=()=>{if(b)return;m||(m=i(V));let t=m.now();l&&l(),null!==A?E=t-A:E&&"finished"!==P||(E=t),"finished"===P&&x(),k=E,A=null,P="running",m.start()};t&&M();let B={then:(t,e)=>f.then(t,e),get time(){return et(R)},set time(newTime){R=newTime=t7(newTime),null===A&&m&&0!==v?E=m.now()-newTime/v:A=newTime},get duration(){let t=null===T.calculatedDuration?e9(T):T.calculatedDuration;return et(t)},get speed(){return v},set speed(newSpeed){if(newSpeed===v||!m)return;v=newSpeed,B.time=et(R)},get state(){return P},play:M,pause:()=>{P="paused",A=R},stop:()=>{b=!0,"idle"!==P&&(P="idle",h&&h(),D())},cancel:()=>{null!==k&&V(k),D()},complete:()=>{P="finished"},sample:t=>(E=0,V(t))};return B}let ie=(n=()=>Object.hasOwnProperty.call(Element.prototype,"animate"),()=>(void 0===r&&(r=n()),r)),ii=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),ir=(t,e)=>"spring"===e.type||"backgroundColor"===t||!function t(e){return!!(!e||"string"==typeof e&&es[e]||ei(e)||Array.isArray(e)&&e.every(t))}(e.ease),is={type:"spring",stiffness:500,damping:25,restSpeed:10},io=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),ia={type:"keyframes",duration:.8},il={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ih=(t,{keyframes:e})=>e.length>2?ia:L.has(t)?t.startsWith("scale")?io(e[1]):is:il,iu=(t,e)=>"zIndex"!==t&&!!("number"==typeof e||Array.isArray(e)||"string"==typeof e&&(e$.test(e)||"0"===e)&&!e.startsWith("url(")),ic=new Set(["brightness","contrast","saturate","opacity"]);function ip(t){let[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;let[r]=i.match(z)||[];if(!r)return t;let s=i.replace(r,""),n=ic.has(e)?1:0;return r!==i&&(n*=100),e+"("+n+s+")"}let id=/([a-z-]*)\(.*?\)/g,im={...e$,getAnimatableNone:t=>{let e=t.match(id);return e?e.map(ip).join(" "):t}},ig={...ts,color:e_,backgroundColor:e_,outlineColor:e_,fill:e_,stroke:e_,borderColor:e_,borderTopColor:e_,borderRightColor:e_,borderBottomColor:e_,borderLeftColor:e_,filter:im,WebkitFilter:im},iy=t=>ig[t];function iv(t,e){let i=iy(t);return i!==im&&(i=e$),i.getAnimatableNone?i.getAnimatableNone(e):void 0}let ib=t=>/^0[^.\s]+$/.test(t);function ix(t,e){return t[e]||t.default||t}let iw={skipAnimations:!1},iT=(t,e,i,r={})=>s=>{let n=ix(r,t)||{},o=n.delay||r.delay||0,{elapsed:a=0}=r;a-=t7(o);let l=function(t,e,i,r){let s,n;let o=iu(e,i);s=Array.isArray(i)?[...i]:[null,i];let a=void 0!==r.from?r.from:t.get(),l=[];for(let t=0;t<s.length;t++){var h;null===s[t]&&(s[t]=0===t?a:s[t-1]),("number"==typeof(h=s[t])?0===h:null!==h?"none"===h||"0"===h||ib(h):void 0)&&l.push(t),"string"==typeof s[t]&&"none"!==s[t]&&"0"!==s[t]&&(n=s[t])}if(o&&l.length&&n)for(let t=0;t<l.length;t++){let i=l[t];s[i]=iv(e,n)}return s}(e,t,i,n),h=l[0],u=l[l.length-1],c=iu(t,h),p=iu(t,u);(0,t9.K)(c===p,`You are trying to animate ${t} from "${h}" to "${u}". ${h} is not an animatable value - to enable this animation set ${h} to a value animatable to ${u} via the \`style\` property.`);let d={keyframes:l,velocity:e.getVelocity(),ease:"easeOut",...n,delay:-a,onUpdate:t=>{e.set(t),n.onUpdate&&n.onUpdate(t)},onComplete:()=>{s(),n.onComplete&&n.onComplete()}};if(!function({when:t,delay:e,delayChildren:i,staggerChildren:r,staggerDirection:s,repeat:n,repeatType:o,repeatDelay:a,from:l,elapsed:h,...u}){return!!Object.keys(u).length}(n)&&(d={...d,...ih(t,d)}),d.duration&&(d.duration=t7(d.duration)),d.repeatDelay&&(d.repeatDelay=t7(d.repeatDelay)),!c||!p||ee.current||!1===n.type||iw.skipAnimations)return function({keyframes:t,delay:e,onUpdate:i,onComplete:r}){let s=()=>(i&&i(t[t.length-1]),r&&r(),{time:0,speed:1,duration:0,play:tG.Z,pause:tG.Z,stop:tG.Z,then:t=>(t(),Promise.resolve()),cancel:tG.Z,complete:tG.Z});return e?it({keyframes:[0,1],duration:0,delay:e,onComplete:s}):s()}(ee.current?{...d,delay:0}:d);if(!r.isHandoff&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){let i=function(t,e,{onUpdate:i,onComplete:r,...s}){let n,o;let a=ie()&&ii.has(e)&&!s.repeatDelay&&"mirror"!==s.repeatType&&0!==s.damping&&"inertia"!==s.type;if(!a)return!1;let l=!1,h=!1,u=()=>{o=new Promise(t=>{n=t})};u();let{keyframes:c,duration:p=300,ease:d,times:f}=s;if(ir(e,s)){let t=it({...s,repeat:0,delay:0}),e={done:!1,value:c[0]},i=[],r=0;for(;!e.done&&r<2e4;)e=t.sample(r),i.push(e.value),r+=10;f=void 0,c=i,p=r-10,d="linear"}let m=function(t,e,i,{delay:r=0,duration:s,repeat:n=0,repeatType:o="loop",ease:a,times:l}={}){let h={[e]:i};l&&(h.offset=l);let u=function t(e){if(e)return ei(e)?er(e):Array.isArray(e)?e.map(t):es[e]}(a);return Array.isArray(u)&&(h.easing=u),t.animate(h,{delay:r,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:n+1,direction:"reverse"===o?"alternate":"normal"})}(t.owner.current,e,c,{...s,duration:p,ease:d,times:f}),g=()=>{h=!1,m.cancel()},y=()=>{h=!0,tV.Wi.update(g),n(),u()};return m.onfinish=()=>{h||(t.set(function(t,{repeat:e,repeatType:i="loop"}){let r=e&&"loop"!==i&&e%2==1?0:t.length-1;return t[r]}(c,s)),r&&r(),y())},{then:(t,e)=>o.then(t,e),attachTimeline:t=>(m.timeline=t,m.onfinish=null,tG.Z),get time(){return et(m.currentTime||0)},set time(newTime){m.currentTime=t7(newTime)},get speed(){return m.playbackRate},set speed(newSpeed){m.playbackRate=newSpeed},get duration(){return et(p)},play:()=>{l||(m.play(),(0,tV.Pn)(g))},pause:()=>m.pause(),stop:()=>{if(l=!0,"idle"===m.playState)return;let{currentTime:e}=m;if(e){let i=it({...s,autoplay:!1});t.setWithVelocity(i.sample(e-10).value,i.sample(e).value,10)}y()},complete:()=>{h||m.finish()},cancel:y}}(e,t,d);if(i)return i}return it(d)};function iP(t){return!!(O(t)&&t.add)}let iA=t=>/^\-?\d*\.?\d+$/.test(t);function iE(t,e){-1===t.indexOf(e)&&t.push(e)}function ik(t,e){let i=t.indexOf(e);i>-1&&t.splice(i,1)}class iS{constructor(){this.subscriptions=[]}add(t){return iE(this.subscriptions,t),()=>ik(this.subscriptions,t)}notify(t,e,i){let r=this.subscriptions.length;if(r){if(1===r)this.subscriptions[0](t,e,i);else for(let s=0;s<r;s++){let r=this.subscriptions[s];r&&r(t,e,i)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}let i_=t=>!isNaN(parseFloat(t)),iC={current:void 0};class iR{constructor(t,e={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;let{delta:i,timestamp:r}=tV.frameData;this.lastUpdated!==r&&(this.timeDelta=i,this.lastUpdated=r,tV.Wi.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>tV.Wi.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=i_(this.current),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new iS);let i=this.events[t].add(e);return"change"===t?()=>{i(),tV.Wi.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,i){this.set(e),this.prev=t,this.timeDelta=i}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return iC.current&&iC.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var t,e;return this.canTrackVelocity?(t=parseFloat(this.current)-parseFloat(this.prev),(e=this.timeDelta)?t*(1e3/e):0):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),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 iV(t,e){return new iR(t,e)}let iL=t=>e=>e.test(t),iD=[W,Q,J,G,te,tt,{test:t=>"auto"===t,parse:t=>t}],iO=t=>iD.find(iL(t)),iM=[...iD,e_,e$],iB=t=>iM.find(iL(t));function ij(t,e,{delay:i=0,transitionOverride:r,type:s}={}){let{transition:n=t.getDefaultTransition(),transitionEnd:o,...a}=t.makeTargetAnimatable(e),l=t.getValue("willChange");r&&(n=r);let h=[],u=s&&t.animationState&&t.animationState.getState()[s];for(let e in a){let r=t.getValue(e),s=a[e];if(!r||void 0===s||u&&function({protectedKeys:t,needsAnimating:e},i){let r=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,r}(u,e))continue;let o={delay:i,elapsed:0,...ix(n||{},e)};if(window.HandoffAppearAnimations){let i=t.getProps()[d];if(i){let t=window.HandoffAppearAnimations(i,e,r,tV.Wi);null!==t&&(o.elapsed=t,o.isHandoff=!0)}}let c=!o.isHandoff&&!function(t,e){let i=t.get();if(!Array.isArray(e))return i!==e;for(let t=0;t<e.length;t++)if(e[t]!==i)return!0}(r,s);if("spring"===o.type&&(r.getVelocity()||o.velocity)&&(c=!1),r.animation&&(c=!1),c)continue;r.start(iT(e,r,s,t.shouldReduceMotion&&L.has(e)?{type:!1}:o));let p=r.animation;iP(l)&&(l.add(e),p.then(()=>l.remove(e))),h.push(p)}return o&&Promise.all(h).then(()=>{o&&function(t,e){let i=t8(t,e),{transitionEnd:r={},transition:s={},...n}=i?t.makeTargetAnimatable(i,!1):{};for(let e in n={...n,...r}){let i=t_(n[e]);t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,iV(i))}}(t,o)}),h}function iF(t,e,i={}){let r=t8(t,e,i.custom),{transition:s=t.getDefaultTransition()||{}}=r||{};i.transitionOverride&&(s=i.transitionOverride);let n=r?()=>Promise.all(ij(t,r,i)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(r=0)=>{let{delayChildren:n=0,staggerChildren:o,staggerDirection:a}=s;return function(t,e,i=0,r=0,s=1,n){let o=[],a=(t.variantChildren.size-1)*r,l=1===s?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(iN).forEach((t,r)=>{t.notify("AnimationStart",e),o.push(iF(t,e,{...n,delay:i+l(r)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(o)}(t,e,n+r,o,a,i)}:()=>Promise.resolve(),{when:a}=s;if(!a)return Promise.all([n(),o(i.delay)]);{let[t,e]="beforeChildren"===a?[n,o]:[o,n];return t().then(()=>e())}}function iN(t,e){return t.sortNodePosition(e)}let iU=[...y].reverse(),iI=y.length;function iW(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}class iq extends tz{constructor(t){super(t),t.animationState||(t.animationState=function(t){let e=e=>Promise.all(e.map(({animation:e,options:i})=>(function(t,e,i={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){let s=e.map(e=>iF(t,e,i));r=Promise.all(s)}else if("string"==typeof e)r=iF(t,e,i);else{let s="function"==typeof e?t8(t,e,i.custom):e;r=Promise.all(ij(t,s,i))}return r.then(()=>t.notify("AnimationComplete",e))})(t,e,i))),i={animate:iW(!0),whileInView:iW(),whileHover:iW(),whileTap:iW(),whileDrag:iW(),whileFocus:iW(),exit:iW()},r=!0,s=(e,i)=>{let r=t8(t,i);if(r){let{transition:t,transitionEnd:i,...s}=r;e={...e,...s,...i}}return e};function n(n,o){let a=t.getProps(),l=t.getVariantContext(!0)||{},h=[],u=new Set,c={},p=1/0;for(let e=0;e<iI;e++){var d;let f=iU[e],y=i[f],v=void 0!==a[f]?a[f]:l[f],b=m(v),x=f===o?y.isActive:null;!1===x&&(p=e);let w=v===l[f]&&v!==a[f]&&b;if(w&&r&&t.manuallyAnimateOnMount&&(w=!1),y.protectedKeys={...c},!y.isActive&&null===x||!v&&!y.prevProp||g(v)||"boolean"==typeof v)continue;let T=(d=y.prevProp,"string"==typeof v?v!==d:!!Array.isArray(v)&&!t4(v,d)),P=T||f===o&&y.isActive&&!w&&b||e>p&&b,A=!1,E=Array.isArray(v)?v:[v],k=E.reduce(s,{});!1===x&&(k={});let{prevResolvedValues:S={}}=y,_={...S,...k},C=t=>{P=!0,u.has(t)&&(A=!0,u.delete(t)),y.needsAnimating[t]=!0};for(let t in _){let e=k[t],i=S[t];if(!c.hasOwnProperty(t))(tk(e)&&tk(i)?t4(e,i):e===i)?void 0!==e&&u.has(t)?C(t):y.protectedKeys[t]=!0:void 0!==e?C(t):u.add(t)}y.prevProp=v,y.prevResolvedValues=k,y.isActive&&(c={...c,...k}),r&&t.blockInitialAnimation&&(P=!1),P&&(!w||A)&&h.push(...E.map(t=>({animation:t,options:{type:f,...n}})))}if(u.size){let e={};u.forEach(i=>{let r=t.getBaseTarget(i);void 0!==r&&(e[i]=r)}),h.push({animation:e})}let f=!!h.length;return r&&(!1===a.initial||a.initial===a.animate)&&!t.manuallyAnimateOnMount&&(f=!1),r=!1,f?e(h):Promise.resolve()}return{animateChanges:n,setActive:function(e,r,s){var o;if(i[e].isActive===r)return Promise.resolve();null===(o=t.variantChildren)||void 0===o||o.forEach(t=>{var i;return null===(i=t.animationState)||void 0===i?void 0:i.setActive(e,r)}),i[e].isActive=r;let a=n(s,e);for(let t in i)i[t].protectedKeys={};return a},setAnimateFunction:function(i){e=i(t)},getState:()=>i}}(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();this.unmount(),g(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}let i$=0;class iH extends tz{constructor(){super(...arguments),this.id=i$++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:e,custom:i}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;let s=this.node.animationState.setActive("exit",!t,{custom:null!=i?i:this.node.getProps().custom});e&&!t&&s.then(()=>e(this.id))}mount(){let{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}let iz=(t,e)=>Math.abs(t-e);class iY{constructor(t,e,{transformPagePoint:i,contextWindow:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let t=iK(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,i=function(t,e){let i=iz(t.x,e.x),r=iz(t.y,e.y);return Math.sqrt(i**2+r**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!i)return;let{point:r}=t,{timestamp:s}=tV.frameData;this.history.push({...r,timestamp:s});let{onStart:n,onMove:o}=this.handlers;e||(n&&n(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=iZ(e,this.transformPagePoint),tV.Wi.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();let{onEnd:i,onSessionEnd:r,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let n=iK("pointercancel"===t.type?this.lastMoveEventInfo:iZ(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,n),r&&r(t,n)},!tM(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=i,this.contextWindow=r||window;let n=tB(t),o=iZ(n,this.transformPagePoint),{point:a}=o,{timestamp:l}=tV.frameData;this.history=[{...a,timestamp:l}];let{onSessionStart:h}=e;h&&h(t,iK(o,this.history)),this.removeListeners=tU(tF(this.contextWindow,"pointermove",this.handlePointerMove),tF(this.contextWindow,"pointerup",this.handlePointerUp),tF(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),(0,tV.Pn)(this.updatePoint)}}function iZ(t,e){return e?{point:e(t.point)}:t}function iX(t,e){return{x:t.x-e.x,y:t.y-e.y}}function iK({point:t},e){return{point:t,delta:iX(t,iG(e)),offset:iX(t,e[0]),velocity:function(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,r=null,s=iG(t);for(;i>=0&&(r=t[i],!(s.timestamp-r.timestamp>t7(.1)));)i--;if(!r)return{x:0,y:0};let n=et(s.timestamp-r.timestamp);if(0===n)return{x:0,y:0};let o={x:(s.x-r.x)/n,y:(s.y-r.y)/n};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}(e,0)}}function iG(t){return t[t.length-1]}function iJ(t){return t.max-t.min}function iQ(t,e=0,i=.01){return Math.abs(t-e)<=i}function i0(t,e,i,r=.5){t.origin=r,t.originPoint=eC(e.min,e.max,t.origin),t.scale=iJ(i)/iJ(e),(iQ(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=eC(i.min,i.max,t.origin)-t.originPoint,(iQ(t.translate)||isNaN(t.translate))&&(t.translate=0)}function i1(t,e,i,r){i0(t.x,e.x,i.x,r?r.originX:void 0),i0(t.y,e.y,i.y,r?r.originY:void 0)}function i2(t,e,i){t.min=i.min+e.min,t.max=t.min+iJ(e)}function i5(t,e,i){t.min=e.min-i.min,t.max=t.min+iJ(e)}function i3(t,e,i){i5(t.x,e.x,i.x),i5(t.y,e.y,i.y)}function i6(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function i4(t,e){let i=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([i,r]=[r,i]),{min:i,max:r}}function i8(t,e,i){return{min:i9(t,e),max:i9(t,i)}}function i9(t,e){return"number"==typeof t?t:t[e]||0}let i7=()=>({translate:0,scale:1,origin:0,originPoint:0}),rt=()=>({x:i7(),y:i7()}),re=()=>({min:0,max:0}),ri=()=>({x:re(),y:re()});function rr(t){return[t("x"),t("y")]}function rs({top:t,left:e,right:i,bottom:r}){return{x:{min:e,max:i},y:{min:t,max:r}}}function rn(t){return void 0===t||1===t}function ro({scale:t,scaleX:e,scaleY:i}){return!rn(t)||!rn(e)||!rn(i)}function ra(t){return ro(t)||rl(t)||t.z||t.rotate||t.rotateX||t.rotateY}function rl(t){var e,i;return(e=t.x)&&"0%"!==e||(i=t.y)&&"0%"!==i}function rh(t,e,i,r,s){return void 0!==s&&(t=r+s*(t-r)),r+i*(t-r)+e}function ru(t,e=0,i=1,r,s){t.min=rh(t.min,e,i,r,s),t.max=rh(t.max,e,i,r,s)}function rc(t,{x:e,y:i}){ru(t.x,e.translate,e.scale,e.originPoint),ru(t.y,i.translate,i.scale,i.originPoint)}function rp(t){return Number.isInteger(t)?t:t>1.0000000000001||t<.999999999999?t:1}function rd(t,e){t.min=t.min+e,t.max=t.max+e}function rf(t,e,[i,r,s]){let n=void 0!==e[s]?e[s]:.5,o=eC(t.min,t.max,n);ru(t,e[i],e[r],o,e.scale)}let rm=["x","scaleX","originX"],rg=["y","scaleY","originY"];function ry(t,e){rf(t.x,e,rm),rf(t.y,e,rg)}function rv(t,e){return rs(function(t,e){if(!e)return t;let i=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}let rb=({current:t})=>t?t.ownerDocument.defaultView:null,rx=new WeakMap;class rw{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ri(),this.visualElement=t}start(t,{snapToCursor:e=!1}={}){let{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;let{dragSnapToOrigin:r}=this.getProps();this.panSession=new iY(t,{onSessionStart:t=>{let{dragSnapToOrigin:i}=this.getProps();i?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(tB(t,"page").point)},onStart:(t,e)=>{let{drag:i,dragPropagation:r,onDragStart:s}=this.getProps();if(i&&!r&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=t$(i),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rr(t=>{let e=this.getAxisMotionValue(t).get()||0;if(J.test(e)){let{projection:i}=this.visualElement;if(i&&i.layout){let r=i.layout.layoutBox[t];if(r){let t=iJ(r);e=t*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&tV.Wi.update(()=>s(t,e),!1,!0);let{animationState:n}=this.visualElement;n&&n.setActive("whileDrag",!0)},onMove:(t,e)=>{let{dragPropagation:i,dragDirectionLock:r,onDirectionLock:s,onDrag:n}=this.getProps();if(!i&&!this.openGlobalLock)return;let{offset:o}=e;if(r&&null===this.currentDirection){this.currentDirection=function(t,e=10){let i=null;return Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x"),i}(o),null!==this.currentDirection&&s&&s(this.currentDirection);return}this.updateAxis("x",e.point,o),this.updateAxis("y",e.point,o),this.visualElement.render(),n&&n(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>rr(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:rb(this.visualElement)})}stop(t,e){let i=this.isDragging;if(this.cancel(),!i)return;let{velocity:r}=e;this.startAnimation(r);let{onDragEnd:s}=this.getProps();s&&tV.Wi.update(()=>s(t,e))}cancel(){this.isDragging=!1;let{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,i){let{drag:r}=this.getProps();if(!i||!rT(t,r,this.currentDirection))return;let s=this.getAxisMotionValue(t),n=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(n=function(t,{min:e,max:i},r){return void 0!==e&&t<e?t=r?eC(e,t,r.min):Math.max(t,e):void 0!==i&&t>i&&(t=r?eC(i,t,r.max):Math.min(t,i)),t}(n,this.constraints[t],this.elastic[t])),s.set(n)}resolveConstraints(){var t;let{dragConstraints:e,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,s=this.constraints;e&&f(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=function(t,{top:e,left:i,bottom:r,right:s}){return{x:i6(t.x,i,s),y:i6(t.y,e,r)}}(r.layoutBox,e):this.constraints=!1,this.elastic=function(t=.35){return!1===t?t=0:!0===t&&(t=.35),{x:i8(t,"left","right"),y:i8(t,"top","bottom")}}(i),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&rr(t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){let i={};return void 0!==e.min&&(i.min=e.min-t.min),void 0!==e.max&&(i.max=e.max-t.min),i}(r.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){var t;let{dragConstraints:e,onMeasureDragConstraints:i}=this.getProps();if(!e||!f(e))return!1;let r=e.current;(0,t9.k)(null!==r,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:s}=this.visualElement;if(!s||!s.layout)return!1;let n=function(t,e,i){let r=rv(t,i),{scroll:s}=e;return s&&(rd(r.x,s.offset.x),rd(r.y,s.offset.y)),r}(r,s.root,this.visualElement.getTransformPagePoint()),o={x:i4((t=s.layout.layoutBox).x,n.x),y:i4(t.y,n.y)};if(i){let t=i(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=rs(t))}return o}startAnimation(t){let{drag:e,dragMomentum:i,dragElastic:r,dragTransition:s,dragSnapToOrigin:n,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{},l=rr(o=>{if(!rT(o,e,this.currentDirection))return;let l=a&&a[o]||{};n&&(l={min:0,max:0});let h={type:"inertia",velocity:i?t[o]:0,bounceStiffness:r?200:1e6,bounceDamping:r?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(o,h)});return Promise.all(l).then(o)}startAxisValueAnimation(t,e){let i=this.getAxisMotionValue(t);return i.start(iT(t,i,0,e))}stopAnimation(){rr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){rr(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){let e="_drag"+t.toUpperCase(),i=this.visualElement.getProps(),r=i[e];return r||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){rr(e=>{let{drag:i}=this.getProps();if(!rT(e,i,this.currentDirection))return;let{projection:r}=this.visualElement,s=this.getAxisMotionValue(e);if(r&&r.layout){let{min:i,max:n}=r.layout.layoutBox[e];s.set(t[e]-eC(i,n,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!f(e)||!i||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};rr(t=>{let e=this.getAxisMotionValue(t);if(e){let i=e.get();r[t]=function(t,e){let i=.5,r=iJ(t),s=iJ(e);return s>r?i=eK(e.min,e.max-r,t.min):r>s&&(i=eK(t.min,t.max-s,e.min)),I(0,1,i)}({min:i,max:i},this.constraints[t])}});let{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),rr(e=>{if(!rT(e,t,null))return;let i=this.getAxisMotionValue(e),{min:s,max:n}=this.constraints[e];i.set(eC(s,n,r[e]))})}addListeners(){if(!this.visualElement.current)return;rx.set(this.visualElement,this);let t=this.visualElement.current,e=tF(t,"pointerdown",t=>{let{drag:e,dragListener:i=!0}=this.getProps();e&&i&&this.start(t)}),i=()=>{let{dragConstraints:t}=this.getProps();f(t)&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,s=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),i();let n=tO(window,"resize",()=>this.scalePositionWithinConstraints()),o=r.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(rr(e=>{let i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{n(),e(),s(),o&&o()}}getProps(){let t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:s=!1,dragElastic:n=.35,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:r,dragConstraints:s,dragElastic:n,dragMomentum:o}}}function rT(t,e,i){return(!0===e||e===t)&&(null===i||i===t)}class rP extends tz{constructor(t){super(t),this.removeGroupControls=tG.Z,this.removeListeners=tG.Z,this.controls=new rw(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tG.Z}unmount(){this.removeGroupControls(),this.removeListeners()}}let rA=t=>(e,i)=>{t&&tV.Wi.update(()=>t(e,i))};class rE extends tz{constructor(){super(...arguments),this.removePointerDownListener=tG.Z}onPointerDown(t){this.session=new iY(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:rb(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:rA(t),onStart:rA(e),onMove:i,onEnd:(t,e)=>{delete this.session,r&&tV.Wi.update(()=>r(t,e))}}}mount(){this.removePointerDownListener=tF(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let rk={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function rS(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}let r_={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!Q.test(t))return t;t=parseFloat(t)}let i=rS(t,e.target.x),r=rS(t,e.target.y);return`${i}% ${r}%`}};class rC extends o.Component{componentDidMount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:r}=this.props,{projection:s}=t;Object.assign(R,rV),s&&(e.group&&e.group.add(s),i&&i.register&&r&&i.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),rk.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:e,visualElement:i,drag:r,isPresent:s}=this.props,n=i.projection;return n&&(n.isPresent=s,r||t.layoutDependency!==e||void 0===e?n.willUpdate():this.safeToRemove(),t.isPresent===s||(s?n.promote():n.relegate()||tV.Wi.postRender(()=>{let t=n.getStack();t&&t.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}}function rR(t){let[e,i]=function(){let t=(0,o.useContext)(h.O);if(null===t)return[!0,null];let{isPresent:e,onExitComplete:i,register:r}=t,s=(0,o.useId)();return(0,o.useEffect)(()=>r(s),[]),!e&&i?[!1,()=>i&&i(s)]:[!0]}(),r=(0,o.useContext)(E.p);return o.createElement(rC,{...t,layoutGroup:r,switchLayoutGroup:(0,o.useContext)(k),isPresent:e,safeToRemove:i})}let rV={borderRadius:{...r_,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:r_,borderTopRightRadius:r_,borderBottomLeftRadius:r_,borderBottomRightRadius:r_,boxShadow:{correct:(t,{treeScale:e,projectionDelta:i})=>{let r=e$.parse(t);if(r.length>5)return t;let s=e$.createTransformer(t),n="number"!=typeof r[0]?1:0,o=i.x.scale*e.x,a=i.y.scale*e.y;r[0+n]/=o,r[1+n]/=a;let l=eC(o,a,.5);return"number"==typeof r[2+n]&&(r[2+n]/=l),"number"==typeof r[3+n]&&(r[3+n]/=l),s(r)}}},rL=["TopLeft","TopRight","BottomLeft","BottomRight"],rD=rL.length,rO=t=>"string"==typeof t?parseFloat(t):t,rM=t=>"number"==typeof t||Q.test(t);function rB(t,e){return void 0!==t[e]?t[e]:t.borderRadius}let rj=rN(0,.5,ef),rF=rN(.5,.95,tG.Z);function rN(t,e,i){return r=>r<t?0:r>e?1:i(eK(t,e,r))}function rU(t,e){t.min=e.min,t.max=e.max}function rI(t,e){rU(t.x,e.x),rU(t.y,e.y)}function rW(t,e,i,r,s){return t-=e,t=r+1/i*(t-r),void 0!==s&&(t=r+1/s*(t-r)),t}function rq(t,e,[i,r,s],n,o){!function(t,e=0,i=1,r=.5,s,n=t,o=t){if(J.test(e)){e=parseFloat(e);let t=eC(o.min,o.max,e/100);e=t-o.min}if("number"!=typeof e)return;let a=eC(n.min,n.max,r);t===n&&(a-=e),t.min=rW(t.min,e,i,a,s),t.max=rW(t.max,e,i,a,s)}(t,e[i],e[r],e[s],e.scale,n,o)}let r$=["x","scaleX","originX"],rH=["y","scaleY","originY"];function rz(t,e,i,r){rq(t.x,e,r$,i?i.x:void 0,r?r.x:void 0),rq(t.y,e,rH,i?i.y:void 0,r?r.y:void 0)}function rY(t){return 0===t.translate&&1===t.scale}function rZ(t){return rY(t.x)&&rY(t.y)}function rX(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function rK(t){return iJ(t.x)/iJ(t.y)}class rG{constructor(){this.members=[]}add(t){iE(this.members,t),t.scheduleRender()}remove(t){if(ik(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){let e;let i=this.members.findIndex(e=>t===e);if(0===i)return!1;for(let t=i;t>=0;t--){let i=this.members[t];if(!1!==i.isPresent){e=i;break}}return!!e&&(this.promote(e),!0)}promote(t,e){let i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:r}=t.options;!1===r&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:e,resumingFrom:i}=t;e.onExitComplete&&e.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function rJ(t,e,i){let r="",s=t.x.translate/e.x,n=t.y.translate/e.y;if((s||n)&&(r=`translate3d(${s}px, ${n}px, 0) `),(1!==e.x||1!==e.y)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),i){let{rotate:t,rotateX:e,rotateY:s}=i;t&&(r+=`rotate(${t}deg) `),e&&(r+=`rotateX(${e}deg) `),s&&(r+=`rotateY(${s}deg) `)}let o=t.x.scale*e.x,a=t.y.scale*e.y;return(1!==o||1!==a)&&(r+=`scale(${o}, ${a})`),r||"none"}let rQ=(t,e)=>t.depth-e.depth;class r0{constructor(){this.children=[],this.isDirty=!1}add(t){iE(this.children,t),this.isDirty=!0}remove(t){ik(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(rQ),this.isDirty=!1,this.children.forEach(t)}}let r1=["","X","Y","Z"],r2={visibility:"hidden"},r5=0,r3={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function r6({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(t={},i=null==e?void 0:e()){this.id=r5++,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.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,r3.totalNodes=r3.resolvedTargetDeltas=r3.recalculatedProjection=0,this.nodes.forEach(r9),this.nodes.forEach(sn),this.nodes.forEach(so),this.nodes.forEach(r7),window.MotionDebug&&window.MotionDebug.record(r3)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new r0)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new iS),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){let i=this.eventHandlers.get(t);i&&i.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,i=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;let{layoutId:r,layout:s,visualElement:n}=this.options;if(n&&!n.current&&n.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),i&&(s||r)&&(this.isLayoutDirty=!0),t){let i;let r=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,i&&i(),i=function(t,e){let i=performance.now(),r=({timestamp:s})=>{let n=s-i;n>=e&&((0,tV.Pn)(r),t(n-e))};return tV.Wi.read(r,!0),()=>(0,tV.Pn)(r)}(r,250),rk.hasAnimatedSinceResize&&(rk.hasAnimatedSinceResize=!1,this.nodes.forEach(ss))})}r&&this.root.registerSharedNode(r,this),!1!==this.options.animate&&n&&(r||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:i,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let s=this.options.transition||n.getDefaultTransition()||sp,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=n.getProps(),l=!this.targetLayout||!rX(this.targetLayout,r)||i,h=!e&&i;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,h);let e={...ix(s,"layout"),onPlay:o,onComplete:a};(n.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||ss(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,(0,tV.Pn)(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(sa),this.animationId++)}getTransformTemplate(){let{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){let e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}let{layoutId:e,layout:i}=this.options;if(void 0===e&&!i)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;let t=this.isUpdateBlocked();if(t){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(se);return}this.isUpdating||this.nodes.forEach(si),this.isUpdating=!1,this.nodes.forEach(sr),this.nodes.forEach(r4),this.nodes.forEach(r8),this.clearAllSnapshots();let e=performance.now();tV.frameData.delta=I(0,1e3/60,e-tV.frameData.timestamp),tV.frameData.timestamp=e,tV.frameData.isProcessing=!0,tV.S6.update.process(tV.frameData),tV.S6.preRender.process(tV.frameData),tV.S6.render.process(tV.frameData),tV.frameData.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(st),this.sharedNodes.forEach(sl)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,tV.Wi.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){tV.Wi.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){let e=this.path[t];e.updateScroll()}let t=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ri(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:r(this.instance),offset:i(this.instance)})}resetTransform(){if(!s)return;let t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!rZ(this.projectionDelta),i=this.getTransformTemplate(),r=i?i(this.latestValues,""):void 0,n=r!==this.prevTransformTemplateValue;t&&(e||ra(this.latestValues)||n)&&(s(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){var e;let i=this.measurePageBox(),r=this.removeElementScroll(i);return t&&(r=this.removeTransform(r)),sm((e=r).x),sm(e.y),{animationId:this.root.animationId,measuredBox:i,layoutBox:r,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:t}=this.options;if(!t)return ri();let e=t.measureViewportBox(),{scroll:i}=this.root;return i&&(rd(e.x,i.offset.x),rd(e.y,i.offset.y)),e}removeElementScroll(t){let e=ri();rI(e,t);for(let i=0;i<this.path.length;i++){let r=this.path[i],{scroll:s,options:n}=r;if(r!==this.root&&s&&n.layoutScroll){if(s.isRoot){rI(e,t);let{scroll:i}=this.root;i&&(rd(e.x,-i.offset.x),rd(e.y,-i.offset.y))}rd(e.x,s.offset.x),rd(e.y,s.offset.y)}}return e}applyTransform(t,e=!1){let i=ri();rI(i,t);for(let t=0;t<this.path.length;t++){let r=this.path[t];!e&&r.options.layoutScroll&&r.scroll&&r!==r.root&&ry(i,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),ra(r.latestValues)&&ry(i,r.latestValues)}return ra(this.latestValues)&&ry(i,this.latestValues),i}removeTransform(t){let e=ri();rI(e,t);for(let t=0;t<this.path.length;t++){let i=this.path[t];if(!i.instance||!ra(i.latestValues))continue;ro(i.latestValues)&&i.updateSnapshot();let r=ri(),s=i.measurePageBox();rI(r,s),rz(e,i.latestValues,i.snapshot?i.snapshot.layoutBox:void 0,r)}return ra(this.latestValues)&&rz(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}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!==tV.frameData.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e,i,r,s;let n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);let o=!!this.resumingFrom||this!==n,a=!(t||o&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget);if(a)return;let{layout:l,layoutId:h}=this.options;if(this.layout&&(l||h)){if(this.resolvedRelativeTargetAt=tV.frameData.timestamp,!this.targetDelta&&!this.relativeTarget){let t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ri(),this.relativeTargetOrigin=ri(),i3(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),rI(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){if((this.target||(this.target=ri(),this.targetWithTransforms=ri()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target)?(this.forceRelativeParentToResolveTarget(),i=this.target,r=this.relativeTarget,s=this.relativeParent.target,i2(i.x,r.x,s.x),i2(i.y,r.y,s.y)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):rI(this.target,this.layout.layoutBox),rc(this.target,this.targetDelta)):rI(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let t=this.getClosestProjectingParent();t&&!!t.resumingFrom==!!this.resumingFrom&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ri(),this.relativeTargetOrigin=ri(),i3(this.relativeTargetOrigin,this.target,t.target),rI(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}r3.resolvedTargetDeltas++}}}getClosestProjectingParent(){return!this.parent||ro(this.parent.latestValues)||rl(this.parent.latestValues)?void 0:this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;let e=this.getLead(),i=!!this.resumingFrom||this!==e,r=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(r=!1),i&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===tV.frameData.timestamp&&(r=!1),r)return;let{layout:s,layoutId:n}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(s||n))return;rI(this.layoutCorrected,this.layout.layoutBox);let o=this.treeScale.x,a=this.treeScale.y;!function(t,e,i,r=!1){let s,n;let o=i.length;if(o){e.x=e.y=1;for(let a=0;a<o;a++){n=(s=i[a]).projectionDelta;let o=s.instance;(!o||!o.style||"contents"!==o.style.display)&&(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&ry(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),n&&(e.x*=n.x.scale,e.y*=n.y.scale,rc(t,n)),r&&ra(s.latestValues)&&ry(t,s.latestValues))}e.x=rp(e.x),e.y=rp(e.y)}}(this.layoutCorrected,this.treeScale,this.path,i),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox);let{target:l}=e;if(!l){this.projectionTransform&&(this.projectionDelta=rt(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=rt(),this.projectionDeltaWithTransform=rt());let h=this.projectionTransform;i1(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=rJ(this.projectionDelta,this.treeScale),(this.projectionTransform!==h||this.treeScale.x!==o||this.treeScale.y!==a)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),r3.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){let t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){let i;let r=this.snapshot,s=r?r.latestValues:{},n={...this.latestValues},o=rt();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;let a=ri(),l=r?r.source:void 0,h=this.layout?this.layout.source:void 0,u=l!==h,c=this.getStack(),p=!c||c.members.length<=1,d=!!(u&&!p&&!0===this.options.crossfade&&!this.path.some(sc));this.animationProgress=0,this.mixTargetDelta=e=>{let r=e/1e3;if(sh(o.x,t.x,r),sh(o.y,t.y,r),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var l,h,c,f;i3(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),c=this.relativeTarget,f=this.relativeTargetOrigin,su(c.x,f.x,a.x,r),su(c.y,f.y,a.y,r),i&&(l=this.relativeTarget,h=i,l.x.min===h.x.min&&l.x.max===h.x.max&&l.y.min===h.y.min&&l.y.max===h.y.max)&&(this.isProjectionDirty=!1),i||(i=ri()),rI(i,this.relativeTarget)}u&&(this.animationValues=n,function(t,e,i,r,s,n){s?(t.opacity=eC(0,void 0!==i.opacity?i.opacity:1,rj(r)),t.opacityExit=eC(void 0!==e.opacity?e.opacity:1,0,rF(r))):n&&(t.opacity=eC(void 0!==e.opacity?e.opacity:1,void 0!==i.opacity?i.opacity:1,r));for(let s=0;s<rD;s++){let n=`border${rL[s]}Radius`,o=rB(e,n),a=rB(i,n);if(void 0===o&&void 0===a)continue;o||(o=0),a||(a=0);let l=0===o||0===a||rM(o)===rM(a);l?(t[n]=Math.max(eC(rO(o),rO(a),r),0),(J.test(a)||J.test(o))&&(t[n]+="%")):t[n]=a}(e.rotate||i.rotate)&&(t.rotate=eC(e.rotate||0,i.rotate||0,r))}(n,s,this.latestValues,r,d,p)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=r},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&((0,tV.Pn)(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=tV.Wi.update(()=>{rk.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,i){let r=O(t)?t:iV(t);return r.start(iT("",r,1e3,i)),r.animation}(0,0,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.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);let t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let t=this.getLead(),{targetWithTransforms:e,target:i,layout:r,latestValues:s}=t;if(e&&i&&r){if(this!==t&&this.layout&&r&&sg(this.options.animationType,this.layout.layoutBox,r.layoutBox)){i=this.target||ri();let e=iJ(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;let r=iJ(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+r}rI(e,i),ry(e,s),i1(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new rG);let i=this.sharedNodes.get(t);i.add(e);let r=e.options.initialPromotionConfig;e.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.shouldPreserveFollowOpacity(e):void 0})}isLead(){let t=this.getStack();return!t||t.lead===this}getLead(){var t;let{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;let{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){let{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:i}={}){let r=this.getStack();r&&r.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){let t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){let{visualElement:t}=this.options;if(!t)return;let e=!1,{latestValues:i}=t;if((i.rotate||i.rotateX||i.rotateY||i.rotateZ)&&(e=!0),!e)return;let r={};for(let e=0;e<r1.length;e++){let s="rotate"+r1[e];i[s]&&(r[s]=i[s],t.setStaticValue(s,0))}for(let e in t.render(),r)t.setStaticValue(e,r[e]);t.scheduleRender()}getProjectionStyles(t){var e,i;if(!this.instance||this.isSVG)return;if(!this.isVisible)return r2;let r={visibility:""},s=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=tC(null==t?void 0:t.pointerEvents)||"",r.transform=s?s(this.latestValues,""):"none",r;let n=this.getLead();if(!this.projectionDelta||!this.layout||!n.target){let e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=tC(null==t?void 0:t.pointerEvents)||""),this.hasProjected&&!ra(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}let o=n.animationValues||n.latestValues;this.applyTransformsToTarget(),r.transform=rJ(this.projectionDeltaWithTransform,this.treeScale,o),s&&(r.transform=s(o,r.transform));let{x:a,y:l}=this.projectionDelta;for(let t in r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,n.animationValues?r.opacity=n===this?null!==(i=null!==(e=o.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==i?i:1:this.preserveOpacity?this.latestValues.opacity:o.opacityExit:r.opacity=n===this?void 0!==o.opacity?o.opacity:"":void 0!==o.opacityExit?o.opacityExit:0,R){if(void 0===o[t])continue;let{correct:e,applyTo:i}=R[t],s="none"===r.transform?o[t]:e(o[t],n);if(i){let t=i.length;for(let e=0;e<t;e++)r[i[e]]=s}else r[t]=s}return this.options.layoutId&&(r.pointerEvents=n===this?tC(null==t?void 0:t.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(se),this.root.sharedNodes.clear()}}}function r4(t){t.updateLayout()}function r8(t){var e;let i=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){let{layoutBox:e,measuredBox:r}=t.layout,{animationType:s}=t.options,n=i.source!==t.layout.source;"size"===s?rr(t=>{let r=n?i.measuredBox[t]:i.layoutBox[t],s=iJ(r);r.min=e[t].min,r.max=r.min+s}):sg(s,i.layoutBox,e)&&rr(r=>{let s=n?i.measuredBox[r]:i.layoutBox[r],o=iJ(e[r]);s.max=s.min+o,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[r].max=t.relativeTarget[r].min+o)});let o=rt();i1(o,e,i.layoutBox);let a=rt();n?i1(a,t.applyTransform(r,!0),i.measuredBox):i1(a,e,i.layoutBox);let l=!rZ(o),h=!1;if(!t.resumeFrom){let r=t.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:s,layout:n}=r;if(s&&n){let o=ri();i3(o,i.layoutBox,s.layoutBox);let a=ri();i3(a,e,n.layoutBox),rX(o,a)||(h=!0),r.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=o,t.relativeParent=r)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:i,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeTargetChanged:h})}else if(t.isLead()){let{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function r9(t){r3.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function r7(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function st(t){t.clearSnapshot()}function se(t){t.clearMeasurements()}function si(t){t.isLayoutDirty=!1}function sr(t){let{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ss(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function sn(t){t.resolveTargetDelta()}function so(t){t.calcProjection()}function sa(t){t.resetRotation()}function sl(t){t.removeLeadSnapshot()}function sh(t,e,i){t.translate=eC(e.translate,0,i),t.scale=eC(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function su(t,e,i,r){t.min=eC(e.min,i.min,r),t.max=eC(e.max,i.max,r)}function sc(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}let sp={duration:.45,ease:[.4,0,.1,1]},sd=t=>"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().includes(t),sf=sd("applewebkit/")&&!sd("chrome/")?Math.round:tG.Z;function sm(t){t.min=sf(t.min),t.max=sf(t.max)}function sg(t,e,i){return"position"===t||"preserve-aspect"===t&&!iQ(rK(e),rK(i),.2)}let sy=r6({attachResizeListener:(t,e)=>tO(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),sv={current:void 0},sb=r6({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!sv.current){let t=new sy({});t.mount(window),t.setOptions({layoutScroll:!0}),sv.current=t}return sv.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>"fixed"===window.getComputedStyle(t).position}),sx=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function sw(t,e,i=1){(0,t9.k)(i<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);let[r,s]=function(t){let e=sx.exec(t);if(!e)return[,];let[,i,r]=e;return[i,r]}(t);if(!r)return;let n=window.getComputedStyle(e).getPropertyValue(r);if(n){let t=n.trim();return iA(t)?parseFloat(t):t}return N(s)?sw(s,e,i+1):s}let sT=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),sP=t=>sT.has(t),sA=t=>Object.keys(t).some(sP),sE=t=>t===W||t===Q,sk=(t,e)=>parseFloat(t.split(", ")[e]),sS=(t,e)=>(i,{transform:r})=>{if("none"===r||!r)return 0;let s=r.match(/^matrix3d\((.+)\)$/);if(s)return sk(s[1],e);{let e=r.match(/^matrix\((.+)\)$/);return e?sk(e[1],t):0}},s_=new Set(["x","y","z"]),sC=V.filter(t=>!s_.has(t)),sR={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:sS(4,13),y:sS(5,14)};sR.translateX=sR.x,sR.translateY=sR.y;let sV=(t,e,i)=>{let r=e.measureViewportBox(),s=e.current,n=getComputedStyle(s),{display:o}=n,a={};"none"===o&&e.setStaticValue("display",t.display||"block"),i.forEach(t=>{a[t]=sR[t](r,n)}),e.render();let l=e.measureViewportBox();return i.forEach(i=>{let r=e.getValue(i);r&&r.jump(a[i]),t[i]=sR[i](l,n)}),t},sL=(t,e,i={},r={})=>{e={...e},r={...r};let s=Object.keys(e).filter(sP),n=[],o=!1,a=[];if(s.forEach(s=>{let l;let h=t.getValue(s);if(!t.hasValue(s))return;let u=i[s],c=iO(u),p=e[s];if(tk(p)){let t=p.length,e=null===p[0]?1:0;c=iO(u=p[e]);for(let i=e;i<t&&null!==p[i];i++)l?(0,t9.k)(iO(p[i])===l,"All keyframes must be of the same type"):(l=iO(p[i]),(0,t9.k)(l===c||sE(c)&&sE(l),"Keyframes must be of the same dimension as the current value"))}else l=iO(p);if(c!==l){if(sE(c)&&sE(l)){let t=h.get();"string"==typeof t&&h.set(parseFloat(t)),"string"==typeof p?e[s]=parseFloat(p):Array.isArray(p)&&l===Q&&(e[s]=p.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==l?void 0:l.transform)&&(0===u||0===p)?0===u?h.set(l.transform(u)):e[s]=c.transform(p):(o||(n=function(t){let e=[];return sC.forEach(i=>{let r=t.getValue(i);void 0!==r&&(e.push([i,r.get()]),r.set(i.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),o=!0),a.push(s),r[s]=void 0!==r[s]?r[s]:e[s],h.jump(p))}}),!a.length)return{target:e,transitionEnd:r};{let i=a.indexOf("height")>=0?window.pageYOffset:null,s=sV(e,t,a);return n.length&&n.forEach(([e,i])=>{t.getValue(e).set(i)}),t.render(),A.j&&null!==i&&window.scrollTo({top:i}),{target:s,transitionEnd:r}}},sD=(t,e,i,r)=>{var s,n;let o=function(t,{...e},i){let r=t.current;if(!(r instanceof Element))return{target:e,transitionEnd:i};for(let s in i&&(i={...i}),t.values.forEach(t=>{let e=t.get();if(!N(e))return;let i=sw(e,r);i&&t.set(i)}),e){let t=e[s];if(!N(t))continue;let n=sw(t,r);n&&(e[s]=n,i||(i={}),void 0===i[s]&&(i[s]=t))}return{target:e,transitionEnd:i}}(t,e,r);return e=o.target,r=o.transitionEnd,s=e,n=r,sA(s)?sL(t,s,i,n):{target:s,transitionEnd:n}},sO={current:null},sM={current:!1},sB=new WeakMap,sj=Object.keys(P),sF=sj.length,sN=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],sU=v.length;class sI{constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:r,visualState:s},n={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,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.scheduleRender=()=>tV.Wi.render(this.render,!1,!0);let{latestValues:o,renderState:a}=s;this.latestValues=o,this.baseTarget={...o},this.initialValues=e.initial?{...o}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=n,this.isControllingVariants=b(e),this.isVariantNode=x(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:l,...h}=this.scrapeMotionValuesFromProps(e,{});for(let t in h){let e=h[t];void 0!==o[t]&&O(e)&&(e.set(o[t],!1),iP(l)&&l.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,sB.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((t,e)=>this.bindToMotionValue(e,t)),sM.current||function(){if(sM.current=!0,A.j){if(window.matchMedia){let t=window.matchMedia("(prefers-reduced-motion)"),e=()=>sO.current=t.matches;t.addListener(e),e()}else sO.current=!1}}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||sO.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){for(let t in sB.delete(this.current),this.projection&&this.projection.unmount(),(0,tV.Pn)(this.notifyUpdate),(0,tV.Pn)(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this),this.events)this.events[t].clear();for(let t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){let i=L.has(t),r=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&tV.Wi.update(this.notifyUpdate,!1,!0),i&&this.projection&&(this.projection.isTransformDirty=!0)}),s=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{r(),s()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},i,r,s){let n,o;for(let t=0;t<sF;t++){let i=sj[t],{isEnabled:r,Feature:s,ProjectionNode:a,MeasureLayout:l}=P[i];a&&(n=a),r(e)&&(!this.features[i]&&s&&(this.features[i]=new s(this)),l&&(o=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&n){this.projection=new n(this.latestValues,this.parent&&this.parent.projection);let{layoutId:t,layout:i,drag:r,dragConstraints:o,layoutScroll:a,layoutRoot:l}=e;this.projection.setOptions({layoutId:t,layout:i,alwaysMeasureLayout:!!r||o&&f(o),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof i?i:"both",initialPromotionConfig:s,layoutScroll:a,layoutRoot:l})}return o}updateFeatures(){for(let t in this.features){let e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ri()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<sN.length;e++){let i=sN[e];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let r=t["on"+i];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=function(t,e,i){let{willChange:r}=e;for(let s in e){let n=e[s],o=i[s];if(O(n))t.addValue(s,n),iP(r)&&r.add(s);else if(O(o))t.addValue(s,iV(n,{owner:t})),iP(r)&&r.remove(s);else if(o!==n){if(t.hasValue(s)){let e=t.getValue(s);e.hasAnimated||e.set(n)}else{let e=t.getStaticValue(s);t.addValue(s,iV(void 0!==e?e:n,{owner:t}))}}}for(let r in i)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}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}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){let t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}let e={};for(let t=0;t<sU;t++){let i=v[t],r=this.props[i];(m(r)||!1===r)&&(e[i]=r)}return e}addVariantChild(t){let e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){this.values.delete(t);let e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return void 0===i&&void 0!==e&&(i=iV(e,{owner:this}),this.addValue(t,i)),i}readValue(t){var e;return void 0===this.latestValues[t]&&this.current?null!==(e=this.getBaseTargetFromProps(this.props,t))&&void 0!==e?e:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;let{initial:i}=this.props,r="string"==typeof i||"object"==typeof i?null===(e=tA(this.props,i))||void 0===e?void 0:e[t]:void 0;if(i&&void 0!==r)return r;let s=this.getBaseTargetFromProps(this.props,t);return void 0===s||O(s)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new iS),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class sW extends sI{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...i},{transformValues:r},s){let n=function(t,e,i){let r={};for(let s in t){let t=function(t,e){if(!e)return;let i=e[t]||e.default||e;return i.from}(s,e);if(void 0!==t)r[s]=t;else{let t=i.getValue(s);t&&(r[s]=t.get())}}return r}(i,t||{},this);if(r&&(e&&(e=r(e)),i&&(i=r(i)),n&&(n=r(n))),s){!function(t,e,i){var r,s;let n=Object.keys(e).filter(e=>!t.hasValue(e)),o=n.length;if(o)for(let a=0;a<o;a++){let o=n[a],l=e[o],h=null;Array.isArray(l)&&(h=l[0]),null===h&&(h=null!==(s=null!==(r=i[o])&&void 0!==r?r:t.readValue(o))&&void 0!==s?s:e[o]),null!=h&&("string"==typeof h&&(iA(h)||ib(h))?h=parseFloat(h):!iB(h)&&e$.test(l)&&(h=iv(o,l)),t.addValue(o,iV(h,{owner:t})),void 0===i[o]&&(i[o]=h),null!==h&&t.setBaseTarget(o,h))}}(this,i,n);let t=sD(this,i,n,e);e=t.transitionEnd,i=t.target}return{transition:t,transitionEnd:e,...i}}}class sq extends sW{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,e){if(L.has(e)){let t=iy(e);return t&&t.default||0}{let i=window.getComputedStyle(t),r=(F(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof r?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:e}){return rv(t,e)}build(t,e,i,r){tn(t,e,i,r.transformTemplate)}scrapeMotionValuesFromProps(t,e){return tT(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;O(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}renderInstance(t,e,i,r){tb(t,e,i,r)}}class s$ extends sW{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(L.has(e)){let t=iy(e);return t&&t.default||0}return e=tx.has(e)?e:p(e),t.getAttribute(e)}measureInstanceViewportBox(){return ri()}scrapeMotionValuesFromProps(t,e){return tP(t,e)}build(t,e,i,r){tm(t,e,i,this.isSVGTag,r.transformTemplate)}renderInstance(t,e,i,r){tw(t,e,i,r)}mount(t){this.isSVGTag=ty(t.tagName),super.mount(t)}}let sH=(t,e)=>C(t)?new s$(e,{enableHardwareAcceleration:!1}):new sq(e,{enableHardwareAcceleration:!0}),sz={animation:{Feature:iq},exit:{Feature:iH},inView:{Feature:t6},tap:{Feature:tQ},focus:{Feature:tX},hover:{Feature:tZ},pan:{Feature:rE},drag:{Feature:rP,ProjectionNode:sb,MeasureLayout:rR},layout:{ProjectionNode:sb,MeasureLayout:rR}},sY=function(t){function e(e,i={}){return function({preloadedFeatures:t,createVisualElement:e,useRender:i,useVisualState:r,Component:s}){t&&function(t){for(let e in t)P[e]={...P[e],...t[e]}}(t);let n=(0,o.forwardRef)(function(n,p){var g;let y;let v={...(0,o.useContext)(a),...n,layoutId:function({layoutId:t}){let e=(0,o.useContext)(E.p).id;return e&&void 0!==t?e+"-"+t:t}(n)},{isStatic:x}=v,T=function(t){let{initial:e,animate:i}=function(t,e){if(b(t)){let{initial:e,animate:i}=t;return{initial:!1===e||m(e)?e:void 0,animate:m(i)?i:void 0}}return!1!==t.inherit?e:{}}(t,(0,o.useContext)(l));return(0,o.useMemo)(()=>({initial:e,animate:i}),[w(e),w(i)])}(n),P=r(n,x);if(!x&&A.j){T.visualElement=function(t,e,i,r){let{visualElement:s}=(0,o.useContext)(l),n=(0,o.useContext)(c),p=(0,o.useContext)(h.O),f=(0,o.useContext)(a).reducedMotion,m=(0,o.useRef)();r=r||n.renderer,!m.current&&r&&(m.current=r(t,{visualState:e,parent:s,props:i,presenceContext:p,blockInitialAnimation:!!p&&!1===p.initial,reducedMotionConfig:f}));let g=m.current;(0,o.useInsertionEffect)(()=>{g&&g.update(i,p)});let y=(0,o.useRef)(!!(i[d]&&!window.HandoffComplete));return(0,u.L)(()=>{g&&(g.render(),y.current&&g.animationState&&g.animationState.animateChanges())}),(0,o.useEffect)(()=>{g&&(g.updateFeatures(),!y.current&&g.animationState&&g.animationState.animateChanges(),y.current&&(y.current=!1,window.HandoffComplete=!0))}),g}(s,P,v,e);let i=(0,o.useContext)(k),r=(0,o.useContext)(c).strict;T.visualElement&&(y=T.visualElement.loadFeatures(v,r,t,i))}return o.createElement(l.Provider,{value:T},y&&T.visualElement?o.createElement(y,{visualElement:T.visualElement,...v}):null,i(s,n,(g=T.visualElement,(0,o.useCallback)(t=>{t&&P.mount&&P.mount(t),g&&(t?g.mount(t):g.unmount()),p&&("function"==typeof p?p(t):f(p)&&(p.current=t))},[g])),P,x,T.visualElement))});return n[S]=s,n}(t(e,i))}if("undefined"==typeof Proxy)return e;let i=new Map;return new Proxy(e,{get:(t,r)=>(i.has(r)||i.set(r,e(r)),i.get(r))})}((t,e)=>(function(t,{forwardMotionProps:e=!1},i,r){let s=C(t)?tL:tD;return{...s,preloadedFeatures:i,useRender:function(t=!1){return(e,i,r,{latestValues:s},n)=>{let a=C(e)?tv:tl,l=a(i,s,n,e),h=function(t,e,i){let r={};for(let s in t)("values"!==s||"object"!=typeof t.values)&&(tc(s)||!0===i&&tu(s)||!e&&!tu(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}(i,"string"==typeof e,t),u={...h,...l,ref:r},{children:c}=i,p=(0,o.useMemo)(()=>O(c)?c.get():c,[c]);return(0,o.createElement)(e,{...u,children:p})}}(e),createVisualElement:r,Component:t}})(t,e,sz,sH))},6567:function(t,e,i){"use strict";i.d(e,{K:function(){return s},k:function(){return n}});var r=i(9588);let s=r.Z,n=r.Z},6613:function(t,e,i){"use strict";i.d(e,{j:function(){return r}});let r="undefined"!=typeof document},9588:function(t,e,i){"use strict";i.d(e,{Z:function(){return r}});let r=t=>t},961:function(t,e,i){"use strict";i.d(e,{h:function(){return s}});var r=i(2265);function s(t){let e=(0,r.useRef)(null);return null===e.current&&(e.current=t()),e.current}},538:function(t,e,i){"use strict";i.d(e,{L:function(){return n}});var r=i(2265),s=i(6613);let n=s.j?r.useLayoutEffect:r.useEffect},4337:function(t,e,i){"use strict";let r,s;i.d(e,{io:function(){return tE}});var n,o,a={};i.r(a),i.d(a,{Decoder:function(){return ty},Encoder:function(){return tm},PacketType:function(){return o},protocol:function(){return tf}});let l=Object.create(null);l.open="0",l.close="1",l.ping="2",l.pong="3",l.message="4",l.upgrade="5",l.noop="6";let h=Object.create(null);Object.keys(l).forEach(t=>{h[l[t]]=t});let u={type:"error",data:"parser error"},c="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),p="function"==typeof ArrayBuffer,d=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,f=({type:t,data:e},i,r)=>c&&e instanceof Blob?i?r(e):m(e,r):p&&(e instanceof ArrayBuffer||d(e))?i?r(e):m(new Blob([e]),r):r(l[t]+(e||"")),m=(t,e)=>{let i=new FileReader;return i.onload=function(){let t=i.result.split(",")[1];e("b"+(t||""))},i.readAsDataURL(t)};function g(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t<y.length;t++)v[y.charCodeAt(t)]=t;let b=t=>{let e=.75*t.length,i=t.length,r,s=0,n,o,a,l;"="===t[t.length-1]&&(e--,"="===t[t.length-2]&&e--);let h=new ArrayBuffer(e),u=new Uint8Array(h);for(r=0;r<i;r+=4)n=v[t.charCodeAt(r)],o=v[t.charCodeAt(r+1)],a=v[t.charCodeAt(r+2)],l=v[t.charCodeAt(r+3)],u[s++]=n<<2|o>>4,u[s++]=(15&o)<<4|a>>2,u[s++]=(3&a)<<6|63&l;return h},x="function"==typeof ArrayBuffer,w=(t,e)=>{if("string"!=typeof t)return{type:"message",data:P(t,e)};let i=t.charAt(0);if("b"===i)return{type:"message",data:T(t.substring(1),e)};let r=h[i];return r?t.length>1?{type:h[i],data:t.substring(1)}:{type:h[i]}:u},T=(t,e)=>{if(!x)return{base64:!0,data:t};{let i=b(t);return P(i,e)}},P=(t,e)=>"blob"===e?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer,A=(t,e)=>{let i=t.length,r=Array(i),s=0;t.forEach((t,n)=>{f(t,!1,t=>{r[n]=t,++s===i&&e(r.join("\x1e"))})})},E=(t,e)=>{let i=t.split("\x1e"),r=[];for(let t=0;t<i.length;t++){let s=w(i[t],e);if(r.push(s),"error"===s.type)break}return r};function k(t){return t.reduce((t,e)=>t+e.length,0)}function S(t,e){if(t[0].length===e)return t.shift();let i=new Uint8Array(e),r=0;for(let s=0;s<e;s++)i[s]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),i}function _(t){if(t)return function(t){for(var e in _.prototype)t[e]=_.prototype[e];return t}(t)}_.prototype.on=_.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},_.prototype.once=function(t,e){function i(){this.off(t,i),e.apply(this,arguments)}return i.fn=e,this.on(t,i),this},_.prototype.off=_.prototype.removeListener=_.prototype.removeAllListeners=_.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var s=0;s<r.length;s++)if((i=r[s])===e||i.fn===e){r.splice(s,1);break}return 0===r.length&&delete this._callbacks["$"+t],this},_.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=Array(arguments.length-1),i=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(i){i=i.slice(0);for(var r=0,s=i.length;r<s;++r)i[r].apply(this,e)}return this},_.prototype.emitReserved=_.prototype.emit,_.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},_.prototype.hasListeners=function(t){return!!this.listeners(t).length};let C=(()=>{let t="function"==typeof Promise&&"function"==typeof Promise.resolve;return t?t=>Promise.resolve().then(t):(t,e)=>e(t,0)})(),R="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function V(t,...e){return e.reduce((e,i)=>(t.hasOwnProperty(i)&&(e[i]=t[i]),e),{})}let L=R.setTimeout,D=R.clearTimeout;function O(t,e){e.useNativeTimers?(t.setTimeoutFn=L.bind(R),t.clearTimeoutFn=D.bind(R)):(t.setTimeoutFn=R.setTimeout.bind(R),t.clearTimeoutFn=R.clearTimeout.bind(R))}function M(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class B extends Error{constructor(t,e,i){super(t),this.description=e,this.context=i,this.type="TransportError"}}class j extends _{constructor(t){super(),this.writable=!1,O(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,e,i){return super.emitReserved("error",new B(t,e,i)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(t){"open"===this.readyState&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){let e=w(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,e={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){let t=this.opts.hostname;return -1===t.indexOf(":")?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(t){let e=function(t){let e="";for(let i in t)t.hasOwnProperty(i)&&(e.length&&(e+="&"),e+=encodeURIComponent(i)+"="+encodeURIComponent(t[i]));return e}(t);return e.length?"?"+e:""}}class F extends j{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";let e=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let t=0;this._polling&&(t++,this.once("pollComplete",function(){--t||e()})),this.writable||(t++,this.once("drain",function(){--t||e()}))}else e()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){E(t,this.socket.binaryType).forEach(t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)}),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){let t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){this.writable=!1,A(t,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.opts.secure?"https":"http",e=this.query||{};return!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=M()),this.supportsBinary||e.sid||(e.b64=1),this.createUri(t,e)}}let N=!1;try{N="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}let U=N;function I(){}class W extends F{constructor(t){if(super(t),"undefined"!=typeof location){let e="https:"===location.protocol,i=location.port;i||(i=e?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||i!==t.port}}doWrite(t,e){let i=this.request({method:"POST",data:t});i.on("success",e),i.on("error",(t,e)=>{this.onError("xhr post error",t,e)})}doPoll(){let t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(t,e)=>{this.onError("xhr poll error",t,e)}),this.pollXhr=t}}class Request extends _{constructor(t,e,i){super(),this.createRequest=t,O(this,i),this._opts=i,this._method=i.method||"GET",this._uri=e,this._data=void 0!==i.data?i.data:null,this._create()}_create(){var t;let e=V(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this._opts.xd;let i=this._xhr=this.createRequest(e);try{i.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders)for(let t in i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0),this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(t)&&i.setRequestHeader(t,this._opts.extraHeaders[t])}catch(t){}if("POST"===this._method)try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{i.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this._opts.cookieJar)||void 0===t||t.addCookies(i),"withCredentials"in i&&(i.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(i.timeout=this._opts.requestTimeout),i.onreadystatechange=()=>{var t;3===i.readyState&&(null===(t=this._opts.cookieJar)||void 0===t||t.parseCookies(i.getResponseHeader("set-cookie"))),4===i.readyState&&(200===i.status||1223===i.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof i.status?i.status:0)},0))},i.send(this._data)}catch(t){this.setTimeoutFn(()=>{this._onError(t)},0);return}"undefined"!=typeof document&&(this._index=Request.requestsCount++,Request.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=I,t)try{this._xhr.abort()}catch(t){}"undefined"!=typeof document&&delete Request.requests[this._index],this._xhr=null}}_onLoad(){let t=this._xhr.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(Request.requestsCount=0,Request.requests={},"undefined"!=typeof document){if("function"==typeof attachEvent)attachEvent("onunload",q);else if("function"==typeof addEventListener){let t="onpagehide"in R?"pagehide":"unload";addEventListener(t,q,!1)}}function q(){for(let t in Request.requests)Request.requests.hasOwnProperty(t)&&Request.requests[t].abort()}let $=function(){let t=z({xdomain:!1});return t&&null!==t.responseType}();class H extends W{constructor(t){super(t);let e=t&&t.forceBase64;this.supportsBinary=$&&!e}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Request(z,this.uri(),t)}}function z(t){let e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||U))return new XMLHttpRequest}catch(t){}if(!e)try{return new R[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(t){}}let Y="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class Z extends j{get name(){return"websocket"}doOpen(){let t=this.uri(),e=this.opts.protocols,i=Y?{}:V(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,e,i)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e<t.length;e++){let i=t[e],r=e===t.length-1;f(i,this.supportsBinary,t=>{try{this.doWrite(i,t)}catch(t){}r&&C(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let t=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=M()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}}let X=R.WebSocket||R.MozWebSocket;class K extends Z{createSocket(t,e,i){return Y?new X(t,e,i):e?new X(t,e):new X(t)}doWrite(t,e){this.ws.send(e)}}class G extends j{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{let e=function(t,e){s||(s=new TextDecoder);let i=[],r=0,n=-1,o=!1;return new TransformStream({transform(a,l){for(i.push(a);;){if(0===r){if(1>k(i))break;let t=S(i,1);o=(128&t[0])==128,r=(n=127&t[0])<126?3:126===n?1:2}else if(1===r){if(2>k(i))break;let t=S(i,2);n=new DataView(t.buffer,t.byteOffset,t.length).getUint16(0),r=3}else if(2===r){if(8>k(i))break;let t=S(i,8),e=new DataView(t.buffer,t.byteOffset,t.length),s=e.getUint32(0);if(s>2097151){l.enqueue(u);break}n=4294967296*s+e.getUint32(4),r=3}else{if(k(i)<n)break;let t=S(i,n);l.enqueue(w(o?t:s.decode(t),e)),r=0}if(0===n||n>t){l.enqueue(u);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),i=t.readable.pipeThrough(e).getReader(),n=new TransformStream({transform(t,e){var i;i=i=>{let r;let s=i.length;if(s<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,s);else if(s<65536){r=new Uint8Array(3);let t=new DataView(r.buffer);t.setUint8(0,126),t.setUint16(1,s)}else{r=new Uint8Array(9);let t=new DataView(r.buffer);t.setUint8(0,127),t.setBigUint64(1,BigInt(s))}t.data&&"string"!=typeof t.data&&(r[0]|=128),e.enqueue(r),e.enqueue(i)},c&&t.data instanceof Blob?t.data.arrayBuffer().then(g).then(i):p&&(t.data instanceof ArrayBuffer||d(t.data))?i(g(t.data)):f(t,!1,t=>{r||(r=new TextEncoder),i(r.encode(t))})}});n.readable.pipeTo(t.writable),this._writer=n.writable.getWriter();let o=()=>{i.read().then(({done:t,value:e})=>{t||(this.onPacket(e),o())}).catch(t=>{})};o();let a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let e=0;e<t.length;e++){let i=t[e],r=e===t.length-1;this._writer.write(i).then(()=>{r&&C(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;null===(t=this._transport)||void 0===t||t.close()}}let J={websocket:K,webtransport:G,polling:H},Q=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,tt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function te(t){if(t.length>8e3)throw"URI too long";let e=t,i=t.indexOf("["),r=t.indexOf("]");-1!=i&&-1!=r&&(t=t.substring(0,i)+t.substring(i,r).replace(/:/g,";")+t.substring(r,t.length));let s=Q.exec(t||""),n={},o=14;for(;o--;)n[tt[o]]=s[o]||"";return -1!=i&&-1!=r&&(n.source=e,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=function(t,e){let i=e.replace(/\/{2,9}/g,"/").split("/");return("/"==e.slice(0,1)||0===e.length)&&i.splice(0,1),"/"==e.slice(-1)&&i.splice(i.length-1,1),i}(0,n.path),n.queryKey=function(t,e){let i={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(t,e,r){e&&(i[e]=r)}),i}(0,n.query),n}let ti="function"==typeof addEventListener&&"function"==typeof removeEventListener,tr=[];ti&&addEventListener("offline",()=>{tr.forEach(t=>t())},!1);class ts extends _{constructor(t,e){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&"object"==typeof t&&(e=t,t=null),t){let i=te(t);e.hostname=i.host,e.secure="https"===i.protocol||"wss"===i.protocol,e.port=i.port,i.query&&(e.query=i.query)}else e.host&&(e.hostname=te(e.host).host);O(this,e),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},e.transports.forEach(t=>{let e=t.prototype.name;this.transports.push(e),this._transportsByName[e]=t}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(t){let e={},i=t.split("&");for(let t=0,r=i.length;t<r;t++){let r=i[t].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}(this.opts.query)),ti&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},tr.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){let e=Object.assign({},this.opts.query);e.EIO=4,e.transport=t,this.id&&(e.sid=this.id);let i=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](i)}_open(){if(0===this.transports.length){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let t=this.opts.rememberUpgrade&&ts.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";let e=this.createTransport(t);e.open(),this.setTransport(e)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",ts.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let e=Error("server error");e.code=t.data,this._onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){let t=this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1;if(!t)return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){let i=this.writeBuffer[t].data;if(i&&(e+="string"==typeof i?function(t){let e=0,i=0;for(let r=0,s=t.length;r<s;r++)(e=t.charCodeAt(r))<128?i+=1:e<2048?i+=2:e<55296||e>=57344?i+=3:(r++,i+=4);return i}(i):Math.ceil(1.33*(i.byteLength||i.size))),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,C(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,e,i){return this._sendPacket("message",t,e,i),this}send(t,e,i){return this._sendPacket("message",t,e,i),this}_sendPacket(t,e,i,r){if("function"==typeof e&&(r=e,e=void 0),"function"==typeof i&&(r=i,i=null),"closing"===this.readyState||"closed"===this.readyState)return;(i=i||{}).compress=!1!==i.compress;let s={type:t,data:e,options:i};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),r&&this.once("flush",r),this.flush()}close(){let t=()=>{this._onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},i=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():t()}):this.upgrading?i():t()),this}_onError(t){if(ts.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ti&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let t=tr.indexOf(this._offlineEventListener);-1!==t&&tr.splice(t,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this._prevBufferLen=0}}}ts.protocol=4;class tn extends ts{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let e=this.createTransport(t),i=!1;ts.priorWebsocketSuccess=!1;let r=()=>{i||(e.send([{type:"ping",data:"probe"}]),e.once("packet",t=>{if(!i){if("pong"===t.type&&"probe"===t.data)this.upgrading=!0,this.emitReserved("upgrading",e),e&&(ts.priorWebsocketSuccess="websocket"===e.name,this.transport.pause(()=>{i||"closed"===this.readyState||(h(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())}));else{let t=Error("probe error");t.transport=e.name,this.emitReserved("upgradeError",t)}}}))};function s(){i||(i=!0,h(),e.close(),e=null)}let n=t=>{let i=Error("probe error: "+t);i.transport=e.name,s(),this.emitReserved("upgradeError",i)};function o(){n("transport closed")}function a(){n("socket closed")}function l(t){e&&t.name!==e.name&&s()}let h=()=>{e.removeListener("open",r),e.removeListener("error",n),e.removeListener("close",o),this.off("close",a),this.off("upgrading",l)};e.once("open",r),e.once("error",n),e.once("close",o),this.once("close",a),this.once("upgrading",l),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn(()=>{i||e.open()},200):e.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){let e=[];for(let i=0;i<t.length;i++)~this.transports.indexOf(t[i])&&e.push(t[i]);return e}}class to extends tn{constructor(t,e={}){let i="object"==typeof t?t:e;(!i.transports||i.transports&&"string"==typeof i.transports[0])&&(i.transports=(i.transports||["polling","websocket","webtransport"]).map(t=>J[t]).filter(t=>!!t)),super(t,i)}}to.protocol;let ta="function"==typeof ArrayBuffer,tl=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,th=Object.prototype.toString,tu="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===th.call(Blob),tc="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===th.call(File);function tp(t){return ta&&(t instanceof ArrayBuffer||tl(t))||tu&&t instanceof Blob||tc&&t instanceof File}let td=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],tf=5;(n=o||(o={}))[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK";class tm{constructor(t){this.replacer=t}encode(t){return(t.type===o.EVENT||t.type===o.ACK)&&function t(e,i){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let i=0,r=e.length;i<r;i++)if(t(e[i]))return!0;return!1}if(tp(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1==arguments.length)return t(e.toJSON(),!0);for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t(e[i]))return!0;return!1}(t)?this.encodeAsBinary({type:t.type===o.EVENT?o.BINARY_EVENT:o.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let e=""+t.type;return(t.type===o.BINARY_EVENT||t.type===o.BINARY_ACK)&&(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data,this.replacer)),e}encodeAsBinary(t){let e=function(t){let e=[],i=t.data;return t.data=function t(e,i){if(!e)return e;if(tp(e)){let t={_placeholder:!0,num:i.length};return i.push(e),t}if(Array.isArray(e)){let r=Array(e.length);for(let s=0;s<e.length;s++)r[s]=t(e[s],i);return r}if("object"==typeof e&&!(e instanceof Date)){let r={};for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=t(e[s],i));return r}return e}(i,e),t.attachments=e.length,{packet:t,buffers:e}}(t),i=this.encodeAsString(e.packet),r=e.buffers;return r.unshift(i),r}}function tg(t){return"[object Object]"===Object.prototype.toString.call(t)}class ty extends _{constructor(t){super(),this.reviver=t}add(t){let e;if("string"==typeof t){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");e=this.decodeString(t);let i=e.type===o.BINARY_EVENT;i||e.type===o.BINARY_ACK?(e.type=i?o.EVENT:o.ACK,this.reconstructor=new tv(e),0===e.attachments&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else if(tp(t)||t.base64){if(this.reconstructor)(e=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,super.emitReserved("decoded",e));else throw Error("got binary data when not reconstructing a packet")}else throw Error("Unknown type: "+t)}decodeString(t){let e=0,i={type:Number(t.charAt(0))};if(void 0===o[i.type])throw Error("unknown packet type "+i.type);if(i.type===o.BINARY_EVENT||i.type===o.BINARY_ACK){let r=e+1;for(;"-"!==t.charAt(++e)&&e!=t.length;);let s=t.substring(r,e);if(s!=Number(s)||"-"!==t.charAt(e))throw Error("Illegal attachments");i.attachments=Number(s)}if("/"===t.charAt(e+1)){let r=e+1;for(;++e;){let i=t.charAt(e);if(","===i||e===t.length)break}i.nsp=t.substring(r,e)}else i.nsp="/";let r=t.charAt(e+1);if(""!==r&&Number(r)==r){let r=e+1;for(;++e;){let i=t.charAt(e);if(null==i||Number(i)!=i){--e;break}if(e===t.length)break}i.id=Number(t.substring(r,e+1))}if(t.charAt(++e)){let r=this.tryParse(t.substr(e));if(ty.isPayloadValid(i.type,r))i.data=r;else throw Error("invalid payload")}return i}tryParse(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}}static isPayloadValid(t,e){switch(t){case o.CONNECT:return tg(e);case o.DISCONNECT:return void 0===e;case o.CONNECT_ERROR:return"string"==typeof e||tg(e);case o.EVENT:case o.BINARY_EVENT:return Array.isArray(e)&&("number"==typeof e[0]||"string"==typeof e[0]&&-1===td.indexOf(e[0]));case o.ACK:case o.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class tv{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e,i;let t=(e=this.reconPack,i=this.buffers,e.data=function t(e,i){if(!e)return e;if(e&&!0===e._placeholder){let t="number"==typeof e.num&&e.num>=0&&e.num<i.length;if(t)return i[e.num];throw Error("illegal attachments")}if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=t(e[r],i);else if("object"==typeof e)for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=t(e[r],i));return e}(e.data,i),delete e.attachments,e);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function tb(t,e,i){return t.on(e,i),function(){t.off(e,i)}}let tx=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class tw extends _{constructor(t,e,i){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,i&&i.auth&&(this.auth=i.auth),this._opts=Object.assign({},i),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let t=this.io;this.subs=[tb(t,"open",this.onopen.bind(this)),tb(t,"packet",this.onpacket.bind(this)),tb(t,"error",this.onerror.bind(this)),tb(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){var i,r,s;if(tx.hasOwnProperty(t))throw Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;let n={type:o.EVENT,data:e};if(n.options={},n.options.compress=!1!==this.flags.compress,"function"==typeof e[e.length-1]){let t=this.ids++,i=e.pop();this._registerAckCallback(t,i),n.id=t}let a=null===(r=null===(i=this.io.engine)||void 0===i?void 0:i.transport)||void 0===r?void 0:r.writable,l=this.connected&&!(null===(s=this.io.engine)||void 0===s?void 0:s._hasPingExpired()),h=this.flags.volatile&&!a;return h||(l?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(t,e){var i;let r=null!==(i=this.flags.timeout)&&void 0!==i?i:this._opts.ackTimeout;if(void 0===r){this.acks[t]=e;return}let s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let e=0;e<this.sendBuffer.length;e++)this.sendBuffer[e].id===t&&this.sendBuffer.splice(e,1);e.call(this,Error("operation has timed out"))},r),n=(...t)=>{this.io.clearTimeoutFn(s),e.apply(this,t)};n.withError=!0,this.acks[t]=n}emitWithAck(t,...e){return new Promise((i,r)=>{let s=(t,e)=>t?r(t):i(e);s.withError=!0,e.push(s),this.emit(t,...e)})}_addToQueue(t){let e;"function"==typeof t[t.length-1]&&(e=t.pop());let i={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((t,...r)=>{if(i!==this._queue[0])return;let s=null!==t;return s?i.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(t)):(this._queue.shift(),e&&e(null,...r)),i.pending=!1,this._drainQueue()}),this._queue.push(i),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||0===this._queue.length)return;let e=this._queue[0];(!e.pending||t)&&(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){"function"==typeof this.auth?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:o.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{let e=this.sendBuffer.some(e=>String(e.id)===t);if(!e){let e=this.acks[t];delete this.acks[t],e.withError&&e.call(this,Error("socket has been disconnected"))}})}onpacket(t){let e=t.nsp===this.nsp;if(e)switch(t.type){case o.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case o.EVENT:case o.BINARY_EVENT:this.onevent(t);break;case o.ACK:case o.BINARY_ACK:this.onack(t);break;case o.DISCONNECT:this.ondisconnect();break;case o.CONNECT_ERROR:this.destroy();let i=Error(t.data.message);i.data=t.data.data,this.emitReserved("connect_error",i)}}onevent(t){let e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){let e=this._anyListeners.slice();for(let i of e)i.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&"string"==typeof t[t.length-1]&&(this._lastOffset=t[t.length-1])}ack(t){let e=this,i=!1;return function(...r){i||(i=!0,e.packet({type:o.ACK,id:t,data:r}))}}onack(t){let e=this.acks[t.id];"function"==typeof e&&(delete this.acks[t.id],e.withError&&t.data.unshift(null),e.apply(this,t.data))}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:o.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){let e=this._anyListeners;for(let i=0;i<e.length;i++)if(t===e[i]){e.splice(i,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){let e=this._anyOutgoingListeners;for(let i=0;i<e.length;i++)if(t===e[i]){e.splice(i,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let e=this._anyOutgoingListeners.slice();for(let i of e)i.apply(this,t.data)}}}function tT(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}tT.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),i=Math.floor(e*this.jitter*t);t=(1&Math.floor(10*e))==0?t-i:t+i}return 0|Math.min(t,this.max)},tT.prototype.reset=function(){this.attempts=0},tT.prototype.setMin=function(t){this.ms=t},tT.prototype.setMax=function(t){this.max=t},tT.prototype.setJitter=function(t){this.jitter=t};class tP extends _{constructor(t,e){var i;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.opts=e,O(this,e),this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(i=e.randomizationFactor)&&void 0!==i?i:.5),this.backoff=new tT({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this._readyState="closed",this.uri=t;let r=e.parser||a;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==e.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(e=this.backoff)||void 0===e||e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(e=this.backoff)||void 0===e||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(e=this.backoff)||void 0===e||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new to(this.uri,this.opts);let e=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;let r=tb(e,"open",function(){i.onopen(),t&&t()}),s=e=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",e),t?t(e):this.maybeReconnectOnOpen()},n=tb(e,"error",s);if(!1!==this._timeout){let t=this._timeout,i=this.setTimeoutFn(()=>{r(),s(Error("timeout")),e.close()},t);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}return this.subs.push(r),this.subs.push(n),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let t=this.engine;this.subs.push(tb(t,"ping",this.onping.bind(this)),tb(t,"data",this.ondata.bind(this)),tb(t,"error",this.onerror.bind(this)),tb(t,"close",this.onclose.bind(this)),tb(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}}ondecoded(t){C(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let i=this.nsps[t];return i?this._autoConnect&&!i.active&&i.connect():(i=new tw(this,t,e),this.nsps[t]=i),i}_destroy(t){let e=Object.keys(this.nsps);for(let t of e){let e=this.nsps[t];if(e.active)return}this._close()}_packet(t){let e=this.encoder.encode(t);for(let i=0;i<e.length;i++)this.engine.write(e[i],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,e){var i;this.cleanup(),null===(i=this.engine)||void 0===i||i.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let e=this.backoff.duration();this._reconnecting=!0;let i=this.setTimeoutFn(()=>{!t.skipReconnect&&(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open(e=>{e?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):t.onreconnect()}))},e);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}}onreconnect(){let t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}let tA={};function tE(t,e){let i;"object"==typeof t&&(e=t,t=void 0),e=e||{};let r=function(t,e="",i){let r=t;i=i||"undefined"!=typeof location&&location,null==t&&(t=i.protocol+"//"+i.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?i.protocol+t:i.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==i?i.protocol+"//"+t:"https://"+t),r=te(t)),!r.port&&(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";let s=-1!==r.host.indexOf(":"),n=s?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+n+":"+r.port+e,r.href=r.protocol+"://"+n+(i&&i.port===r.port?"":":"+r.port),r}(t,e.path||"/socket.io"),s=r.source,n=r.id,o=r.path,a=tA[n]&&o in tA[n].nsps,l=e.forceNew||e["force new connection"]||!1===e.multiplex||a;return l?i=new tP(s,e):(tA[n]||(tA[n]=new tP(s,e)),i=tA[n]),r.query&&!e.query&&(e.query=r.queryKey),i.socket(r.path,e)}Object.assign(tE,{Manager:tP,Socket:tw,io:tE,connect:tE})}}]); |