@twilio-paste/animation-library
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.2.2](https://github.com/twilio-labs/paste/compare/@twilio-paste/animation-library@0.2.1...@twilio-paste/animation-library@0.2.2) (2020-10-13) | ||
**Note:** Version bump only for package @twilio-paste/animation-library | ||
## [0.2.1](https://github.com/twilio-labs/paste/compare/@twilio-paste/animation-library@0.2.0...@twilio-paste/animation-library@0.2.1) (2020-06-22) | ||
@@ -8,0 +16,0 @@ |
@@ -1,15 +0,1 @@ | ||
import{useLayoutEffect as t,useEffect as e,useState as n,useRef as r,forwardRef as s,createElement as i,createContext as o,useMemo as a,useContext as u,useImperativeHandle as c,Fragment as l}from"react";import{unstable_batchedUpdates as h}from"react-dom";function d(t,e){if(null==t)return{};var n,r,s={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(s[n]=t[n]);return s}var p="undefined"!=typeof window&&window.document&&window.document.createElement?t:e,f=function(t){return V(t)},m=function(t){void 0===t&&(t=f);var e=!0,n=!1,r=0,s=[],i=0,o=new Set,a=new Set,u=new Set,c=function(t){var e=s.indexOf(t);e<0&&(e=s.findIndex((function(e){return e.priority>t.priority})),s.splice(~e?e:s.length,0,t))},l=function(){if(!e)try{p(),t(l)}catch(t){console.error(t)}},h=function(){e&&(e=!1,0==r&&(r=A(),t(l)))},d=[];this.setTimeout=function(t,e){var n=A()+e,r=function(){var t=d.findIndex((function(t){return t.cancel==r}));t>=0&&d.splice(t,1)},s=g(d,(function(t){return t.time>n})),i={time:n,handler:t,cancel:r};return d.splice(s,0,i),h(),i};var p=this.advance=function(){var t=A();if(o.size&&(o.forEach(c),o.clear()),d.length&&O((function(){var e=g(d,(function(e){return e.time>t}));d.splice(0,e).forEach((function(t){return t.handler()}))})),t>r){var e=Math.min(64,t-r);r=t,O((function(){s.length&&(j(s),s=s.filter((function(t){return i=t.priority,t.idle||t.advance(e),!t.idle})),i=0),a.size&&(a.forEach((function(e){return e(t)})),a.clear()),u.size&&(n=!0,u.forEach((function(e){return e(t)})),u.clear(),n=!1)}))}};if(this.start=function(t){i>t.priority?o.add(t):(c(t),h())},this.onFrame=function(t){a.add(t),h()},this.onWrite=function(t){n?t(r):u.add(t)},"undefined"!=typeof process&&"production"!==process.env.NODE_ENV){var m=function(){e=!0,o.clear(),d.length=0};Object.defineProperties(this,{_animations:{get:function(){return s}},_dispose:{get:function(){return m}}})}};function g(t,e){var n=t.findIndex(e);return n<0?t.length:n}var y=function(){},v={arr:Array.isArray,obj:function(t){return!!t&&"Object"===t.constructor.name},fun:function(t){return"function"==typeof t},str:function(t){return"string"==typeof t},num:function(t){return"number"==typeof t},und:function(t){return void 0===t}};function _(t,e){if(v.arr(t)){if(!v.arr(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}return t===e}var b,w=function(t){return v.str(t)&&("#"==t[0]||/\d/.test(t)||!(!I||!I[t]))},k=function(t,e,n){v.fun(t.forEach)?t.forEach(e,n):Object.keys(t).forEach((function(r){return e.call(n,t[r],r)}))},P=function(t){return v.und(t)?[]:v.arr(t)?t:[t]};function x(t,e){if(t.size){var n=Array.from(t);t.clear(),k(n,e)}}var C,S=new m,A=function(){return performance.now()},I=null,E=!1,V="undefined"!=typeof window?window.requestAnimationFrame:function(){return-1},O=function(t){return t()},j=y,q=function(t){var e;return e=Object.assign({to:C,now:A,frameLoop:S,colorNames:I,skipAnimation:E,createStringInterpolator:b,requestAnimationFrame:V,batchedUpdates:O,willAdvance:j},function(t){var e={};for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}(t)),C=e.to,A=e.now,S=e.frameLoop,I=e.colorNames,E=e.skipAnimation,b=e.createStringInterpolator,V=e.requestAnimationFrame,O=e.batchedUpdates,j=e.willAdvance,e};var R=Object.freeze({__proto__:null,get createStringInterpolator(){return b},get frameLoop(){return S},get to(){return C},get now(){return A},get colorNames(){return I},get skipAnimation(){return E},get requestAnimationFrame(){return V},get batchedUpdates(){return O},get willAdvance(){return j},assign:q}),T=function(t){return e(t,[])},M=function(){var t=n(0)[1],e=r(!1);return T((function(){return function(){e.current=!0}})),function(){e.current||t({})}};function N(t){var n=r(void 0);return e((function(){n.current=t})),n.current}var F=function(t,e,n){if(v.fun(t))return t;if(v.arr(t))return F({range:t,output:e,extrapolate:n});if(v.str(t.output[0]))return b(t);var r=t,s=r.output,i=r.range||[0,1],o=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",u=r.easing||function(t){return t};return function(t){var e=function(t,e){for(var n=1;n<e.length-1&&!(e[n]>=t);++n);return n-1}(t,i);return function(t,e,n,r,s,i,o,a,u){var c=u?u(t):t;if(c<e){if("identity"===o)return c;"clamp"===o&&(c=e)}if(c>n){if("identity"===a)return c;"clamp"===a&&(c=n)}if(r===s)return r;if(e===n)return t<=e?r:s;e===-1/0?c=-c:n===1/0?c-=e:c=(c-e)/(n-e);c=i(c),r===-1/0?c=-c:s===1/0?c+=r:c=c*(s-r)+r;return c}(t,i[e],i[e+1],s[e],s[e+1],u,o,a,r.map)}};var D=Symbol.for("FluidValue:config");function z(t){var e=L(t);return e?e.get():t}function L(t){if(t)return t[D]}var Q=function(){!function(t,e){Object.defineProperty(t,D,{value:e,configurable:!0})}(this,this)};function U(){return(U=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}const G=Symbol.for("Animated:node"),W=t=>t&&t[G],$=(t,e)=>{return n=t,r=G,s=e,Object.defineProperty(n,r,{value:s,writable:!0,configurable:!0});var n,r,s},B=t=>t&&t[G]&&t[G].getPayload();class H{constructor(){this.payload=void 0,$(this,this)}getPayload(){return this.payload||[]}}class Y extends H{constructor(t){super(),this._value=t,this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,v.num(this._value)&&(this.lastPosition=this._value)}static create(t,e){return new Y(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return v.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value!==t&&(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,v.num(this._value)&&(this.elapsedTime=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}}class Z extends Y{constructor(t,e){super(0),this._value=void 0,this._string=null,this._toString=void 0,this._toString=F({output:[t,e]})}static create(t,e=t){if(v.str(t)&&v.str(e))return new Z(t,e);throw TypeError('Expected "from" and "to" to be strings')}getValue(){let t=this._string;return null==t?this._string=this._toString(this._value):t}setValue(t){if(v.num(t)){if(!super.setValue(t))return!1;this._string=null}else this._string=t,this._value=1;return!0}reset(t){t&&(this._toString=F({output:[this.getValue(),t]})),this._value=0,super.reset()}}const J={current:null};class K extends H{constructor(t=null){super(),this.source=void 0,this.setValue(t)}getValue(t){if(!this.source)return null;const e={};return k(this.source,(n,r)=>{if((s=n)&&s[G]===s)e[r]=n.getValue(t);else{const s=L(n);s?e[r]=s.get():t||(e[r]=n)}var s}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&k(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return k(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){L(t)&&J.current&&J.current.dependencies.add(t);const e=B(t);e&&k(e,t=>this.add(t))}}class X extends K{constructor(t,e){super(null),this.source=void 0,super.setValue(this._makeAnimated(t,e))}static create(t,e){return new X(t,e)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();t&&t.length==e.length?k(e,(e,n)=>e.setValue(t[n])):(this.source=this._makeAnimated(t),this.payload=this._makePayload(this.source))}_makeAnimated(t,e=t){return t?t.map((t,n)=>(w(t)?Z:Y).create(t,e[n])):[]}}class tt extends K{constructor(t){super(null),this.update=t,this.dirty=!1}setValue(t,e){if(t){if(e&&(J.current=e,t.style)){const{createAnimatedStyle:n}=e.host;t=U(U({},t),{},{style:n(t.style)})}super.setValue(t),J.current=null}}onParentChange({type:t}){this.dirty||"change"!==t||(this.dirty=!0,S.onFrame(()=>{this.dirty=!1,this.update()}))}}const et=(t,e)=>s((n,s)=>{const o=r(null),a=!v.fun(t)||t.prototype&&t.prototype.isReactComponent,u=M(),c=new tt(()=>{const t=o.current;a&&!t||!1===(!!t&&e.applyAnimatedValues(t,c.getValue(!0)))&&u()}),l=new Set;return c.setValue(n,{dependencies:l,host:e}),p(()=>(k(l,t=>t.addChild(c)),()=>k(l,t=>t.removeChild(c)))),i(t,U({},e.getComponentProps(c.getValue()),{ref:a&&(t=>{o.current=function(t,e){t&&(v.fun(t)?t(e):t.current=e);return e}(s,t)})}))});const nt=Symbol.for("AnimatedComponent"),rt=t=>v.str(t)?t:t&&v.str(t.displayName)?t.displayName:v.fun(t)&&t.name||null;function st(t,s){var i=n((function(){return{inputs:s,result:t()}}))[0],o=r(i),a=Boolean(s&&o.current.inputs&&function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}(s,o.current.inputs))?o.current:{inputs:s,result:t()};return e((function(){o.current=a}),[a]),a.result}function it(t,e){return st((function(){return t}),e)}var ot=!1;function at(){ot||(ot=!0,console.warn('react-spring: The "interpolate" function is deprecated in v10 (use "to" instead)'))} | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */var ut=function(){return(ut=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)},ct="[-+]?\\d*\\.?\\d+";function lt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ht=new RegExp("rgb"+lt(ct,ct,ct)),dt=new RegExp("rgba"+lt(ct,ct,ct,ct)),pt=new RegExp("hsl"+lt(ct,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),ft=new RegExp("hsla"+lt(ct,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",ct)),mt=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,gt=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,yt=/^#([0-9a-fA-F]{6})$/,vt=/^#([0-9a-fA-F]{8})$/;function _t(t,e,n){var r=(1-Math.abs(2*n-1))*e,s=n-r/2,i=function(t,e,n){return t<60?[e,n,0]:t<120?[n,e,0]:t<180?[0,e,n]:t<240?[0,n,e]:t<300?[n,0,e]:[e,0,n]}(t,r,r*(1-Math.abs(t/60%2-1))),o=i[0],a=i[1],u=i[2];return Math.round(255*(o+s))<<24|Math.round(255*(a+s))<<16|Math.round(255*(u+s))<<8}function bt(t){var e=parseInt(t,10);return e<0?0:e>255?255:e}function wt(t){return(parseFloat(t)%360+360)%360/360}function kt(t){var e=parseFloat(t);return e<0?0:e>1?255:Math.round(255*e)}function Pt(t){var e=parseFloat(t);return e<0?0:e>100?1:e/100}function xt(t){var e,n,r="number"==typeof(e=t)?e>>>0===e&&e>=0&&e<=4294967295?e:null:(n=yt.exec(e))?parseInt(n[1]+"ff",16)>>>0:I&&void 0!==I[e]?I[e]:(n=ht.exec(e))?(bt(n[1])<<24|bt(n[2])<<16|bt(n[3])<<8|255)>>>0:(n=dt.exec(e))?(bt(n[1])<<24|bt(n[2])<<16|bt(n[3])<<8|kt(n[4]))>>>0:(n=mt.exec(e))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0:(n=vt.exec(e))?parseInt(n[1],16)>>>0:(n=gt.exec(e))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=pt.exec(e))?(255|_t(wt(n[1]),Pt(n[2]),Pt(n[3])))>>>0:(n=ft.exec(e))?(_t(wt(n[1]),Pt(n[2]),Pt(n[3]))|kt(n[4]))>>>0:null;return null===r?t:"rgba("+((4278190080&(r=r||0))>>>24)+", "+((16711680&r)>>>16)+", "+((65280&r)>>>8)+", "+(255&r)/255+")"}var Ct,St=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,At=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,It=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Et=function(t,e,n,r,s){return"rgba("+Math.round(e)+", "+Math.round(n)+", "+Math.round(r)+", "+s+")"},Vt=function(t){Ct||(Ct=I?new RegExp("("+Object.keys(I).join("|")+")","g"):/^\b$/);var e=t.output.map((function(t){return z(t).replace(At,xt).replace(Ct,xt)})),n=e.map((function(t){return t.match(St).map(Number)})),r=n[0].map((function(t,e){return n.map((function(t){if(!(e in t))throw Error('The arity of each "output" value must be equal');return t[e]}))})).map((function(e){return F(ut(ut({},t),{output:e}))}));return function(t){var n=0;return e[0].replace(St,(function(){return String(r[n++](t))})).replace(It,Et)}};function Ot(t,e,n=1e3){p(()=>{if(e){let r=0;k(t,(t,s)=>{if(!t.current)return;const{controllers:i}=t.current;if(i.length){let t=n*e[s];isNaN(t)?t=r:r=t,k(i,e=>{k(e.queue,e=>{e.delay=t+(e.delay||0)}),e.start()})}})}else{let e=Promise.resolve();k(t,t=>{const{controllers:n,start:r}=t.current||{};if(n&&n.length){const t=n.map(t=>{const e=t.queue;return t.queue=[],e});e=e.then(()=>(k(n,(e,n)=>e.queue.push(...t[n])),r()))}})}})}const jt=U(U({},{tension:170,friction:26}),{},{mass:1,damping:1,easing:t=>t,clamp:!1});class qt{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,jt)}}function Rt(t,e){if(v.und(e.decay)){const n=!v.und(e.tension)||!v.und(e.friction);!n&&v.und(e.frequency)&&v.und(e.damping)&&v.und(e.mass)||(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}else t.duration=void 0}const Tt=[];class Mt{constructor(){this.changed=!1,this.values=Tt,this.toValues=null,this.fromValues=Tt,this.to=void 0,this.from=void 0,this.config=new qt,this.immediate=!1,this.onStart=void 0,this.onChange=void 0,this.onRest=[]}}const Nt=(t,e)=>st(t,e||[{}]);function Ft(t,...e){return v.fun(t)?t(...e):t}const Dt=(t,e)=>!0===t||!!(e&&t&&(v.fun(t)?t(e):P(t).includes(e))),zt=(t,e,n)=>t&&(v.fun(t)?t(e,n):v.arr(t)?t[e]:U({},t)),Lt=(t,e)=>!0===t.default?t[e]:t.default?t.default[e]:void 0,Qt=(t,e=[],n={})=>{let r=Ut;t.default&&!0!==t.default&&(t=t.default,r=Object.keys(t));for(const s of r){const r=t[s];v.und(r)||e.includes(s)||(n[s]=r)}return n},Ut=["pause","cancel","config","immediate","onDelayEnd","onProps","onStart","onChange","onRest"],Gt={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onDelayEnd:1,onProps:1,onStart:1,onChange:1,onRest:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,keys:1,callId:1,parentId:1};function Wt(t){const e=function(t){const e={};let n=0;if(k(t,(t,r)=>{Gt[r]||(e[r]=t,n++)}),n)return e}(t);if(e){const n={to:e};return k(t,(t,r)=>r in e||(n[r]=t)),n}return U({},t)}function $t(t){const e=L(t);return e?$t(e.get()):v.arr(t)?t.map($t):w(t)?b({range:[0,1],output:[t,t]})(1):t}function Bt(t,{key:e,props:n,state:r,actions:s}){return new Promise((i,o)=>{let a,u,c=!1,l=Dt(n.cancel,e);function h(){r.resumeQueue.add(d),u.cancel(),a=u.time-A()}function d(){a>0?(r.pauseQueue.add(h),u=S.setTimeout(p,a)):p()}function p(){r.pauseQueue.delete(h),t<=(r.cancelId||0)&&(l=!0);try{s.start(U(U({},n),{},{callId:t,delay:a,cancel:l,pause:c}),i)}catch(t){o(t)}}l?p():(a=Ft(n.delay||0,e),c=Dt(n.pause,e),c?(r.resumeQueue.add(d),s.pause()):(s.resume(),d()))})}const Ht=(t,e)=>1==e.length?e[0]:e.some(t=>t.cancelled)?Jt(t):e.every(t=>t.noop)?Yt(t):Zt(t,e.every(t=>t.finished)),Yt=(t,e=t.get())=>({value:e,noop:!0,finished:!0,target:t}),Zt=(t,e,n=t.get())=>({value:n,finished:e,target:t}),Jt=(t,e=t.get())=>({value:e,cancelled:!0,target:t});async function Kt(t,e,n,r){e.pause&&await new Promise(t=>{n.resumeQueue.add(t)});const{callId:s,parentId:i,onRest:o}=e,{asyncTo:a,promise:u}=n;return i||t!==a||e.reset?n.promise=(async()=>{n.asyncId=s,n.asyncTo=t;const c=Qt(e,["onRest"]);let l,h;const d=new Promise((t,e)=>(l=t,h=e)),p=t=>{const e=s<=(n.cancelId||0)&&Jt(r)||s!==n.asyncId&&Zt(r,!1);if(e)throw t.result=e,t},f=(m=(t,e)=>{const i=new te;p(i);const o=v.obj(t)?U({},t):U(U({},e),{},{to:t});return o.parentId=s,k(c,(t,e)=>{v.und(o[e])&&(o[e]=t)}),r.start(o).then(async t=>(p(i),r.is("PAUSED")&&await new Promise(t=>{n.resumeQueue.add(t)}),t))},(...t)=>{const e=t=>{throw t instanceof te&&h(t),t};try{return m(...t).catch(e)}catch(t){e(t)}});var m;let g;try{let e;v.arr(t)?e=(async t=>{for(const e of t)await f(e)})(t):v.fun(t)&&(e=Promise.resolve(t(f,r.stop.bind(r)))),await Promise.all([e.then(l),d]),g=Zt(r,!0)}catch(t){if(!(t instanceof te))throw t;g=t.result}finally{s==n.asyncId&&(n.asyncId=i,n.asyncTo=i?a:void 0,n.promise=i?u:void 0)}return v.fun(o)&&O(()=>{o(g)}),g})():u}function Xt(t,e){t.cancelId=e,t.asyncId=t.asyncTo=t.promise=void 0}class te extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}const ee=t=>t instanceof re;let ne=1;class re extends Q{constructor(...t){super(...t),this.id=ne++,this.key=void 0,this._priority=0,this._children=new Set}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=W(this);return t&&t.getValue()}to(...t){return C(this,t)}interpolate(...t){return at(),C(this,t)}addChild(t){this._children.size||this._attach(),this._children.add(t)}removeChild(t){this._children.delete(t),this._children.size||this._detach()}onParentChange({type:t}){this.idle?"start"==t&&(this._reset(),this._start()):"reset"==t&&this._reset()}_attach(){}_detach(){}_reset(){this._emit({type:"reset",parent:this})}_start(){this._emit({type:"start",parent:this})}_onChange(t,e=!1){this._emit({type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||S.start(this),this._emit({type:"priority",parent:this,priority:t})}_emit(t){k(Array.from(this._children),e=>{e.onParentChange(t)})}}const se="ACTIVE";class ie extends re{constructor(t,e){if(super(),this.key=void 0,this.animation=new Mt,this.queue=void 0,this._phase="CREATED",this._state={pauseQueue:new Set,resumeQueue:new Set},this._defaultProps={},this._lastCallId=0,this._lastToId=0,!v.und(t)||!v.und(e)){const n=v.obj(t)?U({},t):U(U({},e),{},{from:t});n.default=!0,this.start(n)}}get idle(){return!this.is(se)&&!this._state.asyncTo}get goal(){return z(this.animation.to)}get velocity(){const t=W(this);return t instanceof Y?t.lastVelocity||0:t.getPayload().map(t=>t.lastVelocity||0)}advance(t){let e=!0,n=!1;const r=this.animation;let{config:s,toValues:i}=r;const o=B(r.to);if(!o){const t=L(r.to);t&&(i=P(t.get()))}return r.values.forEach((a,u)=>{if(a.done)return;let c=o?o[u].lastPosition:i[u],l=r.immediate,h=c;if(!l){if(h=a.lastPosition,s.tension<=0)return void(a.done=!0);const e=a.elapsedTime+=t,n=r.fromValues[u],i=null!=a.v0?a.v0:a.v0=v.arr(s.velocity)?s.velocity[u]:s.velocity;let o;if(v.und(s.duration))if(s.decay){const t=!0===s.decay?.998:s.decay,r=Math.exp(-(1-t)*e);h=n+i/(1-t)*(1-r),l=Math.abs(a.lastPosition-h)<.1,o=i*r}else{o=null==a.lastVelocity?i:a.lastVelocity;const e=s.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),r=s.restVelocity||e/10,u=s.clamp?0:s.bounce,d=!v.und(u),p=n==c?a.v0>0:n<c;let f,m=!1;const g=1,y=Math.ceil(t/g);for(let t=0;t<y&&(f=Math.abs(o)>r,f||(l=Math.abs(c-h)<=e,!l));++t){d&&(m=h==c||h>c==p,m&&(o=-o*u,h=c)),o+=(1e-6*-s.tension*(h-c)+.001*-s.friction*o)/s.mass*g,h+=o*g}}else{let r=s.progress||0;s.duration<=0?r=1:r+=(1-r)*Math.min(1,e/s.duration),h=n+s.easing(r)*(c-n),o=(h-a.lastPosition)/t,l=1==r}a.lastVelocity=o,Number.isNaN(h)&&(console.warn("Got NaN while animating:",this),l=!0)}o&&!o[u].done&&(l=!1),l?a.done=!0:e=!1,a.setValue(h,s.round)&&(n=!0)}),e?this.finish():n&&this._onChange(this.get()),e}is(t){return this._phase==t}set(t){return O(()=>{if(this._focus(t),this._set(t)&&!this.is(se))return this._onChange(this.get(),!0);this._stop()}),this}pause(){oe(this,"pause"),this.is("PAUSED")||(this._phase="PAUSED",x(this._state.pauseQueue,t=>t()))}resume(){oe(this,"resume"),this.is("PAUSED")&&(this._start(),x(this._state.resumeQueue,t=>t()))}finish(t){if(this.resume(),this.is(se)){const e=this.animation;!e.config.decay&&v.und(t)&&(t=e.to),v.und(t)||this._set(t),O(()=>{e.changed||(e.changed=!0,e.onStart&&e.onStart(this)),this._stop()})}return this}update(t){return oe(this,"update"),(this.queue||(this.queue=[])).push(t),this}async start(t,e){let n;oe(this,"start"),v.und(t)?(n=this.queue||[],this.queue=[]):n=[v.obj(t)?t:U(U({},e),{},{to:t})];const r=await Promise.all(n.map(t=>this._update(t)));return Ht(this,r)}stop(t){return this.is("DISPOSED")||(Xt(this._state,this._lastCallId),this._focus(this.get()),O(()=>this._stop(t))),this}reset(){this._update({reset:!0})}dispose(){this.is("DISPOSED")||(this.animation&&(this.animation.onRest=[]),this.stop(),this._phase="DISPOSED")}onParentChange(t){super.onParentChange(t),"change"==t.type?this.is(se)||(this._reset(),this.is("PAUSED")||this._start()):"priority"==t.type&&(this.priority=t.priority+1)}_prepareNode({to:t,from:e,reverse:n}){const r=this.key||"",s={to:t=!v.obj(t)||L(t)?t:t[r],from:e=!v.obj(e)||L(e)?e:e[r]};if(this.is("CREATED")){n&&([t,e]=[e,t]),e=z(e);const r=this._updateNode(v.und(e)?z(t):e);r&&!v.und(e)&&r.setValue(e)}return s}_updateNode(t){let e=W(this);if(!v.und(t)){const n=this._getNodeType(t);e&&e.constructor===n||$(this,e=n.create(t))}return e}_getNodeType(t){const e=W(t);return e?e.constructor:v.arr(t)?X:w(t)?Z:Y}_update(t,e){const n=this._defaultProps,r=e=>{const r=Lt(t,e);v.und(r)||(n[e]=r),n[e]&&(t[e]=n[e])};r("cancel"),r("pause");const s=this._prepareNode(t);return Bt(++this._lastCallId,{key:this.key,props:t,state:this._state,actions:{pause:this.pause.bind(this),resume:this.resume.bind(this),start:this._merge.bind(this,s)}}).then(n=>{if(t.loop&&n.finished&&(!e||!n.noop)){const e=ce(t);if(e)return this._update(e,!0)}return n})}_merge(t,e,n){if(e.cancel)return this.stop(!0),n(Jt(this));const{key:r,animation:s}=this,i=this._defaultProps,o=!v.und(t.to),a=!v.und(t.from);if(o||a){if(!(e.callId>this._lastToId))return n(Jt(this));this._lastToId=e.callId}const u=t=>v.und(e[t])?i[t]:e[t],c=ae(u("onDelayEnd"),r);c&&c(e,this),e.default&&((t,e,n)=>{Qt(e,n,t)})(i,e,["pause","cancel"]);const{to:l,from:h}=s;let{to:d=l,from:p=h}=t;a&&!o&&(d=p),e.reverse&&([d,p]=[p,d]);const f=!_(p,h);f&&(s.from=p);const m=!_(d,l);m&&this._focus(d);const g=L(d),b=L(p);b&&(p=b.get());const k=v.arr(e.to)||v.fun(e.to),{config:x}=s,{decay:C,velocity:S}=x;e.config&&!k&&function(t,e,n){n&&(Rt(n=U({},n),e),e=U(U({},n),e)),Rt(t,e),Object.assign(t,e);for(const e in jt)null==t[e]&&(t[e]=jt[e]);let{mass:r,frequency:s,damping:i}=t;v.und(s)||(s<.01&&(s=.01),i<0&&(i=0),t.tension=Math.pow(2*Math.PI/s,2)*r,t.friction=4*Math.PI*i*r/s)}(x,Ft(e.config,r),e.config!==i.config?Ft(i.config,r):void 0);let A=W(this);if(!A||v.und(d))return n(Zt(this,!0));const I=v.und(e.reset)?a&&!e.default:!v.und(p)&&Dt(e.reset,r),E=I?p:this.get(),V=$t(d),j=v.num(V)||v.arr(V)||w(V),q=!k&&(!j||Dt(i.immediate||e.immediate,r));if(m)if(q)A=this._updateNode(V);else{const t=this._getNodeType(d);if(t!==A.constructor)throw Error("Cannot animate between "+A.constructor.name+" and "+t.name+', as the "to" prop suggests')}const R=A.constructor;let T=!!g,M=!1;if(!T){const t=I||this.is("CREATED")&&f;(m||t)&&(M=_($t(E),V),T=!M),_(x.decay,C)&&_(x.velocity,S)||(T=!0)}if(M&&this.is(se)&&(s.changed&&!I?T=!0:T||this._stop()),!k){(T||L(l))&&(s.values=A.getPayload(),s.toValues=g?null:R==Z?[1]:P(V)),s.immediate=q,s.onStart=ae(u("onStart"),r),s.onChange=ae(u("onChange"),r);const t=s.onRest,i=I&&!e.onRest?t[0]||y:ue(ae(u("onRest"),r),this);if(T){s.onRest=[i,ue(n,this)];let e=I?0:1;e<t.length&&O(()=>{for(;e<t.length;e++)t[e]()})}else(I||e.onRest)&&(s.onRest[0]=i)}const N=ae(u("onProps"),r);N&&N(e,this),I&&A.setValue(E),k?n(Kt(e.to,e,this._state,this)):T?(I&&(this._phase="IDLE"),this._reset(),this._start()):this.is(se)&&!m?s.onRest.push(ue(n,this)):n(Yt(this,E))}_focus(t){const e=this.animation;if(t!==e.to){let n=L(e.to);n&&n.removeChild(this),e.to=t;let r=0;(n=L(t))&&(n.addChild(this),ee(t)&&(r=(t.priority||0)+1)),this.priority=r}}_set(t){const e=L(t);e&&(t=e.get());const n=W(this),r=n&&n.getValue();return n?n.setValue(t):this._updateNode(t),!_(t,r)}_onChange(t,e=!1){const n=this.animation;n.changed||e||(n.changed=!0,n.onStart&&n.onStart(this)),n.onChange&&n.onChange(t,this),super._onChange(t,e)}_reset(){const t=this.animation;W(this).reset(t.to),this.is(se)||(t.changed=!1),t.immediate||(t.fromValues=t.values.map(t=>t.lastPosition)),super._reset()}_start(){this.is(se)||(this._phase=se,super._start(),E?this.finish():S.start(this))}_stop(t){if(this.resume(),this.is(se)){this._phase="IDLE",this._onChange(this.get(),!0);const e=this.animation;k(e.values,t=>{t.done=!0});const n=e.onRest;n.length&&(e.onRest=[e.toValues?y:n[0]],e.changed||(n[0]=y),k(n,e=>e(t)))}}}function oe(t,e){if(t.is("DISPOSED"))throw Error('Cannot call "'+e+'" of disposed "'+t.constructor.name+'" object')}function ae(t,e){return v.fun(t)?t:e&&t?t[e]:void 0}const ue=(t,e)=>{const{to:n}=e.animation;return t?r=>{if(r)t(Jt(e));else{const r=$t(n),s=_($t(e.get()),r);t(Zt(e,s))}}:y};function ce(t,e=t.loop,n=t.to){let r=Ft(e);if(r){const s=!0!==r&&Wt(r),i=(s||t).reverse,o=!s||s.reset;return le(U(U({},t),{},{loop:e,default:!1,to:!i||v.arr(n)||v.fun(n)?n:void 0,from:o?t.from:void 0,reset:o},s))}}function le(t){const{to:e,from:n}=t=Wt(t),r=new Set;return n?de(n,r):delete t.from,v.obj(e)?de(e,r):e||delete t.to,t.keys=r.size?Array.from(r):null,t}function he(t){const e=le(t);return v.und(e.default)&&(e.default=Qt(e,[!0===e.immediate&&"immediate"])),e}function de(t,e){k(t,(t,n)=>null!=t&&e.add(n))}const pe=["onStart","onChange","onRest"];let fe=1;class me{constructor(t,e){this.id=fe++,this.springs={},this.queue=[],this._flush=void 0,this._initialProps=void 0,this._phase="CREATED",this._lastAsyncId=0,this._active=new Set,this._state={pauseQueue:new Set,resumeQueue:new Set},this._events={onStart:new Set,onChange:new Set,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start(t)}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle)}is(t){return this._phase==t}get(){const t={};return this.each((e,n)=>t[n]=e.get()),t}update(t){return t&&this.queue.push(le(t)),this}start(t){const e=t?P(t).map(le):this.queue;return t||(this.queue=[]),this._flush?this._flush(this,e):(we(this,e),ge(this,e))}stop(t){if(v.und(t))this.each(t=>t.stop()),Xt(this._state,this._lastAsyncId);else{const e=this.springs;k(P(t),t=>e[t].stop())}return this}pause(t){if(v.und(t))this.each(t=>t.pause());else{const e=this.springs;k(P(t),t=>e[t].pause())}return this}resume(t){if(v.und(t))this.each(t=>t.resume());else{const e=this.springs;k(P(t),t=>e[t].resume())}return this}reset(){return this.each(t=>t.reset()),this}each(t){k(this.springs,t)}dispose(){this._state.asyncTo=void 0,this.each(t=>t.dispose()),this.springs={}}_onFrame(){const{onStart:t,onChange:e,onRest:n}=this._events,r=this._active.size>0;r&&this._phase!=se&&(this._phase=se,x(t,t=>t(this)));const s=(e.size||!r&&n.size)&&this.get();x(e,t=>t(s)),r||(this._phase="IDLE",x(n,([t,e])=>{e.value=s,t(e)}))}onParentChange(t){"change"==t.type&&(this._active[t.idle?"delete":"add"](t.parent),S.onFrame(this._onFrame))}}function ge(t,e){return Promise.all(e.map(e=>function t(e,n,r){const{to:s,loop:i,onRest:o}=n;i&&(n.loop=!1);const a=v.arr(s)||v.fun(s)?s:void 0;a?(n.to=void 0,n.onRest=void 0):k(pe,t=>{const r=n[t];if(v.fun(r)){const s=e._events[t];s instanceof Set?n[t]=()=>s.add(r):n[t]=({finished:t,cancelled:e})=>{const n=s.get(r);n?(t||(n.finished=!1),e&&(n.cancelled=!0)):s.set(r,{value:null,finished:t,cancelled:e})}}});const u=(n.keys||Object.keys(e.springs)).map(t=>e.springs[t].start(n)),c=e._state;a?u.push(Bt(++e._lastAsyncId,{props:n,state:c,actions:{pause:y,resume:y,start(t,n){t.onRest=o,t.cancel?((t,e)=>!v.und(Lt(t,e)))(t,"cancel")&&Xt(c,t.callId):n(Kt(a,t,c,e))}}})):n.keys||!0!==n.cancel||Xt(c,e._lastAsyncId);return Promise.all(u).then(o=>{const a=Ht(e,o);if(i&&a.finished&&(!r||!a.noop)){const r=ce(n,i,s);if(r)return we(e,[r]),t(e,r,!0)}return a})}(t,e))).then(e=>Ht(t,e))}function ye(t,e){const n=U({},t.springs);return e&&k(P(e),t=>{v.und(t.keys)&&(t=le(t)),v.obj(t.to)||(t=U(U({},t),{},{to:void 0})),be(n,t,t=>_e(t))}),n}function ve(t,e){k(e,(e,n)=>{t.springs[n]||(t.springs[n]=e,e.addChild(t))})}function _e(t,e){const n=new ie;return n.key=t,e&&n.addChild(e),n}function be(t,e,n){e.keys&&k(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function we(t,e){k(e,e=>{be(t.springs,e,e=>_e(e,t))})}const ke=o({}),Pe=t=>{let{children:e}=t,n=d(t,["children"]);const r=u(ke);n=Nt(()=>U(U({},r),n),[r,n.pause,n.cancel,n.immediate,n.config]);const{Provider:s}=ke;return i(s,{value:n},e)};Pe.Provider=ke.Provider,Pe.Consumer=ke.Consumer;const xe=()=>u(ke),Ce=t=>({get controllers(){return t()},update(e){return k(t(),(t,n)=>{t.update(zt(e,n,t))}),this},async start(e){const n=await Promise.all(t().map((t,n)=>{const r=zt(e,n,t);return t.start(r)}));return{value:n.map(t=>t.value),finished:n.every(t=>t.finished)}},stop:e=>k(t(),t=>t.stop(e)),pause:e=>k(t(),t=>t.pause(e)),resume:e=>k(t(),t=>t.resume(e))});function Se(t,e,s){const i=v.fun(e)&&e;i&&!s&&(s=[]);const o=r(0),u=M(),[c]=n(()=>({ctrls:[],queue:[],flush(t,e){const n=ye(t,e);return o.current>0&&!c.queue.length&&!Object.keys(n).some(e=>!t.springs[e])?ge(t,e):new Promise(r=>{ve(t,n),c.queue.push(()=>{r(ge(t,e))}),u()})}})),l=r(),h=[...c.ctrls],d=[],f=N(t)||0,m=h.slice(t,f);function g(t,n){for(let r=t;r<n;r++){const t=h[r]||(h[r]=new me(null,c.flush));let n=i?i(r,t):e[r];n&&(n=d[r]=he(n),0==r&&(l.current=n.ref,n.ref=void 0))}}Nt(()=>{h.length=t,g(f,t)},[t]),Nt(()=>{g(0,Math.min(f,t))},s);const y=a(()=>Ce(()=>c.ctrls),[]),_=h.map((t,e)=>ye(t,d[e])),b=xe();p(()=>{o.current++,c.ctrls=h,l.current&&(l.current.current=y);const{queue:t}=c;t.length&&(c.queue=[],k(t,t=>t())),k(m,t=>t.dispose()),k(h,(t,e)=>{ve(t,_[e]),t.start({default:b});const n=d[e];n&&(l.current?t.queue.push(n):t.start(n))})}),T(()=>()=>{k(c.ctrls,t=>t.dispose())});const w=_.map(t=>U({},t));return i||3==arguments.length?[w,y.start,y.stop]:w}function Ae(t,e){const n=v.fun(t),[[r],s,i]=Se(1,n?t:[t],n?e||[]:e);return n||2==arguments.length?[r,s,i]:r}function Ie(t,e,n){const r=v.fun(e)&&e;r&&!n&&(n=[]);const s=[],i=Se(t,(t,n)=>(s[t]=n,zt(e,t,n)),n||[{}]);if(p(()=>{const t=v.obj(e)&&e.reverse;for(let e=0;e<s.length;e++){const n=s[e+(t?1:-1)];n&&s[e].update({to:n.springs}).start()}},n),r||3==arguments.length){const t=i[1];return i[1]=it(e=>{const n=v.obj(e)&&e.reverse;return t((t,r)=>{const i=zt(e,t,r),o=s[t+(n?1:-1)];return o&&(i.to=o.springs),i})},n),i}return i[0]}const Ee="enter";function Ve(t,e,n){const{ref:s,reset:o,sort:u,trail:h=0,expires:d=!0}=e,f=P(t),m=[],g=Oe(f,e),y=r(null),_=o?null:y.current;p(()=>{y.current=m}),T(()=>()=>k(y.current,t=>{t.expired&&clearTimeout(t.expirationId),t.ctrl.dispose()}));const b=[];if(_&&k(_,(t,e)=>{t.expired?clearTimeout(t.expirationId):~(e=b[e]=g.indexOf(t.key))&&(m[e]=t)}),k(f,(t,e)=>{m[e]||(m[e]={key:g[e],item:t,phase:"mount",ctrl:new me})}),b.length){let t=-1;k(b,(n,r)=>{const s=_[r];~n?(t=m.indexOf(s),m[t]=U(U({},s),{},{item:f[n]})):e.leave&&m.splice(++t,0,s)})}v.fun(u)&&m.sort((t,e)=>u(t.item,e.item));let w=-h;const x=M(),C=Qt(e),S=new Map;k(m,(t,n)=>{const r=t.key,s=t.phase;let i,o;if("mount"==s)i=e.enter,o=Ee;else{const t=g.indexOf(r)<0;if("leave"!=s)if(t)i=e.leave,o="leave";else{if(!(i=e.update))return;o="update"}else{if(t)return;i=e.enter,o=Ee}}if(i=Ft(i,t.item,n),i=v.obj(i)?Wt(i):{to:i},!i.config){const r=e.config||C.config;i.config=Ft(r,t.item,n)}const a=U(U({},C),{},{delay:w+=h,reset:!1},i);if(o==Ee&&v.und(a.from)){const r=v.und(e.initial)||_?e.from:e.initial;a.from=Ft(r,t.item,n)}const{onRest:u}=a;a.onRest=t=>{const e=y.current,n=e.find(t=>t.key===r);if(n)if(v.fun(u)&&u(t,n),t.cancelled&&"update"!=n.phase)n.phase=s;else if(n.ctrl.idle){const t=e.every(t=>t.ctrl.idle);if("leave"==n.phase){const e=Ft(d,n.item);if(!1!==e){const r=!0===e?0:e;if(n.expired=!0,!t&&r>0)return void(r<=2147483647&&(n.expirationId=setTimeout(x,r)))}}t&&e.some(t=>t.expired)&&x()}};const c=ye(t.ctrl,a);S.set(t,{phase:o,springs:c,payload:a})});const A=xe();p(()=>{k(m,t=>{t.ctrl.start({default:A})})},[A]);const I=a(()=>Ce(()=>y.current.map(t=>t.ctrl)),[]);c(s,()=>I),p(()=>{k(S,({phase:t,springs:e,payload:n},r)=>{ve(r.ctrl,e),A.cancel||(r.phase=t,t==Ee&&r.ctrl.start({default:A}),r.ctrl[s?"update":"start"](n))})},o?void 0:n);const E=t=>i(l,null,m.map((e,n)=>{const{springs:r}=S.get(e)||e.ctrl,s=t(U({},r),e.item,e,n);return s&&s.type?i(s.type,U({},s.props,{key:v.str(e.key)||v.num(e.key)?e.key:e.ctrl.id,ref:s.ref})):s}));return 3==arguments.length?[E,I.start,I.stop]:E}function Oe(t,{key:e,keys:n=e}){return v.und(n)?t:v.fun(n)?t.map(n):P(n)}class je extends re{constructor(t,e){super(),this.source=t,this.key=void 0,this.idle=!0,this.calc=void 0,this.calc=F(...e);const n=this._get(),r=v.arr(n)?X:Y;$(this,r.create(n))}advance(t){const e=this._get();_(e,this.get())||(W(this).setValue(e),this._onChange(e,this.idle))}_get(){const t=v.arr(this.source)?this.source.map(t=>t.get()):P(this.source.get());return this.calc(...t)}_reset(){k(B(this),t=>t.reset()),super._reset()}_start(){this.idle=!1,super._start(),E?(this.idle=!0,this.advance()):S.start(this)}_attach(){let t=!0,e=1;k(P(this.source),n=>{ee(n)&&(n.idle||(t=!1),e=Math.max(e,n.priority+1)),n.addChild(this)}),this.priority=e,t||(this._reset(),this._start())}_detach(){k(P(this.source),t=>{t.removeChild(this)}),this.idle=!0}onParentChange(t){"start"==t.type?this.advance():"change"==t.type?this.idle?this.advance():t.idle&&(this.idle=P(this.source).every(t=>!1!==t.idle),this.idle&&(this.advance(),k(B(this),t=>{t.done=!0}))):"priority"==t.type&&(this.priority=P(this.source).reduce((t,e)=>Math.max(t,(e.priority||0)+1),0)),super.onParentChange(t)}}const qe=(t,...e)=>(at(),new je(t,e));q({createStringInterpolator:Vt,to:(t,e)=>new je(t,e)});const Re=/^--/;function Te(t,e){return null==e||"boolean"==typeof e||""===e?"":"number"!=typeof e||0===e||Re.test(t)||Ne.hasOwnProperty(t)&&Ne[t]?(""+e).trim():e+"px"}const Me={};let Ne={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const Fe=["Webkit","Ms","Moz","O"];Ne=Object.keys(Ne).reduce((t,e)=>(Fe.forEach(n=>t[((t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1))(n,e)]=t[e]),t),Ne);const De=/^(matrix|translate|scale|rotate|skew)/,ze=/^(translate)/,Le=/^(rotate|skew)/,Qe=(t,e)=>v.num(t)&&0!==t?t+e:t,Ue=(t,e)=>v.arr(t)?t.every(t=>Ue(t,e)):v.num(t)?t===e:parseFloat(t)===e;class Ge extends K{constructor(t){let{x:e,y:n,z:r}=t,s=d(t,["x","y","z"]);const i=[],o=[];(e||n||r)&&(i.push([e||0,n||0,r||0]),o.push(t=>["translate3d("+t.map(t=>Qe(t,"px")).join(",")+")",Ue(t,0)])),k(s,(t,e)=>{if("transform"===e)i.push([t||""]),o.push(t=>[t,""===t]);else if(De.test(e)){if(delete s[e],v.und(t))return;const n=ze.test(e)?"px":Le.test(e)?"deg":"";i.push(P(t)),o.push("rotate3d"===e?([t,e,r,s])=>["rotate3d("+t+","+e+","+r+","+Qe(s,n)+")",Ue(s,0)]:t=>[e+"("+t.map(t=>Qe(t,n)).join(",")+")",Ue(t,e.startsWith("scale")?1:0)])}}),i.length&&(s.transform=new We(i,o)),super(s)}}class We extends Q{constructor(t,e){super(),this.inputs=t,this.transforms=e,this._value=null,this._children=new Set}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return k(this.inputs,(n,r)=>{const s=z(n[0]),[i,o]=this.transforms[r](v.arr(s)?s:n.map(z));t+=" "+i,e=e&&o}),e?"none":t}addChild(t){this._children.size||k(this.inputs,t=>k(t,t=>{const e=L(t);e&&e.addChild(this)})),this._children.add(t)}removeChild(t){this._children.delete(t),this._children.size||k(this.inputs,t=>k(t,t=>{const e=L(t);e&&e.removeChild(this)}))}onParentChange(t){"change"==t.type&&(this._value=null),k(this._children,e=>{e.onParentChange(t)})}}q({colorNames:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},createStringInterpolator:Vt,batchedUpdates:h});const $e=((t,{applyAnimatedValues:e=(()=>!1),createAnimatedStyle:n=(t=>new K(t)),getComponentProps:r=(t=>t)}={})=>{const s={applyAnimatedValues:e,createAnimatedStyle:n,getComponentProps:r},i=t=>{const e=rt(t)||"Anonymous";return(t=v.str(t)?et(t,s):t[nt]||(t[nt]=et(t,s))).displayName="Animated("+e+")",t};return k(t,(t,e)=>{v.str(e)||(e=rt(t)),i[e]=i(t)}),{animated:i}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(t,e){if(!t.nodeType||!t.setAttribute)return!1;const n="filter"===t.nodeName||t.parentNode&&"filter"===t.parentNode.nodeName,r=e,{style:s,children:i,scrollTop:o,scrollLeft:a}=r,u=d(r,["style","children","scrollTop","scrollLeft"]),c=Object.values(u),l=Object.keys(u).map(e=>n||t.hasAttribute(e)?e:Me[e]||(Me[e]=e.replace(/([A-Z])/g,t=>"-"+t.toLowerCase())));S.onWrite(()=>{void 0!==i&&(t.textContent=i);for(let e in s)if(s.hasOwnProperty(e)){const n=Te(e,s[e]);"float"===e?e="cssFloat":Re.test(e)?t.style.setProperty(e,n):t.style[e]=n}l.forEach((e,n)=>{t.setAttribute(e,c[n])}),void 0!==o&&(t.scrollTop=o),void 0!==a&&(t.scrollLeft=a)})},createAnimatedStyle:t=>new Ge(t),getComponentProps:t=>d(t,["scrollTop","scrollLeft"])}).animated;var Be=!("undefined"!=typeof window&&window.location&&window.location.href&&window.matchMedia)||Boolean(new URL(window.location.href).searchParams.get("eyes-storybook")),He=function(){return Be?{matches:!0,addListener:function(){},removeListener:function(){}}:window.matchMedia("(prefers-reduced-motion: reduce)")};function Ye(){var t=n(He().matches),r=t[0],s=t[1];return e((function(){var t=He(),e=function(){s(t.matches)};return t.addListener(e),function(){t.removeListener(e)}}),[]),r}export{R as Globals,$e as animated,qe as interpolate,Be as isRenderingOnServer,Ot as useChain,Ye as useReducedMotion,Ae as useSpring,Se as useSprings,Ie as useTrail,Ve as useTransition}; | ||
import{useLayoutEffect as t,useEffect as e,useState as n,useRef as r,forwardRef as s,createElement as i,createContext as o,useMemo as a,useContext as u,useImperativeHandle as c,Fragment as l}from"react";import{unstable_batchedUpdates as h}from"react-dom";function d(t,e){if(null==t)return{};var n,r,s={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(s[n]=t[n]);return s}var p="undefined"!=typeof window&&window.document&&window.document.createElement?t:e,f=function(t){return V(t)},m=function(t){void 0===t&&(t=f);var e=!0,n=!1,r=0,s=[],i=0,o=new Set,a=new Set,u=new Set,c=function(t){var e=s.indexOf(t);e<0&&(e=s.findIndex((function(e){return e.priority>t.priority})),s.splice(~e?e:s.length,0,t))},l=function(){if(!e)try{p(),t(l)}catch(t){console.error(t)}},h=function(){e&&(e=!1,0==r&&(r=A(),t(l)))},d=[];this.setTimeout=function(t,e){var n=A()+e,r=function(){var t=d.findIndex((function(t){return t.cancel==r}));t>=0&&d.splice(t,1)},s=g(d,(function(t){return t.time>n})),i={time:n,handler:t,cancel:r};return d.splice(s,0,i),h(),i};var p=this.advance=function(){var t=A();if(o.size&&(o.forEach(c),o.clear()),d.length&&O((function(){var e=g(d,(function(e){return e.time>t}));d.splice(0,e).forEach((function(t){return t.handler()}))})),t>r){var e=Math.min(64,t-r);r=t,O((function(){s.length&&(j(s),s=s.filter((function(t){return i=t.priority,t.idle||t.advance(e),!t.idle})),i=0),a.size&&(a.forEach((function(e){return e(t)})),a.clear()),u.size&&(n=!0,u.forEach((function(e){return e(t)})),u.clear(),n=!1)}))}};if(this.start=function(t){i>t.priority?o.add(t):(c(t),h())},this.onFrame=function(t){a.add(t),h()},this.onWrite=function(t){n?t(r):u.add(t)},"undefined"!=typeof process&&"production"!==process.env.NODE_ENV){var m=function(){e=!0,o.clear(),d.length=0};Object.defineProperties(this,{_animations:{get:function(){return s}},_dispose:{get:function(){return m}}})}};function g(t,e){var n=t.findIndex(e);return n<0?t.length:n}var y=function(){},v={arr:Array.isArray,obj:function(t){return!!t&&"Object"===t.constructor.name},fun:function(t){return"function"==typeof t},str:function(t){return"string"==typeof t},num:function(t){return"number"==typeof t},und:function(t){return void 0===t}};function _(t,e){if(v.arr(t)){if(!v.arr(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}return t===e}var b,w=function(t){return v.str(t)&&("#"==t[0]||/\d/.test(t)||!(!I||!I[t]))},k=function(t,e,n){v.fun(t.forEach)?t.forEach(e,n):Object.keys(t).forEach((function(r){return e.call(n,t[r],r)}))},P=function(t){return v.und(t)?[]:v.arr(t)?t:[t]};function x(t,e){if(t.size){var n=Array.from(t);t.clear(),k(n,e)}}var C,S=new m,A=function(){return performance.now()},I=null,E=!1,V="undefined"!=typeof window?window.requestAnimationFrame:function(){return-1},O=function(t){return t()},j=y,q=function(t){var e;return e=Object.assign({to:C,now:A,frameLoop:S,colorNames:I,skipAnimation:E,createStringInterpolator:b,requestAnimationFrame:V,batchedUpdates:O,willAdvance:j},function(t){var e={};for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}(t)),C=e.to,A=e.now,S=e.frameLoop,I=e.colorNames,E=e.skipAnimation,b=e.createStringInterpolator,V=e.requestAnimationFrame,O=e.batchedUpdates,j=e.willAdvance,e};var R=Object.freeze({__proto__:null,get createStringInterpolator(){return b},get frameLoop(){return S},get to(){return C},get now(){return A},get colorNames(){return I},get skipAnimation(){return E},get requestAnimationFrame(){return V},get batchedUpdates(){return O},get willAdvance(){return j},assign:q}),T=function(t){return e(t,[])},M=function(){var t=n(0)[1],e=r(!1);return T((function(){return function(){e.current=!0}})),function(){e.current||t({})}};function N(t){var n=r(void 0);return e((function(){n.current=t})),n.current}var F=function(t,e,n){if(v.fun(t))return t;if(v.arr(t))return F({range:t,output:e,extrapolate:n});if(v.str(t.output[0]))return b(t);var r=t,s=r.output,i=r.range||[0,1],o=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",u=r.easing||function(t){return t};return function(t){var e=function(t,e){for(var n=1;n<e.length-1&&!(e[n]>=t);++n);return n-1}(t,i);return function(t,e,n,r,s,i,o,a,u){var c=u?u(t):t;if(c<e){if("identity"===o)return c;"clamp"===o&&(c=e)}if(c>n){if("identity"===a)return c;"clamp"===a&&(c=n)}if(r===s)return r;if(e===n)return t<=e?r:s;e===-1/0?c=-c:n===1/0?c-=e:c=(c-e)/(n-e);c=i(c),r===-1/0?c=-c:s===1/0?c+=r:c=c*(s-r)+r;return c}(t,i[e],i[e+1],s[e],s[e+1],u,o,a,r.map)}};var D=Symbol.for("FluidValue:config");function z(t){var e=L(t);return e?e.get():t}function L(t){if(t)return t[D]}var Q=function(){!function(t,e){Object.defineProperty(t,D,{value:e,configurable:!0})}(this,this)};function U(){return(U=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}const G=Symbol.for("Animated:node"),W=t=>t&&t[G],$=(t,e)=>{return n=t,r=G,s=e,Object.defineProperty(n,r,{value:s,writable:!0,configurable:!0});var n,r,s},B=t=>t&&t[G]&&t[G].getPayload();class H{constructor(){this.payload=void 0,$(this,this)}getPayload(){return this.payload||[]}}class Y extends H{constructor(t){super(),this._value=t,this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,v.num(this._value)&&(this.lastPosition=this._value)}static create(t,e){return new Y(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return v.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value!==t&&(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,v.num(this._value)&&(this.elapsedTime=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}}class Z extends Y{constructor(t,e){super(0),this._value=void 0,this._string=null,this._toString=void 0,this._toString=F({output:[t,e]})}static create(t,e=t){if(v.str(t)&&v.str(e))return new Z(t,e);throw TypeError('Expected "from" and "to" to be strings')}getValue(){let t=this._string;return null==t?this._string=this._toString(this._value):t}setValue(t){if(v.num(t)){if(!super.setValue(t))return!1;this._string=null}else this._string=t,this._value=1;return!0}reset(t){t&&(this._toString=F({output:[this.getValue(),t]})),this._value=0,super.reset()}}const J={current:null};class K extends H{constructor(t=null){super(),this.source=void 0,this.setValue(t)}getValue(t){if(!this.source)return null;const e={};return k(this.source,(n,r)=>{if((s=n)&&s[G]===s)e[r]=n.getValue(t);else{const s=L(n);s?e[r]=s.get():t||(e[r]=n)}var s}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&k(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return k(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){L(t)&&J.current&&J.current.dependencies.add(t);const e=B(t);e&&k(e,t=>this.add(t))}}class X extends K{constructor(t,e){super(null),this.source=void 0,super.setValue(this._makeAnimated(t,e))}static create(t,e){return new X(t,e)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();t&&t.length==e.length?k(e,(e,n)=>e.setValue(t[n])):(this.source=this._makeAnimated(t),this.payload=this._makePayload(this.source))}_makeAnimated(t,e=t){return t?t.map((t,n)=>(w(t)?Z:Y).create(t,e[n])):[]}}class tt extends K{constructor(t){super(null),this.update=t,this.dirty=!1}setValue(t,e){if(t){if(e&&(J.current=e,t.style)){const{createAnimatedStyle:n}=e.host;t=U(U({},t),{},{style:n(t.style)})}super.setValue(t),J.current=null}}onParentChange({type:t}){this.dirty||"change"!==t||(this.dirty=!0,S.onFrame(()=>{this.dirty=!1,this.update()}))}}const et=(t,e)=>s((n,s)=>{const o=r(null),a=!v.fun(t)||t.prototype&&t.prototype.isReactComponent,u=M(),c=new tt(()=>{const t=o.current;a&&!t||!1===(!!t&&e.applyAnimatedValues(t,c.getValue(!0)))&&u()}),l=new Set;return c.setValue(n,{dependencies:l,host:e}),p(()=>(k(l,t=>t.addChild(c)),()=>k(l,t=>t.removeChild(c)))),i(t,U({},e.getComponentProps(c.getValue()),{ref:a&&(t=>{o.current=function(t,e){t&&(v.fun(t)?t(e):t.current=e);return e}(s,t)})}))});const nt=Symbol.for("AnimatedComponent"),rt=t=>v.str(t)?t:t&&v.str(t.displayName)?t.displayName:v.fun(t)&&t.name||null;function st(t,s){var i=n((function(){return{inputs:s,result:t()}}))[0],o=r(i),a=Boolean(s&&o.current.inputs&&function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}(s,o.current.inputs))?o.current:{inputs:s,result:t()};return e((function(){o.current=a}),[a]),a.result}function it(t,e){return st((function(){return t}),e)}var ot=!1;function at(){ot||(ot=!0,console.warn('react-spring: The "interpolate" function is deprecated in v10 (use "to" instead)'))}var ut=function(){return(ut=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)},ct="[-+]?\\d*\\.?\\d+";function lt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var ht=new RegExp("rgb"+lt(ct,ct,ct)),dt=new RegExp("rgba"+lt(ct,ct,ct,ct)),pt=new RegExp("hsl"+lt(ct,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),ft=new RegExp("hsla"+lt(ct,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",ct)),mt=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,gt=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,yt=/^#([0-9a-fA-F]{6})$/,vt=/^#([0-9a-fA-F]{8})$/;function _t(t,e,n){var r=(1-Math.abs(2*n-1))*e,s=n-r/2,i=function(t,e,n){return t<60?[e,n,0]:t<120?[n,e,0]:t<180?[0,e,n]:t<240?[0,n,e]:t<300?[n,0,e]:[e,0,n]}(t,r,r*(1-Math.abs(t/60%2-1))),o=i[0],a=i[1],u=i[2];return Math.round(255*(o+s))<<24|Math.round(255*(a+s))<<16|Math.round(255*(u+s))<<8}function bt(t){var e=parseInt(t,10);return e<0?0:e>255?255:e}function wt(t){return(parseFloat(t)%360+360)%360/360}function kt(t){var e=parseFloat(t);return e<0?0:e>1?255:Math.round(255*e)}function Pt(t){var e=parseFloat(t);return e<0?0:e>100?1:e/100}function xt(t){var e,n,r="number"==typeof(e=t)?e>>>0===e&&e>=0&&e<=4294967295?e:null:(n=yt.exec(e))?parseInt(n[1]+"ff",16)>>>0:I&&void 0!==I[e]?I[e]:(n=ht.exec(e))?(bt(n[1])<<24|bt(n[2])<<16|bt(n[3])<<8|255)>>>0:(n=dt.exec(e))?(bt(n[1])<<24|bt(n[2])<<16|bt(n[3])<<8|kt(n[4]))>>>0:(n=mt.exec(e))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0:(n=vt.exec(e))?parseInt(n[1],16)>>>0:(n=gt.exec(e))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=pt.exec(e))?(255|_t(wt(n[1]),Pt(n[2]),Pt(n[3])))>>>0:(n=ft.exec(e))?(_t(wt(n[1]),Pt(n[2]),Pt(n[3]))|kt(n[4]))>>>0:null;return null===r?t:"rgba("+((4278190080&(r=r||0))>>>24)+", "+((16711680&r)>>>16)+", "+((65280&r)>>>8)+", "+(255&r)/255+")"}var Ct,St=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,At=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,It=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Et=function(t,e,n,r,s){return"rgba("+Math.round(e)+", "+Math.round(n)+", "+Math.round(r)+", "+s+")"},Vt=function(t){Ct||(Ct=I?new RegExp("("+Object.keys(I).join("|")+")","g"):/^\b$/);var e=t.output.map((function(t){return z(t).replace(At,xt).replace(Ct,xt)})),n=e.map((function(t){return t.match(St).map(Number)})),r=n[0].map((function(t,e){return n.map((function(t){if(!(e in t))throw Error('The arity of each "output" value must be equal');return t[e]}))})).map((function(e){return F(ut(ut({},t),{output:e}))}));return function(t){var n=0;return e[0].replace(St,(function(){return String(r[n++](t))})).replace(It,Et)}};function Ot(t,e,n=1e3){p(()=>{if(e){let r=0;k(t,(t,s)=>{if(!t.current)return;const{controllers:i}=t.current;if(i.length){let t=n*e[s];isNaN(t)?t=r:r=t,k(i,e=>{k(e.queue,e=>{e.delay=t+(e.delay||0)}),e.start()})}})}else{let e=Promise.resolve();k(t,t=>{const{controllers:n,start:r}=t.current||{};if(n&&n.length){const t=n.map(t=>{const e=t.queue;return t.queue=[],e});e=e.then(()=>(k(n,(e,n)=>e.queue.push(...t[n])),r()))}})}})}const jt=U(U({},{tension:170,friction:26}),{},{mass:1,damping:1,easing:t=>t,clamp:!1});class qt{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,jt)}}function Rt(t,e){if(v.und(e.decay)){const n=!v.und(e.tension)||!v.und(e.friction);!n&&v.und(e.frequency)&&v.und(e.damping)&&v.und(e.mass)||(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}else t.duration=void 0}const Tt=[];class Mt{constructor(){this.changed=!1,this.values=Tt,this.toValues=null,this.fromValues=Tt,this.to=void 0,this.from=void 0,this.config=new qt,this.immediate=!1,this.onStart=void 0,this.onChange=void 0,this.onRest=[]}}const Nt=(t,e)=>st(t,e||[{}]);function Ft(t,...e){return v.fun(t)?t(...e):t}const Dt=(t,e)=>!0===t||!!(e&&t&&(v.fun(t)?t(e):P(t).includes(e))),zt=(t,e,n)=>t&&(v.fun(t)?t(e,n):v.arr(t)?t[e]:U({},t)),Lt=(t,e)=>!0===t.default?t[e]:t.default?t.default[e]:void 0,Qt=(t,e=[],n={})=>{let r=Ut;t.default&&!0!==t.default&&(t=t.default,r=Object.keys(t));for(const s of r){const r=t[s];v.und(r)||e.includes(s)||(n[s]=r)}return n},Ut=["pause","cancel","config","immediate","onDelayEnd","onProps","onStart","onChange","onRest"],Gt={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onDelayEnd:1,onProps:1,onStart:1,onChange:1,onRest:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,keys:1,callId:1,parentId:1};function Wt(t){const e=function(t){const e={};let n=0;if(k(t,(t,r)=>{Gt[r]||(e[r]=t,n++)}),n)return e}(t);if(e){const n={to:e};return k(t,(t,r)=>r in e||(n[r]=t)),n}return U({},t)}function $t(t){const e=L(t);return e?$t(e.get()):v.arr(t)?t.map($t):w(t)?b({range:[0,1],output:[t,t]})(1):t}function Bt(t,{key:e,props:n,state:r,actions:s}){return new Promise((i,o)=>{let a,u,c=!1,l=Dt(n.cancel,e);function h(){r.resumeQueue.add(d),u.cancel(),a=u.time-A()}function d(){a>0?(r.pauseQueue.add(h),u=S.setTimeout(p,a)):p()}function p(){r.pauseQueue.delete(h),t<=(r.cancelId||0)&&(l=!0);try{s.start(U(U({},n),{},{callId:t,delay:a,cancel:l,pause:c}),i)}catch(t){o(t)}}l?p():(a=Ft(n.delay||0,e),c=Dt(n.pause,e),c?(r.resumeQueue.add(d),s.pause()):(s.resume(),d()))})}const Ht=(t,e)=>1==e.length?e[0]:e.some(t=>t.cancelled)?Jt(t):e.every(t=>t.noop)?Yt(t):Zt(t,e.every(t=>t.finished)),Yt=(t,e=t.get())=>({value:e,noop:!0,finished:!0,target:t}),Zt=(t,e,n=t.get())=>({value:n,finished:e,target:t}),Jt=(t,e=t.get())=>({value:e,cancelled:!0,target:t});async function Kt(t,e,n,r){e.pause&&await new Promise(t=>{n.resumeQueue.add(t)});const{callId:s,parentId:i,onRest:o}=e,{asyncTo:a,promise:u}=n;return i||t!==a||e.reset?n.promise=(async()=>{n.asyncId=s,n.asyncTo=t;const c=Qt(e,["onRest"]);let l,h;const d=new Promise((t,e)=>(l=t,h=e)),p=t=>{const e=s<=(n.cancelId||0)&&Jt(r)||s!==n.asyncId&&Zt(r,!1);if(e)throw t.result=e,t},f=(m=(t,e)=>{const i=new te;p(i);const o=v.obj(t)?U({},t):U(U({},e),{},{to:t});return o.parentId=s,k(c,(t,e)=>{v.und(o[e])&&(o[e]=t)}),r.start(o).then(async t=>(p(i),r.is("PAUSED")&&await new Promise(t=>{n.resumeQueue.add(t)}),t))},(...t)=>{const e=t=>{throw t instanceof te&&h(t),t};try{return m(...t).catch(e)}catch(t){e(t)}});var m;let g;try{let e;v.arr(t)?e=(async t=>{for(const e of t)await f(e)})(t):v.fun(t)&&(e=Promise.resolve(t(f,r.stop.bind(r)))),await Promise.all([e.then(l),d]),g=Zt(r,!0)}catch(t){if(!(t instanceof te))throw t;g=t.result}finally{s==n.asyncId&&(n.asyncId=i,n.asyncTo=i?a:void 0,n.promise=i?u:void 0)}return v.fun(o)&&O(()=>{o(g)}),g})():u}function Xt(t,e){t.cancelId=e,t.asyncId=t.asyncTo=t.promise=void 0}class te extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}const ee=t=>t instanceof re;let ne=1;class re extends Q{constructor(...t){super(...t),this.id=ne++,this.key=void 0,this._priority=0,this._children=new Set}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=W(this);return t&&t.getValue()}to(...t){return C(this,t)}interpolate(...t){return at(),C(this,t)}addChild(t){this._children.size||this._attach(),this._children.add(t)}removeChild(t){this._children.delete(t),this._children.size||this._detach()}onParentChange({type:t}){this.idle?"start"==t&&(this._reset(),this._start()):"reset"==t&&this._reset()}_attach(){}_detach(){}_reset(){this._emit({type:"reset",parent:this})}_start(){this._emit({type:"start",parent:this})}_onChange(t,e=!1){this._emit({type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||S.start(this),this._emit({type:"priority",parent:this,priority:t})}_emit(t){k(Array.from(this._children),e=>{e.onParentChange(t)})}}const se="ACTIVE";class ie extends re{constructor(t,e){if(super(),this.key=void 0,this.animation=new Mt,this.queue=void 0,this._phase="CREATED",this._state={pauseQueue:new Set,resumeQueue:new Set},this._defaultProps={},this._lastCallId=0,this._lastToId=0,!v.und(t)||!v.und(e)){const n=v.obj(t)?U({},t):U(U({},e),{},{from:t});n.default=!0,this.start(n)}}get idle(){return!this.is(se)&&!this._state.asyncTo}get goal(){return z(this.animation.to)}get velocity(){const t=W(this);return t instanceof Y?t.lastVelocity||0:t.getPayload().map(t=>t.lastVelocity||0)}advance(t){let e=!0,n=!1;const r=this.animation;let{config:s,toValues:i}=r;const o=B(r.to);if(!o){const t=L(r.to);t&&(i=P(t.get()))}return r.values.forEach((a,u)=>{if(a.done)return;let c=o?o[u].lastPosition:i[u],l=r.immediate,h=c;if(!l){if(h=a.lastPosition,s.tension<=0)return void(a.done=!0);const e=a.elapsedTime+=t,n=r.fromValues[u],i=null!=a.v0?a.v0:a.v0=v.arr(s.velocity)?s.velocity[u]:s.velocity;let o;if(v.und(s.duration))if(s.decay){const t=!0===s.decay?.998:s.decay,r=Math.exp(-(1-t)*e);h=n+i/(1-t)*(1-r),l=Math.abs(a.lastPosition-h)<.1,o=i*r}else{o=null==a.lastVelocity?i:a.lastVelocity;const e=s.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),r=s.restVelocity||e/10,u=s.clamp?0:s.bounce,d=!v.und(u),p=n==c?a.v0>0:n<c;let f,m=!1;const g=1,y=Math.ceil(t/g);for(let t=0;t<y&&(f=Math.abs(o)>r,f||(l=Math.abs(c-h)<=e,!l));++t){d&&(m=h==c||h>c==p,m&&(o=-o*u,h=c)),o+=(1e-6*-s.tension*(h-c)+.001*-s.friction*o)/s.mass*g,h+=o*g}}else{let r=s.progress||0;s.duration<=0?r=1:r+=(1-r)*Math.min(1,e/s.duration),h=n+s.easing(r)*(c-n),o=(h-a.lastPosition)/t,l=1==r}a.lastVelocity=o,Number.isNaN(h)&&(console.warn("Got NaN while animating:",this),l=!0)}o&&!o[u].done&&(l=!1),l?a.done=!0:e=!1,a.setValue(h,s.round)&&(n=!0)}),e?this.finish():n&&this._onChange(this.get()),e}is(t){return this._phase==t}set(t){return O(()=>{if(this._focus(t),this._set(t)&&!this.is(se))return this._onChange(this.get(),!0);this._stop()}),this}pause(){oe(this,"pause"),this.is("PAUSED")||(this._phase="PAUSED",x(this._state.pauseQueue,t=>t()))}resume(){oe(this,"resume"),this.is("PAUSED")&&(this._start(),x(this._state.resumeQueue,t=>t()))}finish(t){if(this.resume(),this.is(se)){const e=this.animation;!e.config.decay&&v.und(t)&&(t=e.to),v.und(t)||this._set(t),O(()=>{e.changed||(e.changed=!0,e.onStart&&e.onStart(this)),this._stop()})}return this}update(t){return oe(this,"update"),(this.queue||(this.queue=[])).push(t),this}async start(t,e){let n;oe(this,"start"),v.und(t)?(n=this.queue||[],this.queue=[]):n=[v.obj(t)?t:U(U({},e),{},{to:t})];const r=await Promise.all(n.map(t=>this._update(t)));return Ht(this,r)}stop(t){return this.is("DISPOSED")||(Xt(this._state,this._lastCallId),this._focus(this.get()),O(()=>this._stop(t))),this}reset(){this._update({reset:!0})}dispose(){this.is("DISPOSED")||(this.animation&&(this.animation.onRest=[]),this.stop(),this._phase="DISPOSED")}onParentChange(t){super.onParentChange(t),"change"==t.type?this.is(se)||(this._reset(),this.is("PAUSED")||this._start()):"priority"==t.type&&(this.priority=t.priority+1)}_prepareNode({to:t,from:e,reverse:n}){const r=this.key||"",s={to:t=!v.obj(t)||L(t)?t:t[r],from:e=!v.obj(e)||L(e)?e:e[r]};if(this.is("CREATED")){n&&([t,e]=[e,t]),e=z(e);const r=this._updateNode(v.und(e)?z(t):e);r&&!v.und(e)&&r.setValue(e)}return s}_updateNode(t){let e=W(this);if(!v.und(t)){const n=this._getNodeType(t);e&&e.constructor===n||$(this,e=n.create(t))}return e}_getNodeType(t){const e=W(t);return e?e.constructor:v.arr(t)?X:w(t)?Z:Y}_update(t,e){const n=this._defaultProps,r=e=>{const r=Lt(t,e);v.und(r)||(n[e]=r),n[e]&&(t[e]=n[e])};r("cancel"),r("pause");const s=this._prepareNode(t);return Bt(++this._lastCallId,{key:this.key,props:t,state:this._state,actions:{pause:this.pause.bind(this),resume:this.resume.bind(this),start:this._merge.bind(this,s)}}).then(n=>{if(t.loop&&n.finished&&(!e||!n.noop)){const e=ce(t);if(e)return this._update(e,!0)}return n})}_merge(t,e,n){if(e.cancel)return this.stop(!0),n(Jt(this));const{key:r,animation:s}=this,i=this._defaultProps,o=!v.und(t.to),a=!v.und(t.from);if(o||a){if(!(e.callId>this._lastToId))return n(Jt(this));this._lastToId=e.callId}const u=t=>v.und(e[t])?i[t]:e[t],c=ae(u("onDelayEnd"),r);c&&c(e,this),e.default&&((t,e,n)=>{Qt(e,n,t)})(i,e,["pause","cancel"]);const{to:l,from:h}=s;let{to:d=l,from:p=h}=t;a&&!o&&(d=p),e.reverse&&([d,p]=[p,d]);const f=!_(p,h);f&&(s.from=p);const m=!_(d,l);m&&this._focus(d);const g=L(d),b=L(p);b&&(p=b.get());const k=v.arr(e.to)||v.fun(e.to),{config:x}=s,{decay:C,velocity:S}=x;e.config&&!k&&function(t,e,n){n&&(Rt(n=U({},n),e),e=U(U({},n),e)),Rt(t,e),Object.assign(t,e);for(const e in jt)null==t[e]&&(t[e]=jt[e]);let{mass:r,frequency:s,damping:i}=t;v.und(s)||(s<.01&&(s=.01),i<0&&(i=0),t.tension=Math.pow(2*Math.PI/s,2)*r,t.friction=4*Math.PI*i*r/s)}(x,Ft(e.config,r),e.config!==i.config?Ft(i.config,r):void 0);let A=W(this);if(!A||v.und(d))return n(Zt(this,!0));const I=v.und(e.reset)?a&&!e.default:!v.und(p)&&Dt(e.reset,r),E=I?p:this.get(),V=$t(d),j=v.num(V)||v.arr(V)||w(V),q=!k&&(!j||Dt(i.immediate||e.immediate,r));if(m)if(q)A=this._updateNode(V);else{const t=this._getNodeType(d);if(t!==A.constructor)throw Error("Cannot animate between "+A.constructor.name+" and "+t.name+', as the "to" prop suggests')}const R=A.constructor;let T=!!g,M=!1;if(!T){const t=I||this.is("CREATED")&&f;(m||t)&&(M=_($t(E),V),T=!M),_(x.decay,C)&&_(x.velocity,S)||(T=!0)}if(M&&this.is(se)&&(s.changed&&!I?T=!0:T||this._stop()),!k){(T||L(l))&&(s.values=A.getPayload(),s.toValues=g?null:R==Z?[1]:P(V)),s.immediate=q,s.onStart=ae(u("onStart"),r),s.onChange=ae(u("onChange"),r);const t=s.onRest,i=I&&!e.onRest?t[0]||y:ue(ae(u("onRest"),r),this);if(T){s.onRest=[i,ue(n,this)];let e=I?0:1;e<t.length&&O(()=>{for(;e<t.length;e++)t[e]()})}else(I||e.onRest)&&(s.onRest[0]=i)}const N=ae(u("onProps"),r);N&&N(e,this),I&&A.setValue(E),k?n(Kt(e.to,e,this._state,this)):T?(I&&(this._phase="IDLE"),this._reset(),this._start()):this.is(se)&&!m?s.onRest.push(ue(n,this)):n(Yt(this,E))}_focus(t){const e=this.animation;if(t!==e.to){let n=L(e.to);n&&n.removeChild(this),e.to=t;let r=0;(n=L(t))&&(n.addChild(this),ee(t)&&(r=(t.priority||0)+1)),this.priority=r}}_set(t){const e=L(t);e&&(t=e.get());const n=W(this),r=n&&n.getValue();return n?n.setValue(t):this._updateNode(t),!_(t,r)}_onChange(t,e=!1){const n=this.animation;n.changed||e||(n.changed=!0,n.onStart&&n.onStart(this)),n.onChange&&n.onChange(t,this),super._onChange(t,e)}_reset(){const t=this.animation;W(this).reset(t.to),this.is(se)||(t.changed=!1),t.immediate||(t.fromValues=t.values.map(t=>t.lastPosition)),super._reset()}_start(){this.is(se)||(this._phase=se,super._start(),E?this.finish():S.start(this))}_stop(t){if(this.resume(),this.is(se)){this._phase="IDLE",this._onChange(this.get(),!0);const e=this.animation;k(e.values,t=>{t.done=!0});const n=e.onRest;n.length&&(e.onRest=[e.toValues?y:n[0]],e.changed||(n[0]=y),k(n,e=>e(t)))}}}function oe(t,e){if(t.is("DISPOSED"))throw Error('Cannot call "'+e+'" of disposed "'+t.constructor.name+'" object')}function ae(t,e){return v.fun(t)?t:e&&t?t[e]:void 0}const ue=(t,e)=>{const{to:n}=e.animation;return t?r=>{if(r)t(Jt(e));else{const r=$t(n),s=_($t(e.get()),r);t(Zt(e,s))}}:y};function ce(t,e=t.loop,n=t.to){let r=Ft(e);if(r){const s=!0!==r&&Wt(r),i=(s||t).reverse,o=!s||s.reset;return le(U(U({},t),{},{loop:e,default:!1,to:!i||v.arr(n)||v.fun(n)?n:void 0,from:o?t.from:void 0,reset:o},s))}}function le(t){const{to:e,from:n}=t=Wt(t),r=new Set;return n?de(n,r):delete t.from,v.obj(e)?de(e,r):e||delete t.to,t.keys=r.size?Array.from(r):null,t}function he(t){const e=le(t);return v.und(e.default)&&(e.default=Qt(e,[!0===e.immediate&&"immediate"])),e}function de(t,e){k(t,(t,n)=>null!=t&&e.add(n))}const pe=["onStart","onChange","onRest"];let fe=1;class me{constructor(t,e){this.id=fe++,this.springs={},this.queue=[],this._flush=void 0,this._initialProps=void 0,this._phase="CREATED",this._lastAsyncId=0,this._active=new Set,this._state={pauseQueue:new Set,resumeQueue:new Set},this._events={onStart:new Set,onChange:new Set,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start(t)}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle)}is(t){return this._phase==t}get(){const t={};return this.each((e,n)=>t[n]=e.get()),t}update(t){return t&&this.queue.push(le(t)),this}start(t){const e=t?P(t).map(le):this.queue;return t||(this.queue=[]),this._flush?this._flush(this,e):(we(this,e),ge(this,e))}stop(t){if(v.und(t))this.each(t=>t.stop()),Xt(this._state,this._lastAsyncId);else{const e=this.springs;k(P(t),t=>e[t].stop())}return this}pause(t){if(v.und(t))this.each(t=>t.pause());else{const e=this.springs;k(P(t),t=>e[t].pause())}return this}resume(t){if(v.und(t))this.each(t=>t.resume());else{const e=this.springs;k(P(t),t=>e[t].resume())}return this}reset(){return this.each(t=>t.reset()),this}each(t){k(this.springs,t)}dispose(){this._state.asyncTo=void 0,this.each(t=>t.dispose()),this.springs={}}_onFrame(){const{onStart:t,onChange:e,onRest:n}=this._events,r=this._active.size>0;r&&this._phase!=se&&(this._phase=se,x(t,t=>t(this)));const s=(e.size||!r&&n.size)&&this.get();x(e,t=>t(s)),r||(this._phase="IDLE",x(n,([t,e])=>{e.value=s,t(e)}))}onParentChange(t){"change"==t.type&&(this._active[t.idle?"delete":"add"](t.parent),S.onFrame(this._onFrame))}}function ge(t,e){return Promise.all(e.map(e=>function t(e,n,r){const{to:s,loop:i,onRest:o}=n;i&&(n.loop=!1);const a=v.arr(s)||v.fun(s)?s:void 0;a?(n.to=void 0,n.onRest=void 0):k(pe,t=>{const r=n[t];if(v.fun(r)){const s=e._events[t];s instanceof Set?n[t]=()=>s.add(r):n[t]=({finished:t,cancelled:e})=>{const n=s.get(r);n?(t||(n.finished=!1),e&&(n.cancelled=!0)):s.set(r,{value:null,finished:t,cancelled:e})}}});const u=(n.keys||Object.keys(e.springs)).map(t=>e.springs[t].start(n)),c=e._state;a?u.push(Bt(++e._lastAsyncId,{props:n,state:c,actions:{pause:y,resume:y,start(t,n){t.onRest=o,t.cancel?((t,e)=>!v.und(Lt(t,e)))(t,"cancel")&&Xt(c,t.callId):n(Kt(a,t,c,e))}}})):n.keys||!0!==n.cancel||Xt(c,e._lastAsyncId);return Promise.all(u).then(o=>{const a=Ht(e,o);if(i&&a.finished&&(!r||!a.noop)){const r=ce(n,i,s);if(r)return we(e,[r]),t(e,r,!0)}return a})}(t,e))).then(e=>Ht(t,e))}function ye(t,e){const n=U({},t.springs);return e&&k(P(e),t=>{v.und(t.keys)&&(t=le(t)),v.obj(t.to)||(t=U(U({},t),{},{to:void 0})),be(n,t,t=>_e(t))}),n}function ve(t,e){k(e,(e,n)=>{t.springs[n]||(t.springs[n]=e,e.addChild(t))})}function _e(t,e){const n=new ie;return n.key=t,e&&n.addChild(e),n}function be(t,e,n){e.keys&&k(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function we(t,e){k(e,e=>{be(t.springs,e,e=>_e(e,t))})}const ke=o({}),Pe=t=>{let{children:e}=t,n=d(t,["children"]);const r=u(ke);n=Nt(()=>U(U({},r),n),[r,n.pause,n.cancel,n.immediate,n.config]);const{Provider:s}=ke;return i(s,{value:n},e)};Pe.Provider=ke.Provider,Pe.Consumer=ke.Consumer;const xe=()=>u(ke),Ce=t=>({get controllers(){return t()},update(e){return k(t(),(t,n)=>{t.update(zt(e,n,t))}),this},async start(e){const n=await Promise.all(t().map((t,n)=>{const r=zt(e,n,t);return t.start(r)}));return{value:n.map(t=>t.value),finished:n.every(t=>t.finished)}},stop:e=>k(t(),t=>t.stop(e)),pause:e=>k(t(),t=>t.pause(e)),resume:e=>k(t(),t=>t.resume(e))});function Se(t,e,s){const i=v.fun(e)&&e;i&&!s&&(s=[]);const o=r(0),u=M(),[c]=n(()=>({ctrls:[],queue:[],flush(t,e){const n=ye(t,e);return o.current>0&&!c.queue.length&&!Object.keys(n).some(e=>!t.springs[e])?ge(t,e):new Promise(r=>{ve(t,n),c.queue.push(()=>{r(ge(t,e))}),u()})}})),l=r(),h=[...c.ctrls],d=[],f=N(t)||0,m=h.slice(t,f);function g(t,n){for(let r=t;r<n;r++){const t=h[r]||(h[r]=new me(null,c.flush));let n=i?i(r,t):e[r];n&&(n=d[r]=he(n),0==r&&(l.current=n.ref,n.ref=void 0))}}Nt(()=>{h.length=t,g(f,t)},[t]),Nt(()=>{g(0,Math.min(f,t))},s);const y=a(()=>Ce(()=>c.ctrls),[]),_=h.map((t,e)=>ye(t,d[e])),b=xe();p(()=>{o.current++,c.ctrls=h,l.current&&(l.current.current=y);const{queue:t}=c;t.length&&(c.queue=[],k(t,t=>t())),k(m,t=>t.dispose()),k(h,(t,e)=>{ve(t,_[e]),t.start({default:b});const n=d[e];n&&(l.current?t.queue.push(n):t.start(n))})}),T(()=>()=>{k(c.ctrls,t=>t.dispose())});const w=_.map(t=>U({},t));return i||3==arguments.length?[w,y.start,y.stop]:w}function Ae(t,e){const n=v.fun(t),[[r],s,i]=Se(1,n?t:[t],n?e||[]:e);return n||2==arguments.length?[r,s,i]:r}function Ie(t,e,n){const r=v.fun(e)&&e;r&&!n&&(n=[]);const s=[],i=Se(t,(t,n)=>(s[t]=n,zt(e,t,n)),n||[{}]);if(p(()=>{const t=v.obj(e)&&e.reverse;for(let e=0;e<s.length;e++){const n=s[e+(t?1:-1)];n&&s[e].update({to:n.springs}).start()}},n),r||3==arguments.length){const t=i[1];return i[1]=it(e=>{const n=v.obj(e)&&e.reverse;return t((t,r)=>{const i=zt(e,t,r),o=s[t+(n?1:-1)];return o&&(i.to=o.springs),i})},n),i}return i[0]}const Ee="enter";function Ve(t,e,n){const{ref:s,reset:o,sort:u,trail:h=0,expires:d=!0}=e,f=P(t),m=[],g=Oe(f,e),y=r(null),_=o?null:y.current;p(()=>{y.current=m}),T(()=>()=>k(y.current,t=>{t.expired&&clearTimeout(t.expirationId),t.ctrl.dispose()}));const b=[];if(_&&k(_,(t,e)=>{t.expired?clearTimeout(t.expirationId):~(e=b[e]=g.indexOf(t.key))&&(m[e]=t)}),k(f,(t,e)=>{m[e]||(m[e]={key:g[e],item:t,phase:"mount",ctrl:new me})}),b.length){let t=-1;k(b,(n,r)=>{const s=_[r];~n?(t=m.indexOf(s),m[t]=U(U({},s),{},{item:f[n]})):e.leave&&m.splice(++t,0,s)})}v.fun(u)&&m.sort((t,e)=>u(t.item,e.item));let w=-h;const x=M(),C=Qt(e),S=new Map;k(m,(t,n)=>{const r=t.key,s=t.phase;let i,o;if("mount"==s)i=e.enter,o=Ee;else{const t=g.indexOf(r)<0;if("leave"!=s)if(t)i=e.leave,o="leave";else{if(!(i=e.update))return;o="update"}else{if(t)return;i=e.enter,o=Ee}}if(i=Ft(i,t.item,n),i=v.obj(i)?Wt(i):{to:i},!i.config){const r=e.config||C.config;i.config=Ft(r,t.item,n)}const a=U(U({},C),{},{delay:w+=h,reset:!1},i);if(o==Ee&&v.und(a.from)){const r=v.und(e.initial)||_?e.from:e.initial;a.from=Ft(r,t.item,n)}const{onRest:u}=a;a.onRest=t=>{const e=y.current,n=e.find(t=>t.key===r);if(n)if(v.fun(u)&&u(t,n),t.cancelled&&"update"!=n.phase)n.phase=s;else if(n.ctrl.idle){const t=e.every(t=>t.ctrl.idle);if("leave"==n.phase){const e=Ft(d,n.item);if(!1!==e){const r=!0===e?0:e;if(n.expired=!0,!t&&r>0)return void(r<=2147483647&&(n.expirationId=setTimeout(x,r)))}}t&&e.some(t=>t.expired)&&x()}};const c=ye(t.ctrl,a);S.set(t,{phase:o,springs:c,payload:a})});const A=xe();p(()=>{k(m,t=>{t.ctrl.start({default:A})})},[A]);const I=a(()=>Ce(()=>y.current.map(t=>t.ctrl)),[]);c(s,()=>I),p(()=>{k(S,({phase:t,springs:e,payload:n},r)=>{ve(r.ctrl,e),A.cancel||(r.phase=t,t==Ee&&r.ctrl.start({default:A}),r.ctrl[s?"update":"start"](n))})},o?void 0:n);const E=t=>i(l,null,m.map((e,n)=>{const{springs:r}=S.get(e)||e.ctrl,s=t(U({},r),e.item,e,n);return s&&s.type?i(s.type,U({},s.props,{key:v.str(e.key)||v.num(e.key)?e.key:e.ctrl.id,ref:s.ref})):s}));return 3==arguments.length?[E,I.start,I.stop]:E}function Oe(t,{key:e,keys:n=e}){return v.und(n)?t:v.fun(n)?t.map(n):P(n)}class je extends re{constructor(t,e){super(),this.source=t,this.key=void 0,this.idle=!0,this.calc=void 0,this.calc=F(...e);const n=this._get(),r=v.arr(n)?X:Y;$(this,r.create(n))}advance(t){const e=this._get();_(e,this.get())||(W(this).setValue(e),this._onChange(e,this.idle))}_get(){const t=v.arr(this.source)?this.source.map(t=>t.get()):P(this.source.get());return this.calc(...t)}_reset(){k(B(this),t=>t.reset()),super._reset()}_start(){this.idle=!1,super._start(),E?(this.idle=!0,this.advance()):S.start(this)}_attach(){let t=!0,e=1;k(P(this.source),n=>{ee(n)&&(n.idle||(t=!1),e=Math.max(e,n.priority+1)),n.addChild(this)}),this.priority=e,t||(this._reset(),this._start())}_detach(){k(P(this.source),t=>{t.removeChild(this)}),this.idle=!0}onParentChange(t){"start"==t.type?this.advance():"change"==t.type?this.idle?this.advance():t.idle&&(this.idle=P(this.source).every(t=>!1!==t.idle),this.idle&&(this.advance(),k(B(this),t=>{t.done=!0}))):"priority"==t.type&&(this.priority=P(this.source).reduce((t,e)=>Math.max(t,(e.priority||0)+1),0)),super.onParentChange(t)}}const qe=(t,...e)=>(at(),new je(t,e));q({createStringInterpolator:Vt,to:(t,e)=>new je(t,e)});const Re=/^--/;function Te(t,e){return null==e||"boolean"==typeof e||""===e?"":"number"!=typeof e||0===e||Re.test(t)||Ne.hasOwnProperty(t)&&Ne[t]?(""+e).trim():e+"px"}const Me={};let Ne={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const Fe=["Webkit","Ms","Moz","O"];Ne=Object.keys(Ne).reduce((t,e)=>(Fe.forEach(n=>t[((t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1))(n,e)]=t[e]),t),Ne);const De=/^(matrix|translate|scale|rotate|skew)/,ze=/^(translate)/,Le=/^(rotate|skew)/,Qe=(t,e)=>v.num(t)&&0!==t?t+e:t,Ue=(t,e)=>v.arr(t)?t.every(t=>Ue(t,e)):v.num(t)?t===e:parseFloat(t)===e;class Ge extends K{constructor(t){let{x:e,y:n,z:r}=t,s=d(t,["x","y","z"]);const i=[],o=[];(e||n||r)&&(i.push([e||0,n||0,r||0]),o.push(t=>["translate3d("+t.map(t=>Qe(t,"px")).join(",")+")",Ue(t,0)])),k(s,(t,e)=>{if("transform"===e)i.push([t||""]),o.push(t=>[t,""===t]);else if(De.test(e)){if(delete s[e],v.und(t))return;const n=ze.test(e)?"px":Le.test(e)?"deg":"";i.push(P(t)),o.push("rotate3d"===e?([t,e,r,s])=>["rotate3d("+t+","+e+","+r+","+Qe(s,n)+")",Ue(s,0)]:t=>[e+"("+t.map(t=>Qe(t,n)).join(",")+")",Ue(t,e.startsWith("scale")?1:0)])}}),i.length&&(s.transform=new We(i,o)),super(s)}}class We extends Q{constructor(t,e){super(),this.inputs=t,this.transforms=e,this._value=null,this._children=new Set}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return k(this.inputs,(n,r)=>{const s=z(n[0]),[i,o]=this.transforms[r](v.arr(s)?s:n.map(z));t+=" "+i,e=e&&o}),e?"none":t}addChild(t){this._children.size||k(this.inputs,t=>k(t,t=>{const e=L(t);e&&e.addChild(this)})),this._children.add(t)}removeChild(t){this._children.delete(t),this._children.size||k(this.inputs,t=>k(t,t=>{const e=L(t);e&&e.removeChild(this)}))}onParentChange(t){"change"==t.type&&(this._value=null),k(this._children,e=>{e.onParentChange(t)})}}q({colorNames:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},createStringInterpolator:Vt,batchedUpdates:h});const $e=((t,{applyAnimatedValues:e=(()=>!1),createAnimatedStyle:n=(t=>new K(t)),getComponentProps:r=(t=>t)}={})=>{const s={applyAnimatedValues:e,createAnimatedStyle:n,getComponentProps:r},i=t=>{const e=rt(t)||"Anonymous";return(t=v.str(t)?et(t,s):t[nt]||(t[nt]=et(t,s))).displayName="Animated("+e+")",t};return k(t,(t,e)=>{v.str(e)||(e=rt(t)),i[e]=i(t)}),{animated:i}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(t,e){if(!t.nodeType||!t.setAttribute)return!1;const n="filter"===t.nodeName||t.parentNode&&"filter"===t.parentNode.nodeName,r=e,{style:s,children:i,scrollTop:o,scrollLeft:a}=r,u=d(r,["style","children","scrollTop","scrollLeft"]),c=Object.values(u),l=Object.keys(u).map(e=>n||t.hasAttribute(e)?e:Me[e]||(Me[e]=e.replace(/([A-Z])/g,t=>"-"+t.toLowerCase())));S.onWrite(()=>{void 0!==i&&(t.textContent=i);for(let e in s)if(s.hasOwnProperty(e)){const n=Te(e,s[e]);"float"===e?e="cssFloat":Re.test(e)?t.style.setProperty(e,n):t.style[e]=n}l.forEach((e,n)=>{t.setAttribute(e,c[n])}),void 0!==o&&(t.scrollTop=o),void 0!==a&&(t.scrollLeft=a)})},createAnimatedStyle:t=>new Ge(t),getComponentProps:t=>d(t,["scrollTop","scrollLeft"])}).animated;var Be=!("undefined"!=typeof window&&window.location&&window.location.href&&window.matchMedia)||Boolean(new URL(window.location.href).searchParams.get("eyes-storybook")),He=function(){return Be?{matches:!0,addListener:function(){},removeListener:function(){}}:window.matchMedia("(prefers-reduced-motion: reduce)")};function Ye(){var t=n(He().matches),r=t[0],s=t[1];return e((function(){var t=He(),e=function(){s(t.matches)};return t.addListener(e),function(){t.removeListener(e)}}),[]),r}export{R as Globals,$e as animated,qe as interpolate,Be as isRenderingOnServer,Ot as useChain,Ye as useReducedMotion,Ae as useSpring,Se as useSprings,Ie as useTrail,Ve as useTransition}; |
@@ -1,15 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("react-dom");function n(t,e){if(null==t)return{};var n,r,s={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(s[n]=t[n]);return s}var r="undefined"!=typeof window&&window.document&&window.document.createElement?t.useLayoutEffect:t.useEffect,s=function(t){return b(t)},i=function(t){void 0===t&&(t=s);var e=!0,n=!1,r=0,i=[],a=0,u=new Set,c=new Set,l=new Set,h=function(t){var e=i.indexOf(t);e<0&&(e=i.findIndex((function(e){return e.priority>t.priority})),i.splice(~e?e:i.length,0,t))},d=function(){if(!e)try{m(),t(d)}catch(t){console.error(t)}},p=function(){e&&(e=!1,0==r&&(r=y(),t(d)))},f=[];this.setTimeout=function(t,e){var n=y()+e,r=function(){var t=f.findIndex((function(t){return t.cancel==r}));t>=0&&f.splice(t,1)},s=o(f,(function(t){return t.time>n})),i={time:n,handler:t,cancel:r};return f.splice(s,0,i),p(),i};var m=this.advance=function(){var t=y();if(u.size&&(u.forEach(h),u.clear()),f.length&&w((function(){var e=o(f,(function(e){return e.time>t}));f.splice(0,e).forEach((function(t){return t.handler()}))})),t>r){var e=Math.min(64,t-r);r=t,w((function(){i.length&&(k(i),i=i.filter((function(t){return a=t.priority,t.idle||t.advance(e),!t.idle})),a=0),c.size&&(c.forEach((function(e){return e(t)})),c.clear()),l.size&&(n=!0,l.forEach((function(e){return e(t)})),l.clear(),n=!1)}))}};if(this.start=function(t){a>t.priority?u.add(t):(h(t),p())},this.onFrame=function(t){c.add(t),p()},this.onWrite=function(t){n?t(r):l.add(t)},"undefined"!=typeof process&&"production"!==process.env.NODE_ENV){var g=function(){e=!0,u.clear(),f.length=0};Object.defineProperties(this,{_animations:{get:function(){return i}},_dispose:{get:function(){return g}}})}};function o(t,e){var n=t.findIndex(e);return n<0?t.length:n}var a=function(){},u={arr:Array.isArray,obj:function(t){return!!t&&"Object"===t.constructor.name},fun:function(t){return"function"==typeof t},str:function(t){return"string"==typeof t},num:function(t){return"number"==typeof t},und:function(t){return void 0===t}};function c(t,e){if(u.arr(t)){if(!u.arr(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}return t===e}var l,h=function(t){return u.str(t)&&("#"==t[0]||/\d/.test(t)||!(!v||!v[t]))},d=function(t,e,n){u.fun(t.forEach)?t.forEach(e,n):Object.keys(t).forEach((function(r){return e.call(n,t[r],r)}))},p=function(t){return u.und(t)?[]:u.arr(t)?t:[t]};function f(t,e){if(t.size){var n=Array.from(t);t.clear(),d(n,e)}}var m,g=new i,y=function(){return performance.now()},v=null,_=!1,b="undefined"!=typeof window?window.requestAnimationFrame:function(){return-1},w=function(t){return t()},k=a,x=function(t){var e;return e=Object.assign({to:m,now:y,frameLoop:g,colorNames:v,skipAnimation:_,createStringInterpolator:l,requestAnimationFrame:b,batchedUpdates:w,willAdvance:k},function(t){var e={};for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}(t)),m=e.to,y=e.now,g=e.frameLoop,v=e.colorNames,_=e.skipAnimation,l=e.createStringInterpolator,b=e.requestAnimationFrame,w=e.batchedUpdates,k=e.willAdvance,e};var P=Object.freeze({__proto__:null,get createStringInterpolator(){return l},get frameLoop(){return g},get to(){return m},get now(){return y},get colorNames(){return v},get skipAnimation(){return _},get requestAnimationFrame(){return b},get batchedUpdates(){return w},get willAdvance(){return k},assign:x}),C=function(e){return t.useEffect(e,[])},S=function(){var e=t.useState(0)[1],n=t.useRef(!1);return C((function(){return function(){n.current=!0}})),function(){n.current||e({})}};function E(e){var n=t.useRef(void 0);return t.useEffect((function(){n.current=e})),n.current}var A=function(t,e,n){if(u.fun(t))return t;if(u.arr(t))return A({range:t,output:e,extrapolate:n});if(u.str(t.output[0]))return l(t);var r=t,s=r.output,i=r.range||[0,1],o=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||function(t){return t};return function(t){var e=function(t,e){for(var n=1;n<e.length-1&&!(e[n]>=t);++n);return n-1}(t,i);return function(t,e,n,r,s,i,o,a,u){var c=u?u(t):t;if(c<e){if("identity"===o)return c;"clamp"===o&&(c=e)}if(c>n){if("identity"===a)return c;"clamp"===a&&(c=n)}if(r===s)return r;if(e===n)return t<=e?r:s;e===-1/0?c=-c:n===1/0?c-=e:c=(c-e)/(n-e);c=i(c),r===-1/0?c=-c:s===1/0?c+=r:c=c*(s-r)+r;return c}(t,i[e],i[e+1],s[e],s[e+1],c,o,a,r.map)}};var I=Symbol.for("FluidValue:config");function V(t){var e=R(t);return e?e.get():t}function R(t){if(t)return t[I]}var O=function(){!function(t,e){Object.defineProperty(t,I,{value:e,configurable:!0})}(this,this)};function j(){return(j=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}const q=Symbol.for("Animated:node"),T=t=>t&&t[q],M=(t,e)=>{return n=t,r=q,s=e,Object.defineProperty(n,r,{value:s,writable:!0,configurable:!0});var n,r,s},N=t=>t&&t[q]&&t[q].getPayload();class F{constructor(){this.payload=void 0,M(this,this)}getPayload(){return this.payload||[]}}class D extends F{constructor(t){super(),this._value=t,this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,u.num(this._value)&&(this.lastPosition=this._value)}static create(t,e){return new D(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return u.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value!==t&&(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,u.num(this._value)&&(this.elapsedTime=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}}class z extends D{constructor(t,e){super(0),this._value=void 0,this._string=null,this._toString=void 0,this._toString=A({output:[t,e]})}static create(t,e=t){if(u.str(t)&&u.str(e))return new z(t,e);throw TypeError('Expected "from" and "to" to be strings')}getValue(){let t=this._string;return null==t?this._string=this._toString(this._value):t}setValue(t){if(u.num(t)){if(!super.setValue(t))return!1;this._string=null}else this._string=t,this._value=1;return!0}reset(t){t&&(this._toString=A({output:[this.getValue(),t]})),this._value=0,super.reset()}}const L={current:null};class Q extends F{constructor(t=null){super(),this.source=void 0,this.setValue(t)}getValue(t){if(!this.source)return null;const e={};return d(this.source,(n,r)=>{if((s=n)&&s[q]===s)e[r]=n.getValue(t);else{const s=R(n);s?e[r]=s.get():t||(e[r]=n)}var s}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&d(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return d(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){R(t)&&L.current&&L.current.dependencies.add(t);const e=N(t);e&&d(e,t=>this.add(t))}}class U extends Q{constructor(t,e){super(null),this.source=void 0,super.setValue(this._makeAnimated(t,e))}static create(t,e){return new U(t,e)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();t&&t.length==e.length?d(e,(e,n)=>e.setValue(t[n])):(this.source=this._makeAnimated(t),this.payload=this._makePayload(this.source))}_makeAnimated(t,e=t){return t?t.map((t,n)=>(h(t)?z:D).create(t,e[n])):[]}}class G extends Q{constructor(t){super(null),this.update=t,this.dirty=!1}setValue(t,e){if(t){if(e&&(L.current=e,t.style)){const{createAnimatedStyle:n}=e.host;t=j(j({},t),{},{style:n(t.style)})}super.setValue(t),L.current=null}}onParentChange({type:t}){this.dirty||"change"!==t||(this.dirty=!0,g.onFrame(()=>{this.dirty=!1,this.update()}))}}const W=(e,n)=>t.forwardRef((s,i)=>{const o=t.useRef(null),a=!u.fun(e)||e.prototype&&e.prototype.isReactComponent,c=S(),l=new G(()=>{const t=o.current;a&&!t||!1===(!!t&&n.applyAnimatedValues(t,l.getValue(!0)))&&c()}),h=new Set;return l.setValue(s,{dependencies:h,host:n}),r(()=>(d(h,t=>t.addChild(l)),()=>d(h,t=>t.removeChild(l)))),t.createElement(e,j({},n.getComponentProps(l.getValue()),{ref:a&&(t=>{o.current=function(t,e){t&&(u.fun(t)?t(e):t.current=e);return e}(i,t)})}))});const $=Symbol.for("AnimatedComponent"),B=t=>u.str(t)?t:t&&u.str(t.displayName)?t.displayName:u.fun(t)&&t.name||null;function H(e,n){var r=t.useState((function(){return{inputs:n,result:e()}}))[0],s=t.useRef(r),i=Boolean(n&&s.current.inputs&&function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}(n,s.current.inputs))?s.current:{inputs:n,result:e()};return t.useEffect((function(){s.current=i}),[i]),i.result}function Y(t,e){return H((function(){return t}),e)}var Z=!1;function J(){Z||(Z=!0,console.warn('react-spring: The "interpolate" function is deprecated in v10 (use "to" instead)'))} | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */var K=function(){return(K=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)},X="[-+]?\\d*\\.?\\d+";function tt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var et=new RegExp("rgb"+tt(X,X,X)),nt=new RegExp("rgba"+tt(X,X,X,X)),rt=new RegExp("hsl"+tt(X,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),st=new RegExp("hsla"+tt(X,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",X)),it=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ot=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,at=/^#([0-9a-fA-F]{6})$/,ut=/^#([0-9a-fA-F]{8})$/;function ct(t,e,n){var r=(1-Math.abs(2*n-1))*e,s=n-r/2,i=function(t,e,n){return t<60?[e,n,0]:t<120?[n,e,0]:t<180?[0,e,n]:t<240?[0,n,e]:t<300?[n,0,e]:[e,0,n]}(t,r,r*(1-Math.abs(t/60%2-1))),o=i[0],a=i[1],u=i[2];return Math.round(255*(o+s))<<24|Math.round(255*(a+s))<<16|Math.round(255*(u+s))<<8}function lt(t){var e=parseInt(t,10);return e<0?0:e>255?255:e}function ht(t){return(parseFloat(t)%360+360)%360/360}function dt(t){var e=parseFloat(t);return e<0?0:e>1?255:Math.round(255*e)}function pt(t){var e=parseFloat(t);return e<0?0:e>100?1:e/100}function ft(t){var e,n,r="number"==typeof(e=t)?e>>>0===e&&e>=0&&e<=4294967295?e:null:(n=at.exec(e))?parseInt(n[1]+"ff",16)>>>0:v&&void 0!==v[e]?v[e]:(n=et.exec(e))?(lt(n[1])<<24|lt(n[2])<<16|lt(n[3])<<8|255)>>>0:(n=nt.exec(e))?(lt(n[1])<<24|lt(n[2])<<16|lt(n[3])<<8|dt(n[4]))>>>0:(n=it.exec(e))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0:(n=ut.exec(e))?parseInt(n[1],16)>>>0:(n=ot.exec(e))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=rt.exec(e))?(255|ct(ht(n[1]),pt(n[2]),pt(n[3])))>>>0:(n=st.exec(e))?(ct(ht(n[1]),pt(n[2]),pt(n[3]))|dt(n[4]))>>>0:null;return null===r?t:"rgba("+((4278190080&(r=r||0))>>>24)+", "+((16711680&r)>>>16)+", "+((65280&r)>>>8)+", "+(255&r)/255+")"}var mt,gt=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,yt=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,vt=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,_t=function(t,e,n,r,s){return"rgba("+Math.round(e)+", "+Math.round(n)+", "+Math.round(r)+", "+s+")"},bt=function(t){mt||(mt=v?new RegExp("("+Object.keys(v).join("|")+")","g"):/^\b$/);var e=t.output.map((function(t){return V(t).replace(yt,ft).replace(mt,ft)})),n=e.map((function(t){return t.match(gt).map(Number)})),r=n[0].map((function(t,e){return n.map((function(t){if(!(e in t))throw Error('The arity of each "output" value must be equal');return t[e]}))})).map((function(e){return A(K(K({},t),{output:e}))}));return function(t){var n=0;return e[0].replace(gt,(function(){return String(r[n++](t))})).replace(vt,_t)}};const wt=j(j({},{tension:170,friction:26}),{},{mass:1,damping:1,easing:t=>t,clamp:!1});class kt{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,wt)}}function xt(t,e){if(u.und(e.decay)){const n=!u.und(e.tension)||!u.und(e.friction);!n&&u.und(e.frequency)&&u.und(e.damping)&&u.und(e.mass)||(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}else t.duration=void 0}const Pt=[];class Ct{constructor(){this.changed=!1,this.values=Pt,this.toValues=null,this.fromValues=Pt,this.to=void 0,this.from=void 0,this.config=new kt,this.immediate=!1,this.onStart=void 0,this.onChange=void 0,this.onRest=[]}}const St=(t,e)=>H(t,e||[{}]);function Et(t,...e){return u.fun(t)?t(...e):t}const At=(t,e)=>!0===t||!!(e&&t&&(u.fun(t)?t(e):p(t).includes(e))),It=(t,e,n)=>t&&(u.fun(t)?t(e,n):u.arr(t)?t[e]:j({},t)),Vt=(t,e)=>!0===t.default?t[e]:t.default?t.default[e]:void 0,Rt=(t,e=[],n={})=>{let r=Ot;t.default&&!0!==t.default&&(t=t.default,r=Object.keys(t));for(const s of r){const r=t[s];u.und(r)||e.includes(s)||(n[s]=r)}return n},Ot=["pause","cancel","config","immediate","onDelayEnd","onProps","onStart","onChange","onRest"],jt={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onDelayEnd:1,onProps:1,onStart:1,onChange:1,onRest:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,keys:1,callId:1,parentId:1};function qt(t){const e=function(t){const e={};let n=0;if(d(t,(t,r)=>{jt[r]||(e[r]=t,n++)}),n)return e}(t);if(e){const n={to:e};return d(t,(t,r)=>r in e||(n[r]=t)),n}return j({},t)}function Tt(t){const e=R(t);return e?Tt(e.get()):u.arr(t)?t.map(Tt):h(t)?l({range:[0,1],output:[t,t]})(1):t}function Mt(t,{key:e,props:n,state:r,actions:s}){return new Promise((i,o)=>{let a,u,c=!1,l=At(n.cancel,e);function h(){r.resumeQueue.add(d),u.cancel(),a=u.time-y()}function d(){a>0?(r.pauseQueue.add(h),u=g.setTimeout(p,a)):p()}function p(){r.pauseQueue.delete(h),t<=(r.cancelId||0)&&(l=!0);try{s.start(j(j({},n),{},{callId:t,delay:a,cancel:l,pause:c}),i)}catch(t){o(t)}}l?p():(a=Et(n.delay||0,e),c=At(n.pause,e),c?(r.resumeQueue.add(d),s.pause()):(s.resume(),d()))})}const Nt=(t,e)=>1==e.length?e[0]:e.some(t=>t.cancelled)?zt(t):e.every(t=>t.noop)?Ft(t):Dt(t,e.every(t=>t.finished)),Ft=(t,e=t.get())=>({value:e,noop:!0,finished:!0,target:t}),Dt=(t,e,n=t.get())=>({value:n,finished:e,target:t}),zt=(t,e=t.get())=>({value:e,cancelled:!0,target:t});async function Lt(t,e,n,r){e.pause&&await new Promise(t=>{n.resumeQueue.add(t)});const{callId:s,parentId:i,onRest:o}=e,{asyncTo:a,promise:c}=n;return i||t!==a||e.reset?n.promise=(async()=>{n.asyncId=s,n.asyncTo=t;const l=Rt(e,["onRest"]);let h,p;const f=new Promise((t,e)=>(h=t,p=e)),m=t=>{const e=s<=(n.cancelId||0)&&zt(r)||s!==n.asyncId&&Dt(r,!1);if(e)throw t.result=e,t},g=(y=(t,e)=>{const i=new Ut;m(i);const o=u.obj(t)?j({},t):j(j({},e),{},{to:t});return o.parentId=s,d(l,(t,e)=>{u.und(o[e])&&(o[e]=t)}),r.start(o).then(async t=>(m(i),r.is("PAUSED")&&await new Promise(t=>{n.resumeQueue.add(t)}),t))},(...t)=>{const e=t=>{throw t instanceof Ut&&p(t),t};try{return y(...t).catch(e)}catch(t){e(t)}});var y;let v;try{let e;u.arr(t)?e=(async t=>{for(const e of t)await g(e)})(t):u.fun(t)&&(e=Promise.resolve(t(g,r.stop.bind(r)))),await Promise.all([e.then(h),f]),v=Dt(r,!0)}catch(t){if(!(t instanceof Ut))throw t;v=t.result}finally{s==n.asyncId&&(n.asyncId=i,n.asyncTo=i?a:void 0,n.promise=i?c:void 0)}return u.fun(o)&&w(()=>{o(v)}),v})():c}function Qt(t,e){t.cancelId=e,t.asyncId=t.asyncTo=t.promise=void 0}class Ut extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}const Gt=t=>t instanceof $t;let Wt=1;class $t extends O{constructor(...t){super(...t),this.id=Wt++,this.key=void 0,this._priority=0,this._children=new Set}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=T(this);return t&&t.getValue()}to(...t){return m(this,t)}interpolate(...t){return J(),m(this,t)}addChild(t){this._children.size||this._attach(),this._children.add(t)}removeChild(t){this._children.delete(t),this._children.size||this._detach()}onParentChange({type:t}){this.idle?"start"==t&&(this._reset(),this._start()):"reset"==t&&this._reset()}_attach(){}_detach(){}_reset(){this._emit({type:"reset",parent:this})}_start(){this._emit({type:"start",parent:this})}_onChange(t,e=!1){this._emit({type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||g.start(this),this._emit({type:"priority",parent:this,priority:t})}_emit(t){d(Array.from(this._children),e=>{e.onParentChange(t)})}}const Bt="ACTIVE";class Ht extends $t{constructor(t,e){if(super(),this.key=void 0,this.animation=new Ct,this.queue=void 0,this._phase="CREATED",this._state={pauseQueue:new Set,resumeQueue:new Set},this._defaultProps={},this._lastCallId=0,this._lastToId=0,!u.und(t)||!u.und(e)){const n=u.obj(t)?j({},t):j(j({},e),{},{from:t});n.default=!0,this.start(n)}}get idle(){return!this.is(Bt)&&!this._state.asyncTo}get goal(){return V(this.animation.to)}get velocity(){const t=T(this);return t instanceof D?t.lastVelocity||0:t.getPayload().map(t=>t.lastVelocity||0)}advance(t){let e=!0,n=!1;const r=this.animation;let{config:s,toValues:i}=r;const o=N(r.to);if(!o){const t=R(r.to);t&&(i=p(t.get()))}return r.values.forEach((a,c)=>{if(a.done)return;let l=o?o[c].lastPosition:i[c],h=r.immediate,d=l;if(!h){if(d=a.lastPosition,s.tension<=0)return void(a.done=!0);const e=a.elapsedTime+=t,n=r.fromValues[c],i=null!=a.v0?a.v0:a.v0=u.arr(s.velocity)?s.velocity[c]:s.velocity;let o;if(u.und(s.duration))if(s.decay){const t=!0===s.decay?.998:s.decay,r=Math.exp(-(1-t)*e);d=n+i/(1-t)*(1-r),h=Math.abs(a.lastPosition-d)<.1,o=i*r}else{o=null==a.lastVelocity?i:a.lastVelocity;const e=s.precision||(n==l?.005:Math.min(1,.001*Math.abs(l-n))),r=s.restVelocity||e/10,c=s.clamp?0:s.bounce,p=!u.und(c),f=n==l?a.v0>0:n<l;let m,g=!1;const y=1,v=Math.ceil(t/y);for(let t=0;t<v&&(m=Math.abs(o)>r,m||(h=Math.abs(l-d)<=e,!h));++t){p&&(g=d==l||d>l==f,g&&(o=-o*c,d=l)),o+=(1e-6*-s.tension*(d-l)+.001*-s.friction*o)/s.mass*y,d+=o*y}}else{let r=s.progress||0;s.duration<=0?r=1:r+=(1-r)*Math.min(1,e/s.duration),d=n+s.easing(r)*(l-n),o=(d-a.lastPosition)/t,h=1==r}a.lastVelocity=o,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),h=!0)}o&&!o[c].done&&(h=!1),h?a.done=!0:e=!1,a.setValue(d,s.round)&&(n=!0)}),e?this.finish():n&&this._onChange(this.get()),e}is(t){return this._phase==t}set(t){return w(()=>{if(this._focus(t),this._set(t)&&!this.is(Bt))return this._onChange(this.get(),!0);this._stop()}),this}pause(){Yt(this,"pause"),this.is("PAUSED")||(this._phase="PAUSED",f(this._state.pauseQueue,t=>t()))}resume(){Yt(this,"resume"),this.is("PAUSED")&&(this._start(),f(this._state.resumeQueue,t=>t()))}finish(t){if(this.resume(),this.is(Bt)){const e=this.animation;!e.config.decay&&u.und(t)&&(t=e.to),u.und(t)||this._set(t),w(()=>{e.changed||(e.changed=!0,e.onStart&&e.onStart(this)),this._stop()})}return this}update(t){return Yt(this,"update"),(this.queue||(this.queue=[])).push(t),this}async start(t,e){let n;Yt(this,"start"),u.und(t)?(n=this.queue||[],this.queue=[]):n=[u.obj(t)?t:j(j({},e),{},{to:t})];const r=await Promise.all(n.map(t=>this._update(t)));return Nt(this,r)}stop(t){return this.is("DISPOSED")||(Qt(this._state,this._lastCallId),this._focus(this.get()),w(()=>this._stop(t))),this}reset(){this._update({reset:!0})}dispose(){this.is("DISPOSED")||(this.animation&&(this.animation.onRest=[]),this.stop(),this._phase="DISPOSED")}onParentChange(t){super.onParentChange(t),"change"==t.type?this.is(Bt)||(this._reset(),this.is("PAUSED")||this._start()):"priority"==t.type&&(this.priority=t.priority+1)}_prepareNode({to:t,from:e,reverse:n}){const r=this.key||"",s={to:t=!u.obj(t)||R(t)?t:t[r],from:e=!u.obj(e)||R(e)?e:e[r]};if(this.is("CREATED")){n&&([t,e]=[e,t]),e=V(e);const r=this._updateNode(u.und(e)?V(t):e);r&&!u.und(e)&&r.setValue(e)}return s}_updateNode(t){let e=T(this);if(!u.und(t)){const n=this._getNodeType(t);e&&e.constructor===n||M(this,e=n.create(t))}return e}_getNodeType(t){const e=T(t);return e?e.constructor:u.arr(t)?U:h(t)?z:D}_update(t,e){const n=this._defaultProps,r=e=>{const r=Vt(t,e);u.und(r)||(n[e]=r),n[e]&&(t[e]=n[e])};r("cancel"),r("pause");const s=this._prepareNode(t);return Mt(++this._lastCallId,{key:this.key,props:t,state:this._state,actions:{pause:this.pause.bind(this),resume:this.resume.bind(this),start:this._merge.bind(this,s)}}).then(n=>{if(t.loop&&n.finished&&(!e||!n.noop)){const e=Kt(t);if(e)return this._update(e,!0)}return n})}_merge(t,e,n){if(e.cancel)return this.stop(!0),n(zt(this));const{key:r,animation:s}=this,i=this._defaultProps,o=!u.und(t.to),l=!u.und(t.from);if(o||l){if(!(e.callId>this._lastToId))return n(zt(this));this._lastToId=e.callId}const d=t=>u.und(e[t])?i[t]:e[t],f=Zt(d("onDelayEnd"),r);f&&f(e,this),e.default&&((t,e,n)=>{Rt(e,n,t)})(i,e,["pause","cancel"]);const{to:m,from:g}=s;let{to:y=m,from:v=g}=t;l&&!o&&(y=v),e.reverse&&([y,v]=[v,y]);const _=!c(v,g);_&&(s.from=v);const b=!c(y,m);b&&this._focus(y);const k=R(y),x=R(v);x&&(v=x.get());const P=u.arr(e.to)||u.fun(e.to),{config:C}=s,{decay:S,velocity:E}=C;e.config&&!P&&function(t,e,n){n&&(xt(n=j({},n),e),e=j(j({},n),e)),xt(t,e),Object.assign(t,e);for(const e in wt)null==t[e]&&(t[e]=wt[e]);let{mass:r,frequency:s,damping:i}=t;u.und(s)||(s<.01&&(s=.01),i<0&&(i=0),t.tension=Math.pow(2*Math.PI/s,2)*r,t.friction=4*Math.PI*i*r/s)}(C,Et(e.config,r),e.config!==i.config?Et(i.config,r):void 0);let A=T(this);if(!A||u.und(y))return n(Dt(this,!0));const I=u.und(e.reset)?l&&!e.default:!u.und(v)&&At(e.reset,r),V=I?v:this.get(),O=Tt(y),q=u.num(O)||u.arr(O)||h(O),M=!P&&(!q||At(i.immediate||e.immediate,r));if(b)if(M)A=this._updateNode(O);else{const t=this._getNodeType(y);if(t!==A.constructor)throw Error("Cannot animate between "+A.constructor.name+" and "+t.name+', as the "to" prop suggests')}const N=A.constructor;let F=!!k,D=!1;if(!F){const t=I||this.is("CREATED")&&_;(b||t)&&(D=c(Tt(V),O),F=!D),c(C.decay,S)&&c(C.velocity,E)||(F=!0)}if(D&&this.is(Bt)&&(s.changed&&!I?F=!0:F||this._stop()),!P){(F||R(m))&&(s.values=A.getPayload(),s.toValues=k?null:N==z?[1]:p(O)),s.immediate=M,s.onStart=Zt(d("onStart"),r),s.onChange=Zt(d("onChange"),r);const t=s.onRest,i=I&&!e.onRest?t[0]||a:Jt(Zt(d("onRest"),r),this);if(F){s.onRest=[i,Jt(n,this)];let e=I?0:1;e<t.length&&w(()=>{for(;e<t.length;e++)t[e]()})}else(I||e.onRest)&&(s.onRest[0]=i)}const L=Zt(d("onProps"),r);L&&L(e,this),I&&A.setValue(V),P?n(Lt(e.to,e,this._state,this)):F?(I&&(this._phase="IDLE"),this._reset(),this._start()):this.is(Bt)&&!b?s.onRest.push(Jt(n,this)):n(Ft(this,V))}_focus(t){const e=this.animation;if(t!==e.to){let n=R(e.to);n&&n.removeChild(this),e.to=t;let r=0;(n=R(t))&&(n.addChild(this),Gt(t)&&(r=(t.priority||0)+1)),this.priority=r}}_set(t){const e=R(t);e&&(t=e.get());const n=T(this),r=n&&n.getValue();return n?n.setValue(t):this._updateNode(t),!c(t,r)}_onChange(t,e=!1){const n=this.animation;n.changed||e||(n.changed=!0,n.onStart&&n.onStart(this)),n.onChange&&n.onChange(t,this),super._onChange(t,e)}_reset(){const t=this.animation;T(this).reset(t.to),this.is(Bt)||(t.changed=!1),t.immediate||(t.fromValues=t.values.map(t=>t.lastPosition)),super._reset()}_start(){this.is(Bt)||(this._phase=Bt,super._start(),_?this.finish():g.start(this))}_stop(t){if(this.resume(),this.is(Bt)){this._phase="IDLE",this._onChange(this.get(),!0);const e=this.animation;d(e.values,t=>{t.done=!0});const n=e.onRest;n.length&&(e.onRest=[e.toValues?a:n[0]],e.changed||(n[0]=a),d(n,e=>e(t)))}}}function Yt(t,e){if(t.is("DISPOSED"))throw Error('Cannot call "'+e+'" of disposed "'+t.constructor.name+'" object')}function Zt(t,e){return u.fun(t)?t:e&&t?t[e]:void 0}const Jt=(t,e)=>{const{to:n}=e.animation;return t?r=>{if(r)t(zt(e));else{const r=Tt(n),s=c(Tt(e.get()),r);t(Dt(e,s))}}:a};function Kt(t,e=t.loop,n=t.to){let r=Et(e);if(r){const s=!0!==r&&qt(r),i=(s||t).reverse,o=!s||s.reset;return Xt(j(j({},t),{},{loop:e,default:!1,to:!i||u.arr(n)||u.fun(n)?n:void 0,from:o?t.from:void 0,reset:o},s))}}function Xt(t){const{to:e,from:n}=t=qt(t),r=new Set;return n?ee(n,r):delete t.from,u.obj(e)?ee(e,r):e||delete t.to,t.keys=r.size?Array.from(r):null,t}function te(t){const e=Xt(t);return u.und(e.default)&&(e.default=Rt(e,[!0===e.immediate&&"immediate"])),e}function ee(t,e){d(t,(t,n)=>null!=t&&e.add(n))}const ne=["onStart","onChange","onRest"];let re=1;class se{constructor(t,e){this.id=re++,this.springs={},this.queue=[],this._flush=void 0,this._initialProps=void 0,this._phase="CREATED",this._lastAsyncId=0,this._active=new Set,this._state={pauseQueue:new Set,resumeQueue:new Set},this._events={onStart:new Set,onChange:new Set,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start(t)}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle)}is(t){return this._phase==t}get(){const t={};return this.each((e,n)=>t[n]=e.get()),t}update(t){return t&&this.queue.push(Xt(t)),this}start(t){const e=t?p(t).map(Xt):this.queue;return t||(this.queue=[]),this._flush?this._flush(this,e):(le(this,e),ie(this,e))}stop(t){if(u.und(t))this.each(t=>t.stop()),Qt(this._state,this._lastAsyncId);else{const e=this.springs;d(p(t),t=>e[t].stop())}return this}pause(t){if(u.und(t))this.each(t=>t.pause());else{const e=this.springs;d(p(t),t=>e[t].pause())}return this}resume(t){if(u.und(t))this.each(t=>t.resume());else{const e=this.springs;d(p(t),t=>e[t].resume())}return this}reset(){return this.each(t=>t.reset()),this}each(t){d(this.springs,t)}dispose(){this._state.asyncTo=void 0,this.each(t=>t.dispose()),this.springs={}}_onFrame(){const{onStart:t,onChange:e,onRest:n}=this._events,r=this._active.size>0;r&&this._phase!=Bt&&(this._phase=Bt,f(t,t=>t(this)));const s=(e.size||!r&&n.size)&&this.get();f(e,t=>t(s)),r||(this._phase="IDLE",f(n,([t,e])=>{e.value=s,t(e)}))}onParentChange(t){"change"==t.type&&(this._active[t.idle?"delete":"add"](t.parent),g.onFrame(this._onFrame))}}function ie(t,e){return Promise.all(e.map(e=>function t(e,n,r){const{to:s,loop:i,onRest:o}=n;i&&(n.loop=!1);const c=u.arr(s)||u.fun(s)?s:void 0;c?(n.to=void 0,n.onRest=void 0):d(ne,t=>{const r=n[t];if(u.fun(r)){const s=e._events[t];s instanceof Set?n[t]=()=>s.add(r):n[t]=({finished:t,cancelled:e})=>{const n=s.get(r);n?(t||(n.finished=!1),e&&(n.cancelled=!0)):s.set(r,{value:null,finished:t,cancelled:e})}}});const l=(n.keys||Object.keys(e.springs)).map(t=>e.springs[t].start(n)),h=e._state;c?l.push(Mt(++e._lastAsyncId,{props:n,state:h,actions:{pause:a,resume:a,start(t,n){t.onRest=o,t.cancel?((t,e)=>!u.und(Vt(t,e)))(t,"cancel")&&Qt(h,t.callId):n(Lt(c,t,h,e))}}})):n.keys||!0!==n.cancel||Qt(h,e._lastAsyncId);return Promise.all(l).then(o=>{const a=Nt(e,o);if(i&&a.finished&&(!r||!a.noop)){const r=Kt(n,i,s);if(r)return le(e,[r]),t(e,r,!0)}return a})}(t,e))).then(e=>Nt(t,e))}function oe(t,e){const n=j({},t.springs);return e&&d(p(e),t=>{u.und(t.keys)&&(t=Xt(t)),u.obj(t.to)||(t=j(j({},t),{},{to:void 0})),ce(n,t,t=>ue(t))}),n}function ae(t,e){d(e,(e,n)=>{t.springs[n]||(t.springs[n]=e,e.addChild(t))})}function ue(t,e){const n=new Ht;return n.key=t,e&&n.addChild(e),n}function ce(t,e,n){e.keys&&d(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function le(t,e){d(e,e=>{ce(t.springs,e,e=>ue(e,t))})}const he=t.createContext({}),de=e=>{let{children:r}=e,s=n(e,["children"]);const i=t.useContext(he);s=St(()=>j(j({},i),s),[i,s.pause,s.cancel,s.immediate,s.config]);const{Provider:o}=he;return t.createElement(o,{value:s},r)};de.Provider=he.Provider,de.Consumer=he.Consumer;const pe=()=>t.useContext(he),fe=t=>({get controllers(){return t()},update(e){return d(t(),(t,n)=>{t.update(It(e,n,t))}),this},async start(e){const n=await Promise.all(t().map((t,n)=>{const r=It(e,n,t);return t.start(r)}));return{value:n.map(t=>t.value),finished:n.every(t=>t.finished)}},stop:e=>d(t(),t=>t.stop(e)),pause:e=>d(t(),t=>t.pause(e)),resume:e=>d(t(),t=>t.resume(e))});function me(e,n,s){const i=u.fun(n)&&n;i&&!s&&(s=[]);const o=t.useRef(0),a=S(),[c]=t.useState(()=>({ctrls:[],queue:[],flush(t,e){const n=oe(t,e);return o.current>0&&!c.queue.length&&!Object.keys(n).some(e=>!t.springs[e])?ie(t,e):new Promise(r=>{ae(t,n),c.queue.push(()=>{r(ie(t,e))}),a()})}})),l=t.useRef(),h=[...c.ctrls],p=[],f=E(e)||0,m=h.slice(e,f);function g(t,e){for(let r=t;r<e;r++){const t=h[r]||(h[r]=new se(null,c.flush));let e=i?i(r,t):n[r];e&&(e=p[r]=te(e),0==r&&(l.current=e.ref,e.ref=void 0))}}St(()=>{h.length=e,g(f,e)},[e]),St(()=>{g(0,Math.min(f,e))},s);const y=t.useMemo(()=>fe(()=>c.ctrls),[]),v=h.map((t,e)=>oe(t,p[e])),_=pe();r(()=>{o.current++,c.ctrls=h,l.current&&(l.current.current=y);const{queue:t}=c;t.length&&(c.queue=[],d(t,t=>t())),d(m,t=>t.dispose()),d(h,(t,e)=>{ae(t,v[e]),t.start({default:_});const n=p[e];n&&(l.current?t.queue.push(n):t.start(n))})}),C(()=>()=>{d(c.ctrls,t=>t.dispose())});const b=v.map(t=>j({},t));return i||3==arguments.length?[b,y.start,y.stop]:b}const ge="enter";function ye(t,{key:e,keys:n=e}){return u.und(n)?t:u.fun(n)?t.map(n):p(n)}class ve extends $t{constructor(t,e){super(),this.source=t,this.key=void 0,this.idle=!0,this.calc=void 0,this.calc=A(...e);const n=this._get(),r=u.arr(n)?U:D;M(this,r.create(n))}advance(t){const e=this._get();c(e,this.get())||(T(this).setValue(e),this._onChange(e,this.idle))}_get(){const t=u.arr(this.source)?this.source.map(t=>t.get()):p(this.source.get());return this.calc(...t)}_reset(){d(N(this),t=>t.reset()),super._reset()}_start(){this.idle=!1,super._start(),_?(this.idle=!0,this.advance()):g.start(this)}_attach(){let t=!0,e=1;d(p(this.source),n=>{Gt(n)&&(n.idle||(t=!1),e=Math.max(e,n.priority+1)),n.addChild(this)}),this.priority=e,t||(this._reset(),this._start())}_detach(){d(p(this.source),t=>{t.removeChild(this)}),this.idle=!0}onParentChange(t){"start"==t.type?this.advance():"change"==t.type?this.idle?this.advance():t.idle&&(this.idle=p(this.source).every(t=>!1!==t.idle),this.idle&&(this.advance(),d(N(this),t=>{t.done=!0}))):"priority"==t.type&&(this.priority=p(this.source).reduce((t,e)=>Math.max(t,(e.priority||0)+1),0)),super.onParentChange(t)}}x({createStringInterpolator:bt,to:(t,e)=>new ve(t,e)});const _e=/^--/;function be(t,e){return null==e||"boolean"==typeof e||""===e?"":"number"!=typeof e||0===e||_e.test(t)||ke.hasOwnProperty(t)&&ke[t]?(""+e).trim():e+"px"}const we={};let ke={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const xe=["Webkit","Ms","Moz","O"];ke=Object.keys(ke).reduce((t,e)=>(xe.forEach(n=>t[((t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1))(n,e)]=t[e]),t),ke);const Pe=/^(matrix|translate|scale|rotate|skew)/,Ce=/^(translate)/,Se=/^(rotate|skew)/,Ee=(t,e)=>u.num(t)&&0!==t?t+e:t,Ae=(t,e)=>u.arr(t)?t.every(t=>Ae(t,e)):u.num(t)?t===e:parseFloat(t)===e;class Ie extends Q{constructor(t){let{x:e,y:r,z:s}=t,i=n(t,["x","y","z"]);const o=[],a=[];(e||r||s)&&(o.push([e||0,r||0,s||0]),a.push(t=>["translate3d("+t.map(t=>Ee(t,"px")).join(",")+")",Ae(t,0)])),d(i,(t,e)=>{if("transform"===e)o.push([t||""]),a.push(t=>[t,""===t]);else if(Pe.test(e)){if(delete i[e],u.und(t))return;const n=Ce.test(e)?"px":Se.test(e)?"deg":"";o.push(p(t)),a.push("rotate3d"===e?([t,e,r,s])=>["rotate3d("+t+","+e+","+r+","+Ee(s,n)+")",Ae(s,0)]:t=>[e+"("+t.map(t=>Ee(t,n)).join(",")+")",Ae(t,e.startsWith("scale")?1:0)])}}),o.length&&(i.transform=new Ve(o,a)),super(i)}}class Ve extends O{constructor(t,e){super(),this.inputs=t,this.transforms=e,this._value=null,this._children=new Set}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return d(this.inputs,(n,r)=>{const s=V(n[0]),[i,o]=this.transforms[r](u.arr(s)?s:n.map(V));t+=" "+i,e=e&&o}),e?"none":t}addChild(t){this._children.size||d(this.inputs,t=>d(t,t=>{const e=R(t);e&&e.addChild(this)})),this._children.add(t)}removeChild(t){this._children.delete(t),this._children.size||d(this.inputs,t=>d(t,t=>{const e=R(t);e&&e.removeChild(this)}))}onParentChange(t){"change"==t.type&&(this._value=null),d(this._children,e=>{e.onParentChange(t)})}}x({colorNames:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},createStringInterpolator:bt,batchedUpdates:e.unstable_batchedUpdates});const Re=((t,{applyAnimatedValues:e=(()=>!1),createAnimatedStyle:n=(t=>new Q(t)),getComponentProps:r=(t=>t)}={})=>{const s={applyAnimatedValues:e,createAnimatedStyle:n,getComponentProps:r},i=t=>{const e=B(t)||"Anonymous";return(t=u.str(t)?W(t,s):t[$]||(t[$]=W(t,s))).displayName="Animated("+e+")",t};return d(t,(t,e)=>{u.str(e)||(e=B(t)),i[e]=i(t)}),{animated:i}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(t,e){if(!t.nodeType||!t.setAttribute)return!1;const r="filter"===t.nodeName||t.parentNode&&"filter"===t.parentNode.nodeName,s=e,{style:i,children:o,scrollTop:a,scrollLeft:u}=s,c=n(s,["style","children","scrollTop","scrollLeft"]),l=Object.values(c),h=Object.keys(c).map(e=>r||t.hasAttribute(e)?e:we[e]||(we[e]=e.replace(/([A-Z])/g,t=>"-"+t.toLowerCase())));g.onWrite(()=>{void 0!==o&&(t.textContent=o);for(let e in i)if(i.hasOwnProperty(e)){const n=be(e,i[e]);"float"===e?e="cssFloat":_e.test(e)?t.style.setProperty(e,n):t.style[e]=n}h.forEach((e,n)=>{t.setAttribute(e,l[n])}),void 0!==a&&(t.scrollTop=a),void 0!==u&&(t.scrollLeft=u)})},createAnimatedStyle:t=>new Ie(t),getComponentProps:t=>n(t,["scrollTop","scrollLeft"])}).animated;var Oe=!("undefined"!=typeof window&&window.location&&window.location.href&&window.matchMedia)||Boolean(new URL(window.location.href).searchParams.get("eyes-storybook")),je=function(){return Oe?{matches:!0,addListener:function(){},removeListener:function(){}}:window.matchMedia("(prefers-reduced-motion: reduce)")};exports.Globals=P,exports.animated=Re,exports.interpolate=(t,...e)=>(J(),new ve(t,e)),exports.isRenderingOnServer=Oe,exports.useChain=function(t,e,n=1e3){r(()=>{if(e){let r=0;d(t,(t,s)=>{if(!t.current)return;const{controllers:i}=t.current;if(i.length){let t=n*e[s];isNaN(t)?t=r:r=t,d(i,e=>{d(e.queue,e=>{e.delay=t+(e.delay||0)}),e.start()})}})}else{let e=Promise.resolve();d(t,t=>{const{controllers:n,start:r}=t.current||{};if(n&&n.length){const t=n.map(t=>{const e=t.queue;return t.queue=[],e});e=e.then(()=>(d(n,(e,n)=>e.queue.push(...t[n])),r()))}})}})},exports.useReducedMotion=function(){var e=t.useState(je().matches),n=e[0],r=e[1];return t.useEffect((function(){var t=je(),e=function(){r(t.matches)};return t.addListener(e),function(){t.removeListener(e)}}),[]),n},exports.useSpring=function(t,e){const n=u.fun(t),[[r],s,i]=me(1,n?t:[t],n?e||[]:e);return n||2==arguments.length?[r,s,i]:r},exports.useSprings=me,exports.useTrail=function(t,e,n){const s=u.fun(e)&&e;s&&!n&&(n=[]);const i=[],o=me(t,(t,n)=>(i[t]=n,It(e,t,n)),n||[{}]);if(r(()=>{const t=u.obj(e)&&e.reverse;for(let e=0;e<i.length;e++){const n=i[e+(t?1:-1)];n&&i[e].update({to:n.springs}).start()}},n),s||3==arguments.length){const t=o[1];return o[1]=Y(e=>{const n=u.obj(e)&&e.reverse;return t((t,r)=>{const s=It(e,t,r),o=i[t+(n?1:-1)];return o&&(s.to=o.springs),s})},n),o}return o[0]},exports.useTransition=function(e,n,s){const{ref:i,reset:o,sort:a,trail:c=0,expires:l=!0}=n,h=p(e),f=[],m=ye(h,n),g=t.useRef(null),y=o?null:g.current;r(()=>{g.current=f}),C(()=>()=>d(g.current,t=>{t.expired&&clearTimeout(t.expirationId),t.ctrl.dispose()}));const v=[];if(y&&d(y,(t,e)=>{t.expired?clearTimeout(t.expirationId):~(e=v[e]=m.indexOf(t.key))&&(f[e]=t)}),d(h,(t,e)=>{f[e]||(f[e]={key:m[e],item:t,phase:"mount",ctrl:new se})}),v.length){let t=-1;d(v,(e,r)=>{const s=y[r];~e?(t=f.indexOf(s),f[t]=j(j({},s),{},{item:h[e]})):n.leave&&f.splice(++t,0,s)})}u.fun(a)&&f.sort((t,e)=>a(t.item,e.item));let _=-c;const b=S(),w=Rt(n),k=new Map;d(f,(t,e)=>{const r=t.key,s=t.phase;let i,o;if("mount"==s)i=n.enter,o=ge;else{const t=m.indexOf(r)<0;if("leave"!=s)if(t)i=n.leave,o="leave";else{if(!(i=n.update))return;o="update"}else{if(t)return;i=n.enter,o=ge}}if(i=Et(i,t.item,e),i=u.obj(i)?qt(i):{to:i},!i.config){const r=n.config||w.config;i.config=Et(r,t.item,e)}const a=j(j({},w),{},{delay:_+=c,reset:!1},i);if(o==ge&&u.und(a.from)){const r=u.und(n.initial)||y?n.from:n.initial;a.from=Et(r,t.item,e)}const{onRest:h}=a;a.onRest=t=>{const e=g.current,n=e.find(t=>t.key===r);if(n)if(u.fun(h)&&h(t,n),t.cancelled&&"update"!=n.phase)n.phase=s;else if(n.ctrl.idle){const t=e.every(t=>t.ctrl.idle);if("leave"==n.phase){const e=Et(l,n.item);if(!1!==e){const r=!0===e?0:e;if(n.expired=!0,!t&&r>0)return void(r<=2147483647&&(n.expirationId=setTimeout(b,r)))}}t&&e.some(t=>t.expired)&&b()}};const d=oe(t.ctrl,a);k.set(t,{phase:o,springs:d,payload:a})});const x=pe();r(()=>{d(f,t=>{t.ctrl.start({default:x})})},[x]);const P=t.useMemo(()=>fe(()=>g.current.map(t=>t.ctrl)),[]);t.useImperativeHandle(i,()=>P),r(()=>{d(k,({phase:t,springs:e,payload:n},r)=>{ae(r.ctrl,e),x.cancel||(r.phase=t,t==ge&&r.ctrl.start({default:x}),r.ctrl[i?"update":"start"](n))})},o?void 0:s);const E=e=>t.createElement(t.Fragment,null,f.map((n,r)=>{const{springs:s}=k.get(n)||n.ctrl,i=e(j({},s),n.item,n,r);return i&&i.type?t.createElement(i.type,j({},i.props,{key:u.str(n.key)||u.num(n.key)?n.key:n.ctrl.id,ref:i.ref})):i}));return 3==arguments.length?[E,P.start,P.stop]:E}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("react-dom");function n(t,e){if(null==t)return{};var n,r,s={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(s[n]=t[n]);return s}var r="undefined"!=typeof window&&window.document&&window.document.createElement?t.useLayoutEffect:t.useEffect,s=function(t){return b(t)},i=function(t){void 0===t&&(t=s);var e=!0,n=!1,r=0,i=[],a=0,u=new Set,c=new Set,l=new Set,h=function(t){var e=i.indexOf(t);e<0&&(e=i.findIndex((function(e){return e.priority>t.priority})),i.splice(~e?e:i.length,0,t))},d=function(){if(!e)try{m(),t(d)}catch(t){console.error(t)}},p=function(){e&&(e=!1,0==r&&(r=y(),t(d)))},f=[];this.setTimeout=function(t,e){var n=y()+e,r=function(){var t=f.findIndex((function(t){return t.cancel==r}));t>=0&&f.splice(t,1)},s=o(f,(function(t){return t.time>n})),i={time:n,handler:t,cancel:r};return f.splice(s,0,i),p(),i};var m=this.advance=function(){var t=y();if(u.size&&(u.forEach(h),u.clear()),f.length&&w((function(){var e=o(f,(function(e){return e.time>t}));f.splice(0,e).forEach((function(t){return t.handler()}))})),t>r){var e=Math.min(64,t-r);r=t,w((function(){i.length&&(k(i),i=i.filter((function(t){return a=t.priority,t.idle||t.advance(e),!t.idle})),a=0),c.size&&(c.forEach((function(e){return e(t)})),c.clear()),l.size&&(n=!0,l.forEach((function(e){return e(t)})),l.clear(),n=!1)}))}};if(this.start=function(t){a>t.priority?u.add(t):(h(t),p())},this.onFrame=function(t){c.add(t),p()},this.onWrite=function(t){n?t(r):l.add(t)},"undefined"!=typeof process&&"production"!==process.env.NODE_ENV){var g=function(){e=!0,u.clear(),f.length=0};Object.defineProperties(this,{_animations:{get:function(){return i}},_dispose:{get:function(){return g}}})}};function o(t,e){var n=t.findIndex(e);return n<0?t.length:n}var a=function(){},u={arr:Array.isArray,obj:function(t){return!!t&&"Object"===t.constructor.name},fun:function(t){return"function"==typeof t},str:function(t){return"string"==typeof t},num:function(t){return"number"==typeof t},und:function(t){return void 0===t}};function c(t,e){if(u.arr(t)){if(!u.arr(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}return t===e}var l,h=function(t){return u.str(t)&&("#"==t[0]||/\d/.test(t)||!(!v||!v[t]))},d=function(t,e,n){u.fun(t.forEach)?t.forEach(e,n):Object.keys(t).forEach((function(r){return e.call(n,t[r],r)}))},p=function(t){return u.und(t)?[]:u.arr(t)?t:[t]};function f(t,e){if(t.size){var n=Array.from(t);t.clear(),d(n,e)}}var m,g=new i,y=function(){return performance.now()},v=null,_=!1,b="undefined"!=typeof window?window.requestAnimationFrame:function(){return-1},w=function(t){return t()},k=a,x=function(t){var e;return e=Object.assign({to:m,now:y,frameLoop:g,colorNames:v,skipAnimation:_,createStringInterpolator:l,requestAnimationFrame:b,batchedUpdates:w,willAdvance:k},function(t){var e={};for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}(t)),m=e.to,y=e.now,g=e.frameLoop,v=e.colorNames,_=e.skipAnimation,l=e.createStringInterpolator,b=e.requestAnimationFrame,w=e.batchedUpdates,k=e.willAdvance,e};var P=Object.freeze({__proto__:null,get createStringInterpolator(){return l},get frameLoop(){return g},get to(){return m},get now(){return y},get colorNames(){return v},get skipAnimation(){return _},get requestAnimationFrame(){return b},get batchedUpdates(){return w},get willAdvance(){return k},assign:x}),C=function(e){return t.useEffect(e,[])},S=function(){var e=t.useState(0)[1],n=t.useRef(!1);return C((function(){return function(){n.current=!0}})),function(){n.current||e({})}};function E(e){var n=t.useRef(void 0);return t.useEffect((function(){n.current=e})),n.current}var A=function(t,e,n){if(u.fun(t))return t;if(u.arr(t))return A({range:t,output:e,extrapolate:n});if(u.str(t.output[0]))return l(t);var r=t,s=r.output,i=r.range||[0,1],o=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||function(t){return t};return function(t){var e=function(t,e){for(var n=1;n<e.length-1&&!(e[n]>=t);++n);return n-1}(t,i);return function(t,e,n,r,s,i,o,a,u){var c=u?u(t):t;if(c<e){if("identity"===o)return c;"clamp"===o&&(c=e)}if(c>n){if("identity"===a)return c;"clamp"===a&&(c=n)}if(r===s)return r;if(e===n)return t<=e?r:s;e===-1/0?c=-c:n===1/0?c-=e:c=(c-e)/(n-e);c=i(c),r===-1/0?c=-c:s===1/0?c+=r:c=c*(s-r)+r;return c}(t,i[e],i[e+1],s[e],s[e+1],c,o,a,r.map)}};var I=Symbol.for("FluidValue:config");function V(t){var e=R(t);return e?e.get():t}function R(t){if(t)return t[I]}var O=function(){!function(t,e){Object.defineProperty(t,I,{value:e,configurable:!0})}(this,this)};function j(){return(j=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}const q=Symbol.for("Animated:node"),T=t=>t&&t[q],M=(t,e)=>{return n=t,r=q,s=e,Object.defineProperty(n,r,{value:s,writable:!0,configurable:!0});var n,r,s},N=t=>t&&t[q]&&t[q].getPayload();class F{constructor(){this.payload=void 0,M(this,this)}getPayload(){return this.payload||[]}}class D extends F{constructor(t){super(),this._value=t,this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,u.num(this._value)&&(this.lastPosition=this._value)}static create(t,e){return new D(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return u.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value!==t&&(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,u.num(this._value)&&(this.elapsedTime=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}}class z extends D{constructor(t,e){super(0),this._value=void 0,this._string=null,this._toString=void 0,this._toString=A({output:[t,e]})}static create(t,e=t){if(u.str(t)&&u.str(e))return new z(t,e);throw TypeError('Expected "from" and "to" to be strings')}getValue(){let t=this._string;return null==t?this._string=this._toString(this._value):t}setValue(t){if(u.num(t)){if(!super.setValue(t))return!1;this._string=null}else this._string=t,this._value=1;return!0}reset(t){t&&(this._toString=A({output:[this.getValue(),t]})),this._value=0,super.reset()}}const L={current:null};class Q extends F{constructor(t=null){super(),this.source=void 0,this.setValue(t)}getValue(t){if(!this.source)return null;const e={};return d(this.source,(n,r)=>{if((s=n)&&s[q]===s)e[r]=n.getValue(t);else{const s=R(n);s?e[r]=s.get():t||(e[r]=n)}var s}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&d(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return d(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){R(t)&&L.current&&L.current.dependencies.add(t);const e=N(t);e&&d(e,t=>this.add(t))}}class U extends Q{constructor(t,e){super(null),this.source=void 0,super.setValue(this._makeAnimated(t,e))}static create(t,e){return new U(t,e)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();t&&t.length==e.length?d(e,(e,n)=>e.setValue(t[n])):(this.source=this._makeAnimated(t),this.payload=this._makePayload(this.source))}_makeAnimated(t,e=t){return t?t.map((t,n)=>(h(t)?z:D).create(t,e[n])):[]}}class G extends Q{constructor(t){super(null),this.update=t,this.dirty=!1}setValue(t,e){if(t){if(e&&(L.current=e,t.style)){const{createAnimatedStyle:n}=e.host;t=j(j({},t),{},{style:n(t.style)})}super.setValue(t),L.current=null}}onParentChange({type:t}){this.dirty||"change"!==t||(this.dirty=!0,g.onFrame(()=>{this.dirty=!1,this.update()}))}}const W=(e,n)=>t.forwardRef((s,i)=>{const o=t.useRef(null),a=!u.fun(e)||e.prototype&&e.prototype.isReactComponent,c=S(),l=new G(()=>{const t=o.current;a&&!t||!1===(!!t&&n.applyAnimatedValues(t,l.getValue(!0)))&&c()}),h=new Set;return l.setValue(s,{dependencies:h,host:n}),r(()=>(d(h,t=>t.addChild(l)),()=>d(h,t=>t.removeChild(l)))),t.createElement(e,j({},n.getComponentProps(l.getValue()),{ref:a&&(t=>{o.current=function(t,e){t&&(u.fun(t)?t(e):t.current=e);return e}(i,t)})}))});const $=Symbol.for("AnimatedComponent"),B=t=>u.str(t)?t:t&&u.str(t.displayName)?t.displayName:u.fun(t)&&t.name||null;function H(e,n){var r=t.useState((function(){return{inputs:n,result:e()}}))[0],s=t.useRef(r),i=Boolean(n&&s.current.inputs&&function(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}(n,s.current.inputs))?s.current:{inputs:n,result:e()};return t.useEffect((function(){s.current=i}),[i]),i.result}function Y(t,e){return H((function(){return t}),e)}var Z=!1;function J(){Z||(Z=!0,console.warn('react-spring: The "interpolate" function is deprecated in v10 (use "to" instead)'))}var K=function(){return(K=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)},X="[-+]?\\d*\\.?\\d+";function tt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var et=new RegExp("rgb"+tt(X,X,X)),nt=new RegExp("rgba"+tt(X,X,X,X)),rt=new RegExp("hsl"+tt(X,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%")),st=new RegExp("hsla"+tt(X,"[-+]?\\d*\\.?\\d+%","[-+]?\\d*\\.?\\d+%",X)),it=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ot=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,at=/^#([0-9a-fA-F]{6})$/,ut=/^#([0-9a-fA-F]{8})$/;function ct(t,e,n){var r=(1-Math.abs(2*n-1))*e,s=n-r/2,i=function(t,e,n){return t<60?[e,n,0]:t<120?[n,e,0]:t<180?[0,e,n]:t<240?[0,n,e]:t<300?[n,0,e]:[e,0,n]}(t,r,r*(1-Math.abs(t/60%2-1))),o=i[0],a=i[1],u=i[2];return Math.round(255*(o+s))<<24|Math.round(255*(a+s))<<16|Math.round(255*(u+s))<<8}function lt(t){var e=parseInt(t,10);return e<0?0:e>255?255:e}function ht(t){return(parseFloat(t)%360+360)%360/360}function dt(t){var e=parseFloat(t);return e<0?0:e>1?255:Math.round(255*e)}function pt(t){var e=parseFloat(t);return e<0?0:e>100?1:e/100}function ft(t){var e,n,r="number"==typeof(e=t)?e>>>0===e&&e>=0&&e<=4294967295?e:null:(n=at.exec(e))?parseInt(n[1]+"ff",16)>>>0:v&&void 0!==v[e]?v[e]:(n=et.exec(e))?(lt(n[1])<<24|lt(n[2])<<16|lt(n[3])<<8|255)>>>0:(n=nt.exec(e))?(lt(n[1])<<24|lt(n[2])<<16|lt(n[3])<<8|dt(n[4]))>>>0:(n=it.exec(e))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0:(n=ut.exec(e))?parseInt(n[1],16)>>>0:(n=ot.exec(e))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=rt.exec(e))?(255|ct(ht(n[1]),pt(n[2]),pt(n[3])))>>>0:(n=st.exec(e))?(ct(ht(n[1]),pt(n[2]),pt(n[3]))|dt(n[4]))>>>0:null;return null===r?t:"rgba("+((4278190080&(r=r||0))>>>24)+", "+((16711680&r)>>>16)+", "+((65280&r)>>>8)+", "+(255&r)/255+")"}var mt,gt=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,yt=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,vt=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,_t=function(t,e,n,r,s){return"rgba("+Math.round(e)+", "+Math.round(n)+", "+Math.round(r)+", "+s+")"},bt=function(t){mt||(mt=v?new RegExp("("+Object.keys(v).join("|")+")","g"):/^\b$/);var e=t.output.map((function(t){return V(t).replace(yt,ft).replace(mt,ft)})),n=e.map((function(t){return t.match(gt).map(Number)})),r=n[0].map((function(t,e){return n.map((function(t){if(!(e in t))throw Error('The arity of each "output" value must be equal');return t[e]}))})).map((function(e){return A(K(K({},t),{output:e}))}));return function(t){var n=0;return e[0].replace(gt,(function(){return String(r[n++](t))})).replace(vt,_t)}};const wt=j(j({},{tension:170,friction:26}),{},{mass:1,damping:1,easing:t=>t,clamp:!1});class kt{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,wt)}}function xt(t,e){if(u.und(e.decay)){const n=!u.und(e.tension)||!u.und(e.friction);!n&&u.und(e.frequency)&&u.und(e.damping)&&u.und(e.mass)||(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}else t.duration=void 0}const Pt=[];class Ct{constructor(){this.changed=!1,this.values=Pt,this.toValues=null,this.fromValues=Pt,this.to=void 0,this.from=void 0,this.config=new kt,this.immediate=!1,this.onStart=void 0,this.onChange=void 0,this.onRest=[]}}const St=(t,e)=>H(t,e||[{}]);function Et(t,...e){return u.fun(t)?t(...e):t}const At=(t,e)=>!0===t||!!(e&&t&&(u.fun(t)?t(e):p(t).includes(e))),It=(t,e,n)=>t&&(u.fun(t)?t(e,n):u.arr(t)?t[e]:j({},t)),Vt=(t,e)=>!0===t.default?t[e]:t.default?t.default[e]:void 0,Rt=(t,e=[],n={})=>{let r=Ot;t.default&&!0!==t.default&&(t=t.default,r=Object.keys(t));for(const s of r){const r=t[s];u.und(r)||e.includes(s)||(n[s]=r)}return n},Ot=["pause","cancel","config","immediate","onDelayEnd","onProps","onStart","onChange","onRest"],jt={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onDelayEnd:1,onProps:1,onStart:1,onChange:1,onRest:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,keys:1,callId:1,parentId:1};function qt(t){const e=function(t){const e={};let n=0;if(d(t,(t,r)=>{jt[r]||(e[r]=t,n++)}),n)return e}(t);if(e){const n={to:e};return d(t,(t,r)=>r in e||(n[r]=t)),n}return j({},t)}function Tt(t){const e=R(t);return e?Tt(e.get()):u.arr(t)?t.map(Tt):h(t)?l({range:[0,1],output:[t,t]})(1):t}function Mt(t,{key:e,props:n,state:r,actions:s}){return new Promise((i,o)=>{let a,u,c=!1,l=At(n.cancel,e);function h(){r.resumeQueue.add(d),u.cancel(),a=u.time-y()}function d(){a>0?(r.pauseQueue.add(h),u=g.setTimeout(p,a)):p()}function p(){r.pauseQueue.delete(h),t<=(r.cancelId||0)&&(l=!0);try{s.start(j(j({},n),{},{callId:t,delay:a,cancel:l,pause:c}),i)}catch(t){o(t)}}l?p():(a=Et(n.delay||0,e),c=At(n.pause,e),c?(r.resumeQueue.add(d),s.pause()):(s.resume(),d()))})}const Nt=(t,e)=>1==e.length?e[0]:e.some(t=>t.cancelled)?zt(t):e.every(t=>t.noop)?Ft(t):Dt(t,e.every(t=>t.finished)),Ft=(t,e=t.get())=>({value:e,noop:!0,finished:!0,target:t}),Dt=(t,e,n=t.get())=>({value:n,finished:e,target:t}),zt=(t,e=t.get())=>({value:e,cancelled:!0,target:t});async function Lt(t,e,n,r){e.pause&&await new Promise(t=>{n.resumeQueue.add(t)});const{callId:s,parentId:i,onRest:o}=e,{asyncTo:a,promise:c}=n;return i||t!==a||e.reset?n.promise=(async()=>{n.asyncId=s,n.asyncTo=t;const l=Rt(e,["onRest"]);let h,p;const f=new Promise((t,e)=>(h=t,p=e)),m=t=>{const e=s<=(n.cancelId||0)&&zt(r)||s!==n.asyncId&&Dt(r,!1);if(e)throw t.result=e,t},g=(y=(t,e)=>{const i=new Ut;m(i);const o=u.obj(t)?j({},t):j(j({},e),{},{to:t});return o.parentId=s,d(l,(t,e)=>{u.und(o[e])&&(o[e]=t)}),r.start(o).then(async t=>(m(i),r.is("PAUSED")&&await new Promise(t=>{n.resumeQueue.add(t)}),t))},(...t)=>{const e=t=>{throw t instanceof Ut&&p(t),t};try{return y(...t).catch(e)}catch(t){e(t)}});var y;let v;try{let e;u.arr(t)?e=(async t=>{for(const e of t)await g(e)})(t):u.fun(t)&&(e=Promise.resolve(t(g,r.stop.bind(r)))),await Promise.all([e.then(h),f]),v=Dt(r,!0)}catch(t){if(!(t instanceof Ut))throw t;v=t.result}finally{s==n.asyncId&&(n.asyncId=i,n.asyncTo=i?a:void 0,n.promise=i?c:void 0)}return u.fun(o)&&w(()=>{o(v)}),v})():c}function Qt(t,e){t.cancelId=e,t.asyncId=t.asyncTo=t.promise=void 0}class Ut extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}const Gt=t=>t instanceof $t;let Wt=1;class $t extends O{constructor(...t){super(...t),this.id=Wt++,this.key=void 0,this._priority=0,this._children=new Set}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=T(this);return t&&t.getValue()}to(...t){return m(this,t)}interpolate(...t){return J(),m(this,t)}addChild(t){this._children.size||this._attach(),this._children.add(t)}removeChild(t){this._children.delete(t),this._children.size||this._detach()}onParentChange({type:t}){this.idle?"start"==t&&(this._reset(),this._start()):"reset"==t&&this._reset()}_attach(){}_detach(){}_reset(){this._emit({type:"reset",parent:this})}_start(){this._emit({type:"start",parent:this})}_onChange(t,e=!1){this._emit({type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||g.start(this),this._emit({type:"priority",parent:this,priority:t})}_emit(t){d(Array.from(this._children),e=>{e.onParentChange(t)})}}const Bt="ACTIVE";class Ht extends $t{constructor(t,e){if(super(),this.key=void 0,this.animation=new Ct,this.queue=void 0,this._phase="CREATED",this._state={pauseQueue:new Set,resumeQueue:new Set},this._defaultProps={},this._lastCallId=0,this._lastToId=0,!u.und(t)||!u.und(e)){const n=u.obj(t)?j({},t):j(j({},e),{},{from:t});n.default=!0,this.start(n)}}get idle(){return!this.is(Bt)&&!this._state.asyncTo}get goal(){return V(this.animation.to)}get velocity(){const t=T(this);return t instanceof D?t.lastVelocity||0:t.getPayload().map(t=>t.lastVelocity||0)}advance(t){let e=!0,n=!1;const r=this.animation;let{config:s,toValues:i}=r;const o=N(r.to);if(!o){const t=R(r.to);t&&(i=p(t.get()))}return r.values.forEach((a,c)=>{if(a.done)return;let l=o?o[c].lastPosition:i[c],h=r.immediate,d=l;if(!h){if(d=a.lastPosition,s.tension<=0)return void(a.done=!0);const e=a.elapsedTime+=t,n=r.fromValues[c],i=null!=a.v0?a.v0:a.v0=u.arr(s.velocity)?s.velocity[c]:s.velocity;let o;if(u.und(s.duration))if(s.decay){const t=!0===s.decay?.998:s.decay,r=Math.exp(-(1-t)*e);d=n+i/(1-t)*(1-r),h=Math.abs(a.lastPosition-d)<.1,o=i*r}else{o=null==a.lastVelocity?i:a.lastVelocity;const e=s.precision||(n==l?.005:Math.min(1,.001*Math.abs(l-n))),r=s.restVelocity||e/10,c=s.clamp?0:s.bounce,p=!u.und(c),f=n==l?a.v0>0:n<l;let m,g=!1;const y=1,v=Math.ceil(t/y);for(let t=0;t<v&&(m=Math.abs(o)>r,m||(h=Math.abs(l-d)<=e,!h));++t){p&&(g=d==l||d>l==f,g&&(o=-o*c,d=l)),o+=(1e-6*-s.tension*(d-l)+.001*-s.friction*o)/s.mass*y,d+=o*y}}else{let r=s.progress||0;s.duration<=0?r=1:r+=(1-r)*Math.min(1,e/s.duration),d=n+s.easing(r)*(l-n),o=(d-a.lastPosition)/t,h=1==r}a.lastVelocity=o,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),h=!0)}o&&!o[c].done&&(h=!1),h?a.done=!0:e=!1,a.setValue(d,s.round)&&(n=!0)}),e?this.finish():n&&this._onChange(this.get()),e}is(t){return this._phase==t}set(t){return w(()=>{if(this._focus(t),this._set(t)&&!this.is(Bt))return this._onChange(this.get(),!0);this._stop()}),this}pause(){Yt(this,"pause"),this.is("PAUSED")||(this._phase="PAUSED",f(this._state.pauseQueue,t=>t()))}resume(){Yt(this,"resume"),this.is("PAUSED")&&(this._start(),f(this._state.resumeQueue,t=>t()))}finish(t){if(this.resume(),this.is(Bt)){const e=this.animation;!e.config.decay&&u.und(t)&&(t=e.to),u.und(t)||this._set(t),w(()=>{e.changed||(e.changed=!0,e.onStart&&e.onStart(this)),this._stop()})}return this}update(t){return Yt(this,"update"),(this.queue||(this.queue=[])).push(t),this}async start(t,e){let n;Yt(this,"start"),u.und(t)?(n=this.queue||[],this.queue=[]):n=[u.obj(t)?t:j(j({},e),{},{to:t})];const r=await Promise.all(n.map(t=>this._update(t)));return Nt(this,r)}stop(t){return this.is("DISPOSED")||(Qt(this._state,this._lastCallId),this._focus(this.get()),w(()=>this._stop(t))),this}reset(){this._update({reset:!0})}dispose(){this.is("DISPOSED")||(this.animation&&(this.animation.onRest=[]),this.stop(),this._phase="DISPOSED")}onParentChange(t){super.onParentChange(t),"change"==t.type?this.is(Bt)||(this._reset(),this.is("PAUSED")||this._start()):"priority"==t.type&&(this.priority=t.priority+1)}_prepareNode({to:t,from:e,reverse:n}){const r=this.key||"",s={to:t=!u.obj(t)||R(t)?t:t[r],from:e=!u.obj(e)||R(e)?e:e[r]};if(this.is("CREATED")){n&&([t,e]=[e,t]),e=V(e);const r=this._updateNode(u.und(e)?V(t):e);r&&!u.und(e)&&r.setValue(e)}return s}_updateNode(t){let e=T(this);if(!u.und(t)){const n=this._getNodeType(t);e&&e.constructor===n||M(this,e=n.create(t))}return e}_getNodeType(t){const e=T(t);return e?e.constructor:u.arr(t)?U:h(t)?z:D}_update(t,e){const n=this._defaultProps,r=e=>{const r=Vt(t,e);u.und(r)||(n[e]=r),n[e]&&(t[e]=n[e])};r("cancel"),r("pause");const s=this._prepareNode(t);return Mt(++this._lastCallId,{key:this.key,props:t,state:this._state,actions:{pause:this.pause.bind(this),resume:this.resume.bind(this),start:this._merge.bind(this,s)}}).then(n=>{if(t.loop&&n.finished&&(!e||!n.noop)){const e=Kt(t);if(e)return this._update(e,!0)}return n})}_merge(t,e,n){if(e.cancel)return this.stop(!0),n(zt(this));const{key:r,animation:s}=this,i=this._defaultProps,o=!u.und(t.to),l=!u.und(t.from);if(o||l){if(!(e.callId>this._lastToId))return n(zt(this));this._lastToId=e.callId}const d=t=>u.und(e[t])?i[t]:e[t],f=Zt(d("onDelayEnd"),r);f&&f(e,this),e.default&&((t,e,n)=>{Rt(e,n,t)})(i,e,["pause","cancel"]);const{to:m,from:g}=s;let{to:y=m,from:v=g}=t;l&&!o&&(y=v),e.reverse&&([y,v]=[v,y]);const _=!c(v,g);_&&(s.from=v);const b=!c(y,m);b&&this._focus(y);const k=R(y),x=R(v);x&&(v=x.get());const P=u.arr(e.to)||u.fun(e.to),{config:C}=s,{decay:S,velocity:E}=C;e.config&&!P&&function(t,e,n){n&&(xt(n=j({},n),e),e=j(j({},n),e)),xt(t,e),Object.assign(t,e);for(const e in wt)null==t[e]&&(t[e]=wt[e]);let{mass:r,frequency:s,damping:i}=t;u.und(s)||(s<.01&&(s=.01),i<0&&(i=0),t.tension=Math.pow(2*Math.PI/s,2)*r,t.friction=4*Math.PI*i*r/s)}(C,Et(e.config,r),e.config!==i.config?Et(i.config,r):void 0);let A=T(this);if(!A||u.und(y))return n(Dt(this,!0));const I=u.und(e.reset)?l&&!e.default:!u.und(v)&&At(e.reset,r),V=I?v:this.get(),O=Tt(y),q=u.num(O)||u.arr(O)||h(O),M=!P&&(!q||At(i.immediate||e.immediate,r));if(b)if(M)A=this._updateNode(O);else{const t=this._getNodeType(y);if(t!==A.constructor)throw Error("Cannot animate between "+A.constructor.name+" and "+t.name+', as the "to" prop suggests')}const N=A.constructor;let F=!!k,D=!1;if(!F){const t=I||this.is("CREATED")&&_;(b||t)&&(D=c(Tt(V),O),F=!D),c(C.decay,S)&&c(C.velocity,E)||(F=!0)}if(D&&this.is(Bt)&&(s.changed&&!I?F=!0:F||this._stop()),!P){(F||R(m))&&(s.values=A.getPayload(),s.toValues=k?null:N==z?[1]:p(O)),s.immediate=M,s.onStart=Zt(d("onStart"),r),s.onChange=Zt(d("onChange"),r);const t=s.onRest,i=I&&!e.onRest?t[0]||a:Jt(Zt(d("onRest"),r),this);if(F){s.onRest=[i,Jt(n,this)];let e=I?0:1;e<t.length&&w(()=>{for(;e<t.length;e++)t[e]()})}else(I||e.onRest)&&(s.onRest[0]=i)}const L=Zt(d("onProps"),r);L&&L(e,this),I&&A.setValue(V),P?n(Lt(e.to,e,this._state,this)):F?(I&&(this._phase="IDLE"),this._reset(),this._start()):this.is(Bt)&&!b?s.onRest.push(Jt(n,this)):n(Ft(this,V))}_focus(t){const e=this.animation;if(t!==e.to){let n=R(e.to);n&&n.removeChild(this),e.to=t;let r=0;(n=R(t))&&(n.addChild(this),Gt(t)&&(r=(t.priority||0)+1)),this.priority=r}}_set(t){const e=R(t);e&&(t=e.get());const n=T(this),r=n&&n.getValue();return n?n.setValue(t):this._updateNode(t),!c(t,r)}_onChange(t,e=!1){const n=this.animation;n.changed||e||(n.changed=!0,n.onStart&&n.onStart(this)),n.onChange&&n.onChange(t,this),super._onChange(t,e)}_reset(){const t=this.animation;T(this).reset(t.to),this.is(Bt)||(t.changed=!1),t.immediate||(t.fromValues=t.values.map(t=>t.lastPosition)),super._reset()}_start(){this.is(Bt)||(this._phase=Bt,super._start(),_?this.finish():g.start(this))}_stop(t){if(this.resume(),this.is(Bt)){this._phase="IDLE",this._onChange(this.get(),!0);const e=this.animation;d(e.values,t=>{t.done=!0});const n=e.onRest;n.length&&(e.onRest=[e.toValues?a:n[0]],e.changed||(n[0]=a),d(n,e=>e(t)))}}}function Yt(t,e){if(t.is("DISPOSED"))throw Error('Cannot call "'+e+'" of disposed "'+t.constructor.name+'" object')}function Zt(t,e){return u.fun(t)?t:e&&t?t[e]:void 0}const Jt=(t,e)=>{const{to:n}=e.animation;return t?r=>{if(r)t(zt(e));else{const r=Tt(n),s=c(Tt(e.get()),r);t(Dt(e,s))}}:a};function Kt(t,e=t.loop,n=t.to){let r=Et(e);if(r){const s=!0!==r&&qt(r),i=(s||t).reverse,o=!s||s.reset;return Xt(j(j({},t),{},{loop:e,default:!1,to:!i||u.arr(n)||u.fun(n)?n:void 0,from:o?t.from:void 0,reset:o},s))}}function Xt(t){const{to:e,from:n}=t=qt(t),r=new Set;return n?ee(n,r):delete t.from,u.obj(e)?ee(e,r):e||delete t.to,t.keys=r.size?Array.from(r):null,t}function te(t){const e=Xt(t);return u.und(e.default)&&(e.default=Rt(e,[!0===e.immediate&&"immediate"])),e}function ee(t,e){d(t,(t,n)=>null!=t&&e.add(n))}const ne=["onStart","onChange","onRest"];let re=1;class se{constructor(t,e){this.id=re++,this.springs={},this.queue=[],this._flush=void 0,this._initialProps=void 0,this._phase="CREATED",this._lastAsyncId=0,this._active=new Set,this._state={pauseQueue:new Set,resumeQueue:new Set},this._events={onStart:new Set,onChange:new Set,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start(t)}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle)}is(t){return this._phase==t}get(){const t={};return this.each((e,n)=>t[n]=e.get()),t}update(t){return t&&this.queue.push(Xt(t)),this}start(t){const e=t?p(t).map(Xt):this.queue;return t||(this.queue=[]),this._flush?this._flush(this,e):(le(this,e),ie(this,e))}stop(t){if(u.und(t))this.each(t=>t.stop()),Qt(this._state,this._lastAsyncId);else{const e=this.springs;d(p(t),t=>e[t].stop())}return this}pause(t){if(u.und(t))this.each(t=>t.pause());else{const e=this.springs;d(p(t),t=>e[t].pause())}return this}resume(t){if(u.und(t))this.each(t=>t.resume());else{const e=this.springs;d(p(t),t=>e[t].resume())}return this}reset(){return this.each(t=>t.reset()),this}each(t){d(this.springs,t)}dispose(){this._state.asyncTo=void 0,this.each(t=>t.dispose()),this.springs={}}_onFrame(){const{onStart:t,onChange:e,onRest:n}=this._events,r=this._active.size>0;r&&this._phase!=Bt&&(this._phase=Bt,f(t,t=>t(this)));const s=(e.size||!r&&n.size)&&this.get();f(e,t=>t(s)),r||(this._phase="IDLE",f(n,([t,e])=>{e.value=s,t(e)}))}onParentChange(t){"change"==t.type&&(this._active[t.idle?"delete":"add"](t.parent),g.onFrame(this._onFrame))}}function ie(t,e){return Promise.all(e.map(e=>function t(e,n,r){const{to:s,loop:i,onRest:o}=n;i&&(n.loop=!1);const c=u.arr(s)||u.fun(s)?s:void 0;c?(n.to=void 0,n.onRest=void 0):d(ne,t=>{const r=n[t];if(u.fun(r)){const s=e._events[t];s instanceof Set?n[t]=()=>s.add(r):n[t]=({finished:t,cancelled:e})=>{const n=s.get(r);n?(t||(n.finished=!1),e&&(n.cancelled=!0)):s.set(r,{value:null,finished:t,cancelled:e})}}});const l=(n.keys||Object.keys(e.springs)).map(t=>e.springs[t].start(n)),h=e._state;c?l.push(Mt(++e._lastAsyncId,{props:n,state:h,actions:{pause:a,resume:a,start(t,n){t.onRest=o,t.cancel?((t,e)=>!u.und(Vt(t,e)))(t,"cancel")&&Qt(h,t.callId):n(Lt(c,t,h,e))}}})):n.keys||!0!==n.cancel||Qt(h,e._lastAsyncId);return Promise.all(l).then(o=>{const a=Nt(e,o);if(i&&a.finished&&(!r||!a.noop)){const r=Kt(n,i,s);if(r)return le(e,[r]),t(e,r,!0)}return a})}(t,e))).then(e=>Nt(t,e))}function oe(t,e){const n=j({},t.springs);return e&&d(p(e),t=>{u.und(t.keys)&&(t=Xt(t)),u.obj(t.to)||(t=j(j({},t),{},{to:void 0})),ce(n,t,t=>ue(t))}),n}function ae(t,e){d(e,(e,n)=>{t.springs[n]||(t.springs[n]=e,e.addChild(t))})}function ue(t,e){const n=new Ht;return n.key=t,e&&n.addChild(e),n}function ce(t,e,n){e.keys&&d(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function le(t,e){d(e,e=>{ce(t.springs,e,e=>ue(e,t))})}const he=t.createContext({}),de=e=>{let{children:r}=e,s=n(e,["children"]);const i=t.useContext(he);s=St(()=>j(j({},i),s),[i,s.pause,s.cancel,s.immediate,s.config]);const{Provider:o}=he;return t.createElement(o,{value:s},r)};de.Provider=he.Provider,de.Consumer=he.Consumer;const pe=()=>t.useContext(he),fe=t=>({get controllers(){return t()},update(e){return d(t(),(t,n)=>{t.update(It(e,n,t))}),this},async start(e){const n=await Promise.all(t().map((t,n)=>{const r=It(e,n,t);return t.start(r)}));return{value:n.map(t=>t.value),finished:n.every(t=>t.finished)}},stop:e=>d(t(),t=>t.stop(e)),pause:e=>d(t(),t=>t.pause(e)),resume:e=>d(t(),t=>t.resume(e))});function me(e,n,s){const i=u.fun(n)&&n;i&&!s&&(s=[]);const o=t.useRef(0),a=S(),[c]=t.useState(()=>({ctrls:[],queue:[],flush(t,e){const n=oe(t,e);return o.current>0&&!c.queue.length&&!Object.keys(n).some(e=>!t.springs[e])?ie(t,e):new Promise(r=>{ae(t,n),c.queue.push(()=>{r(ie(t,e))}),a()})}})),l=t.useRef(),h=[...c.ctrls],p=[],f=E(e)||0,m=h.slice(e,f);function g(t,e){for(let r=t;r<e;r++){const t=h[r]||(h[r]=new se(null,c.flush));let e=i?i(r,t):n[r];e&&(e=p[r]=te(e),0==r&&(l.current=e.ref,e.ref=void 0))}}St(()=>{h.length=e,g(f,e)},[e]),St(()=>{g(0,Math.min(f,e))},s);const y=t.useMemo(()=>fe(()=>c.ctrls),[]),v=h.map((t,e)=>oe(t,p[e])),_=pe();r(()=>{o.current++,c.ctrls=h,l.current&&(l.current.current=y);const{queue:t}=c;t.length&&(c.queue=[],d(t,t=>t())),d(m,t=>t.dispose()),d(h,(t,e)=>{ae(t,v[e]),t.start({default:_});const n=p[e];n&&(l.current?t.queue.push(n):t.start(n))})}),C(()=>()=>{d(c.ctrls,t=>t.dispose())});const b=v.map(t=>j({},t));return i||3==arguments.length?[b,y.start,y.stop]:b}const ge="enter";function ye(t,{key:e,keys:n=e}){return u.und(n)?t:u.fun(n)?t.map(n):p(n)}class ve extends $t{constructor(t,e){super(),this.source=t,this.key=void 0,this.idle=!0,this.calc=void 0,this.calc=A(...e);const n=this._get(),r=u.arr(n)?U:D;M(this,r.create(n))}advance(t){const e=this._get();c(e,this.get())||(T(this).setValue(e),this._onChange(e,this.idle))}_get(){const t=u.arr(this.source)?this.source.map(t=>t.get()):p(this.source.get());return this.calc(...t)}_reset(){d(N(this),t=>t.reset()),super._reset()}_start(){this.idle=!1,super._start(),_?(this.idle=!0,this.advance()):g.start(this)}_attach(){let t=!0,e=1;d(p(this.source),n=>{Gt(n)&&(n.idle||(t=!1),e=Math.max(e,n.priority+1)),n.addChild(this)}),this.priority=e,t||(this._reset(),this._start())}_detach(){d(p(this.source),t=>{t.removeChild(this)}),this.idle=!0}onParentChange(t){"start"==t.type?this.advance():"change"==t.type?this.idle?this.advance():t.idle&&(this.idle=p(this.source).every(t=>!1!==t.idle),this.idle&&(this.advance(),d(N(this),t=>{t.done=!0}))):"priority"==t.type&&(this.priority=p(this.source).reduce((t,e)=>Math.max(t,(e.priority||0)+1),0)),super.onParentChange(t)}}x({createStringInterpolator:bt,to:(t,e)=>new ve(t,e)});const _e=/^--/;function be(t,e){return null==e||"boolean"==typeof e||""===e?"":"number"!=typeof e||0===e||_e.test(t)||ke.hasOwnProperty(t)&&ke[t]?(""+e).trim():e+"px"}const we={};let ke={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const xe=["Webkit","Ms","Moz","O"];ke=Object.keys(ke).reduce((t,e)=>(xe.forEach(n=>t[((t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1))(n,e)]=t[e]),t),ke);const Pe=/^(matrix|translate|scale|rotate|skew)/,Ce=/^(translate)/,Se=/^(rotate|skew)/,Ee=(t,e)=>u.num(t)&&0!==t?t+e:t,Ae=(t,e)=>u.arr(t)?t.every(t=>Ae(t,e)):u.num(t)?t===e:parseFloat(t)===e;class Ie extends Q{constructor(t){let{x:e,y:r,z:s}=t,i=n(t,["x","y","z"]);const o=[],a=[];(e||r||s)&&(o.push([e||0,r||0,s||0]),a.push(t=>["translate3d("+t.map(t=>Ee(t,"px")).join(",")+")",Ae(t,0)])),d(i,(t,e)=>{if("transform"===e)o.push([t||""]),a.push(t=>[t,""===t]);else if(Pe.test(e)){if(delete i[e],u.und(t))return;const n=Ce.test(e)?"px":Se.test(e)?"deg":"";o.push(p(t)),a.push("rotate3d"===e?([t,e,r,s])=>["rotate3d("+t+","+e+","+r+","+Ee(s,n)+")",Ae(s,0)]:t=>[e+"("+t.map(t=>Ee(t,n)).join(",")+")",Ae(t,e.startsWith("scale")?1:0)])}}),o.length&&(i.transform=new Ve(o,a)),super(i)}}class Ve extends O{constructor(t,e){super(),this.inputs=t,this.transforms=e,this._value=null,this._children=new Set}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return d(this.inputs,(n,r)=>{const s=V(n[0]),[i,o]=this.transforms[r](u.arr(s)?s:n.map(V));t+=" "+i,e=e&&o}),e?"none":t}addChild(t){this._children.size||d(this.inputs,t=>d(t,t=>{const e=R(t);e&&e.addChild(this)})),this._children.add(t)}removeChild(t){this._children.delete(t),this._children.size||d(this.inputs,t=>d(t,t=>{const e=R(t);e&&e.removeChild(this)}))}onParentChange(t){"change"==t.type&&(this._value=null),d(this._children,e=>{e.onParentChange(t)})}}x({colorNames:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},createStringInterpolator:bt,batchedUpdates:e.unstable_batchedUpdates});const Re=((t,{applyAnimatedValues:e=(()=>!1),createAnimatedStyle:n=(t=>new Q(t)),getComponentProps:r=(t=>t)}={})=>{const s={applyAnimatedValues:e,createAnimatedStyle:n,getComponentProps:r},i=t=>{const e=B(t)||"Anonymous";return(t=u.str(t)?W(t,s):t[$]||(t[$]=W(t,s))).displayName="Animated("+e+")",t};return d(t,(t,e)=>{u.str(e)||(e=B(t)),i[e]=i(t)}),{animated:i}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(t,e){if(!t.nodeType||!t.setAttribute)return!1;const r="filter"===t.nodeName||t.parentNode&&"filter"===t.parentNode.nodeName,s=e,{style:i,children:o,scrollTop:a,scrollLeft:u}=s,c=n(s,["style","children","scrollTop","scrollLeft"]),l=Object.values(c),h=Object.keys(c).map(e=>r||t.hasAttribute(e)?e:we[e]||(we[e]=e.replace(/([A-Z])/g,t=>"-"+t.toLowerCase())));g.onWrite(()=>{void 0!==o&&(t.textContent=o);for(let e in i)if(i.hasOwnProperty(e)){const n=be(e,i[e]);"float"===e?e="cssFloat":_e.test(e)?t.style.setProperty(e,n):t.style[e]=n}h.forEach((e,n)=>{t.setAttribute(e,l[n])}),void 0!==a&&(t.scrollTop=a),void 0!==u&&(t.scrollLeft=u)})},createAnimatedStyle:t=>new Ie(t),getComponentProps:t=>n(t,["scrollTop","scrollLeft"])}).animated;var Oe=!("undefined"!=typeof window&&window.location&&window.location.href&&window.matchMedia)||Boolean(new URL(window.location.href).searchParams.get("eyes-storybook")),je=function(){return Oe?{matches:!0,addListener:function(){},removeListener:function(){}}:window.matchMedia("(prefers-reduced-motion: reduce)")};exports.Globals=P,exports.animated=Re,exports.interpolate=(t,...e)=>(J(),new ve(t,e)),exports.isRenderingOnServer=Oe,exports.useChain=function(t,e,n=1e3){r(()=>{if(e){let r=0;d(t,(t,s)=>{if(!t.current)return;const{controllers:i}=t.current;if(i.length){let t=n*e[s];isNaN(t)?t=r:r=t,d(i,e=>{d(e.queue,e=>{e.delay=t+(e.delay||0)}),e.start()})}})}else{let e=Promise.resolve();d(t,t=>{const{controllers:n,start:r}=t.current||{};if(n&&n.length){const t=n.map(t=>{const e=t.queue;return t.queue=[],e});e=e.then(()=>(d(n,(e,n)=>e.queue.push(...t[n])),r()))}})}})},exports.useReducedMotion=function(){var e=t.useState(je().matches),n=e[0],r=e[1];return t.useEffect((function(){var t=je(),e=function(){r(t.matches)};return t.addListener(e),function(){t.removeListener(e)}}),[]),n},exports.useSpring=function(t,e){const n=u.fun(t),[[r],s,i]=me(1,n?t:[t],n?e||[]:e);return n||2==arguments.length?[r,s,i]:r},exports.useSprings=me,exports.useTrail=function(t,e,n){const s=u.fun(e)&&e;s&&!n&&(n=[]);const i=[],o=me(t,(t,n)=>(i[t]=n,It(e,t,n)),n||[{}]);if(r(()=>{const t=u.obj(e)&&e.reverse;for(let e=0;e<i.length;e++){const n=i[e+(t?1:-1)];n&&i[e].update({to:n.springs}).start()}},n),s||3==arguments.length){const t=o[1];return o[1]=Y(e=>{const n=u.obj(e)&&e.reverse;return t((t,r)=>{const s=It(e,t,r),o=i[t+(n?1:-1)];return o&&(s.to=o.springs),s})},n),o}return o[0]},exports.useTransition=function(e,n,s){const{ref:i,reset:o,sort:a,trail:c=0,expires:l=!0}=n,h=p(e),f=[],m=ye(h,n),g=t.useRef(null),y=o?null:g.current;r(()=>{g.current=f}),C(()=>()=>d(g.current,t=>{t.expired&&clearTimeout(t.expirationId),t.ctrl.dispose()}));const v=[];if(y&&d(y,(t,e)=>{t.expired?clearTimeout(t.expirationId):~(e=v[e]=m.indexOf(t.key))&&(f[e]=t)}),d(h,(t,e)=>{f[e]||(f[e]={key:m[e],item:t,phase:"mount",ctrl:new se})}),v.length){let t=-1;d(v,(e,r)=>{const s=y[r];~e?(t=f.indexOf(s),f[t]=j(j({},s),{},{item:h[e]})):n.leave&&f.splice(++t,0,s)})}u.fun(a)&&f.sort((t,e)=>a(t.item,e.item));let _=-c;const b=S(),w=Rt(n),k=new Map;d(f,(t,e)=>{const r=t.key,s=t.phase;let i,o;if("mount"==s)i=n.enter,o=ge;else{const t=m.indexOf(r)<0;if("leave"!=s)if(t)i=n.leave,o="leave";else{if(!(i=n.update))return;o="update"}else{if(t)return;i=n.enter,o=ge}}if(i=Et(i,t.item,e),i=u.obj(i)?qt(i):{to:i},!i.config){const r=n.config||w.config;i.config=Et(r,t.item,e)}const a=j(j({},w),{},{delay:_+=c,reset:!1},i);if(o==ge&&u.und(a.from)){const r=u.und(n.initial)||y?n.from:n.initial;a.from=Et(r,t.item,e)}const{onRest:h}=a;a.onRest=t=>{const e=g.current,n=e.find(t=>t.key===r);if(n)if(u.fun(h)&&h(t,n),t.cancelled&&"update"!=n.phase)n.phase=s;else if(n.ctrl.idle){const t=e.every(t=>t.ctrl.idle);if("leave"==n.phase){const e=Et(l,n.item);if(!1!==e){const r=!0===e?0:e;if(n.expired=!0,!t&&r>0)return void(r<=2147483647&&(n.expirationId=setTimeout(b,r)))}}t&&e.some(t=>t.expired)&&b()}};const d=oe(t.ctrl,a);k.set(t,{phase:o,springs:d,payload:a})});const x=pe();r(()=>{d(f,t=>{t.ctrl.start({default:x})})},[x]);const P=t.useMemo(()=>fe(()=>g.current.map(t=>t.ctrl)),[]);t.useImperativeHandle(i,()=>P),r(()=>{d(k,({phase:t,springs:e,payload:n},r)=>{ae(r.ctrl,e),x.cancel||(r.phase=t,t==ge&&r.ctrl.start({default:x}),r.ctrl[i?"update":"start"](n))})},o?void 0:s);const E=e=>t.createElement(t.Fragment,null,f.map((n,r)=>{const{springs:s}=k.get(n)||n.ctrl,i=e(j({},s),n.item,n,r);return i&&i.type?t.createElement(i.type,j({},i.props,{key:u.str(n.key)||u.num(n.key)?n.key:n.ctrl.id,ref:i.ref})):i}));return 3==arguments.length?[E,P.start,P.stop]:E}; |
{ | ||
"name": "@twilio-paste/animation-library", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"category": "interaction", | ||
@@ -37,3 +37,3 @@ "status": "beta", | ||
}, | ||
"gitHead": "5d8b50d00bb62d1d3784ac1412ecc112d2f7c4f6" | ||
"gitHead": "7b34b4af994258e26c6f6d4ac82ae9a7ec7d38df" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
88530
325