framer-motion 7.6.5 → 7.6.7

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,19 +1333,15 @@ declare class FlatTree {
1333
1333
  forEach(callback: (child: WithDepth) => void): void;
1334
1334
  }
1335
1335
 
1336
- interface Snapshot {
1337
- measured: Box;
1338
- layout: Box;
1336
+ interface Measurements {
1337
+ measuredBox: Box;
1338
+ layoutBox: Box;
1339
1339
  latestValues: ResolvedValues;
1340
1340
  isShared?: boolean;
1341
1341
  }
1342
- interface Layout {
1343
- measured: Box;
1344
- actual: Box;
1345
- }
1346
1342
  declare type LayoutEvents = "willUpdate" | "didUpdate" | "beforeMeasure" | "measure" | "projectionUpdate" | "animationStart" | "animationComplete";
1347
1343
  interface IProjectionNode<I = unknown> {
1348
- id: number | undefined;
1344
+ elementId: number | undefined;
1349
1345
  parent?: IProjectionNode;
1350
1346
  relativeParent?: IProjectionNode;
1351
1347
  root?: IProjectionNode;
@@ -1358,8 +1354,8 @@ interface IProjectionNode<I = unknown> {
1358
1354
  unmount: () => void;
1359
1355
  options: ProjectionNodeOptions;
1360
1356
  setOptions(options: ProjectionNodeOptions): void;
1361
- layout?: Layout;
1362
- snapshot?: Snapshot;
1357
+ layout?: Measurements;
1358
+ snapshot?: Measurements;
1363
1359
  target?: Box;
1364
1360
  relativeTarget?: Box;
1365
1361
  targetDelta?: Delta;
@@ -1383,7 +1379,8 @@ interface IProjectionNode<I = unknown> {
1383
1379
  startUpdate(): void;
1384
1380
  willUpdate(notifyListeners?: boolean): void;
1385
1381
  didUpdate(): void;
1386
- measure(): Box;
1382
+ measure(removeTransform?: boolean): Measurements;
1383
+ measurePageBox(): Box;
1387
1384
  updateLayout(): void;
1388
1385
  updateSnapshot(): void;
1389
1386
  clearSnapshot(): 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.5";
1245
+ this.version = "7.6.7";
1246
1246
  /**
1247
1247
  * Duration, in milliseconds, since last updating frame.
1248
1248
  *
@@ -2570,7 +2570,7 @@
2570
2570
  const animationTarget = 1000;
2571
2571
  function createProjectionNode({ attachResizeListener, defaultParent, measureScroll, checkIsScrollRoot, resetTransform, }) {
2572
2572
  return class ProjectionNode {
2573
- constructor(id, latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) {
2573
+ constructor(elementId, latestValues = {}, parent = defaultParent === null || defaultParent === void 0 ? void 0 : defaultParent()) {
2574
2574
  /**
2575
2575
  * A Set containing all this component's children. This is used to iterate
2576
2576
  * through the children.
@@ -2623,7 +2623,7 @@
2623
2623
  /**
2624
2624
  * An object representing the calculated contextual/accumulated/tree scale.
2625
2625
  * This will be used to scale calculcated projection transforms, as these are
2626
- * calculated in screen-space but need to be scaled for elements to actually
2626
+ * calculated in screen-space but need to be scaled for elements to layoutly
2627
2627
  * make it to their calculated destinations.
2628
2628
  *
2629
2629
  * TODO: Lazy-init
@@ -2653,13 +2653,13 @@
2653
2653
  */
2654
2654
  // TODO Only running on root node
2655
2655
  this.sharedNodes = new Map();
2656
- this.id = id;
2656
+ this.elementId = elementId;
2657
2657
  this.latestValues = latestValues;
2658
2658
  this.root = parent ? parent.root || parent : this;
2659
2659
  this.path = parent ? [...parent.path, parent] : [];
2660
2660
  this.parent = parent;
2661
2661
  this.depth = parent ? parent.depth + 1 : 0;
2662
- id && this.root.registerPotentialNode(id, this);
2662
+ elementId && this.root.registerPotentialNode(elementId, this);
2663
2663
  for (let i = 0; i < this.path.length; i++) {
2664
2664
  this.path[i].shouldResetTransform = true;
2665
2665
  }
@@ -2698,7 +2698,7 @@
2698
2698
  }
2699
2699
  this.root.nodes.add(this);
2700
2700
  (_a = this.parent) === null || _a === void 0 ? void 0 : _a.children.add(this);
2701
- this.id && this.root.potentialNodes.delete(this.id);
2701
+ this.elementId && this.root.potentialNodes.delete(this.elementId);
2702
2702
  if (isLayoutDirty && (layout || layoutId)) {
2703
2703
  this.isLayoutDirty = true;
2704
2704
  }
@@ -2914,14 +2914,7 @@
2914
2914
  updateSnapshot() {
2915
2915
  if (this.snapshot || !this.instance)
2916
2916
  return;
2917
- const measured = this.measure();
2918
- const layout = this.removeTransform(this.removeElementScroll(measured));
2919
- roundBox(layout);
2920
- this.snapshot = {
2921
- measured,
2922
- layout,
2923
- latestValues: {},
2924
- };
2917
+ this.snapshot = this.measure();
2925
2918
  }
2926
2919
  updateLayout() {
2927
2920
  var _a;
@@ -2946,18 +2939,13 @@
2946
2939
  node.updateScroll();
2947
2940
  }
2948
2941
  }
2949
- const measured = this.measure();
2950
- roundBox(measured);
2951
2942
  const prevLayout = this.layout;
2952
- this.layout = {
2953
- measured,
2954
- actual: this.removeElementScroll(measured),
2955
- };
2943
+ this.layout = this.measure(false);
2956
2944
  this.layoutCorrected = createBox();
2957
2945
  this.isLayoutDirty = false;
2958
2946
  this.projectionDelta = undefined;
2959
- this.notifyListeners("measure", this.layout.actual);
2960
- (_a = this.options.visualElement) === null || _a === void 0 ? void 0 : _a.notify("LayoutMeasure", this.layout.actual, prevLayout === null || prevLayout === void 0 ? void 0 : prevLayout.actual);
2947
+ this.notifyListeners("measure", this.layout.layoutBox);
2948
+ (_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);
2961
2949
  }
2962
2950
  updateScroll() {
2963
2951
  if (this.options.layoutScroll && this.instance) {
@@ -2983,7 +2971,25 @@
2983
2971
  this.scheduleRender();
2984
2972
  }
2985
2973
  }
2986
- measure() {
2974
+ measure(removeTransform = true) {
2975
+ const pageBox = this.measurePageBox();
2976
+ let layoutBox = this.removeElementScroll(pageBox);
2977
+ /**
2978
+ * Measurements taken during the pre-render stage
2979
+ * still have transforms applied so we remove them
2980
+ * via calculation.
2981
+ */
2982
+ if (removeTransform) {
2983
+ layoutBox = this.removeTransform(layoutBox);
2984
+ }
2985
+ roundBox(layoutBox);
2986
+ return {
2987
+ measuredBox: pageBox,
2988
+ layoutBox,
2989
+ latestValues: {},
2990
+ };
2991
+ }
2992
+ measurePageBox() {
2987
2993
  const { visualElement } = this.options;
2988
2994
  if (!visualElement)
2989
2995
  return createBox();
@@ -3064,9 +3070,9 @@
3064
3070
  continue;
3065
3071
  hasScale(node.latestValues) && node.updateSnapshot();
3066
3072
  const sourceBox = createBox();
3067
- const nodeBox = node.measure();
3073
+ const nodeBox = node.measurePageBox();
3068
3074
  copyBoxInto(sourceBox, nodeBox);
3069
- removeBoxTransforms(boxWithoutTransform, node.latestValues, (_a = node.snapshot) === null || _a === void 0 ? void 0 : _a.layout, sourceBox);
3075
+ removeBoxTransforms(boxWithoutTransform, node.latestValues, (_a = node.snapshot) === null || _a === void 0 ? void 0 : _a.layoutBox, sourceBox);
3070
3076
  }
3071
3077
  if (hasTransform(this.latestValues)) {
3072
3078
  removeBoxTransforms(boxWithoutTransform, this.latestValues);
@@ -3120,7 +3126,7 @@
3120
3126
  this.relativeParent = relativeParent;
3121
3127
  this.relativeTarget = createBox();
3122
3128
  this.relativeTargetOrigin = createBox();
3123
- calcRelativePosition(this.relativeTargetOrigin, this.layout.actual, relativeParent.layout.actual);
3129
+ calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox);
3124
3130
  copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
3125
3131
  }
3126
3132
  else {
@@ -3154,10 +3160,10 @@
3154
3160
  else if (this.targetDelta) {
3155
3161
  if (Boolean(this.resumingFrom)) {
3156
3162
  // TODO: This is creating a new object every frame
3157
- this.target = this.applyTransform(this.layout.actual);
3163
+ this.target = this.applyTransform(this.layout.layoutBox);
3158
3164
  }
3159
3165
  else {
3160
- copyBoxInto(this.target, this.layout.actual);
3166
+ copyBoxInto(this.target, this.layout.layoutBox);
3161
3167
  }
3162
3168
  applyBoxDelta(this.target, this.targetDelta);
3163
3169
  }
@@ -3165,7 +3171,7 @@
3165
3171
  /**
3166
3172
  * If no target, use own layout as target
3167
3173
  */
3168
- copyBoxInto(this.target, this.layout.actual);
3174
+ copyBoxInto(this.target, this.layout.layoutBox);
3169
3175
  }
3170
3176
  /**
3171
3177
  * If we've been told to attempt to resolve a relative target, do so.
@@ -3222,7 +3228,7 @@
3222
3228
  * Reset the corrected box with the latest values from box, as we're then going
3223
3229
  * to perform mutative operations on it.
3224
3230
  */
3225
- copyBoxInto(this.layoutCorrected, this.layout.actual);
3231
+ copyBoxInto(this.layoutCorrected, this.layout.layoutBox);
3226
3232
  /**
3227
3233
  * Apply all the parent deltas to this box to produce the corrected box. This
3228
3234
  * is the layout box, as it will appear on screen as a result of the transforms of its parents.
@@ -3299,7 +3305,7 @@
3299
3305
  this.relativeTargetOrigin &&
3300
3306
  this.layout &&
3301
3307
  ((_a = this.relativeParent) === null || _a === void 0 ? void 0 : _a.layout)) {
3302
- calcRelativePosition(relativeLayout, this.layout.actual, this.relativeParent.layout.actual);
3308
+ calcRelativePosition(relativeLayout, this.layout.layoutBox, this.relativeParent.layout.layoutBox);
3303
3309
  mixBox(this.relativeTarget, this.relativeTargetOrigin, relativeLayout, progress);
3304
3310
  }
3305
3311
  if (isSharedLayoutAnimation) {
@@ -3383,12 +3389,12 @@
3383
3389
  if (this !== lead &&
3384
3390
  this.layout &&
3385
3391
  layout &&
3386
- shouldAnimatePositionOnly(this.options.animationType, this.layout.actual, layout.actual)) {
3392
+ shouldAnimatePositionOnly(this.options.animationType, this.layout.layoutBox, layout.layoutBox)) {
3387
3393
  target = this.target || createBox();
3388
- const xLength = calcLength(this.layout.actual.x);
3394
+ const xLength = calcLength(this.layout.layoutBox.x);
3389
3395
  target.x.min = lead.target.x.min;
3390
3396
  target.x.max = target.x.min + xLength;
3391
- const yLength = calcLength(this.layout.actual.y);
3397
+ const yLength = calcLength(this.layout.layoutBox.y);
3392
3398
  target.y.min = lead.target.y.min;
3393
3399
  target.y.max = target.y.min + yLength;
3394
3400
  }
@@ -3402,7 +3408,7 @@
3402
3408
  /**
3403
3409
  * Update the delta between the corrected box and the final target box, after
3404
3410
  * user-set transforms are applied to it. This will be used by the renderer to
3405
- * create a transform style that will reproject the element from its actual layout
3411
+ * create a transform style that will reproject the element from its layout layout
3406
3412
  * into the desired bounding box.
3407
3413
  */
3408
3414
  calcBoxDelta(this.projectionDeltaWithTransform, this.layoutCorrected, targetWithTransforms, latestValues);
@@ -3558,7 +3564,7 @@
3558
3564
  }
