motion 11.14.4 → 11.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -185,10 +185,11 @@ function createRenderStep(runNextFrame) {
185
185
  }
186
186
  isProcessing = true;
187
187
  [thisFrame, nextFrame] = [nextFrame, thisFrame];
188
- // Clear the next frame queue
189
- nextFrame.clear();
190
188
  // Execute this frame
191
189
  thisFrame.forEach(triggerCallback);
190
+ // Clear the frame so no callbacks remain. This is to avoid
191
+ // memory leaks should this render step not run for a while.
192
+ thisFrame.clear();
192
193
  isProcessing = false;
193
194
  if (flushNextFrame) {
194
195
  flushNextFrame = false;
@@ -323,7 +324,7 @@ class MotionValue {
323
324
  * This will be replaced by the build step with the latest version number.
324
325
  * When MotionValues are provided to motion components, warn if versions are mixed.
325
326
  */
326
- this.version = "11.14.4";
327
+ this.version = "11.15.0";
327
328
  /**
328
329
  * Tracks whether this value can output a velocity. Currently this is only true
329
330
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -1169,7 +1170,24 @@ function compareByTime(a, b) {
1169
1170
  }
1170
1171
  }
1171
1172
 
1173
+ /**
1174
+ * Take an array of times that represent repeated keyframes. For instance
1175
+ * if we have original times of [0, 0.5, 1] then our repeated times will
1176
+ * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back
1177
+ * down to a 0-1 scale.
1178
+ */
1179
+ function normalizeTimes(times, repeat) {
1180
+ for (let i = 0; i < times.length; i++) {
1181
+ times[i] = times[i] / (repeat + 1);
1182
+ }
1183
+ }
1184
+
1185
+ function calculateRepeatDuration(duration, repeat, _repeatDelay) {
1186
+ return duration * (repeat + 1);
1187
+ }
1188
+
1172
1189
  const defaultSegmentEasing = "easeInOut";
1190
+ const MAX_REPEAT = 20;
1173
1191
  function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) {
1174
1192
  const defaultDuration = defaultTransition.duration || 0.3;
1175
1193
  const animationDefinitions = new Map();
@@ -1212,7 +1230,7 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
1212
1230
  let maxDuration = 0;
1213
1231
  const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => {
1214
1232
  const valueKeyframesAsList = keyframesAsList(valueKeyframes);
1215
- const { delay = 0, times = defaultOffset$1(valueKeyframesAsList), type = "keyframes", ...remainingTransition } = valueTransition;
1233
+ const { delay = 0, times = defaultOffset$1(valueKeyframesAsList), type = "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition;
1216
1234
  let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition;
1217
1235
  /**
1218
1236
  * Resolve stagger() if defined.
@@ -1250,7 +1268,6 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
1250
1268
  }
1251
1269
  duration !== null && duration !== void 0 ? duration : (duration = defaultDuration);
1252
1270
  const startTime = currentTime + calculatedDelay;
1253
- const targetTime = startTime + duration;
1254
1271
  /**
1255
1272
  * If there's only one time offset of 0, fill in a second with length 1
1256
1273
  */
@@ -1269,6 +1286,28 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
1269
1286
  */
1270
1287
  valueKeyframesAsList.length === 1 &&
1271
1288
  valueKeyframesAsList.unshift(null);
1289
+ /**
1290
+ * Handle repeat options
1291
+ */
1292
+ if (repeat) {
1293
+ exports.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20");
1294
+ duration = calculateRepeatDuration(duration, repeat);
1295
+ const originalKeyframes = [...valueKeyframesAsList];
1296
+ const originalTimes = [...times];
1297
+ ease = Array.isArray(ease) ? [...ease] : [ease];
1298
+ const originalEase = [...ease];
1299
+ for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {
1300
+ valueKeyframesAsList.push(...originalKeyframes);
1301
+ for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) {
1302
+ times.push(originalTimes[keyframeIndex] + (repeatIndex + 1));
1303
+ ease.push(keyframeIndex === 0
1304
+ ? "linear"
1305
+ : getEasingForSegment(originalEase, keyframeIndex - 1));
1306
+ }
1307
+ }
1308
+ normalizeTimes(times, repeat);
1309
+ }
1310
+ const targetTime = startTime + duration;
1272
1311
  /**
1273
1312
  * Add keyframes, mapping offsets to absolute time.
1274
1313
  */
@@ -4160,7 +4199,7 @@ function updateMotionValuesFromProps(element, next, prev) {
4160
4199
  * and warn against mismatches.
4161
4200
  */
4162
4201
  if (process.env.NODE_ENV === "development") {
4163
- warnOnce(nextValue.version === "11.14.4", `Attempting to mix Motion versions ${nextValue.version} with 11.14.4 may not work as expected.`);
4202
+ warnOnce(nextValue.version === "11.15.0", `Attempting to mix Motion versions ${nextValue.version} with 11.15.0 may not work as expected.`);
4164
4203
  }
4165
4204
  }
4166
4205
  else if (isMotionValue(prevValue)) {
@@ -265,10 +265,11 @@ function createRenderStep(runNextFrame) {
265
265
  }
266
266
  isProcessing = true;
267
267
  [thisFrame, nextFrame] = [nextFrame, thisFrame];
268
- // Clear the next frame queue
269
- nextFrame.clear();
270
268
  // Execute this frame
271
269
  thisFrame.forEach(triggerCallback);
270
+ // Clear the frame so no callbacks remain. This is to avoid
271
+ // memory leaks should this render step not run for a while.
272
+ thisFrame.clear();
272
273
  isProcessing = false;
273
274
  if (flushNextFrame) {
274
275
  flushNextFrame = false;
@@ -3348,7 +3349,7 @@ class MotionValue {
3348
3349
  * This will be replaced by the build step with the latest version number.
3349
3350
  * When MotionValues are provided to motion components, warn if versions are mixed.
3350
3351
  */
3351
- this.version = "11.14.4";
3352
+ this.version = "11.15.0";
3352
3353
  /**
3353
3354
  * Tracks whether this value can output a velocity. Currently this is only true
3354
3355
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -9156,7 +9157,7 @@ function updateMotionValuesFromProps(element, next, prev) {
9156
9157
  * and warn against mismatches.
9157
9158
  */
9158
9159
  if (process.env.NODE_ENV === "development") {
9159
- warnOnce(nextValue.version === "11.14.4", `Attempting to mix Motion versions ${nextValue.version} with 11.14.4 may not work as expected.`);
9160
+ warnOnce(nextValue.version === "11.15.0", `Attempting to mix Motion versions ${nextValue.version} with 11.15.0 may not work as expected.`);
9160
9161
  }
9161
9162
  }
9162
9163
  else if (isMotionValue(prevValue)) {
@@ -100,10 +100,11 @@ function createRenderStep(runNextFrame) {
100
100
  }
101
101
  isProcessing = true;
102
102
  [thisFrame, nextFrame] = [nextFrame, thisFrame];
103
- // Clear the next frame queue
104
- nextFrame.clear();
105
103
  // Execute this frame
106
104
  thisFrame.forEach(triggerCallback);
105
+ // Clear the frame so no callbacks remain. This is to avoid
106
+ // memory leaks should this render step not run for a while.
107
+ thisFrame.clear();
107
108
  isProcessing = false;
108
109
  if (flushNextFrame) {
109
110
  flushNextFrame = false;
@@ -9,8 +9,13 @@ import { isGenerator } from '../generators/utils/is-generator.mjs';
9
9
  import { calcNextTime } from './utils/calc-time.mjs';
10
10
  import { addKeyframes } from './utils/edit.mjs';
11
11
  import { compareByTime } from './utils/sort.mjs';
12
+ import { invariant } from '../../../../../motion-utils/dist/es/errors.mjs';
13
+ import { normalizeTimes } from './utils/normalize-times.mjs';
14
+ import { calculateRepeatDuration } from './utils/calc-repeat-duration.mjs';
15
+ import { getEasingForSegment } from '../../easing/utils/get-easing-for-segment.mjs';
12
16
 
13
17
  const defaultSegmentEasing = "easeInOut";
18
+ const MAX_REPEAT = 20;
14
19
  function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) {
15
20
  const defaultDuration = defaultTransition.duration || 0.3;
16
21
  const animationDefinitions = new Map();
@@ -53,7 +58,7 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
53
58
  let maxDuration = 0;
54
59
  const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => {
55
60
  const valueKeyframesAsList = keyframesAsList(valueKeyframes);
56
- const { delay = 0, times = defaultOffset(valueKeyframesAsList), type = "keyframes", ...remainingTransition } = valueTransition;
61
+ const { delay = 0, times = defaultOffset(valueKeyframesAsList), type = "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition;
57
62
  let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition;
58
63
  /**
59
64
  * Resolve stagger() if defined.
@@ -91,7 +96,6 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
91
96
  }
92
97
  duration !== null && duration !== void 0 ? duration : (duration = defaultDuration);
93
98
  const startTime = currentTime + calculatedDelay;
94
- const targetTime = startTime + duration;
95
99
  /**
96
100
  * If there's only one time offset of 0, fill in a second with length 1
97
101
  */
@@ -110,6 +114,28 @@ function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...seq
110
114
  */
111
115
  valueKeyframesAsList.length === 1 &&
112
116
  valueKeyframesAsList.unshift(null);
117
+ /**
118
+ * Handle repeat options
119
+ */
120
+ if (repeat) {
121
+ invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20");
122
+ duration = calculateRepeatDuration(duration, repeat);
123
+ const originalKeyframes = [...valueKeyframesAsList];
124
+ const originalTimes = [...times];
125
+ ease = Array.isArray(ease) ? [...ease] : [ease];
126
+ const originalEase = [...ease];
127
+ for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {
128
+ valueKeyframesAsList.push(...originalKeyframes);
129
+ for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) {
130
+ times.push(originalTimes[keyframeIndex] + (repeatIndex + 1));
131
+ ease.push(keyframeIndex === 0
132
+ ? "linear"
133
+ : getEasingForSegment(originalEase, keyframeIndex - 1));
134
+ }
135
+ }
136
+ normalizeTimes(times, repeat);
137
+ }
138
+ const targetTime = startTime + duration;
113
139
  /**
114
140
  * Add keyframes, mapping offsets to absolute time.
115
141
  */
@@ -0,0 +1,5 @@
1
+ function calculateRepeatDuration(duration, repeat, _repeatDelay) {
2
+ return duration * (repeat + 1);
3
+ }
4
+
5
+ export { calculateRepeatDuration };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Take an array of times that represent repeated keyframes. For instance
3
+ * if we have original times of [0, 0.5, 1] then our repeated times will
4
+ * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back
5
+ * down to a 0-1 scale.
6
+ */
7
+ function normalizeTimes(times, repeat) {
8
+ for (let i = 0; i < times.length; i++) {
9
+ times[i] = times[i] / (repeat + 1);
10
+ }
11
+ }
12
+
13
+ export { normalizeTimes };
@@ -63,10 +63,11 @@ function createRenderStep(runNextFrame) {
63
63
  }
64
64
  isProcessing = true;
65
65
  [thisFrame, nextFrame] = [nextFrame, thisFrame];
66
- // Clear the next frame queue
67
- nextFrame.clear();
68
66
  // Execute this frame
69
67
  thisFrame.forEach(triggerCallback);
68
+ // Clear the frame so no callbacks remain. This is to avoid
69
+ // memory leaks should this render step not run for a while.
70
+ thisFrame.clear();
70
71
  isProcessing = false;
71
72
  if (flushNextFrame) {
72
73
  flushNextFrame = false;
@@ -17,7 +17,7 @@ function updateMotionValuesFromProps(element, next, prev) {
17
17
  * and warn against mismatches.
18
18
  */
19
19
  if (process.env.NODE_ENV === "development") {
20
- warnOnce(nextValue.version === "11.14.4", `Attempting to mix Motion versions ${nextValue.version} with 11.14.4 may not work as expected.`);
20
+ warnOnce(nextValue.version === "11.15.0", `Attempting to mix Motion versions ${nextValue.version} with 11.15.0 may not work as expected.`);
21
21
  }
22
22
  }
23
23
  else if (isMotionValue(prevValue)) {
@@ -34,7 +34,7 @@ class MotionValue {
34
34
  * This will be replaced by the build step with the latest version number.
35
35
  * When MotionValues are provided to motion components, warn if versions are mixed.
36
36
  */
37
- this.version = "11.14.4";
37
+ this.version = "11.15.0";
38
38
  /**
39
39
  * Tracks whether this value can output a velocity. Currently this is only true
40
40
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -187,10 +187,11 @@
187
187
  }
188
188
  isProcessing = true;
189
189
  [thisFrame, nextFrame] = [nextFrame, thisFrame];
190
- // Clear the next frame queue
191
- nextFrame.clear();
192
190
  // Execute this frame
193
191
  thisFrame.forEach(triggerCallback);
192
+ // Clear the frame so no callbacks remain. This is to avoid
193
+ // memory leaks should this render step not run for a while.
194
+ thisFrame.clear();
194
195
  isProcessing = false;
195
196
  if (flushNextFrame) {
196
197
  flushNextFrame = false;
@@ -325,7 +326,7 @@
325
326
  * This will be replaced by the build step with the latest version number.
326
327
  * When MotionValues are provided to motion components, warn if versions are mixed.
327
328
  */
328
- this.version = "11.14.4";
329
+ this.version = "11.15.0";
329
330
  /**
330
331
  * Tracks whether this value can output a velocity. Currently this is only true
331
332
  * if the value is numerical, but we might be able to widen the scope here and support
@@ -1171,7 +1172,24 @@
1171
1172
  }
1172
1173
  }
1173
1174
 
1175
+ /**
1176
+ * Take an array of times that represent repeated keyframes. For instance
1177
+ * if we have original times of [0, 0.5, 1] then our repeated times will
1178
+ * be [0, 0.5, 1, 1, 1.5, 2]. Loop over the times and scale them back
1179
+ * down to a 0-1 scale.
1180
+ */
1181
+ function normalizeTimes(times, repeat) {
1182
+ for (let i = 0; i < times.length; i++) {
1183
+ times[i] = times[i] / (repeat + 1);
1184
+ }
1185
+ }
1186
+
1187
+ function calculateRepeatDuration(duration, repeat, _repeatDelay) {
1188
+ return duration * (repeat + 1);
1189
+ }
1190
+
1174
1191
  const defaultSegmentEasing = "easeInOut";
1192
+ const MAX_REPEAT = 20;
1175
1193
  function createAnimationsFromSequence(sequence, { defaultTransition = {}, ...sequenceTransition } = {}, scope, generators) {
1176
1194
  const defaultDuration = defaultTransition.duration || 0.3;
1177
1195
  const animationDefinitions = new Map();
@@ -1214,7 +1232,7 @@
1214
1232
  let maxDuration = 0;
1215
1233
  const resolveValueSequence = (valueKeyframes, valueTransition, valueSequence, elementIndex = 0, numSubjects = 0) => {
1216
1234
  const valueKeyframesAsList = keyframesAsList(valueKeyframes);
1217
- const { delay = 0, times = defaultOffset$1(valueKeyframesAsList), type = "keyframes", ...remainingTransition } = valueTransition;
1235
+ const { delay = 0, times = defaultOffset$1(valueKeyframesAsList), type = "keyframes", repeat, repeatType, repeatDelay = 0, ...remainingTransition } = valueTransition;
1218
1236
  let { ease = defaultTransition.ease || "easeOut", duration } = valueTransition;
1219
1237
  /**
1220
1238
  * Resolve stagger() if defined.
@@ -1252,7 +1270,6 @@
1252
1270
  }
1253
1271
  duration !== null && duration !== void 0 ? duration : (duration = defaultDuration);
1254
1272
  const startTime = currentTime + calculatedDelay;
1255
- const targetTime = startTime + duration;
1256
1273
  /**
1257
1274
  * If there's only one time offset of 0, fill in a second with length 1
1258
1275
  */
@@ -1271,6 +1288,28 @@
1271
1288
  */
1272
1289
  valueKeyframesAsList.length === 1 &&
1273
1290
  valueKeyframesAsList.unshift(null);
1291
+ /**
1292
+ * Handle repeat options
1293
+ */
1294
+ if (repeat) {
1295
+ exports.invariant(repeat < MAX_REPEAT, "Repeat count too high, must be less than 20");
1296
+ duration = calculateRepeatDuration(duration, repeat);
1297
+ const originalKeyframes = [...valueKeyframesAsList];
1298
+ const originalTimes = [...times];
1299
+ ease = Array.isArray(ease) ? [...ease] : [ease];
1300
+ const originalEase = [...ease];
1301
+ for (let repeatIndex = 0; repeatIndex < repeat; repeatIndex++) {
1302
+ valueKeyframesAsList.push(...originalKeyframes);
1303
+ for (let keyframeIndex = 0; keyframeIndex < originalKeyframes.length; keyframeIndex++) {
1304
+ times.push(originalTimes[keyframeIndex] + (repeatIndex + 1));
1305
+ ease.push(keyframeIndex === 0
1306
+ ? "linear"
1307
+ : getEasingForSegment(originalEase, keyframeIndex - 1));
1308
+ }
1309
+ }
1310
+ normalizeTimes(times, repeat);
1311
+ }
1312
+ const targetTime = startTime + duration;
1274
1313
  /**
1275
1314
  * Add keyframes, mapping offsets to absolute time.
1276
1315
  */
@@ -4162,7 +4201,7 @@
4162
4201
  * and warn against mismatches.
4163
4202
  */
4164
4203
  {
4165
- warnOnce(nextValue.version === "11.14.4", `Attempting to mix Motion versions ${nextValue.version} with 11.14.4 may not work as expected.`);
4204
+ warnOnce(nextValue.version === "11.15.0", `Attempting to mix Motion versions ${nextValue.version} with 11.15.0 may not work as expected.`);
4166
4205
  }
4167
4206
  }
4168
4207
  else if (isMotionValue(prevValue)) {
package/dist/motion.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";const e=t=>t;let n=e;const s=!1;function i(t,e,n){var s;if(t instanceof Element)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const r=null!==(s=null==n?void 0:n[t])&&void 0!==s?s:i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function r(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class o{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>r(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function a(t,e){return e?t*(1e3/e):0}const l=!1;const u=["read","resolveKeyframes","update","preRender","render","postRender"];const{schedule:c,cancel:h,state:d,steps:p}=function(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=u.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(e){r.has(e)&&(l.schedule(e),t()),e(o)}const l={schedule:(t,i=!1,o=!1)=>{const a=o&&s?e:n;return i&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{o=t,s?i=!0:(s=!0,[e,n]=[n,e],n.clear(),e.forEach(a),s=!1,i&&(i=!1,l.process(t)))}};return l}(r),t),{}),{read:a,resolveKeyframes:l,update:c,preRender:h,render:d,postRender:p}=o,f=()=>{const r=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(r-i.timestamp,40),1),i.timestamp=r,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),h.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(f))};return{schedule:u.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(f)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<u.length;e++)o[u[e]].cancel(t)},state:i,steps:o}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e,!0);let f;function m(){f=void 0}const g={now:()=>(void 0===f&&g.set(d.isProcessing||l?d.timestamp:performance.now()),f),set:t=>{f=t,queueMicrotask(m)}};class y{constructor(t,e={}){this.version="11.14.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=g.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=g.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new o);const n=this.events[t].add(e);return"change"===t?()=>{n(),c.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=g.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return a(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function v(t,e){return new y(t,e)}function w(t){let e;return()=>(void 0===e&&(e=t()),e)}const b=w(()=>void 0!==window.ScrollTimeline);class x{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,e){return Promise.all(this.animations).then(t).catch(e)}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map(n=>b()&&n.attachTimeline?n.attachTimeline(t):e(n));return()=>{n.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const T=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},S=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=t(T(0,i-1,e))+", ";return`linear(${s.substring(0,s.length-2)})`},V=t=>1e3*t,A=t=>t/1e3;function M(t,e,n){const s=Math.max(e-5,0);return a(n-t(s),e-s)}const P=(t,e,n)=>n>e?e:n<t?t:n,k=100,F=10,C=1,E=0,O=800,I=.3,R=.3,B={granular:.01,default:2},D={granular:.005,default:.5},L=.01,W=10,N=.05,K=1;function j({duration:t=O,bounce:e=I,velocity:n=E,mass:s=C}){let i,r,o=1-e;o=P(N,K,o),t=P(L,W,A(t)),o<1?(i=e=>{const s=e*o,i=s*t;return.001-(s-n)/z(e,o)*Math.exp(-i)},r=e=>{const s=e*o*t,r=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=z(Math.pow(e,2),o);return(.001-i(e)>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(i,r,5/t);if(t=V(t),isNaN(a))return{stiffness:k,damping:F,duration:t};{const e=Math.pow(a,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:t}}}function z(t,e){return t*Math.sqrt(1-e*e)}function $(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}const H=["duration","bounce"],U=["stiffness","damping","mass"];function Y(t,e){return e.some(e=>void 0!==t[e])}function q(t=R,e=I){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:u,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:E,stiffness:k,damping:F,mass:C,isResolvedFromDuration:!1,...t};if(!Y(t,U)&&Y(t,H))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),i=s*s,r=2*P(.05,1,1-t.bounce)*Math.sqrt(i);e={...e,mass:C,stiffness:i,damping:r}}else{const n=j(t);e={...e,...n,mass:C},e.isResolvedFromDuration=!0}return e}({...n,velocity:-A(n.velocity||0)}),f=d||0,m=u/(2*Math.sqrt(l*c)),g=o-r,y=A(Math.sqrt(l/c)),v=Math.abs(g)<5;let w;if(s||(s=v?B.granular:B.default),i||(i=v?D.granular:D.default),m<1){const t=z(y,m);w=e=>{const n=Math.exp(-m*y*e);return o-n*((f+m*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===m)w=t=>o-Math.exp(-y*t)*(g+(f+y*g)*t);else{const t=y*Math.sqrt(m*m-1);w=e=>{const n=Math.exp(-m*y*e),s=Math.min(t*e,300);return o-n*((f+m*y*g)*Math.sinh(s)+t*g*Math.cosh(s))/t}}const b={calculatedDuration:p&&h||null,next:t=>{const e=w(t);if(p)a.done=t>=h;else{let n=0;m<1&&(n=0===t?V(f):M(w,t,e));const r=Math.abs(n)<=s,l=Math.abs(o-e)<=i;a.done=r&&l}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min($(b),2e4),e=S(e=>b.next(t*e).value,t,30);return t+"ms "+e}};return b}function X(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min($(s),2e4);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:A(i)}}const G=(t,e,n)=>t+(e-t)*n;function Z(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=T(0,e,s);t.push(G(n,1,i))}}function _(t){const e=[0];return Z(e,t.length-1),e}const J=t=>Boolean(t&&t.getVelocity);function Q(t){return"object"==typeof t&&!Array.isArray(t)}function tt(t,e,n,s){return"string"==typeof t&&Q(e)?i(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function et(t){return"function"==typeof t}function nt(t,e,n,s){var i;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(i=s.get(e))&&void 0!==i?i:t}const st=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},it=t=>Array.isArray(t)&&"number"!=typeof t[0];function rt(t,e){return it(t)?t[st(0,t.length,e)]:t}function ot(t,e,n,s,i,o){!function(t,e,n){for(let s=0;s<t.length;s++){const i=t[s];i.at>e&&i.at<n&&(r(t,i),s--)}}(t,i,o);for(let r=0;r<e.length;r++)t.push({value:e[r],at:G(i,o,s[r]),easing:rt(n,r)})}function at(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function lt(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function ut(t,e){return e[t]||(e[t]=[]),e[t]}function ct(t){return Array.isArray(t)?t:[t]}function ht(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const dt=t=>"number"==typeof t,pt=t=>t.every(dt),ft=new WeakMap,mt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],gt=new Set(mt),yt={type:"spring",stiffness:500,damping:25,restSpeed:10},vt={type:"keyframes",duration:.8},wt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},bt=(t,{keyframes:e})=>e.length>2?vt:gt.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:yt:wt;function xt(t,e){return t?t[e]||t.default||t:void 0}const Tt=t=>null!==t;function St(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Tt),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}const Vt=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function At(t,n,s,i){if(t===n&&s===i)return e;const r=e=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=Vt(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,s);return t=>0===t||1===t?t:Vt(r(t),n,i)}const Mt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Pt=t=>e=>1-t(1-e),kt=At(.33,1.53,.69,.99),Ft=Pt(kt),Ct=Mt(Ft),Et=t=>(t*=2)<1?.5*Ft(t):.5*(2-Math.pow(2,-10*(t-1))),Ot=t=>1-Math.sin(Math.acos(t)),It=Pt(Ot),Rt=Mt(Ot),Bt=t=>/^0[^.\s]+$/u.test(t);const Dt=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Lt=t=>e=>"string"==typeof e&&e.startsWith(t),Wt=Lt("--"),Nt=Lt("var(--"),Kt=t=>!!Nt(t)&&jt.test(t.split("/*")[0].trim()),jt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,zt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $t(t,e,n=1){const[s,i]=function(t){const e=zt.exec(t);if(!e)return[,];const[,n,s,i]=e;return["--"+(null!=n?n:s),i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return Dt(t)?parseFloat(t):t}return Kt(i)?$t(i,e,n+1):i}const Ht={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Ut={...Ht,transform:t=>P(0,1,t)},Yt={...Ht,default:1},qt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Xt=qt("deg"),Gt=qt("%"),Zt=qt("px"),_t=qt("vh"),Jt=qt("vw"),Qt={...Gt,parse:t=>Gt.parse(t)/100,transform:t=>Gt.transform(100*t)},te=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),ee=t=>t===Ht||t===Zt,ne=(t,e)=>parseFloat(t.split(", ")[e]),se=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return ne(i[1],e);{const e=s.match(/^matrix\((.+)\)$/u);return e?ne(e[1],t):0}},ie=new Set(["x","y","z"]),re=mt.filter(t=>!ie.has(t));const oe={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:se(4,13),y:se(5,14)};oe.translateX=oe.x,oe.translateY=oe.y;const ae=t=>e=>e.test(t),le=[Ht,Zt,Gt,Xt,Jt,_t,{test:t=>"auto"===t,parse:t=>t}],ue=t=>le.find(ae(t)),ce=new Set;let he=!1,de=!1;function pe(){if(de){const t=Array.from(ce).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return re.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{var s;null===(s=t.getValue(e))||void 0===s||s.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}de=!1,he=!1,ce.forEach(t=>t.complete()),ce.clear()}function fe(){ce.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(de=!0)})}class me{constructor(t,e,n,s,i,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ce.add(this),he||(he=!0,c.read(fe),c.resolveKeyframes(pe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let i=0;i<t.length;i++)if(null===t[i])if(0===i){const i=null==s?void 0:s.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ce.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ce.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ge=t=>Math.round(1e5*t)/1e5,ye=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ve=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,we=(t,e)=>n=>Boolean("string"==typeof n&&ve.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),be=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(ye);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},xe={...Ht,transform:t=>Math.round((t=>P(0,255,t))(t))},Te={test:we("rgb","red"),parse:be("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+xe.transform(t)+", "+xe.transform(e)+", "+xe.transform(n)+", "+ge(Ut.transform(s))+")"};const Se={test:we("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:Te.transform},Ve={test:we("hsl","hue"),parse:be("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Gt.transform(ge(e))+", "+Gt.transform(ge(n))+", "+ge(Ut.transform(s))+")"},Ae={test:t=>Te.test(t)||Se.test(t)||Ve.test(t),parse:t=>Te.test(t)?Te.parse(t):Ve.test(t)?Ve.parse(t):Se.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Te.transform(t):Ve.transform(t)},Me=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Pe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ke(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(Pe,t=>(Ae.test(t)?(s.color.push(r),i.push("color"),n.push(Ae.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push("number"),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:s,types:i}}function Fe(t){return ke(t).values}function Ce(t){const{split:e,types:n}=ke(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+="number"===e?ge(t[r]):"color"===e?Ae.transform(t[r]):t[r]}return i}}const Ee=t=>"number"==typeof t?0:t;const Oe={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(ye))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(Me))||void 0===n?void 0:n.length)||0)>0},parse:Fe,createTransformer:Ce,getAnimatableNone:function(t){const e=Fe(t);return Ce(t)(e.map(Ee))}},Ie=new Set(["brightness","contrast","saturate","opacity"]);function Re(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(ye)||[];if(!s)return t;const i=n.replace(s,"");let r=Ie.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Be=/\b([a-z-]*)\(.*?\)/gu,De={...Oe,getAnimatableNone:t=>{const e=t.match(Be);return e?e.map(Re).join(" "):t}},Le={borderWidth:Zt,borderTopWidth:Zt,borderRightWidth:Zt,borderBottomWidth:Zt,borderLeftWidth:Zt,borderRadius:Zt,radius:Zt,borderTopLeftRadius:Zt,borderTopRightRadius:Zt,borderBottomRightRadius:Zt,borderBottomLeftRadius:Zt,width:Zt,maxWidth:Zt,height:Zt,maxHeight:Zt,top:Zt,right:Zt,bottom:Zt,left:Zt,padding:Zt,paddingTop:Zt,paddingRight:Zt,paddingBottom:Zt,paddingLeft:Zt,margin:Zt,marginTop:Zt,marginRight:Zt,marginBottom:Zt,marginLeft:Zt,backgroundPositionX:Zt,backgroundPositionY:Zt},We={rotate:Xt,rotateX:Xt,rotateY:Xt,rotateZ:Xt,scale:Yt,scaleX:Yt,scaleY:Yt,scaleZ:Yt,skew:Xt,skewX:Xt,skewY:Xt,distance:Zt,translateX:Zt,translateY:Zt,translateZ:Zt,x:Zt,y:Zt,z:Zt,perspective:Zt,transformPerspective:Zt,opacity:Ut,originX:Qt,originY:Qt,originZ:Zt},Ne={...Ht,transform:Math.round},Ke={...Le,...We,zIndex:Ne,size:Zt,fillOpacity:Ut,strokeOpacity:Ut,numOctaves:Ne},je={...Ke,color:Ae,backgroundColor:Ae,outlineColor:Ae,fill:Ae,stroke:Ae,borderColor:Ae,borderTopColor:Ae,borderRightColor:Ae,borderBottomColor:Ae,borderLeftColor:Ae,filter:De,WebkitFilter:De},ze=t=>je[t];function $e(t,e){let n=ze(t);return n!==De&&(n=Oe),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const He=new Set(["auto","none","0"]);class Ue extends me{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),Kt(s))){const i=$t(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!te.has(n)||2!==t.length)return;const[s,i]=t,r=ue(s),o=ue(i);if(r!==o)if(ee(r)&&ee(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||Bt(s))&&n.push(e);var s;n.length&&function(t,e,n){let s=0,i=void 0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!He.has(e)&&ke(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=$e(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=oe[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=oe[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const Ye=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Oe.test(t)&&"0"!==t||t.startsWith("url(")));function qe(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=Ye(i,e),a=Ye(r,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||et(n))&&s)}class Xe{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=g.now(),this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(fe(),pe()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=g.now(),this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:i,delay:r,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!qe(t,n,s,i)){if(!r)return null==a||a(St(t,this.options,e)),null==o||o(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function Ge({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=h+f,g=void 0===o?m:o(m);g!==m&&(f=g-h);const y=t=>-f*Math.exp(-t/s),v=t=>g+y(t),w=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,x;const T=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,x=q({keyframes:[d.value,p(d.value)],velocity:M(v,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return x||void 0!==b||(e=!0,w(t),T(t)),void 0!==b&&t>=b?x.next(t-b):(!e&&w(t),d)}}}const Ze=At(.42,0,1,1),_e=At(0,0,.58,1),Je=At(.42,0,.58,1),Qe=t=>Array.isArray(t)&&"number"==typeof t[0],tn={linear:e,easeIn:Ze,easeInOut:Je,easeOut:_e,circIn:Ot,circInOut:Rt,circOut:It,backIn:Ft,backInOut:Ct,backOut:kt,anticipate:Et},en=t=>{if(Qe(t)){n(4===t.length);const[e,s,i,r]=t;return At(e,s,i,r)}return"string"==typeof t?tn[t]:t},nn=(t,e)=>n=>e(t(n)),sn=(...t)=>t.reduce(nn);function rn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function on(t,e){return n=>n>0?e:t}const an=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},ln=[Se,Te,Ve];function un(t){const e=(n=t,ln.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Ve&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=rn(a,s,t+1/3),r=rn(a,s,t),o=rn(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const cn=(t,e)=>{const n=un(t),s=un(e);if(!n||!s)return on(t,e);const i={...n};return t=>(i.red=an(n.red,s.red,t),i.green=an(n.green,s.green,t),i.blue=an(n.blue,s.blue,t),i.alpha=G(n.alpha,s.alpha,t),Te.transform(i))},hn=new Set(["none","hidden"]);function dn(t,e){return n=>G(t,e,n)}function pn(t){return"number"==typeof t?dn:"string"==typeof t?Kt(t)?on:Ae.test(t)?cn:gn:Array.isArray(t)?fn:"object"==typeof t?Ae.test(t)?cn:mn:on}function fn(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>pn(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function mn(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=pn(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const gn=(t,e)=>{const n=Oe.createTransformer(e),s=ke(t),i=ke(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?hn.has(t)&&!i.values.length||hn.has(e)&&!s.values.length?function(t,e){return hn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):sn(fn(function(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],l=null!==(n=t.values[a])&&void 0!==n?n:0;s[r]=l,i[o]++}return s}(s,i),i.values),n):on(t,e)};function yn(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return G(t,e,n);return pn(t)(t,e)}function vn(t,s,{clamp:i=!0,ease:r,mixer:o}={}){const a=t.length;if(n(a===s.length),1===a)return()=>s[0];if(2===a&&t[0]===t[1])return()=>s[1];t[0]>t[a-1]&&(t=[...t].reverse(),s=[...s].reverse());const l=function(t,n,s){const i=[],r=s||yn,o=t.length-1;for(let s=0;s<o;s++){let o=r(t[s],t[s+1]);if(n){const t=Array.isArray(n)?n[s]||e:n;o=sn(t,o)}i.push(o)}return i}(s,r,o),u=l.length,c=e=>{let n=0;if(u>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const s=T(t[n],t[n+1],e);return l[n](s)};return i?e=>c(P(t[0],t[a-1],e)):c}function wn({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=it(s)?s.map(en):en(s),r={done:!1,value:e[0]},o=vn(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:_(e),t),e,{ease:Array.isArray(i)?i:(a=e,l=i,a.map(()=>l||Je).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const bn=t=>{const e=({timestamp:e})=>t(e);return{start:()=>c.update(e,!0),stop:()=>h(e),now:()=>d.isProcessing?d.timestamp:g.now()}},xn={decay:Ge,inertia:Ge,tween:wn,keyframes:wn,spring:q},Tn=t=>t/100;class Sn extends Xe{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:s,keyframes:i}=this.options,r=(null==s?void 0:s.KeyframeResolver)||me;this.resolver=new r(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=this.options,o=et(e)?e:xn[e]||wn;let a,l;o!==wn&&"number"!=typeof t[0]&&(a=sn(Tn,yn(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===i&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=$(u));const{calculatedDuration:c}=u,h=c+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(n+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:r,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return i.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),y=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let v=this.currentTime,w=i;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,f&&(n-=f/c)):"mirror"===p&&(w=r)),v=P(0,1,n)*c}const b=y?{done:!1,value:a[0]}:w.next(v);o&&(b.value=o(b.value));let{done:x}=b;y||null===l||(x=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return T&&void 0!==s&&(b.value=St(a,this.options,s)),m&&m(b.value),T&&this.finish(),b}get duration(){const{resolved:t}=this;return t?A(t.calculatedDuration):0}get time(){return A(this.currentTime)}set time(t){t=V(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=A(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=bn,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=s):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Vn=new Set(["opacity","clipPath","filter","transform"]),An={linearEasing:void 0};function Mn(t,e){const n=w(t);return()=>{var t;return null!==(t=An[e])&&void 0!==t?t:n()}}const Pn=Mn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing");function kn(t){return Boolean("function"==typeof t&&Pn()||!t||"string"==typeof t&&(t in Cn||Pn())||Qe(t)||Array.isArray(t)&&t.every(kn))}const Fn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Cn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Fn([0,.65,.55,1]),circOut:Fn([.55,0,1,.45]),backIn:Fn([.31,.01,.66,-.59]),backOut:Fn([.33,1.53,.69,.99])};function En(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=function t(e,n){return e?"function"==typeof e&&Pn()?S(e,n):Qe(e)?Fn(e):Array.isArray(e)?e.map(e=>t(e,n)||Cn.easeOut):Cn[e]:void 0}(a,i);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"})}function On(t,e){t.timeline=e,t.onfinish=null}const In=w(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const Rn={anticipate:Et,backInOut:Ct,circInOut:Rt};class Bn extends Xe{constructor(t){super(t);const{name:e,motionValue:n,element:s,keyframes:i}=this.options;this.resolver=new Ue(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}initPlayback(t,e){var n;let{duration:s=300,times:i,ease:r,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;var c;if("string"==typeof r&&Pn()&&r in Rn&&(r=Rn[r]),et((c=this.options).type)||"spring"===c.type||!kn(c.ease)){const{onComplete:e,onUpdate:n,motionValue:a,element:l,...u}=this.options,c=function(t,e){const n=new Sn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let r=0;for(;!s.done&&r<2e4;)s=n.sample(r),i.push(s.value),r+=10;return{times:void 0,keyframes:i,duration:r-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),s=c.duration,i=c.times,r=c.ease,o="keyframes"}const h=En(a.owner.current,l,t,{...this.options,duration:s,times:i,ease:r});return h.startTime=null!=u?u:this.calcStartTime(),this.pendingTimeline?(On(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:n}=this.options;a.set(St(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:s,times:i,type:o,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return A(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return A(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=V(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:n}=this;if(!n)return e;const{animation:s}=n;On(s,t)}else this.pendingTimeline=t;return e}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:s,type:i,ease:r,times:o}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...u}=this.options,c=new Sn({...u,keyframes:n,duration:s,type:i,ease:r,times:o,isGenerator:!0}),h=V(this.time);t.setWithVelocity(c.sample(h-10).value,c.sample(h).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;return In()&&n&&Vn.has(n)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}}const Dn=(t,e,n,s={},i,r)=>o=>{const a=xt(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u-=V(l);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(a)||(h={...h,...bt(t,h)}),h.duration&&(h.duration=V(h.duration)),h.repeatDelay&&(h.repeatDelay=V(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(d=!0)),d&&!r&&void 0!==e.get()){const t=St(h.keyframes,a);if(void 0!==t)return c.update(()=>{h.onUpdate(t),h.onComplete()}),new x([])}return!r&&Bn.supports(h)?new Bn(h):new Sn(h)},Ln=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t;function Wn(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Nn(t,e,n,s){if("function"==typeof e){const[i,r]=Wn(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=Wn(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function Kn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,v(n))}function jn(t,e){const n=function(t,e,n){const s=t.getProps();return Nn(s,e,void 0!==n?n:s.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){Kn(t,e,Ln(r[e]))}}const zn=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),$n="data-"+zn("framerAppearId");function Hn(t){return t.props[$n]}function Un(t,e){const n=t.getValue("willChange");if(s=n,Boolean(J(s)&&s.add))return n.add(e);var s}function Yn({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function qn(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var r;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);const u=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const e in l){const s=t.getValue(e,null!==(r=t.latestValues[e])&&void 0!==r?r:null),i=l[e];if(void 0===i||h&&Yn(h,e))continue;const a={delay:n,...xt(o||{},e)};let d=!1;if(window.MotionHandoffAnimation){const n=Hn(t);if(n){const t=window.MotionHandoffAnimation(n,e,c);null!==t&&(a.startTime=t,d=!0)}}Un(t,e),s.start(Dn(e,s,i,t.shouldReduceMotion&&gt.has(e)?{type:!1}:a,t,d));const p=s.animation;p&&u.push(p)}return a&&Promise.all(u).then(()=>{c.update(()=>{a&&jn(t,a)})}),u}const Xn={};function Gn(t,{layout:e,layoutId:n}){return gt.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Xn[t]||"opacity"===t)}function Zn(t,e,n){var s;const{style:i}=t,r={};for(const o in i)(J(i[o])||e.style&&J(e.style[o])||Gn(o,t)||void 0!==(null===(s=null==n?void 0:n.getValue(o))||void 0===s?void 0:s.liveStyle))&&(r[o]=i[o]);return r}const _n="undefined"!=typeof window,Jn={current:null},Qn={current:!1};const ts=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function es(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||ts.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const ns={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},ss={};for(const t in ns)ss[t]={isEnabled:e=>ns[t].some(t=>!!e[t])};const is=[...le,Ae,Oe],rs=()=>({x:{min:0,max:0},y:{min:0,max:0}}),os=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class as{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=me,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=g.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,c.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=es(e),this.isVariantNode=function(t){return Boolean(es(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==a[t]&&J(e)&&e.set(a[t],!1)}}mount(t){this.current=t,ft.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Qn.current||function(){if(Qn.current=!0,_n)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Jn.current=t.matches;t.addListener(e),e()}else Jn.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Jn.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){ft.delete(this.current),this.projection&&this.projection.unmount(),h(this.notifyUpdate),h(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=gt.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&c.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i(),r&&r(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in ss){const e=ss[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<os.length;e++){const n=os[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(J(i))t.addValue(s,i);else if(J(r))t.addValue(s,v(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,v(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=v(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let s=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=s&&("string"==typeof s&&(Dt(s)||Bt(s))?s=parseFloat(s):(i=s,!is.find(ae(i))&&Oe.test(e)&&(s=$e(t,e))),this.setBaseTarget(t,J(s)?s.get():s)),J(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let s;if("string"==typeof n||"object"==typeof n){const i=Nn(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);i&&(s=i[t])}if(n&&void 0!==s)return s;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||J(i)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new o),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class ls extends as{constructor(){super(...arguments),this.KeyframeResolver=Ue}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;J(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}}const us=(t,e)=>e&&"number"==typeof t?e.transform(t):t,cs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},hs=mt.length;function ds(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(gt.has(t))o=!0;else if(Wt(t))i[t]=n;else{const e=us(n,Ke[t]);t.startsWith("origin")?(a=!0,r[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r<hs;r++){const o=mt[r],a=t[o];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(o.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=us(a,Ke[o]);if(!l){i=!1;s+=`${cs[o]||o}(${t}) `}n&&(e[o]=t)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}function ps(t,e,n){return"string"==typeof t?t:Zt.transform(e+n*t)}const fs={offset:"stroke-dashoffset",array:"stroke-dasharray"},ms={offset:"strokeDashoffset",array:"strokeDasharray"};function gs(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(ds(t,u,h),c)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:f}=t;d.transform&&(f&&(p.transform=d.transform),delete d.transform),f&&(void 0!==i||void 0!==r||p.transform)&&(p.transformOrigin=function(t,e,n){return`${ps(e,t.x,t.width)} ${ps(n,t.y,t.height)}`}(f,void 0!==i?i:.5,void 0!==r?r:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==s&&(d.scale=s),void 0!==o&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?fs:ms;t[r.offset]=Zt.transform(-s);const o=Zt.transform(e),a=Zt.transform(n);t[r.array]=`${o} ${a}`}(d,o,a,l,!1)}const ys=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function vs(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const e in n)t.style.setProperty(e,n[e])}class ws extends ls{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=rs}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(gt.has(e)){const t=ze(e);return t&&t.default||0}return e=ys.has(e)?e:zn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=Zn(t,e,n);for(const n in t)if(J(t[n])||J(e[n])){s[-1!==mt.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return s}(t,e,n)}build(t,e,n){gs(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){vs(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(ys.has(n)?n:zn(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}class bs extends ls{constructor(){super(...arguments),this.type="html",this.renderInstance=vs}readValueFromInstance(t,e){if(gt.has(e)){const t=ze(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),i=(Wt(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){ds(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Zn(t,e,n)}}class xs extends as{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Ts(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=function(t){return t instanceof SVGElement&&"svg"!==t.tagName}(t)?new ws(e):new bs(e);n.mount(t),ft.set(t,n)}function Ss(t){const e=new xs({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),ft.set(t,e)}function Vs(t,e,n,s){const i=[];if(function(t,e){return J(t)||"number"==typeof t||"string"==typeof t&&!Q(e)}(t,e))i.push(function(t,e,n){const s=J(t)?t:v(t);return s.start(Dn("",s,e,n)),s.animation}(t,Q(e)&&e.default||e,n&&n.default||n));else{const r=tt(t,e,s),o=r.length;for(let t=0;t<o;t++){const s=r[t],a=s instanceof Element?Ts:Ss;ft.has(s)||a(s);const l=ft.get(s),u={...n};"delay"in u&&"function"==typeof u.delay&&(u.delay=u.delay(t,o)),i.push(...qn(l,{...e,transition:u},{}))}}return i}function As(t,e,n){const s=[];return function(t,{defaultTransition:e={},...n}={},s,i){const r=e.duration||.3,o=new Map,a=new Map,l={},u=new Map;let c=0,h=0,d=0;for(let n=0;n<t.length;n++){const o=t[n];if("string"==typeof o){u.set(o,h);continue}if(!Array.isArray(o)){u.set(o.name,nt(h,o.at,c,u));continue}let[p,f,m={}]=o;void 0!==m.at&&(h=nt(h,m.at,c,u));let g=0;const y=(t,n,s,o=0,a=0)=>{const l=ct(t),{delay:u=0,times:c=_(l),type:p="keyframes",...f}=n;let{ease:m=e.ease||"easeOut",duration:y}=n;const v="function"==typeof u?u(o,a):u,w=l.length,b=et(p)?p:null==i?void 0:i[p];if(w<=2&&b){let t=100;if(2===w&&pt(l)){const e=l[1]-l[0];t=Math.abs(e)}const e={...f};void 0!==y&&(e.duration=V(y));const n=X(e,t,b);m=n.ease,y=n.duration}null!=y||(y=r);const x=h+v,T=x+y;1===c.length&&0===c[0]&&(c[1]=1);const S=c.length-l.length;S>0&&Z(c,S),1===l.length&&l.unshift(null),ot(s,l,m,c,x,T),g=Math.max(v+y,g),d=Math.max(T,d)};if(J(p)){y(f,m,ut("default",lt(p,a)))}else{const t=tt(p,f,s,l),e=t.length;for(let n=0;n<e;n++){f=f,m=m;const s=lt(t[n],a);for(const t in f)y(f[t],ht(m,t),ut(t,s),n,e)}}c=h,h+=g}return a.forEach((t,s)=>{for(const i in t){const r=t[i];r.sort(at);const a=[],l=[],u=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:s}=r[t];a.push(n),l.push(T(0,d,e)),u.push(s||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),o.has(s)||o.set(s,{keyframes:{},transition:{}});const c=o.get(s);c.keyframes[i]=a,c.transition[i]={...e,duration:d,ease:u,times:l,...n}}}),o}(t,e,n,{spring:q}).forEach(({keyframes:t,transition:e},n)=>{s.push(...Vs(n,t,e))}),s}function Ms(t){return function(e,n,s){let i=[];var r;r=e,i=Array.isArray(r)&&Array.isArray(r[0])?As(e,n,t):Vs(e,n,s,t);const o=new x(i);return t&&t.animations.push(o),o}}const Ps=Ms();function ks(t,e,n){t.style.setProperty("--"+e,n)}function Fs(t,e,n){t.style[e]=n}const Cs=w(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),Es=new WeakMap;function Os(t){const e=Es.get(t)||new Map;return Es.set(t,e),Es.get(t)}class Is{constructor(t,e,s,i){const r=e.startsWith("--");this.setValue=r?ks:Fs,this.options=i,this.updateFinishedPromise(),n("string"!=typeof i.type);const o=Os(t).get(e);o&&o.stop();if(Array.isArray(s)||(s=[s]),function(t,e,n){for(let s=0;s<e.length;s++)null===e[s]&&(e[s]=0===s?n():e[s-1]),"number"==typeof e[s]&&Le[t]&&(e[s]=Le[t].transform(e[s]));!Cs()&&e.length<2&&e.unshift(n())}(e,s,()=>e.startsWith("--")?t.style.getPropertyValue(e):window.getComputedStyle(t)[e]),et(i.type)){const t=X(i,100,i.type);i.ease=Pn()?t.ease:"easeOut",i.duration=V(t.duration),i.type="keyframes"}else i.ease=i.ease||"easeOut";this.removeAnimation=()=>{var n;return null===(n=Es.get(t))||void 0===n?void 0:n.delete(e)};const a=()=>{this.setValue(t,e,St(s,this.options)),this.cancel(),this.resolveFinishedPromise()};In()?(this.animation=En(t,e,s,i),!1===i.autoplay&&this.animation.pause(),this.animation.onfinish=a,this.pendingTimeline&&On(this.animation,this.pendingTimeline),Os(t).set(e,this)):a()}get duration(){return A(this.options.duration||300)}get time(){var t;return this.animation?A((null===(t=this.animation)||void 0===t?void 0:t.currentTime)||0):0}set time(t){this.animation&&(this.animation.currentTime=V(t))}get speed(){return this.animation?this.animation.playbackRate:1}set speed(t){this.animation&&(this.animation.playbackRate=t)}get state(){return this.animation?this.animation.playState:"finished"}get startTime(){return this.animation?this.animation.startTime:null}flatten(){var t;this.animation&&(null===(t=this.animation.effect)||void 0===t||t.updateTiming({easing:"linear"}))}play(){"finished"===this.state&&this.updateFinishedPromise(),this.animation&&this.animation.play()}pause(){this.animation&&this.animation.pause()}stop(){this.animation&&"idle"!==this.state&&"finished"!==this.state&&(this.animation.commitStyles&&this.animation.commitStyles(),this.cancel())}complete(){this.animation&&this.animation.finish()}cancel(){this.removeAnimation();try{this.animation&&this.animation.cancel()}catch(t){}}then(t,e){return this.currentFinishedPromise.then(t,e)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}attachTimeline(t){return this.animation?On(this.animation,t):this.pendingTimeline=t,e}}const Rs=(t=>function(e,n,s){return new x(function(t,e,n,s){const r=i(t,s),o=r.length,a=[];for(let t=0;t<o;t++){const s=r[t],i={...n};"function"==typeof i.delay&&(i.delay=i.delay(t,o));for(const t in e){const n=e[t],r={...xt(i,t)};r.duration=r.duration?V(r.duration):r.duration,r.delay=V(r.delay||0),a.push(new Is(s,t,n,r))}}return a}(e,n,s,t))})(),Bs=new WeakMap;let Ds;function Ls({target:t,contentRect:e,borderBoxSize:n}){var s;null===(s=Bs.get(t))||void 0===s||s.forEach(s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function Ws(t){t.forEach(Ls)}function Ns(t,e){Ds||"undefined"!=typeof ResizeObserver&&(Ds=new ResizeObserver(Ws));const n=i(t);return n.forEach(t=>{let n=Bs.get(t);n||(n=new Set,Bs.set(t,n)),n.add(e),null==Ds||Ds.observe(t)}),()=>{n.forEach(t=>{const n=Bs.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==Ds||Ds.unobserve(t)})}}const Ks=new Set;let js;function zs(t){return Ks.add(t),js||(js=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};Ks.forEach(t=>t(e))},window.addEventListener("resize",js)),()=>{Ks.delete(t),!Ks.size&&js&&(js=void 0)}}const $s={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Hs(t,e,n,s){const i=n[e],{length:r,position:o}=$s[e],l=i.current,u=n.time;i.current=t["scroll"+o],i.scrollLength=t["scroll"+r]-t["client"+r],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=T(0,i.scrollLength,i.current);const c=s-u;i.velocity=c>50?0:a(i.current-l,c)}const Us={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Ys={start:0,center:.5,end:1};function qs(t,e,n=0){let s=0;if(t in Ys&&(t=Ys[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?s=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?s=e/100*document.documentElement.clientWidth:t.endsWith("vh")?s=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(s=e*t),n+s}const Xs=[0,0];function Gs(t,e,n,s){let i=Array.isArray(t)?t:Xs,r=0,o=0;return"number"==typeof t?i=[t,t]:"string"==typeof t&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,Ys[t]?t:"0"]),r=qs(i[0],n,s),o=qs(i[1],e),r-o}const Zs={x:0,y:0};function _s(t,e,n){const{offset:s=Us.All}=n,{target:i=t,axis:r="y"}=n,o="y"===r?"height":"width",a=i!==t?function(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if("svg"===s.tagName){const t=s.getBoundingClientRect();s=s.parentElement;const e=s.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(s instanceof SVGGraphicsElement))break;{const{x:t,y:e}=s.getBBox();n.x+=t,n.y+=e;let i=null,r=s.parentNode;for(;!i;)"svg"===r.tagName&&(i=r),r=s.parentNode;s=i}}return n}(i,t):Zs,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(i),u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const h=s.length;for(let t=0;t<h;t++){const n=Gs(s[t],u[o],l[o],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=vn(e[r].offset,_(s)),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=e[r].interpolate(e[r].current)}function Js(t,e,n,s={}){return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,s.target,n),update:e=>{!function(t,e,n){Hs(t,"x",e,n),Hs(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&_s(t,n,s)},notify:()=>e(n)}}const Qs=new WeakMap,ti=new WeakMap,ei=new WeakMap,ni=t=>t===document.documentElement?window:t;function si(t,{container:e=document.documentElement,...n}={}){let s=ei.get(e);s||(s=new Set,ei.set(e,s));const i=Js(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(s.add(i),!Qs.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(d.timestamp)},i=()=>{for(const t of s)t.notify()},a=()=>{c.read(t,!1,!0),c.read(n,!1,!0),c.update(i,!1,!0)};Qs.set(e,a);const l=ni(e);window.addEventListener("resize",a,{passive:!0}),e!==document.documentElement&&ti.set(e,(o=a,"function"==typeof(r=e)?zs(r):Ns(r,o))),l.addEventListener("scroll",a,{passive:!0})}var r,o;const a=Qs.get(e);return c.read(a,!1,!0),()=>{var t;h(a);const n=ei.get(e);if(!n)return;if(n.delete(i),n.size)return;const s=Qs.get(e);Qs.delete(e),s&&(ni(e).removeEventListener("scroll",s),null===(t=ti.get(e))||void 0===t||t(),window.removeEventListener("resize",s))}}function ii(t,e){let n;const s=()=>{const{currentTime:s}=e,i=(null===s?0:s.value)/100;n!==i&&t(i),n=i};return c.update(s,!0),()=>h(s)}const ri=new Map;function oi({source:t,container:e=document.documentElement,axis:n="y"}={}){t&&(e=t),ri.has(e)||ri.set(e,{});const s=ri.get(e);return s[n]||(s[n]=b()?new ScrollTimeline({source:e,axis:n}):function({source:t,container:e,axis:n="y"}){t&&(e=t);const s={value:0},i=si(t=>{s.value=100*t[n].progress},{container:e,axis:n});return{currentTime:s,cancel:i}}({source:e,axis:n})),s[n]}function ai(t){return t&&(t.target||t.offset)}const li={some:0,all:1};const ui=(t,e)=>Math.abs(t-e);const ci=c,hi=u.reduce((t,e)=>(t[e]=t=>h(t),t),{});t.MotionValue=y,t.animate=Ps,t.animateMini=Rs,t.anticipate=Et,t.backIn=Ft,t.backInOut=Ct,t.backOut=kt,t.cancelFrame=h,t.cancelSync=hi,t.circIn=Ot,t.circInOut=Rt,t.circOut=It,t.clamp=P,t.createScopedAnimate=Ms,t.cubicBezier=At,t.delay=function(t,e){return function(t,e){const n=g.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(h(s),t(r-e))};return c.read(s,!0),()=>h(s)}(t,V(e))},t.distance=ui,t.distance2D=function(t,e){const n=ui(t.x,e.x),s=ui(t.y,e.y);return Math.sqrt(n**2+s**2)},t.easeIn=Ze,t.easeInOut=Je,t.easeOut=_e,t.frame=c,t.frameData=d,t.frameSteps=p,t.inView=function(t,e,{root:n,margin:s,amount:r="some"}={}){const o=i(t),a=new WeakMap,l=new IntersectionObserver(t=>{t.forEach(t=>{const n=a.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);"function"==typeof n?a.set(t.target,n):l.unobserve(t.target)}else n&&(n(t),a.delete(t.target))})},{root:n,rootMargin:s,threshold:"number"==typeof r?r:li[r]});return o.forEach(t=>l.observe(t)),()=>l.disconnect()},t.inertia=Ge,t.interpolate=vn,t.invariant=n,t.isDragActive=function(){return s},t.keyframes=wn,t.mirrorEasing=Mt,t.mix=yn,t.motionValue=v,t.noop=e,t.pipe=sn,t.progress=T,t.reverseEasing=Pt,t.scroll=function(t,{axis:n="y",...s}={}){const i={axis:n,...s};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||ai(e)?si(n=>{t(n[e.axis].progress,n)},e):ii(t,oi(e))}(t,i):function(t,n){if(t.flatten(),ai(n))return t.pause(),si(e=>{t.time=t.duration*e[n.axis].progress},n);{const s=oi(n);return t.attachTimeline?t.attachTimeline(s,t=>(t.pause(),ii(e=>{t.time=t.duration*e},s))):e}}(t,i)},t.scrollInfo=si,t.spring=q,t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(i,r)=>{const o="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,r),a=Math.abs(o-i);let l=t*a;if(s){const e=r*t;l=en(s)(l/e)*e}return e+l}},t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,i="end"===e?Math.floor(s):Math.ceil(s);return P(0,1,i/t)}},t.sync=ci,t.time=g,t.transform=function(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=t[1+n],r=t[2+n],o=t[3+n],a=vn(i,r,{mixer:(l=r[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...o});var l;return e?a(s):a},t.wrap=st}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";const e=t=>t;let n=e;const s=!1;function i(t,e,n){var s;if(t instanceof Element)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const r=null!==(s=null==n?void 0:n[t])&&void 0!==s?s:i.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function r(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class o{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>r(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function a(t,e){return e?t*(1e3/e):0}const l=!1;const u=["read","resolveKeyframes","update","preRender","render","postRender"];const{schedule:c,cancel:h,state:d,steps:p}=function(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=u.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(e){r.has(e)&&(l.schedule(e),t()),e(o)}const l={schedule:(t,i=!1,o=!1)=>{const a=o&&s?e:n;return i&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{o=t,s?i=!0:(s=!0,[e,n]=[n,e],e.forEach(a),e.clear(),s=!1,i&&(i=!1,l.process(t)))}};return l}(r),t),{}),{read:a,resolveKeyframes:l,update:c,preRender:h,render:d,postRender:p}=o,f=()=>{const r=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(r-i.timestamp,40),1),i.timestamp=r,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),h.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(f))};return{schedule:u.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(f)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<u.length;e++)o[u[e]].cancel(t)},state:i,steps:o}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e,!0);let f;function m(){f=void 0}const g={now:()=>(void 0===f&&g.set(d.isProcessing||l?d.timestamp:performance.now()),f),set:t=>{f=t,queueMicrotask(m)}};class y{constructor(t,e={}){this.version="11.15.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=g.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=g.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new o);const n=this.events[t].add(e);return"change"===t?()=>{n(),c.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=g.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return a(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function v(t,e){return new y(t,e)}function w(t){let e;return()=>(void 0===e&&(e=t()),e)}const b=w(()=>void 0!==window.ScrollTimeline);class T{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,e){return Promise.all(this.animations).then(t).catch(e)}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map(n=>b()&&n.attachTimeline?n.attachTimeline(t):e(n));return()=>{n.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const x=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},S=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=t(x(0,i-1,e))+", ";return`linear(${s.substring(0,s.length-2)})`},V=t=>1e3*t,A=t=>t/1e3;function M(t,e,n){const s=Math.max(e-5,0);return a(n-t(s),e-s)}const P=(t,e,n)=>n>e?e:n<t?t:n,k=100,F=10,C=1,E=0,O=800,I=.3,R=.3,B={granular:.01,default:2},D={granular:.005,default:.5},L=.01,W=10,N=.05,K=1;function j({duration:t=O,bounce:e=I,velocity:n=E,mass:s=C}){let i,r,o=1-e;o=P(N,K,o),t=P(L,W,A(t)),o<1?(i=e=>{const s=e*o,i=s*t;return.001-(s-n)/z(e,o)*Math.exp(-i)},r=e=>{const s=e*o*t,r=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=z(Math.pow(e,2),o);return(.001-i(e)>0?-1:1)*((r-a)*l)/u}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(i,r,5/t);if(t=V(t),isNaN(a))return{stiffness:k,damping:F,duration:t};{const e=Math.pow(a,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:t}}}function z(t,e){return t*Math.sqrt(1-e*e)}function $(t){let e=0;let n=t.next(e);for(;!n.done&&e<2e4;)e+=50,n=t.next(e);return e>=2e4?1/0:e}const H=["duration","bounce"],U=["stiffness","damping","mass"];function Y(t,e){return e.some(e=>void 0!==t[e])}function q(t=R,e=I){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:u,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:E,stiffness:k,damping:F,mass:C,isResolvedFromDuration:!1,...t};if(!Y(t,U)&&Y(t,H))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),i=s*s,r=2*P(.05,1,1-t.bounce)*Math.sqrt(i);e={...e,mass:C,stiffness:i,damping:r}}else{const n=j(t);e={...e,...n,mass:C},e.isResolvedFromDuration=!0}return e}({...n,velocity:-A(n.velocity||0)}),f=d||0,m=u/(2*Math.sqrt(l*c)),g=o-r,y=A(Math.sqrt(l/c)),v=Math.abs(g)<5;let w;if(s||(s=v?B.granular:B.default),i||(i=v?D.granular:D.default),m<1){const t=z(y,m);w=e=>{const n=Math.exp(-m*y*e);return o-n*((f+m*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===m)w=t=>o-Math.exp(-y*t)*(g+(f+y*g)*t);else{const t=y*Math.sqrt(m*m-1);w=e=>{const n=Math.exp(-m*y*e),s=Math.min(t*e,300);return o-n*((f+m*y*g)*Math.sinh(s)+t*g*Math.cosh(s))/t}}const b={calculatedDuration:p&&h||null,next:t=>{const e=w(t);if(p)a.done=t>=h;else{let n=0;m<1&&(n=0===t?V(f):M(w,t,e));const r=Math.abs(n)<=s,l=Math.abs(o-e)<=i;a.done=r&&l}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min($(b),2e4),e=S(e=>b.next(t*e).value,t,30);return t+"ms "+e}};return b}function X(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min($(s),2e4);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:A(i)}}const G=(t,e,n)=>t+(e-t)*n;function Z(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=x(0,e,s);t.push(G(n,1,i))}}function _(t){const e=[0];return Z(e,t.length-1),e}const J=t=>Boolean(t&&t.getVelocity);function Q(t){return"object"==typeof t&&!Array.isArray(t)}function tt(t,e,n,s){return"string"==typeof t&&Q(e)?i(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function et(t){return"function"==typeof t}function nt(t,e,n,s){var i;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(i=s.get(e))&&void 0!==i?i:t}const st=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},it=t=>Array.isArray(t)&&"number"!=typeof t[0];function rt(t,e){return it(t)?t[st(0,t.length,e)]:t}function ot(t,e,n,s,i,o){!function(t,e,n){for(let s=0;s<t.length;s++){const i=t[s];i.at>e&&i.at<n&&(r(t,i),s--)}}(t,i,o);for(let r=0;r<e.length;r++)t.push({value:e[r],at:G(i,o,s[r]),easing:rt(n,r)})}function at(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function lt(t,e){for(let n=0;n<t.length;n++)t[n]=t[n]/(e+1)}function ut(t,e,n){return t*(e+1)}function ct(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function ht(t,e){return e[t]||(e[t]=[]),e[t]}function dt(t){return Array.isArray(t)?t:[t]}function pt(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const ft=t=>"number"==typeof t,mt=t=>t.every(ft),gt=new WeakMap,yt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],vt=new Set(yt),wt={type:"spring",stiffness:500,damping:25,restSpeed:10},bt={type:"keyframes",duration:.8},Tt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},xt=(t,{keyframes:e})=>e.length>2?bt:vt.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:wt:Tt;function St(t,e){return t?t[e]||t.default||t:void 0}const Vt=t=>null!==t;function At(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Vt),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}const Mt=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Pt(t,n,s,i){if(t===n&&s===i)return e;const r=e=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=Mt(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,s);return t=>0===t||1===t?t:Mt(r(t),n,i)}const kt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ft=t=>e=>1-t(1-e),Ct=Pt(.33,1.53,.69,.99),Et=Ft(Ct),Ot=kt(Et),It=t=>(t*=2)<1?.5*Et(t):.5*(2-Math.pow(2,-10*(t-1))),Rt=t=>1-Math.sin(Math.acos(t)),Bt=Ft(Rt),Dt=kt(Rt),Lt=t=>/^0[^.\s]+$/u.test(t);const Wt=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Nt=t=>e=>"string"==typeof e&&e.startsWith(t),Kt=Nt("--"),jt=Nt("var(--"),zt=t=>!!jt(t)&&$t.test(t.split("/*")[0].trim()),$t=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ht=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ut(t,e,n=1){const[s,i]=function(t){const e=Ht.exec(t);if(!e)return[,];const[,n,s,i]=e;return["--"+(null!=n?n:s),i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return Wt(t)?parseFloat(t):t}return zt(i)?Ut(i,e,n+1):i}const Yt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},qt={...Yt,transform:t=>P(0,1,t)},Xt={...Yt,default:1},Gt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Zt=Gt("deg"),_t=Gt("%"),Jt=Gt("px"),Qt=Gt("vh"),te=Gt("vw"),ee={..._t,parse:t=>_t.parse(t)/100,transform:t=>_t.transform(100*t)},ne=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),se=t=>t===Yt||t===Jt,ie=(t,e)=>parseFloat(t.split(", ")[e]),re=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return ie(i[1],e);{const e=s.match(/^matrix\((.+)\)$/u);return e?ie(e[1],t):0}},oe=new Set(["x","y","z"]),ae=yt.filter(t=>!oe.has(t));const le={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:re(4,13),y:re(5,14)};le.translateX=le.x,le.translateY=le.y;const ue=t=>e=>e.test(t),ce=[Yt,Jt,_t,Zt,te,Qt,{test:t=>"auto"===t,parse:t=>t}],he=t=>ce.find(ue(t)),de=new Set;let pe=!1,fe=!1;function me(){if(fe){const t=Array.from(de).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return ae.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{var s;null===(s=t.getValue(e))||void 0===s||s.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}fe=!1,pe=!1,de.forEach(t=>t.complete()),de.clear()}function ge(){de.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(fe=!0)})}class ye{constructor(t,e,n,s,i,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(de.add(this),pe||(pe=!0,c.read(ge),c.resolveKeyframes(me))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let i=0;i<t.length;i++)if(null===t[i])if(0===i){const i=null==s?void 0:s.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),de.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,de.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ve=t=>Math.round(1e5*t)/1e5,we=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const be=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Te=(t,e)=>n=>Boolean("string"==typeof n&&be.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),xe=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(we);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},Se={...Yt,transform:t=>Math.round((t=>P(0,255,t))(t))},Ve={test:Te("rgb","red"),parse:xe("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Se.transform(t)+", "+Se.transform(e)+", "+Se.transform(n)+", "+ve(qt.transform(s))+")"};const Ae={test:Te("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:Ve.transform},Me={test:Te("hsl","hue"),parse:xe("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+_t.transform(ve(e))+", "+_t.transform(ve(n))+", "+ve(qt.transform(s))+")"},Pe={test:t=>Ve.test(t)||Ae.test(t)||Me.test(t),parse:t=>Ve.test(t)?Ve.parse(t):Me.test(t)?Me.parse(t):Ae.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Ve.transform(t):Me.transform(t)},ke=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Fe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ce(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(Fe,t=>(Pe.test(t)?(s.color.push(r),i.push("color"),n.push(Pe.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push("number"),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:s,types:i}}function Ee(t){return Ce(t).values}function Oe(t){const{split:e,types:n}=Ce(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+="number"===e?ve(t[r]):"color"===e?Pe.transform(t[r]):t[r]}return i}}const Ie=t=>"number"==typeof t?0:t;const Re={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(we))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(ke))||void 0===n?void 0:n.length)||0)>0},parse:Ee,createTransformer:Oe,getAnimatableNone:function(t){const e=Ee(t);return Oe(t)(e.map(Ie))}},Be=new Set(["brightness","contrast","saturate","opacity"]);function De(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(we)||[];if(!s)return t;const i=n.replace(s,"");let r=Be.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Le=/\b([a-z-]*)\(.*?\)/gu,We={...Re,getAnimatableNone:t=>{const e=t.match(Le);return e?e.map(De).join(" "):t}},Ne={borderWidth:Jt,borderTopWidth:Jt,borderRightWidth:Jt,borderBottomWidth:Jt,borderLeftWidth:Jt,borderRadius:Jt,radius:Jt,borderTopLeftRadius:Jt,borderTopRightRadius:Jt,borderBottomRightRadius:Jt,borderBottomLeftRadius:Jt,width:Jt,maxWidth:Jt,height:Jt,maxHeight:Jt,top:Jt,right:Jt,bottom:Jt,left:Jt,padding:Jt,paddingTop:Jt,paddingRight:Jt,paddingBottom:Jt,paddingLeft:Jt,margin:Jt,marginTop:Jt,marginRight:Jt,marginBottom:Jt,marginLeft:Jt,backgroundPositionX:Jt,backgroundPositionY:Jt},Ke={rotate:Zt,rotateX:Zt,rotateY:Zt,rotateZ:Zt,scale:Xt,scaleX:Xt,scaleY:Xt,scaleZ:Xt,skew:Zt,skewX:Zt,skewY:Zt,distance:Jt,translateX:Jt,translateY:Jt,translateZ:Jt,x:Jt,y:Jt,z:Jt,perspective:Jt,transformPerspective:Jt,opacity:qt,originX:ee,originY:ee,originZ:Jt},je={...Yt,transform:Math.round},ze={...Ne,...Ke,zIndex:je,size:Jt,fillOpacity:qt,strokeOpacity:qt,numOctaves:je},$e={...ze,color:Pe,backgroundColor:Pe,outlineColor:Pe,fill:Pe,stroke:Pe,borderColor:Pe,borderTopColor:Pe,borderRightColor:Pe,borderBottomColor:Pe,borderLeftColor:Pe,filter:We,WebkitFilter:We},He=t=>$e[t];function Ue(t,e){let n=He(t);return n!==We&&(n=Re),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Ye=new Set(["auto","none","0"]);class qe extends ye{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),zt(s))){const i=Ut(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!ne.has(n)||2!==t.length)return;const[s,i]=t,r=he(s),o=he(i);if(r!==o)if(se(r)&&se(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||Lt(s))&&n.push(e);var s;n.length&&function(t,e,n){let s=0,i=void 0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!Ye.has(e)&&Ce(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=Ue(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=le[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=le[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const Xe=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Re.test(t)&&"0"!==t||t.startsWith("url(")));function Ge(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=Xe(i,e),a=Xe(r,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||et(n))&&s)}class Ze{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=g.now(),this.options={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(ge(),me()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=g.now(),this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:i,delay:r,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!Ge(t,n,s,i)){if(!r)return null==a||a(At(t,this.options,e)),null==o||o(),void this.resolveFinishedPromise();this.options.duration=0}const u=this.initPlayback(t,e);!1!==u&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function _e({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=h+f,g=void 0===o?m:o(m);g!==m&&(f=g-h);const y=t=>-f*Math.exp(-t/s),v=t=>g+y(t),w=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,T=q({keyframes:[d.value,p(d.value)],velocity:M(v,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}const Je=Pt(.42,0,1,1),Qe=Pt(0,0,.58,1),tn=Pt(.42,0,.58,1),en=t=>Array.isArray(t)&&"number"==typeof t[0],nn={linear:e,easeIn:Je,easeInOut:tn,easeOut:Qe,circIn:Rt,circInOut:Dt,circOut:Bt,backIn:Et,backInOut:Ot,backOut:Ct,anticipate:It},sn=t=>{if(en(t)){n(4===t.length);const[e,s,i,r]=t;return Pt(e,s,i,r)}return"string"==typeof t?nn[t]:t},rn=(t,e)=>n=>e(t(n)),on=(...t)=>t.reduce(rn);function an(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ln(t,e){return n=>n>0?e:t}const un=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},cn=[Ae,Ve,Me];function hn(t){const e=(n=t,cn.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Me&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=an(a,s,t+1/3),r=an(a,s,t),o=an(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const dn=(t,e)=>{const n=hn(t),s=hn(e);if(!n||!s)return ln(t,e);const i={...n};return t=>(i.red=un(n.red,s.red,t),i.green=un(n.green,s.green,t),i.blue=un(n.blue,s.blue,t),i.alpha=G(n.alpha,s.alpha,t),Ve.transform(i))},pn=new Set(["none","hidden"]);function fn(t,e){return n=>G(t,e,n)}function mn(t){return"number"==typeof t?fn:"string"==typeof t?zt(t)?ln:Pe.test(t)?dn:vn:Array.isArray(t)?gn:"object"==typeof t?Pe.test(t)?dn:yn:ln}function gn(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>mn(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function yn(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=mn(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const vn=(t,e)=>{const n=Re.createTransformer(e),s=Ce(t),i=Ce(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?pn.has(t)&&!i.values.length||pn.has(e)&&!s.values.length?function(t,e){return pn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):on(gn(function(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],l=null!==(n=t.values[a])&&void 0!==n?n:0;s[r]=l,i[o]++}return s}(s,i),i.values),n):ln(t,e)};function wn(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return G(t,e,n);return mn(t)(t,e)}function bn(t,s,{clamp:i=!0,ease:r,mixer:o}={}){const a=t.length;if(n(a===s.length),1===a)return()=>s[0];if(2===a&&t[0]===t[1])return()=>s[1];t[0]>t[a-1]&&(t=[...t].reverse(),s=[...s].reverse());const l=function(t,n,s){const i=[],r=s||wn,o=t.length-1;for(let s=0;s<o;s++){let o=r(t[s],t[s+1]);if(n){const t=Array.isArray(n)?n[s]||e:n;o=on(t,o)}i.push(o)}return i}(s,r,o),u=l.length,c=e=>{let n=0;if(u>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const s=x(t[n],t[n+1],e);return l[n](s)};return i?e=>c(P(t[0],t[a-1],e)):c}function Tn({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=it(s)?s.map(sn):sn(s),r={done:!1,value:e[0]},o=bn(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:_(e),t),e,{ease:Array.isArray(i)?i:(a=e,l=i,a.map(()=>l||tn).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}const xn=t=>{const e=({timestamp:e})=>t(e);return{start:()=>c.update(e,!0),stop:()=>h(e),now:()=>d.isProcessing?d.timestamp:g.now()}},Sn={decay:_e,inertia:_e,tween:Tn,keyframes:Tn,spring:q},Vn=t=>t/100;class An extends Ze{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:n,element:s,keyframes:i}=this.options,r=(null==s?void 0:s.KeyframeResolver)||ye;this.resolver=new r(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=this.options,o=et(e)?e:Sn[e]||Tn;let a,l;o!==Tn&&"number"!=typeof t[0]&&(a=on(Vn,wn(t[0],t[1])),t=[0,100]);const u=o({...this.options,keyframes:t});"mirror"===i&&(l=o({...this.options,keyframes:[...t].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=$(u));const{calculatedDuration:c}=u,h=c+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(n+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:r,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return i.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),y=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let v=this.currentTime,w=i;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,f&&(n-=f/c)):"mirror"===p&&(w=r)),v=P(0,1,n)*c}const b=y?{done:!1,value:a[0]}:w.next(v);o&&(b.value=o(b.value));let{done:T}=b;y||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return x&&void 0!==s&&(b.value=At(a,this.options,s)),m&&m(b.value),x&&this.finish(),b}get duration(){const{resolved:t}=this;return t?A(t.calculatedDuration):0}get time(){return A(this.currentTime)}set time(t){t=V(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=A(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=xn,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=s):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this._resolved?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Mn=new Set(["opacity","clipPath","filter","transform"]),Pn={linearEasing:void 0};function kn(t,e){const n=w(t);return()=>{var t;return null!==(t=Pn[e])&&void 0!==t?t:n()}}const Fn=kn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing");function Cn(t){return Boolean("function"==typeof t&&Fn()||!t||"string"==typeof t&&(t in On||Fn())||en(t)||Array.isArray(t)&&t.every(Cn))}const En=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,On={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:En([0,.65,.55,1]),circOut:En([.55,0,1,.45]),backIn:En([.31,.01,.66,-.59]),backOut:En([.33,1.53,.69,.99])};function In(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=function t(e,n){return e?"function"==typeof e&&Fn()?S(e,n):en(e)?En(e):Array.isArray(e)?e.map(e=>t(e,n)||On.easeOut):On[e]:void 0}(a,i);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"})}function Rn(t,e){t.timeline=e,t.onfinish=null}const Bn=w(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const Dn={anticipate:It,backInOut:Ot,circInOut:Dt};class Ln extends Ze{constructor(t){super(t);const{name:e,motionValue:n,element:s,keyframes:i}=this.options;this.resolver=new qe(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}initPlayback(t,e){var n;let{duration:s=300,times:i,ease:r,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;var c;if("string"==typeof r&&Fn()&&r in Dn&&(r=Dn[r]),et((c=this.options).type)||"spring"===c.type||!Cn(c.ease)){const{onComplete:e,onUpdate:n,motionValue:a,element:l,...u}=this.options,c=function(t,e){const n=new An({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let r=0;for(;!s.done&&r<2e4;)s=n.sample(r),i.push(s.value),r+=10;return{times:void 0,keyframes:i,duration:r-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),s=c.duration,i=c.times,r=c.ease,o="keyframes"}const h=In(a.owner.current,l,t,{...this.options,duration:s,times:i,ease:r});return h.startTime=null!=u?u:this.calcStartTime(),this.pendingTimeline?(Rn(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:n}=this.options;a.set(At(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:s,times:i,type:o,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return A(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return A(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=V(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){const{resolved:n}=this;if(!n)return e;const{animation:s}=n;Rn(s,t)}else this.pendingTimeline=t;return e}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:n,duration:s,type:i,ease:r,times:o}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:l,...u}=this.options,c=new An({...u,keyframes:n,duration:s,type:i,ease:r,times:o,isGenerator:!0}),h=V(this.time);t.setWithVelocity(c.sample(h-10).value,c.sample(h).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;return Bn()&&n&&Mn.has(n)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}}const Wn=(t,e,n,s={},i,r)=>o=>{const a=St(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u-=V(l);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(a)||(h={...h,...xt(t,h)}),h.duration&&(h.duration=V(h.duration)),h.repeatDelay&&(h.repeatDelay=V(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(d=!0)),d&&!r&&void 0!==e.get()){const t=At(h.keyframes,a);if(void 0!==t)return c.update(()=>{h.onUpdate(t),h.onComplete()}),new T([])}return!r&&Ln.supports(h)?new Ln(h):new An(h)},Nn=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t;function Kn(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function jn(t,e,n,s){if("function"==typeof e){const[i,r]=Kn(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=Kn(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function zn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,v(n))}function $n(t,e){const n=function(t,e,n){const s=t.getProps();return jn(s,e,void 0!==n?n:s.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){zn(t,e,Nn(r[e]))}}const Hn=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Un="data-"+Hn("framerAppearId");function Yn(t){return t.props[Un]}function qn(t,e){const n=t.getValue("willChange");if(s=n,Boolean(J(s)&&s.add))return n.add(e);var s}function Xn({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function Gn(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var r;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);const u=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const e in l){const s=t.getValue(e,null!==(r=t.latestValues[e])&&void 0!==r?r:null),i=l[e];if(void 0===i||h&&Xn(h,e))continue;const a={delay:n,...St(o||{},e)};let d=!1;if(window.MotionHandoffAnimation){const n=Yn(t);if(n){const t=window.MotionHandoffAnimation(n,e,c);null!==t&&(a.startTime=t,d=!0)}}qn(t,e),s.start(Wn(e,s,i,t.shouldReduceMotion&&vt.has(e)?{type:!1}:a,t,d));const p=s.animation;p&&u.push(p)}return a&&Promise.all(u).then(()=>{c.update(()=>{a&&$n(t,a)})}),u}const Zn={};function _n(t,{layout:e,layoutId:n}){return vt.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Zn[t]||"opacity"===t)}function Jn(t,e,n){var s;const{style:i}=t,r={};for(const o in i)(J(i[o])||e.style&&J(e.style[o])||_n(o,t)||void 0!==(null===(s=null==n?void 0:n.getValue(o))||void 0===s?void 0:s.liveStyle))&&(r[o]=i[o]);return r}const Qn="undefined"!=typeof window,ts={current:null},es={current:!1};const ns=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function ss(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||ns.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const is={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},rs={};for(const t in is)rs[t]={isEnabled:e=>is[t].some(t=>!!e[t])};const os=[...ce,Pe,Re],as=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ls=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class us{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ye,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=g.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,c.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=ss(e),this.isVariantNode=function(t){return Boolean(ss(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==a[t]&&J(e)&&e.set(a[t],!1)}}mount(t){this.current=t,gt.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),es.current||function(){if(es.current=!0,Qn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ts.current=t.matches;t.addListener(e),e()}else ts.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||ts.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){gt.delete(this.current),this.projection&&this.projection.unmount(),h(this.notifyUpdate),h(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=vt.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&c.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i(),r&&r(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in rs){const e=rs[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<ls.length;e++){const n=ls[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(J(i))t.addValue(s,i);else if(J(r))t.addValue(s,v(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,v(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=v(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){var n;let s=void 0===this.latestValues[t]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,t))&&void 0!==n?n:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=s&&("string"==typeof s&&(Wt(s)||Lt(s))?s=parseFloat(s):(i=s,!os.find(ue(i))&&Re.test(e)&&(s=Ue(t,e))),this.setBaseTarget(t,J(s)?s.get():s)),J(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let s;if("string"==typeof n||"object"==typeof n){const i=jn(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);i&&(s=i[t])}if(n&&void 0!==s)return s;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||J(i)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new o),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class cs extends us{constructor(){super(...arguments),this.KeyframeResolver=qe}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;J(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}}const hs=(t,e)=>e&&"number"==typeof t?e.transform(t):t,ds={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ps=yt.length;function fs(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(vt.has(t))o=!0;else if(Kt(t))i[t]=n;else{const e=hs(n,ze[t]);t.startsWith("origin")?(a=!0,r[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r<ps;r++){const o=yt[r],a=t[o];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(o.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=hs(a,ze[o]);if(!l){i=!1;s+=`${ds[o]||o}(${t}) `}n&&(e[o]=t)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}function ms(t,e,n){return"string"==typeof t?t:Jt.transform(e+n*t)}const gs={offset:"stroke-dashoffset",array:"stroke-dasharray"},ys={offset:"strokeDashoffset",array:"strokeDasharray"};function vs(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(fs(t,u,h),c)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:f}=t;d.transform&&(f&&(p.transform=d.transform),delete d.transform),f&&(void 0!==i||void 0!==r||p.transform)&&(p.transformOrigin=function(t,e,n){return`${ms(e,t.x,t.width)} ${ms(n,t.y,t.height)}`}(f,void 0!==i?i:.5,void 0!==r?r:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==s&&(d.scale=s),void 0!==o&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?gs:ys;t[r.offset]=Jt.transform(-s);const o=Jt.transform(e),a=Jt.transform(n);t[r.array]=`${o} ${a}`}(d,o,a,l,!1)}const ws=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function bs(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const e in n)t.style.setProperty(e,n[e])}class Ts extends cs{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=as}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(vt.has(e)){const t=He(e);return t&&t.default||0}return e=ws.has(e)?e:Hn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=Jn(t,e,n);for(const n in t)if(J(t[n])||J(e[n])){s[-1!==yt.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return s}(t,e,n)}build(t,e,n){vs(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){bs(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(ws.has(n)?n:Hn(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}class xs extends cs{constructor(){super(...arguments),this.type="html",this.renderInstance=bs}readValueFromInstance(t,e){if(vt.has(e)){const t=He(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),i=(Kt(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){fs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Jn(t,e,n)}}class Ss extends us{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Vs(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=function(t){return t instanceof SVGElement&&"svg"!==t.tagName}(t)?new Ts(e):new xs(e);n.mount(t),gt.set(t,n)}function As(t){const e=new Ss({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),gt.set(t,e)}function Ms(t,e,n,s){const i=[];if(function(t,e){return J(t)||"number"==typeof t||"string"==typeof t&&!Q(e)}(t,e))i.push(function(t,e,n){const s=J(t)?t:v(t);return s.start(Wn("",s,e,n)),s.animation}(t,Q(e)&&e.default||e,n&&n.default||n));else{const r=tt(t,e,s),o=r.length;for(let t=0;t<o;t++){const s=r[t],a=s instanceof Element?Vs:As;gt.has(s)||a(s);const l=gt.get(s),u={...n};"delay"in u&&"function"==typeof u.delay&&(u.delay=u.delay(t,o)),i.push(...Gn(l,{...e,transition:u},{}))}}return i}function Ps(t,e,n){const s=[];return function(t,{defaultTransition:e={},...n}={},s,i){const r=e.duration||.3,o=new Map,a=new Map,l={},u=new Map;let c=0,h=0,d=0;for(let n=0;n<t.length;n++){const o=t[n];if("string"==typeof o){u.set(o,h);continue}if(!Array.isArray(o)){u.set(o.name,nt(h,o.at,c,u));continue}let[p,f,m={}]=o;void 0!==m.at&&(h=nt(h,m.at,c,u));let g=0;const y=(t,n,s,o=0,a=0)=>{const l=dt(t),{delay:u=0,times:c=_(l),type:p="keyframes",repeat:f,repeatType:m,repeatDelay:y=0,...v}=n;let{ease:w=e.ease||"easeOut",duration:b}=n;const T="function"==typeof u?u(o,a):u,x=l.length,S=et(p)?p:null==i?void 0:i[p];if(x<=2&&S){let t=100;if(2===x&&mt(l)){const e=l[1]-l[0];t=Math.abs(e)}const e={...v};void 0!==b&&(e.duration=V(b));const n=X(e,t,S);w=n.ease,b=n.duration}null!=b||(b=r);const A=h+T;1===c.length&&0===c[0]&&(c[1]=1);const M=c.length-l.length;if(M>0&&Z(c,M),1===l.length&&l.unshift(null),f){b=ut(b,f);const t=[...l],e=[...c];w=Array.isArray(w)?[...w]:[w];const n=[...w];for(let s=0;s<f;s++){l.push(...t);for(let i=0;i<t.length;i++)c.push(e[i]+(s+1)),w.push(0===i?"linear":rt(n,i-1))}lt(c,f)}const P=A+b;ot(s,l,w,c,A,P),g=Math.max(T+b,g),d=Math.max(P,d)};if(J(p)){y(f,m,ht("default",ct(p,a)))}else{const t=tt(p,f,s,l),e=t.length;for(let n=0;n<e;n++){f=f,m=m;const s=ct(t[n],a);for(const t in f)y(f[t],pt(m,t),ht(t,s),n,e)}}c=h,h+=g}return a.forEach((t,s)=>{for(const i in t){const r=t[i];r.sort(at);const a=[],l=[],u=[];for(let t=0;t<r.length;t++){const{at:e,value:n,easing:s}=r[t];a.push(n),l.push(x(0,d,e)),u.push(s||"easeOut")}0!==l[0]&&(l.unshift(0),a.unshift(a[0]),u.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),a.push(null)),o.has(s)||o.set(s,{keyframes:{},transition:{}});const c=o.get(s);c.keyframes[i]=a,c.transition[i]={...e,duration:d,ease:u,times:l,...n}}}),o}(t,e,n,{spring:q}).forEach(({keyframes:t,transition:e},n)=>{s.push(...Ms(n,t,e))}),s}function ks(t){return function(e,n,s){let i=[];var r;r=e,i=Array.isArray(r)&&Array.isArray(r[0])?Ps(e,n,t):Ms(e,n,s,t);const o=new T(i);return t&&t.animations.push(o),o}}const Fs=ks();function Cs(t,e,n){t.style.setProperty("--"+e,n)}function Es(t,e,n){t.style[e]=n}const Os=w(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),Is=new WeakMap;function Rs(t){const e=Is.get(t)||new Map;return Is.set(t,e),Is.get(t)}class Bs{constructor(t,e,s,i){const r=e.startsWith("--");this.setValue=r?Cs:Es,this.options=i,this.updateFinishedPromise(),n("string"!=typeof i.type);const o=Rs(t).get(e);o&&o.stop();if(Array.isArray(s)||(s=[s]),function(t,e,n){for(let s=0;s<e.length;s++)null===e[s]&&(e[s]=0===s?n():e[s-1]),"number"==typeof e[s]&&Ne[t]&&(e[s]=Ne[t].transform(e[s]));!Os()&&e.length<2&&e.unshift(n())}(e,s,()=>e.startsWith("--")?t.style.getPropertyValue(e):window.getComputedStyle(t)[e]),et(i.type)){const t=X(i,100,i.type);i.ease=Fn()?t.ease:"easeOut",i.duration=V(t.duration),i.type="keyframes"}else i.ease=i.ease||"easeOut";this.removeAnimation=()=>{var n;return null===(n=Is.get(t))||void 0===n?void 0:n.delete(e)};const a=()=>{this.setValue(t,e,At(s,this.options)),this.cancel(),this.resolveFinishedPromise()};Bn()?(this.animation=In(t,e,s,i),!1===i.autoplay&&this.animation.pause(),this.animation.onfinish=a,this.pendingTimeline&&Rn(this.animation,this.pendingTimeline),Rs(t).set(e,this)):a()}get duration(){return A(this.options.duration||300)}get time(){var t;return this.animation?A((null===(t=this.animation)||void 0===t?void 0:t.currentTime)||0):0}set time(t){this.animation&&(this.animation.currentTime=V(t))}get speed(){return this.animation?this.animation.playbackRate:1}set speed(t){this.animation&&(this.animation.playbackRate=t)}get state(){return this.animation?this.animation.playState:"finished"}get startTime(){return this.animation?this.animation.startTime:null}flatten(){var t;this.animation&&(null===(t=this.animation.effect)||void 0===t||t.updateTiming({easing:"linear"}))}play(){"finished"===this.state&&this.updateFinishedPromise(),this.animation&&this.animation.play()}pause(){this.animation&&this.animation.pause()}stop(){this.animation&&"idle"!==this.state&&"finished"!==this.state&&(this.animation.commitStyles&&this.animation.commitStyles(),this.cancel())}complete(){this.animation&&this.animation.finish()}cancel(){this.removeAnimation();try{this.animation&&this.animation.cancel()}catch(t){}}then(t,e){return this.currentFinishedPromise.then(t,e)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}attachTimeline(t){return this.animation?Rn(this.animation,t):this.pendingTimeline=t,e}}const Ds=(t=>function(e,n,s){return new T(function(t,e,n,s){const r=i(t,s),o=r.length,a=[];for(let t=0;t<o;t++){const s=r[t],i={...n};"function"==typeof i.delay&&(i.delay=i.delay(t,o));for(const t in e){const n=e[t],r={...St(i,t)};r.duration=r.duration?V(r.duration):r.duration,r.delay=V(r.delay||0),a.push(new Bs(s,t,n,r))}}return a}(e,n,s,t))})(),Ls=new WeakMap;let Ws;function Ns({target:t,contentRect:e,borderBoxSize:n}){var s;null===(s=Ls.get(t))||void 0===s||s.forEach(s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})})}function Ks(t){t.forEach(Ns)}function js(t,e){Ws||"undefined"!=typeof ResizeObserver&&(Ws=new ResizeObserver(Ks));const n=i(t);return n.forEach(t=>{let n=Ls.get(t);n||(n=new Set,Ls.set(t,n)),n.add(e),null==Ws||Ws.observe(t)}),()=>{n.forEach(t=>{const n=Ls.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==Ws||Ws.unobserve(t)})}}const zs=new Set;let $s;function Hs(t){return zs.add(t),$s||($s=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};zs.forEach(t=>t(e))},window.addEventListener("resize",$s)),()=>{zs.delete(t),!zs.size&&$s&&($s=void 0)}}const Us={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Ys(t,e,n,s){const i=n[e],{length:r,position:o}=Us[e],l=i.current,u=n.time;i.current=t["scroll"+o],i.scrollLength=t["scroll"+r]-t["client"+r],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=x(0,i.scrollLength,i.current);const c=s-u;i.velocity=c>50?0:a(i.current-l,c)}const qs={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Xs={start:0,center:.5,end:1};function Gs(t,e,n=0){let s=0;if(t in Xs&&(t=Xs[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?s=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?s=e/100*document.documentElement.clientWidth:t.endsWith("vh")?s=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(s=e*t),n+s}const Zs=[0,0];function _s(t,e,n,s){let i=Array.isArray(t)?t:Zs,r=0,o=0;return"number"==typeof t?i=[t,t]:"string"==typeof t&&(i=(t=t.trim()).includes(" ")?t.split(" "):[t,Xs[t]?t:"0"]),r=Gs(i[0],n,s),o=Gs(i[1],e),r-o}const Js={x:0,y:0};function Qs(t,e,n){const{offset:s=qs.All}=n,{target:i=t,axis:r="y"}=n,o="y"===r?"height":"width",a=i!==t?function(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if("svg"===s.tagName){const t=s.getBoundingClientRect();s=s.parentElement;const e=s.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(s instanceof SVGGraphicsElement))break;{const{x:t,y:e}=s.getBBox();n.x+=t,n.y+=e;let i=null,r=s.parentNode;for(;!i;)"svg"===r.tagName&&(i=r),r=s.parentNode;s=i}}return n}(i,t):Js,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(i),u={width:t.clientWidth,height:t.clientHeight};e[r].offset.length=0;let c=!e[r].interpolate;const h=s.length;for(let t=0;t<h;t++){const n=_s(s[t],u[o],l[o],a[r]);c||n===e[r].interpolatorOffsets[t]||(c=!0),e[r].offset[t]=n}c&&(e[r].interpolate=bn(e[r].offset,_(s)),e[r].interpolatorOffsets=[...e[r].offset]),e[r].progress=e[r].interpolate(e[r].current)}function ti(t,e,n,s={}){return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,s.target,n),update:e=>{!function(t,e,n){Ys(t,"x",e,n),Ys(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&Qs(t,n,s)},notify:()=>e(n)}}const ei=new WeakMap,ni=new WeakMap,si=new WeakMap,ii=t=>t===document.documentElement?window:t;function ri(t,{container:e=document.documentElement,...n}={}){let s=si.get(e);s||(s=new Set,si.set(e,s));const i=ti(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(s.add(i),!ei.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(d.timestamp)},i=()=>{for(const t of s)t.notify()},a=()=>{c.read(t,!1,!0),c.read(n,!1,!0),c.update(i,!1,!0)};ei.set(e,a);const l=ii(e);window.addEventListener("resize",a,{passive:!0}),e!==document.documentElement&&ni.set(e,(o=a,"function"==typeof(r=e)?Hs(r):js(r,o))),l.addEventListener("scroll",a,{passive:!0})}var r,o;const a=ei.get(e);return c.read(a,!1,!0),()=>{var t;h(a);const n=si.get(e);if(!n)return;if(n.delete(i),n.size)return;const s=ei.get(e);ei.delete(e),s&&(ii(e).removeEventListener("scroll",s),null===(t=ni.get(e))||void 0===t||t(),window.removeEventListener("resize",s))}}function oi(t,e){let n;const s=()=>{const{currentTime:s}=e,i=(null===s?0:s.value)/100;n!==i&&t(i),n=i};return c.update(s,!0),()=>h(s)}const ai=new Map;function li({source:t,container:e=document.documentElement,axis:n="y"}={}){t&&(e=t),ai.has(e)||ai.set(e,{});const s=ai.get(e);return s[n]||(s[n]=b()?new ScrollTimeline({source:e,axis:n}):function({source:t,container:e,axis:n="y"}){t&&(e=t);const s={value:0},i=ri(t=>{s.value=100*t[n].progress},{container:e,axis:n});return{currentTime:s,cancel:i}}({source:e,axis:n})),s[n]}function ui(t){return t&&(t.target||t.offset)}const ci={some:0,all:1};const hi=(t,e)=>Math.abs(t-e);const di=c,pi=u.reduce((t,e)=>(t[e]=t=>h(t),t),{});t.MotionValue=y,t.animate=Fs,t.animateMini=Ds,t.anticipate=It,t.backIn=Et,t.backInOut=Ot,t.backOut=Ct,t.cancelFrame=h,t.cancelSync=pi,t.circIn=Rt,t.circInOut=Dt,t.circOut=Bt,t.clamp=P,t.createScopedAnimate=ks,t.cubicBezier=Pt,t.delay=function(t,e){return function(t,e){const n=g.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(h(s),t(r-e))};return c.read(s,!0),()=>h(s)}(t,V(e))},t.distance=hi,t.distance2D=function(t,e){const n=hi(t.x,e.x),s=hi(t.y,e.y);return Math.sqrt(n**2+s**2)},t.easeIn=Je,t.easeInOut=tn,t.easeOut=Qe,t.frame=c,t.frameData=d,t.frameSteps=p,t.inView=function(t,e,{root:n,margin:s,amount:r="some"}={}){const o=i(t),a=new WeakMap,l=new IntersectionObserver(t=>{t.forEach(t=>{const n=a.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);"function"==typeof n?a.set(t.target,n):l.unobserve(t.target)}else n&&(n(t),a.delete(t.target))})},{root:n,rootMargin:s,threshold:"number"==typeof r?r:ci[r]});return o.forEach(t=>l.observe(t)),()=>l.disconnect()},t.inertia=_e,t.interpolate=bn,t.invariant=n,t.isDragActive=function(){return s},t.keyframes=Tn,t.mirrorEasing=kt,t.mix=wn,t.motionValue=v,t.noop=e,t.pipe=on,t.progress=x,t.reverseEasing=Ft,t.scroll=function(t,{axis:n="y",...s}={}){const i={axis:n,...s};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||ui(e)?ri(n=>{t(n[e.axis].progress,n)},e):oi(t,li(e))}(t,i):function(t,n){if(t.flatten(),ui(n))return t.pause(),ri(e=>{t.time=t.duration*e[n.axis].progress},n);{const s=li(n);return t.attachTimeline?t.attachTimeline(s,t=>(t.pause(),oi(e=>{t.time=t.duration*e},s))):e}}(t,i)},t.scrollInfo=ri,t.spring=q,t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(i,r)=>{const o="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,r),a=Math.abs(o-i);let l=t*a;if(s){const e=r*t;l=sn(s)(l/e)*e}return e+l}},t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,i="end"===e?Math.floor(s):Math.ceil(s);return P(0,1,i/t)}},t.sync=di,t.time=g,t.transform=function(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=t[1+n],r=t[2+n],o=t[3+n],a=bn(i,r,{mixer:(l=r[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...o});var l;return e?a(s):a},t.wrap=st}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motion",
3
- "version": "11.14.4",
3
+ "version": "11.15.0",
4
4
  "description": "An animation library for JavaScript and React.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/motion/lib/index.mjs",
@@ -70,7 +70,7 @@
70
70
  "postpublish": "git push --tags"
71
71
  },
72
72
  "dependencies": {
73
- "framer-motion": "^11.14.4",
73
+ "framer-motion": "^11.15.0",
74
74
  "tslib": "^2.4.0"
75
75
  },
76
76
  "peerDependencies": {
@@ -89,5 +89,5 @@
89
89
  "optional": true
90
90
  }
91
91
  },
92
- "gitHead": "1108bd55223d1e0bef72be4e00265e24c88846fa"
92
+ "gitHead": "6ddb3e79685653f18a863f64f76c3fb5fade1903"
93
93
  }