@ssgoi/core 2.5.4 → 2.5.6

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.
Files changed (41) hide show
  1. package/dist/animator/animate/css-runner.d.ts +17 -0
  2. package/dist/animator/animate/css-runner.d.ts.map +1 -0
  3. package/dist/animator/animate/index.d.ts +42 -0
  4. package/dist/animator/animate/index.d.ts.map +1 -0
  5. package/dist/animator/animate/tick-runner.d.ts +16 -0
  6. package/dist/animator/animate/tick-runner.d.ts.map +1 -0
  7. package/dist/animator/animate/types.d.ts +31 -0
  8. package/dist/animator/animate/types.d.ts.map +1 -0
  9. package/dist/animator/animation-scheduler.d.ts +4 -17
  10. package/dist/animator/animation-scheduler.d.ts.map +1 -1
  11. package/dist/animator/index.d.ts +32 -32
  12. package/dist/animator/index.d.ts.map +1 -1
  13. package/dist/animator/spring-core.d.ts +63 -0
  14. package/dist/animator/spring-core.d.ts.map +1 -0
  15. package/dist/animator/ticker.d.ts +1 -0
  16. package/dist/animator/ticker.d.ts.map +1 -1
  17. package/dist/index.cjs +2 -2
  18. package/dist/index.js +567 -608
  19. package/dist/jaemin-BG8HRXG1.cjs +1 -0
  20. package/dist/{jaemin-BAi8PTrj.js → jaemin-BWkrXq0V.js} +21 -20
  21. package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -1
  22. package/dist/ssgoi-transition/create-swipe-detector.d.ts +1 -0
  23. package/dist/ssgoi-transition/create-swipe-detector.d.ts.map +1 -1
  24. package/dist/transition/create-transition-callback.d.ts +2 -2
  25. package/dist/transition/create-transition-callback.d.ts.map +1 -1
  26. package/dist/transition/transition-strategy.d.ts +16 -16
  27. package/dist/transition/transition-strategy.d.ts.map +1 -1
  28. package/dist/transition/transition.d.ts +2 -18
  29. package/dist/transition/transition.d.ts.map +1 -1
  30. package/dist/types.cjs +1 -1
  31. package/dist/types.d.ts +74 -34
  32. package/dist/types.d.ts.map +1 -1
  33. package/dist/types.js +21 -6
  34. package/dist/view-transitions/drill.d.ts.map +1 -1
  35. package/dist/view-transitions/hero.d.ts.map +1 -1
  36. package/dist/view-transitions/index.cjs +7 -7
  37. package/dist/view-transitions/index.js +298 -284
  38. package/package.json +1 -1
  39. package/dist/animator/animate.d.ts +0 -35
  40. package/dist/animator/animate.d.ts.map +0 -1
  41. package/dist/jaemin-DL1-g_B5.cjs +0 -1
@@ -0,0 +1,17 @@
1
+ import { SpringConfig } from '../spring-core';
2
+ import { AnimationControls, StyleObject } from './types';
3
+ export interface CssRunnerOptions {
4
+ element: HTMLElement;
5
+ from: number;
6
+ to: number;
7
+ spring: SpringConfig;
8
+ velocity?: number;
9
+ style: (progress: number) => StyleObject;
10
+ onComplete: () => void;
11
+ onStart?: () => void;
12
+ }
13
+ /**
14
+ * Run spring animation via Web Animation API
15
+ */
16
+ export declare function runCssAnimation(options: CssRunnerOptions): AnimationControls;
17
+ //# sourceMappingURL=css-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css-runner.d.ts","sourceRoot":"","sources":["../../../src/lib/animator/animate/css-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE9D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,CAAC;IACzC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AA4HD;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,iBAAiB,CA6E5E"}
@@ -0,0 +1,42 @@
1
+ import { AnimationControls, AnimationOptions } from './types';
2
+ export type { AnimationControls, AnimationOptions };
3
+ /**
4
+ * Run spring animation
5
+ *
6
+ * tick option: RAF-based real-time animation
7
+ * css option: Web Animation API based (GPU accelerated)
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * // Tick mode (RAF)
12
+ * const controls = animate({
13
+ * from: 0,
14
+ * to: 1,
15
+ * spring: { stiffness: 300, damping: 30 },
16
+ * tick: (value) => element.style.opacity = String(value),
17
+ * onComplete: () => console.log('done'),
18
+ * });
19
+ *
20
+ * // CSS mode (Web Animation API)
21
+ * const controls = animate({
22
+ * from: 0,
23
+ * to: 1,
24
+ * spring: { stiffness: 300, damping: 30 },
25
+ * css: {
26
+ * element: myElement,
27
+ * style: (progress) => ({
28
+ * opacity: String(progress),
29
+ * transform: `scale(${0.5 + 0.5 * progress})`,
30
+ * }),
31
+ * },
32
+ * onComplete: () => console.log('done'),
33
+ * });
34
+ *
35
+ * // Stop mid-animation and check state
36
+ * controls.stop();
37
+ * console.log(controls.getPosition()); // Current position
38
+ * console.log(controls.getVelocity()); // Current velocity
39
+ * ```
40
+ */
41
+ export declare function animate(options: AnimationOptions): AnimationControls;
42
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/animator/animate/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEnE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,iBAAiB,CA6CpE"}
@@ -0,0 +1,16 @@
1
+ import { SpringConfig } from '../spring-core';
2
+ import { AnimationControls } from './types';
3
+ export interface TickRunnerOptions {
4
+ from: number;
5
+ to: number;
6
+ spring: SpringConfig;
7
+ velocity?: number;
8
+ onUpdate: (value: number) => void;
9
+ onComplete: () => void;
10
+ onStart?: () => void;
11
+ }
12
+ /**
13
+ * Run spring animation via RAF
14
+ */
15
+ export declare function runTickAnimation(options: TickRunnerOptions): AnimationControls;
16
+ //# sourceMappingURL=tick-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tick-runner.d.ts","sourceRoot":"","sources":["../../../src/lib/animator/animate/tick-runner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,iBAAiB,GACzB,iBAAiB,CA8DnB"}
@@ -0,0 +1,31 @@
1
+ import { SpringConfig } from '../spring-core';
2
+ /**
3
+ * CSS style object type
4
+ */
5
+ export type StyleObject = Record<string, number | string>;
6
+ /**
7
+ * Animation Controls - Common interface for both tick-runner and css-runner
8
+ */
9
+ export interface AnimationControls {
10
+ stop: () => void;
11
+ getPosition: () => number;
12
+ getVelocity: () => number;
13
+ isRunning: () => boolean;
14
+ }
15
+ /**
16
+ * Animation Options - Unified options
17
+ */
18
+ export interface AnimationOptions {
19
+ from: number;
20
+ to: number;
21
+ spring: SpringConfig;
22
+ velocity?: number;
23
+ onComplete: () => void;
24
+ onStart?: () => void;
25
+ tick?: (value: number) => void;
26
+ css?: {
27
+ element: HTMLElement;
28
+ style: (progress: number) => StyleObject;
29
+ };
30
+ }
31
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/animator/animate/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAGrB,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,GAAG,CAAC,EAAE;QACJ,OAAO,EAAE,WAAW,CAAC;QACrB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,CAAC;KAC1C,CAAC;CACH"}
@@ -7,10 +7,8 @@ import { MultiSpringConfig, AnimationController, AnimationState } from '../types
7
7
  * - overlap: All springs start immediately (parallel)
8
8
  * - wait: Each spring waits for previous to complete (sequential)
9
9
  * - chain: Springs start with offset delays
10
- *
11
- * Note: getCurrentState() always returns MultiAnimationState (number-based progress)
12
10
  */
