New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vueuse/motion

Package Overview
Dependencies
Maintainers
3
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vueuse/motion - npm Package Compare versions

Comparing version 1.2.10 to 1.3.0

99

dist/index.cjs.js
/*!
* @vueuse/motion v1.2.10
* @vueuse/motion v1.3.0
* (c) 2021

@@ -12,20 +12,18 @@ * @license MIT

var core = require('@vueuse/core');
var shared = require('@vueuse/shared');
var popmotion = require('popmotion');
var shared = require('@vueuse/shared');
const motionState = {};
var defaultTimestep = 1 / 60 * 1000;
var getCurrentTime = typeof performance !== "undefined" ? function () {
return performance.now();
} : function () {
return Date.now();
};
var onNextFrame = typeof window !== "undefined" ? function (callback) {
return window.requestAnimationFrame(callback);
} : function (callback) {
return setTimeout(function () {
return callback(getCurrentTime());
}, defaultTimestep);
};
var defaultTimestep = (1 / 60) * 1000;
var getCurrentTime = typeof performance !== "undefined"
? function () { return performance.now(); }
: function () { return Date.now(); };
var onNextFrame = typeof window !== "undefined"
? function (callback) {
return window.requestAnimationFrame(callback);
}
: function (callback) {
return setTimeout(function () { return callback(getCurrentTime()); }, defaultTimestep);
};

@@ -40,14 +38,12 @@ function createRenderStep(runNextFrame) {

schedule: function (callback, keepAlive, immediate) {
if (keepAlive === void 0) {
keepAlive = false;
}
if (immediate === void 0) {
immediate = false;
}
if (keepAlive === void 0) { keepAlive = false; }
if (immediate === void 0) { immediate = false; }
var addToCurrentFrame = immediate && isProcessing;
var buffer = addToCurrentFrame ? toRun : toRunNextFrame;
if (keepAlive) toKeepAlive.add(callback);
if (keepAlive)
toKeepAlive.add(callback);
if (buffer.indexOf(callback) === -1) {
buffer.push(callback);
if (addToCurrentFrame && isProcessing) numToRun = toRun.length;
if (addToCurrentFrame && isProcessing)
numToRun = toRun.length;
}

@@ -58,3 +54,4 @@ return callback;

var index = toRunNextFrame.indexOf(callback);
if (index !== -1) toRunNextFrame.splice(index, 1);
if (index !== -1)
toRunNextFrame.splice(index, 1);
toKeepAlive.delete(callback);

@@ -79,3 +76,3 @@ },

isProcessing = false;
}
},
};

@@ -976,21 +973,19 @@ return step;

const stop = (keys) => {
// Destroy key closure
const destroyKey = (key) => {
if (!motionValues[key])
return;
motionValues[key].stop();
motionValues[key].destroy();
vueDemi.del(motionValues, key);
};
// Check if keys argument is defined
if (keys) {
// Destroy key closure
const destroyKey = (key) => {
motionValues[key].stop();
motionValues[key].destroy();
vueDemi.del(motionValues, key);
};
if (isArray(keys)) {
// If `keys` are an array, loop on specified keys and destroy them
keys.forEach((key) => {
if (motionValues[key])
destroyKey(key);
});
keys.forEach(destroyKey);
}
else {
// If `keys` is a string, destroy the specified one
if (motionValues[keys])
destroyKey(keys);
destroyKey(keys);
}

@@ -1000,7 +995,3 @@ }

// No keys specified, destroy all animations
Object.entries(motionValues).forEach(([key, motionValue]) => {
motionValue.stop();
motionValue.destroy();
vueDemi.del(motionValues, key);
});
Object.keys(motionValues).forEach(destroyKey);
}

@@ -1026,14 +1017,14 @@ };

}
// Clear local motion value on animation complete
const _onComplete = () => {
if (onComplete)
onComplete();
motionValue.destroy();
vueDemi.del(motionValues, key);
};
// Sets the value immediately
if (transition && transition.immediate) {
motionValue.set(value);
return;
}
// Create animation
const animation = getAnimation(key, motionValue, value, transition, _onComplete);
const animation = getAnimation(key, motionValue, value, transition, onComplete);
// Start animation
motionValue.start(animation);
};
// Ensure everything is cleared on unmount
shared.tryOnUnmounted(stop);
return { motionValues, stop, push };

@@ -1069,5 +1060,5 @@ }

// Return Promise chain
return Promise.all(Object.keys(variant).map((key) => {
return Promise.all(Object.entries(variant).map(([key, value]) => {
return new Promise((resolve) => {
push(key, variant[key], motionProperties, transition || getDefaultTransition(key, variant[key]), resolve);
push(key, value, motionProperties, transition || getDefaultTransition(key, variant[key]), resolve);
});

@@ -1084,3 +1075,5 @@ }));

Object.entries(variantData).forEach(([key, value]) => {
vueDemi.set(motionProperties, key, value);
push(key, value, motionProperties, {
immediate: true,
});
});

@@ -1087,0 +1080,0 @@ };

/*!
* @vueuse/motion v1.2.10
* @vueuse/motion v1.3.0
* (c) 2021
* @license MIT
*/
import { reactive, del, set, ref, computed, watch, nextTick, isRef } from 'vue-demi';
import { reactive, set, del, ref, computed, watch, nextTick, isRef } from 'vue-demi';
import { isObject, useEventListener, useIntersectionObserver, noop, isNumber } from '@vueuse/core';
import { tryOnUnmounted, isFunction } from '@vueuse/shared';
import { velocityPerSecond, inertia, animate, cubicBezier, linear, easeIn, easeInOut, easeOut, circIn, circInOut, circOut, backIn, backInOut, backOut, anticipate, bounceIn, bounceInOut, bounceOut } from 'popmotion';
import { isFunction } from '@vueuse/shared';
const motionState = {};
var defaultTimestep = 1 / 60 * 1000;
var getCurrentTime = typeof performance !== "undefined" ? function () {
return performance.now();
} : function () {
return Date.now();
};
var onNextFrame = typeof window !== "undefined" ? function (callback) {
return window.requestAnimationFrame(callback);
} : function (callback) {
return setTimeout(function () {
return callback(getCurrentTime());
}, defaultTimestep);
};
var defaultTimestep = (1 / 60) * 1000;
var getCurrentTime = typeof performance !== "undefined"
? function () { return performance.now(); }
: function () { return Date.now(); };
var onNextFrame = typeof window !== "undefined"
? function (callback) {
return window.requestAnimationFrame(callback);
}
: function (callback) {
return setTimeout(function () { return callback(getCurrentTime()); }, defaultTimestep);
};

@@ -35,14 +33,12 @@ function createRenderStep(runNextFrame) {

schedule: function (callback, keepAlive, immediate) {
if (keepAlive === void 0) {
keepAlive = false;
}
if (immediate === void 0) {
immediate = false;
}
if (keepAlive === void 0) { keepAlive = false; }
if (immediate === void 0) { immediate = false; }
var addToCurrentFrame = immediate && isProcessing;
var buffer = addToCurrentFrame ? toRun : toRunNextFrame;
if (keepAlive) toKeepAlive.add(callback);
if (keepAlive)
toKeepAlive.add(callback);
if (buffer.indexOf(callback) === -1) {
buffer.push(callback);
if (addToCurrentFrame && isProcessing) numToRun = toRun.length;
if (addToCurrentFrame && isProcessing)
numToRun = toRun.length;
}

@@ -53,3 +49,4 @@ return callback;

var index = toRunNextFrame.indexOf(callback);
if (index !== -1) toRunNextFrame.splice(index, 1);
if (index !== -1)
toRunNextFrame.splice(index, 1);
toKeepAlive.delete(callback);

@@ -74,3 +71,3 @@ },

isProcessing = false;
}
},
};

@@ -971,21 +968,19 @@ return step;

