@ssgoi/core 2.4.0 → 2.5.1

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 (42) hide show
  1. package/dist/animate.d.ts +35 -0
  2. package/dist/animate.d.ts.map +1 -0
  3. package/dist/animation-scheduler.d.ts +47 -0
  4. package/dist/animation-scheduler.d.ts.map +1 -0
  5. package/dist/animator.d.ts +3 -8
  6. package/dist/animator.d.ts.map +1 -1
  7. package/dist/create-ssgoi-transition-context.d.ts.map +1 -1
  8. package/dist/create-transition-callback.d.ts.map +1 -1
  9. package/dist/index.cjs +2 -2
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +787 -306
  13. package/dist/jaemin-BAi8PTrj.js +130 -0
  14. package/dist/jaemin-DL1-g_B5.cjs +1 -0
  15. package/dist/test-utils.d.ts +46 -0
  16. package/dist/test-utils.d.ts.map +1 -0
  17. package/dist/ticker.d.ts +37 -0
  18. package/dist/ticker.d.ts.map +1 -0
  19. package/dist/transition-strategy.d.ts +2 -3
  20. package/dist/transition-strategy.d.ts.map +1 -1
  21. package/dist/types.cjs +1 -1
  22. package/dist/types.d.ts +164 -4
  23. package/dist/types.d.ts.map +1 -1
  24. package/dist/types.js +10 -1
  25. package/dist/view-transitions/blind.d.ts.map +1 -1
  26. package/dist/view-transitions/curtain-reveal.d.ts +19 -0
  27. package/dist/view-transitions/curtain-reveal.d.ts.map +1 -0
  28. package/dist/view-transitions/fade.d.ts.map +1 -1
  29. package/dist/view-transitions/film.d.ts.map +1 -1
  30. package/dist/view-transitions/hero.d.ts +1 -0
  31. package/dist/view-transitions/hero.d.ts.map +1 -1
  32. package/dist/view-transitions/index.cjs +19 -19
  33. package/dist/view-transitions/index.d.ts +3 -1
  34. package/dist/view-transitions/index.d.ts.map +1 -1
  35. package/dist/view-transitions/index.js +620 -547
  36. package/dist/view-transitions/jaemin.d.ts +4 -0
  37. package/dist/view-transitions/jaemin.d.ts.map +1 -1
  38. package/dist/view-transitions/strip.d.ts +3 -0
  39. package/dist/view-transitions/strip.d.ts.map +1 -0
  40. package/package.json +16 -13
  41. package/dist/view-transitions/hero-rotate.d.ts +0 -28
  42. package/dist/view-transitions/hero-rotate.d.ts.map +0 -1
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Custom spring animation implementation (replacing popmotion)
3
+ * Interface-compatible with popmotion's animate function
4
+ * Uses optimized semi-implicit Euler method (Allen Chou's approach)
5
+ */
6
+ export interface AnimateOptions {
7
+ from: number;
8
+ to: number;
9
+ stiffness: number;
10
+ damping: number;
11
+ mass: number;
12
+ velocity?: number;
13
+ onUpdate: (value: number) => void;
14
+ onComplete: () => void;
15
+ }
16
+ export interface AnimationControls {
17
+ stop: () => void;
18
+ }
19
+ /**
20
+ * Spring-based animation using optimized semi-implicit Euler
21
+ * Based on Allen Chou's implementation for stability and performance
22
+ *
23
+ * Instead of computing F = -k(x-xt) - d*v, then a = F/m,
24
+ * we use angular frequency (omega) and damping ratio (zeta):
25
+ * - omega = sqrt(k/m) - angular frequency
26
+ * - zeta = d/(2*sqrt(k*m)) - damping ratio
27
+ *
28
+ * Semi-implicit Euler update:
29
+ * v += -2*h*zeta*omega*v + h*omega^2*(xt - x)
30
+ * x += h*v
31
+ *
32
+ * This formulation is more stable and efficient than the naive approach.
33
+ */
34
+ export declare function animate(options: AnimateOptions): AnimationControls;
35
+ //# sourceMappingURL=animate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animate.d.ts","sourceRoot":"","sources":["../src/lib/animate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,iBAAiB,CAgFlE"}
@@ -0,0 +1,47 @@
1
+ import { MultiSpringConfig, AnimationController, AnimationState } from './types';
2
+ /**
3
+ * AnimationScheduler - Coordinates multiple spring animations
4
+ *
5
+ * Manages the lifecycle and timing of multiple spring animations.
6
+ * Supports three scheduling strategies:
7
+ * - overlap: All springs start immediately (parallel)
8
+ * - wait: Each spring waits for previous to complete (sequential)
9
+ * - chain: Springs start with offset delays
10
+ *
11
+ * Note: getCurrentState() always returns MultiAnimationState (number-based progress)
12
+ */
13
+ export declare class AnimationScheduler<TAnimationValue = number> implements AnimationController<number> {
14
+ private config;
15
+ private animators;
16
+ private springOrder;
17
+ private completedCount;
18
+ private completedAnimators;
19
+ private direction;
20
+ private idCounter;
21
+ private timeoutIds;
22
+ constructor(config: MultiSpringConfig<TAnimationValue>);
23
+ private generateId;
24
+ 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
+ private normalizeSchedule;
32
+ private onAnimatorComplete;
33
+ /**
34
+ * Handle wait mode chaining: start next/previous spring after completion
35
+ */
36
+ private handleWaitModeChaining;
37
+ private startAnimator;
38
+ private startBackwardAnimator;
39
+ forward(): void;
40
+ backward(): void;
41
+ stop(): void;
42
+ reverse(options?: {
43
+ offsetMode?: "immediate" | "mirror" | "reverse";
44
+ }): void;
45
+ getCurrentState(): AnimationState<number>;
46
+ }
47
+ //# sourceMappingURL=animation-scheduler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animation-scheduler.d.ts","sourceRoot":"","sources":["../src/lib/animation-scheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EAGjB,mBAAmB,EACnB,cAAc,EACf,MAAM,SAAS,CAAC;AAYjB;;;;;;;;;;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,4 +1,4 @@
1
- import { SpringConfig } from './types';
1
+ import { SpringConfig, AnimationController, AnimationState } from './types';
2
2
  export interface AnimationOptions<TAnimationValue = number> {
3
3
  from: TAnimationValue;
4
4
  to: TAnimationValue;
@@ -14,7 +14,7 @@ export interface AnimationOptions<TAnimationValue = number> {
14
14
  *
15
15
  * @template TAnimationValue - The type of value being animated (number | object)
16
16
  */
17
- export declare class Animator<TAnimationValue = number> {
17
+ export declare class Animator<TAnimationValue = number> implements AnimationController<TAnimationValue> {
18
18
  private options;
19
19
  private currentValue;
20
20
  private velocity;
@@ -35,12 +35,7 @@ export declare class Animator<TAnimationValue = number> {
35
35
  getVelocity(): TAnimationValue extends number ? number : Record<string, number>;
36
36
  getCurrentValue(): TAnimationValue;
37
37
  getIsAnimating(): boolean;
38
- getCurrentState(): {
39
- position: TAnimationValue;
40
- velocity: TAnimationValue extends number ? number : Record<string, number>;
41
- from: TAnimationValue;
42
- to: TAnimationValue;
43
- };
38
+ getCurrentState(): AnimationState<TAnimationValue>;
44
39
  setVelocity(velocity: TAnimationValue extends number ? number : Record<string, number>): void;
45
40
  setValue(value: TAnimationValue): void;
46
41
  updateOptions(newOptions: Partial<AnimationOptions<TAnimationValue>>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"animator.d.ts","sourceRoot":"","sources":["../src/lib/animator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,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;IAC5C,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;QACjB,QAAQ,EAAE,eAAe,CAAC;QAC1B,QAAQ,EAAE,eAAe,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3E,IAAI,EAAE,eAAe,CAAC;QACtB,EAAE,EAAE,eAAe,CAAC;KACrB;IAUD,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":"animator.d.ts","sourceRoot":"","sources":["../src/lib/animator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACf,MAAM,SAAS,CAAC;AAEjB,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 +1 @@
1
- {"version":3,"file":"create-ssgoi-transition-context.d.ts","sourceRoot":"","sources":["../src/lib/create-ssgoi-transition-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EAGb,MAAM,SAAS,CAAC;AAyJjB;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,WAAW,GACnB,YAAY,CAwId"}
1
+ {"version":3,"file":"create-ssgoi-transition-context.d.ts","sourceRoot":"","sources":["../src/lib/create-ssgoi-transition-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EAGb,MAAM,SAAS,CAAC;AAmNjB;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,WAAW,GACnB,YAAY,CAkJd"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-transition-callback.d.ts","sourceRoot":"","sources":["../src/lib/create-transition-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE9D,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,wBAAwB,CAAC,eAAe,GAAG,MAAM,EAC/D,aAAa,EAAE,MAAM,UAAU,CAAC,SAAS,EAAE,eAAe,CAAC,EAC3D,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CACT,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,KACtC,kBAAkB,CAAC,eAAe,CAAC,CAAC;CAC1C,GACA,kBAAkB,CA0IpB"}
1
+ {"version":3,"file":"create-transition-callback.d.ts","sourceRoot":"","sources":["../src/lib/create-transition-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AAIjB,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,wBAAwB,CAAC,eAAe,GAAG,MAAM,EAC/D,aAAa,EAAE,MAAM,UAAU,CAAC,SAAS,EAAE,eAAe,CAAC,EAC3D,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CACT,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,KACtC,kBAAkB,CAAC,eAAe,CAAC,CAAC;CAC1C,GACA,kBAAkB,CAsRpB"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var I=Object.defineProperty;var N=(o,t,n)=>t in o?I(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n;var g=(o,t,n)=>N(o,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("popmotion");class E{constructor(t){g(this,"options");g(this,"currentValue");g(this,"velocity");g(this,"isAnimating",!1);g(this,"controls",null);g(this,"animationMap",null);g(this,"activeAnimations",new Set);g(this,"completedAnimations",new Set);g(this,"updatedProperties",new Set);g(this,"animate",(t=!1)=>{!this.isAnimating&&this.options.onStart&&this.options.onStart(),this.isAnimating=!0;const n=t?this.options.from:this.options.to;if(typeof this.currentValue=="object"&&this.currentValue!==null){this.animateObject(n);return}let e=this.currentValue,i=performance.now();const f={from:this.currentValue,to:n,stiffness:this.options.spring.stiffness,damping:this.options.spring.damping,mass:1};typeof this.velocity=="number"&&(f.velocity=this.velocity*1e3),this.controls=R.animate({...f,onUpdate:l=>{const h=performance.now(),a=(h-i)/1e3;if(a>0){if(typeof l=="number"&&typeof e=="number"){const p=(l-e)/a;this.velocity=p/1e3}else if(typeof l=="object"&&l!==null){const p={};Object.keys(l).forEach(c=>{const s=l[c],u=e[c];if(typeof s=="number"&&typeof u=="number"){const d=(s-u)/a;p[c]=d/1e3}}),this.velocity=p}e=l,i=h}this.currentValue=l,this.options.onUpdate(l)},onComplete:()=>{this.currentValue=n,this.isAnimating=!1,this.controls=null,typeof this.velocity=="object"&&this.velocity!==null?Object.keys(this.velocity).forEach(l=>{this.velocity[l]=0}):this.velocity=0,this.options.onComplete()}})});g(this,"animateObject",t=>{const n=this.currentValue,e=Object.keys(n);this.animationMap=new Map,this.activeAnimations.clear(),this.completedAnimations.clear(),this.updatedProperties.clear();const i={...n},f={};let l=!1;const h=()=>{const a=e.filter(c=>!this.completedAnimations.has(c));if(a.every(c=>this.updatedProperties.has(c))&&a.length>0){if(typeof this.velocity=="object"&&this.velocity){const c=performance.now();Object.keys(i).forEach(s=>{if(f[s]){const u=(c-f[s])/1e3,d=this.currentValue[s],r=i[s];typeof d=="number"&&typeof r=="number"&&u>0&&(this.velocity[s]=(r-d)/u/1e3)}f[s]=c})}this.currentValue={...i},this.options.onUpdate(this.currentValue),this.updatedProperties.clear(),!l&&this.options.onStart&&(l=!0,this.options.onStart())}};e.forEach(a=>{this.activeAnimations.add(a);const p={from:n[a],to:t[a],stiffness:this.options.spring.stiffness,damping:this.options.spring.damping,mass:1};typeof this.velocity=="object"&&this.velocity&&a in this.velocity&&(p.velocity=this.velocity[a]*1e3);const c=R.animate({...p,onUpdate:s=>{i[a]=s,this.updatedProperties.add(a),h()},onComplete:()=>{this.completedAnimations.add(a),this.updatedProperties.delete(a),this.completedAnimations.size===e.length&&(this.currentValue=t,this.isAnimating=!1,this.animationMap=null,typeof this.velocity=="object"&&this.velocity&&Object.keys(this.velocity).forEach(s=>{this.velocity[s]=0}),this.options.onComplete())}});this.animationMap.set(a,c)})});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 n={};Object.keys(this.options.from).forEach(e=>{n[e]=0}),this.velocity=n}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 n=this.shouldReverse();this.stop(),this.animate(!n)}}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{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 n=this.shouldReverse();this.stop(),this.animate(!n)}}static fromState(t,n){const e=new E(n);return e.setValue(t.position),e.setVelocity(t.velocity),e}}const V=Symbol.for("TRANSITION_STRATEGY"),j=o=>({runIn:async t=>{const{currentAnimation:n}=o;if(n&&n.direction==="out"){const l=n.animator.getCurrentState();if(n.animator.stop(),t.out){const h=await t.out,{from:a=1,to:p=0}=h;return{config:h,state:l,from:a,to:p,direction:"backward"}}}const e=await t.in;if(!e)return{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};const{from:i=0,to:f=1}=e;return{config:e,state:{position:i,velocity:0},from:i,to:f,direction:"forward"}},runOut:async t=>{const{currentAnimation:n}=o;if(n&&n.direction==="in"){const l=n.animator.getCurrentState();if(n.animator.stop(),t.in){const h=await t.in,{from:a=0,to:p=1}=h;return{config:h,state:{position:l.position,velocity:l.velocity},from:a,to:p,direction:"backward"}}}const e=await t.out;if(!e)return{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};const{from:i=1,to:f=0}=e;return{config:e,state:{position:i,velocity:0},from:i,to:f,direction:"forward"}}}),M=()=>({runIn:async o=>{const t=await o.in;if(!t)return{state:{position:0,velocity:0},from:0,to:1,direction:"forward"};const{from:n=0,to:e=1}=t;return{config:t,state:{position:n,velocity:0},from:n,to:e,direction:"forward"}},runOut:async o=>{const t=await o.out;if(!t)return{state:{position:1,velocity:0},from:1,to:0,direction:"forward"};const{from:n=1,to:e=0}=t;return{config:t,state:{position:n,velocity:0},from:n,to:e,direction:"forward"}}});function D(o,t){var c;let n=null,e=null,i=null,f=null;const l={get currentAnimation(){return n}},h=((c=t==null?void 0:t.strategy)==null?void 0:c.call(t,l))||j(l),a=async s=>{var y,v;e&&(e.remove(),e=null);const u=o(),d={in:u.in&&Promise.resolve(u.in(s)),out:u.out&&Promise.resolve(u.out(s))},r=await h.runIn(d);if(!r.config)return;(v=(y=r.config).prepare)==null||v.call(y,s),r.config.wait&&await r.config.wait();const m=E.fromState(r.state,{from:r.from,to:r.to,spring:r.config.spring,onStart:r.config.onStart,onUpdate:r.config.tick,onComplete:()=>{var w,S;n=null,(S=(w=r.config)==null?void 0:w.onEnd)==null||S.call(w)}});n={animator:m,direction:"in"},r.direction==="forward"?m.forward():m.backward()},p=async s=>{var v,w;e=s;const u=o(),d={in:u.in&&Promise.resolve(u.in(s)),out:u.out&&Promise.resolve(u.out(s))},r=await h.runOut(d);if(!r.config)return;(w=(v=r.config).prepare)==null||w.call(v,s),y(),r.config.wait&&await r.config.wait();const m=E.fromState(r.state,{from:r.from,to:r.to,spring:r.config.spring,onStart:r.config.onStart,onUpdate:r.config.tick,onComplete:()=>{var S,C,b;(C=(S=r.config)==null?void 0:S.onEnd)==null||C.call(S),e&&(e.remove(),e=null),n=null,(b=t==null?void 0:t.onCleanupEnd)==null||b.call(t)}});n={animator:m,direction:"out"},r.direction==="forward"?m.forward():m.backward();function y(){!i||!e||(f&&i.contains(f)?i.insertBefore(e,f):i.appendChild(e))}};return s=>{if(s)return i=s.parentElement,f=s.nextElementSibling,a(s),()=>{const u=s.cloneNode(!0);p(u)}}}const z=3,K=o=>{if(!o)return null;const t=o.split(`
2
- `).map(n=>n.trim());for(let n=z;n<Math.min(t.length,6);n++){const e=t[n],i=e==null?void 0:e.match(/\(?([^):]+):(\d+):(\d+)\)?$/);if(!i)continue;const f=i[1]??"",l=i[2]??"0",h=i[3]??"0";return{file:f.split(/[\\/]/).pop()||f,line:l,column:h}}return null},T=new Map,P=new Map;function $(o,t,n){T.set(o,t);let e=P.get(o);return e||(e=D(()=>{const i=T.get(o);return i||(console.warn(`Transition "${String(o)}" not found`),{})},{strategy:n,onCleanupEnd:()=>U(o)}),P.set(o,e),e)}function U(o){T.delete(o),P.delete(o)}function _(){const o=K(new Error().stack);return o?`auto_${o.file}_${o.line}_${o.column}`:Symbol(`ssgoi_auto_${Date.now()}`)}const O=globalThis.FinalizationRegistry,x=O?new O(o=>{try{U(o)}catch{}}):void 0;function F(o){const t=o.key??_();if(o.ref&&x)try{x.register(o.ref,t)}catch{}return $(t,{in:o.in,out:o.out},o[V])}const W=o=>{let t=o.parentElement;for(;t&&t!==document.body;){const n=window.getComputedStyle(t),e=n.overflow+n.overflowY+n.overflowX;if(e.includes("auto")||e.includes("scroll")||t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.parentElement}return document.documentElement},k=o=>{let t=o.parentElement;for(;t&&t!==document.body;){const n=window.getComputedStyle(t).position;if(n==="relative"||n==="absolute"||n==="fixed"||n==="sticky")return t;t=t.parentElement}return document.body};function L(o){const t=o.filter(n=>n.symmetric).map(n=>({from:n.to,to:n.from,transition:n.transition}));return[...o,...t]}function Y(){let o=null,t=null;const n=new Map;let e=null;const i=()=>{o&&e&&n.set(e,{x:o.scrollLeft,y:o.scrollTop})};return{initializeContext:(c,s)=>{t=c,o||(o=W(c),(o===document.documentElement?window:o).addEventListener("scroll",i,{passive:!0})),e=s},calculateScrollOffset:(c,s)=>{const u=c&&n.has(c)?n.get(c):{x:0,y:0},d=s&&n.has(s)?n.get(s):{x:0,y:0};return{x:-d.x+u.x,y:-d.y+u.y}},getScrollContainer:()=>o,getPositionedParentElement:()=>t?k(t):document.body,getScrollPosition:c=>c&&n.has(c)?n.get(c):{x:0,y:0}}}function G(o){const{transitions:t=[],defaultTransition:n,middleware:e=(r,m)=>({from:r,to:m})}=o;let i=null;const f=L(t),{initializeContext:l,calculateScrollOffset:h,getScrollContainer:a,getPositionedParentElement:p,getScrollPosition:c}=Y();function s(){if(i!=null&&i.from&&(i!=null&&i.to)){const{from:r,to:m}=e(i.from,i.to),v=H(r,m,f)||n,w=h(i.from,i.to),S={scrollOffset:w,scroll:c(i.from),get scrollingElement(){return a()||document.documentElement},get positionedParent(){return p()}},C={scrollOffset:w,get scroll(){return i?c(i.to):{x:0,y:0}},get scrollingElement(){return a()||document.documentElement},get positionedParent(){return p()}};v&&(v.out&&i.outResolve&&i.outResolve(b=>v.out(b,S)),v.in&&i.inResolve&&i.inResolve(b=>v.in(b,C))),i=null}}const u=async(r,m)=>m==="in"&&(!i||!i.from)?()=>({}):(i||(i={}),m==="out"?(i.from=r,new Promise(y=>{i.outResolve=y,s()})):(i.to=r,new Promise(y=>{i.inResolve=y,s()})));return r=>({key:r,in:async m=>(l(m,r),(await u(r,"in"))(m)),out:async m=>(await u(r,"out"))(m),[V]:M})}function H(o,t,n){for(const e of n)if(A(o,e.from)&&A(t,e.to))return e.transition;for(const e of n)if((e.from==="*"||A(o,e.from))&&(e.to==="*"||A(t,e.to)))return e.transition;return null}function A(o,t){if(t==="*")return!0;if(t.endsWith("/*")){const n=t.slice(0,-2);return o===n||o.startsWith(n+"/")}return o===t}exports.TRANSITION_STRATEGY=V;exports.createDefaultStrategy=j;exports.createPageTransitionStrategy=M;exports.createSggoiTransitionContext=G;exports.generateAutoKey=_;exports.transition=F;
1
+ "use strict";var F=Object.defineProperty;var H=(n,t,e)=>t in n?F(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var d=(n,t,e)=>H(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("./types.cjs"),W=require("./jaemin-DL1-g_B5.cjs");class q{constructor(){d(this,"listeners",new Set);d(this,"rafId",null);d(this,"isRunning",!1);d(this,"startTime",Date.now());d(this,"lastUpdate",this.startTime);d(this,"elapsed",0);d(this,"lagThreshold",500);d(this,"adjustedLag",33);d(this,"gap",1e3/240);d(this,"nextTime",this.gap);d(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,r=i-this.nextTime;if(r>0){const o=e/1e3;this.elapsed=i/1e3,this.nextTime+=r+(r>=this.gap?4:this.gap-r),this.listeners.forEach(s=>{s(o,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 x=new q;function k(n){const{from:t,to:e,stiffness:i,damping:r,mass:o,velocity:s=0,onUpdate:m,onComplete:l}=n;let h=t,u=s,a=!0;const p=Math.sqrt(i/o),c=r/(2*Math.sqrt(i*o)),S=.01,w=.01;let f=0;const g=.05,v=A=>{if(!a)return;const E=Math.min(A,.033),y=-2*E*c*p*u,b=E*p*p*(e-h);u+=y+b,h+=E*u;const T=Math.abs(e-h),C=Math.abs(u);if(T<S&&C<w){if(f+=E,f>=g){h=e,u=0,a=!1,m(h),x.unsubscribe(v),l();return}}else f=0;m(h)};return x.subscribe(v),{stop:()=>{a&&(a=!1,x.unsubscribe(v))}}}class O{constructor(t){d(this,"options");d(this,"currentValue");d(this,"velocity");d(this,"isAnimating",!1);d(this,"controls",null);d(this,"animationMap",null);d(this,"activeAnimations",new Set);d(this,"completedAnimations",new Set);d(this,"updatedProperties",new Set);d(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,r=performance.now();const o={from:this.currentValue,to:e,stiffness:this.options.spring.stiffness,damping:this.options.spring.damping,mass:1};typeof this.velocity=="number"&&(o.velocity=this.velocity*1e3),this.controls=k({...o,onUpdate:s=>{const m=performance.now(),l=(m-r)/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,r=m}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()}})});d(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 r={...e},o={};let s=!1;const m=()=>{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(r).forEach(a=>{if(o[a]){const p=(u-o[a])/1e3,c=this.currentValue[a],S=r[a];typeof c=="number"&&typeof S=="number"&&p>0&&(this.velocity[a]=(S-c)/p/1e3)}o[a]=u})}this.currentValue={...r},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=>{r[l]=a,this.updatedProperties.add(l),m()},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 U{constructor(t){d(this,"config");d(this,"animators",new Map);d(this,"springOrder",[]);d(this,"completedCount",0);d(this,"completedAnimators",new Set);d(this,"direction","forward");d(this,"idCounter",0);d(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,r)=>{const o=this.animators.get(i);if(!o)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"&&r===0?{type:"offset",id:i,delay:0}:t==="backward"&&r===this.springOrder.length-1?{type:"offset",id:i,delay:0}:{type:"wait",id:i};const s=o.item.offset??0;if(t==="forward")return{type:"offset",id:i,delay:s};const m=this.animators.size===0?0:Math.max(...Array.from(this.animators.values()).map(l=>l.item.offset??0));return{type:"offset",id:i,delay:m-s}})}onAnimatorComplete(t){var i,r,o,s,m,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++,(r=(i=e.item).onComplete)==null||r.call(i),(s=(o=this.config).onProgress)==null||s.call(o,this.completedCount,this.config.springs.length),this.handleWaitModeChaining(t),this.completedCount===this.config.springs.length&&((l=(m=this.config).onEnd)==null||l.call(m)))}handleWaitModeChaining(t){if(this.config.schedule!=="wait")return;const e=this.springOrder.indexOf(t);if(this.direction==="forward"){const o=this.springOrder[e+1];if(!o)return;const s=this.animators.get(o);s&&s.startTime===null&&this.startAnimator(o);return}const i=this.springOrder[e-1];if(!i)return;const r=this.animators.get(i);r&&r.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(r=>{if(r.type==="wait")return;if(r.delay===0){this.startAnimator(r.id);return}const o=window.setTimeout(()=>this.startAnimator(r.id),r.delay);this.timeoutIds.push(o)})}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(r=>{if(r.type==="wait")return;if(r.delay===0){this.startBackwardAnimator(r.id);return}const o=window.setTimeout(()=>this.startBackwardAnimator(r.id),r.delay);this.timeoutIds.push(o)})}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 r=i.animator.getCurrentState();if(r.type!=="single")return;if(r.position===r.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"),L=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 m=await t.out,{from:l=1,to:h=0}=m;return{config:m,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:r=0,to:o=1}=i;return{config:i,state:{position:r,velocity:0},from:r,to:o,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 m=await t.in,{from:l=0,to:h=1}=m;return{config:m,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:r=1,to:o=0}=i;return{config:i,state:{position:r,velocity:0},from:r,to:o,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 K(n,t){var u;let e=null,i=null,r=null,o=null;const s={get currentAnimation(){return e}},m=((u=t==null?void 0:t.strategy)==null?void 0:u.call(t,s))||L(s),l=async a=>{var v,A,E;i&&(i.remove(),i=null);const p=n(),c=p.in&&await p.in(a),S=!(t!=null&&t.strategy)&&p.out?await p.out(a):void 0;if(!c)return;if(I.isMultiSpring(c)){const y={in:Promise.resolve(c),out:S&&Promise.resolve(S)};if(!(await m.runIn(y)).config){e&&(e.direction="in");return}(v=c.prepare)==null||v.call(c,a),c.wait&&await c.wait();const T=new U({...c,onEnd:()=>{var C;e=null,(C=c.onEnd)==null||C.call(c)}});e={controller:T,direction:"in"},T.forward();return}const w={in:Promise.resolve(c),out:S&&Promise.resolve(S)},f=await m.runIn(w);if(!f.config)return;if("springs"in f.config){console.error("Unexpected MultiSpringConfig in single-spring path");return}(E=(A=f.config).prepare)==null||E.call(A,a),f.config.wait&&await f.config.wait();const g=O.fromState(f.state,{from:f.from,to:f.to,spring:f.config.spring,onStart:f.config.onStart,onUpdate:f.config.tick,onComplete:()=>{var y,b;e=null,(b=(y=f.config)==null?void 0:y.onEnd)==null||b.call(y)}});e={controller:g,direction:"in"},f.direction==="forward"?g.forward():g.backward()},h=async a=>{var v,A,E;i=a;const p=n(),c=p.out&&await p.out(a);if(!c)return;if(I.isMultiSpring(c)){const y={in:void 0,out:Promise.resolve(c)};if(!(await m.runOut(y)).config){e&&(e.direction="out"),i&&(i.remove(),i=null);return}(v=c.prepare)==null||v.call(c,a),g(),c.wait&&await c.wait();const T=new U({...c,onEnd:()=>{var C,M;(C=c.onEnd)==null||C.call(c),i&&(i.remove(),i=null),e=null,(M=t==null?void 0:t.onCleanupEnd)==null||M.call(t)}});e={controller:T,direction:"out"},T.forward();return}const S={in:void 0,out:Promise.resolve(c)},w=await m.runOut(S);if(!w.config)return;if("springs"in w.config){console.error("Unexpected MultiSpringConfig in single-spring path");return}(E=(A=w.config).prepare)==null||E.call(A,a),g(),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 y,b,T;(b=(y=w.config)==null?void 0:y.onEnd)==null||b.call(y),i&&(i.remove(),i=null),e=null,(T=t==null?void 0:t.onCleanupEnd)==null||T.call(t)}});e={controller:f,direction:"out"},w.direction==="forward"?f.forward():f.backward();function g(){!r||!i||(o&&r.contains(o)?r.insertBefore(i,o):r.appendChild(i))}};return a=>{if(a)return r=a.parentElement,o=a.nextElementSibling,l(a),()=>{const p=a.cloneNode(!0);h(p)}}}const B=3,Y=n=>{if(!n)return null;const t=n.split(`
2
+ `).map(e=>e.trim());for(let e=B;e<Math.min(t.length,6);e++){const i=t[e],r=i==null?void 0:i.match(/\(?([^):]+):(\d+):(\d+)\)?$/);if(!r)continue;const o=r[1]??"",s=r[2]??"0",m=r[3]??"0";return{file:o.split(/[\\/]/).pop()||o,line:s,column:m}}return null},R=new Map,V=new Map;function G(n,t,e){R.set(n,t);let i=V.get(n);return i||(i=K(()=>{const r=R.get(n);return r||(console.warn(`Transition "${String(n)}" not found`),{})},{strategy:e,onCleanupEnd:()=>$(n)}),V.set(n,i),i)}function $(n){R.delete(n),V.delete(n)}function N(){const n=Y(new Error().stack);return n?`auto_${n.file}_${n.line}_${n.column}`:Symbol(`ssgoi_auto_${Date.now()}`)}const z=globalThis.FinalizationRegistry,D=z?new z(n=>{try{$(n)}catch{}}):void 0;function X(n){const t=n.key??N();if(n.ref&&D)try{D.register(n.ref,t)}catch{}return G(t,{in:n.in,out:n.out},n[j])}const J=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},Q=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 Z(n){const t=n.filter(e=>e.symmetric).map(e=>({from:e.to,to:e.from,transition:e.transition}));return[...n,...t]}function tt(n){let t=!1,e=!1;const i=l=>{if(!n)return;const h=l.touches[0];h&&(e=h.clientX<50)},r=()=>{n&&(e&&(t=!0,setTimeout(()=>{t=!1},500)),e=!1)};return{initialize:()=>{typeof window>"u"||n&&(window.addEventListener("touchstart",i,{passive:!0}),window.addEventListener("touchend",r,{passive:!0}))},cleanup:()=>{typeof window>"u"||(window.removeEventListener("touchstart",i),window.removeEventListener("touchend",r))},isSwipePending:()=>t}}function et(){let n=null,t=null;const e=new Map;let i=null;const r=()=>{n&&i&&e.set(i,{x:n.scrollLeft,y:n.scrollTop})};return{initializeContext:(u,a)=>{t=u,n||(n=J(u),(n===document.documentElement?window:n).addEventListener("scroll",r,{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?Q(t):document.body,getScrollPosition:u=>u&&e.has(u)?e.get(u):{x:0,y:0}}}function it(n){const{transitions:t=[],defaultTransition:e,middleware:i=(f,g)=>({from:f,to:g}),skipOnIosSwipe:r=!1}=n;let o=null;const s=Z(t),{initializeContext:m,calculateScrollOffset:l,getScrollContainer:h,getPositionedParentElement:u,getScrollPosition:a}=et(),p=tt(r);p.initialize();function c(){if(o!=null&&o.from&&(o!=null&&o.to)){const{from:f,to:g}=i(o.from,o.to),A=nt(f,g,s)||e,E=l(o.from,o.to),y={scrollOffset:E,scroll:a(o.from),get scrollingElement(){return h()||document.documentElement},get positionedParent(){return u()}},b={scrollOffset:E,get scroll(){return o?a(o.to):{x:0,y:0}},get scrollingElement(){return h()||document.documentElement},get positionedParent(){return u()}};A&&(A.out&&o.outResolve&&o.outResolve(T=>A.out(T,y)),A.in&&o.inResolve&&o.inResolve(T=>A.in(T,b))),o=null}}const S=async(f,g)=>p.isSwipePending()?()=>({}):g==="in"&&(!o||!o.from)?()=>({}):(o||(o={}),g==="out"?(o.from=f,new Promise(v=>{o.outResolve=v,c()})):(o.to=f,new Promise(v=>{o.inResolve=v,c()})));return f=>({key:f,in:async g=>(m(g,f),(await S(f,"in"))(g)),out:async g=>(await S(f,"out"))(g),[j]:_})}function nt(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 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}exports.isMultiSpring=I.isMultiSpring;exports.isSingleSpring=I.isSingleSpring;exports.jaeminInternal=W.jaeminInternal;exports.TRANSITION_STRATEGY=j;exports.createDefaultStrategy=L;exports.createPageTransitionStrategy=_;exports.createSggoiTransitionContext=it;exports.generateAutoKey=N;exports.transition=X;
package/dist/index.d.ts CHANGED
@@ -2,4 +2,5 @@ export * from './types';
2
2
  export * from './transition';
3
3
  export * from './create-ssgoi-transition-context';
4
4
  export * from './transition-strategy';
5
+ export { jaeminInternal } from './view-transitions/jaemin';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,mCAAmC,CAAC;AAClD,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,mCAAmC,CAAC;AAClD,cAAc,uBAAuB,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}