13
- export declare class AnimationScheduler<TAnimationValue = number> implements AnimationController<number> {
11
+ export declare class AnimationScheduler implements AnimationController {
14
12
  private config;
15
13
  private animators;
16
14
  private springOrder;
@@ -19,29 +17,18 @@ export declare class AnimationScheduler<TAnimationValue = number> implements Ani
19
17
  private direction;
20
18
  private idCounter;
21
19
  private timeoutIds;
22
- constructor(config: MultiSpringConfig<TAnimationValue>);
20
+ constructor(config: MultiSpringConfig);
23
21
  private generateId;
24
22
  private initializeAnimators;
25
- /**
26
- * Normalize schedule configuration to unified internal representation
27
- * Uses discriminated union and early return pattern
28
- *
29
- * @param direction - "forward" or "backward" direction
30
- */
31
23
  private normalizeSchedule;
32
24
  private onAnimatorComplete;
33
- /**
34
- * Handle wait mode chaining: start next/previous spring after completion
35
- */
36
25
  private handleWaitModeChaining;
37
26
  private startAnimator;
38
27
  private startBackwardAnimator;
39
28
  forward(): void;
40
29
  backward(): void;
41
30
  stop(): void;
42
- reverse(options?: {
43
- offsetMode?: "immediate" | "mirror" | "reverse";
44
- }): void;
45
- getCurrentState(): AnimationState<number>;
31
+ reverse(): void;
32
+ getCurrentState(): AnimationState;
46
33
  }
47
34
  //# sourceMappingURL=animation-scheduler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"animation-scheduler.d.ts","sourceRoot":"","sources":["../../src/lib/animator/animation-scheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EAGjB,mBAAmB,EACnB,cAAc,EACf,MAAM,UAAU,CAAC;AAYlB;;;;;;;;;;GAUG;AACH,qBAAa,kBAAkB,CAAC,eAAe,GAAG,MAAM,CACtD,YAAW,mBAAmB,CAAC,MAAM,CAAC;IAEtC,OAAO,CAAC,MAAM,CAAqC;IACnD,OAAO,CAAC,SAAS,CAA0D;IAC3E,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,SAAS,CAAqC;IACtD,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,UAAU,CAAgB;gBAEtB,MAAM,EAAE,iBAAiB,CAAC,eAAe,CAAC;IAKtD,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,mBAAmB;IAsB3B;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IA+EzB,OAAO,CAAC,kBAAkB;IA4B1B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAkC9B,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,qBAAqB;IAqB7B,OAAO,IAAI,IAAI;IAiCf,QAAQ,IAAI,IAAI;IAiChB,IAAI,IAAI,IAAI;IAYZ,OAAO,CAAC,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAA;KAAE,GAAG,IAAI;IAoD5E,eAAe,IAAI,cAAc,CAAC,MAAM,CAAC;CAQ1C"}
1
+ {"version":3,"file":"animation-scheduler.d.ts","sourceRoot":"","sources":["../../src/lib/animator/animation-scheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EAGjB,mBAAmB,EACnB,cAAc,EACf,MAAM,UAAU,CAAC;AAYlB;;;;;;;;GAQG;AACH,qBAAa,kBAAmB,YAAW,mBAAmB;IAC5D,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,SAAS,CAAyC;IAC1D,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,SAAS,CAAqC;IACtD,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,UAAU,CAAgB;gBAEtB,MAAM,EAAE,iBAAiB;IAKrC,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,mBAAmB;IAsB3B,OAAO,CAAC,iBAAiB;IAwCzB,OAAO,CAAC,kBAAkB;IAkB1B,OAAO,CAAC,sBAAsB;IA0B9B,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,qBAAqB;IAS7B,OAAO,IAAI,IAAI;IAwBf,QAAQ,IAAI,IAAI;IAwBhB,IAAI,IAAI,IAAI;IASZ,OAAO,IAAI,IAAI;IAmCf,eAAe,IAAI,cAAc;CAQlC"}
@@ -1,47 +1,47 @@
1
+ import { StyleObject } from './animate/types';
1
2
  import { SpringConfig, AnimationController, AnimationState } from '../types';
2
- export interface AnimationOptions<TAnimationValue = number> {
3
- from: TAnimationValue;
4
- to: TAnimationValue;
5
- spring: SpringConfig;
6
- onUpdate: (value: TAnimationValue) => void;
7
- onComplete: () => void;
3
+ export type { StyleObject };
4
+ export interface AnimatorOptions {
5
+ from?: number;
6
+ to?: number;
7
+ spring?: SpringConfig;
8
+ tick?: (progress: number) => void;
9
+ css?: {
10
+ element: HTMLElement;
11
+ style: (progress: number) => StyleObject;
12
+ };
13
+ onComplete?: () => void;
8
14
  onStart?: () => void;
9
15
  }
10
16
  /**
11
- * New Animator implementation using Popmotion
12
- * Provides spring-based animations with fine control
13
- * Supports both number and object animations
17
+ * Animator - Spring-based Animation Controller
14
18
  *
15
- * @template TAnimationValue - The type of value being animated (number | object)
19
+ * Internally selects appropriate runner based on tick or css option
20
+ * - tick: RAF-based real-time animation
21
+ * - css: Web Animation API based (GPU accelerated, velocity tracking via simulation data)
16
22
  */
17
- export declare class Animator<TAnimationValue = number> implements AnimationController<TAnimationValue> {
23
+ export declare class Animator implements AnimationController {
18
24
  private options;
19
- private currentValue;
20
- private velocity;
21
- private isAnimating;
22
25
  private controls;
23
- private animationMap;
24
- private activeAnimations;
25
- private completedAnimations;
26
- private updatedProperties;
27
- constructor(options: Partial<AnimationOptions<TAnimationValue>>);
28
- private animate;
29
- private animateObject;
26
+ private isAnimating;
27
+ private currentValue;
28
+ private currentVelocity;
29
+ constructor(options: AnimatorOptions);
30
+ private runAnimation;
30
31
  forward(): void;
31
32
  backward(): void;
32
33
  reverse(): void;
33
- private shouldReverse;
34
34
  stop(): void;
35
- getVelocity(): TAnimationValue extends number ? number : Record<string, number>;
36
- getCurrentValue(): TAnimationValue;
35
+ getVelocity(): number;
36
+ getCurrentValue(): number;
37
37
  getIsAnimating(): boolean;
38
- getCurrentState(): AnimationState<TAnimationValue>;
39
- setVelocity(velocity: TAnimationValue extends number ? number : Record<string, number>): void;
40
- setValue(value: TAnimationValue): void;
41
- updateOptions(newOptions: Partial<AnimationOptions<TAnimationValue>>): void;
42
- static fromState<TAnimationValue = number>(state: {
43
- position: TAnimationValue;
44
- velocity: TAnimationValue extends number ? number : Record<string, number>;
45
- }, newOptions: Partial<AnimationOptions<TAnimationValue>>): Animator<TAnimationValue>;
38
+ getCurrentState(): AnimationState;
39
+ setValue(value: number): void;
40
+ setVelocity(velocity: number): void;
41
+ updateOptions(newOptions: Partial<AnimatorOptions>): void;
42
+ static fromState(state: {
43
+ position: number;
44
+ velocity: number;
45
+ }, options: AnimatorOptions): Animator;
46
46
  }
47
47
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/animator/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,gBAAgB,CAAC,eAAe,GAAG,MAAM;IACxD,IAAI,EAAE,eAAe,CAAC;IACtB,EAAE,EAAE,eAAe,CAAC;IACpB,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;GAMG;AACH,qBAAa,QAAQ,CAAC,eAAe,GAAG,MAAM,CAC5C,YAAW,mBAAmB,CAAC,eAAe,CAAC;IAE/C,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,YAAY,CAAkB;IACtC,OAAO,CAAC,QAAQ,CAEW;IAC3B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,QAAQ,CAAqC;IAGrD,OAAO,CAAC,YAAY,CAAkD;IACtE,OAAO,CAAC,gBAAgB,CAAqB;IAC7C,OAAO,CAAC,mBAAmB,CAAqB;IAChD,OAAO,CAAC,iBAAiB,CAAqB;gBAElC,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC;IA2B/D,OAAO,CAAC,OAAO,CA+Fb;IAEF,OAAO,CAAC,aAAa,CAoHnB;IAGF,OAAO,IAAI,IAAI;IAKf,QAAQ,IAAI,IAAI;IAKhB,OAAO,IAAI,IAAI;IAcf,OAAO,CAAC,aAAa;IAYrB,IAAI,IAAI,IAAI;IAyBZ,WAAW,IAAI,eAAe,SAAS,MAAM,GACzC,MAAM,GACN,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAI1B,eAAe,IAAI,eAAe;IAIlC,cAAc,IAAI,OAAO;IAIzB,eAAe,IAAI,cAAc,CAAC,eAAe,CAAC;IAWlD,WAAW,CACT,QAAQ,EAAE,eAAe,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACzE,IAAI;IAIP,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAKtC,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,GAAG,IAAI;IAY3E,MAAM,CAAC,SAAS,CAAC,eAAe,GAAG,MAAM,EACvC,KAAK,EAAE;QACL,QAAQ,EAAE,eAAe,CAAC;QAC1B,QAAQ,EAAE,eAAe,SAAS,MAAM,GACpC,MAAM,GACN,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC5B,EACD,UAAU,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,GACrD,QAAQ,CAAC,eAAe,CAAC;CAM7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/animator/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,GAAG,CAAC,EAAE;QACJ,OAAO,EAAE,WAAW,CAAC;QACrB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,CAAC;KAC1C,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;GAMG;AACH,qBAAa,QAAS,YAAW,mBAAmB;IAClD,OAAO,CAAC,OAAO,CAWb;IACF,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,eAAe,CAAa;gBAExB,OAAO,EAAE,eAAe;IAiBpC,OAAO,CAAC,YAAY;IAqBpB,OAAO,IAAI,IAAI;IAKf,QAAQ,IAAI,IAAI;IAKhB,OAAO,IAAI,IAAI;IAWf,IAAI,IAAI,IAAI;IAWZ,WAAW,IAAI,MAAM;IAIrB,eAAe,IAAI,MAAM;IAIzB,cAAc,IAAI,OAAO;IAIzB,eAAe,IAAI,cAAc;IAUjC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7B,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAInC,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;IAIzD,MAAM,CAAC,SAAS,CACd,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAC7C,OAAO,EAAE,eAAe,GACvB,QAAQ;CAMZ"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Spring Core
3
+ *
4
+ * Core module containing spring physics calculation logic
5
+ * Used by both tick-runner (RAF based) and css-runner (synchronous simulation)
6
+ *
7
+ * Uses optimized Semi-implicit Euler method (Allen Chou's approach)
8
+ */
9
+ export interface SpringConfig {
10
+ stiffness: number;
11
+ damping: number;
12
+ }
13
+ export interface SpringState {
14
+ position: number;
15
+ velocity: number;
16
+ }
17
+ export interface SpringConstants {
18
+ omega: number;
19
+ zeta: number;
20
+ }
21
+ /**
22
+ * Pre-compute spring constants (performance optimization)
23
+ *
24
+ * @param config Spring configuration
25
+ * @returns omega (angular frequency), zeta (damping ratio)
26
+ */
27
+ export declare function computeSpringConstants(config: SpringConfig): SpringConstants;
28
+ /**
29
+ * Calculate one spring step (Semi-implicit Euler)
30
+ *
31
+ * Uses optimized formula with omega and zeta instead of F = -k(x-xt) - d*v:
32
+ * - v += -2*h*zeta*omega*v + h*omega^2*(target - x)
33
+ * - x += h*v
34
+ *
35
+ * @param state Current state (position, velocity)
36
+ * @param target Target position
37
+ * @param constants Pre-computed spring constants (omega, zeta)
38
+ * @param dt Delta time (seconds)
39
+ * @returns New state
40
+ */
41
+ export declare function stepSpring(state: SpringState, target: number, constants: SpringConstants, dt: number): SpringState;
42
+ export declare const POSITION_THRESHOLD = 0.01;
43
+ export declare const VELOCITY_THRESHOLD = 0.01;
44
+ export declare const SETTLE_THRESHOLD = 0.05;
45
+ /**
46
+ * Check if spring has converged to target
47
+ */
48
+ export declare function isSettled(state: SpringState, target: number): boolean;
49
+ /**
50
+ * Full spring simulation (synchronous)
51
+ * Used for Web Animation API keyframe generation
52
+ *
53
+ * @param config Spring configuration
54
+ * @param from Start value
55
+ * @param to Target value
56
+ * @param initialVelocity Initial velocity
57
+ * @returns Frame-by-frame progress array and duration
58
+ */
59
+ export declare function simulateSpring(config: SpringConfig, from: number, to: number, initialVelocity?: number): {
60
+ frames: number[];
61
+ duration: number;
62
+ };
63
+ //# sourceMappingURL=spring-core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spring-core.d.ts","sourceRoot":"","sources":["../../src/lib/animator/spring-core.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,GAAG,eAAe,CAO5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,eAAe,EAC1B,EAAE,EAAE,MAAM,GACT,WAAW,CAiBb;AAGD,eAAO,MAAM,kBAAkB,OAAO,CAAC;AACvC,eAAO,MAAM,kBAAkB,OAAO,CAAC;AACvC,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAIrE;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,eAAe,SAAI,GAClB;IAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAoCxC"}
@@ -13,6 +13,7 @@ declare class Ticker {
13
13
  private elapsed;
14
14
  private lagThreshold;
15
15
  private adjustedLag;
16
+ private maxDeltaTime;
16
17
  private gap;
17
18
  private nextTime;
18
19
  private tick;
@@ -1 +1 @@
1
- {"version":3,"file":"ticker.d.ts","sourceRoot":"","sources":["../../src/lib/animator/ticker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,KAAK,cAAc,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAEnE,cAAM,MAAM;IACV,OAAO,CAAC,SAAS,CAA6B;IAC9C,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,SAAS,CAAS;IAG1B,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,OAAO,CAAK;IAGpB,OAAO,CAAC,YAAY,CAAO;IAC3B,OAAO,CAAC,WAAW,CAAM;IAGzB,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,QAAQ,CAAY;IAE5B,OAAO,CAAC,IAAI,CAmCV;IAEF,SAAS,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,IAAI;IAe/C,WAAW,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAW3C;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAK1D;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAKtB,gBAAgB,IAAI,MAAM;IAI1B,UAAU,IAAI,MAAM;CAGrB;AAGD,eAAO,MAAM,MAAM,QAAe,CAAC"}
1
+ {"version":3,"file":"ticker.d.ts","sourceRoot":"","sources":["../../src/lib/animator/ticker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,KAAK,cAAc,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAEnE,cAAM,MAAM;IACV,OAAO,CAAC,SAAS,CAA6B;IAC9C,OAAO,CAAC,KAAK,CAAuB;IACpC,OAAO,CAAC,SAAS,CAAS;IAG1B,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,OAAO,CAAK;IAGpB,OAAO,CAAC,YAAY,CAAO;IAC3B,OAAO,CAAC,WAAW,CAAM;IACzB,OAAO,CAAC,YAAY,CAAM;IAG1B,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,QAAQ,CAAY;IAE5B,OAAO,CAAC,IAAI,CAyCV;IAEF,SAAS,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,IAAI;IAe/C,WAAW,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAW3C;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAK1D;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAKtB,gBAAgB,IAAI,MAAM;IAI1B,UAAU,IAAI,MAAM;CAGrB;AAGD,eAAO,MAAM,MAAM,QAAe,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var N=Object.defineProperty;var F=(n,t,e)=>t in n?N(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var m=(n,t,e)=>F(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("./types.cjs"),Y=require("./jaemin-DL1-g_B5.cjs");class W{constructor(){m(this,"listeners",new Set);m(this,"rafId",null);m(this,"isRunning",!1);m(this,"startTime",Date.now());m(this,"lastUpdate",this.startTime);m(this,"elapsed",0);m(this,"lagThreshold",500);m(this,"adjustedLag",33);m(this,"gap",1e3/240);m(this,"nextTime",this.gap);m(this,"tick",()=>{const t=Date.now();let e=t-this.lastUpdate;(e>this.lagThreshold||e<0)&&(this.startTime+=e-this.adjustedLag,e=this.adjustedLag),this.lastUpdate=t;const i=t-this.startTime,o=i-this.nextTime;if(o>0){const r=e/1e3;this.elapsed=i/1e3,this.nextTime+=o+(o>=this.gap?4:this.gap-o),this.listeners.forEach(s=>{s(r,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(t){return this.listeners.add(t),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(t)}}unsubscribe(t){this.listeners.delete(t),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(t,e){this.lagThreshold=t,this.adjustedLag=Math.min(e,t)}fps(t){this.gap=1e3/t,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const R=new W;function k(n){const{from:t,to:e,stiffness:i,damping:o,mass:r,velocity:s=0,onUpdate:d,onComplete:l}=n;let h=t,u=s,a=!0;const p=Math.sqrt(i/r),c=o/(2*Math.sqrt(i*r)),g=.01,w=.01;let f=0;const y=.05,S=T=>{if(!a)return;const A=Math.min(T,.033),v=-2*A*c*p*u,b=A*p*p*(e-h);u+=v+b,h+=A*u;const E=Math.abs(e-h),C=Math.abs(u);if(E<g&&C<w){if(f+=A,f>=y){h=e,u=0,a=!1,d(h),R.unsubscribe(S),l();return}}else f=0;d(h)};return R.subscribe(S),{stop:()=>{a&&(a=!1,R.unsubscribe(S))}}}class O{constructor(t){m(this,"options");m(this,"currentValue");m(this,"velocity");m(this,"isAnimating",!1);m(this,"controls",null);m(this,"animationMap",null);m(this,"activeAnimations",new Set);m(this,"completedAnimations",new Set);m(this,"updatedProperties",new Set);m(this,"animate",(t=!1)=>{!this.isAnimating&&this.options.onStart&&this.options.onStart(),this.isAnimating=!0;const e=t?this.options.from:this.options.to;if(typeof this.currentValue=="object"&&this.currentValue!==null){this.animateObject(e);return}let i=this.currentValue,o=performance.now();const r={from:this.currentValue,to:e,stiffness:this.options.spring.stiffness,damping:this.options.spring.damping,mass:1};typeof this.velocity=="number"&&(r.velocity=this.velocity*1e3),this.controls=k({...r,onUpdate:s=>{const d=performance.now(),l=(d-o)/1e3;if(l>0){if(typeof s=="number"&&typeof i=="number"){const h=(s-i)/l;this.velocity=h/1e3}else if(typeof s=="object"&&s!==null){const h={};Object.keys(s).forEach(u=>{const a=s[u],p=i[u];if(typeof a=="number"&&typeof p=="number"){const c=(a-p)/l;h[u]=c/1e3}}),this.velocity=h}i=s,o=d}this.currentValue=s,this.options.onUpdate(s)},onComplete:()=>{this.currentValue=e,this.isAnimating=!1,this.controls=null,typeof this.velocity=="object"&&this.velocity!==null?Object.keys(this.velocity).forEach(s=>{this.velocity[s]=0}):this.velocity=0,this.options.onComplete()}})});m(this,"animateObject",t=>{const e=this.currentValue,i=Object.keys(e);this.animationMap=new Map,this.activeAnimations.clear(),this.completedAnimations.clear(),this.updatedProperties.clear();const o={...e},r={};let s=!1;const d=()=>{const l=i.filter(u=>!this.completedAnimations.has(u));if(l.every(u=>this.updatedProperties.has(u))&&l.length>0){if(typeof this.velocity=="object"&&this.velocity){const u=performance.now();Object.keys(o).forEach(a=>{if(r[a]){const p=(u-r[a])/1e3,c=this.currentValue[a],g=o[a];typeof c=="number"&&typeof g=="number"&&p>0&&(this.velocity[a]=(g-c)/p/1e3)}r[a]=u})}this.currentValue={...o},this.options.onUpdate(this.currentValue),this.updatedProperties.clear(),!s&&this.options.onStart&&(s=!0,this.options.onStart())}};i.forEach(l=>{this.activeAnimations.add(l);const h={from:e[l],to:t[l],stiffness:this.options.spring.stiffness,damping:this.options.spring.damping,mass:1};typeof this.velocity=="object"&&this.velocity&&l in this.velocity&&(h.velocity=this.velocity[l]*1e3);const u=k({...h,onUpdate:a=>{o[l]=a,this.updatedProperties.add(l),d()},onComplete:()=>{this.completedAnimations.add(l),this.updatedProperties.delete(l),this.completedAnimations.size===i.length&&(this.currentValue=t,this.isAnimating=!1,this.animationMap=null,typeof this.velocity=="object"&&this.velocity&&Object.keys(this.velocity).forEach(a=>{this.velocity[a]=0}),this.options.onComplete())}});this.animationMap.set(l,u)})});if(this.options={from:t.from??0,to:t.to??1,spring:t.spring??{stiffness:100,damping:10},onUpdate:t.onUpdate??(()=>{}),onComplete:t.onComplete??(()=>{}),onStart:t.onStart},this.currentValue=this.options.from,typeof this.options.from=="object"&&this.options.from!==null){const e={};Object.keys(this.options.from).forEach(i=>{e[i]=0}),this.velocity=e}else this.velocity=0}forward(){this.stop(),this.animate(!1)}backward(){this.stop(),this.animate(!0)}reverse(){const t=this.options.from;if(this.options.from=this.options.to,this.options.to=t,this.isAnimating){const e=this.shouldReverse();this.stop(),this.animate(!e)}}shouldReverse(){return typeof this.currentValue=="number"&&typeof this.options.from=="number"&&typeof this.options.to=="number"?this.currentValue>(this.options.from+this.options.to)/2:!1}stop(){this.isAnimating=!1,this.controls&&(this.controls.stop(),this.controls=null),this.animationMap&&(this.animationMap.forEach(t=>{t.stop()}),this.animationMap.clear(),this.animationMap=null),this.updatedProperties.clear()}getVelocity(){return this.velocity}getCurrentValue(){return this.currentValue}getIsAnimating(){return this.isAnimating}getCurrentState(){return{type:"single",position:this.currentValue,velocity:this.velocity,from:this.options.from,to:this.options.to}}setVelocity(t){this.velocity=t}setValue(t){this.currentValue=t}updateOptions(t){if(this.options={...this.options,...t},this.isAnimating&&this.controls){const e=this.shouldReverse();this.stop(),this.animate(!e)}}static fromState(t,e){const i=new O(e);return i.setValue(t.position),i.setVelocity(t.velocity),i}}class L{constructor(t){m(this,"config");m(this,"animators",new Map);m(this,"springOrder",[]);m(this,"completedCount",0);m(this,"completedAnimators",new Set);m(this,"direction","forward");m(this,"idCounter",0);m(this,"timeoutIds",[]);this.config=t,this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.springs.forEach(t=>{const e=this.generateId(),i=new O({from:t.from,to:t.to,spring:t.spring,onUpdate:t.tick,onComplete:()=>this.onAnimatorComplete(e),onStart:t.onStart});this.animators.set(e,{id:e,item:t,animator:i,startTime:null}),this.springOrder.push(e)})}normalizeSchedule(t){const e=this.config.schedule??"overlap";return this.springOrder.map((i,o)=>{const r=this.animators.get(i);if(!r)throw new Error(`AnimationScheduler: animator with id "${i}" not found during normalization`);if(e==="overlap")return{type:"offset",id:i,delay:0};if(e==="wait")return t==="forward"&&o===0?{type:"offset",id:i,delay:0}:t==="backward"&&o===this.springOrder.length-1?{type:"offset",id:i,delay:0}:{type:"wait",id:i};const s=r.item.offset??0;if(t==="forward")return{type:"offset",id:i,delay:s};const d=this.animators.size===0?0:Math.max(...Array.from(this.animators.values()).map(l=>l.item.offset??0));return{type:"offset",id:i,delay:d-s}})}onAnimatorComplete(t){var i,o,r,s,d,l;const e=this.animators.get(t);if(!e){console.warn(`AnimationScheduler: animator with id "${t}" not found on completion`);return}this.completedAnimators.has(t)||(this.completedAnimators.add(t),this.completedCount++,(o=(i=e.item).onComplete)==null||o.call(i),(s=(r=this.config).onProgress)==null||s.call(r,this.completedCount,this.config.springs.length),this.handleWaitModeChaining(t),this.completedCount===this.config.springs.length&&((l=(d=this.config).onEnd)==null||l.call(d)))}handleWaitModeChaining(t){if(this.config.schedule!=="wait")return;const e=this.springOrder.indexOf(t);if(this.direction==="forward"){const r=this.springOrder[e+1];if(!r)return;const s=this.animators.get(r);s&&s.startTime===null&&this.startAnimator(r);return}const i=this.springOrder[e-1];if(!i)return;const o=this.animators.get(i);o&&o.startTime===null&&this.startBackwardAnimator(i)}startAnimator(t){const e=this.animators.get(t);if(!e){console.warn(`AnimationScheduler: animator with id "${t}" not found on start`);return}if(e.startTime!==null){console.warn(`AnimationScheduler: animator with id "${t}" already started`);return}e.startTime=Date.now(),e.animator.forward()}startBackwardAnimator(t){const e=this.animators.get(t);if(!e){console.warn(`AnimationScheduler: animator with id "${t}" not found on backward start`);return}if(e.startTime!==null){console.warn(`AnimationScheduler: animator with id "${t}" already started`);return}e.startTime=Date.now(),e.animator.backward()}forward(){var e,i;this.stop(),this.direction="forward",this.completedCount=0,this.completedAnimators.clear(),(i=(e=this.config).onStart)==null||i.call(e),this.normalizeSchedule("forward").forEach(o=>{if(o.type==="wait")return;if(o.delay===0){this.startAnimator(o.id);return}const r=window.setTimeout(()=>this.startAnimator(o.id),o.delay);this.timeoutIds.push(r)})}backward(){var e,i;this.stop(),this.direction="backward",this.completedCount=0,this.completedAnimators.clear(),(i=(e=this.config).onStart)==null||i.call(e),this.normalizeSchedule("backward").forEach(o=>{if(o.type==="wait")return;if(o.delay===0){this.startBackwardAnimator(o.id);return}const r=window.setTimeout(()=>this.startBackwardAnimator(o.id),o.delay);this.timeoutIds.push(r)})}stop(){this.timeoutIds.forEach(t=>clearTimeout(t)),this.timeoutIds=[],this.animators.forEach(t=>{t.animator.stop(),t.startTime=null})}reverse(t){((t==null?void 0:t.offsetMode)??"immediate")!=="immediate"&&console.warn('AnimationScheduler.reverse(): Only "immediate" offsetMode is currently supported. Falling back to "immediate".'),this.direction=this.direction==="forward"?"backward":"forward",this.animators.forEach(i=>{if(i.startTime===null)return;const o=i.animator.getCurrentState();if(o.type!=="single")return;if(o.position===o.to){const s=O.fromState({position:1,velocity:0},{from:i.item.to??1,to:i.item.from??0,spring:i.item.spring,onUpdate:i.item.tick,onComplete:()=>this.onAnimatorComplete(i.id),onStart:i.item.onStart});s.forward(),i.animator=s;return}i.animator.reverse()})}getCurrentState(){return{type:"multi",completed:this.completedCount,total:this.config.springs.length,direction:this.direction}}}const j=Symbol.for("TRANSITION_STRATEGY"),z=n=>({runIn:async t=>{const{currentAnimation:e}=n;if(e&&e.direction==="out"){const s=e.controller.getCurrentState();if(e.controller.stop(),s.type==="multi")return e.controller.reverse(),{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};if(t.out){const d=await t.out,{from:l=1,to:h=0}=d;return{config:d,state:{position:s.position,velocity:s.velocity},from:l,to:h,direction:"backward"}}}const i=await t.in;if(!i)return{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};if("springs"in i)return{config:i,state:{position:0,velocity:0},from:0,to:1,direction:"forward"};const{from:o=0,to:r=1}=i;return{config:i,state:{position:o,velocity:0},from:o,to:r,direction:"forward"}},runOut:async t=>{const{currentAnimation:e}=n;if(e&&e.direction==="in"){const s=e.controller.getCurrentState();if(e.controller.stop(),s.type==="multi")return e.controller.reverse(),{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};if(t.in){const d=await t.in,{from:l=0,to:h=1}=d;return{config:d,state:{position:s.position,velocity:s.velocity},from:l,to:h,direction:"backward"}}}const i=await t.out;if(!i)return{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};if("springs"in i)return{config:i,state:{position:1,velocity:0},from:1,to:0,direction:"forward"};const{from:o=1,to:r=0}=i;return{config:i,state:{position:o,velocity:0},from:o,to:r,direction:"forward"}}}),_=()=>({runIn:async n=>{const t=await n.in;if(!t)return{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};if("springs"in t)return{config:t,state:{position:0,velocity:0},from:0,to:1,direction:"forward"};const{from:e=0,to:i=1}=t;return{config:t,state:{position:e,velocity:0},from:e,to:i,direction:"forward"}},runOut:async n=>{const t=await n.out;if(!t)return{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};if("springs"in t)return{config:t,state:{position:1,velocity:0},from:1,to:0,direction:"forward"};const{from:e=1,to:i=0}=t;return{config:t,state:{position:e,velocity:0},from:e,to:i,direction:"forward"}}});function X(n,t){var u;let e=null,i=null,o=null,r=null;const s={get currentAnimation(){return e}},d=((u=t==null?void 0:t.strategy)==null?void 0:u.call(t,s))||z(s),l=async a=>{var S,T,A;i&&(i.remove(),i=null);const p=n(),c=p.in&&await p.in(a),g=!(t!=null&&t.strategy)&&p.out?p.out(a):void 0;if(!c)return;if(M.isMultiSpring(c)){const v={in:Promise.resolve(c),out:g&&Promise.resolve(g)};if(!(await d.runIn(v)).config){e&&(e.direction="in");return}(S=c.prepare)==null||S.call(c,a),c.wait&&await c.wait();const E=new L({...c,onEnd:()=>{var C;e=null,(C=c.onEnd)==null||C.call(c)}});e={controller:E,direction:"in"},E.forward();return}const w={in:Promise.resolve(c),out:g&&Promise.resolve(g)},f=await d.runIn(w);if(!f.config)return;if("springs"in f.config){console.error("Unexpected MultiSpringConfig in single-spring path");return}(A=(T=f.config).prepare)==null||A.call(T,a),f.config.wait&&await f.config.wait();const y=O.fromState(f.state,{from:f.from,to:f.to,spring:f.config.spring,onStart:f.config.onStart,onUpdate:f.config.tick,onComplete:()=>{var v,b;e=null,(b=(v=f.config)==null?void 0:v.onEnd)==null||b.call(v)}});e={controller:y,direction:"in"},f.direction==="forward"?y.forward():y.backward()},h=async a=>{var S,T,A;i=a;const p=n(),c=p.out&&await p.out(a);if(!c)return;if(M.isMultiSpring(c)){const v={in:void 0,out:Promise.resolve(c)};if(!(await d.runOut(v)).config){e&&(e.direction="out"),i&&(i.remove(),i=null);return}(S=c.prepare)==null||S.call(c,a),y(),c.wait&&await c.wait();const E=new L({...c,onEnd:()=>{var C,I;(C=c.onEnd)==null||C.call(c),i&&(i.remove(),i=null),e=null,(I=t==null?void 0:t.onCleanupEnd)==null||I.call(t)}});e={controller:E,direction:"out"},E.forward();return}const g={in:void 0,out:Promise.resolve(c)},w=await d.runOut(g);if(!w.config)return;if("springs"in w.config){console.error("Unexpected MultiSpringConfig in single-spring path");return}(A=(T=w.config).prepare)==null||A.call(T,a),y(),w.config.wait&&await w.config.wait();const f=O.fromState(w.state,{from:w.from,to:w.to,spring:w.config.spring,onStart:w.config.onStart,onUpdate:w.config.tick,onComplete:()=>{var v,b,E;(b=(v=w.config)==null?void 0:v.onEnd)==null||b.call(v),i&&(i.remove(),i=null),e=null,(E=t==null?void 0:t.onCleanupEnd)==null||E.call(t)}});e={controller:f,direction:"out"},w.direction==="forward"?f.forward():f.backward();function y(){!o||!i||(r&&o.contains(r)?o.insertBefore(i,r):o.appendChild(i))}};return a=>{if(a)return o=a.parentElement,r=a.nextElementSibling,l(a),()=>{if(a.isConnected){const p=a.cloneNode(!0);h(p)}else h(a)}}}const q=3,K=n=>{if(!n)return null;const t=n.split(`
2
- `).map(e=>e.trim());for(let e=q;e<Math.min(t.length,6);e++){const i=t[e],o=i==null?void 0:i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);if(!o)continue;const r=o[1]??"",s=o[2]??"0",d=o[3]??"0";return{file:r.split(/[\\/]/).pop()||r,line:s,column:d}}return null},x=new Map,V=new Map;function B(n,t,e){x.set(n,t);let i=V.get(n);return i||(i=X(()=>{const o=x.get(n);return o||(console.warn(`Transition "${String(n)}" not found`),{})},{strategy:e,onCleanupEnd:()=>$(n)}),V.set(n,i),i)}function $(n){x.delete(n),V.delete(n)}function H(){const n=K(new Error().stack);return n?`auto_${n.file}_${n.line}_${n.column}`:Symbol(`ssgoi_auto_${Date.now()}`)}const D=globalThis.FinalizationRegistry,U=D?new D(n=>{try{$(n)}catch{}}):void 0;function G(n){const t=n.key??H();if(n.ref&&U)try{U.register(n.ref,t)}catch{}return B(t,{in:n.in,out:n.out},n[j])}function J(n){const t=n.filter(e=>e.symmetric).map(e=>({from:e.to,to:e.from,transition:e.transition}));return[...n,...t]}function Q(n){let t=!1,e=0,i=0,o=!1;const r=50,s=50,d=c=>{if(!n)return;const g=c.touches[0];g&&(o=g.clientX<s,o&&(e=g.clientX,i=g.clientY))},l=c=>{if(!n||!o||t)return;const g=c.touches[0];if(!g)return;const w=g.clientX-e,f=g.clientY-i;w>r&&Math.abs(w)>Math.abs(f)&&(t=!0,setTimeout(()=>{t=!1},500))},h=()=>{n&&(o=!1,e=0,i=0)};return{initialize:()=>{typeof window>"u"||n&&(window.addEventListener("touchstart",d,{passive:!0}),window.addEventListener("touchmove",l,{passive:!0}),window.addEventListener("touchend",h,{passive:!0}))},cleanup:()=>{typeof window>"u"||(window.removeEventListener("touchstart",d),window.removeEventListener("touchmove",l),window.removeEventListener("touchend",h))},isSwipePending:()=>t}}const Z=n=>{let t=n.parentElement;for(;t&&t!==document.body;){const e=window.getComputedStyle(t),i=e.overflow+e.overflowY+e.overflowX;if(i.includes("auto")||i.includes("scroll")||t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.parentElement}return document.documentElement},tt=n=>{let t=n.parentElement;for(;t&&t!==document.body;){const e=window.getComputedStyle(t).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return t;t=t.parentElement}return document.body};function et(){let n=null,t=null;const e=new Map;let i=null;const o=()=>{n&&i&&e.set(i,{x:n.scrollLeft,y:n.scrollTop})};return{initializeContext:(u,a)=>{t=u,n||(n=Z(u),(n===document.documentElement?window:n).addEventListener("scroll",o,{passive:!0})),i=a},calculateScrollOffset:(u,a)=>{const p=u&&e.has(u)?e.get(u):{x:0,y:0},c=a&&e.has(a)?e.get(a):{x:0,y:0};return{x:-c.x+p.x,y:-c.y+p.y}},getScrollContainer:()=>n,getPositionedParentElement:()=>t?tt(t):document.body,getScrollPosition:u=>u&&e.has(u)?e.get(u):{x:0,y:0}}}function P(n,t){if(t==="*")return!0;if(t.endsWith("/*")){const e=t.slice(0,-2);return n===e||n.startsWith(e+"/")}return n===t}function it(n,t,e){for(const i of e)if(P(n,i.from)&&P(t,i.to))return i.transition;for(const i of e)if((i.from==="*"||P(n,i.from))&&(i.to==="*"||P(t,i.to)))return i.transition;return null}function nt(n){const{transitions:t=[],defaultTransition:e,middleware:i=(f,y)=>({from:f,to:y}),skipOnIosSwipe:o=!0}=n;let r=null;const s=J(t),{initializeContext:d,calculateScrollOffset:l,getScrollContainer:h,getPositionedParentElement:u,getScrollPosition:a}=et(),p=Q(o);p.initialize();function c(){if(r!=null&&r.from&&(r!=null&&r.to)){const{from:f,to:y}=i(r.from,r.to),T=it(f,y,s)||e,A=l(r.from,r.to),v={scrollOffset:A,scroll:a(r.from),get scrollingElement(){return h()||document.documentElement},get positionedParent(){return u()}},b={scrollOffset:A,get scroll(){return r?a(r.to):{x:0,y:0}},get scrollingElement(){return h()||document.documentElement},get positionedParent(){return u()}};T&&(T.out&&r.outResolve&&r.outResolve(E=>T.out(E,v)),T.in&&r.inResolve&&r.inResolve(E=>T.in(E,b))),r=null}}const g=async(f,y)=>p.isSwipePending()?()=>({}):y==="in"&&(!r||!r.from)?()=>({}):(r||(r={}),y==="out"?(r.from=f,new Promise(S=>{r.outResolve=S,c()})):(r.to=f,new Promise(S=>{r.inResolve=S,c()})));return f=>({key:f,in:async y=>(d(y,f),(await g(f,"in"))(y)),out:async y=>(await g(f,"out"))(y),[j]:_})}exports.isMultiSpring=M.isMultiSpring;exports.isSingleSpring=M.isSingleSpring;exports.jaeminInternal=Y.jaeminInternal;exports.TRANSITION_STRATEGY=j;exports.createDefaultStrategy=z;exports.createPageTransitionStrategy=_;exports.createSggoiTransitionContext=nt;exports.generateAutoKey=H;exports.transition=G;
1
+ "use strict";var K=Object.defineProperty;var B=(n,t,i)=>t in n?K(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i;var p=(n,t,i)=>B(n,typeof t!="symbol"?t+"":t,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./types.cjs"),U=require("./jaemin-BG8HRXG1.cjs");class G{constructor(){p(this,"listeners",new Set);p(this,"rafId",null);p(this,"isRunning",!1);p(this,"startTime",Date.now());p(this,"lastUpdate",this.startTime);p(this,"elapsed",0);p(this,"lagThreshold",500);p(this,"adjustedLag",33);p(this,"maxDeltaTime",33);p(this,"gap",1e3/240);p(this,"nextTime",this.gap);p(this,"tick",()=>{const t=Date.now();let e=t-this.lastUpdate;e>this.lagThreshold||e<0?(this.startTime+=e-this.adjustedLag,e=this.adjustedLag):e>this.maxDeltaTime&&(e=this.maxDeltaTime),this.lastUpdate=t;const o=t-this.startTime,r=o-this.nextTime;if(r>0){const s=e/1e3;this.elapsed=o/1e3,this.nextTime+=r+(r>=this.gap?4:this.gap-r),this.listeners.forEach(c=>{c(s,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(t){return this.listeners.add(t),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(t)}}unsubscribe(t){this.listeners.delete(t),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(t,i){this.lagThreshold=t,this.adjustedLag=Math.min(i,t)}fps(t){this.gap=1e3/t,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const x=new G;function N(n){const t=n.stiffness,i=n.damping,e=1,o=Math.sqrt(t/e),r=i/(2*Math.sqrt(t*e));return{omega:o,zeta:r}}function H(n,t,i,e){const{omega:o,zeta:r}=i,{position:s,velocity:c}=n,a=Math.min(e,.033),m=-2*a*r*o*c,h=a*o*o*(t-s),u=c+m+h;return{position:s+a*u,velocity:u}}const J=.01,Q=.01,Y=.05;function j(n,t){const i=Math.abs(t-n.position),e=Math.abs(n.velocity);return i<J&&e<Q}function Z(n){const{from:t,to:i,spring:e,velocity:o=0,onUpdate:r,onComplete:s,onStart:c}=n;let a={position:t,velocity:o},m=!0,h=0,u=!1;const g=N(e),l=w=>{if(m){if(u||(u=!0,c==null||c()),a=H(a,i,g,w),j(a,i)){if(h+=Math.min(w,.033),h>=Y){a={position:i,velocity:0},m=!1,r(a.position),x.unsubscribe(l),s();return}}else h=0;r(a.position)}};return x.subscribe(l),{stop:()=>{m&&(m=!1,x.unsubscribe(l))},getPosition:()=>a.position,getVelocity:()=>a.velocity,isRunning:()=>m}}const I=1e3/60;function tt(n,t,i,e=0){const o=N(i),r=600;let s={position:n,velocity:e},c=0;const a=[];for(let m=0;m<r;m++){const h=m*I;if(a.push({time:h,position:s.position,velocity:s.velocity}),s=H(s,t,o,I/1e3),j(s,t)){if(c+=I/1e3,c>=Y){a.push({time:(m+1)*I,position:t,velocity:0});break}}else c=0}return a}function L(n,t){if(n.length===0)return{position:0,velocity:0};const i=n[0],e=n[n.length-1];if(t<=0)return{position:i.position,velocity:i.velocity};if(t>=e.time)return{position:e.position,velocity:e.velocity};let o=0,r=n.length-1;for(;o<r-1;){const m=Math.floor((o+r)/2);n[m].time<=t?o=m:r=m}const s=n[o],c=n[r],a=(t-s.time)/(c.time-s.time);return{position:s.position+(c.position-s.position)*a,velocity:s.velocity+(c.velocity-s.velocity)*a}}function it(n,t){return n.map(i=>t(i.position))}function et(n){const{element:t,from:i,to:e,spring:o,velocity:r=0,style:s,onComplete:c,onStart:a}=n,m=tt(i,e,o,r);if(m.length===0)return a==null||a(),c(),{stop:()=>{},getPosition:()=>e,getVelocity:()=>0,isRunning:()=>!1};const h=it(m,s),u=m[m.length-1],g=u.time,l=t.animate(h,{duration:g,fill:"forwards",easing:"linear"});let w=!0;const d=performance.now();return a==null||a(),l.onfinish=()=>{w&&(w=!1,c())},{stop:()=>{w&&(w=!1,l.cancel())},getPosition:()=>{if(!w)return u.position;const f=performance.now()-d;return L(m,f).position},getVelocity:()=>{if(!w)return 0;const f=performance.now()-d;return L(m,f).velocity},isRunning:()=>w}}function nt(n){const{from:t,to:i,spring:e,velocity:o,onComplete:r,onStart:s,tick:c,css:a}=n;if(c&&a)throw new Error("Cannot use both 'tick' and 'css' options together");return!c&&!a?(s==null||s(),r(),{stop:()=>{},getPosition:()=>i,getVelocity:()=>0,isRunning:()=>!1}):a?et({element:a.element,from:t,to:i,spring:e,velocity:o,style:a.style,onComplete:r,onStart:s}):Z({from:t,to:i,spring:e,velocity:o,onUpdate:c,onComplete:r,onStart:s})}class b{constructor(t){p(this,"options");p(this,"controls",null);p(this,"isAnimating",!1);p(this,"currentValue");p(this,"currentVelocity",0);if(t.tick&&t.css)throw new Error("Cannot use both 'tick' and 'css' options together");this.options={from:t.from??0,to:t.to??1,spring:t.spring??{stiffness:300,damping:30},tick:t.tick,css:t.css,onComplete:t.onComplete??(()=>{}),onStart:t.onStart},this.currentValue=this.options.from}runAnimation(t){this.isAnimating=!0,this.controls=nt({from:this.currentValue,to:t,spring:this.options.spring,velocity:this.currentVelocity,tick:this.options.tick,css:this.options.css,onStart:this.options.onStart,onComplete:()=>{this.currentValue=t,this.currentVelocity=0,this.isAnimating=!1,this.controls=null,this.options.onComplete()}})}forward(){this.stop(),this.runAnimation(this.options.to)}backward(){this.stop(),this.runAnimation(this.options.from)}reverse(){const t=this.options.from;this.options.from=this.options.to,this.options.to=t,this.isAnimating&&(this.stop(),this.runAnimation(this.options.to))}stop(){this.controls&&(this.currentValue=this.controls.getPosition(),this.currentVelocity=this.controls.getVelocity(),this.controls.stop(),this.controls=null),this.isAnimating=!1}getVelocity(){var t;return((t=this.controls)==null?void 0:t.getVelocity())??this.currentVelocity}getCurrentValue(){var t;return((t=this.controls)==null?void 0:t.getPosition())??this.currentValue}getIsAnimating(){return this.isAnimating}getCurrentState(){return{type:"single",position:this.getCurrentValue(),velocity:this.getVelocity(),from:this.options.from,to:this.options.to}}setValue(t){this.currentValue=t}setVelocity(t){this.currentVelocity=t}updateOptions(t){this.options={...this.options,...t}}static fromState(t,i){const e=new b(i);return e.setValue(t.position),e.setVelocity(t.velocity),e}}class _{constructor(t){p(this,"config");p(this,"animators",new Map);p(this,"springOrder",[]);p(this,"completedCount",0);p(this,"completedAnimators",new Set);p(this,"direction","forward");p(this,"idCounter",0);p(this,"timeoutIds",[]);this.config=t,this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.springs.forEach(t=>{const i=this.generateId(),e=new b({from:t.from,to:t.to,spring:t.spring,tick:t.tick,onComplete:()=>this.onAnimatorComplete(i),onStart:t.onStart});this.animators.set(i,{id:i,item:t,animator:e,startTime:null}),this.springOrder.push(i)})}normalizeSchedule(t){const i=this.config.schedule??"overlap";return this.springOrder.map((e,o)=>{const r=this.animators.get(e);if(!r)throw new Error(`AnimationScheduler: animator with id "${e}" not found`);if(i==="overlap")return{type:"offset",id:e,delay:0};if(i==="wait")return t==="forward"&&o===0?{type:"offset",id:e,delay:0}:t==="backward"&&o===this.springOrder.length-1?{type:"offset",id:e,delay:0}:{type:"wait",id:e};const s=r.item.offset??0;if(t==="forward")return{type:"offset",id:e,delay:s};const c=Math.max(...Array.from(this.animators.values()).map(a=>a.item.offset??0));return{type:"offset",id:e,delay:c-s}})}onAnimatorComplete(t){var e,o,r,s,c,a;const i=this.animators.get(t);!i||this.completedAnimators.has(t)||(this.completedAnimators.add(t),this.completedCount++,(o=(e=i.item).onComplete)==null||o.call(e),(s=(r=this.config).onProgress)==null||s.call(r,this.completedCount,this.config.springs.length),this.handleWaitModeChaining(t),this.completedCount===this.config.springs.length&&((a=(c=this.config).onEnd)==null||a.call(c)))}handleWaitModeChaining(t){if(this.config.schedule!=="wait")return;const i=this.springOrder.indexOf(t);if(this.direction==="forward"){const e=this.springOrder[i+1];if(e){const o=this.animators.get(e);o&&o.startTime===null&&this.startAnimator(e)}}else{const e=this.springOrder[i-1];if(e){const o=this.animators.get(e);o&&o.startTime===null&&this.startBackwardAnimator(e)}}}startAnimator(t){const i=this.animators.get(t);!i||i.startTime!==null||(i.startTime=Date.now(),i.animator.forward())}startBackwardAnimator(t){const i=this.animators.get(t);!i||i.startTime!==null||(i.startTime=Date.now(),i.animator.backward())}forward(){var i,e;this.stop(),this.direction="forward",this.completedCount=0,this.completedAnimators.clear(),(e=(i=this.config).onStart)==null||e.call(i),this.normalizeSchedule("forward").forEach(o=>{if(o.type!=="wait")if(o.delay===0)this.startAnimator(o.id);else{const r=window.setTimeout(()=>this.startAnimator(o.id),o.delay);this.timeoutIds.push(r)}})}backward(){var i,e;this.stop(),this.direction="backward",this.completedCount=0,this.completedAnimators.clear(),(e=(i=this.config).onStart)==null||e.call(i),this.normalizeSchedule("backward").forEach(o=>{if(o.type!=="wait")if(o.delay===0)this.startBackwardAnimator(o.id);else{const r=window.setTimeout(()=>this.startBackwardAnimator(o.id),o.delay);this.timeoutIds.push(r)}})}stop(){this.timeoutIds.forEach(t=>clearTimeout(t)),this.timeoutIds=[],this.animators.forEach(t=>{t.animator.stop(),t.startTime=null})}reverse(){this.direction=this.direction==="forward"?"backward":"forward",this.animators.forEach(t=>{if(t.startTime===null)return;const i=t.animator.getCurrentState();if(i.type!=="single")return;if(i.position===i.to){const o=b.fromState({position:1,velocity:0},{from:t.item.to??1,to:t.item.from??0,spring:t.item.spring,tick:t.item.tick,onComplete:()=>this.onAnimatorComplete(t.id),onStart:t.item.onStart});o.forward(),t.animator=o}else t.animator.reverse()})}getCurrentState(){return{type:"multi",completed:this.completedCount,total:this.config.springs.length,direction:this.direction}}}const V=Symbol.for("TRANSITION_STRATEGY"),W=n=>({runIn:async t=>{const{currentAnimation:i}=n;if(i&&i.direction==="out"){const s=i.controller.getCurrentState();if(i.controller.stop(),s.type==="multi")return i.controller.reverse(),{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};if(t.out){const c=await t.out,{from:a=1,to:m=0}=c;return{config:c,state:{position:s.position,velocity:s.velocity},from:a,to:m,direction:"backward"}}}const e=await t.in;if(!e)return{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};if("springs"in e)return{config:e,state:{position:0,velocity:0},from:0,to:1,direction:"forward"};const{from:o=0,to:r=1}=e;return{config:e,state:{position:o,velocity:0},from:o,to:r,direction:"forward"}},runOut:async t=>{const{currentAnimation:i}=n;if(i&&i.direction==="in"){const s=i.controller.getCurrentState();if(i.controller.stop(),s.type==="multi")return i.controller.reverse(),{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};if(t.in){const c=await t.in,{from:a=0,to:m=1}=c;return{config:c,state:{position:s.position,velocity:s.velocity},from:a,to:m,direction:"backward"}}}const e=await t.out;if(!e)return{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};if("springs"in e)return{config:e,state:{position:1,velocity:0},from:1,to:0,direction:"forward"};const{from:o=1,to:r=0}=e;return{config:e,state:{position:o,velocity:0},from:o,to:r,direction:"forward"}}}),X=()=>({runIn:async n=>{const t=await n.in;if(!t)return{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};if("springs"in t)return{config:t,state:{position:0,velocity:0},from:0,to:1,direction:"forward"};const{from:i=0,to:e=1}=t;return{config:t,state:{position:i,velocity:0},from:i,to:e,direction:"forward"}},runOut:async n=>{const t=await n.out;if(!t)return{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};if("springs"in t)return{config:t,state:{position:1,velocity:0},from:1,to:0,direction:"forward"};const{from:i=1,to:e=0}=t;return{config:t,state:{position:i,velocity:0},from:i,to:e,direction:"forward"}}});function ot(n,t){var h;let i=null,e=null,o=null,r=null;const s={get currentAnimation(){return i}},c=((h=t==null?void 0:t.strategy)==null?void 0:h.call(t,s))||W(s),a=async u=>{var S,T,A;e&&(e.remove(),e=null);const g=n(),l=g.in&&await g.in(u),w=!(t!=null&&t.strategy)&&g.out?g.out(u):void 0;if(!l)return;if(k.isMultiSpring(l)){const v={in:Promise.resolve(l),out:w&&Promise.resolve(w)};if(!(await c.runIn(v)).config){i&&(i.direction="in");return}(S=l.prepare)==null||S.call(l,u),l.wait&&await l.wait();const C=new _({...l,onEnd:()=>{var P;i=null,(P=l.onEnd)==null||P.call(l)}});i={controller:C,direction:"in"},C.forward();return}const d={in:Promise.resolve(l),out:w&&Promise.resolve(w)},f=await c.runIn(d);if(!f.config||"springs"in f.config)return;(A=(T=f.config).prepare)==null||A.call(T,u),f.config.wait&&await f.config.wait();const y=b.fromState(f.state,{from:f.from,to:f.to,spring:f.config.spring,tick:f.config.tick,css:f.config.css?{element:u,style:f.config.css}:void 0,onStart:f.config.onStart,onComplete:()=>{var v,E;i=null,(E=(v=f.config)==null?void 0:v.onEnd)==null||E.call(v)}});i={controller:y,direction:"in"},f.direction==="forward"?y.forward():y.backward()},m=async u=>{var S,T,A;e=u;const g=n(),l=g.out&&await g.out(u);if(!l)return;if(k.isMultiSpring(l)){const v={in:void 0,out:Promise.resolve(l)};if(!(await c.runOut(v)).config){i&&(i.direction="out"),e&&(e.remove(),e=null);return}(S=l.prepare)==null||S.call(l,u),y(),l.wait&&await l.wait();const C=new _({...l,onEnd:()=>{var P,D;(P=l.onEnd)==null||P.call(l),e&&(e.remove(),e=null),i=null,(D=t==null?void 0:t.onCleanupEnd)==null||D.call(t)}});i={controller:C,direction:"out"},C.forward();return}const w={in:void 0,out:Promise.resolve(l)},d=await c.runOut(w);if(!d.config||"springs"in d.config)return;(A=(T=d.config).prepare)==null||A.call(T,u),y(),d.config.wait&&await d.config.wait();const f=b.fromState(d.state,{from:d.from,to:d.to,spring:d.config.spring,tick:d.config.tick,css:d.config.css?{element:u,style:d.config.css}:void 0,onStart:d.config.onStart,onComplete:()=>{var v,E,C;(E=(v=d.config)==null?void 0:v.onEnd)==null||E.call(v),e&&(e.remove(),e=null),i=null,(C=t==null?void 0:t.onCleanupEnd)==null||C.call(t)}});i={controller:f,direction:"out"},d.direction==="forward"?f.forward():f.backward();function y(){!o||!e||(r&&o.contains(r)?o.insertBefore(e,r):o.appendChild(e))}};return u=>{if(u)return o=u.parentElement,r=u.nextElementSibling,a(u),()=>{if(u.isConnected){const g=u.cloneNode(!0);m(g)}else m(u)}}}const rt=3,st=n=>{if(!n)return null;const t=n.split(`
2
+ `).map(i=>i.trim());for(let i=rt;i<Math.min(t.length,6);i++){const e=t[i],o=e==null?void 0:e.match(/\(?([^):]+):(\d+):(\d+)\)?$/);if(!o)continue;const r=o[1]??"",s=o[2]??"0",c=o[3]??"0";return{file:r.split(/[\\/]/).pop()||r,line:s,column:c}}return null},M=new Map,O=new Map;function at(n,t,i){M.set(n,t);let e=O.get(n);return e||(e=ot(()=>{const o=M.get(n);return o||(console.warn(`Transition "${String(n)}" not found`),{})},{strategy:i,onCleanupEnd:()=>$(n)}),O.set(n,e),e)}function $(n){M.delete(n),O.delete(n)}function q(){const n=st(new Error().stack);return n?`auto_${n.file}_${n.line}_${n.column}`:Symbol(`ssgoi_auto_${Date.now()}`)}const F=globalThis.FinalizationRegistry,z=F?new F(n=>{try{$(n)}catch{}}):void 0;function ct(n){const t=n.key??q();if(n.ref&&z)try{z.register(n.ref,t)}catch{}return at(t,{in:n.in,out:n.out},n[V])}function lt(n){const t=n.filter(i=>i.symmetric).map(i=>({from:i.to,to:i.from,transition:i.transition}));return[...n,...t]}function ut(n){let t=!1,i=0,e=0,o=!1;const r=50,s=w=>{if(!n)return;const d=w.touches[0];d&&(o=d.clientX<r,o&&(i=d.clientX,e=d.clientY))},c=w=>{if(!n||!o)return;const d=w.touches[0];if(!d)return;const f=d.clientX-i,y=d.clientY-e;f>window.outerWidth/2-5&&Math.abs(f)>Math.abs(y)?t=!0:t=!1},a=()=>{n&&(o=!1,i=0,e=0)},m=()=>t,h=()=>{typeof window>"u"||n&&(window.addEventListener("touchstart",s,{passive:!0}),window.addEventListener("touchmove",c,{passive:!0}),window.addEventListener("touchend",a,{passive:!0}))},u=()=>{typeof window>"u"||(window.removeEventListener("touchstart",s),window.removeEventListener("touchmove",c),window.removeEventListener("touchend",a))};let g=0;return{initialize:h,cleanup:u,isSwipePending:m,resetSwipeDetection:()=>{g++,g>1&&(g=0,t=!1)}}}const ft=n=>{let t=n.parentElement;for(;t&&t!==document.body;){const i=window.getComputedStyle(t),e=i.overflow+i.overflowY+i.overflowX;if(e.includes("auto")||e.includes("scroll")||t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.parentElement}return document.documentElement},mt=n=>{let t=n.parentElement;for(;t&&t!==document.body;){const i=window.getComputedStyle(t).position;if(i==="relative"||i==="absolute"||i==="fixed"||i==="sticky")return t;t=t.parentElement}return document.body};function dt(){let n=null,t=null;const i=new Map;let e=null;const o=()=>{n&&e&&i.set(e,{x:n.scrollLeft,y:n.scrollTop})};return{initializeContext:(h,u)=>{t=h,n||(n=ft(h),(n===document.documentElement?window:n).addEventListener("scroll",o,{passive:!0})),e=u},calculateScrollOffset:(h,u)=>{const g=h&&i.has(h)?i.get(h):{x:0,y:0},l=u&&i.has(u)?i.get(u):{x:0,y:0};return{x:-l.x+g.x,y:-l.y+g.y}},getScrollContainer:()=>n,getPositionedParentElement:()=>t?mt(t):document.body,getScrollPosition:h=>h&&i.has(h)?i.get(h):{x:0,y:0}}}function R(n,t){if(t==="*")return!0;if(t.endsWith("/*")){const i=t.slice(0,-2);return n===i||n.startsWith(i+"/")}return n===t}function ht(n,t,i){for(const e of i)if(R(n,e.from)&&R(t,e.to))return e.transition;for(const e of i)if((e.from==="*"||R(n,e.from))&&(e.to==="*"||R(t,e.to)))return e.transition;return null}function gt(n){const{transitions:t=[],defaultTransition:i,middleware:e=(f,y)=>({from:f,to:y}),skipOnIosSwipe:o=!0}=n;let r=null;const s=lt(t),{initializeContext:c,calculateScrollOffset:a,getScrollContainer:m,getPositionedParentElement:h,getScrollPosition:u}=dt(),g=ut(o);g.initialize();function l(){if(r!=null&&r.from&&(r!=null&&r.to)){const{from:f,to:y}=e(r.from,r.to),T=ht(f,y,s)||i,A=a(r.from,r.to),v={scrollOffset:A,scroll:u(r.from),get scrollingElement(){return m()||document.documentElement},get positionedParent(){return h()}},E={scrollOffset:A,get scroll(){return r?u(r.to):{x:0,y:0}},get scrollingElement(){return m()||document.documentElement},get positionedParent(){return h()}};T&&(T.out&&r.outResolve&&r.outResolve(C=>T.out(C,v)),T.in&&r.inResolve&&r.inResolve(C=>T.in(C,E))),r=null}}const w=async(f,y)=>g.isSwipePending()?(g.resetSwipeDetection(),()=>({})):y==="in"&&(!r||!r.from)?()=>({}):(r||(r={}),y==="out"?(r.from=f,new Promise(S=>{r.outResolve=S,l()})):(r.to=f,new Promise(S=>{r.inResolve=S,l()})));return f=>({key:f,in:async y=>(c(y,f),(await w(f,"in"))(y)),out:async y=>(await w(f,"out"))(y),[V]:X})}exports.isCssAnimation=k.isCssAnimation;exports.isMultiSpring=k.isMultiSpring;exports.isSingleSpring=k.isSingleSpring;exports.isTickAnimation=k.isTickAnimation;exports.validateAnimationMode=k.validateAnimationMode;exports.jaeminInternal=U.jaeminInternal;exports.TRANSITION_STRATEGY=V;exports.createDefaultStrategy=W;exports.createPageTransitionStrategy=X;exports.createSggoiTransitionContext=gt;exports.generateAutoKey=q;exports.transition=ct;