@ssgoi/core 6.6.9 → 6.6.11
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/animation/animation.d.ts +2 -2
- package/dist/animation/frame-scheduler.d.ts +36 -0
- package/dist/animation/frame-scheduler.d.ts.map +1 -0
- package/dist/animation/multi-animation.d.ts +3 -2
- package/dist/animation/multi-animation.d.ts.map +1 -1
- package/dist/animation/web-animation.d.ts +14 -3
- package/dist/animation/web-animation.d.ts.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +16 -10
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +2 -2
- package/dist/multi-animation-6124HEke.cjs +1 -0
- package/dist/multi-animation-ZFZBDBGr.js +439 -0
- package/dist/transitions/drill/provider/crossfade.d.ts.map +1 -1
- package/dist/transitions/drill/provider/parallax.d.ts.map +1 -1
- package/dist/transitions/sheet/provider/static.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/multi-animation-BC5ihz8S.js +0 -367
- package/dist/multi-animation-CE9yYIGJ.cjs +0 -1
|
@@ -51,8 +51,8 @@ export declare abstract class Animation {
|
|
|
51
51
|
* Reads the live simulation value, so it advances frame-by-frame while
|
|
52
52
|
* playing. Useful for external inspection / debugging.
|
|
53
53
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
54
|
+
* `MultiAnimation` uses this live value for sequence/stagger triggering so
|
|
55
|
+
* delayed WAAPI startup is never mistaken for elapsed animation time.
|
|
56
56
|
*/
|
|
57
57
|
abstract get progress(): number;
|
|
58
58
|
/**
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not let one delayed rendering opportunity consume an unbounded amount of
|
|
3
|
+
* animation time while startup is still being stabilized. A 30 Hz display is
|
|
4
|
+
* still a normal cadence, so only gaps larger than two nominal 60 Hz frames
|
|
5
|
+
* are treated as catch-up.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MAX_FRAME_DELTA: number;
|
|
8
|
+
export declare const STABLE_FRAME_THRESHOLD: number;
|
|
9
|
+
export type FrameTick = {
|
|
10
|
+
/** Frame time used by frame-paced animation drivers. */
|
|
11
|
+
delta: number;
|
|
12
|
+
/** Actual gap between rendering opportunities. */
|
|
13
|
+
rawDelta: number;
|
|
14
|
+
};
|
|
15
|
+
type FramePhase = "drive" | "observe";
|
|
16
|
+
type FrameCallback = (tick: FrameTick) => void;
|
|
17
|
+
/**
|
|
18
|
+
* One requestAnimationFrame loop shared by animation drivers and composition
|
|
19
|
+
* observers. Drivers always run first so observers see the pose that will be
|
|
20
|
+
* painted for the current rendering opportunity.
|
|
21
|
+
*/
|
|
22
|
+
declare class FrameScheduler {
|
|
23
|
+
private drivers;
|
|
24
|
+
private observers;
|
|
25
|
+
private frameRequest;
|
|
26
|
+
private previousTimestamp;
|
|
27
|
+
subscribe(callback: FrameCallback, phase?: FramePhase): () => void;
|
|
28
|
+
private requestFrame;
|
|
29
|
+
private tick;
|
|
30
|
+
private runPhase;
|
|
31
|
+
private hasCallbacks;
|
|
32
|
+
private stopIfIdle;
|
|
33
|
+
}
|
|
34
|
+
export declare const frameScheduler: FrameScheduler;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=frame-scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame-scheduler.d.ts","sourceRoot":"","sources":["../../src/lib/animation/frame-scheduler.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAY,CAAC;AACzC,eAAO,MAAM,sBAAsB,QAAsB,CAAC;AAE1D,MAAM,MAAM,SAAS,GAAG;IACtB,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;AACtC,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;AAE/C;;;;GAIG;AACH,cAAM,cAAc;IAClB,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,SAAS,CAA4B;IAC7C,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,iBAAiB,CAAuB;IAEhD,SAAS,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,GAAE,UAAoB,GAAG,MAAM,IAAI;IAW3E,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,IAAI,CAkBV;IAEF,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,UAAU;CAWnB;AAED,eAAO,MAAM,cAAc,gBAAuB,CAAC"}
|
|
@@ -29,7 +29,7 @@ export declare class MultiAnimation extends Animation {
|
|
|
29
29
|
private startAt;
|
|
30
30
|
private pendingComplete;
|
|
31
31
|
private running;
|
|
32
|
-
private
|
|
32
|
+
private pendingStartObservers;
|
|
33
33
|
constructor(children: Animation[], opts?: MultiAnimationOptions);
|
|
34
34
|
play(): void;
|
|
35
35
|
reverse(): void;
|
|
@@ -47,7 +47,8 @@ export declare class MultiAnimation extends Animation {
|
|
|
47
47
|
set playbackRate(rate: number);
|
|
48
48
|
private startRun;
|
|
49
49
|
private scheduleStart;
|
|
50
|
-
private
|
|
50
|
+
private hasReachedThreshold;
|
|
51
|
+
private clearPendingStartObservers;
|
|
51
52
|
private handleChildComplete;
|
|
52
53
|
private handleFinished;
|
|
53
54
|
findTimeForProgress(_threshold: number): number | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-animation.d.ts","sourceRoot":"","sources":["../../src/lib/animation/multi-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"multi-animation.d.ts","sourceRoot":"","sources":["../../src/lib/animation/multi-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,SAAS;IAC3C,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,OAAO,CAAW;IAC1B,OAAO,CAAC,eAAe,CAAK;IAC5B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,qBAAqB,CAAyB;gBAE1C,QAAQ,EAAE,SAAS,EAAE,EAAE,IAAI,GAAE,qBAA0B;IAgBnE,IAAI,IAAI,IAAI;IAIZ,OAAO,IAAI,IAAI;IAIf,KAAK,IAAI,IAAI;IAMb,QAAQ,IAAI,IAAI;IAOhB,IAAI,QAAQ,IAAI,MAAM,CAKrB;IAED,OAAO,IAAI,IAAI,EAAE;IAIjB,WAAW,IAAI,QAAQ,EAAE;IAIzB,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI;IAO/B,IAAI,WAAW,IAAI,OAAO,CAEzB;IACD,IAAI,QAAQ,IAAI,OAAO,CAKtB;IACD,IAAI,UAAU,IAAI,OAAO,CAExB;IACD,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,YAAY,IAAI,MAAM,CAEzB;IACD,IAAI,YAAY,CAAC,IAAI,EAAE,MAAM,EAG5B;IAID,OAAO,CAAC,QAAQ;IAuBhB,OAAO,CAAC,aAAa;IA8BrB,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,0BAA0B;IAKlC,OAAO,CAAC,mBAAmB;IAK3B,OAAO,CAAC,cAAc;IAMtB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAOvD"}
|
|
@@ -21,8 +21,14 @@ export interface WebAnimationOptions {
|
|
|
21
21
|
* velocity) toward the target bound, producing a frame list.
|
|
22
22
|
* 2. Frames are converted to WAAPI keyframes; `element.animate(...)` is held
|
|
23
23
|
* at 0 ms until the pending pause is acknowledged and the browser has had
|
|
24
|
-
* a rendering opportunity
|
|
25
|
-
* 3.
|
|
24
|
+
* a rendering opportunity.
|
|
25
|
+
* 3. Startup is advanced by a shared frame clock until two rendering
|
|
26
|
+
* opportunities arrive without a long gap. Delayed mount work during
|
|
27
|
+
* this startup window therefore cannot be charged to the document
|
|
28
|
+
* timeline in one catch-up jump.
|
|
29
|
+
* 4. Playback is handed to native WAAPI once rendering is stable, preserving
|
|
30
|
+
* compositor playback for the remainder of the transition.
|
|
31
|
+
* 5. While playing, `getPose()` interpolates the live position from frames
|
|
26
32
|
* using WAAPI's `currentTime`, so browser setup latency is not counted as
|
|
27
33
|
* animation progress.
|
|
28
34
|
*
|
|
@@ -43,6 +49,8 @@ export declare class WebAnimation extends Animation {
|
|
|
43
49
|
private waitingForStart;
|
|
44
50
|
private startReady;
|
|
45
51
|
private pendingFirstFrame;
|
|
52
|
+
private stopStartupClock;
|
|
53
|
+
private startupStableFrames;
|
|
46
54
|
private running;
|
|
47
55
|
private paused;
|
|
48
56
|
private settled;
|
|
@@ -75,7 +83,10 @@ export declare class WebAnimation extends Animation {
|
|
|
75
83
|
private clearWaapi;
|
|
76
84
|
private captureLiveState;
|
|
77
85
|
private startWhenReady;
|
|
78
|
-
private
|
|
86
|
+
private startFramePacedPlayback;
|
|
87
|
+
private advanceFramePacedStartup;
|
|
88
|
+
private handOffToWaapi;
|
|
89
|
+
private finishFramePacedRun;
|
|
79
90
|
private applyStyleAt;
|
|
80
91
|
}
|
|
81
92
|
//# sourceMappingURL=web-animation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-animation.d.ts","sourceRoot":"","sources":["../../src/lib/animation/web-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAiB,MAAM,QAAQ,CAAC;AACzE,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"web-animation.d.ts","sourceRoot":"","sources":["../../src/lib/animation/web-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAiB,MAAM,QAAQ,CAAC;AACzE,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAUxC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,WAAW,CAAC;IAC7C,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAQD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,YAAa,SAAQ,SAAS;IACzC,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,UAAU,CAAS;IAE3B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,eAAe,CAAK;IAC5B,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,KAAK,CAAqC;IAClD,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,iBAAiB,CAAuB;IAChD,OAAO,CAAC,gBAAgB,CAA6B;IACrD,OAAO,CAAC,mBAAmB,CAAK;IAChC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAS;gBAEd,IAAI,EAAE,mBAAmB;IAYrC,IAAI,IAAI,IAAI;IAiBZ,OAAO,IAAI,IAAI;IAQf,KAAK,IAAI,IAAI;IAYb,QAAQ,IAAI,IAAI;IAWhB;;;;;;OAMG;IACH,WAAW,IAAI,IAAI;IAInB,IAAI,WAAW,IAAI,OAAO,CAEzB;IACD,IAAI,QAAQ,IAAI,OAAO,CAEtB;IACD,IAAI,UAAU,IAAI,OAAO,CAExB;IACD,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,QAAQ,IAAI,MAAM,CAMrB;IAED,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAcrD,IAAI,YAAY,IAAI,MAAM,CAEzB;IACD,IAAI,YAAY,CAAC,IAAI,EAAE,MAAM,EAG5B;IAED,OAAO,IAAI,IAAI,EAAE;IAcjB,WAAW,IAAI,QAAQ,EAAE;IAczB,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI;IAS9B,OAAO,CAAC,SAAS;IAiEjB,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,gBAAgB;YASV,cAAc;IAwB5B,OAAO,CAAC,uBAAuB;IA8B/B,OAAO,CAAC,wBAAwB;IAqChC,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,mBAAmB;IAiB3B,OAAO,CAAC,YAAY;CAQrB"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var se=Object.defineProperty;var oe=(e,t,n)=>t in e?se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var E=(e,t,n)=>oe(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./multi-animation-CE9yYIGJ.cjs");function _(e,t){const n=[];for(let i=0;i<e.length;i++)for(let s=i+1;s<e.length;s++){const o=e[i],r=e[s];!o||!r||n.push({from:o,to:r,transition:t(),symmetric:!0})}return n}function Ht(e,t){return[{from:e.exit,to:e.enter,transition:t("enter")},{from:e.enter,to:e.exit,transition:t("exit")}]}function ct(e,t,n){const i=[];for(let s=0;s<e.length;s++)for(let o=s+1;o<e.length;o++){const r=e[s],l=e[o];!r||!l||i.push({from:r,to:l,transition:n(t.forward)},{from:l,to:r,transition:n(t.backward)})}return i}class V{constructor(t){E(this,"omega");E(this,"zeta");E(this,"restDelta");E(this,"restSpeed");const{stiffness:n,damping:i}=t,s=1;this.omega=Math.sqrt(n/s),this.zeta=i/(2*Math.sqrt(n*s)),this.restDelta=t.restDelta??m.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??m.VELOCITY_THRESHOLD}step(t,n,i){const s=Math.min(i,.033),{omega:o,zeta:r}=this,{position:l,velocity:a}=t,c=-2*s*r*o*a,u=s*o*o*(n-l),p=a+c+u;return{position:l+s*p,velocity:p}}isSettled(t,n){const i=Math.abs(n-t.position),s=Math.abs(t.velocity);return i<this.restDelta&&s<this.restSpeed}}class re{constructor(t){E(this,"leader");E(this,"follower");E(this,"restDelta");E(this,"restSpeed");this.restDelta=t.restDelta??m.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??m.VELOCITY_THRESHOLD,this.leader=new V({stiffness:t.stiffness,damping:t.damping,restDelta:this.restDelta,restSpeed:this.restSpeed});let n,i,s,o;typeof t.follower=="number"?(n=t.stiffness*t.follower,i=t.damping):t.follower?(n=t.follower.stiffness,i=t.follower.damping,s=t.follower.restDelta,o=t.follower.restSpeed):(n=t.stiffness,i=t.damping),this.follower=new V({stiffness:n,damping:i,restDelta:s??this.restDelta,restSpeed:o??this.restSpeed})}step(t,n,i){const o=t._leader??{position:t.position,velocity:t.velocity},r=this.leader.step(o,n,i),l=this.follower.step(t,r.position,i);return{position:l.position,velocity:l.velocity,_leader:r}}isSettled(t,n){const i=t,s=Math.abs(n-t.position)<this.restDelta&&Math.abs(t.velocity)<this.restSpeed;return i._leader?Math.abs(n-i._leader.position)<this.restDelta&&Math.abs(i._leader.velocity)<this.restSpeed&&s:s}}const ae=.01,le=500,ce=10;class pe{constructor(t){E(this,"acceleration");E(this,"resistance");E(this,"resistanceType");E(this,"min");E(this,"max");E(this,"bounceStiffness");E(this,"bounceDamping");E(this,"restDelta");this.acceleration=t.acceleration,this.resistance=t.resistance,this.resistanceType=t.resistanceType??"quadratic",this.min=t.min,this.max=t.max,this.bounceStiffness=t.bounceStiffness??le,this.bounceDamping=t.bounceDamping??ce,this.restDelta=t.restDelta??ae}step(t,n,i){const s=Math.min(i,.033),{acceleration:o,resistance:r,resistanceType:l,min:a,max:c}=this,{position:u,velocity:p}=t,d=a!==void 0&&u<a,y=c!==void 0&&u>c;let f;if(d||y){const b=u-(d?a:c),$=-this.bounceStiffness*b,x=-this.bounceDamping*p;f=$+x}else{const S=n>u?1:-1;let b;l==="linear"?b=r*p:b=r*p*Math.abs(p),f=S*o-b}const h=p+f*s;let g=u+h*s;if(!d&&!y){const S=n>u?1:-1;(S>0&&g>n||S<0&&g<n)&&(g=n)}return{position:g,velocity:g===n?0:h}}isSettled(t,n){return Math.abs(n-t.position)<this.restDelta}}class w{static from(t){if(t.spring&&t.inertia)throw new Error("Cannot use both 'spring' and 'inertia' together. Choose one physics type.");if(t.inertia)return new pe({acceleration:t.inertia.acceleration,resistance:t.inertia.resistance,resistanceType:t.inertia.resistanceType,min:t.inertia.min,max:t.inertia.max,bounceStiffness:t.inertia.bounceStiffness,bounceDamping:t.inertia.bounceDamping,restDelta:t.inertia.restDelta});const n=t.spring??{stiffness:300,damping:30};if(n.doubleSpring){const i=n.doubleSpring;let s;return typeof i=="number"?s=i:typeof i=="object"&&(s={stiffness:i.stiffness,damping:i.damping}),new re({stiffness:n.stiffness,damping:n.damping,follower:s,restDelta:n.restDelta,restSpeed:n.restSpeed})}return new V({stiffness:n.stiffness,damping:n.damping,restDelta:n.restDelta,restSpeed:n.restSpeed})}static fromSpring(t){return w.from({spring:t})}}class ue{constructor(t){E(this,"durationSec");this.durationSec=Math.max(1/60,t.durationSec)}step(t,n,i){const s=n-t.position;if(s===0)return t;const o=Math.sign(s),r=Math.abs(s)/this.durationSec,l=o*r*i,a=t.position+l;return(o>0?a>=n:a<=n)?{position:n,velocity:0}:{position:a,velocity:o*r}}isSettled(t,n){return Math.abs(t.position-n)<m.POSITION_THRESHOLD}}function k(e,t){function n(o){let r=0,l=0;const a=o.offsetWidth,c=o.offsetHeight;let u=o;for(;u;)r+=u.offsetTop,l+=u.offsetLeft,u=u.offsetParent;return r-=window.scrollY,l-=window.scrollX,{top:r,left:l,width:a,height:c}}const i=n(e),s=n(t);return new DOMRect(s.left-i.left,s.top-i.top,s.width,s.height)}function W(e,t){const n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),s=e.offsetWidth>0?n.width/e.offsetWidth:1,o=e.offsetHeight>0?n.height/e.offsetHeight:1;return new DOMRect((i.left-n.left)/s,(i.top-n.top)/o,i.width/s,i.height/o)}function D(e,t){const{scrollingElement:n,positionedParent:i}=e,s=n!==i&&n.contains(i)?k(n,i).top:0;return{top:e[t].scroll.y,left:0,width:n.clientWidth,height:n.clientHeight-s}}function Nt(e,t){const{scrollingElement:n,positionedParent:i}=e,s=n!==i&&n.contains(i)?k(n,i).top:0;return{top:e[t].scroll.y-s,height:n.clientHeight}}const ut=8,dt={spring:{stiffness:800,damping:40,doubleSpring:1.2,restDelta:.1,restSpeed:.1}};function de({direction:e}){const t=e==="forward"?ut:-ut;return{out:{willChange:"transform, opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${t}px, 0, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(${t*(1-n)}px, 0, 0)`,opacity:`${n}`})}}}function fe(){return{outPhysics:dt,inPhysics:dt,composition:{mode:"parallel",startAt:[0,0]},build:de}}const ft=30,he={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},ye={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function me({direction:e}){const t=e==="forward"?1:-1,n=-ft*t,i=ft*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(${n*s}px, 0, 0)`,opacity:`${1-s}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${i}px, 0, 0)`,opacity:"0"},animate:s=>({transform:`translate3d(${i*(1-s)}px, 0, 0)`,opacity:`${s}`})}}}function ge(){return{outPhysics:he,inPhysics:ye,composition:{mode:"sequence"},build:me}}const be={snappy:fe(),fluid:ge()},ht=8,we={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},Se={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function xe({direction:e}){const t=e==="forward"?1:-1,n=-ht*t,i=ht*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(0, ${n*s}px, 0)`,opacity:`${1-s}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${i}px, 0)`,opacity:"0"},animate:s=>({transform:`translate3d(0, ${i*(1-s)}px, 0)`,opacity:`${s}`})}}}function Ce(){return{outPhysics:we,inPhysics:Se,composition:{mode:"sequence"},build:xe}}const $e=8,Ee={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},Ae={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function Pe(e){const t=$e;return{out:{willChange:"opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${t}px, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(0, ${t*(1-n)}px, 0)`,opacity:`${n}`})}}}function Ie(){return{outPhysics:Ee,inPhysics:Ae,composition:{mode:"sequence"},build:Pe}}const yt=Ce(),_e={snappy:yt,directional:yt,"non-directional":Ie()},mt={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},B=.1,Z=1/3,gt=e=>Math.max(0,Math.min(1,e));function Re({direction:e}){const t=e==="forward"?1:-1,n=1-t*B;return{out:{willChange:"transform, opacity",startStyle:{},animate:i=>({transform:`scale(${1+t*i*B})`,opacity:`${gt(1-i/Z)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${n})`,opacity:"0"},animate:i=>({transform:`scale(${n+t*i*B})`,opacity:`${gt((i-Z)/(1-Z))}`})}}}function Oe(){return{outPhysics:mt,inPhysics:mt,composition:{mode:"parallel"},build:Re}}const bt={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},G=.1,j=1/3,wt=e=>Math.max(0,Math.min(1,e));function ve(){return{out:{willChange:"opacity",startStyle:{},animate:e=>({opacity:`${wt(1-e/j)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${1-G})`,opacity:"0"},animate:e=>({transform:`scale(${1-G+e*G})`,opacity:`${wt((e-j)/(1-j))}`})}}}function Te(){return{outPhysics:bt,inPhysics:bt,composition:{mode:"parallel"},build:ve}}const St=Oe(),De={snappy:St,directional:St,"non-directional":Te()},Fe={x:be,y:_e,z:De};function Me(e,t){const n=Fe[e];return n[t]??n.snappy}const Ye="x",Le="snappy";function xt(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,i]of Object.entries(t.startStyle))e.style[n]=i}function Wt(e){e.style.willChange="auto",e.style.backfaceVisibility="",e.style.contain="",e.style.transform="",e.style.opacity="",e.style.clipPath=""}function ke(e){Wt(e),e.style.pointerEvents=""}const He=(e={})=>{const t=e.direction??"forward",n=e.type??Ye,i=e.feel??Le,s=Me(n,i),o=s.build({direction:t});return{prepare:({from:r,to:l})=>(r.then(a=>{xt(a,o.out),a.style.pointerEvents="none"}),l.then(a=>{xt(a,o.in)}),{}),animation:({from:r,to:l,context:a})=>{if(n==="z"){const p=D(a,"from"),d=D(a,"to");r.style.clipPath=`inset(${p.top}px 0 calc(100% - ${p.top+p.height}px) 0)`,l.style.clipPath=`inset(${d.top}px 0 calc(100% - ${d.top+d.height}px) 0)`}const c=new m.WebAnimation({element:r,integrator:w.from(s.outPhysics),style:p=>o.out.animate(p),onComplete:()=>ke(r)}),u=new m.WebAnimation({element:l,integrator:w.from(s.inPhysics),style:p=>o.in.animate(p),onComplete:()=>Wt(l)});return new m.MultiAnimation([c,u],s.composition)}}};function Ne(e,t,n){return e==="y"?t==="non-directional"?"non-directional":"directional":e!=="x"||t==="snappy"||n==="snappy"?"snappy":"fluid"}function We(e){const{paths:t}=e,n=e.type??"x",i=e.variant,s=e.feel,o=Ne(n,i,s);return ct(t,{forward:"forward",backward:"backward"},r=>He({type:n,direction:r,feel:o}))}const ze={spring:{stiffness:200,damping:22}},Ue=10,Ve="horizontal",Xe="#000000";function Ct(e,t,n,i,s,o){window.getComputedStyle(e).position==="static"&&(e.style.position="relative");const l=document.createElement("div");l.style.cssText=`
|
|
1
|
+
"use strict";var se=Object.defineProperty;var oe=(e,t,n)=>t in e?se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var E=(e,t,n)=>oe(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./multi-animation-6124HEke.cjs");function _(e,t){const n=[];for(let i=0;i<e.length;i++)for(let s=i+1;s<e.length;s++){const o=e[i],r=e[s];!o||!r||n.push({from:o,to:r,transition:t(),symmetric:!0})}return n}function Ht(e,t){return[{from:e.exit,to:e.enter,transition:t("enter")},{from:e.enter,to:e.exit,transition:t("exit")}]}function ct(e,t,n){const i=[];for(let s=0;s<e.length;s++)for(let o=s+1;o<e.length;o++){const r=e[s],l=e[o];!r||!l||i.push({from:r,to:l,transition:n(t.forward)},{from:l,to:r,transition:n(t.backward)})}return i}class V{constructor(t){E(this,"omega");E(this,"zeta");E(this,"restDelta");E(this,"restSpeed");const{stiffness:n,damping:i}=t,s=1;this.omega=Math.sqrt(n/s),this.zeta=i/(2*Math.sqrt(n*s)),this.restDelta=t.restDelta??m.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??m.VELOCITY_THRESHOLD}step(t,n,i){const s=Math.min(i,.033),{omega:o,zeta:r}=this,{position:l,velocity:a}=t,c=-2*s*r*o*a,u=s*o*o*(n-l),p=a+c+u;return{position:l+s*p,velocity:p}}isSettled(t,n){const i=Math.abs(n-t.position),s=Math.abs(t.velocity);return i<this.restDelta&&s<this.restSpeed}}class re{constructor(t){E(this,"leader");E(this,"follower");E(this,"restDelta");E(this,"restSpeed");this.restDelta=t.restDelta??m.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??m.VELOCITY_THRESHOLD,this.leader=new V({stiffness:t.stiffness,damping:t.damping,restDelta:this.restDelta,restSpeed:this.restSpeed});let n,i,s,o;typeof t.follower=="number"?(n=t.stiffness*t.follower,i=t.damping):t.follower?(n=t.follower.stiffness,i=t.follower.damping,s=t.follower.restDelta,o=t.follower.restSpeed):(n=t.stiffness,i=t.damping),this.follower=new V({stiffness:n,damping:i,restDelta:s??this.restDelta,restSpeed:o??this.restSpeed})}step(t,n,i){const o=t._leader??{position:t.position,velocity:t.velocity},r=this.leader.step(o,n,i),l=this.follower.step(t,r.position,i);return{position:l.position,velocity:l.velocity,_leader:r}}isSettled(t,n){const i=t,s=Math.abs(n-t.position)<this.restDelta&&Math.abs(t.velocity)<this.restSpeed;return i._leader?Math.abs(n-i._leader.position)<this.restDelta&&Math.abs(i._leader.velocity)<this.restSpeed&&s:s}}const ae=.01,le=500,ce=10;class pe{constructor(t){E(this,"acceleration");E(this,"resistance");E(this,"resistanceType");E(this,"min");E(this,"max");E(this,"bounceStiffness");E(this,"bounceDamping");E(this,"restDelta");this.acceleration=t.acceleration,this.resistance=t.resistance,this.resistanceType=t.resistanceType??"quadratic",this.min=t.min,this.max=t.max,this.bounceStiffness=t.bounceStiffness??le,this.bounceDamping=t.bounceDamping??ce,this.restDelta=t.restDelta??ae}step(t,n,i){const s=Math.min(i,.033),{acceleration:o,resistance:r,resistanceType:l,min:a,max:c}=this,{position:u,velocity:p}=t,d=a!==void 0&&u<a,y=c!==void 0&&u>c;let f;if(d||y){const b=u-(d?a:c),$=-this.bounceStiffness*b,x=-this.bounceDamping*p;f=$+x}else{const S=n>u?1:-1;let b;l==="linear"?b=r*p:b=r*p*Math.abs(p),f=S*o-b}const h=p+f*s;let g=u+h*s;if(!d&&!y){const S=n>u?1:-1;(S>0&&g>n||S<0&&g<n)&&(g=n)}return{position:g,velocity:g===n?0:h}}isSettled(t,n){return Math.abs(n-t.position)<this.restDelta}}class w{static from(t){if(t.spring&&t.inertia)throw new Error("Cannot use both 'spring' and 'inertia' together. Choose one physics type.");if(t.inertia)return new pe({acceleration:t.inertia.acceleration,resistance:t.inertia.resistance,resistanceType:t.inertia.resistanceType,min:t.inertia.min,max:t.inertia.max,bounceStiffness:t.inertia.bounceStiffness,bounceDamping:t.inertia.bounceDamping,restDelta:t.inertia.restDelta});const n=t.spring??{stiffness:300,damping:30};if(n.doubleSpring){const i=n.doubleSpring;let s;return typeof i=="number"?s=i:typeof i=="object"&&(s={stiffness:i.stiffness,damping:i.damping}),new re({stiffness:n.stiffness,damping:n.damping,follower:s,restDelta:n.restDelta,restSpeed:n.restSpeed})}return new V({stiffness:n.stiffness,damping:n.damping,restDelta:n.restDelta,restSpeed:n.restSpeed})}static fromSpring(t){return w.from({spring:t})}}class ue{constructor(t){E(this,"durationSec");this.durationSec=Math.max(1/60,t.durationSec)}step(t,n,i){const s=n-t.position;if(s===0)return t;const o=Math.sign(s),r=Math.abs(s)/this.durationSec,l=o*r*i,a=t.position+l;return(o>0?a>=n:a<=n)?{position:n,velocity:0}:{position:a,velocity:o*r}}isSettled(t,n){return Math.abs(t.position-n)<m.POSITION_THRESHOLD}}function k(e,t){function n(o){let r=0,l=0;const a=o.offsetWidth,c=o.offsetHeight;let u=o;for(;u;)r+=u.offsetTop,l+=u.offsetLeft,u=u.offsetParent;return r-=window.scrollY,l-=window.scrollX,{top:r,left:l,width:a,height:c}}const i=n(e),s=n(t);return new DOMRect(s.left-i.left,s.top-i.top,s.width,s.height)}function W(e,t){const n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),s=e.offsetWidth>0?n.width/e.offsetWidth:1,o=e.offsetHeight>0?n.height/e.offsetHeight:1;return new DOMRect((i.left-n.left)/s,(i.top-n.top)/o,i.width/s,i.height/o)}function D(e,t){const{scrollingElement:n,positionedParent:i}=e,s=n!==i&&n.contains(i)?k(n,i).top:0;return{top:e[t].scroll.y,left:0,width:n.clientWidth,height:n.clientHeight-s}}function Nt(e,t){const{scrollingElement:n,positionedParent:i}=e,s=n!==i&&n.contains(i)?k(n,i).top:0;return{top:e[t].scroll.y-s,height:n.clientHeight}}const ut=8,dt={spring:{stiffness:800,damping:40,doubleSpring:1.2,restDelta:.1,restSpeed:.1}};function de({direction:e}){const t=e==="forward"?ut:-ut;return{out:{willChange:"transform, opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${t}px, 0, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(${t*(1-n)}px, 0, 0)`,opacity:`${n}`})}}}function fe(){return{outPhysics:dt,inPhysics:dt,composition:{mode:"parallel",startAt:[0,0]},build:de}}const ft=30,he={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},ye={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function me({direction:e}){const t=e==="forward"?1:-1,n=-ft*t,i=ft*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(${n*s}px, 0, 0)`,opacity:`${1-s}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${i}px, 0, 0)`,opacity:"0"},animate:s=>({transform:`translate3d(${i*(1-s)}px, 0, 0)`,opacity:`${s}`})}}}function ge(){return{outPhysics:he,inPhysics:ye,composition:{mode:"sequence"},build:me}}const be={snappy:fe(),fluid:ge()},ht=8,we={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},Se={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function xe({direction:e}){const t=e==="forward"?1:-1,n=-ht*t,i=ht*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(0, ${n*s}px, 0)`,opacity:`${1-s}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${i}px, 0)`,opacity:"0"},animate:s=>({transform:`translate3d(0, ${i*(1-s)}px, 0)`,opacity:`${s}`})}}}function Ce(){return{outPhysics:we,inPhysics:Se,composition:{mode:"sequence"},build:xe}}const $e=8,Ee={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},Ae={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function Pe(e){const t=$e;return{out:{willChange:"opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${t}px, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(0, ${t*(1-n)}px, 0)`,opacity:`${n}`})}}}function Ie(){return{outPhysics:Ee,inPhysics:Ae,composition:{mode:"sequence"},build:Pe}}const yt=Ce(),_e={snappy:yt,directional:yt,"non-directional":Ie()},mt={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},B=.1,Z=1/3,gt=e=>Math.max(0,Math.min(1,e));function Re({direction:e}){const t=e==="forward"?1:-1,n=1-t*B;return{out:{willChange:"transform, opacity",startStyle:{},animate:i=>({transform:`scale(${1+t*i*B})`,opacity:`${gt(1-i/Z)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${n})`,opacity:"0"},animate:i=>({transform:`scale(${n+t*i*B})`,opacity:`${gt((i-Z)/(1-Z))}`})}}}function Oe(){return{outPhysics:mt,inPhysics:mt,composition:{mode:"parallel"},build:Re}}const bt={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},G=.1,j=1/3,wt=e=>Math.max(0,Math.min(1,e));function ve(){return{out:{willChange:"opacity",startStyle:{},animate:e=>({opacity:`${wt(1-e/j)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${1-G})`,opacity:"0"},animate:e=>({transform:`scale(${1-G+e*G})`,opacity:`${wt((e-j)/(1-j))}`})}}}function Te(){return{outPhysics:bt,inPhysics:bt,composition:{mode:"parallel"},build:ve}}const St=Oe(),De={snappy:St,directional:St,"non-directional":Te()},Fe={x:be,y:_e,z:De};function Me(e,t){const n=Fe[e];return n[t]??n.snappy}const Ye="x",Le="snappy";function xt(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,i]of Object.entries(t.startStyle))e.style[n]=i}function Wt(e){e.style.willChange="auto",e.style.backfaceVisibility="",e.style.contain="",e.style.transform="",e.style.opacity="",e.style.clipPath=""}function ke(e){Wt(e),e.style.pointerEvents=""}const He=(e={})=>{const t=e.direction??"forward",n=e.type??Ye,i=e.feel??Le,s=Me(n,i),o=s.build({direction:t});return{prepare:({from:r,to:l})=>(r.then(a=>{xt(a,o.out),a.style.pointerEvents="none"}),l.then(a=>{xt(a,o.in)}),{}),animation:({from:r,to:l,context:a})=>{if(n==="z"){const p=D(a,"from"),d=D(a,"to");r.style.clipPath=`inset(${p.top}px 0 calc(100% - ${p.top+p.height}px) 0)`,l.style.clipPath=`inset(${d.top}px 0 calc(100% - ${d.top+d.height}px) 0)`}const c=new m.WebAnimation({element:r,integrator:w.from(s.outPhysics),style:p=>o.out.animate(p),onComplete:()=>ke(r)}),u=new m.WebAnimation({element:l,integrator:w.from(s.inPhysics),style:p=>o.in.animate(p),onComplete:()=>Wt(l)});return new m.MultiAnimation([c,u],s.composition)}}};function Ne(e,t,n){return e==="y"?t==="non-directional"?"non-directional":"directional":e!=="x"||t==="snappy"||n==="snappy"?"snappy":"fluid"}function We(e){const{paths:t}=e,n=e.type??"x",i=e.variant,s=e.feel,o=Ne(n,i,s);return ct(t,{forward:"forward",backward:"backward"},r=>He({type:n,direction:r,feel:o}))}const ze={spring:{stiffness:200,damping:22}},Ue=10,Ve="horizontal",Xe="#000000";function Ct(e,t,n,i,s,o){window.getComputedStyle(e).position==="static"&&(e.style.position="relative");const l=document.createElement("div");l.style.cssText=`
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
transform: scaleY(${s==="hidden"?0:1});
|
|
28
28
|
transform-origin: ${o==="left"?"top":"bottom"} center;
|
|
29
29
|
will-change: transform;
|
|
30
|
-
`}a.push(u),l.appendChild(u)}return e.appendChild(l),{container:l,blinds:a}}const Be=(e={})=>{const t=e.blindCount??Ue,n=e.direction??Ve,i=e.blindColor??Xe,s=e.physics??ze;return{prepare:async({from:o,to:r})=>{const l=await o,a=await r;l.style.zIndex="1000";const c=Ct(l,t,n,i,"hidden","left");a.style.position="relative",a.style.zIndex="0";const u=Ct(a,t,n,i,"closed","right");return{fromEl:l,fromBlinds:c.blinds,fromContainer:c.container,toBlinds:u.blinds,toContainer:u.container}},animation:({fromEl:o,fromBlinds:r,fromContainer:l,toBlinds:a,toContainer:c})=>{const u=r.map(f=>new m.WebAnimation({element:f,integrator:w.from(s),style:h=>({transform:n==="horizontal"?`scaleX(${h})`:`scaleY(${h})`})})),p=a.map((f,h)=>new m.WebAnimation({element:f,integrator:w.from(s),style:(g,S)=>({transform:n==="horizontal"?`scaleX(${S})`:`scaleY(${S})`}),onComplete:h===a.length-1?()=>{c.remove(),l.remove(),o.style.zIndex="",o.style.position=""}:void 0})),d=new m.MultiAnimation(u,{mode:"parallel"}),y=new m.MultiAnimation(p,{mode:"parallel"});return new m.MultiAnimation([d,y],{mode:"sequence"})}}};function Ze(e){const{paths:t,type:n="horizontal"}=e;return _(t,()=>Be({direction:n}))}const Ge={spring:{stiffness:
|
|
30
|
+
`}a.push(u),l.appendChild(u)}return e.appendChild(l),{container:l,blinds:a}}const Be=(e={})=>{const t=e.blindCount??Ue,n=e.direction??Ve,i=e.blindColor??Xe,s=e.physics??ze;return{prepare:async({from:o,to:r})=>{const l=await o,a=await r;l.style.zIndex="1000";const c=Ct(l,t,n,i,"hidden","left");a.style.position="relative",a.style.zIndex="0";const u=Ct(a,t,n,i,"closed","right");return{fromEl:l,fromBlinds:c.blinds,fromContainer:c.container,toBlinds:u.blinds,toContainer:u.container}},animation:({fromEl:o,fromBlinds:r,fromContainer:l,toBlinds:a,toContainer:c})=>{const u=r.map(f=>new m.WebAnimation({element:f,integrator:w.from(s),style:h=>({transform:n==="horizontal"?`scaleX(${h})`:`scaleY(${h})`})})),p=a.map((f,h)=>new m.WebAnimation({element:f,integrator:w.from(s),style:(g,S)=>({transform:n==="horizontal"?`scaleX(${S})`:`scaleY(${S})`}),onComplete:h===a.length-1?()=>{c.remove(),l.remove(),o.style.zIndex="",o.style.position=""}:void 0})),d=new m.MultiAnimation(u,{mode:"parallel"}),y=new m.MultiAnimation(p,{mode:"parallel"});return new m.MultiAnimation([d,y],{mode:"sequence"})}}};function Ze(e){const{paths:t,type:n="horizontal"}=e;return _(t,()=>Be({direction:n}))}const Ge={spring:{stiffness:250,damping:23,doubleSpring:.7}},L=.5;function je(e){const t=e==="enter"?-100:100,n=e==="enter"?100:-100;return{out:{willChange:"transform, opacity",startStyle:{},animate:i=>({transform:`translate3d(${t*i}%, 0, 0)`,opacity:`${L+(1-L)*(1-i)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${n}%, 0, 0)`,opacity:`${L}`},animate:i=>({transform:`translate3d(${n*(1-i)}%, 0, 0)`,opacity:`${L+(1-L)*i}`})}}}function qe(){return{physics:Ge,build:je}}const Ke={spring:{stiffness:230,damping:25}};function Je(e){const t=e==="enter"?-20:100,n=e==="enter"?100:-20;return{out:{willChange:"transform",startStyle:{},animate:i=>({transform:`translate3d(${t*i}%, 0, 0)`})},in:{willChange:"transform",startStyle:{transform:`translate3d(${n}%, 0, 0)`},animate:i=>({transform:`translate3d(${n*(1-i)}%, 0, 0)`})}}}function Qe(){return{physics:Ke,build:Je}}const tn={parallax:Qe(),crossfade:qe()},R="0",zt="1",O="2",en="parallax";function $t(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,i]of Object.entries(t.startStyle))e.style[n]=i}const nn=(e={})=>{const t=e.direction??"enter",n=tn[e.type??en],i=n.physics,s=n.build(t),o=t==="enter"?R:O,r=t==="enter"?O:R;return{prepare:({from:l,to:a})=>(l.then(c=>{$t(c,s.out),c.style.pointerEvents="none",c.style.zIndex=o}),a.then(c=>{$t(c,s.in),c.style.position="relative",c.style.zIndex=r}),{}),animation:({from:l,to:a})=>{const c=new m.WebAnimation({element:l,integrator:w.from(i),style:p=>s.out.animate(p),onComplete:()=>{l.style.willChange="auto",l.style.backfaceVisibility="",l.style.contain="",l.style.transform="",l.style.opacity="",l.style.pointerEvents="",l.style.zIndex=""}}),u=new m.WebAnimation({element:a,integrator:w.from(i),style:p=>s.in.animate(p),onComplete:()=>{a.style.willChange="auto",a.style.backfaceVisibility="",a.style.contain="",a.style.transform="",a.style.opacity="",a.style.position==="relative"&&(a.style.position=""),a.style.zIndex===r&&(a.style.zIndex="")}});for(const p of[c,u]){const d=p.onComplete;p.onComplete=()=>{d==null||d(),p.releaseFill()}}return new m.MultiAnimation([c,u],{mode:"parallel"})}}};function sn(e){return e==="slide"||e==="crossfade"?"crossfade":"parallax"}function on(e){const{enter:t,exit:n}=e,i=e.type,s=sn(i);return Ht({enter:t,exit:n},o=>nn({direction:o,type:s}))}const rn={spring:{stiffness:180,damping:20,doubleSpring:!0}},an={spring:{stiffness:170,damping:20,doubleSpring:!0}},ln=(e={})=>{const t=e.physics??an,n=e.physics??rn;return{prepare:({to:i})=>(i.then(s=>{s.style.opacity="0",s.style.willChange="opacity"}),{}),animation:({from:i,to:s})=>{const o=new m.WebAnimation({element:i,integrator:w.from(n),style:(l,a)=>({opacity:a}),onComplete:()=>{i.style.willChange="auto",i.style.opacity=""}}),r=new m.WebAnimation({element:s,integrator:w.from(t),style:l=>({opacity:l}),onComplete:()=>{s.style.willChange="auto",s.style.opacity=""}});return new m.MultiAnimation([o,r],{mode:"sequence"})}}};function cn(e){const{paths:t}=e;return _(t,()=>ln())}const q={scaleDown:{stiffness:20,damping:7},translate:{stiffness:15,damping:7},scaleUp:{stiffness:20,damping:7}},F={scaleDown:0,translate:.2,scaleUp:.8},pn=.8,un="white",Et=1e3/60,dn=600;function fn(e){const{items:t,from:n,to:i,recordFrame:s}=e,o=Et/1e3,r=Math.abs(i-n),l=t.map(c=>({item:c,integrator:new V({stiffness:c.spring.stiffness,damping:c.spring.damping}),state:{position:n,velocity:0},started:!1,settled:!1,settleTime:0}));for(let c=0;c<l.length;c++)(c===0||l[c].item.offset===0)&&(l[c].started=!0);s(0);let a=0;for(let c=1;c<=dn;c++){const u=c*Et;a=u;for(const p of l)!p.started||p.settled||(p.state=p.integrator.step(p.state,i,o),p.integrator.isSettled(p.state,i)?(p.settleTime+=o,p.settleTime>=m.SETTLE_THRESHOLD&&(p.state={position:i,velocity:0},p.settled=!0)):p.settleTime=0,p.item.tick(p.state.position));for(let p=1;p<l.length;p++){const d=l[p];if(d.started)continue;const y=l[p-1];if(!y.started)continue;(r===0?1:Math.abs(y.state.position-n)/r)>=d.item.offset&&(d.started=!0)}if(s(u),l.every(p=>p.settled))return u}return a}function K(e,t){return e!=null&&e.spring?{stiffness:e.spring.stiffness,damping:e.spring.damping}:t}function At(e){const{rect:t,scale:n,direction:i,override:s}=e,o=i==="out"?{scale:1,translateY:-t.top}:{scale:n,translateY:-t.top+t.height},r=K(s,q.scaleDown),l=K(s,q.translate),a=K(s,q.scaleUp),c=i==="out"?1:0,u=i==="out"?0:1,p=i==="out"?[{spring:r,offset:F.scaleDown,tick:f=>{const h=1-f;o.scale=1-(1-n)*h}},{spring:l,offset:F.translate,tick:f=>{const h=1-f;o.translateY=-t.top-t.height*h}},{spring:a,offset:F.scaleUp,tick:f=>{const h=1-f;o.scale=n+(1-n)*h}}]:[{spring:r,offset:F.scaleDown,tick:f=>{o.scale=1-(1-n)*f}},{spring:l,offset:F.translate,tick:f=>{o.translateY=-t.top+t.height*(1-f)}},{spring:a,offset:F.scaleUp,tick:f=>{o.scale=n+(1-n)*f}}],d=[],y=fn({items:p,from:c,to:u,recordFrame:f=>d.push({time:f,scale:o.scale,translateY:o.translateY})});return{snapshots:d,totalDuration:y}}function hn(e,t){if(e.length===0)return{time:0,scale:1,translateY:0};if(e.length===1||t<=0)return e[0];if(t>=1)return e[e.length-1];const n=t*(e.length-1),i=Math.floor(n),s=Math.ceil(n);if(i===s)return e[i];const o=e[i],r=e[s],l=n-i;return{time:o.time+(r.time-o.time)*l,scale:o.scale+(r.scale-o.scale)*l,translateY:o.translateY+(r.translateY-o.translateY)*l}}const yn=[[1,1],[-1,1],[1,-1],[-1,-1]];function mn(e,t){const s=(o,r,l)=>{const a=document.createElement("div");Object.assign(a.style,{position:"fixed",pointerEvents:"none",zIndex:"9999",width:"15px",height:"15px",...o});const c=document.createElement("div");Object.assign(c.style,{position:"absolute",width:"15px",height:"1px",backgroundColor:e,[l]:"0",[r]:"0"});const u=document.createElement("div");return Object.assign(u.style,{position:"absolute",width:"1px",height:"15px",backgroundColor:e,[l]:"0",[r]:"0"}),a.appendChild(c),a.appendChild(u),a};return{topLeft:s({top:`${t.top-1}px`,left:`${t.left-1}px`},"left","top"),topRight:s({top:`${t.top-1}px`,left:`${t.left+t.width-15+1}px`},"right","top"),bottomLeft:s({top:`${t.top+t.height-15+1}px`,left:`${t.left-1}px`},"left","bottom"),bottomRight:s({top:`${t.top+t.height-15+1}px`,left:`${t.left+t.width-15+1}px`},"right","bottom")}}function Pt(e,t){const n=t.left+t.width/2,i=t.top+t.height/2;e.style.transformOrigin=`${n}px ${i}px`}function It(e,t){e.style.clipPath=`polygon(
|
|
31
31
|
${t.left}px ${t.top}px,
|
|
32
32
|
${t.left+t.width}px ${t.top}px,
|
|
33
33
|
${t.left+t.width}px ${t.top+t.height}px,
|
|
34
34
|
${t.left}px ${t.top+t.height}px
|
|
35
|
-
)`}function J(e,t,n,i,s){const o=n/1e3;return new m.WebAnimation({element:e,integrator:new ue({durationSec:o}),lowerBound:0,upperBound:1,style:r=>i(hn(t,r)),onComplete:s})}const gn=(e={})=>{var s;const t=((s=e.border)==null?void 0:s.color)??un,n=pn,i=e.physics;return{prepare:({from:o,to:r,context:l})=>{const a=D(l,"from"),c=D(l,"to"),u=k(document.body,l.positionedParent),p=mn(t,{...a,top:u.top});for(const d of["topLeft","topRight","bottomLeft","bottomRight"])l.positionedParent.appendChild(p[d]);return o.then(d=>{Pt(d,a),It(d,a),d.style.transform=`translateY(${-a.top}px)`}),r.then(d=>{Pt(d,c),It(d,c),d.style.transform=`translateY(${-c.top+c.height}px) scale(${n})`}),{borders:p,fromRect:a,toRect:c}},animation:({from:o,to:r,context:l,borders:a,fromRect:c,toRect:u})=>{const p=At({rect:c,scale:n,direction:"out",override:i}),d=At({rect:u,scale:n,direction:"in",override:i}),y=J(o,p.snapshots,p.totalDuration,b=>({transform:`translateY(${b.translateY}px) scale(${b.scale})`}),()=>{o.style.clipPath="",o.style.transformOrigin="",o.style.transform=""}),f=J(r,d.snapshots,d.totalDuration,b=>({transform:`translateY(${b.translateY}px) scale(${b.scale})`}),()=>{r.style.clipPath="",r.style.transformOrigin="",r.style.transform=""}),h=yn.map(([b,$],x)=>{const C=["topLeft","topRight","bottomLeft","bottomRight"][x];return J(a[C],p.snapshots,p.totalDuration,I=>{const P=(c.width-c.width*I.scale)/2*.7*b,A=(c.height-c.height*I.scale)/2*.7*$;return{transform:`translate(${P}px, ${A}px)`}})}),g=new m.MultiAnimation([y,f,...h],{mode:"parallel"}),S=g.onComplete;return g.onComplete=()=>{S==null||S();const b=l.positionedParent;for(const $ of["topLeft","topRight","bottomLeft","bottomRight"]){const x=a[$];x.parentElement===b&&b.removeChild(x)}},g}}};function bn(e){const{paths:t,options:n}=e,i=(n==null?void 0:n.borderColor)!==void 0?{border:{color:n.borderColor}}:void 0;return _(t,()=>gn(i))}function wn(e){if(!e)return null;if(e.includes("/")){const n=e.split("/");if(n.length!==2)return null;const i=Number.parseFloat(n[0]??""),s=Number.parseFloat(n[1]??"");return Number.isFinite(i)&&Number.isFinite(s)&&i>0&&s>0?i/s:null}const t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function Sn(e){return e==="contain"||e==="cover"?e:null}function ot(e){return e.tagName==="IMG"}function xn(e){if(ot(e))return e;if(e.tagName==="PICTURE"||e.tagName==="VIDEO")return null;const t=[];for(const n of Array.from(e.children)){const i=n;ot(i)&&t.push(i)}return t.length===1?t[0]??null:null}function Cn(e){var a,c;if(!ot(e))return null;const t=e,n=t.naturalWidth,i=t.naturalHeight;if(typeof n=="number"&&typeof i=="number"&&Number.isFinite(n)&&Number.isFinite(i)&&n>0&&i>0)return n/i;const s=((a=e.getAttribute("width"))==null?void 0:a.trim())??"",o=((c=e.getAttribute("height"))==null?void 0:c.trim())??"",r=s===""?Number.NaN:Number(s),l=o===""?Number.NaN:Number(o);return Number.isFinite(r)&&Number.isFinite(l)&&r>0&&l>0?r/l:null}function $n(e){const t=e.trim().toLowerCase().replace(/\s+/g," ");return t===""||t==="center"||t==="center center"||t==="50% 50%"}function X(e){if(typeof getComputedStyle=="function")try{return getComputedStyle(e)}catch{}return e.style}function En(e){const t=X(e),n=$n(t.objectPosition??"");return{fit:n?Sn(t.objectFit??null):null,centered:n}}function Ut(e){if(!e)return 0;const t=/^(-?(?:\d+\.?\d*|\.\d+))px$/.exec(e.trim());if(!t)return null;const n=Number.parseFloat(t[1]??"");return Number.isFinite(n)&&n>=0?n:null}function _t(e){const t=X(e),n=[t.borderTopLeftRadius,t.borderTopRightRadius,t.borderBottomRightRadius,t.borderBottomLeftRadius].map(Ut),i=n[0];if(i==null)return{radius:0,supported:!1};const s=n.every(o=>o!==null&&Math.abs(o-i)<.001);return{radius:s?i:0,supported:s}}function An(e,t){var s;if(!t)return null;const n=(s=e.getAttribute(t))==null?void 0:s.trim();if(n==null||n==="")return null;const i=Number.parseFloat(n);return Number.isFinite(i)&&i>=0?i:null}function Pn(e){const t=X(e);return[t.paddingTop,t.paddingRight,t.paddingBottom,t.paddingLeft,t.borderTopWidth,t.borderRightWidth,t.borderBottomWidth,t.borderLeftWidth].every(i=>i?Ut(i)===0:!0)}function In(e){const t=X(e),n=i=>i==="hidden"||i==="clip";return n(t.overflowX)&&n(t.overflowY)}function v(e){return e.left+e.width/2}function T(e){return e.top+e.height/2}function pt(e,t){return{top:Math.max(0,t.top-e.top),right:Math.max(0,e.left+e.width-(t.left+t.width)),bottom:Math.max(0,e.top+e.height-(t.top+t.height)),left:Math.max(0,t.left-e.left)}}function _n(e,t){const n=Math.max(e.left,t.left),i=Math.max(e.top,t.top),s=Math.min(e.left+e.width,t.left+t.width),o=Math.min(e.top+e.height,t.top+t.height);return s>n&&o>i?{left:n,top:i,width:s-n,height:o-i}:null}function Rt(e,t){return Math.abs(e.left-t.left)<.01&&Math.abs(e.top-t.top)<.01&&Math.abs(e.width-t.width)<.01&&Math.abs(e.height-t.height)<.01}function Rn(e,t,n){const i=e.width/e.height;let s,o;return n==="contain"?i>t?(o=e.height,s=o*t):(s=e.width,o=s/t):i>t?(s=e.width,o=s/t):(o=e.height,s=o*t),{left:e.left+(e.width-s)/2,top:e.top+(e.height-o)/2,width:s,height:o}}function Vt(e,t,n){const i=t!==null&&n!==null&&e.width>0&&e.height>0?Rn(e,t,n):e,s=n==="contain"?i:e;return{bbox:e,content:i,window:s,clipInset:pt(i,s),aspectRatio:t,fit:n,radius:0,radiusSource:"none",bboxRadius:0,bboxRadiusSource:"none",contentAware:t!==null&&n!==null,mediaElement:null}}function rt(e,t,n){return{...Vt(e,null,null),radius:t,radiusSource:n,bboxRadius:t,bboxRadiusSource:n}}function Xt(e,t){const n=e.aspectRatio,i=t.aspectRatio;return e.contentAware&&t.contentAware&&n!==null&&i!==null&&Math.abs(n-i)/Math.max(n,i)<.01}function Ot(e){return rt(e.bbox,e.bboxRadius,e.bboxRadiusSource)}function Bt(e,t){return Xt(e,t)?[e,t]:[Ot(e),Ot(t)]}function at(e,t,n,i){const s=xn(e),o=s?n(s):t,r=i.legacyAspectRatioAttribute?wn(e.getAttribute(i.legacyAspectRatioAttribute)??(s==null?void 0:s.getAttribute(i.legacyAspectRatioAttribute))??null):null,l=r??(s?Cn(s):null),a=s?En(s):{fit:null,centered:!0},c=a.centered&&(s===null||Pn(s))?a.fit??(r!==null?i.fallbackFit??null:null):null,u=Vt(o,l,c),p=In(e),y=s!==null&&s!==e&&p?_n(u.window,t):u.window,f=An(e,i.legacyRadiusAttribute),h=s===e||p,g=h?_t(e):{radius:0,supported:!0},S=f??g.radius,b=f!==null?"legacy":g.supported?g.radius>0?"computed":"none":"unsupported",$=[];y&&h&&Rt(y,t)&&$.push(g),y&&s&&Rt(y,o)&&$.push(_t(s));const x=$.every(A=>A.supported),C=Math.max(0,...$.map(A=>A.radius)),I=f??C,P=f!==null?"legacy":x?C>0?"computed":"none":"unsupported";return!y||P==="unsupported"?rt(t,S,b):{...u,bbox:t,window:y,clipInset:pt(u.content,y),radius:I,radiusSource:P,bboxRadius:S,bboxRadiusSource:b,mediaElement:u.contentAware?s:null}}function Zt(e,t,n,i,s){const o=n.width/i,r=n.height/s;return{left:v(e)+(v(n)-v(t))/i-o/2,top:T(e)+(T(n)-T(t))/s-r/2,width:o,height:r}}const On={enter:"contain",exit:"cover",legacy:"contain"};function M(e){return On[e]}const vt="data-hero-enter-key",Tt="data-hero-exit-key",Q="data-hero-key";class vn{constructor(){E(this,"previousFromOpacity","")}prepare(t){t.from.then(n=>{this.previousFromOpacity=n.style.opacity,n.style.opacity="0"})}contribute(t){return t.onComplete(()=>{t.from.style.opacity=this.previousFromOpacity}),[]}}const Tn=()=>new vn;class Dn{contribute(t){const{from:n,to:i,physics:s,onComplete:o}=t,r=n.style.opacity,l=i.style.opacity,a=n.style.willChange,c=i.style.willChange;return i.style.opacity="0",n.style.willChange="opacity",i.style.willChange="opacity",o(()=>{n.style.opacity=r,i.style.opacity=l,n.style.willChange=a,i.style.willChange=c}),[new m.WebAnimation({element:n,integrator:w.from(s),style:(u,p)=>({opacity:p})}),new m.WebAnimation({element:i,integrator:w.from(s),style:u=>({opacity:u})})]}}const Fn=()=>new Dn,Mn={static:Tn,fade:Fn},Yn={spring:{stiffness:320,damping:30}},Ln=()=>Yn,kn={spring:{stiffness:300,damping:30,doubleSpring:1}},Hn=()=>kn,Nn={default:Ln,smooth:Hn},Wn=700,zn="data-hero-aspect-ratio",Un="data-hero-radius";function Dt(e,t,n){const i=k(e,t);return at(t,i,s=>k(e,s),{fallbackFit:n,legacyAspectRatioAttribute:zn,legacyRadiusAttribute:Un})}function z(e,t){const n=new Map,i=e.querySelectorAll(`[${t}]`);for(const s of Array.from(i)){const o=s.getAttribute(t);o&&(n.has(o)||n.set(o,s))}return n}function Vn(e,t){const n=[],i=z(t,vt),s=z(e,Tt);for(const[l,a]of i){const c=s.get(l);c&&n.push({key:l,fromEl:c,toEl:a,fromFit:M("exit"),toFit:M("enter")})}const o=z(e,vt),r=z(t,Tt);for(const[l,a]of o){const c=r.get(l);c&&n.push({key:l,fromEl:a,toEl:c,fromFit:M("enter"),toFit:M("exit")})}return n}function Xn(e,t){const n=[],i=Array.from(t.querySelectorAll(`[${Q}]`));for(const s of i){const o=s.getAttribute(Q);if(!o)continue;const r=e.querySelector(`[${Q}="${o}"]`);r&&n.push({key:o,fromEl:r,toEl:s,fromFit:M("legacy"),toFit:M("legacy")})}return n}function Bn(e,t){const n=Vn(e,t);return n.length>0?n:Xn(e,t)}function Zn(e,t){return Bt(e,t)}function Gn(e,t){return e.radiusSource==="unsupported"||t.radiusSource==="unsupported"?!1:e.mediaElement!==null||t.mediaElement!==null||e.radiusSource==="computed"||e.radiusSource==="legacy"||t.radiusSource==="computed"||t.radiusSource==="legacy"}function jn(e,t,n){const{fromEl:i,toEl:s}=t,[o,r]=Zn(Dt(e,i,t.fromFit),Dt(e,s,t.toFit)),l=o.content,a=o.window,c=r.content,u=r.window,p=r.clipInset,d=o.radiusSource==="unsupported"||r.radiusSource==="unsupported",y=d?0:o.radius,f=d?0:r.radius;if(l.width===0||l.height===0||a.width===0||a.height===0||c.width===0||c.height===0||u.width===0||u.height===0)return null;const h=Math.max(l.width/c.width,l.height/c.height),g=v(l),S=T(l),b=v(c),$=T(c),x=g-b,C=S-$;if(Math.abs(C)>n)return null;const I=pt(c,Zt(c,l,a,h,h));return{toContent:c,fromVisualEl:o.mediaElement??i,toVisualEl:r.mediaElement??s,resetCloneRadius:Gn(o,r),styleFor:(P,A)=>{const H=A*x,Y=A*C,N=P+A*h,Qt=Math.max(0,y*A+f*P)/Math.max(Math.abs(N),1e-6),te=I.top*A+p.top*P,ee=I.right*A+p.right*P,ne=I.bottom*A+p.bottom*P,ie=I.left*A+p.left*P;return{transform:`translate(${H}px, ${Y}px) scale(${N})`,clipPath:`inset(${te}px ${ee}px ${ne}px ${ie}px round ${Qt}px)`}}}}function qn(e,t){e.style.transform=t.transform,e.style.clipPath=t.clipPath}class Kn{contribute(t){const{resolved:n,physics:i,positionedParent:s,maxDistance:o,onComplete:r}=t,l=[];for(const a of n.pairs){const c=jn(s,a,o);if(!c)continue;const{fromVisualEl:u,toVisualEl:p}=c,d=p.cloneNode(!0);d.style.position="absolute",d.style.left=`${c.toContent.left}px`,d.style.top=`${c.toContent.top}px`,d.style.width=`${c.toContent.width}px`,d.style.height=`${c.toContent.height}px`,d.style.margin="0",d.style.transformOrigin="center center",d.style.zIndex="1000",d.style.willChange="transform, clip-path",d.style.pointerEvents="none",d.style.maxWidth="none",d.style.maxHeight="none",c.resetCloneRadius&&(d.style.borderRadius="0"),qn(d,c.styleFor(0,1)),s.appendChild(d);const y=u.style.opacity,f=p.style.opacity;u.style.opacity="0",p.style.opacity="0",r(()=>{u.style.opacity=y,p.style.opacity=f,d.parentElement&&d.parentElement.removeChild(d)}),l.push(new m.WebAnimation({element:d,integrator:w.from(i),style:c.styleFor}))}return l}}function Jn(e){return[new Kn,Mn[e.type]()]}const Qn=e=>{const t=Jn(e),n=Nn[e.variant](),i=Wn;return{prepare:s=>{var l;const o=Promise.all([s.from,s.to]).then(([a,c])=>({pairs:Bn(a,c)})),r={from:s.from,to:s.to,resolved:o};for(const a of t)(l=a.prepare)==null||l.call(a,r);return o.then(a=>({resolved:a}))},animation:({from:s,to:o,context:r,resolved:l})=>{if(l.pairs.length===0)return new m.MultiAnimation([],{mode:"parallel"});const a=[],c=f=>{a.push(f)},u={from:s,to:o,resolved:l,physics:n,positionedParent:r.positionedParent,maxDistance:i,onComplete:c},p=[];for(const f of t)f.contribute&&p.push(...f.contribute(u));if(p.length===0)return new m.MultiAnimation([],{mode:"parallel"});const d=new m.MultiAnimation(p,{mode:"parallel"}),y=d.onComplete;return d.onComplete=()=>{y==null||y();for(const f of a)try{f()}catch(h){console.error("[hero] cleanup error",h)}},d}}};function ti(e){const{paths:t}=e,n=e.type??"static",i=e.variant??"default";return _(t,()=>Qn({type:n,variant:i}))}const ei={spring:{stiffness:50,damping:30}},ni={spring:{stiffness:80,damping:25}},ii=(e={})=>{const t=e.physics??ei,n=e.initialRotation??45,i=e.initialScale??.01,s=e.rotationTriggerPoint??.8;return{prepare:({from:o,to:r,context:l})=>(o.then(a=>{a.style.opacity="1"}),r.then(a=>{const c=D(l,"to"),u=Math.min(c.width,c.height)*.4;a.style.setProperty("--max-border-radius",`${u}px`),a.style.setProperty("--border-radius-scale","1"),a.style.willChange="transform",a.style.backfaceVisibility="hidden";const p=c.left+c.width/2,d=c.top+c.height/2;a.style.transformOrigin=`${p}px ${d}px`,a.style.position="fixed",a.style.top=`${c.top}px`,a.style.left=`${c.left}px`,a.style.width=`${c.width}px`,a.style.height=`${c.height}px`,a.style.zIndex="1000",a.style.overflow="hidden",a.style.transform=`rotate(${n}deg) scale(${i}) translateZ(0)`,a.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",a.style.opacity="1"}),{}),animation:({from:o,to:r})=>{const l=new m.WebAnimation({element:o,integrator:w.from(ni),style:(c,u)=>({opacity:u}),onComplete:()=>{o.style.opacity=""}}),a=new m.WebAnimation({element:r,integrator:w.from(t),style:c=>{let u;if(c<=.05)u=i;else if(c<=s){const f=(c-.05)/(s-.05),h=Math.pow(f,9);u=i+(.8-i)*h}else{const f=(c-s)/(1-s);u=.8+.2*(1-Math.pow(1-f,3))}const p=.7;let d;if(c<=p)d=n;else{const f=(c-p)/(1-p),h=1-Math.pow(1-f,2);d=n*(1-h)}let y;if(c<=p)y=1;else{const f=(c-p)/(1-p);y=1-Math.pow(f,.5)}return{transform:`rotate(${d.toFixed(2)}deg) scale(${u.toFixed(4)}) translateZ(0)`,"--border-radius-scale":y.toFixed(4)}},onComplete:()=>{r.style.willChange="",r.style.backfaceVisibility="",r.style.removeProperty("--max-border-radius"),r.style.removeProperty("--border-radius-scale"),r.style.transform="",r.style.transformOrigin="",r.style.position="",r.style.zIndex="",r.style.top="",r.style.left="",r.style.width="",r.style.height="",r.style.overflow="",r.style.borderRadius=""}});return new m.MultiAnimation([l,a],{mode:"parallel"})}}};function si(e){const{paths:t}=e;return _(t,()=>ii())}const oi={spring:{stiffness:100,damping:30}},ri=(e={})=>{const t=e.physics??oi;return{prepare:({from:n,to:i})=>(n.then(s=>{s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),i.then(s=>{s.style.opacity="0",s.style.transform="rotate(-180deg)",s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),{}),animation:({from:n,to:i})=>{const s=new m.WebAnimation({element:n,integrator:w.from(t),style:r=>({transform:`rotate(${r*180}deg)`,opacity:r<.5?1:0}),onComplete:()=>{n.style.willChange="auto",n.style.transform="",n.style.transformOrigin="",n.style.opacity=""}}),o=new m.WebAnimation({element:i,integrator:w.from(t),style:(r,l)=>({transform:`rotate(${-l*180}deg)`,opacity:r>.5?1:0}),onComplete:()=>{i.style.willChange="auto",i.style.transform="",i.style.transformOrigin="",i.style.opacity=""}});return new m.MultiAnimation([s,o],{mode:"parallel"})}}};function ai(e){const{paths:t}=e;return _(t,()=>ri())}const li={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},Ft=(e={})=>{const t=e.direction??"up",n=e.physics??li,i=t==="up",s=i?R:O,o=i?O:R;return{prepare:({from:r,to:l})=>(r.then(a=>{a.style.zIndex=s,a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.pointerEvents="none"}),l.then(a=>{a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.position="relative",a.style.zIndex=o}),{}),animation:({from:r,to:l})=>{const a=r.offsetHeight,c=l.offsetHeight,u=window.innerHeight,p=Math.max(Math.min(a,c),u),d=new m.WebAnimation({element:r,integrator:w.from(n),style:f=>({transform:`translate3d(0, ${i?-p*f:p*f}px, 0)`}),onComplete:()=>{r.style.willChange="auto",r.style.backfaceVisibility="",r.style.contain="",r.style.transform="",r.style.pointerEvents="",r.style.zIndex=""}}),y=new m.WebAnimation({element:l,integrator:w.from(n),style:(f,h)=>({transform:`translate3d(0, ${i?h*p:h*-p}px, 0)`}),onComplete:()=>{l.style.willChange="auto",l.style.backfaceVisibility="",l.style.contain="",l.style.transform="",l.style.position==="relative"&&(l.style.position=""),l.style.zIndex===o&&(l.style.zIndex="")}});for(const f of[d,y]){const h=f.onComplete;f.onComplete=()=>{h==null||h(),f.releaseFill()}}return new m.MultiAnimation([d,y],{mode:"parallel"})}}};function ci(e){const{paths:t,type:n="directional"}=e;return n==="non-directional"?_(t,()=>Ft({direction:"up"})):ct(t,{forward:"up",backward:"down"},i=>Ft({direction:i}))}const pi={spring:{stiffness:200,damping:24}},ui={inertia:{acceleration:25,resistance:1.2}},tt=.2;function di(){return{enterPhysics:pi,exitPhysics:ui,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-tt*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-tt+tt*e})`,opacity:e})}}}const fi={spring:{stiffness:200,damping:24}},hi={inertia:{acceleration:25,resistance:1.2}},et=.08,yi=16,nt=.6,mi=e=>`blur(${Math.max(0,e).toFixed(2)}px)`;function gi(){return{enterPhysics:fi,exitPhysics:hi,background:{willChange:"transform, opacity",enterStyle:e=>({transform:`scale(${1-et*e})`,opacity:1-(1-nt)*e}),exitStyle:e=>({transform:`scale(${1-et+et*e})`,opacity:nt+(1-nt)*e})},overlay:{willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,i=mi(yi*n);return{backdropFilter:i,WebkitBackdropFilter:i}}}}}const bi={spring:{stiffness:200,damping:24}},wi={inertia:{acceleration:25,resistance:1.2}};function Si(){return{enterPhysics:bi,exitPhysics:wi,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const xi={static:Si(),"background-scale":di(),blur:gi()},Ci="static",$i="transform",Ei=(e={})=>{const t=e.direction??"enter",n=xi[e.type??Ci],i=t==="enter"?n.enterPhysics:n.exitPhysics,s=n.background,o=n.overlay,r=s.willChange!=="";return{prepare:({from:l,to:a,context:c,createElement:u})=>{const p=t==="enter"?a:l,d=t==="enter"?l:a;p.then(f=>{f.style.willChange=$i,f.style.backfaceVisibility="hidden",f.style.contain="layout paint",f.style.zIndex=O,t==="enter"?f.style.position="relative":f.style.pointerEvents="none"}),d.then(f=>{r&&(f.style.willChange=s.willChange,f.style.backfaceVisibility="hidden",f.style.contain="layout paint"),f.style.zIndex=R,t==="enter"?f.style.pointerEvents="none":f.style.position="relative"});let y;return o&&(y=u("sheet-overlay"),Object.assign(y.style,o.initialStyle),y.style.willChange=o.willChange,c.positionedParent.appendChild(y)),{overlay:y}},animation:({from:l,to:a,context:c,overlay:u})=>{const p=t==="enter"?a:l,d=t==="enter"?l:a,y=D(c,t==="enter"?"to":"from"),f=()=>{l.style.pointerEvents="",l.style.zIndex=""},h=()=>{const x=t==="enter"?O:R;a.style.position==="relative"&&(a.style.position=""),a.style.zIndex===x&&(a.style.zIndex="")},g=x=>{const C=x.onComplete;x.onComplete=()=>{C==null||C(),x.releaseFill()}};p.style.clipPath=`inset(${y.top}px 0 calc(100% - ${y.top+y.height}px) 0)`;const S=t==="enter"?(x,C)=>({transform:`translate3d(0, ${C*y.height}px, 0)`}):x=>({transform:`translate3d(0, ${x*y.height}px, 0)`}),b=new m.WebAnimation({element:p,integrator:w.from(i),style:S,onComplete:()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.contain="",p.style.clipPath="",p.style.transform="",f(),h()}});g(b);const $=[b];if(r){const x=d.scrollHeight;x>0&&(d.style.height=`${x}px`);const C=D(c,t==="enter"?"from":"to"),I=C.left+C.width/2,P=C.top+C.height/2;d.style.clipPath=`inset(${C.top}px 0 calc(100% - ${C.top+C.height}px) 0)`,d.style.transformOrigin=`${I}px ${P}px`;const A=t==="enter"?(Y,N)=>s.enterStyle(Y,N):Y=>s.exitStyle(Y),H=new m.WebAnimation({element:d,integrator:w.from(i),style:A,onComplete:()=>{d.style.willChange="auto",d.style.backfaceVisibility="",d.style.contain="",d.style.clipPath="",d.style.transformOrigin="",d.style.transform="",d.style.opacity="",d.style.height=""}});g(H),$.push(H)}if(u&&o){u.style.zIndex=zt;const x=Nt(c,"to");u.style.top=`${x.top}px`,u.style.height=`${x.height}px`,$.push(new m.WebAnimation({element:u,integrator:w.from(i),style:C=>o.style(t,C)}))}return new m.MultiAnimation($,{mode:"parallel"})}}};function Ai(e){return e==="scale"||e==="background-scale"?"background-scale":e==="blur"?"blur":"static"}function Pi(e){const{enter:t,exit:n}=e,i=e.type,s=Ai(i);return Ht({enter:t,exit:n},o=>Ei({direction:o,type:s}))}const Ii={spring:{stiffness:170,damping:22,doubleSpring:.8}},_i=(e={})=>{const t=e.direction??"left",n=e.physics??Ii,i=t==="left";return{prepare:({from:s,to:o})=>(s.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),o.then(r=>{const l=i?100:-100;r.style.transform=`translate3d(${l}%, 0, 0)`,r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}),animation:({from:s,to:o})=>{const r=new m.WebAnimation({element:s,integrator:w.from(n),style:a=>({transform:`translate3d(${i?-100*a:100*a}%, 0, 0)`}),onComplete:()=>{s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain="",s.style.transform="",s.style.pointerEvents=""}}),l=new m.WebAnimation({element:o,integrator:w.from(n),style:(a,c)=>({transform:`translate3d(${i?c*100:c*-100}%, 0, 0)`}),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform=""}});return new m.MultiAnimation([r,l],{mode:"parallel"})}}};function Ri(e){const{paths:t}=e;return ct(t,{forward:"left",backward:"right"},n=>_i({direction:n}))}const Oi={spring:{stiffness:17,damping:6}},it=20,U=800,vi=(e={})=>{const t=e.physics??Oi;return{prepare:({from:n,to:i})=>(n.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.pointerEvents="none",s.style.transform=`perspective(${U}px) rotateY(0deg) translate3d(0%, 0, 0)`}),i.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.transform=`perspective(${U}px) rotateY(${it}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:i})=>{const s=new m.WebAnimation({element:n,integrator:w.from(t),style:r=>{const l=-r*it,a=r*100;return{transform:`perspective(${U}px) rotateY(${l}deg) translate3d(${a}%, 0, 0)`}},onComplete:()=>{n.style.transform="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.pointerEvents=""}}),o=new m.WebAnimation({element:i,integrator:w.from(t),style:(r,l)=>{const a=l*it,c=-l*100;return{transform:`perspective(${U}px) rotateY(${a}deg) translate3d(${c}%, 0, 0)`}},onComplete:()=>{i.style.transform="",i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain=""}});return new m.MultiAnimation([s,o],{mode:"sequence"})}}};function Ti(e){const{paths:t}=e;return _(t,()=>vi())}function Di(e,t){return t.left>=e.left-.01&&t.top>=e.top-.01&&t.left+t.width<=e.left+e.width+.01&&t.top+t.height<=e.top+e.height+.01}function Gt(e){const t=()=>({enterContent:e.enterRect,exitContent:e.exitRect,startWindow:e.enterRect,scaleX:e.exitRect.width/e.enterRect.width,scaleY:e.exitRect.height/e.enterRect.height}),{enterMedia:n,exitMedia:i}=e;if(!n||!i||!Xt(n,i))return t();const s=n.content,o=i.content;if(s.width<=0||s.height<=0||o.width<=0||o.height<=0)return t();const r=o.width/s.width,l=o.height/s.height,a=Zt(s,o,i.window,r,l);return Di(n.window,a)?{enterContent:s,exitContent:o,startWindow:a,scaleX:r,scaleY:l}:t()}function jt(e,t){return{top:e.top/t.height*100,right:(t.width-(e.left+e.width))/t.width*100,bottom:(t.height-(e.top+e.height))/t.height*100,left:e.left/t.width*100}}function qt(e,t,n){return{x:e/Math.max(Math.abs(t),1e-6),y:e/Math.max(Math.abs(n),1e-6)}}function Fi(e){const{pageRect:t,scrollOffset:n,enterRadius:i,exitRadius:s}=e,o=Gt(e),{enterContent:r,exitContent:l,startWindow:a,scaleX:c,scaleY:u}=o,p=l.left-r.left+(l.width-r.width)/2-n.x,d=l.top-r.top+(l.height-r.height)/2-n.y,y=jt(a,t);return{transformOrigin:`${v(r)}px ${T(r)}px`,animate:f=>{const h=1-f,g=1+(c-1)*h,S=1+(u-1)*h,b=Math.max(0,s*h+i*(1-h)),$=qt(b,g,S);return{clipPath:`inset(${y.top*h}% ${y.right*h}% ${y.bottom*h}% ${y.left*h}% round ${$.x}px / ${$.y}px)`,transform:`translate(${p*h}px, ${d*h}px) scale(${g}, ${S})`}}}}function Mi(e){const{pageRect:t,scrollOffset:n,enterRadius:i,exitRadius:s}=e,o=Gt(e),{enterContent:r,exitContent:l,startWindow:a,scaleX:c,scaleY:u}=o,p=l.left-r.left+(l.width-r.width)/2+n.x,d=l.top-r.top+(l.height-r.height)/2+n.y,y=jt(a,t);return{transformOrigin:`${v(r)}px ${T(r)}px`,animate:f=>{const h=1-f,g=1+(c-1)*h,S=1+(u-1)*h,b=Math.max(0,i*(1-h)+s*h),$=qt(b,g,S);return{clipPath:`inset(${y.top*h}% ${y.right*h}% ${y.bottom*h}% ${y.left*h}% round ${$.x}px / ${$.y}px)`,transform:`translate(${p*h-n.x}px, ${d*h}px) scale(${g}, ${S})`}}}}const Yi={spring:{stiffness:380,damping:30,doubleSpring:{stiffness:260,damping:30}}},Kt=.12,Li=18;function ki(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Kt*t})`}}}}function Hi(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Kt*t})`}}}}const st={willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,i=`blur(${Li*n}px)`;return{backdropFilter:i,WebkitBackdropFilter:i}}};class Ni{constructor(){E(this,"physics",Yi)}contribute(t){const{from:n,to:i,resolved:s,physics:o}=t,r=s.mode==="enter",l=r?n:i,a=r?ki():Hi();return a&&(l.style.transformOrigin=a.transformOrigin),[new m.WebAnimation({element:l,integrator:w.from(o),style:r?(c,u)=>a.animate(u):c=>a.animate(c)})]}}class Wi{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,st.initialStyle),n.style.willChange=st.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;if(!n)return[];n.style.zIndex=zt;const i=Nt(t.context,"to");return n.style.top=`${i.top}px`,n.style.height=`${i.height}px`,[new m.WebAnimation({element:n,integrator:w.from(t.physics),style:s=>st.style(t.resolved.mode,s)})]}}const zi={spring:{stiffness:430,damping:33,doubleSpring:1}};function Ui({enterRect:e,exitRect:t,scrollOffset:n}){const i=e.left-t.left+(e.width-t.width)/2+n.x,s=e.top-t.top+(e.height-t.height)/2+n.y,o=e.width/t.width,r=e.height/t.height,l=Math.max(o,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:a=>{const c=1-a;return{transform:`translate(${i*c-n.x}px, ${s*c}px) scale(${1+(l-1)*c})`}}}}function Vi({enterRect:e,exitRect:t,scrollOffset:n}){const i=e.left-t.left+(e.width-t.width)/2-n.x,s=e.top-t.top+(e.height-t.height)/2-n.y,o=e.width/t.width,r=e.height/t.height,l=Math.max(o,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:a=>{const c=1-a;return{transform:`translate(${i*c}px, ${s*c}px) scale(${1+(l-1)*c})`}}}}class Xi{constructor(){E(this,"physics",zi)}contribute(t){const{from:n,to:i,resolved:s,input:o,physics:r}=t,l=s.mode==="enter",a=l?n:i,c=l?Ui(o):Vi(o);return c&&(a.style.transformOrigin=c.transformOrigin),[new m.WebAnimation({element:a,integrator:w.from(r),style:l?(u,p)=>c.animate(p):u=>c.animate(u)})]}}const Bi={spring:{stiffness:530,damping:34,doubleSpring:1}};class Zi{constructor(){E(this,"physics",Bi)}contribute(t){return[]}}const Gi={expand:()=>new Xi,static:()=>new Zi,blur:()=>new Ni};function ji(e){return Gi[e]()}const lt="data-zoom-enter-key",Mt="data-zoom-exit-key",Yt="data-zoom-radius";function qi(e,t){return Math.abs(e.left-t.left)<.01&&Math.abs(e.top-t.top)<.01&&Math.abs(e.width-t.width)<.01&&Math.abs(e.height-t.height)<.01}function Ki(e,t){const n=[];let i=t;for(;i&&i!==e;){const s=i.parentElement;if(!s)break;for(const o of Array.from(s.children))o!==i&&o instanceof HTMLElement&&n.push(o);i=s}return n}function Lt(e){const t=e.querySelectorAll(`[${lt}]`);return t.length!==1?null:t[0]}function kt(e,t){const n=e.querySelectorAll(`[${Mt}]`);for(const i of n)if(i.getAttribute(Mt)===t)return i;return null}function Ji(e,t){const n=Lt(e),i=Lt(t);if(!n&&i){const s=i.getAttribute(lt);if(!s)return null;const o=kt(e,s);return o?{mode:"enter",enterEl:i,exitEl:o}:null}if(n&&!i){const s=n.getAttribute(lt);if(!s)return null;const o=kt(t,s);return o?{mode:"exit",enterEl:n,exitEl:o}:null}return null}function Qi(e,t,n,i){const s=e.mode==="enter"?n:t,o=e.mode==="enter"?t:n,r=W(s,e.enterEl),l=W(o,e.exitEl),a=at(e.enterEl,r,g=>W(s,g),{legacyRadiusAttribute:Yt}),c=at(e.exitEl,l,g=>W(o,g),{legacyRadiusAttribute:Yt}),[u,p]=Bt(a,c),d=u.contentAware&&p.contentAware,y=e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),f={left:0,top:0,width:y.width,height:y.height},h=u.radiusSource==="legacy"||qi(u.window,f)?u.radius:0;return{enterRect:r,exitRect:l,...d?{enterMedia:u,exitMedia:p}:{},pageRect:y,scrollOffset:i,enterRadius:h,exitRadius:p.radius}}class ts{prepare(t){t.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(t){const{from:n,to:i,resolved:s,input:o,physics:r,onComplete:l}=t,a=s.mode==="enter",c=a?Fi(o):Mi(o),u=a?i:n,p=a?"t":"u";c&&(u.style.transformOrigin=c.transformOrigin);const d=a?R:O,y=a?O:R,f=n.style.zIndex;n.style.zIndex=d;const h=i.style.zIndex,g=i.style.position;return i.style.zIndex=y,i.style.position="relative",l(()=>{u.style.willChange="auto",u.style.backfaceVisibility="",u.style.transformOrigin="",u.style.contain="",n.style.zIndex=f,i.style.zIndex===y&&(i.style.zIndex=h),i.style.position==="relative"&&(i.style.position=g),i.style.transformOrigin="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.transformOrigin="",n.style.contain="",n.style.transform="",n.style.clipPath=""}),[new m.WebAnimation({element:u,integrator:w.from(r),style:p==="t"?S=>c.animate(S):(S,b)=>c.animate(b)})]}}class es{contribute(t){const{resolved:n,physics:i,from:s,to:o,onComplete:r}=t,l=n.mode==="enter"?o:s,a=Ki(l,n.enterEl);if(a.length===0)return[];const c=a.map(u=>u.style.opacity);if(n.mode==="enter")for(const u of a)u.style.opacity="0";return r(()=>{for(let u=0;u<a.length;u++){const p=a[u];p&&(p.style.opacity=c[u]??"")}}),a.map(u=>new m.WebAnimation({element:u,integrator:w.from(i),style:(p,d)=>({opacity:n.mode==="enter"?p:d})}))}}class Jt{contribute(){return[]}}const ns={default:()=>new Jt,fade:()=>new es};function is(e){return ns[e]()}class ss extends Jt{}function os(e){const t=ji(e.type);return{strategies:[new ts,t,is(e.variant),new ss,...e.type==="blur"?[new Wi]:[]],physics:t.physics}}const rs=e=>{const{strategies:t,physics:n}=os(e);return{prepare:i=>{const s={from:i.from,to:i.to,context:{positionedParent:i.context.positionedParent},createElement:i.createElement},o={};for(const r of t){if(!r.prepare)continue;const l=r.prepare(s);l&&Object.assign(o,l)}return o},animation:({from:i,to:s,context:o,...r})=>{const l=Ji(i,s);if(!l)return new m.MultiAnimation([],{mode:"parallel"});const a=Qi(l,i,s,o.scrollOffset),c=[],p={from:i,to:s,resolved:l,input:a,physics:n,context:o,extras:r,onComplete:f=>{c.push(f)}},d=[];for(const f of t)f.contribute&&d.push(...f.contribute(p));const y=d[0];if(y){const f=y.onComplete;y.onComplete=()=>{f==null||f();for(const h of c)try{h()}catch(g){console.error("[zoom] cleanup error",g)}}}for(const f of d){if(!(f instanceof m.WebAnimation))continue;const h=f.onComplete;f.onComplete=()=>{h==null||h(),f.releaseFill()}}return new m.MultiAnimation(d,{mode:"parallel"})}}};function as(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function ls(e){const t=as(e);return _(e.paths,()=>rs(t))}exports.Animation=m.Animation;exports.MultiAnimation=m.MultiAnimation;exports.WebAnimation=m.WebAnimation;exports.axis=We;exports.blind=Ze;exports.drill=on;exports.fade=cn;exports.film=bn;exports.hero=ti;exports.jaemin=si;exports.rotate=ai;exports.scroll=ci;exports.sheet=Pi;exports.slide=Ri;exports.strip=Ti;exports.zoom=ls;
|
|
35
|
+
)`}function J(e,t,n,i,s){const o=n/1e3;return new m.WebAnimation({element:e,integrator:new ue({durationSec:o}),lowerBound:0,upperBound:1,style:r=>i(hn(t,r)),onComplete:s})}const gn=(e={})=>{var s;const t=((s=e.border)==null?void 0:s.color)??un,n=pn,i=e.physics;return{prepare:({from:o,to:r,context:l})=>{const a=D(l,"from"),c=D(l,"to"),u=k(document.body,l.positionedParent),p=mn(t,{...a,top:u.top});for(const d of["topLeft","topRight","bottomLeft","bottomRight"])l.positionedParent.appendChild(p[d]);return o.then(d=>{Pt(d,a),It(d,a),d.style.transform=`translateY(${-a.top}px)`}),r.then(d=>{Pt(d,c),It(d,c),d.style.transform=`translateY(${-c.top+c.height}px) scale(${n})`}),{borders:p,fromRect:a,toRect:c}},animation:({from:o,to:r,context:l,borders:a,fromRect:c,toRect:u})=>{const p=At({rect:c,scale:n,direction:"out",override:i}),d=At({rect:u,scale:n,direction:"in",override:i}),y=J(o,p.snapshots,p.totalDuration,b=>({transform:`translateY(${b.translateY}px) scale(${b.scale})`}),()=>{o.style.clipPath="",o.style.transformOrigin="",o.style.transform=""}),f=J(r,d.snapshots,d.totalDuration,b=>({transform:`translateY(${b.translateY}px) scale(${b.scale})`}),()=>{r.style.clipPath="",r.style.transformOrigin="",r.style.transform=""}),h=yn.map(([b,$],x)=>{const C=["topLeft","topRight","bottomLeft","bottomRight"][x];return J(a[C],p.snapshots,p.totalDuration,I=>{const P=(c.width-c.width*I.scale)/2*.7*b,A=(c.height-c.height*I.scale)/2*.7*$;return{transform:`translate(${P}px, ${A}px)`}})}),g=new m.MultiAnimation([y,f,...h],{mode:"parallel"}),S=g.onComplete;return g.onComplete=()=>{S==null||S();const b=l.positionedParent;for(const $ of["topLeft","topRight","bottomLeft","bottomRight"]){const x=a[$];x.parentElement===b&&b.removeChild(x)}},g}}};function bn(e){const{paths:t,options:n}=e,i=(n==null?void 0:n.borderColor)!==void 0?{border:{color:n.borderColor}}:void 0;return _(t,()=>gn(i))}function wn(e){if(!e)return null;if(e.includes("/")){const n=e.split("/");if(n.length!==2)return null;const i=Number.parseFloat(n[0]??""),s=Number.parseFloat(n[1]??"");return Number.isFinite(i)&&Number.isFinite(s)&&i>0&&s>0?i/s:null}const t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function Sn(e){return e==="contain"||e==="cover"?e:null}function ot(e){return e.tagName==="IMG"}function xn(e){if(ot(e))return e;if(e.tagName==="PICTURE"||e.tagName==="VIDEO")return null;const t=[];for(const n of Array.from(e.children)){const i=n;ot(i)&&t.push(i)}return t.length===1?t[0]??null:null}function Cn(e){var a,c;if(!ot(e))return null;const t=e,n=t.naturalWidth,i=t.naturalHeight;if(typeof n=="number"&&typeof i=="number"&&Number.isFinite(n)&&Number.isFinite(i)&&n>0&&i>0)return n/i;const s=((a=e.getAttribute("width"))==null?void 0:a.trim())??"",o=((c=e.getAttribute("height"))==null?void 0:c.trim())??"",r=s===""?Number.NaN:Number(s),l=o===""?Number.NaN:Number(o);return Number.isFinite(r)&&Number.isFinite(l)&&r>0&&l>0?r/l:null}function $n(e){const t=e.trim().toLowerCase().replace(/\s+/g," ");return t===""||t==="center"||t==="center center"||t==="50% 50%"}function X(e){if(typeof getComputedStyle=="function")try{return getComputedStyle(e)}catch{}return e.style}function En(e){const t=X(e),n=$n(t.objectPosition??"");return{fit:n?Sn(t.objectFit??null):null,centered:n}}function Ut(e){if(!e)return 0;const t=/^(-?(?:\d+\.?\d*|\.\d+))px$/.exec(e.trim());if(!t)return null;const n=Number.parseFloat(t[1]??"");return Number.isFinite(n)&&n>=0?n:null}function _t(e){const t=X(e),n=[t.borderTopLeftRadius,t.borderTopRightRadius,t.borderBottomRightRadius,t.borderBottomLeftRadius].map(Ut),i=n[0];if(i==null)return{radius:0,supported:!1};const s=n.every(o=>o!==null&&Math.abs(o-i)<.001);return{radius:s?i:0,supported:s}}function An(e,t){var s;if(!t)return null;const n=(s=e.getAttribute(t))==null?void 0:s.trim();if(n==null||n==="")return null;const i=Number.parseFloat(n);return Number.isFinite(i)&&i>=0?i:null}function Pn(e){const t=X(e);return[t.paddingTop,t.paddingRight,t.paddingBottom,t.paddingLeft,t.borderTopWidth,t.borderRightWidth,t.borderBottomWidth,t.borderLeftWidth].every(i=>i?Ut(i)===0:!0)}function In(e){const t=X(e),n=i=>i==="hidden"||i==="clip";return n(t.overflowX)&&n(t.overflowY)}function v(e){return e.left+e.width/2}function T(e){return e.top+e.height/2}function pt(e,t){return{top:Math.max(0,t.top-e.top),right:Math.max(0,e.left+e.width-(t.left+t.width)),bottom:Math.max(0,e.top+e.height-(t.top+t.height)),left:Math.max(0,t.left-e.left)}}function _n(e,t){const n=Math.max(e.left,t.left),i=Math.max(e.top,t.top),s=Math.min(e.left+e.width,t.left+t.width),o=Math.min(e.top+e.height,t.top+t.height);return s>n&&o>i?{left:n,top:i,width:s-n,height:o-i}:null}function Rt(e,t){return Math.abs(e.left-t.left)<.01&&Math.abs(e.top-t.top)<.01&&Math.abs(e.width-t.width)<.01&&Math.abs(e.height-t.height)<.01}function Rn(e,t,n){const i=e.width/e.height;let s,o;return n==="contain"?i>t?(o=e.height,s=o*t):(s=e.width,o=s/t):i>t?(s=e.width,o=s/t):(o=e.height,s=o*t),{left:e.left+(e.width-s)/2,top:e.top+(e.height-o)/2,width:s,height:o}}function Vt(e,t,n){const i=t!==null&&n!==null&&e.width>0&&e.height>0?Rn(e,t,n):e,s=n==="contain"?i:e;return{bbox:e,content:i,window:s,clipInset:pt(i,s),aspectRatio:t,fit:n,radius:0,radiusSource:"none",bboxRadius:0,bboxRadiusSource:"none",contentAware:t!==null&&n!==null,mediaElement:null}}function rt(e,t,n){return{...Vt(e,null,null),radius:t,radiusSource:n,bboxRadius:t,bboxRadiusSource:n}}function Xt(e,t){const n=e.aspectRatio,i=t.aspectRatio;return e.contentAware&&t.contentAware&&n!==null&&i!==null&&Math.abs(n-i)/Math.max(n,i)<.01}function Ot(e){return rt(e.bbox,e.bboxRadius,e.bboxRadiusSource)}function Bt(e,t){return Xt(e,t)?[e,t]:[Ot(e),Ot(t)]}function at(e,t,n,i){const s=xn(e),o=s?n(s):t,r=i.legacyAspectRatioAttribute?wn(e.getAttribute(i.legacyAspectRatioAttribute)??(s==null?void 0:s.getAttribute(i.legacyAspectRatioAttribute))??null):null,l=r??(s?Cn(s):null),a=s?En(s):{fit:null,centered:!0},c=a.centered&&(s===null||Pn(s))?a.fit??(r!==null?i.fallbackFit??null:null):null,u=Vt(o,l,c),p=In(e),y=s!==null&&s!==e&&p?_n(u.window,t):u.window,f=An(e,i.legacyRadiusAttribute),h=s===e||p,g=h?_t(e):{radius:0,supported:!0},S=f??g.radius,b=f!==null?"legacy":g.supported?g.radius>0?"computed":"none":"unsupported",$=[];y&&h&&Rt(y,t)&&$.push(g),y&&s&&Rt(y,o)&&$.push(_t(s));const x=$.every(A=>A.supported),C=Math.max(0,...$.map(A=>A.radius)),I=f??C,P=f!==null?"legacy":x?C>0?"computed":"none":"unsupported";return!y||P==="unsupported"?rt(t,S,b):{...u,bbox:t,window:y,clipInset:pt(u.content,y),radius:I,radiusSource:P,bboxRadius:S,bboxRadiusSource:b,mediaElement:u.contentAware?s:null}}function Zt(e,t,n,i,s){const o=n.width/i,r=n.height/s;return{left:v(e)+(v(n)-v(t))/i-o/2,top:T(e)+(T(n)-T(t))/s-r/2,width:o,height:r}}const On={enter:"contain",exit:"cover",legacy:"contain"};function M(e){return On[e]}const vt="data-hero-enter-key",Tt="data-hero-exit-key",Q="data-hero-key";class vn{constructor(){E(this,"previousFromOpacity","")}prepare(t){t.from.then(n=>{this.previousFromOpacity=n.style.opacity,n.style.opacity="0"})}contribute(t){return t.onComplete(()=>{t.from.style.opacity=this.previousFromOpacity}),[]}}const Tn=()=>new vn;class Dn{contribute(t){const{from:n,to:i,physics:s,onComplete:o}=t,r=n.style.opacity,l=i.style.opacity,a=n.style.willChange,c=i.style.willChange;return i.style.opacity="0",n.style.willChange="opacity",i.style.willChange="opacity",o(()=>{n.style.opacity=r,i.style.opacity=l,n.style.willChange=a,i.style.willChange=c}),[new m.WebAnimation({element:n,integrator:w.from(s),style:(u,p)=>({opacity:p})}),new m.WebAnimation({element:i,integrator:w.from(s),style:u=>({opacity:u})})]}}const Fn=()=>new Dn,Mn={static:Tn,fade:Fn},Yn={spring:{stiffness:320,damping:30}},Ln=()=>Yn,kn={spring:{stiffness:300,damping:30,doubleSpring:1}},Hn=()=>kn,Nn={default:Ln,smooth:Hn},Wn=700,zn="data-hero-aspect-ratio",Un="data-hero-radius";function Dt(e,t,n){const i=k(e,t);return at(t,i,s=>k(e,s),{fallbackFit:n,legacyAspectRatioAttribute:zn,legacyRadiusAttribute:Un})}function z(e,t){const n=new Map,i=e.querySelectorAll(`[${t}]`);for(const s of Array.from(i)){const o=s.getAttribute(t);o&&(n.has(o)||n.set(o,s))}return n}function Vn(e,t){const n=[],i=z(t,vt),s=z(e,Tt);for(const[l,a]of i){const c=s.get(l);c&&n.push({key:l,fromEl:c,toEl:a,fromFit:M("exit"),toFit:M("enter")})}const o=z(e,vt),r=z(t,Tt);for(const[l,a]of o){const c=r.get(l);c&&n.push({key:l,fromEl:a,toEl:c,fromFit:M("enter"),toFit:M("exit")})}return n}function Xn(e,t){const n=[],i=Array.from(t.querySelectorAll(`[${Q}]`));for(const s of i){const o=s.getAttribute(Q);if(!o)continue;const r=e.querySelector(`[${Q}="${o}"]`);r&&n.push({key:o,fromEl:r,toEl:s,fromFit:M("legacy"),toFit:M("legacy")})}return n}function Bn(e,t){const n=Vn(e,t);return n.length>0?n:Xn(e,t)}function Zn(e,t){return Bt(e,t)}function Gn(e,t){return e.radiusSource==="unsupported"||t.radiusSource==="unsupported"?!1:e.mediaElement!==null||t.mediaElement!==null||e.radiusSource==="computed"||e.radiusSource==="legacy"||t.radiusSource==="computed"||t.radiusSource==="legacy"}function jn(e,t,n){const{fromEl:i,toEl:s}=t,[o,r]=Zn(Dt(e,i,t.fromFit),Dt(e,s,t.toFit)),l=o.content,a=o.window,c=r.content,u=r.window,p=r.clipInset,d=o.radiusSource==="unsupported"||r.radiusSource==="unsupported",y=d?0:o.radius,f=d?0:r.radius;if(l.width===0||l.height===0||a.width===0||a.height===0||c.width===0||c.height===0||u.width===0||u.height===0)return null;const h=Math.max(l.width/c.width,l.height/c.height),g=v(l),S=T(l),b=v(c),$=T(c),x=g-b,C=S-$;if(Math.abs(C)>n)return null;const I=pt(c,Zt(c,l,a,h,h));return{toContent:c,fromVisualEl:o.mediaElement??i,toVisualEl:r.mediaElement??s,resetCloneRadius:Gn(o,r),styleFor:(P,A)=>{const H=A*x,Y=A*C,N=P+A*h,Qt=Math.max(0,y*A+f*P)/Math.max(Math.abs(N),1e-6),te=I.top*A+p.top*P,ee=I.right*A+p.right*P,ne=I.bottom*A+p.bottom*P,ie=I.left*A+p.left*P;return{transform:`translate(${H}px, ${Y}px) scale(${N})`,clipPath:`inset(${te}px ${ee}px ${ne}px ${ie}px round ${Qt}px)`}}}}function qn(e,t){e.style.transform=t.transform,e.style.clipPath=t.clipPath}class Kn{contribute(t){const{resolved:n,physics:i,positionedParent:s,maxDistance:o,onComplete:r}=t,l=[];for(const a of n.pairs){const c=jn(s,a,o);if(!c)continue;const{fromVisualEl:u,toVisualEl:p}=c,d=p.cloneNode(!0);d.style.position="absolute",d.style.left=`${c.toContent.left}px`,d.style.top=`${c.toContent.top}px`,d.style.width=`${c.toContent.width}px`,d.style.height=`${c.toContent.height}px`,d.style.margin="0",d.style.transformOrigin="center center",d.style.zIndex="1000",d.style.willChange="transform, clip-path",d.style.pointerEvents="none",d.style.maxWidth="none",d.style.maxHeight="none",c.resetCloneRadius&&(d.style.borderRadius="0"),qn(d,c.styleFor(0,1)),s.appendChild(d);const y=u.style.opacity,f=p.style.opacity;u.style.opacity="0",p.style.opacity="0",r(()=>{u.style.opacity=y,p.style.opacity=f,d.parentElement&&d.parentElement.removeChild(d)}),l.push(new m.WebAnimation({element:d,integrator:w.from(i),style:c.styleFor}))}return l}}function Jn(e){return[new Kn,Mn[e.type]()]}const Qn=e=>{const t=Jn(e),n=Nn[e.variant](),i=Wn;return{prepare:s=>{var l;const o=Promise.all([s.from,s.to]).then(([a,c])=>({pairs:Bn(a,c)})),r={from:s.from,to:s.to,resolved:o};for(const a of t)(l=a.prepare)==null||l.call(a,r);return o.then(a=>({resolved:a}))},animation:({from:s,to:o,context:r,resolved:l})=>{if(l.pairs.length===0)return new m.MultiAnimation([],{mode:"parallel"});const a=[],c=f=>{a.push(f)},u={from:s,to:o,resolved:l,physics:n,positionedParent:r.positionedParent,maxDistance:i,onComplete:c},p=[];for(const f of t)f.contribute&&p.push(...f.contribute(u));if(p.length===0)return new m.MultiAnimation([],{mode:"parallel"});const d=new m.MultiAnimation(p,{mode:"parallel"}),y=d.onComplete;return d.onComplete=()=>{y==null||y();for(const f of a)try{f()}catch(h){console.error("[hero] cleanup error",h)}},d}}};function ti(e){const{paths:t}=e,n=e.type??"static",i=e.variant??"default";return _(t,()=>Qn({type:n,variant:i}))}const ei={spring:{stiffness:50,damping:30}},ni={spring:{stiffness:80,damping:25}},ii=(e={})=>{const t=e.physics??ei,n=e.initialRotation??45,i=e.initialScale??.01,s=e.rotationTriggerPoint??.8;return{prepare:({from:o,to:r,context:l})=>(o.then(a=>{a.style.opacity="1"}),r.then(a=>{const c=D(l,"to"),u=Math.min(c.width,c.height)*.4;a.style.setProperty("--max-border-radius",`${u}px`),a.style.setProperty("--border-radius-scale","1"),a.style.willChange="transform",a.style.backfaceVisibility="hidden";const p=c.left+c.width/2,d=c.top+c.height/2;a.style.transformOrigin=`${p}px ${d}px`,a.style.position="fixed",a.style.top=`${c.top}px`,a.style.left=`${c.left}px`,a.style.width=`${c.width}px`,a.style.height=`${c.height}px`,a.style.zIndex="1000",a.style.overflow="hidden",a.style.transform=`rotate(${n}deg) scale(${i}) translateZ(0)`,a.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",a.style.opacity="1"}),{}),animation:({from:o,to:r})=>{const l=new m.WebAnimation({element:o,integrator:w.from(ni),style:(c,u)=>({opacity:u}),onComplete:()=>{o.style.opacity=""}}),a=new m.WebAnimation({element:r,integrator:w.from(t),style:c=>{let u;if(c<=.05)u=i;else if(c<=s){const f=(c-.05)/(s-.05),h=Math.pow(f,9);u=i+(.8-i)*h}else{const f=(c-s)/(1-s);u=.8+.2*(1-Math.pow(1-f,3))}const p=.7;let d;if(c<=p)d=n;else{const f=(c-p)/(1-p),h=1-Math.pow(1-f,2);d=n*(1-h)}let y;if(c<=p)y=1;else{const f=(c-p)/(1-p);y=1-Math.pow(f,.5)}return{transform:`rotate(${d.toFixed(2)}deg) scale(${u.toFixed(4)}) translateZ(0)`,"--border-radius-scale":y.toFixed(4)}},onComplete:()=>{r.style.willChange="",r.style.backfaceVisibility="",r.style.removeProperty("--max-border-radius"),r.style.removeProperty("--border-radius-scale"),r.style.transform="",r.style.transformOrigin="",r.style.position="",r.style.zIndex="",r.style.top="",r.style.left="",r.style.width="",r.style.height="",r.style.overflow="",r.style.borderRadius=""}});return new m.MultiAnimation([l,a],{mode:"parallel"})}}};function si(e){const{paths:t}=e;return _(t,()=>ii())}const oi={spring:{stiffness:100,damping:30}},ri=(e={})=>{const t=e.physics??oi;return{prepare:({from:n,to:i})=>(n.then(s=>{s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),i.then(s=>{s.style.opacity="0",s.style.transform="rotate(-180deg)",s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),{}),animation:({from:n,to:i})=>{const s=new m.WebAnimation({element:n,integrator:w.from(t),style:r=>({transform:`rotate(${r*180}deg)`,opacity:r<.5?1:0}),onComplete:()=>{n.style.willChange="auto",n.style.transform="",n.style.transformOrigin="",n.style.opacity=""}}),o=new m.WebAnimation({element:i,integrator:w.from(t),style:(r,l)=>({transform:`rotate(${-l*180}deg)`,opacity:r>.5?1:0}),onComplete:()=>{i.style.willChange="auto",i.style.transform="",i.style.transformOrigin="",i.style.opacity=""}});return new m.MultiAnimation([s,o],{mode:"parallel"})}}};function ai(e){const{paths:t}=e;return _(t,()=>ri())}const li={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},Ft=(e={})=>{const t=e.direction??"up",n=e.physics??li,i=t==="up",s=i?R:O,o=i?O:R;return{prepare:({from:r,to:l})=>(r.then(a=>{a.style.zIndex=s,a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.pointerEvents="none"}),l.then(a=>{a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.position="relative",a.style.zIndex=o}),{}),animation:({from:r,to:l})=>{const a=r.offsetHeight,c=l.offsetHeight,u=window.innerHeight,p=Math.max(Math.min(a,c),u),d=new m.WebAnimation({element:r,integrator:w.from(n),style:f=>({transform:`translate3d(0, ${i?-p*f:p*f}px, 0)`}),onComplete:()=>{r.style.willChange="auto",r.style.backfaceVisibility="",r.style.contain="",r.style.transform="",r.style.pointerEvents="",r.style.zIndex=""}}),y=new m.WebAnimation({element:l,integrator:w.from(n),style:(f,h)=>({transform:`translate3d(0, ${i?h*p:h*-p}px, 0)`}),onComplete:()=>{l.style.willChange="auto",l.style.backfaceVisibility="",l.style.contain="",l.style.transform="",l.style.position==="relative"&&(l.style.position=""),l.style.zIndex===o&&(l.style.zIndex="")}});for(const f of[d,y]){const h=f.onComplete;f.onComplete=()=>{h==null||h(),f.releaseFill()}}return new m.MultiAnimation([d,y],{mode:"parallel"})}}};function ci(e){const{paths:t,type:n="directional"}=e;return n==="non-directional"?_(t,()=>Ft({direction:"up"})):ct(t,{forward:"up",backward:"down"},i=>Ft({direction:i}))}const pi={spring:{stiffness:200,damping:24}},ui={inertia:{acceleration:25,resistance:1.2}},tt=.2;function di(){return{enterPhysics:pi,exitPhysics:ui,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-tt*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-tt+tt*e})`,opacity:e})}}}const fi={spring:{stiffness:200,damping:24}},hi={inertia:{acceleration:25,resistance:1.2}},et=.08,yi=16,nt=.6,mi=e=>`blur(${Math.max(0,e).toFixed(2)}px)`;function gi(){return{enterPhysics:fi,exitPhysics:hi,background:{willChange:"transform, opacity",enterStyle:e=>({transform:`scale(${1-et*e})`,opacity:1-(1-nt)*e}),exitStyle:e=>({transform:`scale(${1-et+et*e})`,opacity:nt+(1-nt)*e})},overlay:{willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,i=mi(yi*n);return{backdropFilter:i,WebkitBackdropFilter:i}}}}}const bi={spring:{stiffness:230,damping:25}},wi={spring:{stiffness:230,damping:25}};function Si(){return{enterPhysics:bi,exitPhysics:wi,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const xi={static:Si(),"background-scale":di(),blur:gi()},Ci="static",$i="transform",Ei=(e={})=>{const t=e.direction??"enter",n=xi[e.type??Ci],i=t==="enter"?n.enterPhysics:n.exitPhysics,s=n.background,o=n.overlay,r=s.willChange!=="";return{prepare:({from:l,to:a,context:c,createElement:u})=>{const p=t==="enter"?a:l,d=t==="enter"?l:a;p.then(f=>{f.style.willChange=$i,f.style.backfaceVisibility="hidden",f.style.contain="layout paint",f.style.zIndex=O,t==="enter"?f.style.position="relative":f.style.pointerEvents="none"}),d.then(f=>{r&&(f.style.willChange=s.willChange,f.style.backfaceVisibility="hidden",f.style.contain="layout paint"),f.style.zIndex=R,t==="enter"?f.style.pointerEvents="none":f.style.position="relative"});let y;return o&&(y=u("sheet-overlay"),Object.assign(y.style,o.initialStyle),y.style.willChange=o.willChange,c.positionedParent.appendChild(y)),{overlay:y}},animation:({from:l,to:a,context:c,overlay:u})=>{const p=t==="enter"?a:l,d=t==="enter"?l:a,y=D(c,t==="enter"?"to":"from"),f=()=>{l.style.pointerEvents="",l.style.zIndex=""},h=()=>{const x=t==="enter"?O:R;a.style.position==="relative"&&(a.style.position=""),a.style.zIndex===x&&(a.style.zIndex="")},g=x=>{const C=x.onComplete;x.onComplete=()=>{C==null||C(),x.releaseFill()}};p.style.clipPath=`inset(${y.top}px 0 calc(100% - ${y.top+y.height}px) 0)`;const S=t==="enter"?(x,C)=>({transform:`translate3d(0, ${C*y.height}px, 0)`}):x=>({transform:`translate3d(0, ${x*y.height}px, 0)`}),b=new m.WebAnimation({element:p,integrator:w.from(i),style:S,onComplete:()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.contain="",p.style.clipPath="",p.style.transform="",f(),h()}});g(b);const $=[b];if(r){const x=d.scrollHeight;x>0&&(d.style.height=`${x}px`);const C=D(c,t==="enter"?"from":"to"),I=C.left+C.width/2,P=C.top+C.height/2;d.style.clipPath=`inset(${C.top}px 0 calc(100% - ${C.top+C.height}px) 0)`,d.style.transformOrigin=`${I}px ${P}px`;const A=t==="enter"?(Y,N)=>s.enterStyle(Y,N):Y=>s.exitStyle(Y),H=new m.WebAnimation({element:d,integrator:w.from(i),style:A,onComplete:()=>{d.style.willChange="auto",d.style.backfaceVisibility="",d.style.contain="",d.style.clipPath="",d.style.transformOrigin="",d.style.transform="",d.style.opacity="",d.style.height=""}});g(H),$.push(H)}if(u&&o){u.style.zIndex=zt;const x=Nt(c,"to");u.style.top=`${x.top}px`,u.style.height=`${x.height}px`,$.push(new m.WebAnimation({element:u,integrator:w.from(i),style:C=>o.style(t,C)}))}return new m.MultiAnimation($,{mode:"parallel"})}}};function Ai(e){return e==="scale"||e==="background-scale"?"background-scale":e==="blur"?"blur":"static"}function Pi(e){const{enter:t,exit:n}=e,i=e.type,s=Ai(i);return Ht({enter:t,exit:n},o=>Ei({direction:o,type:s}))}const Ii={spring:{stiffness:170,damping:22,doubleSpring:.8}},_i=(e={})=>{const t=e.direction??"left",n=e.physics??Ii,i=t==="left";return{prepare:({from:s,to:o})=>(s.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),o.then(r=>{const l=i?100:-100;r.style.transform=`translate3d(${l}%, 0, 0)`,r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}),animation:({from:s,to:o})=>{const r=new m.WebAnimation({element:s,integrator:w.from(n),style:a=>({transform:`translate3d(${i?-100*a:100*a}%, 0, 0)`}),onComplete:()=>{s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain="",s.style.transform="",s.style.pointerEvents=""}}),l=new m.WebAnimation({element:o,integrator:w.from(n),style:(a,c)=>({transform:`translate3d(${i?c*100:c*-100}%, 0, 0)`}),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform=""}});return new m.MultiAnimation([r,l],{mode:"parallel"})}}};function Ri(e){const{paths:t}=e;return ct(t,{forward:"left",backward:"right"},n=>_i({direction:n}))}const Oi={spring:{stiffness:17,damping:6}},it=20,U=800,vi=(e={})=>{const t=e.physics??Oi;return{prepare:({from:n,to:i})=>(n.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.pointerEvents="none",s.style.transform=`perspective(${U}px) rotateY(0deg) translate3d(0%, 0, 0)`}),i.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.transform=`perspective(${U}px) rotateY(${it}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:i})=>{const s=new m.WebAnimation({element:n,integrator:w.from(t),style:r=>{const l=-r*it,a=r*100;return{transform:`perspective(${U}px) rotateY(${l}deg) translate3d(${a}%, 0, 0)`}},onComplete:()=>{n.style.transform="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.pointerEvents=""}}),o=new m.WebAnimation({element:i,integrator:w.from(t),style:(r,l)=>{const a=l*it,c=-l*100;return{transform:`perspective(${U}px) rotateY(${a}deg) translate3d(${c}%, 0, 0)`}},onComplete:()=>{i.style.transform="",i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain=""}});return new m.MultiAnimation([s,o],{mode:"sequence"})}}};function Ti(e){const{paths:t}=e;return _(t,()=>vi())}function Di(e,t){return t.left>=e.left-.01&&t.top>=e.top-.01&&t.left+t.width<=e.left+e.width+.01&&t.top+t.height<=e.top+e.height+.01}function Gt(e){const t=()=>({enterContent:e.enterRect,exitContent:e.exitRect,startWindow:e.enterRect,scaleX:e.exitRect.width/e.enterRect.width,scaleY:e.exitRect.height/e.enterRect.height}),{enterMedia:n,exitMedia:i}=e;if(!n||!i||!Xt(n,i))return t();const s=n.content,o=i.content;if(s.width<=0||s.height<=0||o.width<=0||o.height<=0)return t();const r=o.width/s.width,l=o.height/s.height,a=Zt(s,o,i.window,r,l);return Di(n.window,a)?{enterContent:s,exitContent:o,startWindow:a,scaleX:r,scaleY:l}:t()}function jt(e,t){return{top:e.top/t.height*100,right:(t.width-(e.left+e.width))/t.width*100,bottom:(t.height-(e.top+e.height))/t.height*100,left:e.left/t.width*100}}function qt(e,t,n){return{x:e/Math.max(Math.abs(t),1e-6),y:e/Math.max(Math.abs(n),1e-6)}}function Fi(e){const{pageRect:t,scrollOffset:n,enterRadius:i,exitRadius:s}=e,o=Gt(e),{enterContent:r,exitContent:l,startWindow:a,scaleX:c,scaleY:u}=o,p=l.left-r.left+(l.width-r.width)/2-n.x,d=l.top-r.top+(l.height-r.height)/2-n.y,y=jt(a,t);return{transformOrigin:`${v(r)}px ${T(r)}px`,animate:f=>{const h=1-f,g=1+(c-1)*h,S=1+(u-1)*h,b=Math.max(0,s*h+i*(1-h)),$=qt(b,g,S);return{clipPath:`inset(${y.top*h}% ${y.right*h}% ${y.bottom*h}% ${y.left*h}% round ${$.x}px / ${$.y}px)`,transform:`translate(${p*h}px, ${d*h}px) scale(${g}, ${S})`}}}}function Mi(e){const{pageRect:t,scrollOffset:n,enterRadius:i,exitRadius:s}=e,o=Gt(e),{enterContent:r,exitContent:l,startWindow:a,scaleX:c,scaleY:u}=o,p=l.left-r.left+(l.width-r.width)/2+n.x,d=l.top-r.top+(l.height-r.height)/2+n.y,y=jt(a,t);return{transformOrigin:`${v(r)}px ${T(r)}px`,animate:f=>{const h=1-f,g=1+(c-1)*h,S=1+(u-1)*h,b=Math.max(0,i*(1-h)+s*h),$=qt(b,g,S);return{clipPath:`inset(${y.top*h}% ${y.right*h}% ${y.bottom*h}% ${y.left*h}% round ${$.x}px / ${$.y}px)`,transform:`translate(${p*h-n.x}px, ${d*h}px) scale(${g}, ${S})`}}}}const Yi={spring:{stiffness:380,damping:30,doubleSpring:{stiffness:260,damping:30}}},Kt=.12,Li=18;function ki(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Kt*t})`}}}}function Hi(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Kt*t})`}}}}const st={willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,i=`blur(${Li*n}px)`;return{backdropFilter:i,WebkitBackdropFilter:i}}};class Ni{constructor(){E(this,"physics",Yi)}contribute(t){const{from:n,to:i,resolved:s,physics:o}=t,r=s.mode==="enter",l=r?n:i,a=r?ki():Hi();return a&&(l.style.transformOrigin=a.transformOrigin),[new m.WebAnimation({element:l,integrator:w.from(o),style:r?(c,u)=>a.animate(u):c=>a.animate(c)})]}}class Wi{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,st.initialStyle),n.style.willChange=st.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;if(!n)return[];n.style.zIndex=zt;const i=Nt(t.context,"to");return n.style.top=`${i.top}px`,n.style.height=`${i.height}px`,[new m.WebAnimation({element:n,integrator:w.from(t.physics),style:s=>st.style(t.resolved.mode,s)})]}}const zi={spring:{stiffness:430,damping:33,doubleSpring:1}};function Ui({enterRect:e,exitRect:t,scrollOffset:n}){const i=e.left-t.left+(e.width-t.width)/2+n.x,s=e.top-t.top+(e.height-t.height)/2+n.y,o=e.width/t.width,r=e.height/t.height,l=Math.max(o,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:a=>{const c=1-a;return{transform:`translate(${i*c-n.x}px, ${s*c}px) scale(${1+(l-1)*c})`}}}}function Vi({enterRect:e,exitRect:t,scrollOffset:n}){const i=e.left-t.left+(e.width-t.width)/2-n.x,s=e.top-t.top+(e.height-t.height)/2-n.y,o=e.width/t.width,r=e.height/t.height,l=Math.max(o,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:a=>{const c=1-a;return{transform:`translate(${i*c}px, ${s*c}px) scale(${1+(l-1)*c})`}}}}class Xi{constructor(){E(this,"physics",zi)}contribute(t){const{from:n,to:i,resolved:s,input:o,physics:r}=t,l=s.mode==="enter",a=l?n:i,c=l?Ui(o):Vi(o);return c&&(a.style.transformOrigin=c.transformOrigin),[new m.WebAnimation({element:a,integrator:w.from(r),style:l?(u,p)=>c.animate(p):u=>c.animate(u)})]}}const Bi={spring:{stiffness:530,damping:34,doubleSpring:1}};class Zi{constructor(){E(this,"physics",Bi)}contribute(t){return[]}}const Gi={expand:()=>new Xi,static:()=>new Zi,blur:()=>new Ni};function ji(e){return Gi[e]()}const lt="data-zoom-enter-key",Mt="data-zoom-exit-key",Yt="data-zoom-radius";function qi(e,t){return Math.abs(e.left-t.left)<.01&&Math.abs(e.top-t.top)<.01&&Math.abs(e.width-t.width)<.01&&Math.abs(e.height-t.height)<.01}function Ki(e,t){const n=[];let i=t;for(;i&&i!==e;){const s=i.parentElement;if(!s)break;for(const o of Array.from(s.children))o!==i&&o instanceof HTMLElement&&n.push(o);i=s}return n}function Lt(e){const t=e.querySelectorAll(`[${lt}]`);return t.length!==1?null:t[0]}function kt(e,t){const n=e.querySelectorAll(`[${Mt}]`);for(const i of n)if(i.getAttribute(Mt)===t)return i;return null}function Ji(e,t){const n=Lt(e),i=Lt(t);if(!n&&i){const s=i.getAttribute(lt);if(!s)return null;const o=kt(e,s);return o?{mode:"enter",enterEl:i,exitEl:o}:null}if(n&&!i){const s=n.getAttribute(lt);if(!s)return null;const o=kt(t,s);return o?{mode:"exit",enterEl:n,exitEl:o}:null}return null}function Qi(e,t,n,i){const s=e.mode==="enter"?n:t,o=e.mode==="enter"?t:n,r=W(s,e.enterEl),l=W(o,e.exitEl),a=at(e.enterEl,r,g=>W(s,g),{legacyRadiusAttribute:Yt}),c=at(e.exitEl,l,g=>W(o,g),{legacyRadiusAttribute:Yt}),[u,p]=Bt(a,c),d=u.contentAware&&p.contentAware,y=e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),f={left:0,top:0,width:y.width,height:y.height},h=u.radiusSource==="legacy"||qi(u.window,f)?u.radius:0;return{enterRect:r,exitRect:l,...d?{enterMedia:u,exitMedia:p}:{},pageRect:y,scrollOffset:i,enterRadius:h,exitRadius:p.radius}}class ts{prepare(t){t.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(t){const{from:n,to:i,resolved:s,input:o,physics:r,onComplete:l}=t,a=s.mode==="enter",c=a?Fi(o):Mi(o),u=a?i:n,p=a?"t":"u";c&&(u.style.transformOrigin=c.transformOrigin);const d=a?R:O,y=a?O:R,f=n.style.zIndex;n.style.zIndex=d;const h=i.style.zIndex,g=i.style.position;return i.style.zIndex=y,i.style.position="relative",l(()=>{u.style.willChange="auto",u.style.backfaceVisibility="",u.style.transformOrigin="",u.style.contain="",n.style.zIndex=f,i.style.zIndex===y&&(i.style.zIndex=h),i.style.position==="relative"&&(i.style.position=g),i.style.transformOrigin="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.transformOrigin="",n.style.contain="",n.style.transform="",n.style.clipPath=""}),[new m.WebAnimation({element:u,integrator:w.from(r),style:p==="t"?S=>c.animate(S):(S,b)=>c.animate(b)})]}}class es{contribute(t){const{resolved:n,physics:i,from:s,to:o,onComplete:r}=t,l=n.mode==="enter"?o:s,a=Ki(l,n.enterEl);if(a.length===0)return[];const c=a.map(u=>u.style.opacity);if(n.mode==="enter")for(const u of a)u.style.opacity="0";return r(()=>{for(let u=0;u<a.length;u++){const p=a[u];p&&(p.style.opacity=c[u]??"")}}),a.map(u=>new m.WebAnimation({element:u,integrator:w.from(i),style:(p,d)=>({opacity:n.mode==="enter"?p:d})}))}}class Jt{contribute(){return[]}}const ns={default:()=>new Jt,fade:()=>new es};function is(e){return ns[e]()}class ss extends Jt{}function os(e){const t=ji(e.type);return{strategies:[new ts,t,is(e.variant),new ss,...e.type==="blur"?[new Wi]:[]],physics:t.physics}}const rs=e=>{const{strategies:t,physics:n}=os(e);return{prepare:i=>{const s={from:i.from,to:i.to,context:{positionedParent:i.context.positionedParent},createElement:i.createElement},o={};for(const r of t){if(!r.prepare)continue;const l=r.prepare(s);l&&Object.assign(o,l)}return o},animation:({from:i,to:s,context:o,...r})=>{const l=Ji(i,s);if(!l)return new m.MultiAnimation([],{mode:"parallel"});const a=Qi(l,i,s,o.scrollOffset),c=[],p={from:i,to:s,resolved:l,input:a,physics:n,context:o,extras:r,onComplete:f=>{c.push(f)}},d=[];for(const f of t)f.contribute&&d.push(...f.contribute(p));const y=d[0];if(y){const f=y.onComplete;y.onComplete=()=>{f==null||f();for(const h of c)try{h()}catch(g){console.error("[zoom] cleanup error",g)}}}for(const f of d){if(!(f instanceof m.WebAnimation))continue;const h=f.onComplete;f.onComplete=()=>{h==null||h(),f.releaseFill()}}return new m.MultiAnimation(d,{mode:"parallel"})}}};function as(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function ls(e){const t=as(e);return _(e.paths,()=>rs(t))}exports.Animation=m.Animation;exports.MultiAnimation=m.MultiAnimation;exports.WebAnimation=m.WebAnimation;exports.axis=We;exports.blind=Ze;exports.drill=on;exports.fade=cn;exports.film=bn;exports.hero=ti;exports.jaemin=si;exports.rotate=ai;exports.scroll=ci;exports.sheet=Pi;exports.slide=Ri;exports.strip=Ti;exports.zoom=ls;
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var ae = Object.defineProperty;
|
|
2
2
|
var le = (e, t, n) => t in e ? ae(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var E = (e, t, n) => le(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { P as pt, V as zt, W as b, M as P, S as ce } from "./multi-animation-
|
|
5
|
-
import { A as wo } from "./multi-animation-
|
|
4
|
+
import { P as pt, V as zt, W as b, M as P, S as ce } from "./multi-animation-ZFZBDBGr.js";
|
|
5
|
+
import { A as wo } from "./multi-animation-ZFZBDBGr.js";
|
|
6
6
|
function R(e, t) {
|
|
7
7
|
const n = [];
|
|
8
8
|
for (let s = 0; s < e.length; s++)
|
|
@@ -692,7 +692,11 @@ function oo(e) {
|
|
|
692
692
|
);
|
|
693
693
|
}
|
|
694
694
|
const qe = {
|
|
695
|
-
spring: {
|
|
695
|
+
spring: {
|
|
696
|
+
stiffness: 250,
|
|
697
|
+
damping: 23,
|
|
698
|
+
doubleSpring: 0.7
|
|
699
|
+
}
|
|
696
700
|
}, k = 0.5;
|
|
697
701
|
function Ke(e) {
|
|
698
702
|
const t = e === "enter" ? -100 : 100, n = e === "enter" ? 100 : -100;
|
|
@@ -727,11 +731,7 @@ function Je() {
|
|
|
727
731
|
const Qe = {
|
|
728
732
|
spring: {
|
|
729
733
|
stiffness: 230,
|
|
730
|
-
damping: 25
|
|
731
|
-
doubleSpring: {
|
|
732
|
-
stiffness: 230,
|
|
733
|
-
damping: 24
|
|
734
|
-
}
|
|
734
|
+
damping: 25
|
|
735
735
|
}
|
|
736
736
|
};
|
|
737
737
|
function tn(e) {
|
|
@@ -1844,9 +1844,15 @@ function ds() {
|
|
|
1844
1844
|
};
|
|
1845
1845
|
}
|
|
1846
1846
|
const fs = {
|
|
1847
|
-
spring: {
|
|
1847
|
+
spring: {
|
|
1848
|
+
stiffness: 230,
|
|
1849
|
+
damping: 25
|
|
1850
|
+
}
|
|
1848
1851
|
}, hs = {
|
|
1849
|
-
|
|
1852
|
+
spring: {
|
|
1853
|
+
stiffness: 230,
|
|
1854
|
+
damping: 25
|
|
1855
|
+
}
|
|
1850
1856
|
};
|
|
1851
1857
|
function ys() {
|
|
1852
1858
|
return {
|
package/dist/internal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var It=Object.defineProperty;var Ht=(t,n,e)=>n in t?It(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var F=(t,n,e)=>Ht(t,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=require("./multi-animation-CE9yYIGJ.cjs");class Mt extends Q.Animation{constructor(){super(...arguments);F(this,"child",null);F(this,"_state","idle");F(this,"_settled",!1);F(this,"listeners",new Set)}attach(e){const s=this.child;if(this.child=e,this._settled=!1,s){const l=s.getPose();s.complete(),e.matchInto(l)}e.playbackRate=this.playbackRate;const o=e.onComplete;e.onComplete=()=>{o==null||o(),this.child===e&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const a=e.onUpdate;e.onUpdate=l=>{var u;a==null||a(l),(u=this.onUpdate)==null||u.call(this,l),this.notify()},this._state==="paused"?e.pause():this._state==="reversing"?e.reverse():(this._state="playing",e.play()),this.notify()}play(){var e;this._state="playing",this._settled=!1,(e=this.child)==null||e.play(),this.notify()}reverse(){var e;this._state="reversing",this._settled=!1,(e=this.child)==null||e.reverse(),this.notify()}pause(){var e;this._state="paused",(e=this.child)==null||e.pause(),this.notify()}complete(){var e;(e=this.child)==null||e.complete(),this.notify()}get isAnimating(){var e;return((e=this.child)==null?void 0:e.isAnimating)??!1}get isPaused(){return this._state==="paused"}get isComplete(){return this._settled&&!this.child}get isReversing(){var e;return((e=this.child)==null?void 0:e.isReversing)??this._state==="reversing"}get progress(){var e;return((e=this.child)==null?void 0:e.progress)??0}findTimeForProgress(e){var s;return((s=this.child)==null?void 0:s.findTimeForProgress(e))??null}get playbackRate(){return super.playbackRate}set playbackRate(e){super.playbackRate=e,this.child&&(this.child.playbackRate=e),this.notify()}getPose(){var e;return((e=this.child)==null?void 0:e.getPose())??[]}getTimeline(){var e;return((e=this.child)==null?void 0:e.getTimeline())??[]}matchInto(e){var s;(s=this.child)==null||s.matchInto(e)}get activeChild(){return this.child}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){for(const e of this.listeners)e()}}const Wt=(t,n)=>{var e;t.style.position="absolute",t.style.width="100%",t.style.top=`${-1*(((e=n==null?void 0:n.scrollOffset)==null?void 0:e.y)??0)}px`,t.style.left="0"},vt=new Set(["auto","scroll","overlay"]),zt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n);if(vt.has(e.overflowY)||vt.has(e.overflowX))return n;n=n.parentElement}return document.documentElement},Bt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return n;n=n.parentElement}return document.body};function Ft(t){const n=Object.keys(t);return Promise.all(n.map(e=>t[e])).then(e=>{const s={};return n.forEach((o,a)=>{s[o]=e[a]}),s})}function Kt(t){const n=t.filter(e=>e.symmetric).map(e=>({from:e.to,to:e.from,transition:e.transition}));return[...t,...n]}const Xt=1e6,bt=100,$t=10;function qt(t){const n=t.trim(),e=n.indexOf("#"),s=n.indexOf("?"),o=[e,s].filter(a=>a>=0).reduce((a,l)=>Math.min(a,l),n.length);return n.slice(0,o)}function ut(t){const n=qt(t);try{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n))return ut(new URL(n).pathname)}catch{}const s=(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/");return(s.length>1?s.replace(/\/+$/g,""):s)||"/"}function Ut(t){const n=t.trim();return n==="*"?"*":ut(n)}function rt(t){return t==="/"?[]:t.slice(1).split("/")}function Vt(t){return t.startsWith(":")||t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}")}function ct(t,n){const e=ut(t),s=Ut(n);if(s==="*")return{matched:!0,specificity:0};if(e===s)return{matched:!0,specificity:Xt+rt(s).length*bt};const o=rt(e),a=rt(s);let l=0;for(let u=0;u<a.length;u++){const g=a[u],b=o[u],_=u===a.length-1;if(g===void 0)return{matched:!1,specificity:0};if((g==="*"||g==="**")&&_)return{matched:g==="**"?o.length>=u:o.length>u,specificity:l};if(b===void 0)return{matched:!1,specificity:0};if(g==="*"||Vt(g)){l+=$t;continue}if(g!==b)return{matched:!1,specificity:0};l+=bt}return{matched:o.length===a.length,specificity:l}}function Gt(t,n){return ct(t,n).matched}function Yt(t,n,e){let s;for(const o of e){const a=ct(t,o.from);if(!a.matched)continue;const l=ct(n,o.to);if(!l.matched)continue;const u=a.specificity+l.specificity;(!s||u>s.specificity)&&(s={transition:o.transition,specificity:u})}return(s==null?void 0:s.transition)??null}const Zt=768,jt=10,Qt=10;function Jt(t={}){const{preserveScroll:n=f=>f,resolvePath:e=f=>f}=t,s=typeof n=="function"?n:()=>n;let o=null,a=!1,l=!1;const u=()=>{const f=(o==null?void 0:o.clientWidth)??0,d=f>0?f:typeof window<"u"?window.innerWidth:0;return d>0&&d<Zt},g=()=>(l||(a=u(),l=!0),a),b=f=>{var R;const d=e(f),y=s(g());if(y===!1)return{preserves:!1,shared:!1,storageKey:`path:${d}`};if(y===!0)return{preserves:!0,shared:!1,storageKey:`path:${d}`};const E=((R=y.exclude)==null?void 0:R.some(C=>Gt(d,C)))??!1,P=!E&&!!y.key;return{preserves:!E,shared:P,storageKey:P?`shared:${y.key}`:`path:${d}`}},_=f=>b(f).preserves;let O=null;const T=new Map;let L=null,k=!1,W=0;const $=()=>{o&&L&&!k&&T.set(b(L).storageKey,{x:o.scrollLeft,y:o.scrollTop})},z=f=>{if(!o)return;const d=b(f);if(d.preserves&&d.shared&&!T.has(d.storageKey))return;const y=d.preserves&&T.has(d.storageKey)?T.get(d.storageKey):{x:0,y:0};let E=0;const P=()=>{if(!o)return;o.scrollTo({top:y.y,left:y.x}),!(Math.abs(o.scrollTop-y.y)<1&&Math.abs(o.scrollLeft-y.x)<1)&&E<jt&&(E++,requestAnimationFrame(P))};requestAnimationFrame(P)};return{initializeContext:(f,d)=>{k=!0;const y=++W;O=f,o||(o=zt(f),a=u(),l=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{a=u()}).observe(o),(o===document.documentElement?window:o).addEventListener("scroll",$,{passive:!0})),L=d,z(d);let E=0;const P=()=>{y===W&&(E++,E>=Qt?k=!1:requestAnimationFrame(P))};requestAnimationFrame(P)},calculateScrollOffset:(f,d)=>{const y=f?b(f).storageKey:null,E=y&&T.has(y)?T.get(y):{x:0,y:0},P=d?b(d):null,R=P!=null&&P.preserves?P.storageKey:null,C=R&&T.has(R)?T.get(R):{x:0,y:0};return{x:-C.x+E.x,y:-C.y+E.y}},evictScrollPosition:f=>{T.delete(b(f).storageKey)},shouldPreserve:_,getScrollContainer:()=>o,getPositionedParentElement:()=>O?Bt(O):document.body,getScrollPosition:f=>{const d=f?b(f).storageKey:null;return d&&T.has(d)?T.get(d):{x:0,y:0}},getIsMobile:g}}const St=30,Et=8,Tt=1.2,wt=30,te=600;function ee(){let t=null,n=!1,e=!1,s=null,o=null,a=!1;const l=(h,v)=>{for(let S=0;S<h.length;S++){const m=h.item(S);if(m&&m.identifier===v)return m}return null},u=()=>{s!==null&&(clearTimeout(s),s=null)},g=()=>{o!==null&&(clearTimeout(o),o=null)},b=()=>{n=!0,e=!0,u(),g(),s=setTimeout(()=>{n=!1,e=!1,s=null},te)},_=h=>{if(h.touches.length!==1){t=null;return}const v=h.touches.item(0);if(!v){t=null;return}const S=window.innerWidth,m=v.clientX<=St,w=v.clientX>=S-St;if(!m&&!w){t=null;return}t={identifier:v.identifier,startX:v.clientX,startY:v.clientY,fromLeftEdge:m,moved:!1}},O=h=>{if(!t)return;if(h.touches.length!==1){t=null;return}const v=l(h.touches,t.identifier);if(!v){t=null;return}const S=v.clientX-t.startX,m=v.clientY-t.startY,w=Math.abs(S),I=Math.abs(m);if(I>Et&&I>w*Tt){t=null;return}const f=t.fromLeftEdge?S>0:S<0;w>Et&&w>I*Tt&&f&&(t.moved=!0)},T=h=>{if(!t)return;const v=l(h.changedTouches,t.identifier);if(!v){t=null;return}const S=v.clientX-t.startX,m=t.fromLeftEdge?S>0:S<0;if(t.moved&&m&&Math.abs(S)>=wt){b(),t=null;return}t.moved&&Math.abs(S)>=wt&&b(),t=null},L=()=>{t&&(t.moved&&b(),t=null)};return{initialize:()=>{if(typeof window>"u"||a)return;a=!0;const h={passive:!0,capture:!0};window.addEventListener("touchstart",_,h),window.addEventListener("touchmove",O,h),window.addEventListener("touchend",T,h),window.addEventListener("touchcancel",L,h)},destroy:()=>{if(typeof window>"u"||!a)return;a=!1;const h={capture:!0};window.removeEventListener("touchstart",_,h),window.removeEventListener("touchmove",O,h),window.removeEventListener("touchend",T,h),window.removeEventListener("touchcancel",L,h),u(),g(),t=null,n=!1,e=!1},isSwipeBack:()=>{const h=n||e;return h&&u(),h},onPageEnter:()=>{n=!1,u(),g(),o=setTimeout(()=>{e=!1,o=null},0)}}}function ne(){let t=null;function n(){var s,o;t&&((s=t.outResolve)==null||s.call(t,null),(o=t.inResolve)==null||o.call(t,null),t=null)}function e(){if(t!=null&&t.from&&(t!=null&&t.to)&&(t!=null&&t.outResolve)&&(t!=null&&t.inResolve)){if(t.from===t.to){n();return}const s={from:t.from,to:t.to};t.outResolve(s),t.inResolve(s),t=null}}return{trigger(s,o){var l;o==="out"&&(t==null?void 0:t.to)===s&&!t.from&&((l=t.inResolve)==null||l.call(t,null),t={}),t&&(o==="out"&&t.from&&t.from!==s||o==="in"&&t.to&&t.to!==s)&&n(),t||(t={}),o==="out"?t.from=s:t.to=s},get(s){return new Promise(o=>{t||(t={}),s==="out"?t.outResolve=o:t.inResolve=o,e()})}}}const X=new Map;let Y=null,Pt=!1;function Rt(t,n){if(t instanceof HTMLElement&&X.has(t)&&!t.isConnected){const e=X.get(t);X.delete(t),queueMicrotask(()=>e(n))}for(const e of Array.from(t.childNodes))Rt(e,n)}function se(){if(Pt||typeof document>"u")return;Pt=!0,Y=new MutationObserver(n=>{for(const e of n){const s={parent:e.target,nextSibling:e.nextSibling};for(const o of Array.from(e.removedNodes))Rt(o,s)}});const t=()=>{Y==null||Y.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function ie(t,n){return se(),X.set(t,n),()=>{X.delete(t)}}const lt=new WeakMap;let Z=null;const j="none !important";function K(t){const n=t.style.getPropertyValue("display");return t.style.getPropertyPriority("display")?`${n} !important`:n}function oe(){return Z||(Z=new MutationObserver(t=>{for(const n of t){const e=n.target,s=lt.get(e);if(!s)continue;const o=K(e);o!==s.accounted&&(s.accounted=o,o===j?(s.reactHidden=!0,s.onHide()):o!=="none"&&s.reactHidden&&(s.reactHidden=!1,s.onShow()))}}),Z)}function re(t,n){const e=K(t),s={accounted:e,reactHidden:e===j,onHide:n.onHide,onShow:n.onShow};return lt.set(t,s),oe().observe(t,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return K(t)===j},setDisplay(o,a=!1){o===null?t.style.removeProperty("display"):t.style.setProperty("display",o,a?"important":""),s.accounted=K(t)},sync(){s.accounted=K(t),s.reactHidden=s.accounted===j},stop(){lt.delete(t)}}}function ce(t){return Array.isArray(t)}function Ct(t){const n=[];for(const e of t)ce(e)?n.push(...Ct(e)):n.push(e);return n}function le(t,n={}){const{transitions:e=[],middleware:s=(i,r)=>({from:i,to:r}),preserveScroll:o=i=>i}=t,a=n.host??new Mt,l=ne(),u=typeof e=="function"?e:()=>e,g=ee();g.initialize();const b=new Map,_=i=>{let r=b.get(i);return r===void 0&&(r=s(i,i).from,b.set(i,r)),r},{initializeContext:O,calculateScrollOffset:T,evictScrollPosition:L,shouldPreserve:k,getScrollContainer:W,getPositionedParentElement:$,getScrollPosition:z,getIsMobile:h}=Jt({preserveScroll:o,resolvePath:_}),v=new Map,S=()=>{const i=h();let r=v.get(i);return r||(r=Kt(Ct(u({isMobile:i}))),v.set(i,r)),r};let m=null,w=null;const I=new WeakMap,f=i=>{I.set(i,{parent:i.parentNode,nextSibling:i.nextSibling})},d=i=>{const r=I.get(i);return r||{parent:i.parentNode,nextSibling:i.nextSibling}},y=new WeakMap,E=new WeakMap;let P=0;const R=i=>{const r=typeof getComputedStyle<"u"?getComputedStyle(i).display:"";return r&&r!=="none"?r:"block"},C=(i,r)=>{r.visibleDisplay=i.style.getPropertyValue("display"),r.computedDisplay=R(i)},dt=(i,r)=>{if(E.get(i)!==r)return;E.delete(i);const c=y.get(i);c&&(c.savedCss!==null&&(i.style.cssText=c.savedCss,c.savedCss=null),c.intent==="hidden"?c.vis.setDisplay("none",!0):c.visibleDisplay?(c.vis.setDisplay(c.visibleDisplay,!1),C(i,c)):(c.vis.setDisplay(null),C(i,c)))},Ot=(i,r,c,p,A)=>{const M=p.element,D=A.element,N=(p.mode??"unmount")==="hidden",{parent:U,nextSibling:tt}=p.parent?{parent:p.parent,nextSibling:p.nextSibling}:d(M),V=T(r,c),et={scrollOffset:V,from:{scroll:z(r)},to:{scroll:z(c)},get scrollingElement(){return W()||document.documentElement},get positionedParent(){return $()}};let x;if(N){x=M,x.style.top=`${-1*((V==null?void 0:V.y)??0)}px`;const H=y.get(D);H&&H.savedCss===null&&(H.savedCss=D.style.cssText)}else x=M,Wt(x,et);k(r)||L(r);const G=N?++P:0;N&&(E.set(D,G),E.set(M,G));const yt=Promise.resolve(x),mt=Promise.resolve(D),gt=[],Nt={from:yt,to:mt,context:et,createElement:((H,nt="div")=>{const B=document.createElement(nt);return B.setAttribute("data-ssgoi-id",H),gt.push(B),B})},kt=Promise.resolve(i.prepare?i.prepare(Nt):{});Ft({from:yt,to:mt,extras:kt}).then(({from:H,to:nt,extras:B})=>{!N&&U&&(tt&&U.contains(tt)?U.insertBefore(x,tt):U.appendChild(x));const st=i.animation({from:H,to:nt,context:et,...B}),it=st.onComplete;st.onComplete=()=>{it==null||it(),N?(dt(M,G),dt(D,G)):x.parentNode&&x.parentNode.removeChild(x);for(const ot of gt)ot.parentNode&&ot.parentNode.removeChild(ot)},a.attach(st)})},q=(i,r)=>{const c=g.isSwipeBack();l.trigger(i,r),l.get(r).then(p=>{if(r==="in"&&g.onPageEnter(),!p)return;if(c){r==="out"&&p.from&&!k(p.from)&&L(p.from),m=null,w=null;return}if(r!=="in")return;const{from:A,to:M}=s(p.from,p.to),D=Yt(A,M,S()),J=m,N=w;m=null,w=null,!(!D||!J||!N)&&Ot(D,p.from,p.to,J,N)})},Lt=(i,r)=>{const c=y.get(i);if(!c)return;const p=c.intent==="hidden";if(c.intent="hidden",c.savedCss===null&&(c.savedCss=i.style.cssText),c.vis.setDisplay(c.computedDisplay||"block",!0),i.style.position="absolute",i.style.width="100%",i.style.left="0",p)return;const A=d(i);m={element:i,parent:A.parent,nextSibling:A.nextSibling,mode:"hidden"};const M=i.getAttribute("data-ssgoi-transition")??r;q(M,"out")},_t=(i,r)=>{const c=y.get(i);if(!c||c.intent==="visible")return;c.intent="visible",C(i,c),c.savedCss!==null&&(i.style.cssText=c.savedCss,c.visibleDisplay?c.vis.setDisplay(c.visibleDisplay,!1):c.vis.setDisplay(null)),O(i,r),w={element:i,parent:i.parentElement,nextSibling:i.nextElementSibling};const p=i.getAttribute("data-ssgoi-transition")??r;q(p,"in")},Dt=(i,r,c)=>{const p=y.get(i);if(p&&(p.vis.stop(),y.delete(i),E.delete(i),p.intent==="hidden")){(m==null?void 0:m.element)===i&&(m=null),(w==null?void 0:w.element)===i&&(w=null);return}const A=c??d(i);m={element:i,parent:A.parent,nextSibling:A.nextSibling,mode:"unmount"};const M=i.getAttribute("data-ssgoi-transition")??r;q(M,"out")},ft=new WeakSet,ht=(i,r)=>{if(ft.has(r))return;ft.add(r),f(r);const c=re(r,{onHide:()=>Lt(r,i),onShow:()=>_t(r,i)}),p={vis:c,savedCss:null,intent:c.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block"};y.set(r,p),c.isHidden||(C(r,p),O(r,i),w={element:r,parent:r.parentElement,nextSibling:r.nextElementSibling},q(i,"in")),ie(r,A=>Dt(r,i,A))},pt=new Map;return{register:ht,refFor:i=>{let r=pt.get(i);return r||(r=c=>{c&&ht(i,c)},pt.set(i,r)),r}}}const xt="data-ssgoi-root",ae=`[${xt}]`,at="data-ssgoi-transition",At=`[${at}]`,ue="[data-ssgoi-clone]";function de(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function fe(t){return t.nodeType===Node.ELEMENT_NODE}function he(t){return t instanceof HTMLElement}function pe(t,n){if(!de())return()=>{};t.setAttribute(xt,"");const e=l=>l.closest(ae)===t,s=l=>{if(!he(l)||!e(l)||l.closest(ue))return;const u=l.getAttribute(at);u!==null&&n.register(u,l)},o=l=>{if(fe(l)){l.matches(At)&&s(l);for(const u of l.querySelectorAll(At))s(u)}},a=new MutationObserver(l=>{for(const u of l){if(u.type==="attributes"){s(u.target);continue}for(const g of u.addedNodes)o(g)}});return a.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[at]}),o(t),()=>a.disconnect()}exports.Animation=Q.Animation;exports.MultiAnimation=Q.MultiAnimation;exports.WebAnimation=Q.WebAnimation;exports.HostAnimation=Mt;exports.createSggoiTransitionContext=le;exports.observeSsgoiTransitions=pe;
|
|
1
|
+
"use strict";var It=Object.defineProperty;var Ht=(t,n,e)=>n in t?It(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var F=(t,n,e)=>Ht(t,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=require("./multi-animation-6124HEke.cjs");class Mt extends Q.Animation{constructor(){super(...arguments);F(this,"child",null);F(this,"_state","idle");F(this,"_settled",!1);F(this,"listeners",new Set)}attach(e){const s=this.child;if(this.child=e,this._settled=!1,s){const l=s.getPose();s.complete(),e.matchInto(l)}e.playbackRate=this.playbackRate;const o=e.onComplete;e.onComplete=()=>{o==null||o(),this.child===e&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const a=e.onUpdate;e.onUpdate=l=>{var u;a==null||a(l),(u=this.onUpdate)==null||u.call(this,l),this.notify()},this._state==="paused"?e.pause():this._state==="reversing"?e.reverse():(this._state="playing",e.play()),this.notify()}play(){var e;this._state="playing",this._settled=!1,(e=this.child)==null||e.play(),this.notify()}reverse(){var e;this._state="reversing",this._settled=!1,(e=this.child)==null||e.reverse(),this.notify()}pause(){var e;this._state="paused",(e=this.child)==null||e.pause(),this.notify()}complete(){var e;(e=this.child)==null||e.complete(),this.notify()}get isAnimating(){var e;return((e=this.child)==null?void 0:e.isAnimating)??!1}get isPaused(){return this._state==="paused"}get isComplete(){return this._settled&&!this.child}get isReversing(){var e;return((e=this.child)==null?void 0:e.isReversing)??this._state==="reversing"}get progress(){var e;return((e=this.child)==null?void 0:e.progress)??0}findTimeForProgress(e){var s;return((s=this.child)==null?void 0:s.findTimeForProgress(e))??null}get playbackRate(){return super.playbackRate}set playbackRate(e){super.playbackRate=e,this.child&&(this.child.playbackRate=e),this.notify()}getPose(){var e;return((e=this.child)==null?void 0:e.getPose())??[]}getTimeline(){var e;return((e=this.child)==null?void 0:e.getTimeline())??[]}matchInto(e){var s;(s=this.child)==null||s.matchInto(e)}get activeChild(){return this.child}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){for(const e of this.listeners)e()}}const Wt=(t,n)=>{var e;t.style.position="absolute",t.style.width="100%",t.style.top=`${-1*(((e=n==null?void 0:n.scrollOffset)==null?void 0:e.y)??0)}px`,t.style.left="0"},vt=new Set(["auto","scroll","overlay"]),zt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n);if(vt.has(e.overflowY)||vt.has(e.overflowX))return n;n=n.parentElement}return document.documentElement},Bt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return n;n=n.parentElement}return document.body};function Ft(t){const n=Object.keys(t);return Promise.all(n.map(e=>t[e])).then(e=>{const s={};return n.forEach((o,a)=>{s[o]=e[a]}),s})}function Kt(t){const n=t.filter(e=>e.symmetric).map(e=>({from:e.to,to:e.from,transition:e.transition}));return[...t,...n]}const Xt=1e6,bt=100,$t=10;function qt(t){const n=t.trim(),e=n.indexOf("#"),s=n.indexOf("?"),o=[e,s].filter(a=>a>=0).reduce((a,l)=>Math.min(a,l),n.length);return n.slice(0,o)}function ut(t){const n=qt(t);try{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n))return ut(new URL(n).pathname)}catch{}const s=(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/");return(s.length>1?s.replace(/\/+$/g,""):s)||"/"}function Ut(t){const n=t.trim();return n==="*"?"*":ut(n)}function rt(t){return t==="/"?[]:t.slice(1).split("/")}function Vt(t){return t.startsWith(":")||t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}")}function ct(t,n){const e=ut(t),s=Ut(n);if(s==="*")return{matched:!0,specificity:0};if(e===s)return{matched:!0,specificity:Xt+rt(s).length*bt};const o=rt(e),a=rt(s);let l=0;for(let u=0;u<a.length;u++){const g=a[u],b=o[u],_=u===a.length-1;if(g===void 0)return{matched:!1,specificity:0};if((g==="*"||g==="**")&&_)return{matched:g==="**"?o.length>=u:o.length>u,specificity:l};if(b===void 0)return{matched:!1,specificity:0};if(g==="*"||Vt(g)){l+=$t;continue}if(g!==b)return{matched:!1,specificity:0};l+=bt}return{matched:o.length===a.length,specificity:l}}function Gt(t,n){return ct(t,n).matched}function Yt(t,n,e){let s;for(const o of e){const a=ct(t,o.from);if(!a.matched)continue;const l=ct(n,o.to);if(!l.matched)continue;const u=a.specificity+l.specificity;(!s||u>s.specificity)&&(s={transition:o.transition,specificity:u})}return(s==null?void 0:s.transition)??null}const Zt=768,jt=10,Qt=10;function Jt(t={}){const{preserveScroll:n=f=>f,resolvePath:e=f=>f}=t,s=typeof n=="function"?n:()=>n;let o=null,a=!1,l=!1;const u=()=>{const f=(o==null?void 0:o.clientWidth)??0,d=f>0?f:typeof window<"u"?window.innerWidth:0;return d>0&&d<Zt},g=()=>(l||(a=u(),l=!0),a),b=f=>{var R;const d=e(f),y=s(g());if(y===!1)return{preserves:!1,shared:!1,storageKey:`path:${d}`};if(y===!0)return{preserves:!0,shared:!1,storageKey:`path:${d}`};const E=((R=y.exclude)==null?void 0:R.some(C=>Gt(d,C)))??!1,P=!E&&!!y.key;return{preserves:!E,shared:P,storageKey:P?`shared:${y.key}`:`path:${d}`}},_=f=>b(f).preserves;let O=null;const T=new Map;let L=null,k=!1,W=0;const $=()=>{o&&L&&!k&&T.set(b(L).storageKey,{x:o.scrollLeft,y:o.scrollTop})},z=f=>{if(!o)return;const d=b(f);if(d.preserves&&d.shared&&!T.has(d.storageKey))return;const y=d.preserves&&T.has(d.storageKey)?T.get(d.storageKey):{x:0,y:0};let E=0;const P=()=>{if(!o)return;o.scrollTo({top:y.y,left:y.x}),!(Math.abs(o.scrollTop-y.y)<1&&Math.abs(o.scrollLeft-y.x)<1)&&E<jt&&(E++,requestAnimationFrame(P))};requestAnimationFrame(P)};return{initializeContext:(f,d)=>{k=!0;const y=++W;O=f,o||(o=zt(f),a=u(),l=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{a=u()}).observe(o),(o===document.documentElement?window:o).addEventListener("scroll",$,{passive:!0})),L=d,z(d);let E=0;const P=()=>{y===W&&(E++,E>=Qt?k=!1:requestAnimationFrame(P))};requestAnimationFrame(P)},calculateScrollOffset:(f,d)=>{const y=f?b(f).storageKey:null,E=y&&T.has(y)?T.get(y):{x:0,y:0},P=d?b(d):null,R=P!=null&&P.preserves?P.storageKey:null,C=R&&T.has(R)?T.get(R):{x:0,y:0};return{x:-C.x+E.x,y:-C.y+E.y}},evictScrollPosition:f=>{T.delete(b(f).storageKey)},shouldPreserve:_,getScrollContainer:()=>o,getPositionedParentElement:()=>O?Bt(O):document.body,getScrollPosition:f=>{const d=f?b(f).storageKey:null;return d&&T.has(d)?T.get(d):{x:0,y:0}},getIsMobile:g}}const St=30,Et=8,Tt=1.2,wt=30,te=600;function ee(){let t=null,n=!1,e=!1,s=null,o=null,a=!1;const l=(h,v)=>{for(let S=0;S<h.length;S++){const m=h.item(S);if(m&&m.identifier===v)return m}return null},u=()=>{s!==null&&(clearTimeout(s),s=null)},g=()=>{o!==null&&(clearTimeout(o),o=null)},b=()=>{n=!0,e=!0,u(),g(),s=setTimeout(()=>{n=!1,e=!1,s=null},te)},_=h=>{if(h.touches.length!==1){t=null;return}const v=h.touches.item(0);if(!v){t=null;return}const S=window.innerWidth,m=v.clientX<=St,w=v.clientX>=S-St;if(!m&&!w){t=null;return}t={identifier:v.identifier,startX:v.clientX,startY:v.clientY,fromLeftEdge:m,moved:!1}},O=h=>{if(!t)return;if(h.touches.length!==1){t=null;return}const v=l(h.touches,t.identifier);if(!v){t=null;return}const S=v.clientX-t.startX,m=v.clientY-t.startY,w=Math.abs(S),I=Math.abs(m);if(I>Et&&I>w*Tt){t=null;return}const f=t.fromLeftEdge?S>0:S<0;w>Et&&w>I*Tt&&f&&(t.moved=!0)},T=h=>{if(!t)return;const v=l(h.changedTouches,t.identifier);if(!v){t=null;return}const S=v.clientX-t.startX,m=t.fromLeftEdge?S>0:S<0;if(t.moved&&m&&Math.abs(S)>=wt){b(),t=null;return}t.moved&&Math.abs(S)>=wt&&b(),t=null},L=()=>{t&&(t.moved&&b(),t=null)};return{initialize:()=>{if(typeof window>"u"||a)return;a=!0;const h={passive:!0,capture:!0};window.addEventListener("touchstart",_,h),window.addEventListener("touchmove",O,h),window.addEventListener("touchend",T,h),window.addEventListener("touchcancel",L,h)},destroy:()=>{if(typeof window>"u"||!a)return;a=!1;const h={capture:!0};window.removeEventListener("touchstart",_,h),window.removeEventListener("touchmove",O,h),window.removeEventListener("touchend",T,h),window.removeEventListener("touchcancel",L,h),u(),g(),t=null,n=!1,e=!1},isSwipeBack:()=>{const h=n||e;return h&&u(),h},onPageEnter:()=>{n=!1,u(),g(),o=setTimeout(()=>{e=!1,o=null},0)}}}function ne(){let t=null;function n(){var s,o;t&&((s=t.outResolve)==null||s.call(t,null),(o=t.inResolve)==null||o.call(t,null),t=null)}function e(){if(t!=null&&t.from&&(t!=null&&t.to)&&(t!=null&&t.outResolve)&&(t!=null&&t.inResolve)){if(t.from===t.to){n();return}const s={from:t.from,to:t.to};t.outResolve(s),t.inResolve(s),t=null}}return{trigger(s,o){var l;o==="out"&&(t==null?void 0:t.to)===s&&!t.from&&((l=t.inResolve)==null||l.call(t,null),t={}),t&&(o==="out"&&t.from&&t.from!==s||o==="in"&&t.to&&t.to!==s)&&n(),t||(t={}),o==="out"?t.from=s:t.to=s},get(s){return new Promise(o=>{t||(t={}),s==="out"?t.outResolve=o:t.inResolve=o,e()})}}}const X=new Map;let Y=null,Pt=!1;function Rt(t,n){if(t instanceof HTMLElement&&X.has(t)&&!t.isConnected){const e=X.get(t);X.delete(t),queueMicrotask(()=>e(n))}for(const e of Array.from(t.childNodes))Rt(e,n)}function se(){if(Pt||typeof document>"u")return;Pt=!0,Y=new MutationObserver(n=>{for(const e of n){const s={parent:e.target,nextSibling:e.nextSibling};for(const o of Array.from(e.removedNodes))Rt(o,s)}});const t=()=>{Y==null||Y.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function ie(t,n){return se(),X.set(t,n),()=>{X.delete(t)}}const lt=new WeakMap;let Z=null;const j="none !important";function K(t){const n=t.style.getPropertyValue("display");return t.style.getPropertyPriority("display")?`${n} !important`:n}function oe(){return Z||(Z=new MutationObserver(t=>{for(const n of t){const e=n.target,s=lt.get(e);if(!s)continue;const o=K(e);o!==s.accounted&&(s.accounted=o,o===j?(s.reactHidden=!0,s.onHide()):o!=="none"&&s.reactHidden&&(s.reactHidden=!1,s.onShow()))}}),Z)}function re(t,n){const e=K(t),s={accounted:e,reactHidden:e===j,onHide:n.onHide,onShow:n.onShow};return lt.set(t,s),oe().observe(t,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return K(t)===j},setDisplay(o,a=!1){o===null?t.style.removeProperty("display"):t.style.setProperty("display",o,a?"important":""),s.accounted=K(t)},sync(){s.accounted=K(t),s.reactHidden=s.accounted===j},stop(){lt.delete(t)}}}function ce(t){return Array.isArray(t)}function Ct(t){const n=[];for(const e of t)ce(e)?n.push(...Ct(e)):n.push(e);return n}function le(t,n={}){const{transitions:e=[],middleware:s=(i,r)=>({from:i,to:r}),preserveScroll:o=i=>i}=t,a=n.host??new Mt,l=ne(),u=typeof e=="function"?e:()=>e,g=ee();g.initialize();const b=new Map,_=i=>{let r=b.get(i);return r===void 0&&(r=s(i,i).from,b.set(i,r)),r},{initializeContext:O,calculateScrollOffset:T,evictScrollPosition:L,shouldPreserve:k,getScrollContainer:W,getPositionedParentElement:$,getScrollPosition:z,getIsMobile:h}=Jt({preserveScroll:o,resolvePath:_}),v=new Map,S=()=>{const i=h();let r=v.get(i);return r||(r=Kt(Ct(u({isMobile:i}))),v.set(i,r)),r};let m=null,w=null;const I=new WeakMap,f=i=>{I.set(i,{parent:i.parentNode,nextSibling:i.nextSibling})},d=i=>{const r=I.get(i);return r||{parent:i.parentNode,nextSibling:i.nextSibling}},y=new WeakMap,E=new WeakMap;let P=0;const R=i=>{const r=typeof getComputedStyle<"u"?getComputedStyle(i).display:"";return r&&r!=="none"?r:"block"},C=(i,r)=>{r.visibleDisplay=i.style.getPropertyValue("display"),r.computedDisplay=R(i)},dt=(i,r)=>{if(E.get(i)!==r)return;E.delete(i);const c=y.get(i);c&&(c.savedCss!==null&&(i.style.cssText=c.savedCss,c.savedCss=null),c.intent==="hidden"?c.vis.setDisplay("none",!0):c.visibleDisplay?(c.vis.setDisplay(c.visibleDisplay,!1),C(i,c)):(c.vis.setDisplay(null),C(i,c)))},Ot=(i,r,c,p,A)=>{const M=p.element,D=A.element,N=(p.mode??"unmount")==="hidden",{parent:U,nextSibling:tt}=p.parent?{parent:p.parent,nextSibling:p.nextSibling}:d(M),V=T(r,c),et={scrollOffset:V,from:{scroll:z(r)},to:{scroll:z(c)},get scrollingElement(){return W()||document.documentElement},get positionedParent(){return $()}};let x;if(N){x=M,x.style.top=`${-1*((V==null?void 0:V.y)??0)}px`;const H=y.get(D);H&&H.savedCss===null&&(H.savedCss=D.style.cssText)}else x=M,Wt(x,et);k(r)||L(r);const G=N?++P:0;N&&(E.set(D,G),E.set(M,G));const yt=Promise.resolve(x),mt=Promise.resolve(D),gt=[],Nt={from:yt,to:mt,context:et,createElement:((H,nt="div")=>{const B=document.createElement(nt);return B.setAttribute("data-ssgoi-id",H),gt.push(B),B})},kt=Promise.resolve(i.prepare?i.prepare(Nt):{});Ft({from:yt,to:mt,extras:kt}).then(({from:H,to:nt,extras:B})=>{!N&&U&&(tt&&U.contains(tt)?U.insertBefore(x,tt):U.appendChild(x));const st=i.animation({from:H,to:nt,context:et,...B}),it=st.onComplete;st.onComplete=()=>{it==null||it(),N?(dt(M,G),dt(D,G)):x.parentNode&&x.parentNode.removeChild(x);for(const ot of gt)ot.parentNode&&ot.parentNode.removeChild(ot)},a.attach(st)})},q=(i,r)=>{const c=g.isSwipeBack();l.trigger(i,r),l.get(r).then(p=>{if(r==="in"&&g.onPageEnter(),!p)return;if(c){r==="out"&&p.from&&!k(p.from)&&L(p.from),m=null,w=null;return}if(r!=="in")return;const{from:A,to:M}=s(p.from,p.to),D=Yt(A,M,S()),J=m,N=w;m=null,w=null,!(!D||!J||!N)&&Ot(D,p.from,p.to,J,N)})},Lt=(i,r)=>{const c=y.get(i);if(!c)return;const p=c.intent==="hidden";if(c.intent="hidden",c.savedCss===null&&(c.savedCss=i.style.cssText),c.vis.setDisplay(c.computedDisplay||"block",!0),i.style.position="absolute",i.style.width="100%",i.style.left="0",p)return;const A=d(i);m={element:i,parent:A.parent,nextSibling:A.nextSibling,mode:"hidden"};const M=i.getAttribute("data-ssgoi-transition")??r;q(M,"out")},_t=(i,r)=>{const c=y.get(i);if(!c||c.intent==="visible")return;c.intent="visible",C(i,c),c.savedCss!==null&&(i.style.cssText=c.savedCss,c.visibleDisplay?c.vis.setDisplay(c.visibleDisplay,!1):c.vis.setDisplay(null)),O(i,r),w={element:i,parent:i.parentElement,nextSibling:i.nextElementSibling};const p=i.getAttribute("data-ssgoi-transition")??r;q(p,"in")},Dt=(i,r,c)=>{const p=y.get(i);if(p&&(p.vis.stop(),y.delete(i),E.delete(i),p.intent==="hidden")){(m==null?void 0:m.element)===i&&(m=null),(w==null?void 0:w.element)===i&&(w=null);return}const A=c??d(i);m={element:i,parent:A.parent,nextSibling:A.nextSibling,mode:"unmount"};const M=i.getAttribute("data-ssgoi-transition")??r;q(M,"out")},ft=new WeakSet,ht=(i,r)=>{if(ft.has(r))return;ft.add(r),f(r);const c=re(r,{onHide:()=>Lt(r,i),onShow:()=>_t(r,i)}),p={vis:c,savedCss:null,intent:c.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block"};y.set(r,p),c.isHidden||(C(r,p),O(r,i),w={element:r,parent:r.parentElement,nextSibling:r.nextElementSibling},q(i,"in")),ie(r,A=>Dt(r,i,A))},pt=new Map;return{register:ht,refFor:i=>{let r=pt.get(i);return r||(r=c=>{c&&ht(i,c)},pt.set(i,r)),r}}}const xt="data-ssgoi-root",ae=`[${xt}]`,at="data-ssgoi-transition",At=`[${at}]`,ue="[data-ssgoi-clone]";function de(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function fe(t){return t.nodeType===Node.ELEMENT_NODE}function he(t){return t instanceof HTMLElement}function pe(t,n){if(!de())return()=>{};t.setAttribute(xt,"");const e=l=>l.closest(ae)===t,s=l=>{if(!he(l)||!e(l)||l.closest(ue))return;const u=l.getAttribute(at);u!==null&&n.register(u,l)},o=l=>{if(fe(l)){l.matches(At)&&s(l);for(const u of l.querySelectorAll(At))s(u)}},a=new MutationObserver(l=>{for(const u of l){if(u.type==="attributes"){s(u.target);continue}for(const g of u.addedNodes)o(g)}});return a.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[at]}),o(t),()=>a.disconnect()}exports.Animation=Q.Animation;exports.MultiAnimation=Q.MultiAnimation;exports.WebAnimation=Q.WebAnimation;exports.HostAnimation=Mt;exports.createSggoiTransitionContext=le;exports.observeSsgoiTransitions=pe;
|
package/dist/internal.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var Nt = Object.defineProperty;
|
|
2
2
|
var kt = (t, n, e) => n in t ? Nt(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
3
3
|
var F = (t, n, e) => kt(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
-
import { A as It } from "./multi-animation-
|
|
5
|
-
import { M as Ee, W as we } from "./multi-animation-
|
|
4
|
+
import { A as It } from "./multi-animation-ZFZBDBGr.js";
|
|
5
|
+
import { M as Ee, W as we } from "./multi-animation-ZFZBDBGr.js";
|
|
6
6
|
class Ht extends It {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(...arguments);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var F=Object.defineProperty;var b=(a,i,t)=>i in a?F(a,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[i]=t;var r=(a,i,t)=>b(a,typeof i!="symbol"?i+"":i,t);class d{constructor(){r(this,"_playbackRate",1);r(this,"onUpdate");r(this,"onComplete")}get playbackRate(){return this._playbackRate}set playbackRate(i){this._playbackRate=i}}const R=.01,T=.01,g=.05;function k(a){return new Promise(i=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{i()})})})}const w=1e3/60,y=1e3/30,C=y+1;class A{constructor(){r(this,"drivers",new Set);r(this,"observers",new Set);r(this,"frameRequest",null);r(this,"previousTimestamp",null);r(this,"tick",i=>{this.frameRequest=null;const t=this.previousTimestamp===null?w:Math.max(0,i-this.previousTimestamp);this.previousTimestamp=i;const e={delta:Math.min(t,y),rawDelta:t};this.runPhase(this.drivers,e),this.runPhase(this.observers,e),this.hasCallbacks()?this.requestFrame():this.previousTimestamp=null})}subscribe(i,t="drive"){const e=t==="drive"?this.drivers:this.observers;return e.add(i),this.requestFrame(),()=>{e.delete(i),this.stopIfIdle()}}requestFrame(){this.frameRequest!==null||!this.hasCallbacks()||(this.frameRequest=requestAnimationFrame(this.tick))}runPhase(i,t){for(const e of[...i])i.has(e)&&e(t)}hasCallbacks(){return this.drivers.size>0||this.observers.size>0}stopIfIdle(){this.hasCallbacks()||(this.frameRequest!==null&&typeof cancelAnimationFrame<"u"&&cancelAnimationFrame(this.frameRequest),this.frameRequest=null,this.previousTimestamp=null)}}const S=new A,p=1e3/60,P=2;class O extends d{constructor(t){super();r(this,"element");r(this,"integrator");r(this,"styleFn");r(this,"lowerBound");r(this,"upperBound");r(this,"currentValue");r(this,"currentVelocity",0);r(this,"frames",[]);r(this,"waapi",null);r(this,"runId",0);r(this,"waitingForStart",!1);r(this,"startReady",!1);r(this,"pendingFirstFrame");r(this,"stopStartupClock",null);r(this,"startupStableFrames",0);r(this,"running",!1);r(this,"paused",!1);r(this,"settled",!1);r(this,"reversing",!1);this.element=t.element,this.integrator=t.integrator,this.styleFn=t.style,this.lowerBound=t.lowerBound??0,this.upperBound=t.upperBound??1,this.currentValue=this.lowerBound,this.onUpdate=t.onUpdate,this.onComplete=t.onComplete}play(){if(this.reversing=!1,this.paused&&this.waapi){if(this.paused=!1,this.running=!0,this.waitingForStart){this.startReady&&this.startFramePacedPlayback(this.waapi);return}this.waapi.play();return}this.runToward(this.upperBound)}reverse(){this.reversing=!0,this.runToward(this.lowerBound)}pause(){var t,e;this.running&&(this.captureLiveState(),(t=this.waapi)==null||t.pause(),(e=this.stopStartupClock)==null||e.call(this),this.stopStartupClock=null,this.running=!1,this.paused=!0)}complete(){var t;this.clearWaapi(),this.running=!1,this.paused=!1,this.currentValue=this.upperBound,this.currentVelocity=0,this.applyStyleAt(this.currentValue),this.settled=!0,(t=this.onComplete)==null||t.call(this)}releaseFill(){this.clearWaapi()}get isAnimating(){return this.running}get isPaused(){return this.paused}get isComplete(){return this.settled}get isReversing(){return this.reversing}get progress(){this.running&&this.captureLiveState();const t=this.upperBound-this.lowerBound;if(t===0)return 0;const e=(this.currentValue-this.lowerBound)/t;return e<0?0:e>1?1:e}findTimeForProgress(t){if(this.frames.length<2)return null;const e=this.upperBound-this.lowerBound;if(e===0)return 0;for(const s of this.frames)if((s.position-this.lowerBound)/e>=t)return s.time;return this.frames[this.frames.length-1].time}get playbackRate(){return super.playbackRate}set playbackRate(t){super.playbackRate=t,this.waapi&&(this.waapi.playbackRate=t)}getPose(){return this.running&&this.captureLiveState(),[{element:this.element,value:this.currentValue,velocity:this.currentVelocity}]}getTimeline(){const t=this.frames.map(e=>{const s=e.position,n=this.lowerBound+this.upperBound-s;return{time:e.time,value:e.position,velocity:e.velocity,style:this.styleFn(s,n)}});return[{element:this.element,frames:t}]}matchInto(t){const e=t.find(s=>s.element===this.element);e&&(this.currentValue=e.value,this.currentVelocity=e.velocity)}runToward(t){var o;if(this.running&&this.captureLiveState(),this.clearWaapi(),this.running=!1,this.paused=!1,this.settled=!1,this.frames=B(this.integrator,this.currentValue,t,this.currentVelocity),this.frames.length===0){this.currentValue=t,this.currentVelocity=0,this.applyStyleAt(t),this.settled=!0,(o=this.onComplete)==null||o.call(this);return}const e=this.frames.map(c=>{const m=c.position,v=this.lowerBound+this.upperBound-m;return this.styleFn(m,v)}),s=e[0],n=this.frames[this.frames.length-1],h=n.time,u=++this.runId,l=this.element.animate(e,{duration:h,fill:"both",easing:"linear",composite:"replace"});l.playbackRate=this.playbackRate,l.currentTime=0,l.pause(),this.waapi=l,this.waitingForStart=!0,this.startReady=!1,this.pendingFirstFrame=s,this.running=!0,l.onfinish=()=>{var c;!this.running||this.waapi!==l||(this.running=!1,this.settled=!0,this.currentValue=n.position,this.currentVelocity=0,(c=this.onComplete)==null||c.call(this))},this.startWhenReady(l,u)}clearWaapi(){var t,e;this.runId++,(t=this.waapi)==null||t.cancel(),this.waapi=null,this.waitingForStart=!1,this.startReady=!1,this.pendingFirstFrame=void 0,(e=this.stopStartupClock)==null||e.call(this),this.stopStartupClock=null,this.startupStableFrames=0}captureLiveState(){if(this.frames.length===0)return;const t=f(this.waapi);if(t===null)return;const{position:e,velocity:s}=E(this.frames,t);this.currentValue=e,this.currentVelocity=s}async startWhenReady(t,e){try{await t.ready,typeof requestAnimationFrame<"u"&&await k(this.element)}catch{return}this.runId!==e||this.waapi!==t||(this.startReady=!0,!(!this.running||this.paused)&&this.startFramePacedPlayback(t))}startFramePacedPlayback(t){if(!(this.waapi!==t||!this.waitingForStart||!this.startReady||this.stopStartupClock)){if(this.pendingFirstFrame)for(const e of Object.keys(this.pendingFirstFrame))this.element.style[e]="";if(this.pendingFirstFrame=void 0,typeof requestAnimationFrame>"u"||this.playbackRate<0){this.handOffToWaapi(t);return}this.startupStableFrames=0,this.stopStartupClock=S.subscribe(e=>{this.advanceFramePacedStartup(t,e)})}}advanceFramePacedStartup(t,e){if(this.waapi!==t||!this.running||this.paused||!this.waitingForStart)return;const s=this.frames[this.frames.length-1];if(!s)return;const n=f(t)??0,h=Math.min(s.time,n+e.delta*Math.max(0,this.playbackRate));if(t.currentTime=h,this.captureLiveState(),h>=s.time){this.finishFramePacedRun(t,s);return}e.rawDelta<=C?this.startupStableFrames++:this.startupStableFrames=0,!(this.startupStableFrames<P)&&this.handOffToWaapi(t)}handOffToWaapi(t){var e;this.waapi!==t||!this.running||this.paused||((e=this.stopStartupClock)==null||e.call(this),this.stopStartupClock=null,this.waitingForStart=!1,this.startReady=!1,this.startupStableFrames=0,t.play())}finishFramePacedRun(t,e){var s,n;this.waapi!==t||!this.running||((s=this.stopStartupClock)==null||s.call(this),this.stopStartupClock=null,this.waitingForStart=!1,this.startReady=!1,this.startupStableFrames=0,this.running=!1,this.settled=!0,this.currentValue=e.position,this.currentVelocity=0,(n=this.onComplete)==null||n.call(this))}applyStyleAt(t){const e=this.lowerBound+this.upperBound-t,s=this.styleFn(t,e);for(const[n,h]of Object.entries(s))this.element.style[n]=typeof h=="number"?String(h):h}}function B(a,i,t,e){if(i===t&&e===0)return[];const s=600;let n={position:i,velocity:e},h=0;const u=[];for(let l=0;l<s;l++){const o=l*p;if(u.push({time:o,position:n.position,velocity:n.velocity}),n=a.step(n,t,p/1e3),a.isSettled(n,t)){if(h+=p/1e3,h>=g){u.push({time:(l+1)*p,position:t,velocity:0});break}}else h=0}return u}function E(a,i){if(a.length===0)return{position:0,velocity:0};const t=a[0],e=a[a.length-1];if(i<=0)return{position:t.position,velocity:t.velocity};if(i>=e.time)return{position:e.position,velocity:e.velocity};let s=0,n=a.length-1;for(;s<n-1;){const o=s+n>>1;a[o].time<=i?s=o:n=o}const h=a[s],u=a[n],l=(i-h.time)/(u.time-h.time);return{position:h.position+(u.position-h.position)*l,velocity:h.velocity+(u.velocity-h.velocity)*l}}function f(a){const i=a==null?void 0:a.currentTime;return typeof i=="number"?i:null}class _ extends d{constructor(t,e={}){super();r(this,"children");r(this,"startAt");r(this,"pendingComplete",0);r(this,"running",!1);r(this,"pendingStartObservers",[]);this.children=t,(e.mode??"parallel")==="sequence"?this.startAt=t.map((s,n)=>n===0?0:1):this.startAt=e.startAt??[]}play(){this.startRun("play")}reverse(){this.startRun("reverse")}pause(){this.running=!1,this.clearPendingStartObservers();for(const t of this.children)t.pause()}complete(){var t;this.running=!1,this.clearPendingStartObservers();for(const e of this.children)e.complete();(t=this.onComplete)==null||t.call(this)}get progress(){if(this.children.length===0)return 0;let t=0;for(const e of this.children)t+=e.progress;return t/this.children.length}getPose(){return this.children.flatMap(t=>t.getPose())}getTimeline(){return this.children.flatMap(t=>t.getTimeline())}matchInto(t){}get isAnimating(){return this.children.some(t=>t.isAnimating)}get isPaused(){return this.children.some(t=>t.isPaused)&&this.children.every(t=>t.isPaused||t.isComplete)}get isComplete(){return this.children.every(t=>t.isComplete)}get isReversing(){return this.children.some(t=>t.isReversing)}get playbackRate(){return super.playbackRate}set playbackRate(t){super.playbackRate=t;for(const e of this.children)e.playbackRate=t}startRun(t){if(this.running&&this.pause(),this.running=!0,this.pendingComplete=this.children.length,this.pendingComplete===0){this.handleFinished();return}for(const e of this.children){const s=e.onComplete;e.onComplete=()=>{s==null||s(),this.handleChildComplete()}}this.scheduleStart(0,t)}scheduleStart(t,e){if(!this.running||t>=this.children.length)return;this.children[t][e]();const s=t+1;if(s>=this.children.length)return;const n=this.startAt[s];if(n===void 0||n<=0){this.scheduleStart(s,e);return}const h=this.children[t];if(this.hasReachedThreshold(h,n,e)){this.scheduleStart(s,e);return}const u=S.subscribe(()=>{this.running&&this.hasReachedThreshold(h,n,e)&&(u(),this.pendingStartObservers=this.pendingStartObservers.filter(l=>l!==u),this.scheduleStart(s,e))},"observe");this.pendingStartObservers.push(u)}hasReachedThreshold(t,e,s){return t.isComplete?!0:(s==="play"?t.progress:1-t.progress)>=e}clearPendingStartObservers(){for(const t of this.pendingStartObservers)t();this.pendingStartObservers=[]}handleChildComplete(){this.pendingComplete--,this.pendingComplete<=0&&this.handleFinished()}handleFinished(){var t;this.running=!1,this.clearPendingStartObservers(),(t=this.onComplete)==null||t.call(this)}findTimeForProgress(t){return null}}exports.Animation=d;exports.MultiAnimation=_;exports.POSITION_THRESHOLD=R;exports.SETTLE_THRESHOLD=g;exports.VELOCITY_THRESHOLD=T;exports.WebAnimation=O;
|