3559
3565
  else {
3560
3566
  /**
3561
- * Or we're not animating at all, set the lead component to its actual
3567
+ * Or we're not animating at all, set the lead component to its layout
3562
3568
  * opacity and other components to hidden.
3563
3569
  */
3564
3570
  styles.opacity =
@@ -3622,37 +3628,37 @@
3622
3628
  node.layout &&
3623
3629
  snapshot &&
3624
3630
  node.hasListeners("didUpdate")) {
3625
- const { actual: layout, measured: measuredLayout } = node.layout;
3631
+ const { layoutBox: layout, measuredBox: measuredLayout } = node.layout;
3626
3632
  const { animationType } = node.options;
3627
3633
  // TODO Maybe we want to also resize the layout snapshot so we don't trigger
3628
3634
  // animations for instance if layout="size" and an element has only changed position
3629
3635
  if (animationType === "size") {
3630
3636
  eachAxis((axis) => {
3631
3637
  const axisSnapshot = snapshot.isShared
3632
- ? snapshot.measured[axis]
3633
- : snapshot.layout[axis];
3638
+ ? snapshot.measuredBox[axis]
3639
+ : snapshot.layoutBox[axis];
3634
3640
  const length = calcLength(axisSnapshot);
3635
3641
  axisSnapshot.min = layout[axis].min;
3636
3642
  axisSnapshot.max = axisSnapshot.min + length;
3637
3643
  });
3638
3644
  }
3639
- else if (shouldAnimatePositionOnly(animationType, snapshot.layout, layout)) {
3645
+ else if (shouldAnimatePositionOnly(animationType, snapshot.layoutBox, layout)) {
3640
3646
  eachAxis((axis) => {
3641
3647
  const axisSnapshot = snapshot.isShared
3642
- ? snapshot.measured[axis]
3643
- : snapshot.layout[axis];
3648
+ ? snapshot.measuredBox[axis]
3649
+ : snapshot.layoutBox[axis];
3644
3650
  const length = calcLength(layout[axis]);
3645
3651
  axisSnapshot.max = axisSnapshot.min + length;
3646
3652
  });
3647
3653
  }
3648
3654
  const layoutDelta = createDelta();
3649
- calcBoxDelta(layoutDelta, layout, snapshot.layout);
3655
+ calcBoxDelta(layoutDelta, layout, snapshot.layoutBox);
3650
3656
  const visualDelta = createDelta();
3651
3657
  if (snapshot.isShared) {
3652
- calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measured);
3658
+ calcBoxDelta(visualDelta, node.applyTransform(measuredLayout, true), snapshot.measuredBox);
3653
3659
  }
3654
3660
  else {
3655
- calcBoxDelta(visualDelta, layout, snapshot.layout);
3661
+ calcBoxDelta(visualDelta, layout, snapshot.layoutBox);
3656
3662
  }
3657
3663
  const hasLayoutChanged = !isDeltaZero(layoutDelta);
3658
3664
  let hasRelativeTargetChanged = false;
@@ -3666,9 +3672,9 @@
3666
3672
  const { snapshot: parentSnapshot, layout: parentLayout } = relativeParent;
3667
3673
  if (parentSnapshot && parentLayout) {
3668
3674
  const relativeSnapshot = createBox();
3669
- calcRelativePosition(relativeSnapshot, snapshot.layout, parentSnapshot.layout);
3675
+ calcRelativePosition(relativeSnapshot, snapshot.layoutBox, parentSnapshot.layoutBox);
3670
3676
  const relativeLayout = createBox();
3671
- calcRelativePosition(relativeLayout, layout, parentLayout.actual);
3677
+ calcRelativePosition(relativeLayout, layout, parentLayout.layoutBox);
3672
3678
  if (!boxEquals(relativeSnapshot, relativeLayout)) {
3673
3679
  hasRelativeTargetChanged = true;
3674
3680
  }
@@ -4736,7 +4742,7 @@
4736
4742
  * and warn against mismatches.
4737
4743
  */
4738
4744
  {
4739
- warnOnce(nextValue.version === "7.6.5", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.6.5 may not work as expected.`);
4745
+ warnOnce(nextValue.version === "7.6.7", `Attempting to mix Framer Motion versions ${nextValue.version} with 7.6.7 may not work as expected.`);
4740
4746
  }
4741
4747
  }
4742
4748
  else if (isMotionValue(prevValue)) {
@@ -4890,17 +4896,6 @@
4890
4896
  }
4891
4897
  }
4892
4898
  }
4893
- /**
4894
- * Update external values with initial values
4895
- */
4896
- if (props.values) {
4897
- for (const key in props.values) {
4898
- const value = props.values[key];
4899
- if (latestValues[key] !== undefined && isMotionValue(value)) {
4900
- value.set(latestValues[key]);
4901
- }
4902
- }
4903
- }
4904
4899
  }
4905
4900
  /**
4906
4901
  * 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.5",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.7",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};