popmotion-pose
Version:
A declarative animation library for HTML and SVG
1 lines • 55.3 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e():"function"==typeof define&&define.amd?define(e):e()}(0,function(){"use strict";var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};function e(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var r=function(){return(r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function n(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function o(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<r;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)n[o]=i[u];return n}var i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},u=function(t,e){return function(r){return Math.max(Math.min(r,e),t)}},a=function(t){return t%1?Number(t.toFixed(5)):t},s=/(-)?(\d[\d\.]*)/g,c=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,f=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$/i,p={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},l=i(i({},p),{transform:u(0,1)}),d=i(i({},p),{default:1}),v=function(t){return{test:function(e){return"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},h=v("deg"),m=v("%"),g=v("px"),y=v("vh"),b=v("vw"),w=i(i({},m),{parse:function(t){return m.parse(t)/100},transform:function(t){return m.transform(100*t)}}),O=u(0,255),P=function(t){return void 0!==t.red},x=function(t){return void 0!==t.hue},A=function(t){return function(e){if("string"!=typeof e)return e;for(var r,n={},o=(r=e,r.substring(r.indexOf("(")+1,r.lastIndexOf(")"))).split(/,\s*/),i=0;i<4;i++)n[t[i]]=void 0!==o[i]?parseFloat(o[i]):1;return n}},S=i(i({},p),{transform:function(t){return Math.round(O(t))}});function E(t,e){return t.startsWith(e)&&f.test(t)}var C,V={test:function(t){return"string"==typeof t?E(t,"rgb"):P(t)},parse:A(["red","green","blue","alpha"]),transform:function(t){var e=t.red,r=t.green,n=t.blue,o=t.alpha,i=void 0===o?1:o;return function(t){var e=t.red,r=t.green,n=t.blue,o=t.alpha;return"rgba("+e+", "+r+", "+n+", "+(void 0===o?1:o)+")"}({red:S.transform(e),green:S.transform(r),blue:S.transform(n),alpha:a(l.transform(i))})}},M={test:function(t){return"string"==typeof t?E(t,"hsl"):x(t)},parse:A(["hue","saturation","lightness","alpha"]),transform:function(t){var e=t.hue,r=t.saturation,n=t.lightness,o=t.alpha,i=void 0===o?1:o;return function(t){var e=t.hue,r=t.saturation,n=t.lightness,o=t.alpha;return"hsla("+e+", "+r+", "+n+", "+(void 0===o?1:o)+")"}({hue:Math.round(e),saturation:m.transform(a(r)),lightness:m.transform(a(n)),alpha:a(l.transform(i))})}},k=i(i({},V),{test:function(t){return"string"==typeof t&&E(t,"#")},parse:function(t){var e="",r="",n="";return t.length>4?(e=t.substr(1,2),r=t.substr(3,2),n=t.substr(5,2)):(e=t.substr(1,1),r=t.substr(2,1),n=t.substr(3,1),e+=e,r+=r,n+=n),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:1}}}),T={test:function(t){return"string"==typeof t&&f.test(t)||P(t)||x(t)},parse:function(t){return V.test(t)?V.parse(t):M.test(t)?M.parse(t):k.test(t)?k.parse(t):t},transform:function(t){return P(t)?V.transform(t):x(t)?M.transform(t):t}},R=function(t){return"number"==typeof t?0:t},D={test:function(t){if("string"!=typeof t||!isNaN(t))return!1;var e=0,r=t.match(s),n=t.match(c);return r&&(e+=r.length),n&&(e+=n.length),e>0},parse:function(t){var e=t,r=[],n=e.match(c);n&&(e=e.replace(c,"${c}"),r.push.apply(r,n.map(T.parse)));var o=e.match(s);return o&&r.push.apply(r,o.map(p.parse)),r},createTransformer:function(t){var e=t,r=0,n=t.match(c),o=n?n.length:0;if(n)for(var i=0;i<o;i++)e=e.replace(n[i],"${c}"),r++;var u=e.match(s),f=u?u.length:0;if(u)for(i=0;i<f;i++)e=e.replace(u[i],"${n}"),r++;return function(t){for(var n=e,i=0;i<r;i++)n=n.replace(i<o?"${c}":"${n}",i<o?T.transform(t[i]):a(t[i]));return n}},getAnimatableNone:function(t){var e=D.parse(t);return D.createTransformer(t)(e.map(R))}},j=Object.freeze({number:p,scale:d,alpha:l,degrees:h,percent:m,progressPercentage:w,px:g,vw:b,vh:y,rgba:V,rgbUnit:S,hsla:M,hex:k,color:T,complex:D}),F=function(){},I=0,B="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(t){return window.requestAnimationFrame(t)}:function(t){var e=Date.now(),r=Math.max(0,16.7-(e-I));I=e+r,setTimeout(function(){return t(I)},r)};!function(t){t.Read="read",t.Update="update",t.Render="render",t.PostRender="postRender",t.FixedUpdate="fixedUpdate"}(C||(C={}));var X=1/60*1e3,Y=!0,L=!1,z=!1,N={delta:0,timestamp:0},W=[C.Read,C.Update,C.Render,C.PostRender],q=function(t){return L=t},U=W.reduce(function(t,e){var r,n,o,i,u,a,s,c,f,p=(r=q,n=[],o=[],i=0,u=!1,a=0,s=new WeakSet,c=new WeakSet,f={cancel:function(t){var e=o.indexOf(t);s.add(t),-1!==e&&o.splice(e,1)},process:function(t){var e,p;if(u=!0,n=(e=[o,n])[0],(o=e[1]).length=0,i=n.length)for(a=0;a<i;a++)(p=n[a])(t),!0!==c.has(p)||s.has(p)||(f.schedule(p),r(!0));u=!1},schedule:function(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=!1);var a=r&&u,f=a?n:o;s.delete(t),e&&c.add(t),-1===f.indexOf(t)&&(f.push(t),a&&(i=n.length))}});return t.sync[e]=function(t,e,r){return void 0===e&&(e=!1),void 0===r&&(r=!1),L||K(),p.schedule(t,e,r),t},t.cancelSync[e]=function(t){return p.cancel(t)},t.steps[e]=p,t},{steps:{},sync:{},cancelSync:{}}),Z=U.steps,H=U.sync,$=U.cancelSync,_=function(t){return Z[t].process(N)},G=function(t){L=!1,N.delta=Y?X:Math.max(Math.min(t-N.timestamp,40),1),Y||(X=N.delta),N.timestamp=t,z=!0,W.forEach(_),z=!1,L&&(Y=!1,B(G))},K=function(){L=!0,Y=!0,z||B(G)},J=function(){return N},Q=function(t){return function(e){return 1-t(1-e)}},tt=function(t){return function(e){return e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2}},et=Q,rt=tt,nt=function(t){return function(e){return Math.pow(e,t)}},ot=function(t){return function(e){return e*e*((t+1)*e-t)}},it=function(t){var e=ot(t);return function(t){return(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))}},ut=function(t){return t},at=nt(2),st=Q(at),ct=tt(at),ft=function(t){return 1-Math.sin(Math.acos(t))},pt=Q(ft),lt=tt(pt),dt=ot(1.525),vt=Q(dt),ht=tt(dt),mt=it(1.525),gt=function(t){var e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},yt=8,bt=.001,wt=1e-7,Ot=10,Pt=11,xt=1/(Pt-1),At="undefined"!=typeof Float32Array,St=function(t,e){return 1-3*e+3*t},Et=function(t,e){return 3*e-6*t},Ct=function(t){return 3*t},Vt=function(t,e,r){return 3*St(e,r)*t*t+2*Et(e,r)*t+Ct(e)},Mt=function(t,e,r){return((St(e,r)*t+Et(e,r))*t+Ct(e))*t};function kt(t,e,r,n){var o=At?new Float32Array(Pt):new Array(Pt),i=function(e){for(var n,i,u,a=0,s=1,c=Pt-1;s!==c&&o[s]<=e;++s)a+=xt;return n=(e-o[--s])/(o[s+1]-o[s]),(u=Vt(i=a+n*xt,t,r))>=bt?function(e,n){for(var o=0,i=0;o<yt;++o){if(0===(i=Vt(n,t,r)))return n;n-=(Mt(n,t,r)-e)/i}return n}(e,i):0===u?i:function(e,n,o){var i,u,a=0;do{(i=Mt(u=n+(o-n)/2,t,r)-e)>0?o=u:n=u}while(Math.abs(i)>wt&&++a<Ot);return u}(e,a,a+xt)};!function(){for(var e=0;e<Pt;++e)o[e]=Mt(e*xt,t,r)}();return function(o){return t===e&&r===n?o:0===o?0:1===o?1:Mt(i(o),e,n)}}var Tt=Object.freeze({reversed:Q,mirrored:tt,createReversedEasing:et,createMirroredEasing:rt,createExpoIn:nt,createBackIn:ot,createAnticipateEasing:it,linear:ut,easeIn:at,easeOut:st,easeInOut:ct,circIn:ft,circOut:pt,circInOut:lt,backIn:dt,backOut:vt,backInOut:ht,anticipate:mt,bounceOut:gt,bounceIn:function(t){return 1-gt(1-t)},bounceInOut:function(t){return t<.5?.5*(1-gt(1-2*t)):.5*gt(2*t-1)+.5},cubicBezier:kt}),Rt={x:0,y:0,z:0},Dt=function(t){return"number"==typeof t},jt=function(t){return 180*t/Math.PI},Ft=function(t,e){return void 0===e&&(e=Rt),jt(Math.atan2(e.y-t.y,e.x-t.x))},It=function(t,e){var r=!0;return void 0===e&&(e=t,r=!1),function(n){return r?n-t+e:(t=n,r=!0,e)}},Bt=function(t){return function(e,r,n){return void 0!==n?t(e,r,n):function(n){return t(e,r,n)}}},Xt=Bt(function(t,e,r){return Math.min(Math.max(r,t),e)}),Yt=function(t){return t*Math.PI/180},Lt=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},zt=function(t){return Lt(t)&&t.hasOwnProperty("z")},Nt=function(t,e){return Math.abs(t-e)},Wt=function(t,e){if(void 0===e&&(e=Rt),Dt(t)&&Dt(e))return Nt(t,e);if(Lt(t)&&Lt(e)){var r=Nt(t.x,e.x),n=Nt(t.y,e.y),o=zt(t)&&zt(e)?Nt(t.z,e.z):0;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2)+Math.pow(o,2))}return 0},qt=function(t,e,r){var n=e-t;return 0===n?1:(r-t)/n},Ut=function(t,e,r){return-r*t+r*e+t},Zt=function(){return(Zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ht=function(t,e,r){var n=t*t,o=e*e;return Math.sqrt(Math.max(0,r*(o-n)+n))},$t=[k,V,M],_t=function(t){return $t.find(function(e){return e.test(t)})},Gt=function(t){return"'"+t+"' is not an animatable color. Use the equivalent color code instead."},Kt=function(t,e){var r=_t(t),n=_t(e);F(!!r,Gt(t)),F(!!n,Gt(e)),F(r.transform===n.transform,"Both colors must be hex/RGBA, OR both must be HSLA.");var o=r.parse(t),i=n.parse(e),u=Zt({},o),a=r===M?Ut:Ht;return function(t){for(var e in u)"alpha"!==e&&(u[e]=a(o[e],i[e],t));return u.alpha=Ut(o.alpha,i.alpha,t),r.transform(u)}},Jt=function(t,e){return function(r){return e(t(r))}},Qt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(Jt)};function te(t,e){return Dt(t)?function(r){return Ut(t,e,r)}:T.test(t)?Kt(t,e):oe(t,e)}var ee=function(t,e){var r=t.slice(),n=r.length,o=t.map(function(t,r){return te(t,e[r])});return function(t){for(var e=0;e<n;e++)r[e]=o[e](t);return r}},re=function(t,e){var r=Zt({},t,e),n={};for(var o in r)void 0!==t[o]&&void 0!==e[o]&&(n[o]=te(t[o],e[o]));return function(t){for(var e in n)r[e]=n[e](t);return r}};function ne(t){for(var e=D.parse(t),r=e.length,n=0,o=0,i=0,u=0;u<r;u++)n||"number"==typeof e[u]?n++:void 0!==e[u].hue?i++:o++;return{parsed:e,numNumbers:n,numRGB:o,numHSL:i}}var oe=function(t,e){var r=D.createTransformer(e),n=ne(t),o=ne(e);return F(n.numHSL===o.numHSL&&n.numRGB===o.numRGB&&n.numNumbers>=o.numNumbers,"Complex values '"+t+"' and '"+e+"' too different to mix. Ensure all colors are of the same type."),Qt(ee(n.parsed,o.parsed),r)},ie=function(t,e){return function(r){return Ut(t,e,r)}};function ue(t,e,r){for(var n,o=[],i=r||("number"==typeof(n=t[0])?ie:"string"==typeof n?T.test(n)?Kt:oe:Array.isArray(n)?ee:"object"==typeof n?re:void 0),u=t.length-1,a=0;a<u;a++){var s=i(t[a],t[a+1]);if(e){var c=Array.isArray(e)?e[a]:e;s=Qt(c,s)}o.push(s)}return o}var ae,se=function(t,e,r,n){return void 0===n&&(n=0),o=t+r*(e-t)/Math.max(n,r),void 0===i&&(i=2),i=Math.pow(10,i),Math.round(o*i)/i;var o,i},ce=function(t){return t},fe=function(t){return void 0===t&&(t=ce),Bt(function(e,r,n){var o=r-n,i=-(0-e+1)*(0-t(Math.abs(o)));return o<=0?r+i:r-i})},pe=fe(),le=fe(Math.sqrt),de=function(t,e){return Dt(t)?t/(1e3/e):0},ve=function(t,e){return e?t*(1e3/e):0},he=Bt(function(t,e,r){var n=e-t;return((r-t)%n+n)%n+t}),me=(Xt(0,1),function(t){var e=t.onRead,r=t.onRender,o=t.uncachedValues,i=void 0===o?new Set:o,u=t.useCache,a=void 0===u||u;return function(t){void 0===t&&(t={});var o=n(t,[]),u={},s=[],c=!1;function f(t,e){t.startsWith("--")&&(o.hasCSSVariable=!0);var r=u[t];u[t]=e,u[t]!==r&&(-1===s.indexOf(t)&&s.push(t),c||(c=!0,H.render(p.render)))}var p={get:function(t,r){return void 0===r&&(r=!1),!r&&a&&!i.has(t)&&void 0!==u[t]?u[t]:e(t,o)},set:function(t,e){if("string"==typeof t)f(t,e);else for(var r in t)f(r,t[r]);return this},render:function(t){return void 0===t&&(t=!1),(c||!0===t)&&(r(u,o,s),c=!1,s.length=0),this}};return p}}),ge=/([a-z])([A-Z])/g,ye=function(t){return t.replace(ge,"$1-$2").toLowerCase()},be=new Map,we=new Map,Oe=["Webkit","Moz","O","ms",""],Pe=Oe.length,xe="undefined"!=typeof document,Ae=function(t,e){return we.set(t,ye(e))},Se=function(t,e){void 0===e&&(e=!1);var r=e?we:be;return r.has(t)||(xe?function(t){ae=ae||document.createElement("div");for(var e=0;e<Pe;e++){var r=Oe[e],n=""===r,o=n?t:r+t.charAt(0).toUpperCase()+t.slice(1);if(o in ae.style||n){if(n&&"clipPath"===t&&we.has(t))return;be.set(t,o),Ae(t,(n?"":"-")+ye(o))}}}(t):function(t){Ae(t,t)}(t)),r.get(t)||t},Ee=["","X","Y","Z"],Ce=["translate","scale","rotate","skew","transformPerspective"].reduce(function(t,e){return Ee.reduce(function(t,r){return t.push(e+r),t},t)},["x","y","z"]),Ve=Ce.reduce(function(t,e){return t[e]=!0,t},{});function Me(t){return!0===Ve[t]}function ke(t,e){return Ce.indexOf(t)-Ce.indexOf(e)}var Te=new Set(["originX","originY","originZ"]);function Re(t){return Te.has(t)}var De=r(r({},p),{transform:Math.round}),je={color:T,backgroundColor:T,outlineColor:T,fill:T,stroke:T,borderColor:T,borderTopColor:T,borderRightColor:T,borderBottomColor:T,borderLeftColor:T,borderWidth:g,borderTopWidth:g,borderRightWidth:g,borderBottomWidth:g,borderLeftWidth:g,borderRadius:g,radius:g,borderTopLeftRadius:g,borderTopRightRadius:g,borderBottomRightRadius:g,borderBottomLeftRadius:g,width:g,maxWidth:g,height:g,maxHeight:g,size:g,top:g,right:g,bottom:g,left:g,padding:g,paddingTop:g,paddingRight:g,paddingBottom:g,paddingLeft:g,margin:g,marginTop:g,marginRight:g,marginBottom:g,marginLeft:g,rotate:h,rotateX:h,rotateY:h,rotateZ:h,scale:d,scaleX:d,scaleY:d,scaleZ:d,skew:h,skewX:h,skewY:h,distance:g,translateX:g,translateY:g,translateZ:g,x:g,y:g,z:g,perspective:g,opacity:l,originX:w,originY:w,originZ:g,zIndex:De,fillOpacity:l,strokeOpacity:l,numOctaves:De},Fe=function(t){return je[t]},Ie=function(t,e){return e&&"number"==typeof t?e.transform(t):t},Be="scrollLeft",Xe="scrollTop",Ye=new Set([Be,Xe]),Le=new Set([Be,Xe,"transform"]),ze={x:"translateX",y:"translateY",z:"translateZ"};function Ne(t){return"function"==typeof t}function We(t,e,r,n,o,i,u){void 0===e&&(e=!0),void 0===r&&(r={}),void 0===n&&(n={}),void 0===o&&(o={}),void 0===i&&(i=[]),void 0===u&&(u=!1);var a=!0,s=!1,c=!1;for(var f in t){var p=t[f],l=Fe(f),d=Ie(p,l);Me(f)?(s=!0,n[f]=d,i.push(f),a&&(l.default&&p!==l.default||!l.default&&0!==p)&&(a=!1)):Re(f)?(o[f]=d,c=!0):Le.has(f)&&Ne(d)||(r[Se(f,u)]=d)}return(s||"function"==typeof t.transform)&&(r.transform=function(t,e,r,n,o){var i="",u=!1;r.sort(ke);for(var a=r.length,s=0;s<a;s++){var c=r[s];i+=(ze[c]||c)+"("+e[c]+") ",u="z"===c||u}return!u&&o?i+="translateZ(0)":i=i.trim(),Ne(t.transform)?i=t.transform(e,i):n&&(i="none"),i}(t,n,i,a,e)),c&&(r.transformOrigin=(o.originX||"50%")+" "+(o.originY||"50%")+" "+(o.originZ||0)),r}function qe(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0);var r={},n={},o={},i=[];return function(u){return i.length=0,We(u,t,r,n,o,i,e),r}}var Ue=me({onRead:function(t,e){var r=e.element,n=e.preparseOutput,o=Fe(t);if(Me(t))return o&&o.default||0;if(Ye.has(t))return r[t];var i=window.getComputedStyle(r,null).getPropertyValue(Se(t,!0))||0;return n&&o&&o.test(i)&&o.parse?o.parse(i):i},onRender:function(t,e,r){var n=e.element,o=e.buildStyles,i=e.hasCSSVariable;if(Object.assign(n.style,o(t)),i)for(var u=r.length,a=0;a<u;a++){var s=r[a];s.startsWith("--")&&n.style.setProperty(s,t[s])}-1!==r.indexOf(Be)&&(n[Be]=t[Be]),-1!==r.indexOf(Xe)&&(n[Xe]=t[Xe])},uncachedValues:Ye});var Ze=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),He=.5,$e=function(){return{style:{}}},_e=function(t,e){return g.transform(t*e)},Ge={x:0,y:0,width:0,height:0};function Ke(t,e,r){return"string"==typeof t?t:g.transform(e+r*t)}function Je(t,e,r,o,i,u){void 0===e&&(e=Ge),void 0===o&&(o=qe(!1,!1)),void 0===i&&(i=$e()),void 0===u&&(u=!0);var a=t.attrX,s=t.attrY,c=t.originX,f=t.originY,p=t.pathLength,l=t.pathSpacing,d=void 0===l?1:l,v=t.pathOffset,h=void 0===v?0:v,m=o(n(t,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]));for(var g in m){if("transform"===g)i.style.transform=m[g];else i[u&&!Ze.has(g)?ye(g):g]=m[g]}return(void 0!==c||void 0!==f||m.transform)&&(i.style.transformOrigin=function(t,e,r){return Ke(e,t.x,t.width)+" "+Ke(r,t.y,t.height)}(e,void 0!==c?c:He,void 0!==f?f:He)),void 0!==a&&(i.x=a),void 0!==s&&(i.y=s),void 0!==r&&void 0!==p&&(i[u?"stroke-dashoffset":"strokeDashoffset"]=_e(-h,r),i[u?"stroke-dasharray":"strokeDasharray"]=_e(p,r)+" "+_e(d,r)),i}var Qe=me({onRead:function(t,e){var r=e.element;if(Me(t=Ze.has(t)?t:ye(t))){var n=Fe(t);return n&&n.default||0}return r.getAttribute(t)},onRender:function(t,e){var r=e.element,n=(0,e.buildAttrs)(t);for(var o in n)"style"===o?Object.assign(r.style,n.style):r.setAttribute(o,n[o])}}),tr=function(t){var e=function(t){try{return function(t){return"function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}(t)}catch(t){return{x:0,y:0,width:0,height:0}}}(t),r=function(t){return"path"===t.tagName}(t)&&t.getTotalLength?t.getTotalLength():void 0;return Qe({element:t,buildAttrs:function(t,e,r){void 0===r&&(r=!0);var n=$e(),o=qe(!1,!1);return function(i){return Je(i,t,e,o,n,r)}}(e,r)})},er=me({useCache:!1,onRead:function(t){return"scrollTop"===t?window.pageYOffset:window.pageXOffset},onRender:function(t){var e=t.scrollTop,r=void 0===e?0:e,n=t.scrollLeft,o=void 0===n?0:n;return window.scrollTo(o,r)}}),rr=new WeakMap,nr=function(t,e){var o;return t instanceof HTMLElement?o=function(t,e){void 0===e&&(e={});var o=e.enableHardwareAcceleration,i=n(e,["enableHardwareAcceleration"]);return Ue(r({element:t,buildStyles:qe(o),preparseOutput:!0},i))}(t,e):t instanceof SVGElement?o=tr(t):t===window&&(o=er(t)),rr.set(t,o),o},or=function(t,e){return rr.has(t)?rr.get(t):nr(t,e)};function ir(t,e){var r="string"==typeof t?document.querySelector(t):t;return or(r,e)}var ur=function(){function t(t){void 0===t&&(t={}),this.props=t}return t.prototype.applyMiddleware=function(t){return this.create(r({},this.props,{middleware:this.props.middleware?[t].concat(this.props.middleware):[t]}))},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=1===t.length?t[0]:Qt.apply(void 0,t);return this.applyMiddleware(function(t){return function(e){return t(r(e))}})},t.prototype.while=function(t){return this.applyMiddleware(function(e,r){return function(n){return t(n)?e(n):r()}})},t.prototype.filter=function(t){return this.applyMiddleware(function(e){return function(r){return t(r)&&e(r)}})},t}(),ar=function(){return function(t,e){var r=t.middleware,n=t.onComplete,o=this;this.isActive=!0,this.update=function(t){o.observer.update&&o.updateObserver(t)},this.complete=function(){o.observer.complete&&o.isActive&&o.observer.complete(),o.onComplete&&o.onComplete(),o.isActive=!1},this.error=function(t){o.observer.error&&o.isActive&&o.observer.error(t),o.isActive=!1},this.observer=e,this.updateObserver=function(t){return e.update(t)},this.onComplete=n,e.update&&r&&r.length&&r.forEach(function(t){return o.updateObserver=t(o.updateObserver,o.complete)})}}(),sr=function(t,e,r){var n=e.middleware;return new ar({middleware:n,onComplete:r},"function"==typeof t?{update:t}:t)},cr=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return e(o,t),o.prototype.create=function(t){return new o(t)},o.prototype.start=function(t){void 0===t&&(t={});var e=!1,o={stop:function(){}},i=this.props,u=i.init,a=n(i,["init"]),s=u(sr(t,a,function(){e=!0,o.stop()}));return o=s?r({},o,s):o,t.registerParent&&t.registerParent(o),e&&o.stop(),o},o}(ur),fr=function(t){return new cr({init:t})},pr=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.subscribers=[],e}return e(r,t),r.prototype.complete=function(){this.subscribers.forEach(function(t){return t.complete()})},r.prototype.error=function(t){this.subscribers.forEach(function(e){return e.error(t)})},r.prototype.update=function(t){for(var e=0;e<this.subscribers.length;e++)this.subscribers[e].update(t)},r.prototype.subscribe=function(t){var e=this,r=sr(t,this.props);return this.subscribers.push(r),{unsubscribe:function(){var t=e.subscribers.indexOf(r);-1!==t&&e.subscribers.splice(t,1)}}},r.prototype.stop=function(){this.parent&&this.parent.stop()},r.prototype.registerParent=function(t){this.stop(),this.parent=t},r}(ur),lr=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return e(r,t),r.prototype.create=function(t){return new r(t)},r}(pr),dr=function(t,e){var r=1/(t-1),n=1/(2*(t-1)),o=Math.min(e,1)/n;return Math.floor((o+1)/2)*r},vr=Object.freeze({angle:Ft,degreesToRadians:Yt,distance:Wt,isPoint3D:zt,isPoint:Lt,dilate:Ut,getValueFromProgress:Ut,pointFromAngleAndDistance:function(t,e,r){return e=Yt(e),{x:r*Math.cos(e)+t.x,y:r*Math.sin(e)+t.y}},getProgressFromValue:qt,radiansToDegrees:jt,smooth:se,speedPerFrame:de,speedPerSecond:ve,stepProgress:dr}),hr=function(t){return Array.isArray(t)},mr=function(t){var e=typeof t;return"string"===e||"number"===e},gr=function(t){function r(e){var r=t.call(this,e)||this;return r.scheduleVelocityCheck=function(){return H.postRender(r.velocityCheck)},r.velocityCheck=function(t){t.timestamp!==r.lastUpdated&&(r.prev=r.current)},r.prev=r.current=e.value||0,mr(r.current)?(r.updateCurrent=function(t){return r.current=t},r.getVelocityOfCurrent=function(){return r.getSingleVelocity(r.current,r.prev)}):hr(r.current)?(r.updateCurrent=function(t){return r.current=t.slice()},r.getVelocityOfCurrent=function(){return r.getListVelocity()}):(r.updateCurrent=function(t){for(var e in r.current={},t)t.hasOwnProperty(e)&&(r.current[e]=t[e])},r.getVelocityOfCurrent=function(){return r.getMapVelocity()}),e.initialSubscription&&r.subscribe(e.initialSubscription),r}return e(r,t),r.prototype.create=function(t){return new r(t)},r.prototype.get=function(){return this.current},r.prototype.getVelocity=function(){return this.getVelocityOfCurrent()},r.prototype.update=function(e){t.prototype.update.call(this,e),this.prev=this.current,this.updateCurrent(e);var r=J(),n=r.delta,o=r.timestamp;this.timeDelta=n,this.lastUpdated=o,H.postRender(this.scheduleVelocityCheck)},r.prototype.subscribe=function(e){var r=t.prototype.subscribe.call(this,e);return this.subscribers[this.subscribers.length-1].update(this.current),r},r.prototype.getSingleVelocity=function(t,e){return"number"==typeof t&&"number"==typeof e?ve(t-e,this.timeDelta):ve(parseFloat(t)-parseFloat(e),this.timeDelta)||0},r.prototype.getListVelocity=function(){var t=this;return this.current.map(function(e,r){return t.getSingleVelocity(e,t.prev[r])})},r.prototype.getMapVelocity=function(){var t={};for(var e in this.current)this.current.hasOwnProperty(e)&&(t[e]=this.getSingleVelocity(this.current[e],this.prev[e]));return t},r}(pr),yr=function(t,e){return new gr({value:t,initialSubscription:e})},br=function(t){var e=t.getCount,r=t.getFirst,n=t.getOutput,o=t.mapApi,i=t.setProp,u=t.startActions;return function(t){return fr(function(a){var s=a.update,c=a.complete,f=a.error,p=e(t),l=n(),d=function(){return s(l)},v=0,h=u(t,function(t,e){var r=!1;return t.start({complete:function(){r||(r=!0,++v===p&&H.update(c))},error:f,update:function(t){i(l,e,t),H.update(d,!1,!0)}})});return Object.keys(r(h)).reduce(function(t,e){return t[e]=o(h,e),t},{})})}},wr=br({getOutput:function(){return{}},getCount:function(t){return Object.keys(t).length},getFirst:function(t){return t[Object.keys(t)[0]]},mapApi:function(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return Object.keys(t).reduce(function(n,o){var i;return t[o][e]&&(r[0]&&void 0!==r[0][o]?n[o]=t[o][e](r[0][o]):n[o]=(i=t[o])[e].apply(i,r)),n},{})}},setProp:function(t,e,r){return t[e]=r},startActions:function(t,e){return Object.keys(t).reduce(function(r,n){return r[n]=e(t[n],n),r},{})}}),Or=br({getOutput:function(){return[]},getCount:function(t){return t.length},getFirst:function(t){return t[0]},mapApi:function(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.map(function(t,n){if(t[e])return Array.isArray(r[0])?t[e](r[0][n]):t[e].apply(t,r)})}},setProp:function(t,e,r){return t[e]=r},startActions:function(t,e){return t.map(function(t,r){return e(t,r)})}}),Pr=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Or(t)},xr=[g,m,h,y,b],Ar=function(t){return xr.find(function(e){return e.test(t)})},Sr=function(t,e){return t(e)},Er=function(t,e,n){var o=n[0],i=e[o].map(function(o,i){var u=n.reduce(function(t){return function(e,r){return e[r]=e[r][t],e}}(i),r({},e));return Dr(o)(t,u)});return Pr.apply(void 0,i)},Cr=function(t,e,n){var o=n[0],i=Object.keys(e[o]).reduce(function(i,u){var a=n.reduce(function(t){return function(e,r){return e[r]=e[r][t],e}}(u),r({},e));return i[u]=Dr(e[o][u])(t,a),i},{});return wr(i)},Vr=function(t,e){var o=e.from,i=e.to,u=n(e,["from","to"]),a=Ar(o)||Ar(i),s=a.transform,c=a.parse;return t(r({},u,{from:"string"==typeof o?c(o):o,to:"string"==typeof i?c(i):i})).pipe(s)},Mr=function(t){return function(e,o){var i=o.from,u=o.to,a=n(o,["from","to"]);return e(r({},a,{from:0,to:1})).pipe(t(i,u))}},kr=Mr(Kt),Tr=Mr(oe),Rr=function(t,e){var r=function(t){var e=Object.keys(t),r=function(e,r){return void 0!==e&&!t[r](e)};return{getVectorKeys:function(t){return e.reduce(function(e,n){return r(t[n],n)&&e.push(n),e},[])},testVectorProps:function(t){return t&&e.some(function(e){return r(t[e],e)})}}}(e),n=r.testVectorProps,o=r.getVectorKeys;return function(e){if(!n(e))return t(e);var r=o(e),i=e[r[0]];return Dr(i)(t,e,r)}},Dr=function(t){return"number"==typeof t?Sr:Array.isArray(t)?Er:function(t){return Boolean(Ar(t))}(t)?Vr:T.test(t)?kr:D.test(t)?Tr:"object"==typeof t?Cr:Sr},jr=Rr(function(t){return void 0===t&&(t={}),fr(function(e){var r=e.complete,n=e.update,o=t.velocity,i=void 0===o?0:o,u=t.from,a=void 0===u?0:u,s=t.power,c=void 0===s?.8:s,f=t.timeConstant,p=void 0===f?350:f,l=t.restDelta,d=void 0===l?.5:l,v=t.modifyTarget,h=0,m=c*i,g=Math.round(a+m),y=void 0===v?g:v(g),b=H.update(function(t){var e=t.delta;h+=e;var o=-m*Math.exp(-h/p),i=o>d||o<-d;n(i?y+o:y),i||($.update(b),r())},!0);return{stop:function(){return $.update(b)}}})},{from:p.test,modifyTarget:function(t){return"function"==typeof t},velocity:p.test}),Fr=Rr(function(t){return void 0===t&&(t={}),fr(function(e){var r=e.update,n=e.complete,o=t.velocity,i=void 0===o?0:o,u=t.from,a=void 0===u?0:u,s=t.to,c=void 0===s?0:s,f=t.stiffness,p=void 0===f?100:f,l=t.damping,d=void 0===l?10:l,v=t.mass,h=void 0===v?1:v,m=t.restSpeed,g=void 0===m?.01:m,y=t.restDelta,b=void 0===y?.01:y,w=i?-i/1e3:0,O=0,P=c-a,x=a,A=x,S=H.update(function(t){var e=t.delta;O+=e;var o=d/(2*Math.sqrt(p*h)),u=Math.sqrt(p/h)/1e3;if(A=x,o<1){var a=Math.exp(-o*u*O),s=u*Math.sqrt(1-o*o);x=c-a*((w+o*u*P)/s*Math.sin(s*O)+P*Math.cos(s*O))}else a=Math.exp(-u*O),x=c-a*(P+(w+u*P)*O);i=ve(x-A,e);var f=Math.abs(i)<=g,l=Math.abs(c-x)<=b;f&&l?(r(x=c),$.update(S),n()):r(x)},!0);return{stop:function(){return $.update(S)}}})},{from:p.test,to:p.test,stiffness:p.test,damping:p.test,mass:p.test,velocity:p.test}),Ir=Rr(function(t){var e=t.from,n=void 0===e?0:e,o=t.velocity,i=void 0===o?0:o,u=t.min,a=t.max,s=t.power,c=void 0===s?.8:s,f=t.timeConstant,p=void 0===f?700:f,l=t.bounceStiffness,d=void 0===l?500:l,v=t.bounceDamping,h=void 0===v?10:v,m=t.restDelta,g=void 0===m?1:m,y=t.modifyTarget;return fr(function(t){var e,o=t.update,s=t.complete,f=yr(n),l=!1,v=function(t){return void 0!==u&&t<=u},m=function(t){return void 0!==a&&t>=a},b=function(t){return v(t)||m(t)},w=function(t,r){e&&e.stop(),e=t.start({update:function(t){return f.update(t)},complete:function(){r?r():s()}})},O=function(t){l=!0,w(Fr(r({},t,{to:v(t.from)?u:a,stiffness:d,damping:h,restDelta:g})))};if(f.subscribe(function(t){o(t);var r=f.getVelocity();e&&!l&&function(t,e){return v(t)&&e<0||m(t)&&e>0}(t,r)&&O({from:t,velocity:r})}),b(n))O({from:n,velocity:i});else if(0!==i){var P=jr({from:n,velocity:i,timeConstant:p,power:c,restDelta:b(n)?20:g,modifyTarget:y});w(P,function(){var t=f.get();b(t)?O({from:t,velocity:f.getVelocity()}):s()})}else s();return{stop:function(){return e&&e.stop()}}})},{from:p.test,velocity:p.test,min:p.test,max:p.test,damping:p.test,stiffness:p.test,modifyTarget:function(t){return"function"==typeof t}}),Br=Rr(function(t){var e=t.from,r=void 0===e?0:e,n=t.to,o=void 0===n?1:n,i=t.ease,u=void 0===i?ut:i,a=t.reverseEase;return void 0!==a&&a&&(u=et(u)),fr(function(t){var e=t.update;return{seek:function(t){return e(t)}}}).pipe(u,function(t){return Ut(r,o,t)})},{ease:function(t){return"function"==typeof t},from:p.test,to:p.test}),Xr=Xt(0,1),Yr=function(t){return void 0===t&&(t={}),fr(function(e){var r,n=e.update,o=e.complete,i=t.duration,u=void 0===i?300:i,a=t.ease,s=void 0===a?st:a,c=t.flip,f=void 0===c?0:c,p=t.loop,l=void 0===p?0:p,d=t.yoyo,v=void 0===d?0:d,h=t.repeatDelay,m=void 0===h?0:h,g=t.from,y=void 0===g?0:g,b=t.to,w=void 0===b?1:b,O=t.elapsed,P=void 0===O?0:O,x=t.flipCount,A=void 0===x?0:x,S=t.yoyoCount,E=void 0===S?0:S,C=t.loopCount,V=void 0===C?0:C,M=Br({from:y,to:w,ease:s}).start(n),k=0,T=!1,R=function(t){var e;void 0===t&&(t=!1),M=Br({from:y=(e=[w,y])[0],to:w=e[1],ease:s,reverseEase:t}).start(n)},D=function(){k=Xr(qt(0,u,P)),M.seek(k)},j=function(){T=!0,r=H.update(function(t){var e,n=t.delta;P+=n,D(),!(e=T&&P>u+m)||(!e||l||f||v)&&(P=u-(P-m),l&&V<l?(V++,1):f&&A<f?(A++,R(),1):v&&E<v&&(R(++E%2!=0),1))||($.update(r),o&&H.update(o,!1,!0))},!0)},F=function(){T=!1,r&&$.update(r)};return j(),{isActive:function(){return T},getElapsed:function(){return Xt(0,u,P)},getProgress:function(){return k},stop:function(){F()},pause:function(){return F(),this},resume:function(){return T||j(),this},seek:function(t){return P=Ut(0,u,t),H.update(D,!1,!0),this},reverse:function(){return R(),this}}})},Lr=Xt(0,1),zr=function(t){var e=t.easings,o=t.ease,i=void 0===o?ut:o,u=t.times,a=t.values,s=n(t,["easings","ease","times","values"]);e=Array.isArray(e)?e:function(t,e){return t.map(function(){return e||st}).splice(0,t.length-1)}(a,e),u=u||function(t){var e=t.length;return t.map(function(t,r){return 0!==r?r/(e-1):0})}(a);var c=e.map(function(t,e){return Br({from:a[e],to:a[e+1],ease:t})});return Yr(r({},s,{ease:i})).applyMiddleware(function(t){return function(t,e,r){var n=t.length,o=n-1,i=o-1,u=e.map(function(t){return t.start(r)});return function(e){e<=t[0]&&u[0].seek(0),e>=t[o]&&u[i].seek(1);for(var r=1;r<n&&!(t[r]>e||r===o);r++);var a=qt(t[r-1],t[r],e);u[r-1].seek(Lr(a))}}(u,c,t)})},Nr=Rr(function(t){return void 0===t&&(t={}),fr(function(e){var r=e.complete,n=e.update,o=t.acceleration,i=void 0===o?0:o,u=t.friction,a=void 0===u?0:u,s=t.velocity,c=void 0===s?0:s,f=t.springStrength,p=t.to,l=t.restSpeed,d=void 0===l?.001:l,v=t.from,h=void 0===v?0:v,m=H.update(function(t){var e=t.delta,o=Math.max(e,16);i&&(c+=de(i,o)),a&&(c*=Math.pow(1-a,o/100)),void 0!==f&&void 0!==p&&(c+=(p-h)*de(f,o)),h+=de(c,o),n(h),!1!==d&&(!c||Math.abs(c)<=d)&&($.update(m),r())},!0);return{set:function(t){return h=t,this},setAcceleration:function(t){return i=t,this},setFriction:function(t){return a=t,this},setSpringStrength:function(t){return f=t,this},setSpringTarget:function(t){return p=t,this},setVelocity:function(t){return c=t,this},stop:function(){return $.update(m)}}})},{acceleration:p.test,friction:p.test,velocity:p.test,from:p.test,to:p.test,springStrength:p.test}),Wr=function(t,e){return Array.isArray(e)?t.push.apply(t,function(t){var e=[],r=t[t.length-1],n="number"==typeof r,o=n?r:0,i=n?t.slice(0,-1):t,u=i.length,a=0;return i.forEach(function(t,r){if(e.push(t),r!==u-1){var n=t.duration||300;a+=o,e.push("-"+(n-a))}}),e}(e)):t.push(e),t},qr=function(t,e,r){var n=t.duration,o=t.easings,i=t.times,u=t.values,a=u.length,s=i[a-1],c=0===e.at?0:e.at/n,f=(e.at+e.duration)/n;if(0===r)u.push(e.from),i.push(c);else if(s!==c){void 0!==e.from&&(u.push(u[a-1]),i.push(c),o.push(ut));var p=void 0!==e.from?e.from:u[a-1];u.push(p),i.push(c),o.push(ut)}else void 0!==e.from&&(u.push(e.from),i.push(c),o.push(ut));return u.push(e.to),i.push(f),o.push(e.ease||ct),t},Ur=function(t,e,r){return fr(function(n){var o=n.update,i=e.split(" ").map(function(e){return t.addEventListener(e,o,r),e});return{stop:function(){return i.forEach(function(e){return t.removeEventListener(e,o,r)})}}})},Zr=function(t,e){return void 0===e&&(e={clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}),e.clientX=e.x=t.clientX,e.clientY=e.y=t.clientY,e.pageX=t.pageX,e.pageY=t.pageY,e},Hr=[{clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}],$r=!1;if("undefined"!=typeof document){Ur(document,"touchstart touchmove",{passive:!0,capture:!0}).start(function(t){var e=t.touches;$r=!0;var r=e.length;Hr.length=0;for(var n=0;n<r;n++){var o=e[n];Hr.push(Zr(o))}})}var _r=function(t){var e=void 0===t?{}:t,r=e.preventDefault,n=void 0===r||r,o=e.scale,i=void 0===o?1:o,u=e.rotate,a=void 0===u?0:u;return fr(function(t){var e=t.update,r={touches:Hr,scale:i,rotate:a},o=0,u=0,s=Hr.length>1;if(s){var c=Hr[0],f=Hr[1];o=Wt(c,f),u=Ft(c,f)}var p=function(){if(s){var t=Hr[0],n=Hr[1],c=Wt(t,n),f=Ft(t,n);r.scale=i*(c/o),r.rotate=a+(f-u)}e(r)},l=Ur(document,"touchmove",{passive:!n}).start(function(t){(n||t.touches.length>1)&&t.preventDefault(),H.update(p)});return $r&&H.update(p),{stop:function(){$.update(p),l.stop()}}})},Gr={clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0},Kr=!1;if("undefined"!=typeof document){Ur(document,"mousedown mousemove",!0).start(function(t){Kr=!0,Zr(t,Gr)})}var Jr,Qr=function(t){var e=(void 0===t?{}:t).preventDefault,r=void 0===e||e;return fr(function(t){var e=t.update,n=function(){return e(Gr)},o=Ur(document,"mousemove").start(function(t){r&&t.preventDefault(),H.update(n)});return Kr&&H.update(n),{stop:function(){$.update(n),o.stop()}}})},tn=function(t){return t[0]},en=function(t){return void 0===t&&(t={}),$r?_r(t).pipe(function(t){return t.touches},tn):Qr(t)},rn=function(t){void 0===t&&(t={});var e=t.x,r=t.y,o=n(t,["x","y"]);if(void 0!==e||void 0!==r){var i=It(e||0),u=It(r||0),a={x:0,y:0};return en(o).pipe(function(t){return a.x=i(t.x),a.y=u(t.y),a})}return en(o)},nn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return fr(function(e){var r,n=e.update,o=e.complete,i=0,u=function(){r=t[i].start({complete:function(){++i>=t.length?o():u()},update:n})};return u(),{stop:function(){return r&&r.stop()}}})},on=function(t){return fr(function(e){var r=e.complete,n=setTimeout(r,t);return{stop:function(){return clearTimeout(n)}}})},un=Object.freeze({applyOffset:It,clamp:Xt,conditional:function(t,e){return function(r){return t(r)?e(r):r}},interpolate:function(t,e,r){var n=void 0===r?{}:r,o=n.clamp,i=void 0===o||o,u=n.ease,a=n.mixer,s=t.length;F(s===e.length,"Both input and output ranges must be the same length"),F(!u||!Array.isArray(u)||u.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());var c=ue(e,u,a),f=2===s?function(t,e){var r=t[0],n=t[1],o=e[0];return function(t){return o(qt(r,n,t))}}(t,c):function(t,e){var r=t.length,n=r-1;return function(o){var i=0,u=!1;if(o<=t[0]?u=!0:o>=t[n]&&(i=n-1,u=!0),!u){for(var a=1;a<r&&!(t[a]>o||a===n);a++);i=a-1}var s=qt(t[i],t[i+1],o);return e[i](s)}}(t,c);return i?Qt(Xt(t[0],t[s-1]),f):f},blendArray:ee,blendColor:Kt,pipe:Qt,smooth:function(t){void 0===t&&(t=50);var e=0,r=0;return function(n){var o=J().timestamp,i=o!==r?o-r:0,u=i?se(e,n,i,t):e;return r=o,e=u,u}},snap:function(t){if("number"==typeof t)return function(e){return Math.round(e/t)*t};var e=0,r=t.length;return function(n){var o=Math.abs(t[0]-n);for(e=1;e<r;e++){var i=t[e],u=Math.abs(i-n);if(0===u)return i;if(u>o)return t[e-1];if(e===r-1)return i;o=u}}},generateStaticSpring:fe,nonlinearSpring:le,linearSpring:pe,wrap:he,appendUnit:function(t){return function(e){return""+e+t}},steps:function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=1),function(n){var o=qt(e,r,n);return Ut(e,r,dr(t,o))}},transformMap:function(t){return function(e){var n=r({},e);for(var o in t)if(t.hasOwnProperty(o)){var i=t[o];n[o]=i(e[o])}return n}}}),an=Object.freeze({valueTypes:j,easing:Tt,action:fr,multicast:function(){return new lr},value:yr,decay:jr,inertia:Ir,keyframes:zr,everyFrame:function(){return fr(function(t){var e=t.update,r=0,n=H.update(function(t){var n=t.timestamp;r||(r=n),e(n-r)},!0,!0);return{stop:function(){return $.update(n)}}})},physics:Nr,spring:Fr,timeline:function(t,e){var n=void 0===e?{}:e,o=n.duration,i=n.elapsed,u=n.ease,a=n.loop,s=n.flip,c=n.yoyo,f=0,p=0,l=[];t.reduce(Wr,[]).forEach(function(t){if("string"==typeof t)f+=parseFloat(t);else if("number"==typeof t)f=t;else{var e=r({},t,{at:f});e.duration=void 0===e.duration?300:e.duration,l.push(e),f+=e.duration,p=Math.max(p,e.at+e.duration)}});for(var d={},v=l.length,h=0;h<v;h++){var m=l[h],g=m.track;if(void 0===g)throw new Error("No track defined");d.hasOwnProperty(g)||(d[g]=[]),d[g].push(m)}var y={};for(var b in d)if(d.hasOwnProperty(b)){var w=d[b].reduce(qr,{duration:p,easings:[],times:[],values:[]});y[b]=zr(r({},w,{duration:o||p,ease:u,elapsed:i,loop:a,yoyo:c,flip:s}))}return wr(y)},tween:Yr,listen:Ur,pointer:rn,mouse:Qr,multitouch:_r,chain:nn,composite:wr,crossfade:function(t,e){return fr(function(n){var o=0,i=Pr(t,e).start(r({},n,{update:function(t){var e=t[0],r=t[1];n.update(Ut(e,r,o))}}));return{setBalance:function(t){return o=t},stop:function(){return i.stop()}}})},delay:on,merge:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return fr(function(e){var r=t.map(function(t){return t.start(e)});return{stop:function(){return r.forEach(function(t){return t.stop()})}}})},parallel:Pr,schedule:function(t,e){return fr(function(r){var n,o=r.update,i=r.complete,u=t.start({update:function(){return void 0!==n&&o(n)},complete:i}),a=e.start({update:function(t){return n=t},complete:i});return{stop:function(){u.stop(),a.stop()}}})},stagger:function(t,e){var r="number"==typeof e,n=t.map(function(t,n){var o=r?e*n:e(n);return nn(on(o),t)});return Pr.apply(void 0,n)},calc:vr,transform:un,css:function(t,e){return ir(t,e)},svg:function(t,e){return ir(t,e)},Action:cr,ValueReaction:gr,styler:ir}),sn=function(t){t.transition,t.flip,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection,t.afterChildren,t.beforeChildren,t.preTransition,t.applyAtStart,t.applyAtEnd;return n(t,["transition","flip","delay","delayChildren","staggerChildren","staggerDirection","afterChildren","beforeChildren","preTransition","applyAtStart","applyAtEnd"])},cn=function(t,e){return"function"==typeof t?t(e):t},fn=function(t,e,r,n){return t&&void 0!==t[e]?cn(t[e],n):r},pn=function(t,e,r,n,o,i){var u;if("function"==typeof t){var a=t(n);u=pn(a,e,r,n,o,i)}else if(t[e]||t.default){var s=t[e]||t.default;u="function"==typeof s?s(n):s}else u=t;return!1===u?i(r,n):o(r,u,n)},ln=function(t,e,r,n,o){return Object.keys(t).forEach(function(i){var u=cn(t[i],r);e.has(i)?n(e.get(i),u):o(i,u,r)})},dn=function(t){var e=t.state,n=t.poses,i=t.startAction,u=t.stopAction,a=t.getInstantTransition,s=t.addActionDelay,c=t.getTransitionProps,f=t.resolveTarget,p=t.transformPose,l=t.posePriority,d=t.convertTransitionDefinition,v=t.setValue,h=t.setValueNative,m=t.forceRender;return function(t,g,y){void 0===g&&(g={}),void 0===y&&(y=!0);var b=e.children,w=e.values,O=e.props,P=e.activeActions,x=e.activePoses,A=g.delay,S=void 0===A?0:A,E=b.size,C=r(r({},O),g),V=n[t],M=function(){return E&&y?function(t,e,r,n){var o=[],i=fn(r,"delayChildren",0,n),u=fn(r,"staggerChildren",0,n),a=fn(r,"staggerDirection",1,n),s=(t.size-1)*u,c=1===a?function(t){return t*u}:function(t){return s-t*u};return Array.from(t).forEach(function(t,r){o.push(t.set(e,{delay:i+c(r)}))}),o}(b,t,V,C):[]},k=function(){if(!V)return[];var n=V.applyAtStart;n&&(ln(n,w,C,v,h),m&&m(C)),p&&(V=p(V,t,e));var o=V.preTransition,g=V.transition,y=V.applyAtEnd;o&&o(C);var b=Object.keys(sn(V)).map(function(e){var n=x.has(e)?x.get(e):(x.set(e,[]),x.get(e)),o=n.indexOf(t);-1!==o&&n.splice(o,1);var p=l?l.indexOf(t):0,v=p<=0?0:function(t,e,r){for(var n=0,o=r-1;o>=0;o--){var i=t.indexOf(e[o]);if(-1!==i){n=i+1;break}}return n}(n,l,p);return n.splice(v,0,t),0===v?new Promise(function(t){var n=w.get(e),o=r(r({},C),{key:e,value:n}),p=f(n,cn(V[e],o));P.has(e)&&u(P.get(e));var l=r(r({to:p},o),c(n,p,o)),v=pn(g,e,n,l,d,a),h=S||cn(V.delay,o);h&&(v=s(h,v)),P.set(e,i(n,v,t))}):Promise.resolve()});return y?[Promise.all(b).then(function(){ln(y,w,C,v,h)})]:b};if(V&&E){if(cn(V.beforeChildren,C))return Promise.all(k()).then(function(){return Promise.all(M())});if(cn(V.afterChildren,C))return Promise.all(M()).then(function(){return Promise.all(k())})}return Promise.all(o(k(),M()))}},vn=function(t){return function(t){return t.includes("scale")}(t)?1:0},hn=function(t){var e=Array.isArray(t)?t:[t];return e.push("init"),e},mn=function(t,e,r,n,o,i){void 0===o&&(o=vn);var u=hn(r).filter(Boolean).find(function(r){var n=t[r];return n&&(void 0!==n[e]||n.applyAtStart&&void 0!==n.applyAtStart[e]||n.applyAtEnd&&void 0!==n.applyAtEnd[e])});return i.set(e,[u||"init"]),u?function(t,e,r){var n=t.applyAtEnd&&void 0!==t.applyAtEnd[e]?t.applyAtEnd[e]:void 0!==t[e]?t[e]:t.applyAtStart&&void 0!==t.applyAtStart[e]?t.applyAtStart[e]:0;return cn(n,r)}(t[u],e,n):o(e,n)},gn=function(t,e){return function(r){var n=e.poses[r];Object.keys(sn(n)).forEach(function(t,e){var r=e.userSetValues,n=e.createValue,o=e.convertValue,i=e.readValueFromSource,u=e.initialPose,a=e.poses,s=e.activePoses,c=e.props;return function(e){if(!t.has(e)){var f;if(r&&void 0!==r[e])f=o(r[e],e,c);else{var p=mn(a,e,u,c,i,s);f=n(p,e,c)}t.set(e,f)}}}(t,e))}},yn=function(t){var e=t.poses,r=t.passive,n=new Map;return Object.keys(e).forEach(gn(n,t)),function(t){var e=t.setValueNative,r=t.initialPose,n=t.props,o=t.poses,i=new Set,u=function(t,r){if(t[r])for(var o in t[r])i.has(o)||(i.add(o),e(o,cn(t[r][o],n),n))};hn(r).forEach(function(t){var e=o[t];e&&(u(e,"applyAtEnd"),u(e,"applyAtStart"))})}(t),r&&Object.keys(r).forEach(function(t,e){var r=e.passive,n=e.ancestorValues,o=e.createValue,i=e.readValue,u=e.props;return function(e){var a=r[e],s=a[0],c=a[1],f=a[2],p=f&&n.length?function(t,e,r){if(!0===e)return r[0]&&r[0].values.get(t);var n=r.find(function(t){return t.label===e});return n&&n.values.get(t)}(s,f,n):!!t.has(s)&&t.get(s);if(p){var l=o(i(p),e,u,{passiveParentKey:s,passiveParent:p,passiveProps:c});t.set(e,l)}}}(n,t)),n},bn=function(t,e){return Object.keys(t).forEach(function(n){var o=t[n];t[n]=void 0!==o.transition?o:function(t,e,n){return r(r({},t),{transition:n.has(e)?n.get(e):n.get("default")})}(o,n,e)}),t},wn=function(t){var e=t.getDefaultProps,i=t.defaultTransitions,u=t.bindOnChange,a=t.startAction,s=t.stopAction,c=t.readValue,f=t.readValueFromSource,p=t.resolveTarget,l=t.setValue,d=t.setValueNative,v=t.createValue,h=t.convertValue,m=t.getInstantTransition,g=t.getTransitionProps,y=t.addActionDelay,b=t.selectValueToRead,w=t.convertTransitionDefinition,O=t.transformPose,P=t.posePriority,x=t.forceRender,A=t.extendAPI;return function(t){var S=t.parentValues,E=t.ancestorValues,C=void 0===E?[]:E;S&&C.unshift({values:S});var V=new Map,M=new Map,k=new Set,T=bn(function(t){t.label,t.props,t.values,t.parentValues,t.ancestorValues,t.onChange,t.passive,t.initialPose;return n(t,["label","props","values","parentValues","ancestorValues","onChange","passive","initialPose"])}(t),i),R=t.props,D=void 0===R?{}:R;e&&(D=r(r({},e(t)),D));var j=t.passive,F=t.values,I=t.initialPose,B=void 0===I?"init":I,X=yn({poses:T,passive:j,ancestorValues:C,readValue:c,setValueNative:d,createValue:v,convertValue:h,readValueFromSource:f,userSetValues:F,initialPose:B,activePoses:M,props:D}),Y={activeActions:V,activePoses:M,children:k,props:D,values:X},L=t.onChange;L&&Object.keys(L).forEach(u(X,L));var z=dn({state:Y,poses:T,getInstantTransition:m,getTransitionProps:g,convertTransitionDefinition:w,setValue:l,setValueNative:d,startAction:a,stopAction:s,resolveTarget:p,addActionDelay:y,transformPose:O,posePriority:P,forceRender:x});return A({set:z,unset:function(t,e){var r=[];M.forEach(function(e){var n=e.indexOf(t);if(-1!==n){var o=e[0];e.splice(n,1);var i=e[0];i!==o&&-1===r.indexOf(i)&&r.push(i)}});var n,o=r.sort((n=P,function(t,e){var r=n.indexOf(t),o=n.indexOf(e);return-1===r&&-1!==o?-1:-1!==r&&-1===o?1:r-o})).map(function(t){return z(t,e,!1)});return k.forEach(function(e){return o.push(e.unset(t))}),Promise.all(o)},get:function(t){return t?b(X.get(t)):function(t,e){var r={};return t.forEach(function(t,n){return r[n]=e(t)}),r}(X,b)},has:function(t){return!!T[t]},setProps:function(t){return Y.props=r(r({},Y.props),t)},_addChild:function(e,n){var i=n(r(r({initialPose:B},e),{ancestorValues:o([{label:t.label,values:X}],C)}));return k.add(i),i},removeChild:function(t){return k.delete(t)},clearChildren:function(){k.forEach(function(t){return t.destroy()}),k.clear()},destroy:function(){V.forEach(s),k.forEach(function(t){return t.destroy()})}},Y,t)}};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Jr||(Jr={}));var On=function(t,e){return"function"==typeof t?t(e):t},Pn=un.interpolate,xn=function(t){return function(e){var r;return rn((r={},r[t]="string"==typeof e?parseFloat(e):e,r)).pipe(function(e){return e[t]})}},An=xn("x"),Sn=xn("y"),En=function(t,e,r,n){return function(o){var i=o.from,u=o.type,a=o.dimensions,s=o.dragBounds,c=t(a.measurementAsPixels(n,i,u)),f=[];if(s){var p=On(s,o);void 0!==p[e]&&f.push(function(t){return Math.max(t,a.measurementAsPixels(n,p[e],u))}),void 0!==p[r]&&f.push(function(t){return Math.min(t,a.measurementAsPixels(n,p[r],u))})}return u===m&&f.push(Pn([0,a.get(n)],[0,100],{clamp:!1}),function(t){return t+"%"}),f.length?c.pipe.apply(c,f):c}},Cn=function(t){return fr(function(e){var r=e.update,n=e.complete;r(t),n()})},Vn=function(t){var e=t.from,r=t.velocity,n=t.to;return Fr({from:e,to:n,velocity:r,stiffness:500,damping:25,restDelta:.5,restSpeed:10})},Mn=function(t){var e=t.from,r=t.velocity,n=t.to;return Fr({from:e,to:n,velocity:r,stiffness:700,damping:0===n?100:35})},kn={x:Vn,y:Vn,z:Vn,rotate:Vn,rotateX:Vn,rotateY:Vn,rotateZ:Vn,scaleX:Mn,scaleY:Mn,scale:Mn,opacity:function(t){var e=t.from,r=t.to;return Yr({from:e,to:r,ease:ut})},default:Yr},Tn=r(r({},kn),{x:En(An,"left","right",Jr.width),y:En(Sn,"top","bottom",Jr.height)}),Rn=function(t){var e=t.from;return Cn(e)},Dn=r(r({},kn),{x:Rn,y:Rn}),jn=new Map([["default",kn],["drag",Tn],["dragEnd",Dn]]),Fn={tween:Yr,spring:Fr,decay:jr,keyframes:zr,physics:Nr},In={linear:ut,easeIn:at,easeOut:st,easeInOut:ct,circIn:ft,circOut:pt,circInOut:lt,backIn:dt,backOut:vt,backInOut:ht,anticipate:mt},Bn=[p,h,m,g,b,y,{test:function(t){return"auto"===t},parse:function(t){return t}}],Xn=function(t){return Bn.find(function(t){return function(e){return e.test(t)}}(t))},Yn=function(t,e){return void 0===t&&(t=0),nn(on(t),e)},Ln=function(t){var e=t.startEvents,r=t.endEvents,n=t.startPose,o=t.endPose,i=t.startCallback,u=t.endCallback,a=t.useDocumentToEnd,s=t.preventScroll;return function(t,c,f,p){var l=n+"Start",d=n+"End",v=n+"Move";if(s){var h=Ur(t,"touchmove",{passive:!1}).start(function(t){t.preventDefault()});c.set(v,h)}var m=Ur(t,e).start(function(e){f.unset(o),f.set(n),i&&p[i]&&p[i](e);var s=Ur(a?document.documentElement:t,r+(a?" mouseenter":"")).start(function(t){a&&"mouseenter"===t.type&&1===t.buttons||(c.get(d).stop(),f.unset(n),f.set(o),u&&p[u]&&p[u](t))});c.set(d,s)});c.set(l,m)}},zn={draggable:Ln({startEvents:"mousedown touchstart",endEvents:"mouseup touchend",startPose:"drag",endPose:"dragEnd",startCallback:"onDragStart",endCallback:"onDragEnd",useDocumentToEnd:!0,preventScroll:!0}),hoverable:Ln({startEvents:"mouseenter",endEvents:"mouseleave",startPose:"hover",endPose:"hoverEnd"}),focusable:Ln({startEvents:"focus",endEvents:"blur",startPose:"focus",endPose:"blur"}),pressable:Ln({startEvents:"mousedown touchstart",endEvents:"mouseup touchend",startPose:"press",endPose:"pressEnd",startCallback:"onPressStart",endCallback:"onPressEnd",useDocumentToEnd:!0})},Nn=Object.keys(zn),Wn=function(t){var e=t.top,r=t.right,n=t.bottom;return{x:(t.left+r)/2,y:(e+n)/2}},qn=["width","height","top","left","bottom","right"],Un=new Set(qn),Zn=function(t){return Un.has(t)},Hn=function(t,e,r){var n=t.values,o=t.props;if(n.has(e)){var i=n.get(e).raw;i.update(r),i.update(r)}else n.set(e,{raw:yr(r,function(t){return o.elementStyler.set(e,t)})})},$n=function(t,e){var r=t.props,n=r.dimensions,o=r.element,i=r.elementStyler;if(!n.has())return{};var u=n.get(),a=function(t){var e=t.style.transform;t.style.transform="";var r=t.getBoundingClientRect();return t.style.transform=e,r}(o),s=u.left===a.left?0:u.right===a.right?"100%":"50%",c=u.top===a.top?0:u.bottom===a.bottom?"100%":"50%";i.set({originX:s,originY:c}),u.width!==a.width&&(Hn(t,"scaleX",u.width/a.width),e.scaleX=1),u.height!==a.height&&(Hn(t,"scaleY",u.height/a.height),e.scaleY=1);var f=Wn(u),p=Wn(a);return"50%"===s&&(Hn(t,"x",f.x-p.x),e.x=0),"50%"===c&&(Hn(t,"y",f.y-p.y),e.y=0),i.render(),e},_n=function(t,e){return r=e,Object.keys(r).some(Zn)?function(t,e){var r=t.props,o=r.dimensions,i=r.elementStyler;o.measure();e.width,e.height,e.top,e.left,e.bottom,e.right,e.position;var u=n(e,["width","height","top","left","bottom","right","position"]),a=qn.concat("position").reduce(function(r,n){return void 0!==e[n]&&(r[n]=On(e[n],t.props)),r},{});return i.set(a).render(),$n(t,u)}(t,e):$n(t,e);var r},Gn=function(t,e){return parseFloat(t.split(", ")[e])},Kn=function(t,e)