UNPKG

89.6 kBJavaScriptView Raw
1!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t=t||self).Motion={},t.React)}(this,(function(t,e){"use strict";var n="default"in e?e.default:e,r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function s(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}var u,c=function(t){return"object"==typeof t&&t.hasOwnProperty("current")},f=0,l="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(t){return window.requestAnimationFrame(t)}:function(t){var e=Date.now(),n=Math.max(0,16.7-(e-f));f=e+n,setTimeout((function(){return t(f)}),n)};!function(t){t.Read="read",t.Update="update",t.Render="render",t.PostRender="postRender",t.FixedUpdate="fixedUpdate"}(u||(u={}));var d=1/60*1e3,p=!0,h=!1,v=!1,m={delta:0,timestamp:0},y=[u.Read,u.Update,u.Render,u.PostRender],g=function(t){return h=t},x=y.reduce((function(t,e){var n=function(t){var e=[],n=[],r=0,o=!1,i=0,a=new WeakSet,s=new WeakSet,u={cancel:function(t){var e=n.indexOf(t);a.add(t),-1!==e&&n.splice(e,1)},process:function(c){var f,l;if(o=!0,e=(f=[n,e])[0],(n=f[1]).length=0,r=e.length)for(i=0;i<r;i++)(l=e[i])(c),!0!==s.has(l)||a.has(l)||(u.schedule(l),t(!0));o=!1},schedule:function(t,i,u){void 0===i&&(i=!1),void 0===u&&(u=!1);var c=u&&o,f=c?e:n;a.delete(t),i&&s.add(t),-1===f.indexOf(t)&&(f.push(t),c&&(r=e.length))}};return u}(g);return t.sync[e]=function(t,e,r){return void 0===e&&(e=!1),void 0===r&&(r=!1),h||S(),n.schedule(t,e,r),t},t.cancelSync[e]=function(t){return n.cancel(t)},t.steps[e]=n,t}),{steps:{},sync:{},cancelSync:{}}),b=x.steps,E=x.sync,w=x.cancelSync,C=function(t){return b[t].process(m)},P=function(t){h=!1,m.delta=p?d:Math.max(Math.min(t-m.timestamp,40),1),p||(d=m.delta),m.timestamp=t,v=!0,y.forEach(C),v=!1,h&&(p=!1,l(P))},S=function(){h=!0,p=!0,v||l(P)},A=function(){return m},V=function(t,e){return function(n){return Math.max(Math.min(n,e),t)}},T=function(t){return t%1?Number(t.toFixed(5)):t},M=/(-)?(\d[\d\.]*)/g,L=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,k=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i,O={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},B=i(i({},O),{transform:V(0,1)}),R=i(i({},O),{default:1}),D=function(t){return{test:function(e){return"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},F=D("deg"),I=D("%"),U=D("px"),j=D("vh"),X=D("vw"),Y=i(i({},I),{parse:function(t){return I.parse(t)/100},transform:function(t){return I.transform(100*t)}}),H=V(0,255),z=function(t){return void 0!==t.red},W=function(t){return void 0!==t.hue};var N=function(t){return function(e){if("string"!=typeof e)return e;for(var n={},r=function(t){return t.substring(t.indexOf("(")+1,t.lastIndexOf(")"))}(e).replace(/(,|\/)/g," ").split(/ \s*/),o=0;o<4;o++)n[t[o]]=void 0!==r[o]?parseFloat(r[o]):1;return n}},G=i(i({},O),{transform:function(t){return Math.round(H(t))}});function _(t,e){return t.startsWith(e)&&k.test(t)}var Z={test:function(t){return"string"==typeof t?_(t,"rgb"):z(t)},parse:N(["red","green","blue","alpha"]),transform:function(t){var e=t.red,n=t.green,r=t.blue,o=t.alpha,i=void 0===o?1:o;return function(t){var e=t.red,n=t.green,r=t.blue,o=t.alpha;return"rgba("+e+", "+n+", "+r+", "+(void 0===o?1:o)+")"}({red:G.transform(e),green:G.transform(n),blue:G.transform(r),alpha:T(B.transform(i))})}},q={test:function(t){return"string"==typeof t?_(t,"hsl"):W(t)},parse:N(["hue","saturation","lightness","alpha"]),transform:function(t){var e=t.hue,n=t.saturation,r=t.lightness,o=t.alpha,i=void 0===o?1:o;return function(t){var e=t.hue,n=t.saturation,r=t.lightness,o=t.alpha;return"hsla("+e+", "+n+", "+r+", "+(void 0===o?1:o)+")"}({hue:Math.round(e),saturation:I.transform(T(n)),lightness:I.transform(T(r)),alpha:T(B.transform(i))})}},$=i(i({},Z),{test:function(t){return"string"==typeof t&&_(t,"#")},parse:function(t){var e="",n="",r="";return t.length>4?(e=t.substr(1,2),n=t.substr(3,2),r=t.substr(5,2)):(e=t.substr(1,1),n=t.substr(2,1),r=t.substr(3,1),e+=e,n+=n,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:1}}}),K={test:function(t){return"string"==typeof t&&k.test(t)||z(t)||W(t)},parse:function(t){return Z.test(t)?Z.parse(t):q.test(t)?q.parse(t):$.test(t)?$.parse(t):t},transform:function(t){return z(t)?Z.transform(t):W(t)?q.transform(t):t}},J=function(t){return"number"==typeof t?0:t},Q={test:function(t){if("string"!=typeof t||!isNaN(t))return!1;var e=0,n=t.match(M),r=t.match(L);return n&&(e+=n.length),r&&(e+=r.length),e>0},parse:function(t){var e=t,n=[],r=e.match(L);r&&(e=e.replace(L,"${c}"),n.push.apply(n,r.map(K.parse)));var o=e.match(M);return o&&n.push.apply(n,o.map(O.parse)),n},createTransformer:function(t){var e=t,n=0,r=t.match(L),o=r?r.length:0;if(r)for(var i=0;i<o;i++)e=e.replace(r[i],"${c}"),n++;var a=e.match(M),s=a?a.length:0;if(a)for(i=0;i<s;i++)e=e.replace(a[i],"${n}"),n++;return function(t){for(var r=e,i=0;i<n;i++)r=r.replace(i<o?"${c}":"${n}",i<o?K.transform(t[i]):T(t[i]));return r}},getAnimatableNone:function(t){var e=Q.parse(t);return Q.createTransformer(t)(e.map(J))}},tt=function(t){return function(e){return 1-t(1-e)}},et=function(t){return function(e){return e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2}},nt=tt,rt=et,ot=function(t){return function(e){return Math.pow(e,t)}},it=function(t){return function(e){return e*e*((t+1)*e-t)}},at=function(t){var e=it(t);return function(t){return(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))}},st=function(t){return t},ut=ot(2),ct=tt(ut),ft=et(ut),lt=function(t){return 1-Math.sin(Math.acos(t))},dt=tt(lt),pt=et(dt),ht=it(1.525),vt=tt(ht),mt=et(ht),yt=at(1.525),gt=function(t){var e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},xt="undefined"!=typeof Float32Array,bt=function(t,e){return 1-3*e+3*t},Et=function(t,e){return 3*e-6*t},wt=function(t){return 3*t},Ct=function(t,e,n){return 3*bt(e,n)*t*t+2*Et(e,n)*t+wt(e)},Pt=function(t,e,n){return((bt(e,n)*t+Et(e,n))*t+wt(e))*t};function St(t,e,n,r){var o=xt?new Float32Array(11):new Array(11),i=function(e){for(var r,i,a,s=0,u=1;10!==u&&o[u]<=e;++u)s+=.1;return--u,r=(e-o[u])/(o[u+1]-o[u]),(a=Ct(i=s+.1*r,t,n))>=.001?function(e,r){for(var o=0,i=0;o<8;++o){if(0===(i=Ct(r,t,n)))return r;r-=(Pt(r,t,n)-e)/i}return r}(e,i):0===a?i:function(e,r,o){var i,a,s=0;do{(i=Pt(a=r+(o-r)/2,t,n)-e)>0?o=a:r=a}while(Math.abs(i)>1e-7&&++s<10);return a}(e,s,s+.1)};!function(){for(var e=0;e<11;++e)o[e]=Pt(.1*e,t,n)}();return function(o){return t===e&&n===r?o:0===o?0:1===o?1:Pt(i(o),e,r)}}var At=Object.freeze({__proto__:null,reversed:tt,mirrored:et,createReversedEasing:nt,createMirroredEasing:rt,createExpoIn:ot,createBackIn:it,createAnticipateEasing:at,linear:st,easeIn:ut,easeOut:ct,easeInOut:ft,circIn:lt,circOut:dt,circInOut:pt,backIn:ht,backOut:vt,backInOut:mt,anticipate:yt,bounceOut:gt,bounceIn:function(t){return 1-gt(1-t)},bounceInOut:function(t){return t<.5?.5*(1-gt(1-2*t)):.5*gt(2*t-1)+.5},cubicBezier:St}),Vt={x:0,y:0,z:0},Tt=function(t){return"number"==typeof t},Mt=function(t){return function(e,n,r){return void 0!==r?t(e,n,r):function(r){return t(e,n,r)}}},Lt=Mt((function(t,e,n){return Math.min(Math.max(n,t),e)})),kt=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},Ot=function(t){return kt(t)&&t.hasOwnProperty("z")},Bt=function(t,e){return Math.abs(t-e)},Rt=function(t,e){if(void 0===e&&(e=Vt),Tt(t)&&Tt(e))return Bt(t,e);if(kt(t)&&kt(e)){var n=Bt(t.x,e.x),r=Bt(t.y,e.y),o=Ot(t)&&Ot(e)?Bt(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(o,2))}return 0},Dt=function(t,e,n){var r=e-t;return 0===r?1:(n-t)/r},Ft=function(t,e,n){return-n*t+n*e+t},It=function(){return(It=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ut=function(t,e,n){var r=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-r)+r))},jt=[$,Z,q],Xt=function(t){return jt.find((function(e){return e.test(t)}))},Yt=function(t,e){var n=Xt(t),r=Xt(e);n.transform,r.transform;var o=n.parse(t),i=r.parse(e),a=It({},o),s=n===q?Ft:Ut;return function(t){for(var e in a)"alpha"!==e&&(a[e]=s(o[e],i[e],t));return a.alpha=Ft(o.alpha,i.alpha,t),n.transform(a)}},Ht=function(t,e){return function(n){return e(t(n))}},zt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(Ht)};function Wt(t,e){return Tt(t)?function(n){return Ft(t,e,n)}:K.test(t)?Yt(t,e):Zt(t,e)}var Nt=function(t,e){var n=t.slice(),r=n.length,o=t.map((function(t,n){return Wt(t,e[n])}));return function(t){for(var e=0;e<r;e++)n[e]=o[e](t);return n}},Gt=function(t,e){var n=It({},t,e),r={};for(var o in n)void 0!==t[o]&&void 0!==e[o]&&(r[o]=Wt(t[o],e[o]));return function(t){for(var e in r)n[e]=r[e](t);return n}};function _t(t){for(var e=Q.parse(t),n=e.length,r=0,o=0,i=0,a=0;a<n;a++)r||"number"==typeof e[a]?r++:void 0!==e[a].hue?i++:o++;return{parsed:e,numNumbers:r,numRGB:o,numHSL:i}}var Zt=function(t,e){var n=Q.createTransformer(e),r=_t(t),o=_t(e);return zt(Nt(r.parsed,o.parsed),n)},qt=function(t,e){return function(n){return Ft(t,e,n)}};function $t(t,e,n){for(var r,o=[],i=n||("number"==typeof(r=t[0])?qt:"string"==typeof r?K.test(r)?Yt:Zt:Array.isArray(r)?Nt:"object"==typeof r?Gt:void 0),a=t.length-1,s=0;s<a;s++){var u=i(t[s],t[s+1]);if(e){var c=Array.isArray(e)?e[s]:e;u=zt(c,u)}o.push(u)}return o}function Kt(t,e,n){var r=void 0===n?{}:n,o=r.clamp,i=void 0===o||o,a=r.ease,s=r.mixer,u=t.length;e.length,!a||!Array.isArray(a)||a.length,t[0]>t[u-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());var c=$t(e,a,s),f=2===u?function(t,e){var n=t[0],r=t[1],o=e[0];return function(t){return o(Dt(n,r,t))}}(t,c):function(t,e){var n=t.length,r=n-1;return function(o){var i=0,a=!1;if(o<=t[0]?a=!0:o>=t[r]&&(i=r-1,a=!0),!a){for(var s=1;s<n&&!(t[s]>o||s===r);s++);i=s-1}var u=Dt(t[i],t[i+1],o);return e[i](u)}}(t,c);return i?zt(Lt(t[0],t[u-1]),f):f}var Jt=function(t,e){return e?t*(1e3/e):0},Qt=Mt((function(t,e,n){var r=e-t;return((n-t)%r+r)%r+t})),te=(Lt(0,1),function(){function t(t){var e,n=this;this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.updateAndNotify=function(t,e){void 0===e&&(e=!0),n.prev=n.current,n.current=t,n.updateSubscribers&&n.prev!==n.current&&n.updateSubscribers.forEach(n.notifySubscriber),e&&n.renderSubscribers&&n.renderSubscribers.forEach(n.notifySubscriber);var r=A(),o=r.delta,i=r.timestamp;n.lastUpdated!==i&&(n.timeDelta=o,n.lastUpdated=i,E.postRender(n.scheduleVelocityCheck))},this.notifySubscriber=function(t){t(n.current)},this.scheduleVelocityCheck=function(){return E.postRender(n.velocityCheck)},this.velocityCheck=function(t){t.timestamp!==n.lastUpdated&&(n.prev=n.current)},this.set(t,!1),this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}return t.prototype.subscribeTo=function(t,e){var n=this,r=function(){return e(n.current)};return t.add(r),function(){return t.delete(r)}},t.prototype.onChange=function(t){return this.updateSubscribers||(this.updateSubscribers=new Set),this.subscribeTo(this.updateSubscribers,t)},t.prototype.clearListeners=function(){var t;null===(t=this.updateSubscribers)||void 0===t||t.clear()},t.prototype.onRenderRequest=function(t){return this.renderSubscribers||(this.renderSubscribers=new Set),this.notifySubscriber(t),this.subscribeTo(this.renderSubscribers,t)},t.prototype.attach=function(t){this.passiveEffect=t},t.prototype.set=function(t,e){void 0===e&&(e=!0),e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)},t.prototype.get=function(){return this.current},t.prototype.getPrevious=function(){return this.prev},t.prototype.getVelocity=function(){return this.canTrackVelocity?Jt(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},t.prototype.start=function(t){var e=this;return this.stop(),new Promise((function(n){e.stopAnimation=t(n)})).then((function(){return e.clearAnimation()}))},t.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},t.prototype.isAnimating=function(){return!!this.stopAnimation},t.prototype.clearAnimation=function(){this.stopAnimation=null},t.prototype.destroy=function(){this.updateSubscribers&&this.updateSubscribers.clear(),this.renderSubscribers&&this.renderSubscribers.clear(),this.stop()},t}());function ee(t){return new te(t)}var ne=function(){function t(t,e){var n=this;this.children=new Set,this.latest={},this.values=new Map,this.valueSubscriptions=new Map,this.config={},this.update=function(){return n.config.onUpdate(n.latest)},this.triggerRender=function(){return n.render()},this.scheduleRender=function(){return E.render(n.triggerRender,!1,!0)},this.ref=function(t){t?n.mount(t):n.unmount(),n.externalRef&&("function"==typeof n.externalRef?n.externalRef(t):c(n.externalRef)&&(n.externalRef.current=t))},this.parent=t,this.rootParent=t?t.rootParent:this,this.treePath=t?s(t.treePath,[t]):[],this.depth=t?t.depth+1:0,this.externalRef=e}return t.prototype.subscribe=function(t){var e=this;return this.children.add(t),function(){return e.children.delete(t)}},t.prototype.hasValue=function(t){return this.values.has(t)},t.prototype.addValue=function(t,e){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latest[t]=e.get(),this.element&&this.subscribeToValue(t,e)},t.prototype.removeValue=function(t){var e=this.valueSubscriptions.get(t);e&&e(),this.values.delete(t),delete this.latest[t],this.valueSubscriptions.delete(t)},t.prototype.getValue=function(t,e){var n=this.values.get(t);return void 0===n&&void 0!==e&&(n=new te(e),this.addValue(t,n)),n},t.prototype.forEachValue=function(t){this.values.forEach(t)},t.prototype.getInstance=function(){return this.element},t.prototype.updateConfig=function(t){void 0===t&&(t={}),this.config=i({},t)},t.prototype.setSingleStaticValue=function(t,e){this.latest[t]=e},t.prototype.setStaticValues=function(t,e){if("string"==typeof t)this.setSingleStaticValue(t,e);else for(var n in t)this.setSingleStaticValue(n,t[n])},t.prototype.scheduleUpdateLayoutDelta=function(){E.update(this.rootParent.updateLayoutDelta,!1,!0)},t.prototype.subscribeToValue=function(t,e){var n=this,r=e.onChange((function(e){n.setSingleStaticValue(t,e),n.latest[t]=e,n.config.onUpdate&&E.update(n.update,!1,!0)})),o=e.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,(function(){r(),o()}))},t.prototype.mount=function(t){var e=this;this.parent&&(this.removeFromParent=this.parent.subscribe(this)),this.element=this.current=t,this.forEachValue((function(t,n){return e.subscribeToValue(n,t)}))},t.prototype.unmount=function(){var t=this;this.forEachValue((function(e,n){return t.removeValue(n)})),w.update(this.update),w.render(this.render),this.removeFromParent&&this.removeFromParent()},t}();function re(t){return t}function oe(t){var e=t.top;return{x:{min:t.left,max:t.right},y:{min:e,max:t.bottom}}}function ie(t){return{x:i({},t.x),y:i({},t.y)}}var ae={translate:0,scale:1,origin:0,originPoint:0};function se(){return{x:i({},ae),y:i({},ae)}}var ue=i(i({},O),{transform:Math.round}),ce={color:K,backgroundColor:K,outlineColor:K,fill:K,stroke:K,borderColor:K,borderTopColor:K,borderRightColor:K,borderBottomColor:K,borderLeftColor:K,borderWidth:U,borderTopWidth:U,borderRightWidth:U,borderBottomWidth:U,borderLeftWidth:U,borderRadius:U,radius:U,borderTopLeftRadius:U,borderTopRightRadius:U,borderBottomRightRadius:U,borderBottomLeftRadius:U,width:U,maxWidth:U,height:U,maxHeight:U,size:U,top:U,right:U,bottom:U,left:U,padding:U,paddingTop:U,paddingRight:U,paddingBottom:U,paddingLeft:U,margin:U,marginTop:U,marginRight:U,marginBottom:U,marginLeft:U,rotate:F,rotateX:F,rotateY:F,rotateZ:F,scale:R,scaleX:R,scaleY:R,scaleZ:R,skew:F,skewX:F,skewY:F,distance:U,translateX:U,translateY:U,translateZ:U,x:U,y:U,z:U,perspective:U,opacity:B,originX:Y,originY:Y,originZ:U,zIndex:ue,fillOpacity:B,strokeOpacity:B,numOctaves:ue},fe=[O,U,I,F,X,j,{test:function(t){return"auto"===t},parse:function(t){return t}}],le=function(t){return function(e){return e.test(t)}},de=function(t){return fe.find(le(t))},pe=s(fe,[K,Q]),he=function(t){return pe.find(le(t))},ve=function(t){return ce[t]},me=function(t,e){return e&&"number"==typeof t?e.transform(t):t},ye=["","X","Y","Z"],ge=["x","y","z"];function xe(t,e){return ge.indexOf(t)-ge.indexOf(e)}["translate","scale","rotate","skew","transformPerspective"].forEach((function(t){ye.forEach((function(e){return ge.push(t+e)}))}));var be=new Set(ge);function Ee(t){return be.has(t)}var we=new Set(["originX","originY","originZ"]);function Ce(t){return we.has(t)}var Pe={x:"translateX",y:"translateY",z:"translateZ"};function Se(t){return t.startsWith("--")}function Ae(t,e){return t/(e.max-e.min)*100}var Ve={process:function(t,e){return"number"!=typeof t?t:Ae(t,e.x)+"% "+Ae(t,e.y)+"%"}},Te={borderRadius:i(i({},Ve),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Ve,borderTopRightRadius:Ve,borderBottomLeftRadius:Ve,borderBottomRightRadius:Ve,boxShadow:{process:function(t,e,n,r){var o=Q.parse(t),i=Q.createTransformer(t),a=n.x.scale*r.x,s=n.y.scale*r.y;o[1]/=a,o[2]/=s;var u=Ft(a,s,.5);return"number"==typeof o[3]&&(o[3]/=u),"number"==typeof o[4]&&(o[4]/=u),i(o)}}};function Me(t,e){return"translate3d("+t.x.translate/e.x+"px, "+t.y.translate/e.y+"px, 0) scale("+t.x.scale+", "+t.y.scale+")"}function Le(t,e,n,r,o,i,a,s,u,c,f,l){var d=a.enableHardwareAcceleration,p=a.transformTemplate,h=a.allowTransformNone;i.length=0;var v=!!s,m=!!s,y=!0;for(var g in t){var x=t[g],b=ve(g),E=me(x,b);if(Ee(g)){if(v=!0,r[g]=E,i.push(g),!y)continue;x!==(void 0!==b.default?b.default:0)&&(y=!1)}else if(Ce(g))o[g]=E,m=!0;else if("transform"!==g||"function"!=typeof x){var w=Se(g)?n:e;if(s&&Te[g]){var C=Te[g].process(x,l,u,f),P=Te[g].applyTo;if(P)for(var S=P.length,A=0;A<S;A++)w[P[A]]=C;else w[g]=C}else w[g]=E}}if((v||p)&&(s?(e.transform=Me(c,f),p&&(e.transform=p(r,e.transform))):e.transform=function(t,e,n,r,o,i){void 0===o&&(o=!0),void 0===i&&(i=!0);var a="",s=!1;e.sort(xe);for(var u=e.length,c=0;c<u;c++){var f=e[c];a+=(Pe[f]||f)+"("+t[f]+") ","z"===f&&(s=!0)}return!s&&o?a+="translateZ(0)":a=a.trim(),n?a=n(t,r?"":a):i&&r&&(a="none"),a}(r,i,p,y,d,h)),m){var V=s?100*c.x.origin+"%":o.originX||"50%",T=s?100*c.y.origin+"%":o.originY||"50%",M=o.originZ||"0";e.transformOrigin=V+" "+T+" "+M}}function ke(t,e){t.min=e.min,t.max=e.max}function Oe(t,e,n){return n+e*(t-n)}function Be(t,e,n,r,o){return void 0!==o&&(t=Oe(t,o,r)),Oe(t,n,r)+e}function Re(t,e,n,r,o){void 0===e&&(e=0),void 0===n&&(n=1),t.min=Be(t.min,e,n,r,o),t.max=Be(t.max,e,n,r,o)}function De(t,e){var n=e.x,r=e.y;Re(t.x,n.translate,n.scale,n.originPoint),Re(t.y,r.translate,r.scale,r.originPoint)}function Fe(t,e,n,r){var o=r[0],i=r[1],a=r[2];t.min=e.min,t.max=e.max;var s=Ft(e.min,e.max,n[a]||.5);Re(t,n[o],n[i],s,n.scale)}var Ie=["x","scaleX","originX"],Ue=["y","scaleY","originY"];function je(t,e,n,r,o){return t=Oe(t-=e,1/n,r),void 0!==o&&(t=Oe(t,1/o,r)),t}function Xe(t,e,n){var r=n[0],o=n[1],i=n[2];!function(t,e,n,r,o){void 0===e&&(e=0),void 0===n&&(n=1),void 0===r&&(r=.5);var i=Ft(t.min,t.max,r)-e;t.min=je(t.min,e,n,i,o),t.max=je(t.max,e,n,i,o)}(t,e[r],e[o],e[i],e.scale)}var Ye=Lt(0,1);function He(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=.01),Rt(t,e)<n}function ze(t,e){var n=.5,r=t.max-t.min,o=e.max-e.min;return o>r?n=Dt(e.min,e.max-r,t.min):r>o&&(n=Dt(t.min,t.max-o,e.min)),Ye(n)}function We(t,e,n,r){var o=e.max-e.min,i=n.max-n.min;t.origin=void 0===r?ze(e,n):r,t.originPoint=Ft(e.min,e.max,t.origin),t.scale=i/o,He(t.scale,1,1e-4)&&(t.scale=1),t.translate=function(t,e,n){var r=Ft(t.min,t.max,n);return Ft(e.min,e.max,n)-r}(e,n,t.origin),He(t.translate)&&(t.translate=0)}function Ne(t,e,n,r){We(t.x,e.x,n.x,r),We(t.y,e.y,n.y,r)}function Ge(t){return[t("x"),t("y")]}var _e=function(){return function(t,e){var n=this,r=t.middleware,o=t.onComplete;this.isActive=!0,this.update=function(t){n.observer.update&&n.updateObserver(t)},this.complete=function(){n.observer.complete&&n.isActive&&n.observer.complete(),n.onComplete&&n.onComplete(),n.isActive=!1},this.error=function(t){n.observer.error&&n.isActive&&n.observer.error(t),n.isActive=!1},this.observer=e,this.updateObserver=function(t){return e.update(t)},this.onComplete=o,e.update&&r&&r.length&&r.forEach((function(t){return n.updateObserver=t(n.updateObserver,n.complete)}))}}(),Ze=function(){function t(t){void 0===t&&(t={}),this.props=t}return t.prototype.create=function(e){return new t(e)},t.prototype.start=function(t){void 0===t&&(t={});var e=!1,n={stop:function(){}},r=this.props,o=(0,r.init)(function(t,e,n){var r=e.middleware;return new _e({middleware:r,onComplete:n},"function"==typeof t?{update:t}:t)}(t,a(r,["init"]),(function(){e=!0,n.stop()})));return n=o?i({},n,o):n,e&&n.stop(),n},t.prototype.applyMiddleware=function(t){return this.create(i({},this.props,{middleware:this.props.middleware?[t].concat(this.props.middleware):[t]}))},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=1===t.length?t[0]:zt.apply(void 0,t);return this.applyMiddleware((function(t){return function(e){return t(n(e))}}))},t}(),qe=function(t){return new Ze({init:t})},$e=[U,I,F,j,X],Ke=function(t){return $e.find((function(e){return e.test(t)}))},Je=function(t,e){return t(e)},Qe=function(t,e){var n=e.from,r=e.to,o=a(e,["from","to"]),s=Ke(n)||Ke(r),u=s.transform,c=s.parse;return t(i({},o,{from:"string"==typeof n?c(n):n,to:"string"==typeof r?c(r):r})).pipe(u)},tn=function(t){return function(e,n){var r=n.from,o=n.to,s=a(n,["from","to"]);return e(i({},s,{from:0,to:1})).pipe(t(r,o))}},en=tn(Yt),nn=tn(Zt),rn=function(t,e){var n=function(t){var e=Object.keys(t),n=function(e,n){return void 0!==e&&!t[n](e)};return{getVectorKeys:function(t){return e.reduce((function(e,r){return n(t[r],r)&&e.push(r),e}),[])},testVectorProps:function(t){return t&&e.some((function(e){return n(t[e],e)}))}}}(e),r=n.testVectorProps,o=n.getVectorKeys;return function(e){if(!r(e))return t(e);var n=o(e),i=e[n[0]];return on(i)(t,e,n)}},on=function(t){return"number"==typeof t?Je:function(t){return Boolean(Ke(t))}(t)?Qe:K.test(t)?en:Q.test(t)?nn:Je},an=rn((function(t){return void 0===t&&(t={}),qe((function(e){var n=e.complete,r=e.update,o=t.velocity,i=void 0===o?0:o,a=t.from,s=void 0===a?0:a,u=t.power,c=void 0===u?.8:u,f=t.timeConstant,l=void 0===f?350:f,d=t.restDelta,p=void 0===d?.5:d,h=t.modifyTarget,v=0,m=c*i,y=Math.round(s+m),g=void 0===h?y:h(y),x=E.update((function(t){var e=t.delta;v+=e;var o=-m*Math.exp(-v/l),i=o>p||o<-p;r(i?g+o:g),i||(w.update(x),n())}),!0);return{stop:function(){return w.update(x)}}}))}),{from:O.test,modifyTarget:function(t){return"function"==typeof t},velocity:O.test}),sn=rn((function(t){return void 0===t&&(t={}),qe((function(e){var n=e.update,r=e.complete,o=t.velocity,i=void 0===o?0:o,a=t.from,s=void 0===a?0:a,u=t.to,c=void 0===u?0:u,f=t.stiffness,l=void 0===f?100:f,d=t.damping,p=void 0===d?10:d,h=t.mass,v=void 0===h?1:h,m=t.restSpeed,y=void 0===m?.01:m,g=t.restDelta,x=void 0===g?.01:g,b=i?-i/1e3:0,C=0,P=c-s,S=s,A=S,V=E.update((function(t){var e=t.delta;C+=e;var o=p/(2*Math.sqrt(l*v)),a=Math.sqrt(l/v)/1e3;if(A=S,o<1){var s=Math.exp(-o*a*C),u=a*Math.sqrt(1-o*o);S=c-s*((b+o*a*P)/u*Math.sin(u*C)+P*Math.cos(u*C))}else{s=Math.exp(-a*C);S=c-s*(P+(b+a*P)*C)}i=Jt(S-A,e);var f=Math.abs(i)<=y,d=Math.abs(c-S)<=x;f&&d?(n(S=c),w.update(V),r()):n(S)}),!0);return{stop:function(){return w.update(V)}}}))}),{from:O.test,to:O.test,stiffness:O.test,damping:O.test,mass:O.test,velocity:O.test}),un=rn((function(t){var e=t.from,n=void 0===e?0:e,r=t.velocity,o=void 0===r?0:r,a=t.min,s=t.max,u=t.power,c=void 0===u?.8:u,f=t.timeConstant,l=void 0===f?700:f,d=t.bounceStiffness,p=void 0===d?500:d,h=t.bounceDamping,v=void 0===h?10:h,m=t.restDelta,y=void 0===m?1:m,g=t.modifyTarget;return qe((function(t){var e,r=t.update,u=t.complete,f=n,d=n,h=!1,m=function(t){return void 0!==a&&t<=a},x=function(t){return void 0!==s&&t>=s},b=function(t){return m(t)||x(t)},E=function(t){r(t),f=d,o=Jt((d=t)-f,A().delta),e&&!h&&function(t,e){return m(t)&&e<0||x(t)&&e>0}(t,o)&&C({from:t,velocity:o})},w=function(t,n){e&&e.stop(),e=t.start({update:E,complete:function(){n?n():u()}})},C=function(t){h=!0,w(sn(i({},t,{to:m(t.from)?a:s,stiffness:p,damping:v,restDelta:y})))};if(b(n))C({from:n,velocity:o});else if(0!==o){var P=an({from:n,velocity:o,timeConstant:l,power:c,restDelta:b(n)?20:y,modifyTarget:g});w(P,(function(){b(d)?C({from:d,velocity:o}):u()}))}else u();return{stop:function(){return e&&e.stop()}}}))}),{from:O.test,velocity:O.test,min:O.test,max:O.test,damping:O.test,stiffness:O.test,modifyTarget:function(t){return"function"==typeof t}}),cn=rn((function(t){var e=t.from,n=void 0===e?0:e,r=t.to,o=void 0===r?1:r,i=t.ease,a=void 0===i?st:i,s=t.reverseEase;return void 0!==s&&s&&(a=nt(a)),qe((function(t){var e=t.update;return{seek:function(t){return e(t)}}})).pipe(a,(function(t){return Ft(n,o,t)}))}),{ease:function(t){return"function"==typeof t},from:O.test,to:O.test}),fn=Lt(0,1),ln=function(t){return void 0===t&&(t={}),qe((function(e){var n,r=e.update,o=e.complete,i=t.duration,a=void 0===i?300:i,s=t.ease,u=void 0===s?ct:s,c=t.flip,f=void 0===c?0:c,l=t.loop,d=void 0===l?0:l,p=t.yoyo,h=void 0===p?0:p,v=t.repeatDelay,m=void 0===v?0:v,y=t.from,g=void 0===y?0:y,x=t.to,b=void 0===x?1:x,C=t.elapsed,P=void 0===C?0:C,S=t.flipCount,A=void 0===S?0:S,V=t.yoyoCount,T=void 0===V?0:V,M=t.loopCount,L=void 0===M?0:M,k=cn({from:g,to:b,ease:u}).start(r),O=0,B=!1,R=function(t){var e;void 0===t&&(t=!1),k=cn({from:g=(e=[b,g])[0],to:b=e[1],ease:u,reverseEase:t}).start(r)},D=function(){O=fn(Dt(0,a,P)),k.seek(O)},F=function(){B=!0,n=E.update((function(t){var e,r=t.delta;P+=r,D(),!(e=B&&P>a+m)||(!e||d||f||h)&&(P=P-a-m,d&&L<d?(L++,1):f&&A<f?(A++,R(),1):h&&T<h&&(T++,R(T%2!=0),1))||(w.update(n),o&&E.update(o,!1,!0))}),!0)},I=function(){B=!1,n&&w.update(n)};return F(),{isActive:function(){return B},getElapsed:function(){return Lt(0,a,P)},getProgress:function(){return O},stop:function(){I()},pause:function(){return I(),this},resume:function(){return B||F(),this},seek:function(t){return P=Ft(0,a,t),E.update(D,!1,!0),this},reverse:function(){return R(),this}}}))},dn=Lt(0,1),pn=function(t,e,n){return qe((function(r){var o=r.update,i=e.split(" ").map((function(e){return t.addEventListener(e,o,n),e}));return{stop:function(){return i.forEach((function(e){return t.removeEventListener(e,o,n)}))}}}))},hn=function(){return{clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}},vn=function(t,e){return void 0===e&&(e={clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}),e.clientX=e.x=t.clientX,e.clientY=e.y=t.clientY,e.pageX=t.pageX,e.pageY=t.pageY,e},mn=[hn()];if("undefined"!=typeof document){pn(document,"touchstart touchmove",{passive:!0,capture:!0}).start((function(t){var e=t.touches,n=e.length;mn.length=0;for(var r=0;r<n;r++){var o=e[r];mn.push(vn(o))}}))}var yn=hn();if("undefined"!=typeof document){pn(document,"mousedown mousemove",!0).start((function(t){vn(t,yn)}))}var gn=function(t){return qe((function(e){var n=e.complete,r=setTimeout(n,t);return{stop:function(){return clearTimeout(r)}}}))},xn=function(t){return Array.isArray(t)},bn=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},En=function(t){return{type:"spring",stiffness:700,damping:0===t?100:35}},wn=function(){return{ease:"linear",duration:.3}},Cn=function(t){return{type:"keyframes",duration:.8,values:t}},Pn={x:bn,y:bn,z:bn,rotate:bn,rotateX:bn,rotateY:bn,rotateZ:bn,scaleX:En,scaleY:En,scale:En,opacity:wn,backgroundColor:wn,color:wn,default:En},Sn=function(t){var e=t.to,n=t.duration;return qe((function(t){var r=t.update,o=t.complete;r(e),n?gn(n).start({complete:o}):o()}))},An=function(t){return Array.isArray(t)?(t.length,St(t[0],t[1],t[2],t[3])):"string"==typeof t?(At[t],At[t]):t},Vn=function(t){return Array.isArray(t)&&"number"!=typeof t[0]},Tn=function(t,e){return"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Q.test(e)||e.startsWith("url(")))},Mn=function(t){return 1e3*t},Ln={tween:ln,spring:sn,keyframes:function(t){var e=t.easings,n=t.ease,r=void 0===n?st:n,o=t.times,s=t.values,u=a(t,["easings","ease","times","values"]);e=Array.isArray(e)?e:function(t,e){return t.map((function(){return e||ct})).splice(0,t.length-1)}(s,e),o=o||function(t){var e=t.length;return t.map((function(t,n){return 0!==n?n/(e-1):0}))}(s);var c=e.map((function(t,e){return cn({from:s[e],to:s[e+1],ease:t})}));return ln(i({},u,{ease:r})).applyMiddleware((function(t){return function(t,e,n){var r=t.length,o=r-1,i=o-1,a=e.map((function(t){return t.start(n)}));return function(e){e<=t[0]&&a[0].seek(0),e>=t[o]&&a[i].seek(1);for(var n=1;n<r&&!(t[n]>e||n===o);n++);var s=Dt(t[n-1],t[n],e);a[n-1].seek(dn(s))}}(o,c,t)}))},inertia:un,just:Sn},kn={tween:function(t){if(t.ease){var e=Vn(t.ease)?t.ease[0]:t.ease;t.ease=An(e)}return t},keyframes:function(t){var e=t.from,n=(t.to,t.velocity,a(t,["from","to","velocity"]));if(n.values&&null===n.values[0]){var r=s(n.values);r[0]=e,n.values=r}return n.ease&&(n.easings=Vn(n.ease)?n.ease.map(An):An(n.ease)),n.ease=st,n}},On=function(t,e,n){var r=n?n.delay:0;if(void 0===n||!function(t){t.when,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection;var e=a(t,["when","delay","delayChildren","staggerChildren","staggerDirection"]);return Object.keys(e).length}(n))return i({delay:r},function(t,e){var n;return n=xn(e)?Cn:Pn[t]||Pn.default,i({to:e},n(e))}(t,e));var o=n[t]||n.default||n;return!1===o.type?{delay:o.hasOwnProperty("delay")?o.delay:r,to:xn(e)?e[e.length-1]:e,type:"just"}:xn(e)?i(i({values:e,duration:.8,delay:r,ease:"linear"},o),{type:"keyframes"}):i({type:"tween",to:e,delay:r},o)},Bn=function(t,e,n,r){var o,s=e.get(),u=Tn(t,s),c=Tn(t,n),f=On(t,n,r),l=f.type,d=void 0===l?"tween":l,p=a(f,["type"]),h=u&&c?Ln[d]:Sn,v=function(t,e){return kn[t]?kn[t](e):e}(d,i({from:s,velocity:e.getVelocity()},p));return((o=v).hasOwnProperty("duration")||o.hasOwnProperty("repeatDelay"))&&(v.duration&&(v.duration=Mn(v.duration)),v.repeatDelay&&(v.repeatDelay=Mn(v.repeatDelay))),[h,v]};function Rn(t,e,n,r){void 0===r&&(r={});var o=r.delay,i=void 0===o?0:o,s=a(r,["delay"]);return e.start((function(r){var o,u=Bn(t,e,n,s),c=u[0],f=u[1],l=f.delay,d=a(f,["delay"]);void 0!==l&&(i=l);var p=function(){var t=c(d);o=t.start({update:function(t){return e.set(t)},complete:r})};return i?o=gn(Mn(i)).start({complete:p}):p(),function(){o&&o.stop()}}))}function Dn(t,e){return oe(function(t,e){var n=t.top,r=t.left,o=t.bottom,i=t.right;void 0===e&&(e=re);var a=e({x:r,y:n}),s=e({x:i,y:o});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}var Fn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.defaultConfig={enableHardwareAcceleration:!0,allowTransformNone:!0},e.style={},e.reactStyle={},e.vars={},e.transform={},e.transformOrigin={},e.transformKeys=[],e.config=e.defaultConfig,e.isLayoutProjectionEnabled=!1,e.layoutUpdateListeners=new Set,e.hasViewportBoxUpdated=!1,e.targetBoxFinal={x:{min:0,max:1},y:{min:0,max:1}},e.treeScale={x:1,y:1},e.delta=se(),e.deltaFinal=se(),e.stopLayoutAxisAnimation={x:function(){},y:function(){}},e.isTargetBoxLocked=!1,e.axisProgress={x:ee(0),y:ee(0)},e.updateLayoutDelta=function(){e.isLayoutProjectionEnabled&&e.box&&e.updateLayoutDeltas(),e.children.forEach(In)},e}return o(e,t),e.prototype.removeValue=function(e){t.prototype.removeValue.call(this,e),delete this.vars[e],delete this.style[e]},e.prototype.clean=function(){this.style={},this.vars={},this.transform={}},e.prototype.updateConfig=function(t){void 0===t&&(t={}),this.config=i(i({},this.defaultConfig),t)},e.prototype.read=function(t){return this.getComputedStyle()[t]||0},e.prototype.readNativeValue=function(t){if(Ee(t)){var e=ve(t);return e&&e.default||0}return this.read(t)},e.prototype.enableLayoutProjection=function(){this.isLayoutProjectionEnabled=!0},e.prototype.hide=function(){!1!==this.isVisible&&(this.isVisible=!1,this.scheduleRender())},e.prototype.show=function(){!0!==this.isVisible&&(this.isVisible=!0,this.scheduleRender())},e.prototype.onLayoutUpdate=function(t){var e=this;return this.layoutUpdateListeners.add(t),function(){return e.layoutUpdateListeners.delete(t)}},e.prototype.layoutReady=function(t){var e=this;this.layoutUpdateListeners.forEach((function(n){n(e.box,e.prevViewportBox||e.box,t)}))},e.prototype.getBoundingBox=function(){var t=this.config.transformPagePoint;return Dn(this.element,t)},e.prototype.getBoundingBoxWithoutTransforms=function(){var t,e,n=this.getBoundingBox();return t=n,e=this.latest,Xe(t.x,e,Ie),Xe(t.y,e,Ue),n},e.prototype.getComputedStyle=function(){return window.getComputedStyle(this.element)},e.prototype.snapshotBoundingBox=function(){this.prevViewportBox=this.getBoundingBoxWithoutTransforms();var t=this.axisProgress,e=t.x,n=t.y;this.isTargetBoxLocked||e.isAnimating()||n.isAnimating()||(this.targetBox=ie(this.prevViewportBox))},e.prototype.measureLayout=function(){this.box=this.getBoundingBox(),this.boxCorrected=ie(this.box),this.targetBox||(this.targetBox=ie(this.box))},e.prototype.refreshTargetBox=function(){this.targetBox=this.getBoundingBoxWithoutTransforms()},e.prototype.lockTargetBox=function(){this.isTargetBoxLocked=!0},e.prototype.unlockTargetBox=function(){this.stopLayoutAnimation(),this.isTargetBoxLocked=!1},e.prototype.resetTransform=function(){var t=this.config.transformTemplate;this.element.style.transform=t?t({},""):"none",this.scheduleRender()},e.prototype.setAxisTarget=function(t,e,n){var r=this.targetBox[t];r.min=e,r.max=n,this.hasViewportBoxUpdated=!0,this.rootParent.scheduleUpdateLayoutDelta()},e.prototype.startLayoutAxisAnimation=function(t,e){var n=this,r=this.axisProgress[t],o=this.targetBox[t],i=o.min,a=o.max-i;return r.clearListeners(),r.set(i),r.set(i),r.onChange((function(e){return n.setAxisTarget(t,e,e+a)})),Rn(t,r,0,e)},e.prototype.stopLayoutAnimation=function(){var t=this;Ge((function(e){return t.axisProgress[e].stop()}))},e.prototype.updateLayoutDeltas=function(){var t,e,n,r,o,i,a;n=this.boxCorrected,r=this.box,ke(n.x,r.x),ke(n.y,r.y),this.parent&&(o=this.treeScale,i=this.parent.treeScale,a=this.parent.delta,o.x=i.x*a.x.scale,o.y=i.y*a.y.scale),function(t,e){for(var n=e.length,r=0;r<n;r++)De(t,e[r].delta)}(this.boxCorrected,this.treePath),Ne(this.delta,this.boxCorrected,this.targetBox),this.hasViewportBoxUpdated&&(null===(e=(t=this.config).onViewportBoxUpdate)||void 0===e||e.call(t,this.targetBox,this.delta)),this.hasViewportBoxUpdated=!1;var s=Me(this.delta,this.treeScale);s!==this.deltaTransform&&this.scheduleRender(),this.deltaTransform=s},e.prototype.updateTransformDeltas=function(){var t,e,n;this.isLayoutProjectionEnabled&&this.box&&(t=this.targetBoxFinal,e=this.targetBox,n=this.latest,Fe(t.x,e.x,n,Ie),Fe(t.y,e.y,n,Ue),Ne(this.deltaFinal,this.boxCorrected,this.targetBoxFinal))},e.prototype.build=function(){this.updateTransformDeltas(),void 0!==this.isVisible&&(this.style.visibility=this.isVisible?"visible":"hidden"),Le(this.latest,this.style,this.vars,this.transform,this.transformOrigin,this.transformKeys,this.config,this.isLayoutProjectionEnabled&&!!this.box,this.delta,this.deltaFinal,this.treeScale,this.targetBoxFinal)},e.prototype.render=function(){for(var t in this.build(),Object.assign(this.element.style,this.style),this.vars)this.element.style.setProperty(t,this.vars[t])},e}(ne),In=function(t){return t.updateLayoutDelta()};function Un(t){var n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}function jn(t,e,n){return"string"==typeof t?t:U.transform(e+n*t)}var Xn=function(t,e){return U.transform(t*e)},Yn={offset:"stroke-dashoffset",array:"stroke-dasharray"},Hn={offset:"strokeDashoffset",array:"strokeDasharray"};var zn={x:0,y:0,width:0,height:0};function Wn(t,e,n,r,o,i,s,u,c,f,l,d,p,h,v){var m=t.attrX,y=t.attrY,g=t.originX,x=t.originY,b=t.pathLength,E=t.pathSpacing,w=void 0===E?1:E,C=t.pathOffset,P=void 0===C?0:C;return Le(a(t,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),r,n,o,i,s,u,l,d,p,h,v),r.transform&&(e.transform=r.transform,delete r.transform),(void 0!==g||void 0!==x||e.transform)&&(e.transformOrigin=function(t,e,n){return jn(e,t.x,t.width)+" "+jn(n,t.y,t.height)}(c||zn,void 0!==g?g:.5,void 0!==x?x:.5)),void 0!==m&&(r.x=m),void 0!==y&&(r.y=y),void 0!==f&&void 0!==b&&function(t,e,n,r,o,i){void 0===r&&(r=1),void 0===o&&(o=0),void 0===i&&(i=!0);var a=i?Yn:Hn;t[a.offset]=Xn(-o,e);var s=Xn(n,e),u=Xn(r,e);t[a.array]=s+" "+u}(r,f,b,w,P,!1),r}var Nn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),Gn=/([a-z])([A-Z])/g,_n=function(t){return t.replace(Gn,"$1-$2").toLowerCase()},Zn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.attrs={},e.defaultConfig={enableHardwareAcceleration:!1},e.config=e.defaultConfig,e}return o(e,t),e.prototype.mount=function(e){t.prototype.mount.call(this,e),this.measure()},e.prototype.measure=function(){try{this.dimensions="function"==typeof this.element.getBBox?this.element.getBBox():this.element.getBoundingClientRect()}catch(t){this.dimensions={x:0,y:0,width:0,height:0}}"path"===this.element.tagName&&(this.totalPathLength=this.element.getTotalLength())},e.prototype.clean=function(){t.prototype.clean.call(this),this.attrs={}},e.prototype.read=function(t){return t=Nn.has(t)?t:_n(t),this.element.getAttribute(t)},e.prototype.build=function(){this.updateTransformDeltas(),Wn(this.latest,this.style,this.vars,this.attrs,this.transform,this.transformOrigin,this.transformKeys,this.config,this.dimensions,this.totalPathLength,this.isLayoutProjectionEnabled&&!!this.box,this.delta,this.deltaFinal,this.treeScale,this.targetBoxFinal)},e.prototype.render=function(){for(var e in t.prototype.render.call(this),this.attrs)this.element.setAttribute(_n(e),this.attrs[e])},e}(Fn);var qn=new Set(["animate","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use","view"]);function $n(t){return"string"==typeof t&&qn.has(t)}var Kn=e.createContext(null);function Jn(){var t=e.useContext(Kn);if(null===t)return[!0,null];var n=t.isPresent,r=t.onExitComplete,o=t.register,i=nr();e.useEffect((function(){return o(i)}),[]);return!n&&r?[!1,function(){return null==r?void 0:r(i)}]:[!0]}function Qn(){var t=e.useContext(Kn);return null===t||t.isPresent}var tr=0,er=function(){return tr++},nr=function(){return Un(er)},rr=function(t,e,n,r,o){var a=Un((function(){return new($n(t)?Zn:Fn)(n,o)}));a.updateConfig(i({enableHardwareAcceleration:!r},e)),a.layoutId=e.layoutId;var s=Qn();return a.isPresent=void 0!==e.isPresent?e.isPresent:s,a},or=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","static","layout","layoutId","onLayoutAnimationComplete","onViewportBoxUpdate","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragElastic","dragMomentum","dragPropagation","dragTransition","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","whileHover","whileTap","onHoverEnd","onHoverStart"]);function ir(t){return or.has(t)}var ar=function(t){return!ir(t)};try{var sr=require("@emotion/is-prop-valid").default;ar=function(t){return t.startsWith("on")?!ir(t):sr(t)}}catch(x){}function ur(t,n,r){var o="string"==typeof t?function(t){var e={};for(var n in t)ar(n)&&(e[n]=t[n]);return e}(n):n;r.clean(),r.build();var a=$n(t)?function(t){return i(i({},t.attrs),{style:i({},t.reactStyle)})}(r):function(t,e){var n=e.drag,r={style:i(i(i({},t.reactStyle),t.style),t.vars)};return n&&(r.style.userSelect="none",r.draggable=!1),r}(r,n);return e.createElement(t,i(i(i({},o),{ref:r.ref}),a))}function cr(t){return"string"==typeof t&&t.startsWith("var(--")}var fr=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function lr(t,e,n){var r=function(t){var e=fr.exec(t);return e?[e[1],e[2]]:[,]}(t),o=r[0],i=r[1];if(o){var a=window.getComputedStyle(e).getPropertyValue(o);return a||(cr(i)?lr(i,e):i)}}var dr,pr=new Set(["width","height","top","left","right","bottom","x","y"]),hr=function(t){return pr.has(t)},vr=function(t,e){t.set(e,!1),t.set(e)},mr=function(t){return t===O||t===U};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(dr||(dr={}));var yr=function(t,e){return parseFloat(t.split(", ")[e])},gr=function(t,e){return function(n,r){var o=r.transform;if("none"===o||!o)return 0;var i=o.match(/^matrix3d\((.+)\)$/);if(i)return yr(i[1],e);var a=o.match(/^matrix\((.+)\)$/);return a?yr(a[1],t):0}},xr=new Set(["x","y","z"]),br=ge.filter((function(t){return!xr.has(t)}));var Er={width:function(t){var e=t.x;return e.max-e.min},height:function(t){var e=t.y;return e.max-e.min},top:function(t,e){var n=e.top;return parseFloat(n)},left:function(t,e){var n=e.left;return parseFloat(n)},bottom:function(t,e){var n=t.y,r=e.top;return parseFloat(r)+(n.max-n.min)},right:function(t,e){var n=t.x,r=e.left;return parseFloat(r)+(n.max-n.min)},x:gr(4,13),y:gr(5,14)},wr=function(t,e,n,r){void 0===n&&(n={}),void 0===r&&(r={}),e=i({},e),r=i({},r);var o=Object.keys(e).filter(hr),a=[],s=!1,u=[];if(o.forEach((function(o){var i=t.getValue(o);if(t.hasValue(o)){var c,f=n[o],l=e[o],d=de(f);if(xn(l))for(var p=l.length,h=null===l[0]?1:0;h<p;h++)c?de(l[h]):c=de(l[h]);else c=de(l);if(d!==c)if(mr(d)&&mr(c)){var v=i.get();"string"==typeof v&&i.set(parseFloat(v)),"string"==typeof l?e[o]=parseFloat(l):Array.isArray(l)&&c===U&&(e[o]=l.map(parseFloat))}else s||(a=function(t){var e=[];return br.forEach((function(n){var r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),e.length&&t.render(),e}(t),s=!0),u.push(o),r[o]=void 0!==r[o]?r[o]:e[o],vr(i,l)}})),u.length){var c=function(t,e,n){var r=e.getBoundingBox(),o=e.getComputedStyle(),i=o.display,a={top:o.top,left:o.left,bottom:o.bottom,right:o.right,transform:o.transform};"none"===i&&e.setStaticValues("display",t.display||"block"),e.render();var s=e.getBoundingBox();return n.forEach((function(n){var i=e.getValue(n);vr(i,Er[n](r,a)),t[n]=Er[n](s,o)})),t}(e,t,u);return a.length&&a.forEach((function(e){var n=e[0],r=e[1];t.getValue(n).set(r)})),t.render(),{target:c,transitionEnd:r}}return{target:e,transitionEnd:r}};function Cr(t,e,n,r){return function(t){return Object.keys(t).some(hr)}(e)?wr(t,e,n,r):{target:e,transitionEnd:r}}var Pr=function(t,e,n,r){var o=function(t,e,n){var r=a(e,[]),o=t.getInstance();if(!(o instanceof HTMLElement))return{target:r,transitionEnd:n};for(var s in n&&(n=i({},n)),t.forEachValue((function(t){var e=t.get();if(cr(e)){var n=lr(e,o);n&&t.set(n)}})),r){var u=r[s];if(cr(u)){var c=lr(u,o);c&&(r[s]=c,n&&void 0===n[s]&&(n[s]=u))}}return{target:r,transitionEnd:n}}(t,e,r);return Cr(t,e=o.target,n,r=o.transitionEnd)};var Sr=function(){function t(){this.hasMounted=!1,this.pendingAnimations=[],this.componentControls=new Set}return t.prototype.setVariants=function(t){this.variants=t,this.componentControls.forEach((function(e){return e.setVariants(t)}))},t.prototype.setDefaultTransition=function(t){this.defaultTransition=t,this.componentControls.forEach((function(e){return e.setDefaultTransition(t)}))},t.prototype.subscribe=function(t){var e=this;return this.componentControls.add(t),this.variants&&t.setVariants(this.variants),this.defaultTransition&&t.setDefaultTransition(this.defaultTransition),function(){return e.componentControls.delete(t)}},t.prototype.start=function(t,e){var n=this;if(this.hasMounted){var r=[];return this.componentControls.forEach((function(n){var o=n.start(t,{transitionOverride:e});r.push(o)})),Promise.all(r)}return new Promise((function(r){n.pendingAnimations.push({animation:[t,e],resolve:r})}))},t.prototype.set=function(t){return this.hasMounted,this.componentControls.forEach((function(e){return e.apply(t)}))},t.prototype.stop=function(){this.componentControls.forEach((function(t){return t.stop()}))},t.prototype.mount=function(){var t=this;this.hasMounted=!0,this.pendingAnimations.forEach((function(e){var n=e.animation,r=e.resolve;return t.start.apply(t,n).then(r)}))},t.prototype.unmount=function(){this.hasMounted=!1,this.stop()},t}(),Ar=e.createContext({static:!1}),Vr=function(t){return"string"==typeof t||Array.isArray(t)},Tr=function(t){return t instanceof Sr},Mr=function(t,n,r,o,i){void 0===o&&(o=!1);var a,s=i.initial,u=i.animate,c=i.variants,f=i.whileTap,l=i.whileHover,d=i.layoutId,p=e.useContext(Kn),h=null==p?void 0:p.id;r.isPresenceRoot=t.presenceId!==h,void 0!==(null==p?void 0:p.initial)&&(s=p.initial),!1!==s||Tr(u)?"boolean"!=typeof s&&(a=s):a=u;var v=e.useRef(!1),m=c||Vr(u)||Vr(f)||Vr(l)||Tr(u),y=Vr(a)?a:t.initial,g=Vr(u)?u:t.animate,x=o?y:null,b=m&&Vr(g)?g:null,E=e.useMemo((function(){return{controls:m?n:t.controls,initial:y,animate:g,visualElement:r,hasMounted:v,isReducedMotion:t.isReducedMotion,presenceId:h}}),[x,b,t.isReducedMotion,u,d,h]);return E.static=o,function(t,n){void 0===n&&(n=!1);var r=e.useRef(!0);(!n||n&&r.current)&&t(),r.current=!1}((function(){var e=a||t.initial;e&&n.apply(e)}),!o),e.useEffect((function(){v.current=!0}),[]),E},Lr=function(t){var e=t.animate,n=t.variants,r=t.inherit;return(void 0===r||r)&&!!n&&(!e||e instanceof Sr)},kr=function(t){return t instanceof te};function Or(t,e,n,r){for(var o in void 0===r&&(r=!1),r&&(t.reactStyle={}),n){var i=n[o],a=!1;if(kr(i))Br.has(o)||(t.addValue(o,i),a=!0);else if(Ee(o)||Ce(o)){if(t.hasValue(o)){if(i!==e[o]){t.getValue(o).set(i)}}else t.addValue(o,ee(i));a=!0}else r&&(t.reactStyle[o]=i);a&&(e[o]=i)}}var Br=new Set([]),Rr=function(){return{}},Dr=function(t){return xn(t)?t[t.length-1]||0:t},Fr=function(){function t(t,e){var n=this,r=e.makeTargetAnimatable;this.props={},this.variants={},this.baseTarget={},this.overrides=[],this.resolvedOverrides=[],this.activeOverrides=new Set,this.isAnimating=new Set,this.hasValue=function(t){return!n.visualElement.hasValue(t)},this.visualElement=t,this.makeTargetAnimatable=r,this.visualElement.forEachValue((function(t,e){return n.baseTarget[e]=t.get()}))}return t.prototype.setProps=function(t){this.props=t},t.prototype.setVariants=function(t){t&&(this.variants=t)},t.prototype.setDefaultTransition=function(t){t&&(this.defaultTransition=t)},t.prototype.setValues=function(t,e){var n=void 0===e?{}:e,r=n.isActive,o=void 0===r?new Set:r,a=n.priority,s=this.resolveVariant(t),u=s.target,c=s.transitionEnd;for(var f in u=this.transformValues(i(i({},u),c))){if(o.has(f))return;if(o.add(f),u){var l=Dr(u[f]);if(this.visualElement.hasValue(f)){var d=this.visualElement.getValue(f);d&&d.set(l)}else this.visualElement.addValue(f,ee(l));a||(this.baseTarget[f]=l)}}},t.prototype.transformValues=function(t){var e=this.props.transformValues;return e?e(t):t},t.prototype.checkForNewValues=function(t){var e=Object.keys(t).filter(this.hasValue),n=e.length;if(n)for(var r=0;r<n;r++){var o=e[r],i=t[o],a=null;if(Array.isArray(i)&&(a=i[0]),null===a){var s=this.visualElement.readNativeValue(o);a=void 0!==s?s:t[o]}"string"==typeof a&&/^\-?\d*\.?\d+$/.test(a)?a=parseFloat(a):!he(a)&&Q.test(i)&&(a=Q.getAnimatableNone(i)),this.visualElement.addValue(o,ee(a)),this.baseTarget[o]=a}},t.prototype.resolveVariant=function(t){if(!t)return{target:void 0,transition:void 0,transitionEnd:void 0};var e,n;"function"==typeof t&&(t=t(this.props.custom,(e=this.visualElement,n={},e.forEachValue((function(t,e){return n[e]=t.get()})),n),function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.getVelocity()})),e}(this.visualElement)));var r=t.transition;return{transition:void 0===r?this.defaultTransition:r,transitionEnd:t.transitionEnd,target:a(t,["transition","transitionEnd"])}},t.prototype.getHighestPriority=function(){return this.activeOverrides.size?Math.max.apply(Math,Array.from(this.activeOverrides)):0},t.prototype.setOverride=function(t,e){this.overrides[e]=t,this.children&&this.children.forEach((function(n){return n.setOverride(t,e)}))},t.prototype.startOverride=function(t){var e=this.overrides[t];if(e)return this.start(e,{priority:t})},t.prototype.clearOverride=function(t){var e=this;if(this.children&&this.children.forEach((function(e){return e.clearOverride(t)})),this.overrides[t]){this.activeOverrides.delete(t);var n=this.getHighestPriority();if(this.resetIsAnimating(),n)this.overrides[n]&&this.startOverride(n);var r=this.resolvedOverrides[t];if(r){var o={};for(var i in this.baseTarget)void 0!==r[i]&&(o[i]=this.baseTarget[i]);this.onStart(),this.animate(o).then((function(){return e.onComplete()}))}}},t.prototype.apply=function(t){return Array.isArray(t)?this.applyVariantLabels(t):"string"==typeof t?this.applyVariantLabels([t]):void this.setValues(t)},t.prototype.applyVariantLabels=function(t){var e=this,n=new Set;s(t).reverse().forEach((function(r){var o=e.resolveVariant(e.variants[r]),i=o.target,a=o.transitionEnd;a&&e.setValues(a,{isActive:n}),i&&e.setValues(i,{isActive:n}),e.children&&e.children.size&&e.children.forEach((function(e){return e.applyVariantLabels(t)}))}))},t.prototype.start=function(t,e){var n,r,o=this;return void 0===e&&(e={}),e.priority&&this.activeOverrides.add(e.priority),this.resetIsAnimating(e.priority),r=t,n=Array.isArray(r)?this.animateVariantLabels(t,e):"string"==typeof t?this.animateVariant(t,e):this.animate(t,e),this.onStart(),n.then((function(){return o.onComplete()}))},t.prototype.animate=function(t,e){var n=this,r=void 0===e?{}:e,o=r.delay,a=void 0===o?0:o,s=r.priority,u=void 0===s?0:s,c=r.transitionOverride,f=this.resolveVariant(t),l=f.target,d=f.transition,p=f.transitionEnd;if(c&&(d=c),!l)return Promise.resolve();l=this.transformValues(l),p&&(p=this.transformValues(p)),this.checkForNewValues(l);var h=this.transformValues(function(t,e,n){var r,o,i={};for(var a in t)i[a]=null!==(r=Ir(a,e))&&void 0!==r?r:null===(o=n.getValue(a))||void 0===o?void 0:o.get();return i}(l,d,this.visualElement));if(this.makeTargetAnimatable){var v=this.makeTargetAnimatable(this.visualElement,l,h,p);l=v.target,p=v.transitionEnd}u&&(this.resolvedOverrides[u]=l),this.checkForNewValues(l);var m=[];for(var y in l){var g=this.visualElement.getValue(y);if(g&&l&&void 0!==l[y]){var x=l[y];u||(this.baseTarget[y]=Dr(x)),this.isAnimating.has(y)||(this.isAnimating.add(y),m.push(Rn(y,g,x,i({delay:a},d))))}}var b=Promise.all(m);return p?b.then((function(){n.setValues(p,{priority:u})})):b},t.prototype.animateVariantLabels=function(t,e){var n=this,r=s(t).reverse().map((function(t){return n.animateVariant(t,e)}));return Promise.all(r)},t.prototype.animateVariant=function(t,e){var n=this,r=!1,o=0,i=0,a=1,s=e&&e.priority||0,u=this.variants[t],c=u?function(){return n.animate(u,e)}:function(){return Promise.resolve()},f=this.children?function(){return n.animateChildren(t,o,i,a,s)}:function(){return Promise.resolve()};if(u&&this.children){var l=this.resolveVariant(u).transition;l&&(r=l.when||r,o=l.delayChildren||o,i=l.staggerChildren||i,a=l.staggerDirection||a)}if(r){var d="beforeChildren"===r?[c,f]:[f,c],p=d[1];return(0,d[0])().then(p)}return Promise.all([c(),f()])},t.prototype.animateChildren=function(t,e,n,r,o){if(void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=1),void 0===o&&(o=0),!this.children)return Promise.resolve();var i=[],a=(this.children.size-1)*n,s=1===r?function(t){return t*n}:function(t){return a-t*n};return Array.from(this.children).forEach((function(n,r){var a=n.animateVariant(t,{priority:o,delay:e+s(r)});i.push(a)})),Promise.all(i)},t.prototype.onStart=function(){var t=this.props.onAnimationStart;t&&t()},t.prototype.onComplete=function(){var t=this.props.onAnimationComplete;t&&t()},t.prototype.checkOverrideIsAnimating=function(t){for(var e=this.overrides.length,n=t+1;n<e;n++){var r=this.resolvedOverrides[n];if(r)for(var o in r)this.isAnimating.add(o)}},t.prototype.resetIsAnimating=function(t){void 0===t&&(t=0),this.isAnimating.clear(),t<this.getHighestPriority()&&this.checkOverrideIsAnimating(t),this.children&&this.children.forEach((function(e){return e.resetIsAnimating(t)}))},t.prototype.stop=function(){this.visualElement.forEachValue((function(t){return t.stop()}))},t.prototype.addChild=function(t){this.children||(this.children=new Set),this.children.add(t),this.overrides.forEach((function(e,n){e&&t.setOverride(e,n)}))},t.prototype.removeChild=function(t){this.children&&this.children.delete(t)},t.prototype.resetChildren=function(){this.children&&this.children.clear()},t}();function Ir(t,e){if(e)return(e[t]||e.default||e).from}function Ur(t,n,r){var o=Lr(n),i=n.variants,s=n.transition,u=e.useContext(Ar).controls,c=e.useContext(Kn),f=Un((function(){return new Fr(t,r)}));return c&&!c.isPresent||(f.resetChildren(),f.setProps(n),f.setVariants(i),f.setDefaultTransition(s)),e.useEffect((function(){o&&u&&u.addChild(f)})),e.useEffect((function(){return function(){n.onAnimationComplete;var t=a(n,["onAnimationComplete"]);f.setProps(t),u&&u.removeChild(f)}}),[]),f}var jr,Xr,Yr=e.createContext({transformPagePoint:function(t){return t},features:[]});!function(t){t[t.Entering=0]="Entering",t[t.Present=1]="Present",t[t.Exiting=2]="Exiting"}(jr||(jr={})),function(t){t[t.Hide=0]="Hide",t[t.Show=1]="Show"}(Xr||(Xr={}));var Hr={measureLayout:function(t){return t.measureLayout()},layoutReady:function(t){return t.layoutReady()}},zr=function(t,e){return t.depth-e.depth};function Wr(){var t=new Set;return{add:function(e){return t.add(e)},flush:function(e){var n=void 0===e?Hr:e,r=n.measureLayout,o=n.layoutReady,i=Array.from(t).sort(zr);i.forEach((function(t){return t.resetTransform()})),i.forEach(r),i.forEach(o),i.forEach((function(t){t.isPresent&&(t.presence=jr.Present)})),t.clear()}}}function Nr(t){return!!t.forceUpdate}var Gr=e.createContext(Wr());function _r(t){return e.useEffect((function(){return function(){return t()}}),[])}function Zr(t,n){var r=n.defaultFeatures,o=n.useVisualElement,a=n.render,u=n.animationControlsConfig;return e.forwardRef((function(n,c){var f=e.useContext(Ar),l=Lr(n),d=f.static||n.static||!1,p=o(t,n,f.visualElement,d,c);!function(t,e){var n=Un(Rr);for(var r in n){var o=Ee(r)||Ce(r),i=e[r],a=e.style&&e.style[r],s=i&&kr(e[r]),u=a&&kr(e.style[r]);(o&&!i&&!a||!o&&!s&&!u)&&(t.removeValue(r),delete n[r])}Or(t,n,e),e.style&&Or(t,n,e.style,!0),e.transformValues&&(t.reactStyle=e.transformValues(t.reactStyle))}(p,n);var h=Ur(p,n,u),v=Mr(f,h,p,d,n),m=function(t,n,r,o,a,u,c,f){var l=e.useContext(Yr);if(n||"undefined"==typeof window)return null;for(var d=s(t,l.features),p=d.length,h=[],v=0;v<p;v++){var m=d[v],y=m.shouldRender,g=m.key,x=m.getComponent;if(y(a,c)){var b=x(a);b&&h.push(e.createElement(b,i({key:g},a,{localContext:u,parentContext:c,visualElement:r,controls:o,inherit:f})))}}return h}(r,d,p,h,n,v,f,l),y=a(t,n,p);return function(t){var n=e.useContext(Gr);_r((function(){Nr(n)&&n.remove(t)}))}(p),e.createElement(e.Fragment,null,e.createElement(Ar.Provider,{value:v},y),m)}))}function qr(t){var e=null;return function(){return null===e&&(e=t,function(){e=null})}}var $r=qr("dragHorizontal"),Kr=qr("dragVertical");function Jr(t){var e=!1;if("y"===t)e=Kr();else if("x"===t)e=$r();else{var n=$r(),r=Kr();n&&r?e=function(){n(),r()}:(n&&n(),r&&r())}return e}var Qr=!1;"undefined"!=typeof window&&document.addEventListener("touchmove",(function(t){Qr&&t.preventDefault()}),{passive:!1});var to=function(){return Qr=!1};function eo(t,e,n,r){if(n)return t.addEventListener(e,n,r),function(){return t.removeEventListener(e,n,r)}}function no(t,n,r,o){e.useEffect((function(){var e=t.current;if(r&&e)return eo(e,n,r,o)}),[t,n,r,o])}function ro(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function oo(t){return!!t.touches}var io={pageX:0,pageY:0};function ao(t,e){void 0===e&&(e="page");var n=t.touches[0]||t.changedTouches[0]||io;return{x:n[e+"X"],y:n[e+"Y"]}}function so(t,e){return void 0===e&&(e="page"),{x:t[e+"X"],y:t[e+"Y"]}}function uo(t,e){return void 0===e&&(e="page"),{point:oo(t)?ao(t,e):so(t,e)}}function co(t){return uo(t,"client")}var fo,lo=function(t,e){if(void 0===e&&(e=!1),t){var n=function(e){return t(e,uo(e))};return e?function(t){if(t)return function(e){var n=e instanceof MouseEvent;(!n||n&&0===e.button)&&t(e)}}(n):n}},po="undefined"!=typeof window,ho={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},vo={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function mo(t){return po&&null===window.onpointerdown?t:po&&null===window.ontouchstart?vo[t]:po&&null===window.onmousedown?ho[t]:t}function yo(t,e,n,r){return eo(t,mo(e),lo(n,"pointerdown"===e),r)}function go(t,e,n,r){return no(t,mo(e),lo(n,"pointerdown"===e),r)}!function(t){t.subtract=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},t.relativeTo=function(t){var e;return function(n){var r=n.x,o=n.y,i=void 0!==e?e:e="string"==typeof t?document.getElementById(t):t;if(i){var a=i.getBoundingClientRect();return{x:r-a.left-window.scrollX,y:o-a.top-window.scrollY}}}}}(fo||(fo={}));var xo=function(){function t(t,e,n){var r=this,o=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(r.lastMoveEvent&&r.lastMoveEventInfo){var t=Eo(r.lastMoveEventInfo,r.history),e=null!==r.startEvent,n=Rt(t.offset,{x:0,y:0})>=3;if(e||n){var o=t.point,a=A().timestamp;r.history.push(i(i({},o),{timestamp:a}));var s=r.handlers,u=s.onStart,c=s.onMove;e||(u&&u(r.lastMoveEvent,t),r.startEvent=r.lastMoveEvent),c&&c(r.lastMoveEvent,t)}}},!(oo(t)&&t.touches.length>1)){this.handlers=e,this.transformPagePoint=o;var a=bo(uo(t),this.transformPagePoint),s=a.point,u=A().timestamp;this.history=[i(i({},s),{timestamp:u})];var c=e.onSessionStart;c&&c(t,Eo(a,this.history));var f=yo(window,"pointermove",(function(t,e){return r.handlePointerMove(t,e)})),l=yo(window,"pointerup",(function(t,e){return r.handlePointerUp(t,e)}));this.removeListeners=function(){f&&f(),l&&l()}}}return t.prototype.handlePointerMove=function(t,e){this.lastMoveEvent=t,this.lastMoveEventInfo=bo(e,this.transformPagePoint),ro(t)&&0===t.buttons?this.handlePointerUp(t,e):E.update(this.updatePoint,!0)},t.prototype.handlePointerUp=function(t,e){this.end();var n=this.handlers.onEnd;if(n){var r=Eo(bo(e,this.transformPagePoint),this.history);n&&n(t,r)}},t.prototype.updateHandlers=function(t){this.handlers=t},t.prototype.end=function(){this.removeListeners&&this.removeListeners(),w.update(this.updatePoint),to()},t}();function bo(t,e){return e?{point:e(t.point)}:t}function Eo(t,e){var n=t.point;return{point:n,delta:fo.subtract(n,Co(e)),offset:fo.subtract(n,wo(e)),velocity:Po(e,.1)}}function wo(t){return t[0]}function Co(t){return t[t.length-1]}function Po(t,e){if(t.length<2)return{x:0,y:0};for(var n=t.length-1,r=null,o=Co(t);n>=0&&(r=t[n],!(o.timestamp-r.timestamp>Mn(e)));)n--;if(!r)return{x:0,y:0};var i=(o.timestamp-r.timestamp)/1e3;if(0===i)return{x:0,y:0};var a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function So(t,e,n,r,o){var i=t-e*n;return r?function(t,e,n){var r=e.min,o=e.max;return void 0!==r&&t<r?t=n?Ft(r,t,n):Math.max(t,r):void 0!==o&&t>o&&(t=n?Ft(o,t,n):Math.min(t,o)),t}(i,r,o):i}function Ao(t,e,n){var r={},o=t.max-t.min;return void 0!==e&&(r.min=t.min+e),void 0!==n&&(r.max=Math.max(t.min+n-o,t.min)),r}function Vo(t,e){var n,r=e.min-t.min,o=e.max-t.max;return e.max-e.min<t.max-t.min&&(r=(n=[o,r])[0],o=n[1]),{min:t.min+r,max:t.min+o}}var To,Mo=new WeakMap,Lo=function(){function t(t){var e=t.visualElement;this.isDragging=!1,this.currentDirection=null,this.constraints=!1,this.props={},this.cursorProgress={x:.5,y:.5},this.openGlobalLock=null,this.panSession=null,this.visualElement=e,this.visualElement.enableLayoutProjection(),Mo.set(e,this)}return t.prototype.start=function(t,e){var n=this,r=void 0===e?{}:e,o=r.snapToCursor,i=void 0!==o&&o,a=r.cursorProgress;i&&this.snapToCursor(t);var s=this.props.transformPagePoint;this.panSession=new xo(t,{onSessionStart:function(){Qr=!0,n.stopMotion()},onStart:function(t,e){var r,o,i=n.props,s=i.drag,u=i.dragPropagation;if(!s||u||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Jr(s),n.openGlobalLock)){n.prepareBoundingBox(),n.visualElement.lockTargetBox(),n.resolveDragConstraints();var c=co(t).point;Ge((function(t){var e=n.visualElement.targetBox[t],r=e.min,o=e.max;n.cursorProgress[t]=a?a[t]:Dt(r,o,c[t])})),n.isDragging=!0,n.currentDirection=null,null===(o=(r=n.props).onDragStart)||void 0===o||o.call(r,t,e)}},onMove:function(t,e){var r,o,i,a,s=n.props,u=s.dragPropagation,c=s.dragDirectionLock;if(u||n.openGlobalLock){var f=e.offset;if(c&&null===n.currentDirection)return n.currentDirection=function(t,e){void 0===e&&(e=10);var n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(f),void(null!==n.currentDirection&&(null===(o=(r=n.props).onDirectionLock)||void 0===o||o.call(r,n.currentDirection)));n.updateAxis("x",t),n.updateAxis("y",t),null===(a=(i=n.props).onDrag)||void 0===a||a.call(i,t,e),To=t}},onEnd:function(t,e){return n.stop(t,e)}},{transformPagePoint:s})},t.prototype.prepareBoundingBox=function(){var t=this.visualElement.getInstance(),e=t.style.transform;this.visualElement.resetTransform(),this.visualElement.measureLayout(),t.style.transform=e,this.visualElement.refreshTargetBox()},t.prototype.resolveDragConstraints=function(){var t=this.props.dragConstraints;this.constraints=!!t&&(c(t)?this.resolveRefConstraints(this.visualElement.box,t):function(t,e){var n=e.top,r=e.left,o=e.bottom,i=e.right;return{x:Ao(t.x,r,i),y:Ao(t.y,n,o)}}(this.visualElement.box,t))},t.prototype.resolveRefConstraints=function(t,e){var n=this.props,r=n.onMeasureDragConstraints,o=n.transformPagePoint,i=e.current;this.constraintsBox=Dn(i,o);var a=function(t,e){return{x:Vo(t.x,e.x),y:Vo(t.y,e.y)}}(t,this.constraintsBox);if(r){var s=r(function(t){var e=t.x,n=t.y;return{top:n.min,bottom:n.max,left:e.min,right:e.max}}(a));s&&(a=oe(s))}return a},t.prototype.cancelDrag=function(){to(),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null)},t.prototype.stop=function(t,e){var n;this.visualElement.unlockTargetBox(),null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var r=this.isDragging;if(this.cancelDrag(),r){var o=this.props,i=o.dragMomentum,a=o.dragElastic,s=o.onDragEnd;if(i||a){var u=e.velocity;this.animateDragEnd(u)}null==s||s(t,e)}},t.prototype.snapToCursor=function(t){this.prepareBoundingBox(),this.cursorProgress.x=.5,this.cursorProgress.y=.5,this.updateAxis("x",t),this.updateAxis("y",t)},t.prototype.updateAxis=function(t,e){var n,r=this.props,o=r.drag,i=r.dragElastic;if(ko(t,o,this.currentDirection)){var a=this.visualElement.box[t],s=a.max-a.min,u=this.cursorProgress[t],c=So(co(e).point[t],s,u,null===(n=this.constraints)||void 0===n?void 0:n[t],i);this.visualElement.setAxisTarget(t,c,c+s)}},t.prototype.updateProps=function(t){var e=t.drag,n=void 0!==e&&e,r=t.dragDirectionLock,o=void 0!==r&&r,s=t.dragPropagation,u=void 0!==s&&s,c=t.dragConstraints,f=void 0!==c&&c,l=t.dragElastic,d=void 0===l?.35:l,p=t.dragMomentum,h=void 0===p||p,v=a(t,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=i({drag:n,dragDirectionLock:o,dragPropagation:u,dragConstraints:f,dragElastic:d,dragMomentum:h},v)},t.prototype.animateDragEnd=function(t){var e=this,n=this.props,r=n.drag,o=n.dragMomentum,a=n.dragElastic,s=n.dragTransition,u=Ge((function(n){if(ko(n,r,e.currentDirection)){var u=e.constraints?e.constraints[n]:{},c=a?200:1e6,f=a?40:1e7,l=i(i({type:"inertia",velocity:o?t[n]:0,bounceStiffness:c,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10},s),u);return e.visualElement.startLayoutAxisAnimation(n,l)}}));return Promise.all(u).then((function(){var t,n;null===(n=(t=e.props).onDragTransitionEnd)||void 0===n||n.call(t)}))},t.prototype.stopMotion=function(){this.visualElement.stopLayoutAnimation()},t.prototype.scalePoint=function(){var t=this,e=this.props,n=e.drag,r=e.dragConstraints;if(c(r)&&this.constraintsBox){this.stopMotion();var o={x:0,y:0};Ge((function(e){o[e]=ze(t.visualElement.targetBox[e],t.constraintsBox[e])})),this.prepareBoundingBox(),this.resolveDragConstraints(),Ge((function(e){if(ko(e,n,null)){var r=function(t,e,n){var r=t.max-t.min,o=Ft(e.min,e.max-r,n);return{min:o,max:o+r}}(t.visualElement.targetBox[e],t.constraintsBox[e],o[e]),i=r.min,a=r.max;t.visualElement.setAxisTarget(e,i,a)}}))}},t.prototype.mount=function(t){var e=this,n=yo(t.getInstance(),"pointerdown",(function(t){var n=e.props,r=n.drag,o=n.dragListener;r&&(void 0===o||o)&&e.start(t)})),r=eo(window,"resize",(function(){e.scalePoint()})),o=t.onLayoutUpdate((function(){e.isDragging&&e.resolveDragConstraints()})),i=t.prevSnapshot;return(null==i?void 0:i.isDragging)&&this.start(To,{cursorProgress:i.cursorProgress}),function(){null==n||n(),null==r||r(),null==o||o(),e.cancelDrag()}},t}();function ko(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}var Oo=function(t){return function(e){return t(e),null}},Bo=Oo((function(t){var n=t.visualElement;return function(t,n){var r=t.dragControls,o=e.useContext(Yr).transformPagePoint,a=Un((function(){return new Lo({visualElement:n})}));a.updateProps(i(i({},t),{transformPagePoint:o})),e.useEffect((function(){return r&&r.subscribe(a)}),[a]),e.useEffect((function(){return a.mount(n)}),[])}(a(t,["visualElement"]),n)})),Ro={key:"drag",shouldRender:function(t){return!!t.drag},getComponent:function(){return Bo}};function Do(t,n){var r=t.onPan,o=t.onPanStart,i=t.onPanEnd,a=t.onPanSessionStart,s=r||o||i||a,u=e.useRef(null),c=e.useContext(Yr).transformPagePoint,f={onSessionStart:a,onStart:o,onMove:r,onEnd:function(t,e){u.current=null,i&&i(t,e)}};e.useEffect((function(){null!==u.current&&u.current.updateHandlers(f)})),go(n,"pointerdown",s&&function(t){u.current=new xo(t,f,{transformPagePoint:c})}),_r((function(){return u.current&&u.current.end()}))}var Fo=function(t,e){return!!e&&(t===e||Fo(t,e.parentElement))},Io=["whileHover","whileTap","whileDrag"],Uo=function(t){return Io.indexOf(t)+1},jo=Uo("whileTap");function Xo(t,n){var r=t.onTap,o=t.onTapStart,i=t.onTapCancel,a=t.whileTap,s=t.controls,u=r||o||i||a,c=e.useRef(!1),f=e.useRef(null);function l(){f.current&&f.current(),f.current=null}a&&s&&s.setOverride(a,jo);var d=e.useRef(null);d.current=function(t,e){var o=n.current;if(l(),c.current&&o){c.current=!1,s&&a&&s.clearOverride(jo);var u=Jr(!0);u&&(u(),Fo(o,t.target)?r&&r(t,e):i&&i(t,e))}},go(n,"pointerdown",u?function(t,e){l(),f.current=yo(window,"pointerup",(function(t,e){return d.current(t,e)})),n.current&&!c.current&&(c.current=!0,o&&o(t,e),s&&a&&s.startOverride(jo))}:void 0),_r(l)}var Yo=Uo("whileHover"),Ho=function(t){return function(e,n){ro(e)&&t(e,n)}};function zo(t,e){Do(t,e),Xo(t,e),function(t,e){var n=t.whileHover,r=t.onHoverStart,o=t.onHoverEnd,i=t.controls;n&&i&&i.setOverride(n,Yo),go(e,"pointerenter",Ho((function(t,e){r&&r(t,e),n&&i&&i.startOverride(Yo)}))),go(e,"pointerleave",Ho((function(t,e){o&&o(t,e),n&&i&&i.clearOverride(Yo)})))}(t,e)}var Wo,No=["onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","whileTap","whileHover","onHoverStart","onHoverEnd"],Go=Oo((function(t){var e=t.visualElement;zo(a(t,["visualElement"]),e)})),_o={key:"gestures",shouldRender:function(t){return No.some((function(e){return t.hasOwnProperty(e)}))},getComponent:function(){return Go}},Zo=Oo((function(t){var n=t.animate,r=t.controls,o=t.exit,a=Jn(),s=a[0],u=a[1],c=e.useContext(Kn),f=e.useRef(!1),l=void 0!==(null==c?void 0:c.custom)?c.custom:t.custom;e.useEffect((function(){s?!f.current||!n||"boolean"==typeof n||n instanceof Sr||r.start(n):(!f.current&&o&&(r.setProps(i(i({},t),{custom:l})),r.start(o).then(u)),f.current=!0),s&&(f.current=!1)}),[n,r,l,o,s,u,t])})),qo={key:"exit",shouldRender:function(t){return!!t.exit&&!Lr(t)},getComponent:function(){return Zo}};!function(t){t.Target="Target",t.VariantLabel="VariantLabel",t.AnimationSubscription="AnimationSubscription"}(Wo||(Wo={}));function $o(t,e){void 0===e&&(e=!1);t.transition;var n=t.transitionEnd,r=a(t,["transition","transitionEnd"]);return e?i(i({},r),n):r}var Ko,Jo,Qo=function(t){var e,n=t instanceof te?t.get():t;return Array.from(new Set((e=n)?Array.isArray(e)?e:[e]:[]))};var ti=((Ko={})[Wo.Target]=Oo((function(t){return function(t,n,r,o){var a=e.useRef(!0),s=e.useRef(null);s.current||(s.current=$o(t,!0)),e.useEffect((function(){var e,u,c={},f=$o(t),l=$o(t,!0);for(var d in f){var p=a.current&&(!r.hasValue(d)||r.getValue(d).get()!==l[d]),h=null!==l[d],v=(e=s.current[d],void 0!==(u=l[d])&&(Array.isArray(e)&&Array.isArray(u)?!function(t,e){if(null===e)return!1;var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}(u,e):e!==u));h&&(v||p)&&(c[d]=f[d])}a.current=!1,s.current=i(i({},s.current),l),Object.keys(c).length&&n.start(i(i({},c),{transition:t.transition||o,transitionEnd:t.transitionEnd}))}),[t])}(t.animate,t.controls,t.visualElement,t.transition)})),Ko[Wo.VariantLabel]=Oo((function(t){var n=t.animate,r=t.inherit,o=void 0===r||r,i=t.controls;return function(t,n,r,o){var i=Qo(n),a=e.useContext(Ar),s=a.hasMounted&&a.hasMounted.current,u=e.useRef(!1);e.useEffect((function(){var e,n,c=!1;r?(c=!!s,i=Qo(a.animate)):c=u.current||(e=Qo(t),n=i,e.join(",")!==n.join(",")),c&&o.start(i),u.current=!0}),[i.join(",")])}(t.initial,n,o,i)})),Ko[Wo.AnimationSubscription]=Oo((function(t){return function(t,n){var r=e.useMemo((function(){return t.subscribe(n)}),[t]);e.useEffect((function(){return function(){r&&r()}}),[r])}(t.animate,t.controls)})),Ko),ei=function(t){return t.animate instanceof Sr},ni=["initial","animate","whileTap","whileHover"],ri=((Jo={})[Wo.Target]=function(t){return!(void 0===t.animate||(e=t.animate,Array.isArray(e)||"string"==typeof e)||ei(t));var e},Jo[Wo.VariantLabel]=function(t){return void 0!==t.variants||ni.some((function(e){return"string"==typeof t[e]}))},Jo[Wo.AnimationSubscription]=ei,Jo),oi={key:"animation",shouldRender:function(){return!0},getComponent:function(t){var e=void 0;for(var n in Wo)ri[n](t)&&(e=n);return e?ti[e]:void 0}};var ii=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.frameTarget={x:{min:0,max:0},y:{min:0,max:0}},e.stopAxisAnimation={x:void 0,y:void 0},e.animate=function(t,n,r){void 0===r&&(r={});var o=r.originBox,i=r.targetBox,s=r.visibilityAction,u=a(r,["originBox","targetBox","visibilityAction"]),c=e.props,f=c.visualElement,l=c.layout,d=si(n=o||n,t=i||t),p=Ge((function(r){if("position"===l){var o=t[r].max-t[r].min;n[r].max=n[r].min+o}if(!f.isTargetBoxLocked)return void 0===s?d?e.animateAxis(r,t[r],n[r],u):f.setAxisTarget(r,t[r].min,t[r].max):void(s===Xr.Hide?f.hide():f.show())}));return f.render(),Promise.all(p).then((function(){var t,n;null===(n=(t=e.props).onLayoutAnimationComplete)||void 0===n||n.call(t),f.isPresent?f.presence=jr.Present:e.safeToRemove()}))},e}return o(e,t),e.prototype.componentDidMount=function(){var t=this.props.visualElement;t.enableLayoutProjection(),this.unsubLayoutReady=t.onLayoutUpdate(this.animate)},e.prototype.componentWillUnmount=function(){var t=this;this.unsubLayoutReady(),Ge((function(e){var n,r;return null===(r=(n=t.stopAxisAnimation)[e])||void 0===r?void 0:r.call(n)}))},e.prototype.animateAxis=function(t,e,n,r){var o,i,a=void 0===r?{}:r,s=a.transition,u=a.crossfadeOpacity;null===(i=(o=this.stopAxisAnimation)[t])||void 0===i||i.call(o);var c=this.props.visualElement,f=this.frameTarget[t],l=c.axisProgress[t];l.clearListeners(),l.set(0),l.set(0);var d=u&&this.createCrossfadeAnimation(u),p=function(){var r=l.get()/1e3;!function(t,e,n,r){t.min=Ft(e.min,n.min,r),t.max=Ft(e.max,n.max,r)}(f,n,e,r),c.setAxisTarget(t,f.min,f.max),null==d||d(r)};p();var h=Rn("x"===t?"layoutX":"layoutY",l,1e3,s||this.props.transition||ci),v=l.onChange(p);return this.stopAxisAnimation[t]=function(){l.stop(),v()},h},e.prototype.createCrossfadeAnimation=function(t){var e=this.props.visualElement.getValue("opacity",0);return function(n){e.set(li(Ft(0,1,n))),t.set(di(Ft(1,0,n)))}},e.prototype.safeToRemove=function(){var t,e;null===(e=(t=this.props).safeToRemove)||void 0===e||e.call(t)},e.prototype.render=function(){return null},e}(e.Component);function ai(t){var n=Jn()[1];return e.createElement(ii,i({},t,{safeToRemove:n}))}function si(t,e){return ui(t.x,e.x)||ui(t.y,e.y)}function ui(t,e){return t.min!==e.min||t.max!==e.max}var ci={duration:.45,ease:[.4,0,.1,1]};function fi(t,e,n){return function(r){return r<t?0:r>e?1:n(Dt(t,e,r))}}var li=fi(0,.5,dt),di=fi(.5,.95,st),pi={key:"animate-layout",shouldRender:function(t){return!!t.layout||!!t.layoutId},getComponent:function(){return ai}},hi=function(t){function e(e){var n=t.call(this,e)||this,r=e.syncLayout;return Nr(r)||(n.componentDidUpdate=function(){return r.flush()}),n}return o(e,t),e.prototype.componentDidMount=function(){var t=this.props,e=t.syncLayout,n=t.visualElement;Nr(e)&&e.register(n)},e.prototype.getSnapshotBeforeUpdate=function(){var t=this.props,e=t.syncLayout,n=t.visualElement;return Nr(e)?e.syncUpdate():(n.snapshotBoundingBox(),e.add(n)),null},e.prototype.componentDidUpdate=function(){},e.prototype.render=function(){return null},e}(n.Component);function vi(t){var r=e.useContext(Gr);return n.createElement(hi,i({},t,{syncLayout:r}))}var mi={key:"measure-layout",shouldRender:function(t){return!!t.drag||!!t.layout||!!t.layoutId},getComponent:function(){return vi}};function yi(t){var e={defaultFeatures:t,useVisualElement:rr,render:ur,animationControlsConfig:{makeTargetAnimatable:Pr}};var n=new Map;return new Proxy({custom:function(t){return Zr(t,e)}},{get:function(t,r){return"custom"===r?t.custom:(n.has(r)||n.set(r,Zr(r,e)),n.get(r))}})}var gi=yi([mi,oi,Ro,_o,qo,pi]),xi=yi([mi]);var bi=0;function Ei(){var t=bi;return bi++,t}var wi=function(t){var n=t.children,r=t.initial,o=t.isPresent,i=t.onExitComplete,a=t.custom,s=Un(Ci),u={id:Un(Ei),initial:r,isPresent:o,custom:a,onExitComplete:function(t){s.set(t,!0);var e=!0;s.forEach((function(t){t||(e=!1)})),e&&(null==i||i())},register:function(t){return s.set(t,!1),function(){return s.delete(t)}}};return e.useMemo((function(){s.forEach((function(t,e){return s.set(e,!1)}))}),[o]),e.createElement(Kn.Provider,{value:u},n)};function Ci(){return new Map}function Pi(t){return t.key||""}function Si(t,e){return e&&t!==e.lead?{visibilityAction:Xr.Hide}:e&&t.presence!==jr.Entering&&t===e.lead&&e.lead!==e.prevLead?{visibilityAction:Xr.Show}:(t.presence===jr.Entering?n=null==e?void 0:e.getFollowOrigin():t.presence===jr.Exiting&&(r=null==e?void 0:e.getFollowTarget()),{originBox:n,targetBox:r});var n,r}function Ai(t,e){var n,r,o,i={},a=e&&e.lead,s=null==a?void 0:a.presence;return e&&t===a?t.presence===jr.Entering?i.originBox=e.getFollowOrigin():t.presence===jr.Exiting&&(i.targetBox=e.getFollowTarget()):e&&t===e.follow&&(i.transition=e.getLeadTransition(),s===jr.Entering?i.targetBox=e.getLeadTarget():s===jr.Exiting&&(i.originBox=e.getLeadOrigin())),(null===(n=null==e?void 0:e.follow)||void 0===n?void 0:n.isPresenceRoot)||(null==a?void 0:a.isPresenceRoot)?(e&&t!==a?e&&t===e.follow?a&&s!==jr.Entering&&s===jr.Exiting&&(i.crossfadeOpacity=null===(o=null==e?void 0:e.lead)||void 0===o?void 0:o.getValue("opacity",1)):i.visibilityAction=Xr.Hide:t.presence===jr.Entering&&(i.crossfadeOpacity=null===(r=null==e?void 0:e.follow)||void 0===r?void 0:r.getValue("opacity",0)),i):i}var Vi=function(){function t(){this.order=[],this.hasChildren=!1}return t.prototype.add=function(t){var e,n=t.config.layoutOrder;if(void 0===n)this.order.push(t);else{var r=this.order.findIndex((function(t){return n<=(t.config.layoutOrder||0)}));-1===r&&(t.presence=this.hasChildren?jr.Entering:jr.Present,r=this.order.length),this.order.splice(r,0,t)}if(this.snapshot){t.prevSnapshot=this.snapshot,t.prevViewportBox=this.snapshot.boundingBox;var o=this.snapshot.latestMotionValues;for(var i in o)t.hasValue(i)?null===(e=t.getValue(i))||void 0===e||e.set(o[i]):t.addValue(i,ee(o[i]))}this.hasChildren=!0},t.prototype.remove=function(t){var e=this.order.findIndex((function(e){return t===e}));-1!==e&&this.order.splice(e,1)},t.prototype.updateLeadAndFollow=function(){this.prevLead=this.lead,this.prevFollow=this.follow;var t=function(t,e){for(var n=e[0],r=e[1],o=void 0,i=0,a=void 0,s=t.length,u=!1,c=s-1;c>=0;c--){var f=t[c];if(c===s-1&&(u=f.isPresent),u)o=f;else{var l=t[c-1];l&&l.isPresent&&(o=f)}if(o){i=c;break}}if(o||(o=t[0]),a=t[i-1],o)for(c=i-1;c>=0;c--){if((f=t[c]).isPresent){a=f;break}}return o!==n&&!u&&a===r&&t.find((function(t){return t===n}))&&(o=n),[o,a]}(this.order,[this.lead,this.follow]),e=t[0],n=t[1];this.lead=e,this.follow=n},t.prototype.updateSnapshot=function(){if(this.lead){var t={boundingBox:this.lead.prevViewportBox,latestMotionValues:{}};this.lead.forEachValue((function(e,n){var r=e.get();Ee(r)||(t.latestMotionValues[n]=r)}));var e=Mo.get(this.lead);e&&e.isDragging&&(t.isDragging=!0,t.cursorProgress=e.cursorProgress),this.snapshot=t}},t.prototype.isLeadPresent=function(){var t;return this.lead&&(null===(t=this.lead)||void 0===t?void 0:t.presence)!==jr.Exiting},t.prototype.shouldStackAnimate=function(){return!0},t.prototype.getFollowOrigin=function(){var t;return this.follow?this.follow.prevViewportBox:null===(t=this.snapshot)||void 0===t?void 0:t.boundingBox},t.prototype.getFollowTarget=function(){var t;return null===(t=this.follow)||void 0===t?void 0:t.box},t.prototype.getLeadOrigin=function(){var t;return null===(t=this.lead)||void 0===t?void 0:t.prevViewportBox},t.prototype.getLeadTarget=function(){var t;return null===(t=this.lead)||void 0===t?void 0:t.box},t.prototype.getLeadTransition=function(){var t;return null===(t=this.lead)||void 0===t?void 0:t.config.transition},t}(),Ti=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.children=new Set,e.stacks=new Map,e.hasMounted=!1,e.updateScheduled=!1,e.renderScheduled=!1,e.syncContext=i(i({},Wr()),{syncUpdate:function(t){return e.scheduleUpdate(t)},forceUpdate:function(){e.syncContext=i({},e.syncContext),e.scheduleUpdate(!0)},register:function(t){return e.addChild(t)},remove:function(t){return e.removeChild(t)}}),e}return o(n,t),n.prototype.componentDidMount=function(){this.hasMounted=!0,this.updateStacks()},n.prototype.componentDidUpdate=function(){this.startLayoutAnimation()},n.prototype.shouldComponentUpdate=function(){return this.renderScheduled=!0,!0},n.prototype.startLayoutAnimation=function(){var t=this;this.renderScheduled=this.updateScheduled=!1;var e=this.props.type;this.children.forEach((function(t){t.isPresent?t.presence!==jr.Entering&&(t.presence=t.presence===jr.Exiting?jr.Entering:jr.Present):t.presence=jr.Exiting})),this.updateStacks();var n="crossfade"===e?Ai:Si,r={measureLayout:function(t){return t.measureLayout()},layoutReady:function(e){var r=e.layoutId;e.layoutReady(n(e,t.getStack(r)))}};this.children.forEach((function(e){return t.syncContext.add(e)})),this.syncContext.flush(r),this.stacks.forEach((function(t){return t.snapshot=void 0}))},n.prototype.updateStacks=function(){this.stacks.forEach((function(t){return t.updateLeadAndFollow()}))},n.prototype.scheduleUpdate=function(t){void 0===t&&(t=!1),!t&&this.updateScheduled||(this.updateScheduled=!0,this.children.forEach((function(t){return t.snapshotBoundingBox()})),this.stacks.forEach((function(t){return t.updateSnapshot()})),!t&&this.renderScheduled||(this.renderScheduled=!0,this.forceUpdate()))},n.prototype.addChild=function(t){this.children.add(t),this.addToStack(t),t.presence=this.hasMounted?jr.Entering:jr.Present},n.prototype.removeChild=function(t){this.scheduleUpdate(),this.children.delete(t),this.removeFromStack(t)},n.prototype.addToStack=function(t){var e=this.getStack(t.layoutId);null==e||e.add(t)},n.prototype.removeFromStack=function(t){var e=this.getStack(t.layoutId);null==e||e.remove(t)},n.prototype.getStack=function(t){if(void 0!==t)return!this.stacks.has(t)&&this.stacks.set(t,new Vi),this.stacks.get(t)},n.prototype.render=function(){return e.createElement(Gr.Provider,{value:this.syncContext},this.props.children)},n}(e.Component);function Mi(t){return Un((function(){return ee(t)}))}var Li=function(t){return function(t){return"object"==typeof t&&t.mix}(t)?t.mix:void 0};function ki(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!Array.isArray(t[0]),r=n?0:-1,o=t[0+r],a=t[1+r],s=t[2+r],u=t[3+r],c=Kt(a,s,i({mixer:Li(s[0])},u));return n?c(o):c}var Oi=function(t){return"function"==typeof t};function Bi(t,n,r,o){var i=Oi(n)?[t]:[t,n.join(","),null==r?void 0:r.join(",")],a=e.useMemo((function(){return Oi(n)?n:ki(n,r,o)}),i),s=a(t.get()),u=Mi(s),c=e.useRef();return e.useMemo((function(){c.current&&c.current(),c.current=t.onChange((function(t){return u.set(a(t))})),u.set(s)}),[t,u,a]),_r((function(){return c.current&&c.current()})),u}var Ri=function(t){return t>.001?1/t:1e5};function Di(){return{scrollX:ee(0),scrollY:ee(0),scrollXProgress:ee(0),scrollYProgress:ee(0)}}function Fi(t,e,n){n.set(t&&e?t/e:0)}function Ii(t,e){var n=function(){var n=e(),r=n.xOffset,o=n.yOffset,i=n.xMaxOffset,a=n.yMaxOffset;t.scrollX.set(r),t.scrollY.set(o),Fi(r,i,t.scrollXProgress),Fi(o,a,t.scrollYProgress)};return n(),n}var Ui="undefined"!=typeof window?e.useLayoutEffect:e.useEffect;var ji=Di();function Xi(){return{xOffset:window.pageXOffset,yOffset:window.pageYOffset,xMaxOffset:document.body.clientWidth-window.innerWidth,yMaxOffset:document.body.clientHeight-window.innerHeight}}var Yi=!1;var Hi=ee(null);if("undefined"!=typeof window)if(window.matchMedia){var zi=window.matchMedia("(prefers-reduced-motion)"),Wi=function(){return Hi.set(zi.matches)};zi.addListener(Wi),Wi()}else Hi.set(!1);function Ni(t,e){return"boolean"==typeof e?e:Boolean(t)}var Gi=function(){function t(){this.componentControls=new Set}return t.prototype.subscribe=function(t){var e=this;return this.componentControls.add(t),function(){return e.componentControls.delete(t)}},t.prototype.start=function(t,e){this.componentControls.forEach((function(n){n.start(t.nativeEvent||t,e)}))},t}(),_i=function(){return new Gi};var Zi=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.initialState={},e}return o(e,t),e.prototype.updateLayoutDelta=function(){},e.prototype.build=function(){},e.prototype.clean=function(){},e.prototype.getBoundingBox=function(){return{x:{min:0,max:0},y:{min:0,max:0}}},e.prototype.readNativeValue=function(t){return this.initialState[t]||0},e.prototype.render=function(){this.build()},e}(ne);t.AnimateLayoutFeature=pi,t.AnimatePresence=function(t){var n=t.children,r=t.custom,o=t.initial,i=void 0===o||o,a=t.onExitComplete,u=t.exitBeforeEnter,c=function(){var t=e.useState(0),n=t[0],r=t[1];return e.useCallback((function(){return r(n+1)}),[n])}(),f=e.useContext(Gr);Nr(f)&&(c=f.forceUpdate);var l=e.useRef(!0),d=function(t){var n=[];return e.Children.forEach(t,(function(t){e.isValidElement(t)&&n.push(t)})),n}(n),p=e.useRef(d),h=e.useRef(new Map).current,v=e.useRef(new Set).current;if(function(t,e){t.forEach((function(t){var n=Pi(t);e.set(n,t)}))}(d,h),l.current)return l.current=!1,e.createElement(e.Fragment,null,d.map((function(t){return e.createElement(wi,{key:Pi(t),isPresent:!0,initial:!!i&&void 0},t)})));for(var m=s(d),y=p.current.map(Pi),g=d.map(Pi),x=y.length,b=0;b<x;b++){var E=y[b];-1===g.indexOf(E)?v.add(E):v.delete(E)}return u&&v.size&&(m=[]),v.forEach((function(t){if(-1===g.indexOf(t)){var n=h.get(t);if(n){var o=y.indexOf(t);m.splice(o,0,e.createElement(wi,{key:Pi(n),isPresent:!1,onExitComplete:function(){h.delete(t),v.delete(t);var e=p.current.findIndex((function(e){return e.key===t}));p.current.splice(e,1),v.size||(p.current=d,c(),a&&a())},custom:r},n))}}})),m=m.map((function(t){var n=t.key;return v.has(n)?t:e.createElement(wi,{key:Pi(t),isPresent:!0},t)})),p.current=m,e.createElement(e.Fragment,null,v.size?m:m.map((function(t){return e.cloneElement(t)})))},t.AnimateSharedLayout=Ti,t.AnimationControls=Sr,t.AnimationFeature=oi,t.DragControls=Gi,t.DragFeature=Ro,t.ExitFeature=qo,t.GesturesFeature=_o,t.MotionConfig=function(t){var n=t.children,r=t.features,o=void 0===r?[]:r,i=a(t,["children","features"]),u=s(e.useContext(Yr).features,o),c=e.useMemo((function(){return{features:u}}),[u.length]);for(var f in i)c[f]=i[f];return e.createElement(Yr.Provider,{value:c},n)},t.MotionConfigContext=Yr,t.MotionContext=Ar,t.MotionValue=te,t.PresenceContext=Kn,t.ReducedMotion=function(t){var n=t.children,r=t.enabled,o=e.useContext(Ar);return o=e.useMemo((function(){return i(i({},o),{isReducedMotion:r})}),[r]),e.createElement(Ar.Provider,{value:o},n)},t.VisualElementAnimationControls=Fr,t.addScaleCorrection=function(t){for(var e in t)Te[e]=t[e]},t.animationControls=function(){return new Sr},t.createMotionComponent=Zr,t.isValidMotionProp=ir,t.m=xi,t.motion=gi,t.motionValue=ee,t.resolveMotionValue=function(t){var e,n=t instanceof te?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n},t.transform=ki,t.useAnimatedState=function(t){var n=e.useState(t),r=n[0],o=n[1],a=Un((function(){return new Zi}));a.updateConfig({onUpdate:function(t){return o(i({},t))}}),a.initialState=t;var s=Ur(a,{},{});return e.useEffect((function(){return a.mount({}),function(){return a.unmount()}}),[]),[r,Un((function(){return function(t){return s.start(t)}}))]},t.useAnimation=function(){var t=Un((function(){return new Sr}));return e.useEffect((function(){return t.mount(),function(){return t.unmount()}}),[]),t},t.useCycle=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=e.useRef(0),o=e.useState(t[r.current]),i=o[0],a=o[1];return[i,function(e){r.current="number"!=typeof e?Qt(0,t.length,r.current+1):e,a(t[r.current])}]},t.useDomEvent=no,t.useDragControls=function(){return Un(_i)},t.useElementScroll=function(t){var e=Un(Di);return Ui((function(){var n=t.current;if(n){var r=Ii(e,function(t){return function(){return{xOffset:t.scrollLeft,yOffset:t.scrollTop,xMaxOffset:t.scrollWidth-t.offsetWidth,yMaxOffset:t.scrollHeight-t.offsetHeight}}}(n)),o=eo(n,"scroll",r,{passive:!0}),i=eo(n,"resize",r);return function(){o&&o(),i&&i()}}}),[]),e},t.useExternalRef=function(t){var n=t&&"function"!=typeof t?t:e.useRef(null);return t&&"function"==typeof t&&e.useEffect((function(){return t(n.current),function(){return t(null)}}),[]),n},t.useGestures=zo,t.useInvertedScale=function(t){var n=Mi(1),r=Mi(1),o=e.useContext(Ar).visualElement;return t?(n=t.scaleX||n,r=t.scaleY||r):o&&(n=o.getValue("scaleX",1),r=o.getValue("scaleY",1)),{scaleX:Bi(n,Ri),scaleY:Bi(r,Ri)}},t.useIsPresent=Qn,t.useMotionValue=Mi,t.usePanGesture=Do,t.usePresence=Jn,t.useReducedMotion=function(){var t=e.useContext(Ar).isReducedMotion,n=e.useState(Ni(Hi.get(),t)),r=n[0],o=n[1];return e.useEffect((function(){return Hi.onChange((function(e){o(Ni(e,t))}))}),[o,t]),r},t.useSpring=function(t,n){void 0===n&&(n={});var r=e.useRef(null),o=Mi(kr(t)?t.get():t);return e.useMemo((function(){return o.attach((function(t,e){return r.current&&r.current.stop(),r.current=sn(i({from:o.get(),to:t,velocity:o.getVelocity()},n)).start(e),o.get()}))}),Object.values(n)),function(t,n){e.useEffect((function(){return kr(t)?t.onChange(n):void 0}),[t])}(t,(function(t){return o.set(parseFloat(t))})),o},t.useTapGesture=Xo,t.useTransform=Bi,t.useViewportScroll=function(){return Ui((function(){!Yi&&function(){if(Yi=!0,"undefined"!=typeof window){var t=Ii(ji,Xi);eo(window,"scroll",t,{passive:!0}),eo(window,"resize",t)}}()}),[]),ji},Object.defineProperty(t,"__esModule",{value:!0})}));