framer-motion 7.6.6 → 7.6.8

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/index.d.ts CHANGED
@@ -1333,15 +1333,27 @@ declare class FlatTree {
1333
1333
  forEach(callback: (child: WithDepth) => void): void;
1334
1334
  }
1335
1335
 
1336
+ declare type Position = "static" | "sticky" | "fixed";
1336
1337
  interface Measurements {
1338
+ animationId: number;
1337
1339
  measuredBox: Box;
1338
1340
  layoutBox: Box;
1339
1341
  latestValues: ResolvedValues;
1340
- isShared?: boolean;
1342
+ source: number;
1343
+ position: Position;
1344
+ }
1345
+ declare type Phase = "snapshot" | "measure";
1346
+ interface ScrollMeasurements {
1347
+ animationId: number;
1348
+ phase: Phase;
1349
+ isRoot: boolean;
1350
+ offset: Point;
1341
1351
  }
1342
1352
  declare type LayoutEvents = "willUpdate" | "didUpdate" | "beforeMeasure" | "measure" | "projectionUpdate" | "animationStart" | "animationComplete";
1343
1353
  interface IProjectionNode<I = unknown> {
1354
+ id: number;
1344
1355
  elementId: number | undefined;
1356
+ animationId: number;
1345
1357
  parent?: IProjectionNode;
1346
1358
  relativeParent?: IProjectionNode;
1347
1359
  root?: IProjectionNode;
@@ -1360,8 +1372,7 @@ interface IProjectionNode<I = unknown> {
1360
1372
  relativeTarget?: Box;
1361
1373
  targetDelta?: Delta;
1362
1374
  targetWithTransforms?: Box;
1363
- scroll?: Point;
1364
- isScrollRoot?: boolean;
1375
+ scroll?: ScrollMeasurements;
1365
1376
  treeScale?: Point;
1366
1377
  projectionDelta?: Delta;
1367
1378
  projectionDeltaWithTransform?: Delta;
@@ -1384,7 +1395,7 @@ interface IProjectionNode<I = unknown> {
1384
1395
  updateLayout(): void;
1385
1396
  updateSnapshot(): void;
1386
1397
  clearSnapshot(): void;
1387
- updateScroll(): void;
1398
+ updateScroll(phase?: Phase): void;
1388
1399
  scheduleUpdateProjection(): void;
1389
1400
  scheduleCheckAfterUnmount(): void;
1390
1401
  checkUpdateFailed(): void;
@@ -1242,7 +1242,7 @@
1242
1242
  * This will be replaced by the build step with the latest version number.
1243
1243
  * When MotionValues are provided to motion components, warn if versions are mixed.
1244
1244
  */
1245
- this.version = "7.6.6";
1245
+ this.version = "7.6.8";
1246
1246
  /**
1247
1247
  * Duration, in milliseconds, since last updating frame.
1248
1248
  *
@@ -2194,7 +2194,10 @@
2194
2194
  node.options.layoutScroll &&
2195
2195
  node.scroll &&
2196
2196
  node !== node.root) {
2197
- transformBox(box, { x: -node.scroll.x, y: -node.scroll.y });
2197
+ transformBox(box, {
2198
+ x: -node.scroll.offset.x,
2199
+ y: -node.scroll.offset.y,
2200
+ });
2198
2201
  }
2199
2202
  if (delta) {
2200
2203
  // Incoporate each ancestor's scale into a culmulative treeScale for this component
@@ -2420,7 +2423,6 @@
2420
2423
  node.snapshot = prevLead.snapshot;
2421
2424
  node.snapshot.latestValues =
2422
2425
  prevLead.animationValues || prevLead.latestValues;
2423
- node.snapshot.isShared = true;
2424
2426
  }
2425
2427
  if ((_a = node.root) === null || _a === void 0 ? void 0 : _a.isUpdating) {
2426
2428
  node.isLayoutDirty = true;
@@ -2471,8 +2473,8 @@
2471
2473
  Object.assign(scaleCorrectors, correctors);
2472
2474
  }
2473
2475
 
2474
- const identityProjection = "translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";
2475
2476
  function buildProjectionTransform(delta, treeScale, latestTransform) {
2477
+ let transform = "";
2476
2478
  /**
2477
2479
  * The translations we use to calculate are always relative to the viewport coordinate space.
2478
2480
  * But when we apply scales, we also scale the coordinate space of an element and its children.
@@ -2481,12 +2483,16 @@
2481
2483
  */
2482
2484
  const xTranslate = delta.x.translate / treeScale.x;
2483
2485
  const yTranslate = delta.y.translate / treeScale.y;
2484
- let transform = `translate3d(${xTranslate}px, ${yTranslate}px, 0) `;
2486
+ if (xTranslate || yTranslate) {
2487
+ transform = `translate3d(${xTranslate}px, ${yTranslate}px, 0) `;
2488
+ }
2485
2489
  /**
2486
2490
  * Apply scale correction for the tree transform.
2487
2491
  * This will apply scale to the screen-orientated axes.
2488
2492
  */
2489
- transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `;
2493
+ if (treeScale.x !== 1 || treeScale.y !== 1) {
2494
+ transform += `scale(${1 / treeScale.x}, ${1 / treeScale.y}) `;
2495
+ }
2490
2496
  if (latestTransform) {
2491
2497
  const { rotate, rotateX, rotateY } = latestTransform;
2492
2498
  if (rotate)
@@ -2502,8 +2508,10 @@
2502
2508
  */
2503
2509
  const elementScaleX = delta.x.scale * treeScale.x;
2504
2510
  const elementScaleY = delta.y.scale * treeScale.y;
2505
- transform += `scale(${elementScaleX}, ${elementScaleY})`;
2506
- return transform === identityProjection ? "none" : transform;
2511
+ if (elementScaleX !== 1 || elementScaleY !== 1) {
2512
+ transform += `scale(${elementScaleX}, ${elementScaleY})`;
2513
+ }
2514
+ return transform || "none";
2507
2515
  }
2508
2516
 
2509
2517
  function eachAxis(callback) {
@@ -2568,9 +2576,18 @@
2568
2576
  * which has a noticeable difference in spring animations
2569
2577
  */
2570
2578
  const animationTarget = 1000;
2579
+ let id = 0;
2571
2580
  function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {
2572
2581
  return class ProjectionNode {
2573
2582
  constructor(elementId, latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) {
2583
+ /**
2584
+ * A unique ID generated for every projection node.
2585
+ */
2586
+ this.id = id++;
2587
+ /**
2588
+ * An id that represents a unique session instigated by startUpdate.
2589
+ */
2590
+ this.animationId = 0;
2574
2591
  /**
2575
2592
  * A Set containing all this component's children. This is used to iterate
2576
2593
  * through the children.
@@ -2679,8 +2696,8 @@
2679
2696
  hasListeners(name) {
2680
2697
  return this.eventHandlers.has(name);
2681
2698
  }
2682
- registerPotentialNode(id, node) {
2683
- this.potentialNodes.set(id, node);
2699
+ registerPotentialNode(elementId, node) {
2700
+ this.potentialNodes.set(elementId, node);
2684
2701
  }
2685
2702
  /**
2686
2703
  * Lifecycles
@@ -2813,6 +2830,7 @@
2813
2830
  return;
2814
2831
  this.isUpdating = true;
2815
2832
  (_a = this.nodes) === null || _a === void 0 ? void 0 : _a.forEach(resetRotation);
2833
+ this.animationId++;
2816
2834
  }
2817
2835
  willUpdate(shouldNotifyListeners = true) {
2818
2836
  var _a, _b, _c;
@@ -2827,11 +2845,7 @@
2827
2845
  for (let i = 0; i < this.path.length; i++) {
2828
2846
  const node = this.path[i];
2829
2847
  node.shouldResetTransform = true;
2830
- /**
2831
- * TODO: Check we haven't updated the scroll
2832
- * since the last didUpdate
2833
- */
2834
- node.updateScroll();
2848
+ node.updateScroll("snapshot");
2835
2849
  }
2836
2850
  const { layoutId, layout } = this.options;
2837
2851
  if (layoutId === undefined && !layout)
@@ -2947,10 +2961,20 @@
2947
2961
  this.notifyListeners("measure", this.layout.layoutBox);
2948
2962
  (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.notify("LayoutMeasure", this.layout.layoutBox, prevLayout === null || prevLayout === void 0 ? void 0 : prevLayout.layoutBox);
2949
2963
  }
2950
- updateScroll() {
2951
- if (this.options.layoutScroll && this.instance) {
2952
- this.isScrollRoot = checkIsScrollRoot(this.instance);
2953
- this.scroll = measureScroll(this.instance);
2964
+ updateScroll(phase = "measure") {
2965
+ let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);
2966
+ if (this.scroll &&
2967
+ this.scroll.animationId === this.root.animationId &&
2968
+ this.scroll.phase === phase) {
2969
+ needsMeasurement = false;
2970
+ }
2971
+ if (needsMeasurement) {
2972
+ this.scroll = {
2973
+ animationId: this.root.animationId,
2974
+ phase,
2975
+ isRoot: checkIsScrollRoot(this.instance),
2976
+ offset: measureScroll(this.instance),
2977
+ };
2954
2978
  }
2955
2979
  }
2956
2980
  resetTransform() {
@@ -2972,6 +2996,7 @@
2972
2996
  }
2973
2997
  }
2974
2998
  measure(removeTransform = true) {
2999
+ var _a;
2975
3000
  const pageBox = this.measurePageBox();
2976
3001
  let layoutBox = this.removeElementScroll(pageBox);
2977
3002
  /**
@@ -2983,10 +3008,17 @@
2983
3008
  layoutBox = this.removeTransform(layoutBox);
2984
3009
  }
2985
3010
  roundBox(layoutBox);
3011
+ const positionStyle = (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.readValue("position");
3012
+ const position = positionStyle === "fixed" || positionStyle === "sticky"
3013
+ ? positionStyle
3014
+ : "static";
2986
3015
  return {
3016
+ animationId: this.root.animationId,
2987
3017
  measuredBox: pageBox,
2988
3018
  layoutBox,
2989
3019
  latestValues: {},
3020
+ source: this.id,
3021
+ position,
2990
3022
  };
2991
3023
  }
2992
3024
  measurePageBox() {
@@ -2997,8 +3029,8 @@
2997
3029
  // Remove viewport scroll to give page-relative coordinates
2998
3030
  const { scroll } = this.root;
2999
3031
  if (scroll) {
3000
- translateAxis(box.x, scroll.x);
3001
- translateAxis(box.y, scroll.y);
3032
+ translateAxis(box.x, scroll.offset.x);
3033
+ translateAxis(box.y, scroll.offset.y);
3002
3034
  }
3003
3035
  return box;
3004
3036
  }
@@ -3011,13 +3043,13 @@
3011
3043
  */
3012
3044
  for (let i = 0; i < this.path.length; i++) {
3013
3045
  const node = this.path[i];
3014
- const { scroll, options, isScrollRoot } = node;
3046
+ const { scroll, options } = node;
3015
3047
  if (node !== this.root && scroll && options.layoutScroll) {
3016
3048
  /**
3017
3049
  * If this is a new scroll root, we want to remove all previous scrolls
3018
3050
  * from the viewport box.
3019
3051
  */
3020
- if (isScrollRoot) {
3052
+ if (scroll.isRoot) {
3021
3053
  copyBoxInto(boxWithoutScroll, box);
3022
3054
  const { scroll: rootScroll } = this.root;
3023
3055
  /**
@@ -3025,12 +3057,12 @@
3025
3057
  * to the measured bounding box.
3026
3058
  */
3027
3059
  if (rootScroll) {
3028
- translateAxis(boxWithoutScroll.x, -rootScroll.x);
3029
- translateAxis(boxWithoutScroll.y, -rootScroll.y);
3060
+ translateAxis(boxWithoutScroll.x, -rootScroll.offset.x);
3061
+ translateAxis(boxWithoutScroll.y, -rootScroll.offset.y);
3030
3062
  }
3031
3063
  }
3032
- translateAxis(boxWithoutScroll.x, scroll.x);
3033
- translateAxis(boxWithoutScroll.y, scroll.y);
3064
+ translateAxis(boxWithoutScroll.x, scroll.offset.x);
3065
+ translateAxis(boxWithoutScroll.y, scroll.offset.y);
3034
3066
  }
3035
3067
  }
3036
3068
  return boxWithoutScroll;
@@ -3045,8 +3077,8 @@
3045
3077
  node.scroll &&
3046
3078
  node !== node.root) {
3047
3079
  transformBox(withTransforms, {
3048
- x: -node.scroll.x,
3049
- y: -node.scroll.y,
3080
+ x: -node.scroll.offset.x,
3081
+ y: -node.scroll.offset.y,
3050
3082
  });
3051
3083
  }
3052
3084
  if (!hasTransform(node.latestValues))
@@ -3280,7 +3312,7 @@
3280
3312
  }
3281
3313
  }
3282
3314
  setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) {
3283
- var _a;
3315
+ var _a, _b;
3284
3316
  const snapshot = this.snapshot;
3285
3317
  const snapshotLatestValues = (snapshot === null || snapshot === void 0 ? void 0 : snapshot.latestValues) || {};
3286
3318
  const mixedValues = { ...this.latestValues };
@@ -3288,8 +3320,8 @@
3288
3320
  this.relativeTarget = this.relativeTargetOrigin = undefined;
3289
3321
  this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;
3290
3322
  const relativeLayout = createBox();
3291
- const isSharedLayoutAnimation = snapshot === null || snapshot === void 0 ? void 0 : snapshot.isShared;
3292
- const isOnlyMember = (((_a = this.getStack()) === null || _a === void 0 ? void 0 : _a.members.length) || 0) <= 1;
3323
+ const isSharedLayoutAnimation = (snapshot === null || snapshot === void 0 ? void 0 : snapshot.source) !== ((_a = this.layout) === null || _a === void 0 ? void 0 : _a.source);
3324
+ const isOnlyMember = (((_b = this.getStack()) === null || _b === void 0 ? void 0 : _b.members.length) || 0) <= 1;
3293
3325
  const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&
3294
3326
  !isOnlyMember &&
3295
3327
  this.options.crossfade === true &&
@@ -3470,25 +3502,30 @@
3470
3502
  return;
3471
3503
  // If there's no detected rotation values, we can early return without a forced render.
3472
3504
  let hasRotate = false;
3473
- // Keep a record of all the values we've reset
3474
- const resetValues = {};
3475
- // Check the rotate value of all axes and reset to 0
3476
- for (let i = 0; i < transformAxes.length; i++) {
3477
- const axis = transformAxes[i];
3478
- const key = "rotate" + axis;
3479
- // If this rotation doesn't exist as a motion value, then we don't
3480
- // need to reset it
3481
- if (!visualElement.getStaticValue(key)) {
3482
- continue;
3483
- }
3505
+ /**
3506
+ * An unrolled check for rotation values. Most elements don't have any rotation and
3507
+ * skipping the nested loop and new object creation is 50% faster.
3508
+ */
3509
+ const { latestValues } = visualElement;
3510
+ if (latestValues.rotate ||
3511
+ latestValues.rotateX ||
3512
+ latestValues.rotateY ||
3513
+ latestValues.rotateZ) {
3484
3514
  hasRotate = true;
3485
- // Record the rotation and then temporarily set it to 0
3486
- resetValues[key] = visualElement.getStaticValue(key);
3487
- visualElement.setStaticValue(key, 0);
3488
3515
  }
3489
3516
  // If there's no rotation values, we don't need to do any more.
3490
3517
  if (!hasRotate)
3491
3518
  return;
3519
+ const resetValues = {};
3520
+ // Check the rotate value of all axes and reset to 0
3521
+ for (let i = 0; i < transformAxes.length; i++) {
3522
+ const key = "rotate" + transformAxes[i];
3523
+ // Record the rotation and then temporarily set it to 0
3524
+ if (latestValues[key]) {
3525
+ resetValues[key] = latestValues[key];
3526
+ visualElement.setStaticValue(key, 0);
3527
+ }
3528
+ }
3492
3529
  // Force a render of this element to apply the transform with all rotations
3493
3530
  // set to 0.
3494
3531
  visualElement === null || visualElement === void 0 ? void 0 : visualElement.render();
@@ -3630,11 +3667,12 @@
3630
3667
  node.hasListeners("didUpdate")) {
3631
3668
  const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;
3632
3669
  const { animationType } = node.options;
3670
+ const isShared = snapshot.source !== node.layout.source;
3633
3671
  // TODO Maybe we want to also resize the layout snapshot so we don't trigger
3634
3672
  // animations for instance if layout="size" and an element has only changed position
3635
3673
  if (animationType === "size") {
3636
3674
  eachAxis((axis) => {
3637
- const axisSnapshot = snapshot.isShared
3675
+ const axisSnapshot = isShared
3638
3676
  ? snapshot.measuredBox[axis]
3639
3677
  : snapshot.layoutBox[axis];
3640
3678
  const length = calcLength(axisSnapshot);
@@ -3644,7 +3682,7 @@
3644
3682
  }
3645
3683
  else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) {
3646
3684
  eachAxis((axis) => {
3647
- const axisSnapshot = snapshot.isShared
3685
+ const axisSnapshot = isShared
3648
3686
  ? snapshot.measuredBox[axis]
3649
3687
  : snapshot.layoutBox[axis];
3650
3688
  const length = calcLength(layout[axis]);
@@ -3654,7 +3692,7 @@
3654
3692
  const layoutDelta = createDelta();
3655
3693
  calcBoxDelta(layoutDelta, layout, snapshot.layoutBox);
3656
3694
  const visualDelta = createDelta();
3657
- if (snapshot.isShared) {
3695
+ if (isShared) {
3658
3696
  calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox);
3659
3697
  }
3660
3698
  else {
@@ -3750,7 +3788,7 @@
3750
3788
  duration: 0.45,
3751
3789
  ease: [0.4, 0, 0.1, 1],
3752
3790
  };
3753
- function mountNodeEarly(node, id) {
3791
+ function mountNodeEarly(node, elementId) {
3754
3792
  /**
3755
3793
  * Rather than searching the DOM from document we can search the
3756
3794
  * path for the deepest mounted ancestor and search from there
@@ -3763,7 +3801,7 @@
3763
3801
  }
3764
3802
  }
3765
3803
  const searchElement = searchNode && searchNode !== node.root ? searchNode.instance : document;
3766
- const element = searchElement.querySelector(`[data-projection-id="${id}"]`);
3804
+ const element = searchElement.querySelector(`[data-projection-id="${elementId}"]`);
3767
3805
  if (element)
3768
3806
  node.mount(element, true);
3769
3807
  }
@@ -4742,7 +4780,7 @@
4742
4780
  * and warn against mismatches.
4743
4781
  */
4744
4782
  {
4745
- warnOnce(nextValue.version === "7.6.6", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.6.6 may not work as expected.`);
4783
+ warnOnce(nextValue.version === "7.6.8", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.6.8 may not work as expected.`);
4746
4784
  }
4747
4785
  }
4748
4786
  else if (isMotionValue(prevValue)) {
@@ -4896,17 +4934,6 @@
4896
4934
  }
4897
4935
  }
4898
4936
  }
4899
- /**
4900
- * Update external values with initial values
4901
- */
4902
- if (props.values) {
4903
- for (const key in props.values) {
4904
- const value = props.values[key];
4905
- if (latestValues[key] !== undefined && isMotionValue(value)) {
4906
- value.set(latestValues[key]);
4907
- }
4908
- }
4909
- }
4910
4937
  }
4911
4938
  /**
4912
4939
  * This method takes React props and returns found MotionValues. For example, HTML
@@ -1 +1 @@
1
- import{useContext as t,useId as e,useEffect as n,useRef as r,createElement as o}from"react";import{p as s,q as i,t as a,u,v as l,w as c,x as p,y as d,z as h,P as f,A as m,B as v,C as g,D as y,E as b,F as w,G as V,r as A,d as S,H as M,m as x,c as C,i as E,I as T,f as O,b as P,l as F,a as I,J as j,g as k,o as R,K as D,L as B,M as N,s as U,h as L,n as H,j as z}from"./size-rollup-dom-animation-assets.js";const q=(t,e)=>n=>Boolean(s(n)&&i.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),W=(t,e,n)=>r=>{if(!s(r))return r;const[o,i,u,l]=r.match(a);return{[t]:parseFloat(o),[e]:parseFloat(i),[n]:parseFloat(u),alpha:void 0!==l?parseFloat(l):1}},$={test:q("hsl","hue"),parse:W("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+u.transform(l(e))+", "+u.transform(l(n))+", "+l(c.transform(r))+")"},K=d(0,255),Y=Object.assign(Object.assign({},p),{transform:t=>Math.round(K(t))}),X={test:q("rgb","red"),parse:W("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Y.transform(t)+", "+Y.transform(e)+", "+Y.transform(n)+", "+l(c.transform(r))+")"};const G={test:q("#"),parse:function(t){let e="",n="",r="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),r=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),r=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,r+=r,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:X.transform},Z={test:t=>X.test(t)||G.test(t)||$.test(t),parse:t=>X.test(t)?X.parse(t):$.test(t)?$.parse(t):G.parse(t),transform:t=>s(t)?t:t.hasOwnProperty("red")?X.transform(t):$.transform(t)};function J(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const r=t.match(h);r&&(n=r.length,t=t.replace(h,"${c}"),e.push(...r.map(Z.parse)));const o=t.match(a);return o&&(t=t.replace(a,"${n}"),e.push(...o.map(p.parse))),{values:e,numColors:n,tokenised:t}}function _(t){return J(t).values}function Q(t){const{values:e,numColors:n,tokenised:r}=J(t),o=e.length;return t=>{let e=r;for(let r=0;r<o;r++)e=e.replace(r<n?"${c}":"${n}",r<n?Z.transform(t[r]):l(t[r]));return e}}const tt=t=>"number"==typeof t?0:t;const et={test:function(t){var e,n,r,o;return isNaN(t)&&s(t)&&(null!==(n=null===(e=t.match(a))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(r=t.match(h))||void 0===r?void 0:r.length)&&void 0!==o?o:0)>0},parse:_,createTransformer:Q,getAnimatableNone:function(t){const e=_(t);return Q(t)(e.map(tt))}},nt=new Set(["brightness","contrast","saturate","opacity"]);function rt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(a)||[];if(!r)return t;const o=n.replace(r,"");let s=nt.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+o+")"}const ot=/([a-z-]*)\(.*?\)/g,st=Object.assign(Object.assign({},et),{getAnimatableNone:t=>{const e=t.match(ot);return e?e.map(rt).join(" "):t}});function it(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function at(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}const ut=(t,e,n)=>Math.min(Math.max(n,t),e);function lt({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let o,s,i=1-e;i=ut(.05,1,i),t=ut(.01,10,t/1e3),i<1?(o=e=>{const r=e*i,o=r*t;return.001-(r-n)/ct(e,i)*Math.exp(-o)},s=e=>{const r=e*i*t,s=r*n+n,a=Math.pow(i,2)*Math.pow(e,2)*t,u=Math.exp(-r),l=ct(Math.pow(e,2),i);return(.001-o(e)>0?-1:1)*((s-a)*u)/l}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let r=n;for(let n=1;n<12;n++)r-=t(r)/e(r);return r}(o,s,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*r;return{stiffness:e,damping:2*i*Math.sqrt(r*e),duration:t}}}function ct(t,e){return t*Math.sqrt(1-e*e)}const pt=["duration","bounce"],dt=["stiffness","damping","mass"];function ht(t,e){return e.some(e=>void 0!==t[e])}function ft(t){var{from:e=0,to:n=1,restSpeed:r=2,restDelta:o}=t,s=at(t,["from","to","restSpeed","restDelta"]);const i={done:!1,value:e};let{stiffness:a,damping:u,mass:l,velocity:c,duration:p,isResolvedFromDuration:d}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!ht(t,dt)&&ht(t,pt)){const n=lt(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(s),h=mt,f=mt;function m(){const t=c?-c/1e3:0,r=n-e,s=u/(2*Math.sqrt(a*l)),i=Math.sqrt(a/l)/1e3;if(void 0===o&&(o=Math.min(Math.abs(n-e)/100,.4)),s<1){const e=ct(i,s);h=o=>{const a=Math.exp(-s*i*o);return n-a*((t+s*i*r)/e*Math.sin(e*o)+r*Math.cos(e*o))},f=n=>{const o=Math.exp(-s*i*n);return s*i*o*(Math.sin(e*n)*(t+s*i*r)/e+r*Math.cos(e*n))-o*(Math.cos(e*n)*(t+s*i*r)-e*r*Math.sin(e*n))}}else if(1===s)h=e=>n-Math.exp(-i*e)*(r+(t+i*r)*e);else{const e=i*Math.sqrt(s*s-1);h=o=>{const a=Math.exp(-s*i*o),u=Math.min(e*o,300);return n-a*((t+s*i*r)*Math.sinh(u)+e*r*Math.cosh(u))/e}}}return m(),{next:t=>{const e=h(t);if(d)i.done=t>=p;else{const s=1e3*f(t),a=Math.abs(s)<=r,u=Math.abs(n-e)<=o;i.done=a&&u}return i.value=i.done?n:e,i},flipTarget:()=>{c=-c,[e,n]=[n,e],m()}}}ft.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const mt=t=>0,vt=(t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r},gt=(t,e,n)=>-n*t+n*e+t;function yt(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 bt({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let o=0,s=0,i=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r;o=yt(a,r,t+1/3),s=yt(a,r,t),i=yt(a,r,t-1/3)}else o=s=i=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*i),alpha:r}}const wt=(t,e,n)=>{const r=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-r)+r))},Vt=[G,X,$],At=t=>Vt.find(e=>e.test(t)),St=(t,e)=>{let n=At(t),r=At(e),o=n.parse(t),s=r.parse(e);n===$&&(o=bt(o),n=X),r===$&&(s=bt(s),r=X);const i=Object.assign({},o);return t=>{for(const e in i)"alpha"!==e&&(i[e]=wt(o[e],s[e],t));return i.alpha=gt(o.alpha,s.alpha,t),n.transform(i)}},Mt=(t,e)=>n=>e(t(n)),xt=(...t)=>t.reduce(Mt);function Ct(t,e){return"number"==typeof t?n=>gt(t,e,n):Z.test(t)?St(t,e):Pt(t,e)}const Et=(t,e)=>{const n=[...t],r=n.length,o=t.map((t,n)=>Ct(t,e[n]));return t=>{for(let e=0;e<r;e++)n[e]=o[e](t);return n}},Tt=(t,e)=>{const n=Object.assign(Object.assign({},t),e),r={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(r[o]=Ct(t[o],e[o]));return t=>{for(const e in r)n[e]=r[e](t);return n}};function Ot(t){const e=et.parse(t),n=e.length;let r=0,o=0,s=0;for(let t=0;t<n;t++)r||"number"==typeof e[t]?r++:void 0!==e[t].hue?s++:o++;return{parsed:e,numNumbers:r,numRGB:o,numHSL:s}}const Pt=(t,e)=>{const n=et.createTransformer(e),r=Ot(t),o=Ot(e);return r.numHSL===o.numHSL&&r.numRGB===o.numRGB&&r.numNumbers>=o.numNumbers?xt(Et(r.parsed,o.parsed),n):n=>""+(n>0?e:t)},Ft=(t,e)=>n=>gt(t,e,n);function It(t,e,n){const r=[],o=n||("number"==typeof(s=t[0])?Ft:"string"==typeof s?Z.test(s)?St:Pt:Array.isArray(s)?Et:"object"==typeof s?Tt:void 0);var s;const i=t.length-1;for(let n=0;n<i;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=xt(t,s)}r.push(s)}return r}function jt(t,e,{clamp:n=!0,ease:r,mixer:o}={}){const s=t.length;e.length,!r||!Array.isArray(r)||r.length,t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const i=It(e,r,o),a=2===s?function([t,e],[n]){return r=>n(vt(t,e,r))}(t,i):function(t,e){const n=t.length,r=n-1;return o=>{let s=0,i=!1;if(o<=t[0]?i=!0:o>=t[r]&&(s=r-1,i=!0),!i){let e=1;for(;e<n&&!(t[e]>o||e===r);e++);s=e-1}const a=vt(t[s],t[s+1],o);return e[s](a)}}(t,i);return n?e=>a(ut(t[0],t[s-1],e)):a}const kt=t=>e=>1-t(1-e),Rt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Dt=t=>e=>e*e*((t+1)*e-t),Bt=t=>t,Nt=(Ut=2,t=>Math.pow(t,Ut));var Ut;const Lt=kt(Nt),Ht=Rt(Nt),zt=t=>1-Math.sin(Math.acos(t)),qt=kt(zt),Wt=Rt(qt),$t=Dt(1.525),Kt=kt($t),Yt=Rt($t),Xt=(t=>{const e=Dt(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),Gt=t=>{if(1===t||0===t)return t;const e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},Zt=kt(Gt);function Jt(t,e){return t.map(()=>e||Ht).splice(0,t.length-1)}function _t({from:t=0,to:e=1,ease:n,offset:r,duration:o=300}){const s={done:!1,value:t},i=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(r&&r.length===i.length?r:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(i),o);function u(){return jt(a,i,{ease:Array.isArray(n)?n:Jt(i,n)})}let l=u();return{next:t=>(s.value=l(t),s.done=t>=o,s),flipTarget:()=>{i.reverse(),l=u()}}}const Qt={keyframes:_t,spring:ft,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:r=350,restDelta:o=.5,modifyTarget:s}){const i={done:!1,value:e};let a=n*t;const u=e+a,l=void 0===s?u:s(u);return l!==u&&(a=l-e),{next:t=>{const e=-a*Math.exp(-t/r);return i.done=!(e>o||e<-o),i.value=i.done?l:l+e,i},flipTarget:()=>{}}}};const te="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),ee="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(te()),1/60*1e3);let ne=!0,re=!1,oe=!1;const se={delta:0,timestamp:0},ie=["read","update","preRender","render","postRender"],ae=ie.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],r=0,o=!1,s=!1;const i=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const u=a&&o,l=u?e:n;return s&&i.add(t),-1===l.indexOf(t)&&(l.push(t),u&&o&&(r=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),i.delete(t)},process:u=>{if(o)s=!0;else{if(o=!0,[e,n]=[n,e],n.length=0,r=e.length,r)for(let n=0;n<r;n++){const r=e[n];r(u),i.has(r)&&(a.schedule(r),t())}o=!1,s&&(s=!1,a.process(u))}}};return a}(()=>re=!0),t),{}),ue=ie.reduce((t,e)=>{const n=ae[e];return t[e]=(t,e=!1,r=!1)=>(re||de(),n.schedule(t,e,r)),t},{}),le=ie.reduce((t,e)=>(t[e]=ae[e].cancel,t),{});ie.reduce((t,e)=>(t[e]=()=>ae[e].process(se),t),{});const ce=t=>ae[t].process(se),pe=t=>{re=!1,se.delta=ne?1/60*1e3:Math.max(Math.min(t-se.timestamp,40),1),se.timestamp=t,oe=!0,ie.forEach(ce),oe=!1,re&&(ne=!1,ee(pe))},de=()=>{re=!0,ne=!0,oe||ee(pe)},he=()=>se;function fe(t,e,n=0){return t-e-n}const me=t=>{const e=({delta:e})=>t(e);return{start:()=>ue.update(e,!0),stop:()=>le.update(e)}};function ve(t){var e,n,{from:r,autoplay:o=!0,driver:s=me,elapsed:i=0,repeat:a=0,repeatType:u="loop",repeatDelay:l=0,onPlay:c,onStop:p,onComplete:d,onRepeat:h,onUpdate:f}=t,m=at(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let v,g,y,{to:b}=m,w=0,V=m.duration,A=!1,S=!0;const M=function(t){if(Array.isArray(t.to))return _t;if(Qt[t.type])return Qt[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?_t:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?ft:_t}(m);(null===(n=(e=M).needsInterpolation)||void 0===n?void 0:n.call(e,r,b))&&(y=jt([0,100],[r,b],{clamp:!1}),r=0,b=100);const x=M(Object.assign(Object.assign({},m),{from:r,to:b}));function C(){w++,"reverse"===u?(S=w%2==0,i=function(t,e,n=0,r=!0){return r?fe(e+-t,e,n):e-(t-e)+n}(i,V,l,S)):(i=fe(i,V,l),"mirror"===u&&x.flipTarget()),A=!1,h&&h()}function E(t){if(S||(t=-t),i+=t,!A){const t=x.next(Math.max(0,i));g=t.value,y&&(g=y(g)),A=S?t.done:i<=0}null==f||f(g),A&&(0===w&&(null!=V||(V=i)),w<a?function(t,e,n,r){return r?t>=e+n:t<=-n}(i,V,l,S)&&C():(v.stop(),d&&d()))}return o&&(null==c||c(),v=s(E),v.start()),{stop:()=>{null==p||p(),v.stop()}}}function ge(t,e){return e?t*(1e3/e):0}const ye=(t,e)=>1-3*e+3*t,be=(t,e)=>3*e-6*t,we=t=>3*t,Ve=(t,e,n)=>((ye(e,n)*t+be(e,n))*t+we(e))*t,Ae=(t,e,n)=>3*ye(e,n)*t*t+2*be(e,n)*t+we(e);function Se(t,e,n,r){if(t===e&&n===r)return Bt;const o=new Float32Array(11);for(let e=0;e<11;++e)o[e]=Ve(.1*e,t,n);function s(e){let r=0,s=1;for(;10!==s&&o[s]<=e;++s)r+=.1;--s;const i=r+.1*((e-o[s])/(o[s+1]-o[s])),a=Ae(i,t,n);return a>=.001?function(t,e,n,r){for(let o=0;o<8;++o){const o=Ae(e,n,r);if(0===o)return e;e-=(Ve(e,n,r)-t)/o}return e}(e,i,t,n):0===a?i:function(t,e,n,r,o){let s,i,a=0;do{i=e+(n-e)/2,s=Ve(i,r,o)-t,s>0?n=i:e=i}while(Math.abs(s)>1e-7&&++a<10);return i}(e,r,r+.1,t,n)}return t=>0===t||1===t?t:Ve(s(t),e,r)}const Me=t=>1e3*t,xe={linear:Bt,easeIn:Nt,easeInOut:Ht,easeOut:Lt,circIn:zt,circInOut:Wt,circOut:qt,backIn:$t,backInOut:Yt,backOut:Kt,anticipate:Xt,bounceIn:Zt,bounceInOut:t=>t<.5?.5*(1-Gt(1-2*t)):.5*Gt(2*t-1)+.5,bounceOut:Gt},Ce=t=>{if(Array.isArray(t)){t.length;const[e,n,r,o]=t;return Se(e,n,r,o)}return"string"==typeof t?xe[t]:t},Ee=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!et.test(e)||e.startsWith("url("))),Te=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Oe=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Pe=()=>({type:"keyframes",ease:"linear",duration:.3}),Fe=t=>({type:"keyframes",duration:.8,values:t}),Ie={x:Te,y:Te,z:Te,rotate:Te,rotateX:Te,rotateY:Te,rotateZ:Te,scaleX:Oe,scaleY:Oe,scale:Oe,opacity:Pe,backgroundColor:Pe,color:Pe,default:Oe},je=(t,e)=>{let n;return n=m(e)?Fe:Ie[t]||Ie.default,{to:e,...n(e)}},ke={...v,color:Z,backgroundColor:Z,outlineColor:Z,fill:Z,stroke:Z,borderColor:Z,borderTopColor:Z,borderRightColor:Z,borderBottomColor:Z,borderLeftColor:Z,filter:st,WebkitFilter:st},Re=t=>ke[t];function De(t,e){var n;let r=Re(t);return r!==st&&(r=et),null===(n=r.getAnimatableNone)||void 0===n?void 0:n.call(r,e)}const Be=!1;function Ne({ease:t,times:e,yoyo:n,flip:r,loop:o,...s}){const i={...s};return e&&(i.offset=e),s.duration&&(i.duration=Me(s.duration)),s.repeatDelay&&(i.repeatDelay=Me(s.repeatDelay)),t&&(i.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(Ce):Ce(t)),"tween"===s.type&&(i.type="keyframes"),(n||o||r)&&(n?i.repeatType="reverse":o?i.repeatType="loop":r&&(i.repeatType="mirror"),i.repeat=o||n||r||s.repeat),"spring"!==s.type&&(i.type="keyframes"),i}function Ue(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:u,...l}){return!!Object.keys(l).length}(t)||(t={...t,...je(n,e.to)}),{...e,...Ne(t)}}function Le(t,e,n,r,o){const s=qe(r,t)||{};let i=void 0!==s.from?s.from:e.get();const a=Ee(t,n);"none"===i&&a&&"string"==typeof n?i=De(t,n):He(i)&&"string"==typeof n?i=ze(n):!Array.isArray(n)&&He(n)&&"string"==typeof i&&(n=ze(i));return Ee(t,i)&&a&&!1!==s.type?function(){const r={from:i,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?function({from:t=0,velocity:e=0,min:n,max:r,power:o=.8,timeConstant:s=750,bounceStiffness:i=500,bounceDamping:a=10,restDelta:u=1,modifyTarget:l,driver:c,onUpdate:p,onComplete:d,onStop:h}){let f;function m(t){return void 0!==n&&t<n||void 0!==r&&t>r}function v(t){return void 0===n?r:void 0===r||Math.abs(n-t)<Math.abs(r-t)?n:r}function g(t){null==f||f.stop(),f=ve(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==p||p(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:h}))}function y(t){g(Object.assign({type:"spring",stiffness:i,damping:a,restDelta:u},t))}if(m(t))y({from:t,velocity:e,to:v(t)});else{let r=o*e+t;void 0!==l&&(r=l(r));const i=v(r),a=i===n?-1:1;let c,p;const d=t=>{c=p,p=t,e=ge(t-c,he().delta),(1===a&&t>i||-1===a&&t<i)&&y({from:t,to:i,velocity:e})};g({type:"decay",from:t,velocity:e,timeConstant:s,power:o,restDelta:u,modifyTarget:l,onUpdate:m(r)?d:void 0})}return{stop:()=>null==f?void 0:f.stop()}}({...r,...s}):ve({...Ue(s,r,t),onUpdate:t=>{r.onUpdate(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{r.onComplete(),s.onComplete&&s.onComplete()}})}:function(){const t=g(n);return e.set(t),o(),s.onUpdate&&s.onUpdate(t),s.onComplete&&s.onComplete(),{stop:()=>{}}}}function He(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function ze(t){return"number"==typeof t?0:De("",t)}function qe(t,e){return t[e]||t.default||t}function We(t,e,n,r={}){return Be&&(r={type:!1}),e.start(o=>{let s;const i=Le(t,e,n,r,o),a=function(t,e){var n,r;return null!==(r=null!==(n=(qe(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==r?r:0}(r,t),u=()=>s=i();let l;return a?l=function(t,e){const n=performance.now(),r=({timestamp:o})=>{const s=o-n;s>=e&&(le.read(r),t(s-e))};return ue.read(r,!0),()=>le.read(r)}(u,Me(a)):u(),()=>{l&&l(),s&&s.stop()}})}const $e=t=>/^0[^.\s]+$/.test(t);class Ke{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(this.subscriptions,t)}notify(t,e,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Ye{constructor(t){var e;this.version="7.6.6",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Ke,this.velocityUpdateSubscribers=new Ke,this.renderSubscribers=new Ke,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:r}=he();this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,ue.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>ue.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ge(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Xe(t){return new Ye(t)}const Ge=t=>e=>e.test(t),Ze=[p,y,u,b,w,V,{test:t=>"auto"===t,parse:t=>t}],Je=t=>Ze.find(Ge(t)),_e=[...Ze,Z,et],Qe=t=>_e.find(Ge(t));function tn(t,e,n){const r=t.getProps();return A(r,e,void 0!==n?n:r.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function en(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Xe(n))}function nn(t,e){if(!e)return;return(e[t]||e.default||e).from}function rn(t){return Boolean(S(t)&&t.add)}function on(t,e,n={}){var r;const o=tn(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const i=o?()=>sn(t,o,n):()=>Promise.resolve(),a=(null===(r=t.variantChildren)||void 0===r?void 0:r.size)?(r=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:a}=s;return function(t,e,n=0,r=0,o=1,s){const i=[],a=(t.variantChildren.size-1)*r,u=1===o?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(an).forEach((t,r)=>{i.push(on(t,e,{...s,delay:n+u(r)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(i)}(t,e,o+r,i,a,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[t,e]="beforeChildren"===u?[i,a]:[a,i];return t().then(e)}return Promise.all([i(),a(n.delay)])}function sn(t,e,{delay:n=0,transitionOverride:r,type:o}={}){var s;let{transition:i=t.getDefaultTransition(),transitionEnd:a,...u}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");r&&(i=r);const c=[],p=o&&(null===(s=t.animationState)||void 0===s?void 0:s.getState()[o]);for(const e in u){const r=t.getValue(e),o=u[e];if(!r||void 0===o||p&&un(p,e))continue;let s={delay:n,...i};t.shouldReduceMotion&&M.has(e)&&(s={...s,type:!1,delay:0});let a=We(e,r,o,s);rn(l)&&(l.add(e),a=a.then(()=>l.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=tn(t,e);let{transitionEnd:r={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...r};for(const e in s){en(t,e,g(s[e]))}}(t,a)})}function an(t,e){return t.sortNodePosition(e)}function un({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}var ln;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(ln||(ln={}));const cn=[ln.Animate,ln.InView,ln.Focus,ln.Hover,ln.Tap,ln.Drag,ln.Exit],pn=[...cn].reverse(),dn=cn.length;function hn(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map(e=>on(t,e,n));r=Promise.all(o)}else if("string"==typeof e)r=on(t,e,n);else{const o="function"==typeof e?tn(t,e,n.custom):e;r=sn(t,o,n)}return r.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function fn(t){let e=hn(t);const n={[ln.Animate]:vn(!0),[ln.InView]:vn(),[ln.Hover]:vn(),[ln.Tap]:vn(),[ln.Drag]:vn(),[ln.Focus]:vn(),[ln.Exit]:vn()};let r=!0;const o=(e,n)=>{const r=tn(t,n);if(r){const{transition:t,transitionEnd:n,...o}=r;e={...e,...o,...n}}return e};function s(s,i){var a;const u=t.getProps(),l=t.getVariantContext(!0)||{},c=[],p=new Set;let d={},h=1/0;for(let e=0;e<dn;e++){const f=pn[e],v=n[f],g=null!==(a=u[f])&&void 0!==a?a:l[f],y=C(g),b=f===i?v.isActive:null;!1===b&&(h=e);let w=g===l[f]&&g!==u[f]&&y;if(w&&r&&t.manuallyAnimateOnMount&&(w=!1),v.protectedKeys={...d},!v.isActive&&null===b||!g&&!v.prevProp||x(g)||"boolean"==typeof g)continue;const V=mn(v.prevProp,g);let A=V||f===i&&v.isActive&&!w&&y||e>h&&y;const S=Array.isArray(g)?g:[g];let M=S.reduce(o,{});!1===b&&(M={});const{prevResolvedValues:E={}}=v,T={...E,...M},O=t=>{A=!0,p.delete(t),v.needsAnimating[t]=!0};for(const t in T){const e=M[t],n=E[t];d.hasOwnProperty(t)||(e!==n?m(e)&&m(n)?!it(e,n)||V?O(t):v.protectedKeys[t]=!0:void 0!==e?O(t):p.add(t):void 0!==e&&p.has(t)?O(t):v.protectedKeys[t]=!0)}v.prevProp=g,v.prevResolvedValues=M,v.isActive&&(d={...d,...M}),r&&t.blockInitialAnimation&&(A=!1),A&&!w&&c.push(...S.map(t=>({animation:t,options:{type:f,...s}})))}if(p.size){const e={};p.forEach(n=>{const r=t.getBaseTarget(n);void 0!==r&&(e[n]=r)}),c.push({animation:e})}let f=Boolean(c.length);return r&&!1===u.initial&&!t.manuallyAnimateOnMount&&(f=!1),r=!1,f?e(c):Promise.resolve()}return{animateChanges:s,setActive:function(e,r,o){var i;if(n[e].isActive===r)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)}),n[e].isActive=r;const a=s(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function mn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!it(e,t)}function vn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const gn=t=>e=>(t(e),null),yn={animation:gn(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=fn(t)),x(e)&&n(()=>e.subscribe(t),[e])}),exit:gn(r=>{const{custom:o,visualElement:s}=r,[i,a]=function(){const r=t(f);if(null===r)return[!0,null];const{isPresent:o,onExitComplete:s,register:i}=r,a=e();return n(()=>i(a),[]),!o&&s?[!1,()=>s&&s(a)]:[!0]}(),u=t(f);n(()=>{s.isPresent=i;const t=s.animationState&&s.animationState.setActive(ln.Exit,!i,{custom:u&&u.custom||o});t&&!i&&t.then(a)},[i])})};function bn(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function wn(t,e,r,o){n(()=>{const n=t.current;if(r&&n)return bn(n,e,r,o)},[t,e,r,o])}function Vn(t){return!!t.touches}const An={pageX:0,pageY:0};function Sn(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||An;return{x:n[e+"X"],y:n[e+"Y"]}}function Mn(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}const xn=(t,e=!1)=>{const n=e=>t(e,function(t,e="page"){return{point:Vn(t)?Sn(t,e):Mn(t,e)}}(e));return e?(r=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&r(t)}):n;var r},Cn={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},En={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Tn(t){return E&&null===window.onpointerdown?t:E&&null===window.ontouchstart?En[t]:E&&null===window.onmousedown?Cn[t]:t}function On(t,e,n,r){return bn(t,Tn(e),xn(n,"pointerdown"===e),r)}function Pn(t,e,n,r){return wn(t,Tn(e),n&&xn(n,"pointerdown"===e),r)}function Fn(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const In=Fn("dragHorizontal"),jn=Fn("dragVertical");function kn(){const t=function(t){let e=!1;if("y"===t)e=jn();else if("x"===t)e=In();else{const t=In(),n=jn();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}(!0);return!t||(t(),!1)}function Rn(t,e,n){return(r,o)=>{(function(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent})(r)&&!kn()&&(t.animationState&&t.animationState.setActive(ln.Hover,e),n&&n(r,o))}}const Dn=(t,e)=>!!e&&(t===e||Dn(t,e.parentElement));const Bn=("undefined"==typeof process||process.env,"production"),Nn=new Set;const Un=new WeakMap,Ln=new WeakMap,Hn=t=>{const e=Un.get(t.target);e&&e(t)},zn=t=>{t.forEach(Hn)};function qn(t,e,n){const r=function({root:t,...e}){const n=t||document;Ln.has(n)||Ln.set(n,{});const r=Ln.get(n),o=JSON.stringify(e);return r[o]||(r[o]=new IntersectionObserver(zn,{root:t,...e})),r[o]}(e);return Un.set(t,n),r.observe(t),()=>{Un.delete(t),r.unobserve(t)}}const Wn={some:0,all:1};function $n(t,e,r,{root:o,margin:s,amount:i="some",once:a}){n(()=>{if(!t||!r.current)return;const n={root:null==o?void 0:o.current,rootMargin:s,threshold:"number"==typeof i?i:Wn[i]};return qn(r.current,n,t=>{const{isIntersecting:n}=t;if(e.isInView===n)return;if(e.isInView=n,a&&!n&&e.hasEnteredView)return;n&&(e.hasEnteredView=!0),r.animationState&&r.animationState.setActive(ln.InView,n);const o=r.getProps(),s=n?o.onViewportEnter:o.onViewportLeave;s&&s(t)})},[t,o,s,i])}function Kn(t,e,r,{fallback:o=!0}){n(()=>{var n,s;t&&o&&("production"!==Bn&&(n="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||Nn.has(n)||(console.warn(n),s&&console.warn(s),Nn.add(n))),requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:t}=r.getProps();t&&t(null),r.animationState&&r.animationState.setActive(ln.InView,!0)}))},[t])}const Yn={inView:gn((function({visualElement:t,whileInView:e,onViewportEnter:n,onViewportLeave:o,viewport:s={}}){const i=r({hasEnteredView:!1,isInView:!1});let a=Boolean(e||n||o);s.once&&i.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?Kn:$n)(a,i.current,t,s)})),tap:gn((function({onTap:t,onTapStart:e,onTapCancel:o,whileTap:s,visualElement:i}){const a=t||e||o||s,u=r(!1),l=r(null),c={passive:!(e||t||o||m)};function p(){l.current&&l.current(),l.current=null}function d(){return p(),u.current=!1,i.animationState&&i.animationState.setActive(ln.Tap,!1),!kn()}function h(e,n){d()&&(Dn(i.current,e.target)?t&&t(e,n):o&&o(e,n))}function f(t,e){d()&&o&&o(t,e)}function m(t,n){p(),u.current||(u.current=!0,l.current=xt(On(window,"pointerup",h,c),On(window,"pointercancel",f,c)),i.animationState&&i.animationState.setActive(ln.Tap,!0),e&&e(t,n))}var v;Pn(i,"pointerdown",a?m:void 0,c),v=p,n(()=>()=>v(),[])})),focus:gn((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;wn(e,"focus",t?()=>{n&&n.setActive(ln.Focus,!0)}:void 0),wn(e,"blur",t?()=>{n&&n.setActive(ln.Focus,!1)}:void 0)})),hover:gn((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:r}){Pn(r,"pointerenter",t||n?Rn(r,!0,t):void 0,{passive:!t}),Pn(r,"pointerleave",e||n?Rn(r,!1,e):void 0,{passive:!e})}))};function Xn(t){return"string"==typeof t&&t.startsWith("var(--")}const Gn=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Zn(t,e,n=1){const[r,o]=function(t){const e=Gn.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]}(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);return s?s.trim():Xn(o)?Zn(o,e,n+1):o}const Jn=new Set(["width","height","top","left","right","bottom","x","y"]),_n=t=>Jn.has(t),Qn=(t,e)=>{t.set(e,!1),t.set(e)},tr=t=>t===p||t===y;var er;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(er||(er={}));const nr=(t,e)=>parseFloat(t.split(", ")[e]),rr=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return nr(o[1],e);{const e=r.match(/^matrix\((.+)\)$/);return e?nr(e[1],t):0}},or=new Set(["x","y","z"]),sr=T.filter(t=>!or.has(t));const ir={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:rr(4,13),y:rr(5,14)},ar=(t,e,n={},r={})=>{e={...e},r={...r};const o=Object.keys(e).filter(_n);let s=[],i=!1;const a=[];if(o.forEach(o=>{const u=t.getValue(o);if(!t.hasValue(o))return;let l=n[o],c=Je(l);const p=e[o];let d;if(m(p)){const t=p.length,e=null===p[0]?1:0;l=p[e],c=Je(l);for(let n=e;n<t;n++)d?Je(p[n]):d=Je(p[n])}else d=Je(p);if(c!==d)if(tr(c)&&tr(d)){const t=u.get();"string"==typeof t&&u.set(parseFloat(t)),"string"==typeof p?e[o]=parseFloat(p):Array.isArray(p)&&d===y&&(e[o]=p.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===l||0===p)?0===l?u.set(d.transform(l)):e[o]=c.transform(p):(i||(s=function(t){const e=[];return sr.forEach(n=>{const r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),i=!0),a.push(o),r[o]=void 0!==r[o]?r[o]:e[o],Qn(u,p))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const r=e.measureViewportBox(),o=e.current,s=getComputedStyle(o),{display:i}=s,a={};"none"===i&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=ir[t](r,s)}),e.render();const u=e.measureViewportBox();return n.forEach(n=>{const r=e.getValue(n);Qn(r,a[n]),t[n]=ir[n](u,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),E&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:r}}return{target:e,transitionEnd:r}};function ur(t,e,n,r){return(t=>Object.keys(t).some(_n))(e)?ar(t,e,n,r):{target:e,transitionEnd:r}}const lr=(t,e,n,r)=>{const o=function(t,{...e},n){const r=t.current;if(!(r instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!Xn(e))return;const n=Zn(e,r);n&&t.set(n)});for(const t in e){const o=e[t];if(!Xn(o))continue;const s=Zn(o,r);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,r);return ur(t,e=o.target,n,r=o.transitionEnd)},cr={current:null},pr={current:!1};const dr=Object.keys(O),hr=dr.length,fr=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const mr=["initial",...cn],vr=mr.length;class gr extends class{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,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.scheduleRender=()=>ue.render(this.render,!1,!0);const{latestValues:s,renderState:i}=r;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=i,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=o,this.isControllingVariants=P(e),this.isVariantNode=F(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...u}=this.scrapeMotionValuesFromProps(e);for(const t in u){const e=u[t];void 0!==s[t]&&S(e)&&(e.set(s[t],!1),rn(a)&&a.add(t))}if(e.values)for(const t in e.values){const n=e.values[t];void 0!==s[t]&&S(n)&&n.set(s[t])}}scrapeMotionValuesFromProps(t){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),pr.current||function(){if(pr.current=!0,E)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>cr.current=t.matches;t.addListener(e),e()}else cr.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||cr.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),le.update(this.notifyUpdate),le.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=e.onChange(e=>{this.latestValues[t]=e,this.props.onUpdate&&ue.update(this.notifyUpdate,!1,!0)}),r=e.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{n(),r()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,e,n,r,s,i){const a=[];for(let e=0;e<hr;e++){const n=dr[e],{isEnabled:r,Component:s}=O[n];r(t)&&s&&a.push(o(s,{key:n,...t,visualElement:this}))}if(!this.projection&&s){this.projection=new s(r,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:o,dragConstraints:a,layoutScroll:u}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(o)||a&&I(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:u})}return a}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,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}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let e=0;e<fr.length;e++){const n=fr[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=t["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(t,e,n){const{willChange:r}=e;for(const o in e){const s=e[o],i=n[o];if(S(s))t.addValue(o,s),rn(r)&&r.add(o);else if(S(i))t.addValue(o,Xe(s)),rn(r)&&r.remove(o);else if(i!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,Xe(void 0!==e?e:s))}}for(const r in n)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const r={};for(let t=0;t<vr;t++){const e=mr[t],n=this.props[e];(C(n)||!1===n)&&(r[e]=n)}return r}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===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=Xe(e),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(e=A(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,t);return void 0===o||S(o)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:o}on(t,e){return this.events[t]||(this.events[t]=new Ke),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:r},o){let s=function(t,e,n){var r;const o={};for(const s in t){const t=nn(s,e);o[s]=void 0!==t?t:null===(r=n.getValue(s))||void 0===r?void 0:r.get()}return o}(n,t||{},this);if(r&&(e&&(e=r(e)),n&&(n=r(n)),s&&(s=r(s))),o){!function(t,e,n){var r,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),i=s.length;if(i)for(let a=0;a<i;a++){const i=s[a],u=e[i];let l=null;Array.isArray(u)&&(l=u[0]),null===l&&(l=null!==(o=null!==(r=n[i])&&void 0!==r?r:t.readValue(i))&&void 0!==o?o:e[i]),null!=l&&("string"==typeof l&&(/^\-?\d*\.?\d+$/.test(l)||$e(l))?l=parseFloat(l):!Qe(l)&&et.test(u)&&(l=De(i,u)),t.addValue(i,Xe(l)),void 0===n[i]&&(n[i]=l),null!==l&&t.setBaseTarget(i,l))}}(this,n,s);const t=lr(this,n,s,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class yr extends gr{readValueFromInstance(t,e){if(M.has(e)){const t=Re(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),o=(j(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n,r){k(t,e,n,r.transformTemplate)}scrapeMotionValuesFromProps(t){return R(t)}renderInstance(t,e,n,r){D(t,e,n,r)}}class br extends gr{getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return M.has(e)?(null===(n=Re(e))||void 0===n?void 0:n.default)||0:(e=B.has(e)?e:N(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return U(t)}build(t,e,n,r){L(t,e,n,r.transformTemplate)}renderInstance(t,e,n,r){H(t,e,n,r)}}const wr={renderer:(t,e)=>z(t)?new br(e,{enableHardwareAcceleration:!1}):new yr(e,{enableHardwareAcceleration:!0}),...yn,...Yn};export{wr as domAnimation};
1
+ import{useContext as t,useId as e,useEffect as n,useRef as r,createElement as o}from"react";import{p as s,q as i,t as a,u,v as l,w as c,x as p,y as d,z as h,P as f,A as m,B as v,C as g,D as y,E as b,F as w,G as V,r as A,d as S,H as M,m as x,c as C,i as E,I as T,f as O,b as P,l as F,a as I,J as j,g as k,o as R,K as D,L as B,M as N,s as U,h as L,n as H,j as z}from"./size-rollup-dom-animation-assets.js";const q=(t,e)=>n=>Boolean(s(n)&&i.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),W=(t,e,n)=>r=>{if(!s(r))return r;const[o,i,u,l]=r.match(a);return{[t]:parseFloat(o),[e]:parseFloat(i),[n]:parseFloat(u),alpha:void 0!==l?parseFloat(l):1}},$={test:q("hsl","hue"),parse:W("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+u.transform(l(e))+", "+u.transform(l(n))+", "+l(c.transform(r))+")"},K=d(0,255),Y=Object.assign(Object.assign({},p),{transform:t=>Math.round(K(t))}),X={test:q("rgb","red"),parse:W("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Y.transform(t)+", "+Y.transform(e)+", "+Y.transform(n)+", "+l(c.transform(r))+")"};const G={test:q("#"),parse:function(t){let e="",n="",r="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),r=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),r=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,r+=r,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:X.transform},Z={test:t=>X.test(t)||G.test(t)||$.test(t),parse:t=>X.test(t)?X.parse(t):$.test(t)?$.parse(t):G.parse(t),transform:t=>s(t)?t:t.hasOwnProperty("red")?X.transform(t):$.transform(t)};function J(t){"number"==typeof t&&(t=""+t);const e=[];let n=0;const r=t.match(h);r&&(n=r.length,t=t.replace(h,"${c}"),e.push(...r.map(Z.parse)));const o=t.match(a);return o&&(t=t.replace(a,"${n}"),e.push(...o.map(p.parse))),{values:e,numColors:n,tokenised:t}}function _(t){return J(t).values}function Q(t){const{values:e,numColors:n,tokenised:r}=J(t),o=e.length;return t=>{let e=r;for(let r=0;r<o;r++)e=e.replace(r<n?"${c}":"${n}",r<n?Z.transform(t[r]):l(t[r]));return e}}const tt=t=>"number"==typeof t?0:t;const et={test:function(t){var e,n,r,o;return isNaN(t)&&s(t)&&(null!==(n=null===(e=t.match(a))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(o=null===(r=t.match(h))||void 0===r?void 0:r.length)&&void 0!==o?o:0)>0},parse:_,createTransformer:Q,getAnimatableNone:function(t){const e=_(t);return Q(t)(e.map(tt))}},nt=new Set(["brightness","contrast","saturate","opacity"]);function rt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(a)||[];if(!r)return t;const o=n.replace(r,"");let s=nt.has(e)?1:0;return r!==n&&(s*=100),e+"("+s+o+")"}const ot=/([a-z-]*)\(.*?\)/g,st=Object.assign(Object.assign({},et),{getAnimatableNone:t=>{const e=t.match(ot);return e?e.map(rt).join(" "):t}});function it(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function at(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}const ut=(t,e,n)=>Math.min(Math.max(n,t),e);function lt({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let o,s,i=1-e;i=ut(.05,1,i),t=ut(.01,10,t/1e3),i<1?(o=e=>{const r=e*i,o=r*t;return.001-(r-n)/ct(e,i)*Math.exp(-o)},s=e=>{const r=e*i*t,s=r*n+n,a=Math.pow(i,2)*Math.pow(e,2)*t,u=Math.exp(-r),l=ct(Math.pow(e,2),i);return(.001-o(e)>0?-1:1)*((s-a)*u)/l}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let r=n;for(let n=1;n<12;n++)r-=t(r)/e(r);return r}(o,s,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*r;return{stiffness:e,damping:2*i*Math.sqrt(r*e),duration:t}}}function ct(t,e){return t*Math.sqrt(1-e*e)}const pt=["duration","bounce"],dt=["stiffness","damping","mass"];function ht(t,e){return e.some(e=>void 0!==t[e])}function ft(t){var{from:e=0,to:n=1,restSpeed:r=2,restDelta:o}=t,s=at(t,["from","to","restSpeed","restDelta"]);const i={done:!1,value:e};let{stiffness:a,damping:u,mass:l,velocity:c,duration:p,isResolvedFromDuration:d}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!ht(t,dt)&&ht(t,pt)){const n=lt(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(s),h=mt,f=mt;function m(){const t=c?-c/1e3:0,r=n-e,s=u/(2*Math.sqrt(a*l)),i=Math.sqrt(a/l)/1e3;if(void 0===o&&(o=Math.min(Math.abs(n-e)/100,.4)),s<1){const e=ct(i,s);h=o=>{const a=Math.exp(-s*i*o);return n-a*((t+s*i*r)/e*Math.sin(e*o)+r*Math.cos(e*o))},f=n=>{const o=Math.exp(-s*i*n);return s*i*o*(Math.sin(e*n)*(t+s*i*r)/e+r*Math.cos(e*n))-o*(Math.cos(e*n)*(t+s*i*r)-e*r*Math.sin(e*n))}}else if(1===s)h=e=>n-Math.exp(-i*e)*(r+(t+i*r)*e);else{const e=i*Math.sqrt(s*s-1);h=o=>{const a=Math.exp(-s*i*o),u=Math.min(e*o,300);return n-a*((t+s*i*r)*Math.sinh(u)+e*r*Math.cosh(u))/e}}}return m(),{next:t=>{const e=h(t);if(d)i.done=t>=p;else{const s=1e3*f(t),a=Math.abs(s)<=r,u=Math.abs(n-e)<=o;i.done=a&&u}return i.value=i.done?n:e,i},flipTarget:()=>{c=-c,[e,n]=[n,e],m()}}}ft.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const mt=t=>0,vt=(t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r},gt=(t,e,n)=>-n*t+n*e+t;function yt(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 bt({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let o=0,s=0,i=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r;o=yt(a,r,t+1/3),s=yt(a,r,t),i=yt(a,r,t-1/3)}else o=s=i=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*i),alpha:r}}const wt=(t,e,n)=>{const r=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-r)+r))},Vt=[G,X,$],At=t=>Vt.find(e=>e.test(t)),St=(t,e)=>{let n=At(t),r=At(e),o=n.parse(t),s=r.parse(e);n===$&&(o=bt(o),n=X),r===$&&(s=bt(s),r=X);const i=Object.assign({},o);return t=>{for(const e in i)"alpha"!==e&&(i[e]=wt(o[e],s[e],t));return i.alpha=gt(o.alpha,s.alpha,t),n.transform(i)}},Mt=(t,e)=>n=>e(t(n)),xt=(...t)=>t.reduce(Mt);function Ct(t,e){return"number"==typeof t?n=>gt(t,e,n):Z.test(t)?St(t,e):Pt(t,e)}const Et=(t,e)=>{const n=[...t],r=n.length,o=t.map((t,n)=>Ct(t,e[n]));return t=>{for(let e=0;e<r;e++)n[e]=o[e](t);return n}},Tt=(t,e)=>{const n=Object.assign(Object.assign({},t),e),r={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(r[o]=Ct(t[o],e[o]));return t=>{for(const e in r)n[e]=r[e](t);return n}};function Ot(t){const e=et.parse(t),n=e.length;let r=0,o=0,s=0;for(let t=0;t<n;t++)r||"number"==typeof e[t]?r++:void 0!==e[t].hue?s++:o++;return{parsed:e,numNumbers:r,numRGB:o,numHSL:s}}const Pt=(t,e)=>{const n=et.createTransformer(e),r=Ot(t),o=Ot(e);return r.numHSL===o.numHSL&&r.numRGB===o.numRGB&&r.numNumbers>=o.numNumbers?xt(Et(r.parsed,o.parsed),n):n=>""+(n>0?e:t)},Ft=(t,e)=>n=>gt(t,e,n);function It(t,e,n){const r=[],o=n||("number"==typeof(s=t[0])?Ft:"string"==typeof s?Z.test(s)?St:Pt:Array.isArray(s)?Et:"object"==typeof s?Tt:void 0);var s;const i=t.length-1;for(let n=0;n<i;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;s=xt(t,s)}r.push(s)}return r}function jt(t,e,{clamp:n=!0,ease:r,mixer:o}={}){const s=t.length;e.length,!r||!Array.isArray(r)||r.length,t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const i=It(e,r,o),a=2===s?function([t,e],[n]){return r=>n(vt(t,e,r))}(t,i):function(t,e){const n=t.length,r=n-1;return o=>{let s=0,i=!1;if(o<=t[0]?i=!0:o>=t[r]&&(s=r-1,i=!0),!i){let e=1;for(;e<n&&!(t[e]>o||e===r);e++);s=e-1}const a=vt(t[s],t[s+1],o);return e[s](a)}}(t,i);return n?e=>a(ut(t[0],t[s-1],e)):a}const kt=t=>e=>1-t(1-e),Rt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Dt=t=>e=>e*e*((t+1)*e-t),Bt=t=>t,Nt=(Ut=2,t=>Math.pow(t,Ut));var Ut;const Lt=kt(Nt),Ht=Rt(Nt),zt=t=>1-Math.sin(Math.acos(t)),qt=kt(zt),Wt=Rt(qt),$t=Dt(1.525),Kt=kt($t),Yt=Rt($t),Xt=(t=>{const e=Dt(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),Gt=t=>{if(1===t||0===t)return t;const e=t*t;return t<4/11?7.5625*e:t<8/11?9.075*e-9.9*t+3.4:t<.9?4356/361*e-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72},Zt=kt(Gt);function Jt(t,e){return t.map(()=>e||Ht).splice(0,t.length-1)}function _t({from:t=0,to:e=1,ease:n,offset:r,duration:o=300}){const s={done:!1,value:t},i=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map(t=>t*e)}(r&&r.length===i.length?r:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(i),o);function u(){return jt(a,i,{ease:Array.isArray(n)?n:Jt(i,n)})}let l=u();return{next:t=>(s.value=l(t),s.done=t>=o,s),flipTarget:()=>{i.reverse(),l=u()}}}const Qt={keyframes:_t,spring:ft,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:r=350,restDelta:o=.5,modifyTarget:s}){const i={done:!1,value:e};let a=n*t;const u=e+a,l=void 0===s?u:s(u);return l!==u&&(a=l-e),{next:t=>{const e=-a*Math.exp(-t/r);return i.done=!(e>o||e<-o),i.value=i.done?l:l+e,i},flipTarget:()=>{}}}};const te="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),ee="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(te()),1/60*1e3);let ne=!0,re=!1,oe=!1;const se={delta:0,timestamp:0},ie=["read","update","preRender","render","postRender"],ae=ie.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],r=0,o=!1,s=!1;const i=new WeakSet,a={schedule:(t,s=!1,a=!1)=>{const u=a&&o,l=u?e:n;return s&&i.add(t),-1===l.indexOf(t)&&(l.push(t),u&&o&&(r=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),i.delete(t)},process:u=>{if(o)s=!0;else{if(o=!0,[e,n]=[n,e],n.length=0,r=e.length,r)for(let n=0;n<r;n++){const r=e[n];r(u),i.has(r)&&(a.schedule(r),t())}o=!1,s&&(s=!1,a.process(u))}}};return a}(()=>re=!0),t),{}),ue=ie.reduce((t,e)=>{const n=ae[e];return t[e]=(t,e=!1,r=!1)=>(re||de(),n.schedule(t,e,r)),t},{}),le=ie.reduce((t,e)=>(t[e]=ae[e].cancel,t),{});ie.reduce((t,e)=>(t[e]=()=>ae[e].process(se),t),{});const ce=t=>ae[t].process(se),pe=t=>{re=!1,se.delta=ne?1/60*1e3:Math.max(Math.min(t-se.timestamp,40),1),se.timestamp=t,oe=!0,ie.forEach(ce),oe=!1,re&&(ne=!1,ee(pe))},de=()=>{re=!0,ne=!0,oe||ee(pe)},he=()=>se;function fe(t,e,n=0){return t-e-n}const me=t=>{const e=({delta:e})=>t(e);return{start:()=>ue.update(e,!0),stop:()=>le.update(e)}};function ve(t){var e,n,{from:r,autoplay:o=!0,driver:s=me,elapsed:i=0,repeat:a=0,repeatType:u="loop",repeatDelay:l=0,onPlay:c,onStop:p,onComplete:d,onRepeat:h,onUpdate:f}=t,m=at(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let v,g,y,{to:b}=m,w=0,V=m.duration,A=!1,S=!0;const M=function(t){if(Array.isArray(t.to))return _t;if(Qt[t.type])return Qt[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?_t:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?ft:_t}(m);(null===(n=(e=M).needsInterpolation)||void 0===n?void 0:n.call(e,r,b))&&(y=jt([0,100],[r,b],{clamp:!1}),r=0,b=100);const x=M(Object.assign(Object.assign({},m),{from:r,to:b}));function C(){w++,"reverse"===u?(S=w%2==0,i=function(t,e,n=0,r=!0){return r?fe(e+-t,e,n):e-(t-e)+n}(i,V,l,S)):(i=fe(i,V,l),"mirror"===u&&x.flipTarget()),A=!1,h&&h()}function E(t){if(S||(t=-t),i+=t,!A){const t=x.next(Math.max(0,i));g=t.value,y&&(g=y(g)),A=S?t.done:i<=0}null==f||f(g),A&&(0===w&&(null!=V||(V=i)),w<a?function(t,e,n,r){return r?t>=e+n:t<=-n}(i,V,l,S)&&C():(v.stop(),d&&d()))}return o&&(null==c||c(),v=s(E),v.start()),{stop:()=>{null==p||p(),v.stop()}}}function ge(t,e){return e?t*(1e3/e):0}const ye=(t,e)=>1-3*e+3*t,be=(t,e)=>3*e-6*t,we=t=>3*t,Ve=(t,e,n)=>((ye(e,n)*t+be(e,n))*t+we(e))*t,Ae=(t,e,n)=>3*ye(e,n)*t*t+2*be(e,n)*t+we(e);function Se(t,e,n,r){if(t===e&&n===r)return Bt;const o=new Float32Array(11);for(let e=0;e<11;++e)o[e]=Ve(.1*e,t,n);function s(e){let r=0,s=1;for(;10!==s&&o[s]<=e;++s)r+=.1;--s;const i=r+.1*((e-o[s])/(o[s+1]-o[s])),a=Ae(i,t,n);return a>=.001?function(t,e,n,r){for(let o=0;o<8;++o){const o=Ae(e,n,r);if(0===o)return e;e-=(Ve(e,n,r)-t)/o}return e}(e,i,t,n):0===a?i:function(t,e,n,r,o){let s,i,a=0;do{i=e+(n-e)/2,s=Ve(i,r,o)-t,s>0?n=i:e=i}while(Math.abs(s)>1e-7&&++a<10);return i}(e,r,r+.1,t,n)}return t=>0===t||1===t?t:Ve(s(t),e,r)}const Me=t=>1e3*t,xe={linear:Bt,easeIn:Nt,easeInOut:Ht,easeOut:Lt,circIn:zt,circInOut:Wt,circOut:qt,backIn:$t,backInOut:Yt,backOut:Kt,anticipate:Xt,bounceIn:Zt,bounceInOut:t=>t<.5?.5*(1-Gt(1-2*t)):.5*Gt(2*t-1)+.5,bounceOut:Gt},Ce=t=>{if(Array.isArray(t)){t.length;const[e,n,r,o]=t;return Se(e,n,r,o)}return"string"==typeof t?xe[t]:t},Ee=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!et.test(e)||e.startsWith("url("))),Te=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Oe=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Pe=()=>({type:"keyframes",ease:"linear",duration:.3}),Fe=t=>({type:"keyframes",duration:.8,values:t}),Ie={x:Te,y:Te,z:Te,rotate:Te,rotateX:Te,rotateY:Te,rotateZ:Te,scaleX:Oe,scaleY:Oe,scale:Oe,opacity:Pe,backgroundColor:Pe,color:Pe,default:Oe},je=(t,e)=>{let n;return n=m(e)?Fe:Ie[t]||Ie.default,{to:e,...n(e)}},ke={...v,color:Z,backgroundColor:Z,outlineColor:Z,fill:Z,stroke:Z,borderColor:Z,borderTopColor:Z,borderRightColor:Z,borderBottomColor:Z,borderLeftColor:Z,filter:st,WebkitFilter:st},Re=t=>ke[t];function De(t,e){var n;let r=Re(t);return r!==st&&(r=et),null===(n=r.getAnimatableNone)||void 0===n?void 0:n.call(r,e)}const Be=!1;function Ne({ease:t,times:e,yoyo:n,flip:r,loop:o,...s}){const i={...s};return e&&(i.offset=e),s.duration&&(i.duration=Me(s.duration)),s.repeatDelay&&(i.repeatDelay=Me(s.repeatDelay)),t&&(i.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(Ce):Ce(t)),"tween"===s.type&&(i.type="keyframes"),(n||o||r)&&(n?i.repeatType="reverse":o?i.repeatType="loop":r&&(i.repeatType="mirror"),i.repeat=o||n||r||s.repeat),"spring"!==s.type&&(i.type="keyframes"),i}function Ue(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:s,repeatType:i,repeatDelay:a,from:u,...l}){return!!Object.keys(l).length}(t)||(t={...t,...je(n,e.to)}),{...e,...Ne(t)}}function Le(t,e,n,r,o){const s=qe(r,t)||{};let i=void 0!==s.from?s.from:e.get();const a=Ee(t,n);"none"===i&&a&&"string"==typeof n?i=De(t,n):He(i)&&"string"==typeof n?i=ze(n):!Array.isArray(n)&&He(n)&&"string"==typeof i&&(n=ze(i));return Ee(t,i)&&a&&!1!==s.type?function(){const r={from:i,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:t=>e.set(t)};return"inertia"===s.type||"decay"===s.type?function({from:t=0,velocity:e=0,min:n,max:r,power:o=.8,timeConstant:s=750,bounceStiffness:i=500,bounceDamping:a=10,restDelta:u=1,modifyTarget:l,driver:c,onUpdate:p,onComplete:d,onStop:h}){let f;function m(t){return void 0!==n&&t<n||void 0!==r&&t>r}function v(t){return void 0===n?r:void 0===r||Math.abs(n-t)<Math.abs(r-t)?n:r}function g(t){null==f||f.stop(),f=ve(Object.assign(Object.assign({},t),{driver:c,onUpdate:e=>{var n;null==p||p(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:h}))}function y(t){g(Object.assign({type:"spring",stiffness:i,damping:a,restDelta:u},t))}if(m(t))y({from:t,velocity:e,to:v(t)});else{let r=o*e+t;void 0!==l&&(r=l(r));const i=v(r),a=i===n?-1:1;let c,p;const d=t=>{c=p,p=t,e=ge(t-c,he().delta),(1===a&&t>i||-1===a&&t<i)&&y({from:t,to:i,velocity:e})};g({type:"decay",from:t,velocity:e,timeConstant:s,power:o,restDelta:u,modifyTarget:l,onUpdate:m(r)?d:void 0})}return{stop:()=>null==f?void 0:f.stop()}}({...r,...s}):ve({...Ue(s,r,t),onUpdate:t=>{r.onUpdate(t),s.onUpdate&&s.onUpdate(t)},onComplete:()=>{r.onComplete(),s.onComplete&&s.onComplete()}})}:function(){const t=g(n);return e.set(t),o(),s.onUpdate&&s.onUpdate(t),s.onComplete&&s.onComplete(),{stop:()=>{}}}}function He(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function ze(t){return"number"==typeof t?0:De("",t)}function qe(t,e){return t[e]||t.default||t}function We(t,e,n,r={}){return Be&&(r={type:!1}),e.start(o=>{let s;const i=Le(t,e,n,r,o),a=function(t,e){var n,r;return null!==(r=null!==(n=(qe(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==r?r:0}(r,t),u=()=>s=i();let l;return a?l=function(t,e){const n=performance.now(),r=({timestamp:o})=>{const s=o-n;s>=e&&(le.read(r),t(s-e))};return ue.read(r,!0),()=>le.read(r)}(u,Me(a)):u(),()=>{l&&l(),s&&s.stop()}})}const $e=t=>/^0[^.\s]+$/.test(t);class Ke{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(this.subscriptions,t)}notify(t,e,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Ye{constructor(t){var e;this.version="7.6.8",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Ke,this.velocityUpdateSubscribers=new Ke,this.renderSubscribers=new Ke,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:r}=he();this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,ue.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>ue.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ge(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.stopAnimation=t(e)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Xe(t){return new Ye(t)}const Ge=t=>e=>e.test(t),Ze=[p,y,u,b,w,V,{test:t=>"auto"===t,parse:t=>t}],Je=t=>Ze.find(Ge(t)),_e=[...Ze,Z,et],Qe=t=>_e.find(Ge(t));function tn(t,e,n){const r=t.getProps();return A(r,e,void 0!==n?n:r.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function en(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Xe(n))}function nn(t,e){if(!e)return;return(e[t]||e.default||e).from}function rn(t){return Boolean(S(t)&&t.add)}function on(t,e,n={}){var r;const o=tn(t,e,n.custom);let{transition:s=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(s=n.transitionOverride);const i=o?()=>sn(t,o,n):()=>Promise.resolve(),a=(null===(r=t.variantChildren)||void 0===r?void 0:r.size)?(r=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:a}=s;return function(t,e,n=0,r=0,o=1,s){const i=[],a=(t.variantChildren.size-1)*r,u=1===o?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(an).forEach((t,r)=>{i.push(on(t,e,{...s,delay:n+u(r)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(i)}(t,e,o+r,i,a,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[t,e]="beforeChildren"===u?[i,a]:[a,i];return t().then(e)}return Promise.all([i(),a(n.delay)])}function sn(t,e,{delay:n=0,transitionOverride:r,type:o}={}){var s;let{transition:i=t.getDefaultTransition(),transitionEnd:a,...u}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");r&&(i=r);const c=[],p=o&&(null===(s=t.animationState)||void 0===s?void 0:s.getState()[o]);for(const e in u){const r=t.getValue(e),o=u[e];if(!r||void 0===o||p&&un(p,e))continue;let s={delay:n,...i};t.shouldReduceMotion&&M.has(e)&&(s={...s,type:!1,delay:0});let a=We(e,r,o,s);rn(l)&&(l.add(e),a=a.then(()=>l.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=tn(t,e);let{transitionEnd:r={},transition:o={},...s}=n?t.makeTargetAnimatable(n,!1):{};s={...s,...r};for(const e in s){en(t,e,g(s[e]))}}(t,a)})}function an(t,e){return t.sortNodePosition(e)}function un({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}var ln;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(ln||(ln={}));const cn=[ln.Animate,ln.InView,ln.Focus,ln.Hover,ln.Tap,ln.Drag,ln.Exit],pn=[...cn].reverse(),dn=cn.length;function hn(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map(e=>on(t,e,n));r=Promise.all(o)}else if("string"==typeof e)r=on(t,e,n);else{const o="function"==typeof e?tn(t,e,n.custom):e;r=sn(t,o,n)}return r.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function fn(t){let e=hn(t);const n={[ln.Animate]:vn(!0),[ln.InView]:vn(),[ln.Hover]:vn(),[ln.Tap]:vn(),[ln.Drag]:vn(),[ln.Focus]:vn(),[ln.Exit]:vn()};let r=!0;const o=(e,n)=>{const r=tn(t,n);if(r){const{transition:t,transitionEnd:n,...o}=r;e={...e,...o,...n}}return e};function s(s,i){var a;const u=t.getProps(),l=t.getVariantContext(!0)||{},c=[],p=new Set;let d={},h=1/0;for(let e=0;e<dn;e++){const f=pn[e],v=n[f],g=null!==(a=u[f])&&void 0!==a?a:l[f],y=C(g),b=f===i?v.isActive:null;!1===b&&(h=e);let w=g===l[f]&&g!==u[f]&&y;if(w&&r&&t.manuallyAnimateOnMount&&(w=!1),v.protectedKeys={...d},!v.isActive&&null===b||!g&&!v.prevProp||x(g)||"boolean"==typeof g)continue;const V=mn(v.prevProp,g);let A=V||f===i&&v.isActive&&!w&&y||e>h&&y;const S=Array.isArray(g)?g:[g];let M=S.reduce(o,{});!1===b&&(M={});const{prevResolvedValues:E={}}=v,T={...E,...M},O=t=>{A=!0,p.delete(t),v.needsAnimating[t]=!0};for(const t in T){const e=M[t],n=E[t];d.hasOwnProperty(t)||(e!==n?m(e)&&m(n)?!it(e,n)||V?O(t):v.protectedKeys[t]=!0:void 0!==e?O(t):p.add(t):void 0!==e&&p.has(t)?O(t):v.protectedKeys[t]=!0)}v.prevProp=g,v.prevResolvedValues=M,v.isActive&&(d={...d,...M}),r&&t.blockInitialAnimation&&(A=!1),A&&!w&&c.push(...S.map(t=>({animation:t,options:{type:f,...s}})))}if(p.size){const e={};p.forEach(n=>{const r=t.getBaseTarget(n);void 0!==r&&(e[n]=r)}),c.push({animation:e})}let f=Boolean(c.length);return r&&!1===u.initial&&!t.manuallyAnimateOnMount&&(f=!1),r=!1,f?e(c):Promise.resolve()}return{animateChanges:s,setActive:function(e,r,o){var i;if(n[e].isActive===r)return Promise.resolve();null===(i=t.variantChildren)||void 0===i||i.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)}),n[e].isActive=r;const a=s(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function mn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!it(e,t)}function vn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const gn=t=>e=>(t(e),null),yn={animation:gn(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=fn(t)),x(e)&&n(()=>e.subscribe(t),[e])}),exit:gn(r=>{const{custom:o,visualElement:s}=r,[i,a]=function(){const r=t(f);if(null===r)return[!0,null];const{isPresent:o,onExitComplete:s,register:i}=r,a=e();return n(()=>i(a),[]),!o&&s?[!1,()=>s&&s(a)]:[!0]}(),u=t(f);n(()=>{s.isPresent=i;const t=s.animationState&&s.animationState.setActive(ln.Exit,!i,{custom:u&&u.custom||o});t&&!i&&t.then(a)},[i])})};function bn(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function wn(t,e,r,o){n(()=>{const n=t.current;if(r&&n)return bn(n,e,r,o)},[t,e,r,o])}function Vn(t){return!!t.touches}const An={pageX:0,pageY:0};function Sn(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||An;return{x:n[e+"X"],y:n[e+"Y"]}}function Mn(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}const xn=(t,e=!1)=>{const n=e=>t(e,function(t,e="page"){return{point:Vn(t)?Sn(t,e):Mn(t,e)}}(e));return e?(r=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&r(t)}):n;var r},Cn={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},En={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Tn(t){return E&&null===window.onpointerdown?t:E&&null===window.ontouchstart?En[t]:E&&null===window.onmousedown?Cn[t]:t}function On(t,e,n,r){return bn(t,Tn(e),xn(n,"pointerdown"===e),r)}function Pn(t,e,n,r){return wn(t,Tn(e),n&&xn(n,"pointerdown"===e),r)}function Fn(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const In=Fn("dragHorizontal"),jn=Fn("dragVertical");function kn(){const t=function(t){let e=!1;if("y"===t)e=jn();else if("x"===t)e=In();else{const t=In(),n=jn();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}(!0);return!t||(t(),!1)}function Rn(t,e,n){return(r,o)=>{(function(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent})(r)&&!kn()&&(t.animationState&&t.animationState.setActive(ln.Hover,e),n&&n(r,o))}}const Dn=(t,e)=>!!e&&(t===e||Dn(t,e.parentElement));const Bn=("undefined"==typeof process||process.env,"production"),Nn=new Set;const Un=new WeakMap,Ln=new WeakMap,Hn=t=>{const e=Un.get(t.target);e&&e(t)},zn=t=>{t.forEach(Hn)};function qn(t,e,n){const r=function({root:t,...e}){const n=t||document;Ln.has(n)||Ln.set(n,{});const r=Ln.get(n),o=JSON.stringify(e);return r[o]||(r[o]=new IntersectionObserver(zn,{root:t,...e})),r[o]}(e);return Un.set(t,n),r.observe(t),()=>{Un.delete(t),r.unobserve(t)}}const Wn={some:0,all:1};function $n(t,e,r,{root:o,margin:s,amount:i="some",once:a}){n(()=>{if(!t||!r.current)return;const n={root:null==o?void 0:o.current,rootMargin:s,threshold:"number"==typeof i?i:Wn[i]};return qn(r.current,n,t=>{const{isIntersecting:n}=t;if(e.isInView===n)return;if(e.isInView=n,a&&!n&&e.hasEnteredView)return;n&&(e.hasEnteredView=!0),r.animationState&&r.animationState.setActive(ln.InView,n);const o=r.getProps(),s=n?o.onViewportEnter:o.onViewportLeave;s&&s(t)})},[t,o,s,i])}function Kn(t,e,r,{fallback:o=!0}){n(()=>{var n,s;t&&o&&("production"!==Bn&&(n="IntersectionObserver not available on this device. whileInView animations will trigger on mount.",!1||Nn.has(n)||(console.warn(n),s&&console.warn(s),Nn.add(n))),requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:t}=r.getProps();t&&t(null),r.animationState&&r.animationState.setActive(ln.InView,!0)}))},[t])}const Yn={inView:gn((function({visualElement:t,whileInView:e,onViewportEnter:n,onViewportLeave:o,viewport:s={}}){const i=r({hasEnteredView:!1,isInView:!1});let a=Boolean(e||n||o);s.once&&i.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?Kn:$n)(a,i.current,t,s)})),tap:gn((function({onTap:t,onTapStart:e,onTapCancel:o,whileTap:s,visualElement:i}){const a=t||e||o||s,u=r(!1),l=r(null),c={passive:!(e||t||o||m)};function p(){l.current&&l.current(),l.current=null}function d(){return p(),u.current=!1,i.animationState&&i.animationState.setActive(ln.Tap,!1),!kn()}function h(e,n){d()&&(Dn(i.current,e.target)?t&&t(e,n):o&&o(e,n))}function f(t,e){d()&&o&&o(t,e)}function m(t,n){p(),u.current||(u.current=!0,l.current=xt(On(window,"pointerup",h,c),On(window,"pointercancel",f,c)),i.animationState&&i.animationState.setActive(ln.Tap,!0),e&&e(t,n))}var v;Pn(i,"pointerdown",a?m:void 0,c),v=p,n(()=>()=>v(),[])})),focus:gn((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;wn(e,"focus",t?()=>{n&&n.setActive(ln.Focus,!0)}:void 0),wn(e,"blur",t?()=>{n&&n.setActive(ln.Focus,!1)}:void 0)})),hover:gn((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:r}){Pn(r,"pointerenter",t||n?Rn(r,!0,t):void 0,{passive:!t}),Pn(r,"pointerleave",e||n?Rn(r,!1,e):void 0,{passive:!e})}))};function Xn(t){return"string"==typeof t&&t.startsWith("var(--")}const Gn=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Zn(t,e,n=1){const[r,o]=function(t){const e=Gn.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]}(t);if(!r)return;const s=window.getComputedStyle(e).getPropertyValue(r);return s?s.trim():Xn(o)?Zn(o,e,n+1):o}const Jn=new Set(["width","height","top","left","right","bottom","x","y"]),_n=t=>Jn.has(t),Qn=(t,e)=>{t.set(e,!1),t.set(e)},tr=t=>t===p||t===y;var er;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(er||(er={}));const nr=(t,e)=>parseFloat(t.split(", ")[e]),rr=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return nr(o[1],e);{const e=r.match(/^matrix\((.+)\)$/);return e?nr(e[1],t):0}},or=new Set(["x","y","z"]),sr=T.filter(t=>!or.has(t));const ir={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:rr(4,13),y:rr(5,14)},ar=(t,e,n={},r={})=>{e={...e},r={...r};const o=Object.keys(e).filter(_n);let s=[],i=!1;const a=[];if(o.forEach(o=>{const u=t.getValue(o);if(!t.hasValue(o))return;let l=n[o],c=Je(l);const p=e[o];let d;if(m(p)){const t=p.length,e=null===p[0]?1:0;l=p[e],c=Je(l);for(let n=e;n<t;n++)d?Je(p[n]):d=Je(p[n])}else d=Je(p);if(c!==d)if(tr(c)&&tr(d)){const t=u.get();"string"==typeof t&&u.set(parseFloat(t)),"string"==typeof p?e[o]=parseFloat(p):Array.isArray(p)&&d===y&&(e[o]=p.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===l||0===p)?0===l?u.set(d.transform(l)):e[o]=c.transform(p):(i||(s=function(t){const e=[];return sr.forEach(n=>{const r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),i=!0),a.push(o),r[o]=void 0!==r[o]?r[o]:e[o],Qn(u,p))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const r=e.measureViewportBox(),o=e.current,s=getComputedStyle(o),{display:i}=s,a={};"none"===i&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=ir[t](r,s)}),e.render();const u=e.measureViewportBox();return n.forEach(n=>{const r=e.getValue(n);Qn(r,a[n]),t[n]=ir[n](u,s)}),t})(e,t,a);return s.length&&s.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),E&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:r}}return{target:e,transitionEnd:r}};function ur(t,e,n,r){return(t=>Object.keys(t).some(_n))(e)?ar(t,e,n,r):{target:e,transitionEnd:r}}const lr=(t,e,n,r)=>{const o=function(t,{...e},n){const r=t.current;if(!(r instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!Xn(e))return;const n=Zn(e,r);n&&t.set(n)});for(const t in e){const o=e[t];if(!Xn(o))continue;const s=Zn(o,r);s&&(e[t]=s,n&&void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,r);return ur(t,e=o.target,n,r=o.transitionEnd)},cr={current:null},pr={current:!1};const dr=Object.keys(O),hr=dr.length,fr=["AnimationStart","AnimationComplete","Update","Unmount","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const mr=["initial",...cn],vr=mr.length;class gr extends class{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,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.scheduleRender=()=>ue.render(this.render,!1,!0);const{latestValues:s,renderState:i}=r;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=i,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=o,this.isControllingVariants=P(e),this.isVariantNode=F(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...u}=this.scrapeMotionValuesFromProps(e);for(const t in u){const e=u[t];void 0!==s[t]&&S(e)&&(e.set(s[t],!1),rn(a)&&a.add(t))}}scrapeMotionValuesFromProps(t){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),pr.current||function(){if(pr.current=!0,E)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>cr.current=t.matches;t.addListener(e),e()}else cr.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||cr.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),le.update(this.notifyUpdate),le.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=e.onChange(e=>{this.latestValues[t]=e,this.props.onUpdate&&ue.update(this.notifyUpdate,!1,!0)}),r=e.onRenderRequest(this.scheduleRender);this.valueSubscriptions.set(t,()=>{n(),r()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures(t,e,n,r,s,i){const a=[];for(let e=0;e<hr;e++){const n=dr[e],{isEnabled:r,Component:s}=O[n];r(t)&&s&&a.push(o(s,{key:n,...t,visualElement:this}))}if(!this.projection&&s){this.projection=new s(r,this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:o,dragConstraints:a,layoutScroll:u}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(o)||a&&I(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:u})}return a}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,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}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.props=t;for(let e=0;e<fr.length;e++){const n=fr[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=t["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(t,e,n){const{willChange:r}=e;for(const o in e){const s=e[o],i=n[o];if(S(s))t.addValue(o,s),rn(r)&&r.add(o);else if(S(i))t.addValue(o,Xe(s)),rn(r)&&r.remove(o);else if(i!==s)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(s)}else{const e=t.getStaticValue(o);t.addValue(o,Xe(void 0!==e?e:s))}}for(const r in n)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t),this.prevMotionValues)}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const r={};for(let t=0;t<vr;t++){const e=mr[t],n=this.props[e];(C(n)||!1===n)&&(r[e]=n)}return r}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){this.hasValue(t)&&this.removeValue(t),this.values.set(t,e),this.latestValues[t]=e.get(),this.bindToMotionValue(t,e)}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===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=Xe(e),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(e=A(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,t);return void 0===o||S(o)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:o}on(t,e){return this.events[t]||(this.events[t]=new Ke),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:r},o){let s=function(t,e,n){var r;const o={};for(const s in t){const t=nn(s,e);o[s]=void 0!==t?t:null===(r=n.getValue(s))||void 0===r?void 0:r.get()}return o}(n,t||{},this);if(r&&(e&&(e=r(e)),n&&(n=r(n)),s&&(s=r(s))),o){!function(t,e,n){var r,o;const s=Object.keys(e).filter(e=>!t.hasValue(e)),i=s.length;if(i)for(let a=0;a<i;a++){const i=s[a],u=e[i];let l=null;Array.isArray(u)&&(l=u[0]),null===l&&(l=null!==(o=null!==(r=n[i])&&void 0!==r?r:t.readValue(i))&&void 0!==o?o:e[i]),null!=l&&("string"==typeof l&&(/^\-?\d*\.?\d+$/.test(l)||$e(l))?l=parseFloat(l):!Qe(l)&&et.test(u)&&(l=De(i,u)),t.addValue(i,Xe(l)),void 0===n[i]&&(n[i]=l),null!==l&&t.setBaseTarget(i,l))}}(this,n,s);const t=lr(this,n,s,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class yr extends gr{readValueFromInstance(t,e){if(M.has(e)){const t=Re(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),o=(j(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n,r){k(t,e,n,r.transformTemplate)}scrapeMotionValuesFromProps(t){return R(t)}renderInstance(t,e,n,r){D(t,e,n,r)}}class br extends gr{getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return M.has(e)?(null===(n=Re(e))||void 0===n?void 0:n.default)||0:(e=B.has(e)?e:N(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t){return U(t)}build(t,e,n,r){L(t,e,n,r.transformTemplate)}renderInstance(t,e,n,r){H(t,e,n,r)}}const wr={renderer:(t,e)=>z(t)?new br(e,{enableHardwareAcceleration:!1}):new yr(e,{enableHardwareAcceleration:!0}),...yn,...Yn};export{wr as domAnimation};