UNPKG

vue-pose

Version:

A declarative animation library for Vue

1 lines 54.8 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):e(t.Vue)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,n)};function n(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function o(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&(n[r[o]]=t[r[o]])}return n}var i,a=function(){return(a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},u=function(t,e){return function(n){return Math.max(Math.min(n,e),t)}},s=function(t){return function(e){return"string"==typeof e&&0===e.indexOf(t)}},c=function(t){return t%1?Number(t.toFixed(5)):t},f={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},p=a({},f,{transform:u(0,1)}),l=a({},f,{default:1}),d=function(t){return{test:function(e){return"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},v=d("deg"),h=d("%"),g=d("px"),m=d("vh"),y=d("vw"),b=(a({},h,{parse:function(t){return h.parse(t)/100},transform:function(t){return h.transform(100*t)}}),u(0,255)),P=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$/i,w=function(t){return void 0!==t.red},O=function(t){return void 0!==t.hue},x=function(t){var e=t.length;return function(n){if("string"!=typeof n)return n;for(var r,o={},i=function(t){return"string"==typeof t?t.split(/,\s*/):[t]}((r=n).substring(r.indexOf("(")+1,r.lastIndexOf(")"))),a=0;a<e;a++)o[t[a]]=void 0!==i[a]?parseFloat(i[a]):1;return o}},S=a({},f,{transform:function(t){return Math.round(b(t))}}),A=s("rgb"),C={test:function(t){return"string"==typeof t?A(t):w(t)},parse:x(["red","green","blue","alpha"]),transform:function(t){var e=t.red,n=t.green,r=t.blue,o=t.alpha;return function(t){var e=t.red,n=t.green,r=t.blue,o=t.alpha;return"rgba("+e+", "+n+", "+r+", "+(void 0===o?1:o)+")"}({red:S.transform(e),green:S.transform(n),blue:S.transform(r),alpha:c(o)})}},E=s("hsl"),V={test:function(t){return"string"==typeof t?E(t):O(t)},parse:x(["hue","saturation","lightness","alpha"]),transform:function(t){var e=t.hue,n=t.saturation,r=t.lightness,o=t.alpha;return function(t){var e=t.hue,n=t.saturation,r=t.lightness,o=t.alpha;return"hsla("+e+", "+n+", "+r+", "+(void 0===o?1:o)+")"}({hue:Math.round(e),saturation:h.transform(c(n)),lightness:h.transform(c(r)),alpha:c(o)})}},M=a({},C,{test:s("#"),parse:function(t){var e="",n="",r="";return t.length>4?(e=t.substr(1,2),n=t.substr(3,2),r=t.substr(5,2)):(e=t.substr(1,1),n=t.substr(2,1),r=t.substr(3,1),e+=e,n+=n,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:1}}}),k={test:function(t){return"string"==typeof t&&P.test(t)||C.test(t)||V.test(t)||M.test(t)},parse:function(t){return C.test(t)?C.parse(t):V.test(t)?V.parse(t):M.test(t)?M.parse(t):t},transform:function(t){return w(t)?C.transform(t):O(t)?V.transform(t):t}},T=/(-)?(\d[\d\.]*)/g,j=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,R=function(t){if("string"!=typeof t||!isNaN(t))return!1;var e=0,n=t.match(T),r=t.match(j);return n&&(e+=n.length),r&&(e+=r.length),e>0},D=function(t){var e=t,n=[],r=e.match(j);r&&(e=e.replace(j,"${c}"),n.push.apply(n,r.map(k.parse)));var o=e.match(T);return o&&n.push.apply(n,o.map(f.parse)),n},F=function(t){var e=t,n=0,r=t.match(j),o=r?r.length:0;if(r)for(var i=0;i<o;i++)e=e.replace(r[i],"${c}"),n++;var a=e.match(T),u=a?a.length:0;if(a)for(i=0;i<u;i++)e=e.replace(a[i],"${n}"),n++;return function(t){for(var r=e,i=0;i<n;i++)r=r.replace(i<o?"${c}":"${n}",i<o?k.transform(t[i]):c(t[i]));return r}},$=function(){},Y=0,L="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(t){return window.requestAnimationFrame(t)}:function(t){var e=Date.now(),n=Math.max(0,16.7-(e-Y));Y=e+n,setTimeout(function(){return t(Y)},n)};!function(t){t.Read="read",t.Update="update",t.Render="render",t.PostRender="postRender",t.FixedUpdate="fixedUpdate"}(i||(i={}));var X=1/60*1e3,I=!0,B=!1,_=!1,N={delta:0,timestamp:0},U=[i.Read,i.Update,i.Render,i.PostRender],z=function(t){return B=t},q=U.reduce(function(t,e){var n,r,o,i,a,u,s,c,f,p=(n=z,r=[],o=[],i=0,a=!1,u=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(a=!0,r=(e=[o,r])[0],(o=e[1]).length=0,i=r.length)for(u=0;u<i;u++)(p=r[u])(t),!0!==c.has(p)||s.has(p)||(f.schedule(p),n(!0));a=!1},schedule:function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1),$("function"==typeof t,"Argument must be a function");var u=n&&a,f=u?r:o;s.delete(t),e&&c.add(t),-1===f.indexOf(t)&&(f.push(t),u&&(i=r.length))}});return t.sync[e]=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=!1),B||J(),p.schedule(t,e,n),t},t.cancelSync[e]=function(t){return p.cancel(t)},t.steps[e]=p,t},{steps:{},sync:{},cancelSync:{}}),W=q.steps,G=q.sync,Z=q.cancelSync,H=function(t){return W[t].process(N)},K=function(t){B=!1,N.delta=I?X:Math.max(Math.min(t-N.timestamp,40),1),I||(X=N.delta),N.timestamp=t,_=!0,U.forEach(H),_=!1,B&&(I=!1,L(K))},J=function(){B=!0,I=!0,_||L(K)},Q=function(){return N},tt=function(t){return function(e){return 1-t(1-e)}},et=function(t){return function(e){return e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2}},nt=function(t){return function(e){return e*e*((t+1)*e-t)}},rt=function(t){return t},ot=function(t){return function(e){return Math.pow(e,t)}}(2),it=tt(ot),at=et(ot),ut=function(t){return 1-Math.sin(Math.acos(t))},st=tt(ut),ct=et(st),ft=nt(1.525),pt=tt(ft),lt=et(ft),dt=function(t){var e=nt(t);return function(t){return(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))}}(1.525),vt=8,ht=.001,gt=1e-7,mt=10,yt=11,bt=1/(yt-1),Pt="undefined"!=typeof Float32Array,wt=function(t,e){return 1-3*e+3*t},Ot=function(t,e){return 3*e-6*t},xt=function(t){return 3*t},St=function(t,e,n){return 3*wt(e,n)*t*t+2*Ot(e,n)*t+xt(e)},At=function(t,e,n){return((wt(e,n)*t+Ot(e,n))*t+xt(e))*t};function Ct(t,e,n,r){var o=Pt?new Float32Array(yt):new Array(yt),i=function(e){for(var r,i,a,u=0,s=1,c=yt-1;s!==c&&o[s]<=e;++s)u+=bt;return r=(e-o[--s])/(o[s+1]-o[s]),(a=St(i=u+r*bt,t,n))>=ht?function(e,r){for(var o=0,i=0;o<vt;++o){if(0===(i=St(r,t,n)))return r;r-=(At(r,t,n)-e)/i}return r}(e,i):0===a?i:function(e,r,o){var i,a,u=0;do{(i=At(a=r+(o-r)/2,t,n)-e)>0?o=a:r=a}while(Math.abs(i)>gt&&++u<mt);return a}(e,u,u+bt)};!function(){for(var e=0;e<yt;++e)o[e]=At(e*bt,t,n)}();return function(o){return t===e&&n===r?o:0===o?0:1===o?1:At(i(o),e,r)}}var Et={x:0,y:0,z:0},Vt=function(t){return"number"==typeof t},Mt=function(t){return 180*t/Math.PI},kt=function(t,e){return void 0===e&&(e=Et),Mt(Math.atan2(e.y-t.y,e.x-t.x))},Tt=function(t,e){var n=!0;return void 0===e&&(e=t,n=!1),function(r){return n?r-t+e:(t=r,n=!0,e)}},jt=function(t){return function(e,n,r){return void 0!==r?t(e,n,r):function(r){return t(e,n,r)}}},Rt=jt(function(t,e,n){return Math.min(Math.max(n,t),e)}),Dt=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},Ft=function(t){return Dt(t)&&t.hasOwnProperty("z")},$t=function(t,e){return Math.abs(t-e)},Yt=function(t,e){if(void 0===e&&(e=Et),Vt(t)&&Vt(e))return $t(t,e);if(Dt(t)&&Dt(e)){var n=$t(t.x,e.x),r=$t(t.y,e.y),o=Ft(t)&&Ft(e)?$t(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(o,2))}return 0},Lt=function(t,e,n){var r=e-t;return 0===r?1:(n-t)/r},Xt=function(t,e,n){return-n*t+n*e+t},It=function(){return(It=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bt=function(t,e,n){var r=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-r)+r))},_t=[M,C,V],Nt=function(t){return _t.find(function(e){return e.test(t)})},Ut=function(t){return"'"+t+"' is not an animatable color. Use the equivalent color code instead."},zt=function(t,e){var n=Nt(t),r=Nt(e);$(!!n,Ut(t)),$(!!r,Ut(e)),$(n.transform===r.transform,"Both colors must be hex/RGBA, OR both must be HSLA.");var o=n.parse(t),i=r.parse(e),a=It({},o),u=n===V?Xt:Bt;return function(t){for(var e in a)"alpha"!==e&&(a[e]=u(o[e],i[e],t));return a.alpha=Xt(o.alpha,i.alpha,t),n.transform(a)}},qt=function(t,e){return function(n){return e(t(n))}},Wt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(qt)},Gt=function(t,e){var n=t.slice(),r=n.length,o=t.map(function(t,n){var r=e[n];return Vt(t)?function(e){return Xt(t,r,e)}:k.test(t)?zt(t,r):Zt(t,r)});return function(t){for(var e=0;e<r;e++)n[e]=o[e](t);return n}},Zt=function(t,e){var n=F(t);return $(n(t)===F(e)(t),"Values '"+t+"' and '"+e+"' are of different format, or a value might have changed value type."),Wt(Gt(D(t),D(e)),n)},Ht=function(t,e){return function(n){return Xt(t,e,n)}};function Kt(t,e,n){for(var r,o=[],i=n||("number"==typeof(r=t[0])?Ht:k.test(r)?zt:Zt),a=t.length-1,u=0;u<a;u++){var s=i(t[u],t[u+1]);if(e){var c=Array.isArray(e)?e[u]:e;s=Wt(c,s)}o.push(s)}return o}var Jt=function(t,e,n,r){return void 0===r&&(r=0),o=t+n*(e-t)/Math.max(r,n),void 0===i&&(i=2),i=Math.pow(10,i),Math.round(o*i)/i;var o,i},Qt=function(t){return t},te=function(t){return void 0===t&&(t=Qt),jt(function(e,n,r){var o=n-r,i=-(0-e+1)*(0-t(Math.abs(o)));return o<=0?n+i:n-i})},ee=te(),ne=te(Math.sqrt),re=function(t,e){return Vt(t)?t/(1e3/e):0},oe=function(t,e){return e?t*(1e3/e):0},ie=jt(function(t,e,n){var r=e-t;return((n-t)%r+r)%r+t}),ae=(Rt(0,1),function(){return(ae=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)});var ue,se=function(t){var e=t.onRead,n=t.onRender,r=t.uncachedValues,o=void 0===r?new Set:r,i=t.useCache,a=void 0===i||i;return function(t){var r={},i=[],u=!1,s=function(t,e){var n=r[t];r[t]=e,r[t]!==n&&(-1===i.indexOf(t)&&i.push(t),u||(u=!0,G.render(c)))};function c(e){return void 0===e&&(e=!1),(!0===e||u)&&(n(r,t,i),u=!1,i.length=0),this}return{get:function(n){return n?a&&!o.has(n)&&void 0!==r[n]?r[n]:e(n,t):r},set:function(t,e){if("string"==typeof t){if(void 0===e)return function(e){return s(t,e)};s(t,e)}else for(var n in t)t.hasOwnProperty(n)&&s(n,t[n]);return this},render:c}}},ce=/([a-z])([A-Z])/g,fe=function(t){return t.replace(ce,"$1-$2").toLowerCase()},pe=new Map,le=new Map,de=["Webkit","Moz","O","ms",""],ve=de.length,he="undefined"!=typeof document,ge=function(t,e){return le.set(t,fe(e))},me=function(t,e){void 0===e&&(e=!1);var n=e?le:pe;return n.has(t)||(he?function(t){ue=ue||document.createElement("div");for(var e=0;e<ve;e++){var n=de[e],r=""===n,o=r?t:n+t.charAt(0).toUpperCase()+t.slice(1);(o in ue.style||r)&&(pe.set(t,o),ge(t,(r?"":"-")+fe(o)))}}(t):function(t){ge(t,t)}(t)),n.get(t)||t},ye=["","X","Y","Z"],be=["scale","rotate","skew","transformPerspective"].reduce(function(t,e){return ye.reduce(function(t,n){return t.push(e+n),t},t)},["x","y","z"]),Pe=be.reduce(function(t,e){return t[e]=!0,t},{}),we=function(t){return!0===Pe[t]},Oe=function(t,e){return be.indexOf(t)-be.indexOf(e)},xe=function(t){return"originX"===t||"originY"===t},Se={color:k,backgroundColor:k,outlineColor:k,fill:k,stroke:k,borderColor:k,borderTopColor:k,borderRightColor:k,borderBottomColor:k,borderLeftColor:k,borderWidth:g,borderTopWidth:g,borderRightWidth:g,borderBottomWidth:g,borderLeftWidth:g,borderRadius:g,borderTopLeftRadius:g,borderTopRightRadius:g,borderBottomRightRadius:g,borderBottomLeftRadius:g,width:g,maxWidth:g,height:g,maxHeight: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:v,rotateX:v,rotateY:v,rotateZ:v,scale:l,scaleX:l,scaleY:l,scaleZ:l,skew:v,skewX:v,skewY:v,distance:g,x:g,y:g,z:g,perspective:g,opacity:p,originX:h,originY:h,originZ:g},Ae=function(t){return Se[t]},Ce=new Set(["scrollLeft","scrollTop"]),Ee=new Set(["scrollLeft","scrollTop","transform"]),Ve={x:"translateX",y:"translateY",z:"translateZ"},Me=function(t){return"function"==typeof t},ke=function(t,e,n,r,o,i,a){void 0===e&&(e=!0),void 0===n&&(n={}),void 0===r&&(r={}),void 0===o&&(o={}),void 0===i&&(i=[]),void 0===a&&(a=!1);var u=!0,s=!1,c=!1;for(var f in t){var p=t[f],l=Ae(f),d="number"==typeof p&&l?l.transform(p):p;we(f)?(s=!0,r[f]=d,i.push(f),u&&(l.default&&p!==l.default||!l.default&&0!==p)&&(u=!1)):xe(f)?(o[f]=d,c=!0):Ee.has(f)&&Me(d)||(n[me(f,a)]=d)}return(s||"function"==typeof t.transform)&&(n.transform=function(t,e,n,r,o){var i="",a=!1;n.sort(Oe);for(var u=n.length,s=0;s<u;s++){var c=n[s];i+=(Ve[c]||c)+"("+e[c]+") ",a="z"===c||a}return!a&&o?i+="translateZ(0)":i=i.trim(),Me(t.transform)?i=t.transform(e,i):r&&(i="none"),i}(t,r,i,u,e)),c&&(n.transformOrigin=(o.originX||0)+" "+(o.originY||0)+" "+(o.originZ||0)),n},Te=se({onRead:function(t,e){var n=e.element,r=e.preparseOutput,o=Ae(t);if(we(t))return o&&o.default||0;if(Ce.has(t))return n[t];var i=window.getComputedStyle(n,null).getPropertyValue(me(t,!0))||0;return r&&o&&o.parse?o.parse(i):i},onRender:function(t,e,n){var r=e.element,o=e.buildStyles;Object.assign(r.style,o(t)),-1!==n.indexOf("scrollLeft")&&(r.scrollLeft=t.scrollLeft),-1!==n.indexOf("scrollTop")&&(r.scrollTop=t.scrollTop)},uncachedValues:Ce}),je=function(t,e){void 0===e&&(e={});var n=e.enableHardwareAcceleration,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&(n[r[o]]=t[r[o]])}return n}(e,["enableHardwareAcceleration"]);return Te(ae({element:t,buildStyles:function(t){void 0===t&&(t=!0);var e={},n={},r={},o=[];return function(i){return o.length=0,ke(i,t,e,n,r,o,!0),e}}(n),preparseOutput:!0},r))},Re=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),De=function(t,e){return t/100*e+"px"},Fe=ae({},f,{transform:Math.round}),$e={fill:k,stroke:k,scale:l,scaleX:l,scaleY:l,opacity:p,fillOpacity:p,strokeOpacity:p,numOctaves:Fe},Ye=se({onRead:function(t,e){var n=e.element;if(we(t)){var r=function(t){return $e[t]}(t);return r?r.default:0}return n.getAttribute(t)},onRender:function(t,e){var n=e.dimensions;!function(t,e){for(var n in e)e.hasOwnProperty(n)&&t.setAttribute(n,e[n])}(e.element,function(t,e,n,r){var o=!1,i=!1,a={},u=n?{pathLength:"0",pathSpacing:""+r}:void 0,s=void 0!==t.scale?t.scale||1e-7:t.scaleX||1,c=void 0!==t.scaleY?t.scaleY||1e-7:s||1,f=e.width*((t.originX||50)/100)+e.x,p=e.height*((t.originY||50)/100)+e.y,l=1*s*-f,d=1*c*-p,v=f/s,h=p/c,g={translate:"translate("+t.x+", "+t.y+") ",scale:"translate("+l+", "+d+") scale("+s+", "+c+") translate("+v+", "+h+") ",rotate:"rotate("+t.rotate+", "+f+", "+p+") ",skewX:"skewX("+t.skewX+") ",skewY:"skewY("+t.skewY+") "};for(var m in t)if(t.hasOwnProperty(m)){var y=t[m];we(m)?o=!0:!n||"pathLength"!==m&&"pathSpacing"!==m||"number"!=typeof y?n&&"pathOffset"===m?a["stroke-dashoffset"]=De(-y,r):a[Re.has(m)?m:fe(m)]=y:(i=!0,u[m]=De(y,r))}if(i&&(a["stroke-dasharray"]=u.pathLength+" "+u.pathSpacing),o)for(var m in a.transform="",g)if(g.hasOwnProperty(m)){var b="scale"===m?"1":"0";a.transform+=g[m].replace(/undefined/g,b)}return a}(t,n,e.isPath,e.pathLength))}}),Le=se({useCache:!1,onRead:function(t){return"scrollTop"===t?window.pageYOffset:window.pageXOffset},onRender:function(t){var e=t.scrollTop,n=void 0===e?0:e,r=t.scrollLeft,o=void 0===r?0:r;return window.scrollTo(o,n)}}),Xe=new WeakMap,Ie=function(t,e){var n;return t instanceof HTMLElement?n=je(t,e):t instanceof SVGElement?n=function(t){var e={element:t,dimensions: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),isPath:!1};return"path"===t.tagName&&(e.isPath=!0,e.pathLength=t.getTotalLength()),Ye(e)}(t):t===window&&(n=Le(t)),$(void 0!==n,"No valid node provided. Node must be HTMLElement, SVGElement or window."),Xe.set(t,n),n},Be=function(t,e){return Xe.has(t)?Xe.get(t):Ie(t,e)};var _e=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 n=1===t.length?t[0]:Wt.apply(void 0,t);return this.applyMiddleware(function(t){return function(e){return t(n(e))}})},t.prototype.while=function(t){return this.applyMiddleware(function(e,n){return function(r){return t(r)?e(r):n()}})},t.prototype.filter=function(t){return this.applyMiddleware(function(e){return function(n){return t(n)&&e(n)}})},t}(),Ne=function(){return function(t,e){var n=t.middleware,r=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=r,e.update&&n&&n.length&&n.forEach(function(t){return o.updateObserver=t(o.updateObserver,o.complete)})}}(),Ue=function(t,e,n){var r=e.middleware;return new Ne({middleware:r,onComplete:n},"function"==typeof t?{update:t}:t)},ze=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.create=function(t){return new e(t)},e.prototype.start=function(t){void 0===t&&(t={});var e=!1,n={stop:function(){}},i=this.props,a=i.init,u=o(i,["init"]),s=a(Ue(t,u,function(){e=!0,n.stop()}));return n=s?r({},n,s):n,t.registerParent&&t.registerParent(n),e&&n.stop(),n},e}(_e),qe=function(t){return new ze({init:t})},We=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.subscribers=[],e}return n(e,t),e.prototype.complete=function(){this.subscribers.forEach(function(t){return t.complete()})},e.prototype.error=function(t){this.subscribers.forEach(function(e){return e.error(t)})},e.prototype.update=function(t){for(var e=0;e<this.subscribers.length;e++)this.subscribers[e].update(t)},e.prototype.subscribe=function(t){var e=this,n=Ue(t,this.props);return this.subscribers.push(n),{unsubscribe:function(){var t=e.subscribers.indexOf(n);-1!==t&&e.subscribers.splice(t,1)}}},e.prototype.stop=function(){this.parent&&this.parent.stop()},e.prototype.registerParent=function(t){this.stop(),this.parent=t},e}(_e),Ge=function(t,e){var n=1/(t-1),r=1/(2*(t-1)),o=Math.min(e,1)/r;return Math.floor((o+1)/2)*n},Ze=function(t){return Array.isArray(t)},He=function(t){var e=typeof t;return"string"===e||"number"===e},Ke=function(t){function e(e){var n=t.call(this,e)||this;return n.scheduleVelocityCheck=function(){return G.postRender(n.velocityCheck)},n.velocityCheck=function(t){t.timestamp!==n.lastUpdated&&(n.prev=n.current)},n.prev=n.current=e.value||0,He(n.current)?(n.updateCurrent=function(t){return n.current=t},n.getVelocityOfCurrent=function(){return n.getSingleVelocity(n.current,n.prev)}):Ze(n.current)?(n.updateCurrent=function(t){return n.current=t.slice()},n.getVelocityOfCurrent=function(){return n.getListVelocity()}):(n.updateCurrent=function(t){for(var e in n.current={},t)t.hasOwnProperty(e)&&(n.current[e]=t[e])},n.getVelocityOfCurrent=function(){return n.getMapVelocity()}),e.initialSubscription&&n.subscribe(e.initialSubscription),n}return n(e,t),e.prototype.create=function(t){return new e(t)},e.prototype.get=function(){return this.current},e.prototype.getVelocity=function(){return this.getVelocityOfCurrent()},e.prototype.update=function(e){t.prototype.update.call(this,e),this.prev=this.current,this.updateCurrent(e);var n=Q(),r=n.delta,o=n.timestamp;this.timeDelta=r,this.lastUpdated=o,G.postRender(this.scheduleVelocityCheck)},e.prototype.subscribe=function(e){var n=t.prototype.subscribe.call(this,e);return this.subscribers[this.subscribers.length-1].update(this.current),n},e.prototype.getSingleVelocity=function(t,e){return"number"==typeof t&&"number"==typeof e?oe(t-e,this.timeDelta):oe(parseFloat(t)-parseFloat(e),this.timeDelta)||0},e.prototype.getListVelocity=function(){var t=this;return this.current.map(function(e,n){return t.getSingleVelocity(e,t.prev[n])})},e.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},e}(We),Je=function(t,e){return new Ke({value:t,initialSubscription:e})},Qe=function(t){var e=t.getCount,n=t.getFirst,r=t.getOutput,o=t.mapApi,i=t.setProp,a=t.startActions;return function(t){return qe(function(u){var s=u.update,c=u.complete,f=u.error,p=e(t),l=r(),d=function(){return s(l)},v=0,h=a(t,function(t,e){var n=!1;return t.start({complete:function(){n||(n=!0,++v===p&&G.update(c))},error:f,update:function(t){i(l,e,t),G.update(d,!1,!0)}})});return Object.keys(n(h)).reduce(function(t,e){return t[e]=o(h,e),t},{})})}},tn=Qe({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 n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return Object.keys(t).reduce(function(r,o){var i;return t[o][e]&&(n[0]&&void 0!==n[0][o]?r[o]=t[o][e](n[0][o]):r[o]=(i=t[o])[e].apply(i,n)),r},{})}},setProp:function(t,e,n){return t[e]=n},startActions:function(t,e){return Object.keys(t).reduce(function(n,r){return n[r]=e(t[r],r),n},{})}}),en=Qe({getOutput:function(){return[]},getCount:function(t){return t.length},getFirst:function(t){return t[0]},mapApi:function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.map(function(t,r){if(t[e])return Array.isArray(n[0])?t[e](n[0][r]):t[e].apply(t,n)})}},setProp:function(t,e,n){return t[e]=n},startActions:function(t,e){return t.map(function(t,n){return e(t,n)})}}),nn=[g,h,v,m,y],rn=function(t){return nn.find(function(e){return e.test(t)})},on=function(t,e){return t(e)},an=function(t,e,n){var o=n[0],i=e[o].map(function(o,i){var a=n.reduce(function(t){return function(e,n){return e[n]=e[n][t],e}}(i),r({},e));return ln(o)(t,a)});return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return en(t)}.apply(void 0,i)},un=function(t,e,n){var o=n[0],i=Object.keys(e[o]).reduce(function(i,a){var u=n.reduce(function(t){return function(e,n){return e[n]=e[n][t],e}}(a),r({},e));return i[a]=ln(e[o][a])(t,u),i},{});return tn(i)},sn=function(t,e){var n=e.from,i=e.to,a=o(e,["from","to"]),u=rn(n)||rn(i),s=u.transform,c=u.parse;return t(r({},a,{from:"string"==typeof n?c(n):n,to:"string"==typeof i?c(i):i})).pipe(s)},cn=function(t,e){var n=e.from,i=e.to,a=o(e,["from","to"]);return t(r({},a,{from:0,to:1})).pipe(zt(n,i),k.transform)},fn=function(t,e){var n=e.from,i=e.to,a=o(e,["from","to"]),u=F(n);return $(u(n)===F(i)(n),"Values '"+n+"' and '"+i+"' are of different format, or a value might have changed value type."),t(r({},a,{from:0,to:1})).pipe(Gt(D(n),D(i)),u)},pn=function(t,e){var n=function(t){var e=Object.keys(t),n=function(e,n){return void 0!==e&&!t[n](e)};return{getVectorKeys:function(t){return e.reduce(function(e,r){return n(t[r],r)&&e.push(r),e},[])},testVectorProps:function(t){return t&&e.some(function(e){return n(t[e],e)})}}}(e),r=n.testVectorProps,o=n.getVectorKeys;return function(e){if(!r(e))return t(e);var n=o(e),i=e[n[0]];return ln(i)(t,e,n)}},ln=function(t){var e=on;return"number"==typeof t?e=on:Array.isArray(t)?e=an:!function(t){return Boolean(rn(t))}(t)?k.test(t)?e=cn:R(t)?e=fn:"object"==typeof t&&(e=un):e=sn,e},dn=pn(function(t){return void 0===t&&(t={}),qe(function(e){var n=e.complete,r=e.update,o=t.velocity,i=void 0===o?0:o,a=t.from,u=void 0===a?0:a,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,g=c*i,m=Math.round(u+g),y=void 0===v?m:v(m),b=G.update(function(t){var e=t.delta;h+=e;var o=-g*Math.exp(-h/p),i=o>d||o<-d;r(i?y+o:y),i||(Z.update(b),n())},!0);return{stop:function(){return Z.update(b)}}})},{from:f.test,modifyTarget:function(t){return"function"==typeof t},velocity:f.test}),vn=pn(function(t){return void 0===t&&(t={}),qe(function(e){var n=e.update,r=e.complete,o=t.velocity,i=void 0===o?0:o,a=t.from,u=void 0===a?0:a,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,g=t.restSpeed,m=void 0===g?.01:g,y=t.restDelta,b=void 0===y?.01:y,P=i?-i/1e3:0,w=0,O=c-u,x=u,S=x,A=G.update(function(t){var e=t.delta;w+=e;var o=d/(2*Math.sqrt(p*h)),a=Math.sqrt(p/h)/1e3;if(S=x,o<1){var u=Math.exp(-o*a*w),s=a*Math.sqrt(1-o*o);x=c-u*((P+o*a*O)/s*Math.sin(s*w)+O*Math.cos(s*w))}else u=Math.exp(-a*w),x=c-u*(O+(P+a*O)*w);i=oe(x-S,e);var f=Math.abs(i)<=m,l=Math.abs(c-x)<=b;f&&l?(n(x=c),Z.update(A),r()):n(x)},!0);return{stop:function(){return Z.update(A)}}})},{from:f.test,to:f.test,stiffness:f.test,damping:f.test,mass:f.test,velocity:f.test}),hn=pn(function(t){var e=t.from,n=void 0===e?0:e,r=t.to,o=void 0===r?1:r,i=t.ease,a=void 0===i?rt:i;return qe(function(t){var e=t.update;return{seek:function(t){return e(t)}}}).pipe(a,function(t){return Xt(n,o,t)})},{ease:function(t){return"function"==typeof t},from:f.test,to:f.test}),gn=Rt(0,1),mn=function(t){return void 0===t&&(t={}),qe(function(e){var n,r=e.update,o=e.complete,i=t.duration,a=void 0===i?300:i,u=t.ease,s=void 0===u?it:u,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.from,g=void 0===h?0:h,m=t.to,y=void 0===m?1:m,b=t.elapsed,P=void 0===b?0:b,w=t.playDirection,O=void 0===w?1:w,x=t.flipCount,S=void 0===x?0:x,A=t.yoyoCount,C=void 0===A?0:A,E=t.loopCount,V=void 0===E?0:E,M=hn({from:g,to:y,ease:s}).start(r),k=0,T=!1,j=function(){if(P>a)P-=2*(P-a);else if(P<0){P+=2*(-1*P)}O*=-1},R=function(){k=gn(Lt(0,a,P)),M.seek(k)},D=function(){T=!0,n=G.update(function(t){var e=t.delta;P+=e*O,R(),function(){var t,e=1===O?T&&P>=a:T&&P<=0;if(!e)return!1;if(e&&!l&&!f&&!v)return!0;var n=!1;return l&&V<l?(P=a-P,V++,n=!0):f&&S<f?(P=a-P,g=(t=[y,g])[0],y=t[1],M=hn({from:g,to:y,ease:s}).start(r),S++,n=!0):v&&C<v&&(j(),C++,n=!0),!n}()&&o&&(Z.update(n),G.update(o,!1,!0))},!0)},F=function(){T=!1,n&&Z.update(n)};return D(),{isActive:function(){return T},getElapsed:function(){return Rt(0,a,P)},getProgress:function(){return k},stop:function(){F()},pause:function(){return F(),this},resume:function(){return T||D(),this},seek:function(t){return P=Xt(0,a,t),G.update(R,!1,!0),this},reverse:function(){return j(),this}}})},yn=Rt(0,1),bn=pn(function(t){return void 0===t&&(t={}),qe(function(e){var n=e.complete,r=e.update,o=t.acceleration,i=void 0===o?0:o,a=t.friction,u=void 0===a?0:a,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,g=G.update(function(t){var e=t.delta,o=Math.max(e,16);i&&(c+=re(i,o)),u&&(c*=Math.pow(1-u,o/100)),void 0!==f&&void 0!==p&&(c+=(p-h)*re(f,o)),h+=re(c,o),r(h),!1!==d&&(!c||Math.abs(c)<=d)&&(Z.update(g),n())},!0);return{set:function(t){return h=t,this},setAcceleration:function(t){return i=t,this},setFriction:function(t){return u=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 Z.update(g)}}})},{acceleration:f.test,friction:f.test,velocity:f.test,from:f.test,to:f.test,springStrength:f.test}),Pn=function(t,e,n){return qe(function(r){var o=r.update,i=e.split(" ").map(function(e){return t.addEventListener(e,o,n),e});return{stop:function(){return i.forEach(function(e){return t.removeEventListener(e,o,n)})}}})},wn=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},On=[{clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}],xn=!1;if("undefined"!=typeof document){Pn(document,"touchstart touchmove",{passive:!0,capture:!0}).start(function(t){var e=t.touches;xn=!0;var n=e.length;On.length=0;for(var r=0;r<n;r++){var o=e[r];On.push(wn(o))}})}var Sn={clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0},An=!1;if("undefined"!=typeof document){Pn(document,"mousedown mousemove",!0).start(function(t){An=!0,wn(t,Sn)})}var Cn,En=function(t){return t[0]},Vn=function(t){return void 0===t&&(t={}),xn?(e=t,n=void 0===e?{}:e,r=n.preventDefault,o=void 0===r||r,i=n.scale,a=void 0===i?1:i,u=n.rotate,s=void 0===u?0:u,qe(function(t){var e=t.update,n={touches:On,scale:a,rotate:s},r=0,i=0,u=On.length>1;if(u){var c=On[0],f=On[1];r=Yt(c,f),i=kt(c,f)}var p=function(){if(u){var t=On[0],o=On[1],c=Yt(t,o),f=kt(t,o);n.scale=a*(c/r),n.rotate=s+(f-i)}e(n)},l=Pn(document,"touchmove",{passive:!o}).start(function(t){(o||t.touches.length>1)&&t.preventDefault(),G.update(p)});return xn&&G.update(p),{stop:function(){Z.update(p),l.stop()}}})).pipe(function(t){return t.touches},En):function(t){var e=(void 0===t?{}:t).preventDefault,n=void 0===e||e;return qe(function(t){var e=t.update,r=function(){return e(Sn)},o=Pn(document,"mousemove").start(function(t){n&&t.preventDefault(),G.update(r)});return An&&G.update(r),{stop:function(){Z.update(r),o.stop()}}})}(t);var e,n,r,o,i,a,u,s},Mn=Object.freeze({applyOffset:Tt,clamp:Rt,conditional:function(t,e){return function(n){return t(n)?e(n):n}},interpolate:function(t,e,n){var r=void 0===n?{}:n,o=r.clamp,i=void 0===o||o,a=r.ease,u=r.mixer,s=t.length;$(s===e.length,"Both input and output ranges must be the same length"),$(!a||!Array.isArray(a)||a.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=Kt(e,a,u),f=2===s?function(t,e){var n=t[0],r=t[1],o=e[0];return function(t){return o(Lt(n,r,t))}}(t,c):function(t,e){var n=t.length,r=n-1;return function(o){var i=0,a=!1;if(o<=t[0]?a=!0:o>=t[r]&&(i=r-1,a=!0),!a){for(var u=1;u<n&&!(t[u]>o||u===r);u++);i=u-1}var s=Lt(t[i],t[i+1],o);return e[i](s)}}(t,c);return i?Wt(Rt(t[0],t[s-1]),f):f},blendArray:Gt,blendColor:zt,pipe:Wt,smooth:function(t){void 0===t&&(t=50);var e=0,n=0;return function(r){var o=Q().timestamp,i=o!==n?o-n:0,a=i?Jt(e,r,i,t):e;return n=o,e=a,a}},snap:function(t){if("number"==typeof t)return function(e){return Math.round(e/t)*t};var e=0,n=t.length;return function(r){var o=Math.abs(t[0]-r);for(e=1;e<n;e++){var i=t[e],a=Math.abs(i-r);if(0===a)return i;if(a>o)return t[e-1];if(e===n-1)return i;o=a}}},generateStaticSpring:te,nonlinearSpring:ne,linearSpring:ee,wrap:ie,appendUnit:function(t){return function(e){return""+e+t}},steps:function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=1),function(r){var o=Lt(e,n,r);return Xt(e,n,Ge(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}}}),kn=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 o(t,["transition","flip","delay","delayChildren","staggerChildren","staggerDirection","afterChildren","beforeChildren","preTransition","applyAtStart","applyAtEnd"])},Tn=function(t,e){return"function"==typeof t?t(e):t},jn=function(t,e,n,r){return t&&void 0!==t[e]?Tn(t[e],r):n},Rn=function(t,e,n,r,o,i){var a;if("function"==typeof t){var u=t(r);a=Rn(u,e,n,r,o,i)}else if(t[e]||t.default){var s=t[e]||t.default;a="function"==typeof s?s(r):s}else a=t;return!1===a?i(n,r):o(n,a,r)},Dn=function(t,e,n,r,o){return $("object"==typeof t,"applyAtStart and applyAtEnd must be of type object"),Object.keys(t).forEach(function(i){var a=Tn(t[i],n);e.has(i)?r(e.get(i),a):o(i,a,n)})},Fn=function(t){var e=t.state,n=t.poses,o=t.startAction,i=t.stopAction,a=t.getInstantTransition,u=t.addActionDelay,s=t.getTransitionProps,c=t.resolveTarget,f=t.transformPose,p=t.posePriority,l=t.convertTransitionDefinition,d=t.setValue,v=t.setValueNative,h=t.forceRender;return function(t,g,m){void 0===g&&(g={}),void 0===m&&(m=!0);var y=e.children,b=e.values,P=e.props,w=e.activeActions,O=e.activePoses,x=g.delay,S=void 0===x?0:x,A=y.size,C=r({},P,g),E=n[t],V=function(){return A&&m?function(t,e,n,r){var o=[],i=jn(n,"delayChildren",0,r),a=jn(n,"staggerChildren",0,r),u=jn(n,"staggerDirection",1,r),s=(t.size-1)*a,c=1===u?function(t){return t*a}:function(t){return s-t*a};return Array.from(t).forEach(function(t,n){o.push(t.set(e,{delay:i+c(n)}))}),o}(y,t,E,C):[]},M=function(){if(!E)return[];var n=E.applyAtStart;n&&(Dn(n,b,C,d,v),h&&h(C)),f&&(E=f(E,t,e));var g=E.preTransition,m=E.transition,y=E.applyAtEnd;g&&g(C);var P=Object.keys(kn(E)).map(function(e){var n=O.has(e)?O.get(e):(O.set(e,[]),O.get(e)),f=n.indexOf(t);-1!==f&&n.splice(f,1);var d=p?p.indexOf(t):0,v=d<=0?0:function(t,e,n){for(var r=0,o=n-1;o>=0;o--){var i=t.indexOf(e[o]);if(-1!==i){r=i+1;break}}return r}(n,p,d);return n.splice(v,0,t),0===v?new Promise(function(t){var n=b.get(e),f=r({},C,{key:e,value:n}),p=c(n,Tn(E[e],f));w.has(e)&&i(w.get(e));var d=r({to:p},f,s(n,p,f)),v=Rn(m,e,n,d,l,a),h=S||Tn(E.delay,f);h&&(v=u(h,v)),w.set(e,o(n,v,t))}):Promise.resolve()});return y?[Promise.all(P).then(function(){Dn(y,b,C,d,v)})]:P};if(E&&A){if(Tn(E.beforeChildren,C))return Promise.all(M()).then(function(){return Promise.all(V())});if(Tn(E.afterChildren,C))return Promise.all(V()).then(function(){return Promise.all(M())})}return Promise.all(M().concat(V()))}},$n=function(t){return function(t){return t.includes("scale")}(t)?1:0},Yn=function(t){var e=Array.isArray(t)?t:[t];return e.push("init"),e},Ln=function(t,e,n,r,o,i){void 0===o&&(o=$n);var a=Yn(n).filter(Boolean).find(function(n){var r=t[n];return r&&(void 0!==r[e]||r.applyAtStart&&void 0!==r.applyAtStart[e]||r.applyAtEnd&&void 0!==r.applyAtEnd[e])});return i.set(e,[a||"init"]),a?function(t,e,n){var r=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 Tn(r,n)}(t[a],e,r):o(e,r)},Xn=function(t,e){return function(n){var r=e.poses[n];Object.keys(kn(r)).forEach(function(t,e){var n=e.userSetValues,r=e.createValue,o=e.convertValue,i=e.readValueFromSource,a=e.initialPose,u=e.poses,s=e.activePoses,c=e.props;return function(e){if(!t.has(e)){var f;if(n&&void 0!==n[e])f=o(n[e],e,c);else{var p=Ln(u,e,a,c,i,s);f=r(p,e,c)}t.set(e,f)}}}(t,e))}},In=function(t){var e=t.poses,n=t.passive,r=new Map;return Object.keys(e).forEach(Xn(r,t)),function(t){var e=t.setValueNative,n=t.initialPose,r=t.props,o=t.poses,i=new Set,a=function(t,n){if(t[n])for(var o in t[n])i.has(o)||(i.add(o),e(o,Tn(t[n][o],r),r))};Yn(n).forEach(function(t){var e=o[t];e&&(a(e,"applyAtEnd"),a(e,"applyAtStart"))})}(t),n&&Object.keys(n).forEach(function(t,e){var n=e.passive,r=e.ancestorValues,o=e.createValue,i=e.readValue,a=e.props;return function(e){var u=n[e],s=u[0],c=u[1],f=u[2],p=f&&r.length?function(t,e,n){if(!0===e)return n[0]&&n[0].values.get(t);var r=n.find(function(t){return t.label===e});return r&&r.values.get(t)}(s,f,r):!!t.has(s)&&t.get(s);if(p){var l=o(i(p),e,a,{passiveParentKey:s,passiveParent:p,passiveProps:c});t.set(e,l)}}}(r,t)),r},Bn=function(t,e){return Object.keys(t).forEach(function(n){var o=t[n];$("object"==typeof o,"Pose '"+n+"' is of invalid type. All poses should be objects."),t[n]=void 0!==o.transition?o:function(t,e,n){return r({},t,{transition:n.has(e)?n.get(e):n.get("default")})}(o,n,e)}),t},_n=function(t){var e=t.getDefaultProps,n=t.defaultTransitions,i=t.bindOnChange,a=t.startAction,u=t.stopAction,s=t.readValue,c=t.readValueFromSource,f=t.resolveTarget,p=t.setValue,l=t.setValueNative,d=t.createValue,v=t.convertValue,h=t.getInstantTransition,g=t.getTransitionProps,m=t.addActionDelay,y=t.selectValueToRead,b=t.convertTransitionDefinition,P=t.transformPose,w=t.posePriority,O=t.forceRender,x=t.extendAPI;return function(t){var S=t.parentValues,A=t.ancestorValues,C=void 0===A?[]:A;S&&C.unshift({values:S});var E=new Map,V=new Map,M=new Set,k=Bn(function(t){t.label,t.props,t.values,t.parentValues,t.ancestorValues,t.onChange,t.passive,t.initialPose;return o(t,["label","props","values","parentValues","ancestorValues","onChange","passive","initialPose"])}(t),n),T=t.props,j=void 0===T?{}:T;e&&(j=r({},e(t),j));var R=t.passive,D=t.values,F=t.initialPose,$=void 0===F?"init":F,Y=In({poses:k,passive:R,ancestorValues:C,readValue:s,setValueNative:l,createValue:d,convertValue:v,readValueFromSource:c,userSetValues:D,initialPose:$,activePoses:V,props:j}),L={activeActions:E,activePoses:V,children:M,props:j,values:Y},X=t.onChange;X&&Object.keys(X).forEach(i(Y,X));var I=Fn({state:L,poses:k,getInstantTransition:h,getTransitionProps:g,convertTransitionDefinition:b,setValue:p,setValueNative:l,startAction:a,stopAction:u,resolveTarget:f,addActionDelay:m,transformPose:P,posePriority:w,forceRender:O});return x({set:I,unset:function(t,e){var n=[];V.forEach(function(e){var r=e.indexOf(t);if(-1!==r){var o=e[0];e.splice(r,1);var i=e[0];i!==o&&-1===n.indexOf(i)&&n.push(i)}});var r,o=n.sort((r=w,function(t,e){var n=r.indexOf(t),o=r.indexOf(e);return-1===n&&-1!==o?-1:-1!==n&&-1===o?1:n-o})).map(function(t){return I(t,e,!1)});return M.forEach(function(e){return o.push(e.unset(t))}),Promise.all(o)},get:function(t){return t?y(Y.get(t)):function(t,e){var n={};return t.forEach(function(t,r){return n[r]=e(t)}),n}(Y,y)},has:function(t){return!!k[t]},setProps:function(t){return L.props=r({},L.props,t)},_addChild:function(e,n){var o=n(r({initialPose:$},e,{ancestorValues:[{label:t.label,values:Y}].concat(C)}));return M.add(o),o},removeChild:function(t){return M.delete(t)},clearChildren:function(){M.forEach(function(t){return t.destroy()}),M.clear()},destroy:function(){E.forEach(u),M.forEach(function(t){return t.destroy()})}},L,t)}},Nn=function(){return(Nn=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function Un(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&(n[r[o]]=t[r[o]])}return n}!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(Cn||(Cn={}));var zn=function(t,e){return"function"==typeof t?t(e):t},qn=Mn.interpolate,Wn=function(t){return function(e){var n;return function(t){void 0===t&&(t={});var e=t.x,n=t.y,r=o(t,["x","y"]);if(void 0!==e||void 0!==n){var i=Tt(e||0),a=Tt(n||0),u={x:0,y:0};return Vn(r).pipe(function(t){return u.x=i(t.x),u.y=a(t.y),u})}return Vn(r)}((n={},n[t]="string"==typeof e?parseFloat(e):e,n)).pipe(function(e){return e[t]})}},Gn=Wn("x"),Zn=Wn("y"),Hn=function(t,e,n,r){return function(o){var i=o.from,a=o.type,u=o.dimensions,s=o.dragBounds,c=t(u.measurementAsPixels(r,i,a)),f=[];if(s){var p=zn(s,o);void 0!==p[e]&&f.push(function(t){return Math.max(t,u.measurementAsPixels(r,p[e],a))}),void 0!==p[n]&&f.push(function(t){return Math.min(t,u.measurementAsPixels(r,p[n],a))})}return a===h&&f.push(qn([0,u.get(r)],[0,100],{clamp:!1}),function(t){return t+"%"}),f.length?c.pipe.apply(c,f):c}},Kn=function(t){return qe(function(e){var n=e.update,r=e.complete;n(t),r()})},Jn=function(t){var e=t.from,n=t.velocity,r=t.to;return vn({from:e,to:r,velocity:n,stiffness:500,damping:25,restDelta:.5,restSpeed:10})},Qn=function(t){var e=t.from,n=t.velocity,r=t.to;return vn({from:e,to:r,velocity:n,stiffness:700,damping:0===r?100:35})},tr={x:Jn,y:Jn,z:Jn,rotate:Jn,rotateX:Jn,rotateY:Jn,rotateZ:Jn,scaleX:Qn,scaleY:Qn,scale:Qn,opacity:function(t){var e=t.from,n=t.to;return mn({from:e,to:n,ease:rt})},default:mn},er=Nn({},tr,{x:Hn(Gn,"left","right",Cn.width),y:Hn(Zn,"top","bottom",Cn.height)}),nr=function(t){var e=t.from;return Kn(e)},rr=new Map([["default",tr],["drag",er],["dragEnd",Nn({},tr,{x:nr,y:nr})]]),or={tween:mn,spring:vn,decay:dn,keyframes:function(t){var e=t.easings,n=t.ease,i=void 0===n?rt:n,a=t.times,u=t.values,s=o(t,["easings","ease","times","values"]);e=Array.isArray(e)?e:function(t,e){return t.map(function(){return e||it}).splice(0,t.length-1)}(u,e),a=a||function(t){var e=t.length;return t.map(function(t,n){return 0!==n?n/(e-1):0})}(u);var c=e.map(function(t,e){return hn({from:u[e],to:u[e+1],ease:t})});return mn(r({},s,{ease:i})).applyMiddleware(function(t){return function(t,e,n){var r=t.length,o=r-1,i=o-1,a=e.map(function(t){return t.start(n)});return function(e){e<=t[0]&&a[0].seek(0),e>=t[o]&&a[i].seek(1);for(var n=1;n<r&&!(t[n]>e||n===o);n++);var u=Lt(t[n-1],t[n],e);a[n-1].seek(yn(u))}}(a,c,t)})},physics:bn},ir={linear:rt,easeIn:ot,easeOut:it,easeInOut:at,circIn:ut,circOut:st,circInOut:ct,backIn:ft,backOut:pt,backInOut:lt,anticipate:dt},ar=[f,v,h,g,y,m,{test:function(t){return"auto"===t},parse:function(t){return t}}],ur=function(t){return ar.find(function(t){return function(e){return e.test(t)}}(t))},sr=function(t,e){return void 0===t&&(t=0),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return qe(function(e){var n,r=e.update,o=e.complete,i=0,a=function(){n=t[i].start({complete:function(){++i>=t.length?o():a()},update:r})};return a(),{stop:function(){return n&&n.stop()}}})}((n=t,qe(function(t){var e=t.complete,r=setTimeout(e,n);return{stop:function(){return clearTimeout(r)}}})),e);var n},cr=function(t){var e=t.startEvents,n=t.endEvents,r=t.startPose,o=t.endPose,i=t.startCallback,a=t.endCallback,u=t.useDocumentToEnd,s=t.preventScroll;return function(t,c,f,p){var l=r+"Start",d=r+"End",v=r+"Move";if(s){var h=Pn(t,"touchmove",{passive:!1}).start(function(t){t.preventDefault()});c.set(v,h)}var g=Pn(t,e).start(function(e){f.unset(o),f.set(r),i&&p[i]&&p[i](e);var s=Pn(u?document.documentElement:t,n+(u?" mouseenter":"")).start(function(t){u&&"mouseenter"===t.type&&1===t.buttons||(c.get(d).stop(),f.unset(r),f.set(o),a&&p[a]&&p[a](t))});c.set(d,s)});c.set(l,g)}},fr={draggable:cr({startEvents:"mousedown touchstart",endEvents:"mouseup touchend",startPose:"drag",endPose:"dragEnd",startCallback:"onDragStart",endCallback:"onDragEnd",useDocumentToEnd:!0,preventScroll:!0}),hoverable:cr({startEvents:"mouseenter",endEvents:"mouseleave",startPose:"hover",endPose:"hoverEnd"}),focusable:cr({startEvents:"focus",endEvents:"blur",startPose:"focus",endPose:"blur"}),pressable:cr({startEvents:"mousedown touchstart",endEvents:"mouseup touchend",startPose:"press",endPose:"pressEnd",startCallback:"onPressStart",endCallback:"onPressEnd",useDocumentToEnd:!0})},pr=Object.keys(fr),lr=function(t){var e=t.top,n=t.right,r=t.bottom;return{x:(t.left+n)/2,y:(e+r)/2}},dr=["width","height","top","left","bottom","right"],vr=new Set(dr),hr=function(t){return vr.has(t)},gr=function(t,e,n){var r=t.values,o=t.props;if(r.has(e)){var i=r.get(e).raw;i.update(n),i.update(n)}else r.set(e,{raw:Je(n,function(t){return o.elementStyler.set(e,t)})})},mr=function(t,e){var n=t.props,r=n.dimensions,o=n.element,i=n.elementStyler;if(!r.has())return{};var a=r.get(),u=function(t){var e=t.style.transform;t.style.transform="";var n=t.getBoundingClientRect();return t.style.transform=e,n}(o),s=a.left===u.left?0:a.right===u.right?"100%":"50%",c=a.top===u.top?0:a.bottom===u.bottom?"100%":"50%";i.set({originX:s,originY:c}),a.width!==u.width&&(gr(t,"scaleX",a.width/u.width),e.scaleX=1),a.height!==u.height&&(gr(t,"scaleY",a.height/u.height),e.scaleY=1);var f=lr(a),p=lr(u);return"50%"===s&&(gr(t,"x",f.x-p.x),e.x=0),"50%"===c&&(gr(t,"y",f.y-p.y),e.y=0),i.render(),e},yr=function(t,e){return n=e,Object.keys(n).some(hr)?function(t,e){var n=t.props,r=n.dimensions,o=n.elementStyler;r.measure();e.width,e.height,e.top,e.left,e.bottom,e.right,e.position;var i=Un(e,["width","height","top","left","bottom","right","position"]),a=dr.concat("position").reduce(function(n,r){return void 0!==e[r]&&(n[r]=zn(e[r],t.props)),n},{});return o.set(a).render(),mr(t,i)}(t,e):mr(t,e);var n},br=function(t,e){return parseFloat(t.split(", ")[e])},Pr=function(t,e){return function(n,r,o){var i=o.transform;if("none"===i)return 0;var a=i.match(/^matrix3d\((.+)\)$/);return a?br(a[1],e):br(i.match(/^matrix\((.+)\)$/)[1],t)}},wr={width:function(t,e){return e.width},height:function(t,e){return e.height},top:function(t,e,n){var r=n.top;return parseFloat(r)},left:function(t,e,n){var r=n.left;return parseFloat(r)},bottom:function(t,e,n){var r=e.height,o=n.top;return parseFloat(o)+r},right:function(t,e,n){var r=e.width,o=n.left;return parseFloat(o)+r},x:Pr(4,13),y:Pr(5,14)},Or=function(t){return void 0!==wr[t]},xr=function(t){return function(e){return e.elementStyler.get(t)}},Sr=function(t,e){var n,r,o,i=e.onDragStart,a=e.onDragEnd,u=e.onPressStart,s=e.onPressEnd,c=e.draggable,f=e.hoverable,p=e.focusable,l=e.pressable,d=e.dragBounds,v=Un(e,["onDragStart","onDragEnd","onPressStart","onPressEnd","draggable","hoverable","focusable","pressable","dragBounds"]),g=Nn({flip:{}},v,{props:Nn({},v.props,{onDragStart:i,onDragEnd:a,onPressStart:u,onPressEnd:s,dragBounds:d,draggable:c,hoverable:f,focusable:p,pressable:l,element:t,elementStyler:(n=t,r={preparseOutput:!1},o="string"==typeof n?document.querySelector(n):n,Be(o,r)),dimensions:function(t){var e=!1,n={width:0,height:0,top:0,left:0,bottom:0,right:0};return{get:function(t){return t?n[t]:n},measure:function(){return n=t.getBoundingClientRect(),e=!0,n},measurementAsPixels:function(t,e,r){return r===h?("string"==typeof e?parseFloat(e):e)/100*n[t]:e},has:function(){return e}}}(t)})});if(c){var m=function(t){var e={preTransition:function(t){return t.dimensions.measure()}},n={};return!0!==t&&"x"!==t||(e.x=n.x=xr("x")),!0!==t&&"y"!==t||(e.y=n.y=xr("y")),{drag:e,dragEnd:n}}(c),y=m.drag,b=m.dragEnd;g.drag=Nn({},y,g.drag),g.dragEnd=Nn({},b,g.dragEnd)}return g},Ar=function(t){var e=t.transformPose,n=t.addListenerToValue,r=t.extendAPI,o=t.readValueFromSource,i=t.posePriority,a=t.setValueNative;return _n({bindOnChange:function(t,e){return function(n){t.has(n)&&t.get(n).raw.subscribe(e[n])}},readValue:function(t){return t.raw.get()},setValue:function(t,e){return t.raw.update(e)},createValue:function(t,e,r,o){var i=r.elementStyler,a=void 0===o?{}:o,u=a.passiveParent,s=a.passiveProps,c=u?function(t,e,n){var r=Je(n(t));return e.raw.subscribe(function(t){return r.update(n(t))}),{raw:r}}(t,u,s):function(t){var e=ur(t);return{raw:Je(t),type:e}}(t);return c.raw.subscribe(n(e,i)),c},convertValue:function(t,e,r){var o=r.elementStyler;return t.subscribe(n(e,o)),{raw:t,type:ur(t.get())}},getTransitionProps:function(t,e){var n=t.raw,r=t.type;return{from:n.get(),velocity:n.getVelocity(),to:e,type:r}},resolveTarget:function(t,e){return e},selectValueToRead:function(t){return t.raw},startAction:function(t,e,n){var r=t.raw,o={update:function(t){return r.update(t)},complete:n};return e.start(o)},stopAction:function(t){return t.stop()},getInstantTransition:function(t,e){var n=e.to;return Kn(n)},convertTransitionDefinition:function(t,e,n){if(function(t){return void 0!==t.start}(e))return e;var r=e.delay,o=e.min,i=e.max,a=e.round,u=function(t,e,n){var r,o=n.from,i=n.to,a=n.velocity,u=e.type,s=void 0===u?"tween":u,c=e.ease,f=Un(e,["type","ease"]);$(void 0!==or[s],"Invalid transition type '"+s+"'. Valid transition types are: tween, spring, decay, physics and keyframes."),"tween"===s&&"function"!=typeof c&&("string"==typeof c?($(void 0!==ir[c],"Invalid easing type '"+c+"'. popmotion.io/pose/api/config"),r=ir[c]):Array.isArray(c)&&"number"==typeof c[0]&&($(4===c.length,"Cubic bezier arrays must contain four numerical values."),r=Ct(c[0],c[1],c[2],c[3]))),r=r||c;var p="keyframes"!==s?{from:o,to:i,velocity:a,ease:r}:{ease:r};return or[s](Nn({},p,f))}(0,Un(e,["delay","min","max","round"]),n),s=[];return r&&(u=sr(r,u)),void 0!==o&&s.push(function(t){return Math.max(t,o)}),void 0!==i&&s.push(function(t){return Math.min(t,i)}),a&&s.push(Math.round),s.length?u.pipe.apply(u,s):u},setValueNative:a,addActionDelay:sr,defaultTransitions:rr,transformPose:e,readValueFromSource:o,posePriority:i,extendAPI:r})}({posePriority:["drag","press","focus","hover"],transformPose:function(t,e,n){var r,o=t.flip,i=Un(t,["flip"]);return function(t,e,n){return n.props.element instanceof HTMLElement&&(!0===t||"flip"===e)}(o,e,n)?yr(n,i):(r=i,Object.keys(r).some(Or)?function(t,e){var n=t.values,r=t.props,o=r.element,i=r.elementStyler,a=Object.keys(e).filter(Or),u=[],s=getComputedStyle(o),c=!1;if(a.forEach(function(o){var i=n.get(o),a=ur(i.raw.get()),s=zn(e[o],r);a!==ur(s)&&(u.push(o),c||(c=!0,e.applyAtEnd=e.applyAtEnd?Nn({},e.applyAtEnd):{}),e.applyAtEnd[o]=e.applyAtEnd[o]||e[o],gr(t,o,s))}),!u.length)return e;var f=o.getBoundingClientRect(),p={top:s.top,left:s.left,bottom:s.bottom,right:s.right,transform:s.transform};i.render();var l=o.getBoundingClientRect();return u.forEach(function(n){gr(t,n,wr[n](o,f,p)),e[n]=wr[n](o,l,s)}),i.render(),e}(n,i):i)},forceRender:function(t){t.elementStyler.render()},addListenerToValue:function(t,e){return function(n){return e.set(t,n)}},readValueFromSource:function(t,e){var n=e.e