const stop = (keys) => {
// Destroy key closure
const destroyKey = (key) => {
if (!motionValues[key])
return;
motionValues[key].stop();
motionValues[key].destroy();
del(motionValues, key);
};
// Check if keys argument is defined
if (keys) {
// Destroy key closure
const destroyKey = (key) => {
motionValues[key].stop();
motionValues[key].destroy();
del(motionValues, key);
};
if (isArray(keys)) {
// If `keys` are an array, loop on specified keys and destroy them
keys.forEach((key) => {
if (motionValues[key])
destroyKey(key);
});
keys.forEach(destroyKey);
}
else {
// If `keys` is a string, destroy the specified one
if (motionValues[keys])
destroyKey(keys);
destroyKey(keys);
}

@@ -995,7 +990,3 @@ }

// No keys specified, destroy all animations
Object.entries(motionValues).forEach(([key, motionValue]) => {
motionValue.stop();
motionValue.destroy();
del(motionValues, key);
});
Object.keys(motionValues).forEach(destroyKey);
}

@@ -1021,14 +1012,14 @@ };

}
// Clear local motion value on animation complete
const _onComplete = () => {
if (onComplete)
onComplete();
motionValue.destroy();
del(motionValues, key);
};
// Sets the value immediately
if (transition && transition.immediate) {
motionValue.set(value);
return;
}
// Create animation
const animation = getAnimation(key, motionValue, value, transition, _onComplete);
const animation = getAnimation(key, motionValue, value, transition, onComplete);
// Start animation
motionValue.start(animation);
};
// Ensure everything is cleared on unmount
tryOnUnmounted(stop);
return { motionValues, stop, push };

@@ -1064,9 +1055,9 @@ }

// Return Promise chain
return Promise.all(Object.keys(variant).map((key) => {
return Promise.all(Object.entries(variant).map(([key, value]) => {
return new Promise((resolve) => {
push(key, variant[key], motionProperties, transition || getDefaultTransition(key, variant[key]), resolve);
push(key, value, motionProperties, transition || getDefaultTransition(key, variant[key]), resolve);
});
}));
};
const set$1 = (variant) => {
const set = (variant) => {
// Get variant data from parameter

@@ -1079,3 +1070,5 @@ let variantData = isObject(variant) ? variant : getVariantFromKey(variant);

Object.entries(variantData).forEach(([key, value]) => {
set(motionProperties, key, value);
push(key, value, motionProperties, {
immediate: true,
});
});

@@ -1102,3 +1095,3 @@ };

apply,
set: set$1,
set,
stopTransitions: stop,

@@ -1105,0 +1098,0 @@ leave,

/*!
* @vueuse/motion v1.2.10
* @vueuse/motion v1.3.0
* (c) 2021
* @license MIT
*/
import { reactive, del, set, ref, computed, watch, nextTick, isRef } from 'vue-demi';
import { reactive, set, del, ref, computed, watch, nextTick, isRef } from 'vue-demi';
import { isObject, useEventListener, useIntersectionObserver, noop, isNumber } from '@vueuse/core';
import { tryOnUnmounted, isFunction } from '@vueuse/shared';
import { velocityPerSecond, inertia, animate, cubicBezier, linear, easeIn, easeInOut, easeOut, circIn, circInOut, circOut, backIn, backInOut, backOut, anticipate, bounceIn, bounceInOut, bounceOut } from 'popmotion';
import { isFunction } from '@vueuse/shared';
const motionState = {};
var defaultTimestep = 1 / 60 * 1000;
var getCurrentTime = typeof performance !== "undefined" ? function () {
return performance.now();
} : function () {
return Date.now();
};
var onNextFrame = typeof window !== "undefined" ? function (callback) {
return window.requestAnimationFrame(callback);
} : function (callback) {
return setTimeout(function () {
return callback(getCurrentTime());
}, defaultTimestep);
};
var defaultTimestep = (1 / 60) * 1000;
var getCurrentTime = typeof performance !== "undefined"
? function () { return performance.now(); }
: function () { return Date.now(); };
var onNextFrame = typeof window !== "undefined"
? function (callback) {
return window.requestAnimationFrame(callback);
}
: function (callback) {
return setTimeout(function () { return callback(getCurrentTime()); }, defaultTimestep);
};

@@ -35,14 +33,12 @@ function createRenderStep(runNextFrame) {

schedule: function (callback, keepAlive, immediate) {
if (keepAlive === void 0) {
keepAlive = false;
}
if (immediate === void 0) {
immediate = false;
}
if (keepAlive === void 0) { keepAlive = false; }
if (immediate === void 0) { immediate = false; }
var addToCurrentFrame = immediate && isProcessing;
var buffer = addToCurrentFrame ? toRun : toRunNextFrame;
if (keepAlive) toKeepAlive.add(callback);
if (keepAlive)
toKeepAlive.add(callback);
if (buffer.indexOf(callback) === -1) {
buffer.push(callback);
if (addToCurrentFrame && isProcessing) numToRun = toRun.length;
if (addToCurrentFrame && isProcessing)
numToRun = toRun.length;
}

@@ -53,3 +49,4 @@ return callback;

var index = toRunNextFrame.indexOf(callback);
if (index !== -1) toRunNextFrame.splice(index, 1);
if (index !== -1)
toRunNextFrame.splice(index, 1);
toKeepAlive.delete(callback);

@@ -74,3 +71,3 @@ },

isProcessing = false;
}
},
};

@@ -971,21 +968,19 @@ return step;

const stop = (keys) => {
// Destroy key closure
const destroyKey = (key) => {
if (!motionValues[key])
return;
motionValues[key].stop();
motionValues[key].destroy();
del(motionValues, key);
};
// Check if keys argument is defined
if (keys) {
// Destroy key closure
const destroyKey = (key) => {
motionValues[key].stop();
motionValues[key].destroy();
del(motionValues, key);
};
if (isArray(keys)) {
// If `keys` are an array, loop on specified keys and destroy them
keys.forEach((key) => {
if (motionValues[key])
destroyKey(key);
});
keys.forEach(destroyKey);
}
else {
// If `keys` is a string, destroy the specified one
if (motionValues[keys])
destroyKey(keys);
destroyKey(keys);
}

@@ -995,7 +990,3 @@ }

// No keys specified, destroy all animations
Object.entries(motionValues).forEach(([key, motionValue]) => {
motionValue.stop();
motionValue.destroy();
del(motionValues, key);
});
Object.keys(motionValues).forEach(destroyKey);
}

@@ -1021,14 +1012,14 @@ };

}
// Clear local motion value on animation complete
const _onComplete = () => {
if (onComplete)
onComplete();
motionValue.destroy();
del(motionValues, key);
};
// Sets the value immediately
if (transition && transition.immediate) {
motionValue.set(value);
return;
}
// Create animation
const animation = getAnimation(key, motionValue, value, transition, _onComplete);
const animation = getAnimation(key, motionValue, value, transition, onComplete);
// Start animation
motionValue.start(animation);
};
// Ensure everything is cleared on unmount
tryOnUnmounted(stop);
return { motionValues, stop, push };

@@ -1064,9 +1055,9 @@ }

// Return Promise chain
return Promise.all(Object.keys(variant).map((key) => {
return Promise.all(Object.entries(variant).map(([key, value]) => {
return new Promise((resolve) => {
push(key, variant[key], motionProperties, transition || getDefaultTransition(key, variant[key]), resolve);
push(key, value, motionProperties, transition || getDefaultTransition(key, variant[key]), resolve);
});
}));
};
const set$1 = (variant) => {
const set = (variant) => {
// Get variant data from parameter

@@ -1079,3 +1070,5 @@ let variantData = isObject(variant) ? variant : getVariantFromKey(variant);

Object.entries(variantData).forEach(([key, value]) => {
set(motionProperties, key, value);
push(key, value, motionProperties, {
immediate: true,
});
});

@@ -1102,3 +1095,3 @@ };

apply,
set: set$1,
set,
stopTransitions: stop,

@@ -1105,0 +1098,0 @@ leave,

/*!
* @vueuse/motion v1.2.10
* @vueuse/motion v1.3.0
* (c) 2021
* @license MIT
*/
var VueuseMotion=function(t,e,r,i,n){"use strict";const a={};var s=1/60*1e3,o="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},l="undefined"!=typeof window?function(t){return window.requestAnimationFrame(t)}:function(t){return setTimeout((function(){return t(o())}),s)};var u=!0,c=!1,p=!1,d={delta:0,timestamp:0},f=["read","update","preRender","render","postRender"],v=f.reduce((function(t,e){return t[e]=function(t){var e=[],r=[],i=0,n=!1,a=new WeakSet,s={schedule:function(t,s,o){void 0===s&&(s=!1),void 0===o&&(o=!1);var l=o&&n,u=l?e:r;return s&&a.add(t),-1===u.indexOf(t)&&(u.push(t),l&&n&&(i=e.length)),t},cancel:function(t){var e=r.indexOf(t);-1!==e&&r.splice(e,1),a.delete(t)},process:function(o){var l;if(n=!0,e=(l=[r,e])[0],(r=l[1]).length=0,i=e.length)for(var u=0;u<i;u++){var c=e[u];c(o),a.has(c)&&(s.schedule(c),t())}n=!1}};return s}((function(){return c=!0})),t}),{}),h=f.reduce((function(t,e){var r=v[e];return t[e]=function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!1),c||b(),r.schedule(t,e,i)},t}),{}),y=function(t){return v[t].process(d)},m=function(t){c=!1,d.delta=u?s:Math.max(Math.min(t-d.timestamp,40),1),d.timestamp=t,p=!0,f.forEach(y),p=!1,c&&(u=!1,l(m))},b=function(){c=!0,u=!0,p||l(m)};class g{constructor(){this.subscriptions=new Set}add(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}notify(t,e,r){if(this.subscriptions.size)for(const i of this.subscriptions)i(t,e,r)}clear(){this.subscriptions.clear()}}const w=t=>!isNaN(parseFloat(t));class O{constructor(t){this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new g,this.renderSubscribers=new g,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t,this.prev!==this.current&&this.updateSubscribers.notify(this.current),e&&this.renderSubscribers.notify(this.current);const{delta:r,timestamp:i}=d;this.lastUpdated!==i&&(this.timeDelta=r,this.lastUpdated=i,h.postRender(this.scheduleVelocityCheck))},this.scheduleVelocityCheck=()=>h.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current)},this.current=t,this.canTrackVelocity=w(this.current)}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){void 0!==this.current||this.canTrackVelocity||(this.canTrackVelocity=w(t)),e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?i.velocityPerSecond(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise((e=>{const{stop:r}=t(e);this.stopAnimation=r})).then((()=>this.clearAnimation()))}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}
var VueuseMotion=function(t,e,r,i,n){"use strict";const a={};var o=1/60*1e3,s="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},u="undefined"!=typeof window?function(t){return window.requestAnimationFrame(t)}:function(t){return setTimeout((function(){return t(s())}),o)};var l=!0,c=!1,p=!1,d={delta:0,timestamp:0},f=["read","update","preRender","render","postRender"],v=f.reduce((function(t,e){return t[e]=function(t){var e=[],r=[],i=0,n=!1,a=new WeakSet,o={schedule:function(t,o,s){void 0===o&&(o=!1),void 0===s&&(s=!1);var u=s&&n,l=u?e:r;return o&&a.add(t),-1===l.indexOf(t)&&(l.push(t),u&&n&&(i=e.length)),t},cancel:function(t){var e=r.indexOf(t);-1!==e&&r.splice(e,1),a.delete(t)},process:function(s){var u;if(n=!0,e=(u=[r,e])[0],(r=u[1]).length=0,i=e.length)for(var l=0;l<i;l++){var c=e[l];c(s),a.has(c)&&(o.schedule(c),t())}n=!1}};return o}((function(){return c=!0})),t}),{}),h=f.reduce((function(t,e){var r=v[e];return t[e]=function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!1),c||b(),r.schedule(t,e,i)},t}),{}),m=function(t){return v[t].process(d)},y=function(t){c=!1,d.delta=l?o:Math.max(Math.min(t-d.timestamp,40),1),d.timestamp=t,p=!0,f.forEach(m),p=!1,c&&(l=!1,u(y))},b=function(){c=!0,l=!0,p||u(y)};class g{constructor(){this.subscriptions=new Set}add(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}notify(t,e,r){if(this.subscriptions.size)for(const i of this.subscriptions)i(t,e,r)}clear(){this.subscriptions.clear()}}const w=t=>!isNaN(parseFloat(t));class O{constructor(t){this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new g,this.renderSubscribers=new g,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t,this.prev!==this.current&&this.updateSubscribers.notify(this.current),e&&this.renderSubscribers.notify(this.current);const{delta:r,timestamp:i}=d;this.lastUpdated!==i&&(this.timeDelta=r,this.lastUpdated=i,h.postRender(this.scheduleVelocityCheck))},this.scheduleVelocityCheck=()=>h.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current)},this.current=t,this.canTrackVelocity=w(this.current)}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){void 0!==this.current||this.canTrackVelocity||(this.canTrackVelocity=w(t)),e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?n.velocityPerSecond(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise((e=>{const{stop:r}=t(e);this.stopAnimation=r})).then((()=>this.clearAnimation()))}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}
/*! *****************************************************************************

@@ -21,2 +21,2 @@ Copyright (c) Microsoft Corporation.

***************************************************************************** */
var k=function(){return(k=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},x=function(t,e){return function(r){return Math.max(Math.min(r,e),t)}},V=function(t){return t%1?Number(t.toFixed(5)):t},A=/(-)?([\d]*\.?[\d])+/g,T=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,L=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function R(t){return"string"==typeof t}var E={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},j=k(k({},E),{transform:x(0,1)}),C=k(k({},E),{default:1}),I=function(t){return{test:function(e){return R(e)&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},S=I("deg"),M=I("%"),P=I("px"),z=k(k({},M),{parse:function(t){return M.parse(t)/100},transform:function(t){return M.transform(100*t)}}),B=function(t,e){return function(r){return R(r)&&L.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)}},F=function(t,e,r){return function(i){var n;if(!R(i))return i;var a=i.match(A),s=a[1],o=a[2],l=a[3];return(n={})[t]=parseFloat(a[0]),n[e]=parseFloat(s),n[r]=parseFloat(o),n.alpha=void 0!==l?parseFloat(l):1,n}},N={test:B("hsl","hue"),parse:F("hue","saturation","lightness"),transform:function(t){var e=t.saturation,r=t.lightness,i=t.alpha,n=void 0===i?1:i;return"hsla("+Math.round(t.hue)+", "+M.transform(V(e))+", "+M.transform(V(r))+", "+V(j.transform(n))+")"}},W=x(0,255),U=k(k({},E),{transform:function(t){return Math.round(W(t))}}),Z={test:B("rgb","red"),parse:F("red","green","blue"),transform:function(t){var e=t.green,r=t.blue,i=t.alpha,n=void 0===i?1:i;return"rgba("+U.transform(t.red)+", "+U.transform(e)+", "+U.transform(r)+", "+V(j.transform(n))+")"}};var D={test:B("#"),parse:function(t){var e="",r="",i="",n="";return t.length>5?(e=t.substr(1,2),r=t.substr(3,2),i=t.substr(5,2),n=t.substr(7,2)):(e=t.substr(1,1),r=t.substr(2,1),i=t.substr(3,1),n=t.substr(4,1),e+=e,r+=r,i+=i,n+=n),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(i,16),alpha:n?parseInt(n,16)/255:1}},transform:Z.transform},X={test:function(t){return Z.test(t)||D.test(t)||N.test(t)},parse:function(t){return Z.test(t)?Z.parse(t):N.test(t)?N.parse(t):D.parse(t)},transform:function(t){return R(t)?t:t.hasOwnProperty("red")?Z.transform(t):N.transform(t)}},Y="${c}",$="${n}";function _(t){var e=[],r=0,i=t.match(T);i&&(r=i.length,t=t.replace(T,Y),e.push.apply(e,i.map(X.parse)));var n=t.match(A);return n&&(t=t.replace(A,$),e.push.apply(e,n.map(E.parse))),{values:e,numColors:r,tokenised:t}}function H(t){return _(t).values}function q(t){var e=_(t),r=e.numColors,i=e.tokenised,n=e.values.length;return function(t){for(var e=i,a=0;a<n;a++)e=e.replace(a<r?Y:$,a<r?X.transform(t[a]):V(t[a]));return e}}var G=function(t){return"number"==typeof t?0:t};var J={test:function(t){var e,r,i,n;return isNaN(t)&&R(t)&&(null!==(r=null===(e=t.match(A))||void 0===e?void 0:e.length)&&void 0!==r?r:0)+(null!==(n=null===(i=t.match(T))||void 0===i?void 0:i.length)&&void 0!==n?n:0)>0},parse:H,createTransformer:q,getAnimatableNone:function(t){var e=H(t);return q(t)(e.map(G))}},K=new Set(["brightness","contrast","saturate","opacity"]);function Q(t){var e=t.slice(0,-1).split("("),r=e[0],i=e[1];if("drop-shadow"===r)return t;var n=(i.match(A)||[])[0];if(!n)return t;var a=i.replace(n,""),s=K.has(r)?1:0;return n!==i&&(s*=100),r+"("+s+a+")"}var tt=/([a-z-]*)\(.*?\)/g,et=k(k({},J),{getAnimatableNone:function(t){var e=t.match(tt);return e?e.map(Q).join(" "):t}});const rt=()=>({type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}),it=t=>({type:"spring",stiffness:550,damping:0===t?100:30,restDelta:.01,restSpeed:10}),nt=()=>({type:"keyframes",ease:"linear",duration:300}),at=t=>({type:"keyframes",duration:800,values:t}),st={default:it,x:rt,y:rt,z:rt,rotate:rt,rotateX:rt,rotateY:rt,rotateZ:rt,scaleX:it,scaleY:it,scale:it,backgroundColor:nt,color:nt,opacity:nt},ot=(t,e)=>{let r;return r=Array.isArray(e)?at:st[t]||st.default,{to:e,...r(e)}},lt={...E,transform:Math.round},ut={color:X,backgroundColor:X,outlineColor:X,fill:X,stroke:X,borderColor:X,borderTopColor:X,borderRightColor:X,borderBottomColor:X,borderLeftColor:X,borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,radius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,size:P,top:P,right:P,bottom:P,left:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,rotate:S,rotateX:S,rotateY:S,rotateZ:S,scale:C,scaleX:C,scaleY:C,scaleZ:C,skew:S,skewX:S,skewY:S,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:j,originX:z,originY:z,originZ:P,zIndex:lt,filter:et,WebkitFilter:et,fillOpacity:j,strokeOpacity:j,numOctaves:lt},ct=t=>ut[t],pt=(t,e)=>e&&"number"==typeof t&&e.transform?e.transform(t):t;const dt={linear:i.linear,easeIn:i.easeIn,easeInOut:i.easeInOut,easeOut:i.easeOut,circIn:i.circIn,circInOut:i.circInOut,circOut:i.circOut,backIn:i.backIn,backInOut:i.backInOut,backOut:i.backOut,anticipate:i.anticipate,bounceIn:i.bounceIn,bounceInOut:i.bounceInOut,bounceOut:i.bounceOut},ft=t=>{if(Array.isArray(t)){const[e,r,n,a]=t;return i.cubicBezier(e,r,n,a)}return"string"==typeof t?dt[t]:t},vt=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!J.test(e)||e.startsWith("url(")));function ht({ease:t,times:e,delay:r,...i}){const n={...i};return e&&(n.offset=e),t&&(n.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(ft):ft(t)),r&&(n.elapsed=-r),n}function yt(t,e,r){return Array.isArray(e.to)&&(t.duration||(t.duration=800)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({delay:t,repeat:e,repeatType:r,repeatDelay:i,from:n,...a}){return!!Object.keys(a).length}(t)||(t={...t,...ot(r,e.to)}),{...e,...ht(t)}}function mt(t,e,r,n,a){const s=function(t,e){return t[e]||t.default||t}(n,t);let o=null==s.from?e.get():s.from;const l=vt(t,r);"none"===o&&l&&"string"==typeof r&&(o=function(t,e){let r=ct(t);return r!==et&&(r=J),r.getAnimatableNone?r.getAnimatableNone(e):void 0}(t,r));return vt(t,o)&&l&&!1!==s.type?function(l){const u={from:o,to:r,velocity:n.velocity?n.velocity:e.getVelocity(),onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?i.inertia({...u,...s}):i.animate({...yt(s,u,t),onUpdate:t=>{u.onUpdate(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{n.onComplete&&n.onComplete(),a&&a(),l&&l()}})}:function(t){return e.set(r),n.onComplete&&n.onComplete(),a&&a(),t&&t(),{stop:()=>{}}}}const{isArray:bt}=Array;function gt(){const t=e.reactive({});return{motionValues:t,stop:r=>{if(r){const i=r=>{t[r].stop(),t[r].destroy(),e.del(t,r)};bt(r)?r.forEach((e=>{t[e]&&i(e)})):t[r]&&i(r)}else Object.entries(t).forEach((([r,i])=>{i.stop(),i.destroy(),e.del(t,r)}))},push:(r,i,n,a={},s)=>{let o=t[r];if(!o){const i=new O(n[r]);i.onChange((t=>{e.set(n,r,t)})),e.set(t,r,i),o=i}const l=mt(r,o,i,a,(()=>{s&&s(),o.destroy(),e.del(t,r)}));o.start(l)}}}function wt(t,i={},{push:n,stop:a}=gt()){const s=e.ref(i),o=t=>{if(!s||!s.value||!s.value[t])throw new Error(`The variant ${t} does not exist.`);return s.value[t]},l=e=>{let i=r.isObject(e)&&e.transition;return i||"string"!=typeof e||(e=o(e)),i&&delete e.transition,Promise.all(Object.keys(e).map((r=>new Promise((a=>{n(r,e[r],t,i||ot(r,e[r]),a)})))))};return{apply:l,set:i=>{let n=r.isObject(i)?i:o(i);n.transition&&delete n.transition,Object.entries(n).forEach((([r,i])=>{e.set(t,r,i)}))},stopTransitions:a,leave:async t=>{let e;s&&s.value&&(s.value.leave&&(e=s.value.leave),!s.value.leave&&s.value.initial&&(e=s.value.initial)),e?(await l(e),t()):t()}}}const Ot="undefined"!=typeof window;function kt({target:t,state:i,variants:n,apply:a}){const s=e.ref(!1),o=e.ref(!1),l=e.ref(!1),u=e.computed((()=>{let t=[];return n.value.hovered&&(t=[...t,...Object.keys(n.value.hovered)]),n.value.tapped&&(t=[...t,...Object.keys(n.value.tapped)]),n.value.focused&&(t=[...t,...Object.keys(n.value.focused)]),t})),c=e.computed((()=>{const t={};Object.assign(t,i.value),s.value&&n.value.hovered&&Object.assign(t,n.value.hovered),o.value&&n.value.tapped&&Object.assign(t,n.value.tapped),l.value&&n.value.focused&&Object.assign(t,n.value.focused);for(const e in t)u.value.includes(e)||delete t[e];return t}));e.watch(t,(t=>{t&&(n.value.hovered&&(r.useEventListener(t,"mouseenter",(()=>{s.value=!0})),r.useEventListener(t,"mouseleave",(()=>{s.value=!1,o.value=!1})),r.useEventListener(t,"mouseout",(()=>{s.value=!1,o.value=!1}))),n.value.tapped&&(Ot&&null===window.onmousedown&&(r.useEventListener(t,"mousedown",(()=>{o.value=!0})),r.useEventListener(t,"mouseup",(()=>{o.value=!1}))),Ot&&null===window.onpointerdown&&(r.useEventListener(t,"pointerdown",(()=>{o.value=!0})),r.useEventListener(t,"pointerup",(()=>{o.value=!1}))),Ot&&null===window.ontouchstart&&(r.useEventListener(t,"touchstart",(()=>{o.value=!0})),r.useEventListener(t,"touchend",(()=>{o.value=!1})))),n.value.focused&&(r.useEventListener(t,"focus",(()=>{l.value=!0})),r.useEventListener(t,"blur",(()=>{l.value=!1}))))}),{immediate:!0}),e.watch(c,(t=>{a(t)}))}function xt(t,i={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){i.lifeCycleHooks&&function({target:t,variants:r,variant:i}){e.watch(t,(()=>{r.value&&r.value.enter&&(r.value.initial&&(i.value="initial"),e.nextTick((()=>i.value="enter")))}),{immediate:!0,flush:"pre"})}(t),i.syncVariants&&function({state:t,apply:r}){e.watch(t,(t=>{t&&r(t)}),{immediate:!0})}(t),i.visibilityHooks&&function({target:t,variants:i,variant:n}){let a=r.noop;const s=e.watch(t,(e=>{e&&(a=r.useIntersectionObserver(t,(([{isIntersecting:t}])=>{i.value&&i.value.visible&&(n.value=t?"visible":"initial")})).stop)}),{immediate:!0})}(t),i.eventListeners&&kt(t)}function Vt(t={}){const r=e.reactive({...t}),i=e.ref({});return e.watch(r,(()=>{const t={};for(const[e,i]of Object.entries(r)){const r=ct(e),n=pt(i,r);t[e]=n}i.value=t}),{immediate:!0,deep:!0}),{state:r,style:i}}function At(t){const r=e.ref(t);let i;const{state:n,style:a}=Vt(),s=e.watch(r,(t=>{if(t){for(const r of Object.keys(ut))null!=t.style[r]&&""!==t.style[r]&&e.set(n,r,t.style[r]);if(i)for(const r in i)e.set(t.style,r,i[r])}})),o=e.watch(a,(t=>{if(r.value&&r.value.style)for(const i in t)e.set(r.value.style,i,t[i]);else i=t}),{immediate:!0});return{style:n,stop:()=>{s(),o()}}}const Tt={x:"translateX",y:"translateY",z:"translateZ"};function Lt(t={},r=!0){const i=e.reactive({...t}),n=e.ref("");return e.watch(i,(()=>{let t="",e=!1;for(const[r,n]of Object.entries(i)){const i=ct(r),a=pt(n,i);t+=`${Tt[r]||r}(${a}) `,"z"!==r&&"translateZ"!==r||(e=!0)}!e&&r?t+="translateZ(0)":t=t.trim(),n.value=t}),{immediate:!0,deep:!0}),{state:i,transform:n}}function Rt(t){const r=e.ref(t);let i;const{state:n,transform:a}=Lt(),s=e.watch(r,(t=>{t&&i&&(t.style.transform=i)})),o=e.watch(a,(t=>{r.value&&r.value.style?r.value.style.transform=t:i=t}),{immediate:!0});return{transform:n,stop:()=>{s(),o()}}}const Et=["","X","Y","Z"],jt=["transformPerspective","x","y","z"];["perspective","translate","scale","rotate","skew"].forEach((t=>{Et.forEach((e=>{jt.push(t+e)}))}));const Ct=new Set(jt);function It(t){return Ct.has(t)}function St(t){const r=e.ref(t),{style:i}=At(r),{transform:n}=Rt(r),a=e.reactive({});return e.watch(a,(t=>{for(const r in t){const a=It(r)?n:i;a[r]&&a[r]===t[r]||e.set(a,r,t[r])}}),{immediate:!0,deep:!0}),{motionProperties:a,style:i,transform:n}}function Mt(t={}){const r=e.ref(t),i=e.ref();return{state:e.computed((()=>{if(i.value)return r.value[i.value]})),variant:i}}function Pt(t,r={},i){const n=e.ref(r),a=e.ref(t),{motionProperties:s}=St(a),{variant:o,state:l}=Mt(n),u={target:a,variant:o,variants:n,state:l,motionProperties:s,...wt(s,n)};return xt(u,i),u}const zt=["initial","enter","leave","visible","hovered","tapped","focused","delay"],Bt=t=>{const i=(i,n,s)=>{const o=e.ref(t||{});((t,e)=>{const i=t.props?t.props:t.data&&t.data.attrs?t.data.attrs:{};i&&(i.variants&&r.isObject(i.variants)&&(e.value={...e.value,...i.variants}),zt.forEach((t=>{if("delay"!==t)i&&i[t]&&r.isObject(i[t])&&(e.value[t]=i[t]);else if(i&&i[t]&&r.isNumber(i[t])){const r=i[t];e&&e.value&&(e.value.enter&&(e.value.enter.transition||(e.value.enter.transition={}),e.value.enter.transition={...e.value.enter.transition,delay:r}),e.value.visible&&(e.value.visible.transition||(e.value.visible.transition={}),e.value.visible.transition={...e.value.visible.transition,delay:r}))}})))})(s,o);const l=Pt(i,o);n.value&&e.set(a,n.value,l)},n=(t,r,i)=>{r.value&&a[r.value]&&e.del(a,r.value)};return{created:i,unmounted:n,bind:i,unbind:n}},Ft={initial:{opacity:0},enter:{opacity:1}},Nt={initial:{opacity:0},visible:{opacity:1}},Wt={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},Ut={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},Zt={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},Dt={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},Xt={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},Yt={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},$t={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},_t={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},Ht={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},qt={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},Gt={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},Jt={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},Kt={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},Qt={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},te={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},ee={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},re={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},ie={initial:{y:100,opacity:0},visible:{y:0,opacity:1}};var ne=Object.freeze({__proto__:null,fade:Ft,fadeVisible:Nt,pop:Wt,popVisible:Ut,rollBottom:Ht,rollLeft:Zt,rollRight:Xt,rollTop:$t,rollVisibleBottom:qt,rollVisibleLeft:Dt,rollVisibleRight:Yt,rollVisibleTop:_t,slideBottom:re,slideLeft:Gt,slideRight:Kt,slideTop:te,slideVisibleBottom:ie,slideVisibleLeft:Jt,slideVisibleRight:Qt,slideVisibleTop:ee});function ae(t){const e="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;",r=new RegExp(e.split("").join("|"),"g");return t.toString().replace(/[A-Z]/g,(t=>"-"+t)).toLowerCase().replace(/\s+/g,"-").replace(r,(t=>"aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------".charAt(e.indexOf(t)))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}const se={install(t,e){if(t.directive("motion",Bt()),!e||e&&!e.excludePresets)for(const e in ne){const r=ne[e];t.directive(`motion-${ae(e)}`,Bt(r))}if(e&&e.directives)for(const r in e.directives){const i=e.directives[r];0,t.directive(`motion-${r}`,Bt(i))}}};return t.MotionDirective=Bt,t.MotionPlugin=se,t.fade=Ft,t.fadeVisible=Nt,t.isMotionInstance=function(t){const r=t;return void 0!==r.apply&&n.isFunction(r.apply)&&void 0!==r.set&&n.isFunction(r.set)&&void 0!==r.stopTransitions&&n.isFunction(r.stopTransitions)&&void 0!==r.target&&e.isRef(r.target)},t.pop=Wt,t.popVisible=Ut,t.reactiveStyle=Vt,t.reactiveTransform=Lt,t.rollBottom=Ht,t.rollLeft=Zt,t.rollRight=Xt,t.rollTop=$t,t.rollVisibleBottom=qt,t.rollVisibleLeft=Dt,t.rollVisibleRight=Yt,t.rollVisibleTop=_t,t.slideBottom=re,t.slideLeft=Gt,t.slideRight=Kt,t.slideTop=te,t.slideVisibleBottom=ie,t.slideVisibleLeft=Jt,t.slideVisibleRight=Qt,t.slideVisibleTop=ee,t.slugify=ae,t.useElementStyle=At,t.useElementTransform=Rt,t.useMotion=Pt,t.useMotionControls=wt,t.useMotionProperties=St,t.useMotionTransitions=gt,t.useMotionVariants=Mt,t.useMotions=function(){return a},t.useTrail=function(t,r){const i=e.reactive({}),n=wt(i,{});return e.watch(i,(e=>{t.forEach(((t,i)=>{0!==i?setTimeout((()=>t.apply(e)),i*r):t.apply(e)}))})),{...n}},Object.defineProperty(t,"__esModule",{value:!0}),t}({},VueDemi,VueUse,popmotion,shared);
var k=function(){return(k=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},x=function(t,e){return function(r){return Math.max(Math.min(r,e),t)}},V=function(t){return t%1?Number(t.toFixed(5)):t},A=/(-)?([\d]*\.?[\d])+/g,T=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,L=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function R(t){return"string"==typeof t}var E={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},j=k(k({},E),{transform:x(0,1)}),C=k(k({},E),{default:1}),I=function(t){return{test:function(e){return R(e)&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},S=I("deg"),M=I("%"),P=I("px"),z=k(k({},M),{parse:function(t){return M.parse(t)/100},transform:function(t){return M.transform(100*t)}}),B=function(t,e){return function(r){return R(r)&&L.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)}},F=function(t,e,r){return function(i){var n;if(!R(i))return i;var a=i.match(A),o=a[1],s=a[2],u=a[3];return(n={})[t]=parseFloat(a[0]),n[e]=parseFloat(o),n[r]=parseFloat(s),n.alpha=void 0!==u?parseFloat(u):1,n}},N={test:B("hsl","hue"),parse:F("hue","saturation","lightness"),transform:function(t){var e=t.saturation,r=t.lightness,i=t.alpha,n=void 0===i?1:i;return"hsla("+Math.round(t.hue)+", "+M.transform(V(e))+", "+M.transform(V(r))+", "+V(j.transform(n))+")"}},U=x(0,255),W=k(k({},E),{transform:function(t){return Math.round(U(t))}}),Z={test:B("rgb","red"),parse:F("red","green","blue"),transform:function(t){var e=t.green,r=t.blue,i=t.alpha,n=void 0===i?1:i;return"rgba("+W.transform(t.red)+", "+W.transform(e)+", "+W.transform(r)+", "+V(j.transform(n))+")"}};var D={test:B("#"),parse:function(t){var e="",r="",i="",n="";return t.length>5?(e=t.substr(1,2),r=t.substr(3,2),i=t.substr(5,2),n=t.substr(7,2)):(e=t.substr(1,1),r=t.substr(2,1),i=t.substr(3,1),n=t.substr(4,1),e+=e,r+=r,i+=i,n+=n),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(i,16),alpha:n?parseInt(n,16)/255:1}},transform:Z.transform},X={test:function(t){return Z.test(t)||D.test(t)||N.test(t)},parse:function(t){return Z.test(t)?Z.parse(t):N.test(t)?N.parse(t):D.parse(t)},transform:function(t){return R(t)?t:t.hasOwnProperty("red")?Z.transform(t):N.transform(t)}},Y="${c}",$="${n}";function _(t){var e=[],r=0,i=t.match(T);i&&(r=i.length,t=t.replace(T,Y),e.push.apply(e,i.map(X.parse)));var n=t.match(A);return n&&(t=t.replace(A,$),e.push.apply(e,n.map(E.parse))),{values:e,numColors:r,tokenised:t}}function H(t){return _(t).values}function q(t){var e=_(t),r=e.numColors,i=e.tokenised,n=e.values.length;return function(t){for(var e=i,a=0;a<n;a++)e=e.replace(a<r?Y:$,a<r?X.transform(t[a]):V(t[a]));return e}}var G=function(t){return"number"==typeof t?0:t};var J={test:function(t){var e,r,i,n;return isNaN(t)&&R(t)&&(null!==(r=null===(e=t.match(A))||void 0===e?void 0:e.length)&&void 0!==r?r:0)+(null!==(n=null===(i=t.match(T))||void 0===i?void 0:i.length)&&void 0!==n?n:0)>0},parse:H,createTransformer:q,getAnimatableNone:function(t){var e=H(t);return q(t)(e.map(G))}},K=new Set(["brightness","contrast","saturate","opacity"]);function Q(t){var e=t.slice(0,-1).split("("),r=e[0],i=e[1];if("drop-shadow"===r)return t;var n=(i.match(A)||[])[0];if(!n)return t;var a=i.replace(n,""),o=K.has(r)?1:0;return n!==i&&(o*=100),r+"("+o+a+")"}var tt=/([a-z-]*)\(.*?\)/g,et=k(k({},J),{getAnimatableNone:function(t){var e=t.match(tt);return e?e.map(Q).join(" "):t}});const rt=()=>({type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}),it=t=>({type:"spring",stiffness:550,damping:0===t?100:30,restDelta:.01,restSpeed:10}),nt=()=>({type:"keyframes",ease:"linear",duration:300}),at=t=>({type:"keyframes",duration:800,values:t}),ot={default:it,x:rt,y:rt,z:rt,rotate:rt,rotateX:rt,rotateY:rt,rotateZ:rt,scaleX:it,scaleY:it,scale:it,backgroundColor:nt,color:nt,opacity:nt},st=(t,e)=>{let r;return r=Array.isArray(e)?at:ot[t]||ot.default,{to:e,...r(e)}},ut={...E,transform:Math.round},lt={color:X,backgroundColor:X,outlineColor:X,fill:X,stroke:X,borderColor:X,borderTopColor:X,borderRightColor:X,borderBottomColor:X,borderLeftColor:X,borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,radius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,size:P,top:P,right:P,bottom:P,left:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,rotate:S,rotateX:S,rotateY:S,rotateZ:S,scale:C,scaleX:C,scaleY:C,scaleZ:C,skew:S,skewX:S,skewY:S,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:j,originX:z,originY:z,originZ:P,zIndex:ut,filter:et,WebkitFilter:et,fillOpacity:j,strokeOpacity:j,numOctaves:ut},ct=t=>lt[t],pt=(t,e)=>e&&"number"==typeof t&&e.transform?e.transform(t):t;const dt={linear:n.linear,easeIn:n.easeIn,easeInOut:n.easeInOut,easeOut:n.easeOut,circIn:n.circIn,circInOut:n.circInOut,circOut:n.circOut,backIn:n.backIn,backInOut:n.backInOut,backOut:n.backOut,anticipate:n.anticipate,bounceIn:n.bounceIn,bounceInOut:n.bounceInOut,bounceOut:n.bounceOut},ft=t=>{if(Array.isArray(t)){const[e,r,i,a]=t;return n.cubicBezier(e,r,i,a)}return"string"==typeof t?dt[t]:t},vt=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!J.test(e)||e.startsWith("url(")));function ht({ease:t,times:e,delay:r,...i}){const n={...i};return e&&(n.offset=e),t&&(n.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(ft):ft(t)),r&&(n.elapsed=-r),n}function mt(t,e,r){return Array.isArray(e.to)&&(t.duration||(t.duration=800)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({delay:t,repeat:e,repeatType:r,repeatDelay:i,from:n,...a}){return!!Object.keys(a).length}(t)||(t={...t,...st(r,e.to)}),{...e,...ht(t)}}function yt(t,e,r,i,a){const o=function(t,e){return t[e]||t.default||t}(i,t);let s=null==o.from?e.get():o.from;const u=vt(t,r);"none"===s&&u&&"string"==typeof r&&(s=function(t,e){let r=ct(t);return r!==et&&(r=J),r.getAnimatableNone?r.getAnimatableNone(e):void 0}(t,r));return vt(t,s)&&u&&!1!==o.type?function(u){const l={from:s,to:r,velocity:i.velocity?i.velocity:e.getVelocity(),onUpdate:t=>e.set(t)};return"inertia"===o.type||"decay"===o.type?n.inertia({...l,...o}):n.animate({...mt(o,l,t),onUpdate:t=>{l.onUpdate(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{i.onComplete&&i.onComplete(),a&&a(),u&&u()}})}:function(t){return e.set(r),i.onComplete&&i.onComplete(),a&&a(),t&&t(),{stop:()=>{}}}}const{isArray:bt}=Array;function gt(){const t=e.reactive({}),r=r=>{const i=r=>{t[r]&&(t[r].stop(),t[r].destroy(),e.del(t,r))};r?bt(r)?r.forEach(i):i(r):Object.keys(t).forEach(i)};return i.tryOnUnmounted(r),{motionValues:t,stop:r,push:(r,i,n,a={},o)=>{let s=t[r];if(!s){const i=new O(n[r]);i.onChange((t=>{e.set(n,r,t)})),e.set(t,r,i),s=i}if(a&&a.immediate)return void s.set(i);const u=yt(r,s,i,a,o);s.start(u)}}}function wt(t,i={},{push:n,stop:a}=gt()){const o=e.ref(i),s=t=>{if(!o||!o.value||!o.value[t])throw new Error(`The variant ${t} does not exist.`);return o.value[t]},u=e=>{let i=r.isObject(e)&&e.transition;return i||"string"!=typeof e||(e=s(e)),i&&delete e.transition,Promise.all(Object.entries(e).map((([r,a])=>new Promise((o=>{n(r,a,t,i||st(r,e[r]),o)})))))};return{apply:u,set:e=>{let i=r.isObject(e)?e:s(e);i.transition&&delete i.transition,Object.entries(i).forEach((([e,r])=>{n(e,r,t,{immediate:!0})}))},stopTransitions:a,leave:async t=>{let e;o&&o.value&&(o.value.leave&&(e=o.value.leave),!o.value.leave&&o.value.initial&&(e=o.value.initial)),e?(await u(e),t()):t()}}}const Ot="undefined"!=typeof window;function kt({target:t,state:i,variants:n,apply:a}){const o=e.ref(!1),s=e.ref(!1),u=e.ref(!1),l=e.computed((()=>{let t=[];return n.value.hovered&&(t=[...t,...Object.keys(n.value.hovered)]),n.value.tapped&&(t=[...t,...Object.keys(n.value.tapped)]),n.value.focused&&(t=[...t,...Object.keys(n.value.focused)]),t})),c=e.computed((()=>{const t={};Object.assign(t,i.value),o.value&&n.value.hovered&&Object.assign(t,n.value.hovered),s.value&&n.value.tapped&&Object.assign(t,n.value.tapped),u.value&&n.value.focused&&Object.assign(t,n.value.focused);for(const e in t)l.value.includes(e)||delete t[e];return t}));e.watch(t,(t=>{t&&(n.value.hovered&&(r.useEventListener(t,"mouseenter",(()=>{o.value=!0})),r.useEventListener(t,"mouseleave",(()=>{o.value=!1,s.value=!1})),r.useEventListener(t,"mouseout",(()=>{o.value=!1,s.value=!1}))),n.value.tapped&&(Ot&&null===window.onmousedown&&(r.useEventListener(t,"mousedown",(()=>{s.value=!0})),r.useEventListener(t,"mouseup",(()=>{s.value=!1}))),Ot&&null===window.onpointerdown&&(r.useEventListener(t,"pointerdown",(()=>{s.value=!0})),r.useEventListener(t,"pointerup",(()=>{s.value=!1}))),Ot&&null===window.ontouchstart&&(r.useEventListener(t,"touchstart",(()=>{s.value=!0})),r.useEventListener(t,"touchend",(()=>{s.value=!1})))),n.value.focused&&(r.useEventListener(t,"focus",(()=>{u.value=!0})),r.useEventListener(t,"blur",(()=>{u.value=!1}))))}),{immediate:!0}),e.watch(c,(t=>{a(t)}))}function xt(t,i={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){i.lifeCycleHooks&&function({target:t,variants:r,variant:i}){e.watch(t,(()=>{r.value&&r.value.enter&&(r.value.initial&&(i.value="initial"),e.nextTick((()=>i.value="enter")))}),{immediate:!0,flush:"pre"})}(t),i.syncVariants&&function({state:t,apply:r}){e.watch(t,(t=>{t&&r(t)}),{immediate:!0})}(t),i.visibilityHooks&&function({target:t,variants:i,variant:n}){let a=r.noop;const o=e.watch(t,(e=>{e&&(a=r.useIntersectionObserver(t,(([{isIntersecting:t}])=>{i.value&&i.value.visible&&(n.value=t?"visible":"initial")})).stop)}),{immediate:!0})}(t),i.eventListeners&&kt(t)}function Vt(t={}){const r=e.reactive({...t}),i=e.ref({});return e.watch(r,(()=>{const t={};for(const[e,i]of Object.entries(r)){const r=ct(e),n=pt(i,r);t[e]=n}i.value=t}),{immediate:!0,deep:!0}),{state:r,style:i}}function At(t){const r=e.ref(t);let i;const{state:n,style:a}=Vt(),o=e.watch(r,(t=>{if(t){for(const r of Object.keys(lt))null!=t.style[r]&&""!==t.style[r]&&e.set(n,r,t.style[r]);if(i)for(const r in i)e.set(t.style,r,i[r])}})),s=e.watch(a,(t=>{if(r.value&&r.value.style)for(const i in t)e.set(r.value.style,i,t[i]);else i=t}),{immediate:!0});return{style:n,stop:()=>{o(),s()}}}const Tt={x:"translateX",y:"translateY",z:"translateZ"};function Lt(t={},r=!0){const i=e.reactive({...t}),n=e.ref("");return e.watch(i,(()=>{let t="",e=!1;for(const[r,n]of Object.entries(i)){const i=ct(r),a=pt(n,i);t+=`${Tt[r]||r}(${a}) `,"z"!==r&&"translateZ"!==r||(e=!0)}!e&&r?t+="translateZ(0)":t=t.trim(),n.value=t}),{immediate:!0,deep:!0}),{state:i,transform:n}}function Rt(t){const r=e.ref(t);let i;const{state:n,transform:a}=Lt(),o=e.watch(r,(t=>{t&&i&&(t.style.transform=i)})),s=e.watch(a,(t=>{r.value&&r.value.style?r.value.style.transform=t:i=t}),{immediate:!0});return{transform:n,stop:()=>{o(),s()}}}const Et=["","X","Y","Z"],jt=["transformPerspective","x","y","z"];["perspective","translate","scale","rotate","skew"].forEach((t=>{Et.forEach((e=>{jt.push(t+e)}))}));const Ct=new Set(jt);function It(t){return Ct.has(t)}function St(t){const r=e.ref(t),{style:i}=At(r),{transform:n}=Rt(r),a=e.reactive({});return e.watch(a,(t=>{for(const r in t){const a=It(r)?n:i;a[r]&&a[r]===t[r]||e.set(a,r,t[r])}}),{immediate:!0,deep:!0}),{motionProperties:a,style:i,transform:n}}function Mt(t={}){const r=e.ref(t),i=e.ref();return{state:e.computed((()=>{if(i.value)return r.value[i.value]})),variant:i}}function Pt(t,r={},i){const n=e.ref(r),a=e.ref(t),{motionProperties:o}=St(a),{variant:s,state:u}=Mt(n),l={target:a,variant:s,variants:n,state:u,motionProperties:o,...wt(o,n)};return xt(l,i),l}const zt=["initial","enter","leave","visible","hovered","tapped","focused","delay"],Bt=t=>{const i=(i,n,o)=>{const s=e.ref(t||{});((t,e)=>{const i=t.props?t.props:t.data&&t.data.attrs?t.data.attrs:{};i&&(i.variants&&r.isObject(i.variants)&&(e.value={...e.value,...i.variants}),zt.forEach((t=>{if("delay"!==t)i&&i[t]&&r.isObject(i[t])&&(e.value[t]=i[t]);else if(i&&i[t]&&r.isNumber(i[t])){const r=i[t];e&&e.value&&(e.value.enter&&(e.value.enter.transition||(e.value.enter.transition={}),e.value.enter.transition={...e.value.enter.transition,delay:r}),e.value.visible&&(e.value.visible.transition||(e.value.visible.transition={}),e.value.visible.transition={...e.value.visible.transition,delay:r}))}})))})(o,s);const u=Pt(i,s);n.value&&e.set(a,n.value,u)},n=(t,r,i)=>{r.value&&a[r.value]&&e.del(a,r.value)};return{created:i,unmounted:n,bind:i,unbind:n}},Ft={initial:{opacity:0},enter:{opacity:1}},Nt={initial:{opacity:0},visible:{opacity:1}},Ut={initial:{scale:0,opacity:0},enter:{scale:1,opacity:1}},Wt={initial:{scale:0,opacity:0},visible:{scale:1,opacity:1}},Zt={initial:{x:-100,rotate:90,opacity:0},enter:{x:0,rotate:0,opacity:1}},Dt={initial:{x:-100,rotate:90,opacity:0},visible:{x:0,rotate:0,opacity:1}},Xt={initial:{x:100,rotate:-90,opacity:0},enter:{x:0,rotate:0,opacity:1}},Yt={initial:{x:100,rotate:-90,opacity:0},visible:{x:0,rotate:0,opacity:1}},$t={initial:{y:-100,rotate:-90,opacity:0},enter:{y:0,rotate:0,opacity:1}},_t={initial:{y:-100,rotate:-90,opacity:0},visible:{y:0,rotate:0,opacity:1}},Ht={initial:{y:100,rotate:90,opacity:0},enter:{y:0,rotate:0,opacity:1}},qt={initial:{y:100,rotate:90,opacity:0},visible:{y:0,rotate:0,opacity:1}},Gt={initial:{x:-100,opacity:0},enter:{x:0,opacity:1}},Jt={initial:{x:-100,opacity:0},visible:{x:0,opacity:1}},Kt={initial:{x:100,opacity:0},enter:{x:0,opacity:1}},Qt={initial:{x:100,opacity:0},visible:{x:0,opacity:1}},te={initial:{y:-100,opacity:0},enter:{y:0,opacity:1}},ee={initial:{y:-100,opacity:0},visible:{y:0,opacity:1}},re={initial:{y:100,opacity:0},enter:{y:0,opacity:1}},ie={initial:{y:100,opacity:0},visible:{y:0,opacity:1}};var ne=Object.freeze({__proto__:null,fade:Ft,fadeVisible:Nt,pop:Ut,popVisible:Wt,rollBottom:Ht,rollLeft:Zt,rollRight:Xt,rollTop:$t,rollVisibleBottom:qt,rollVisibleLeft:Dt,rollVisibleRight:Yt,rollVisibleTop:_t,slideBottom:re,slideLeft:Gt,slideRight:Kt,slideTop:te,slideVisibleBottom:ie,slideVisibleLeft:Jt,slideVisibleRight:Qt,slideVisibleTop:ee});function ae(t){const e="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;",r=new RegExp(e.split("").join("|"),"g");return t.toString().replace(/[A-Z]/g,(t=>"-"+t)).toLowerCase().replace(/\s+/g,"-").replace(r,(t=>"aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------".charAt(e.indexOf(t)))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}const oe={install(t,e){if(t.directive("motion",Bt()),!e||e&&!e.excludePresets)for(const e in ne){const r=ne[e];t.directive(`motion-${ae(e)}`,Bt(r))}if(e&&e.directives)for(const r in e.directives){const i=e.directives[r];0,t.directive(`motion-${r}`,Bt(i))}}};return t.MotionDirective=Bt,t.MotionPlugin=oe,t.fade=Ft,t.fadeVisible=Nt,t.isMotionInstance=function(t){const r=t;return void 0!==r.apply&&i.isFunction(r.apply)&&void 0!==r.set&&i.isFunction(r.set)&&void 0!==r.stopTransitions&&i.isFunction(r.stopTransitions)&&void 0!==r.target&&e.isRef(r.target)},t.pop=Ut,t.popVisible=Wt,t.reactiveStyle=Vt,t.reactiveTransform=Lt,t.rollBottom=Ht,t.rollLeft=Zt,t.rollRight=Xt,t.rollTop=$t,t.rollVisibleBottom=qt,t.rollVisibleLeft=Dt,t.rollVisibleRight=Yt,t.rollVisibleTop=_t,t.slideBottom=re,t.slideLeft=Gt,t.slideRight=Kt,t.slideTop=te,t.slideVisibleBottom=ie,t.slideVisibleLeft=Jt,t.slideVisibleRight=Qt,t.slideVisibleTop=ee,t.slugify=ae,t.useElementStyle=At,t.useElementTransform=Rt,t.useMotion=Pt,t.useMotionControls=wt,t.useMotionProperties=St,t.useMotionTransitions=gt,t.useMotionVariants=Mt,t.useMotions=function(){return a},t.useTrail=function(t,r){const i=e.reactive({}),n=wt(i,{});return e.watch(i,(e=>{t.forEach(((t,i)=>{0!==i?setTimeout((()=>t.apply(e)),i*r):t.apply(e)}))})),{...n}},Object.defineProperty(t,"__esModule",{value:!0}),t}({},VueDemi,VueUse,shared,popmotion);
{
"name": "@vueuse/motion",
"version": "1.2.10",
"version": "1.3.0",
"description": "🤹 Vue Composables putting your components in motion",

@@ -47,5 +47,5 @@ "repository": "https://github.com/vueuse/motion",

"dependencies": {
"@vueuse/core": "^4.3.0",
"popmotion": "^9.2.1",
"vue-demi": "0.7.0"
"@vueuse/core": "^4.3.5",
"popmotion": "^9.3.1",
"vue-demi": "0.7.1"
},

@@ -68,4 +68,4 @@ "peerDependencies": {

"@vitejs/plugin-vue": "^1.1.5",
"@vue/compiler-sfc": "^3.0.6",
"@vue/server-renderer": "^3.0.6",
"@vue/compiler-sfc": "^3.0.7",
"@vue/server-renderer": "^3.0.7",
"@vue/test-utils": "^2.0.0-beta.13",

@@ -78,13 +78,13 @@ "@vuedx/typecheck": "^0.6.3",

"prettier": "^2.2.1",
"prism-theme-vars": "^0.1.4",
"prism-theme-vars": "^0.2.0",
"prismjs": "^1.23.0",
"rollup": "^2.40.0",
"rollup-plugin-dts": "^2.0.1",
"rollup": "^2.41.0",
"rollup-plugin-dts": "^3.0.1",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.30.0",
"style-value-types": "^4.0.3",
"ts-jest": "^26.5.2",
"typescript": "^4.2.2",
"vite": "^2.0.4",
"vite-plugin-windicss": "^0.6.2",
"style-value-types": "^4.1.1",
"ts-jest": "^26.5.3",
"typescript": "^4.2.3",
"vite": "^2.0.5",
"vite-plugin-windicss": "^0.7.2",
"vitepress": "^0.12.2",

@@ -91,0 +91,0 @@ "vue": "^3.0.5",

@@ -17,3 +17,3 @@ # 🤹 @vueuse/motion

[🌍 **Documentation**](https://motion.vueuse.js.org)
[🌍 **Documentation**](https://motion.vueuse.org)

@@ -20,0 +20,0 @@ [👀 **Demos**](https://vueuse-motion-demo.netlify.app)

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc