@ssgoi/core 3.4.0 → 3.5.0

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/index.cjs +1 -1
  2. package/dist/index.d.ts +0 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +12 -14
  5. package/dist/transitions/blur.d.ts +2 -5
  6. package/dist/transitions/blur.d.ts.map +1 -1
  7. package/dist/transitions/bounce.d.ts +2 -5
  8. package/dist/transitions/bounce.d.ts.map +1 -1
  9. package/dist/transitions/fade.d.ts +2 -5
  10. package/dist/transitions/fade.d.ts.map +1 -1
  11. package/dist/transitions/fly.d.ts +2 -5
  12. package/dist/transitions/fly.d.ts.map +1 -1
  13. package/dist/transitions/index.cjs +1 -1
  14. package/dist/transitions/index.js +181 -172
  15. package/dist/transitions/mask.d.ts +2 -5
  16. package/dist/transitions/mask.d.ts.map +1 -1
  17. package/dist/transitions/none.d.ts +2 -5
  18. package/dist/transitions/none.d.ts.map +1 -1
  19. package/dist/transitions/rotate.d.ts +2 -5
  20. package/dist/transitions/rotate.d.ts.map +1 -1
  21. package/dist/transitions/scale.d.ts +2 -5
  22. package/dist/transitions/scale.d.ts.map +1 -1
  23. package/dist/transitions/slide.d.ts +2 -5
  24. package/dist/transitions/slide.d.ts.map +1 -1
  25. package/dist/view-transitions/depth.d.ts +19 -0
  26. package/dist/view-transitions/depth.d.ts.map +1 -0
  27. package/dist/view-transitions/index.cjs +13 -13
  28. package/dist/view-transitions/index.d.ts +5 -2
  29. package/dist/view-transitions/index.d.ts.map +1 -1
  30. package/dist/view-transitions/index.js +980 -602
  31. package/dist/view-transitions/instagram.d.ts.map +1 -1
  32. package/dist/view-transitions/jaemin.d.ts +0 -4
  33. package/dist/view-transitions/jaemin.d.ts.map +1 -1
  34. package/dist/view-transitions/pinterest.d.ts.map +1 -1
  35. package/dist/view-transitions/sheet.d.ts +19 -0
  36. package/dist/view-transitions/sheet.d.ts.map +1 -0
  37. package/dist/view-transitions/swap.d.ts +13 -0
  38. package/dist/view-transitions/swap.d.ts.map +1 -0
  39. package/package.json +1 -1
  40. package/dist/jaemin-BG8HRXG1.cjs +0 -1
  41. package/dist/jaemin-BWkrXq0V.js +0 -131
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var st=Object.defineProperty;var ct=(n,e,t)=>e in n?st(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var m=(n,e,t)=>ct(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./types.cjs"),at=require("./jaemin-BG8HRXG1.cjs");class lt{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,"maxDeltaTime",33);m(this,"gap",1e3/240);m(this,"nextTime",this.gap);m(this,"tick",()=>{const e=Date.now();let i=e-this.lastUpdate;i>this.lagThreshold||i<0?(this.startTime+=i-this.adjustedLag,i=this.adjustedLag):i>this.maxDeltaTime&&(i=this.maxDeltaTime),this.lastUpdate=e;const r=e-this.startTime,s=r-this.nextTime;if(s>0){const a=i/1e3;this.elapsed=r/1e3,this.nextTime+=s+(s>=this.gap?4:this.gap-s),this.listeners.forEach(o=>{o(a,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(e){return this.listeners.add(e),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(e)}}unsubscribe(e){this.listeners.delete(e),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(e,t){this.lagThreshold=e,this.adjustedLag=Math.min(t,e)}fps(e){this.gap=1e3/e,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const D=new lt;function $(n){const e=n.stiffness,t=n.damping,i=1,r=Math.sqrt(e/i),s=t/(2*Math.sqrt(e*i)),a={omega:r,zeta:s};if(n.doubleSpring){const o=typeof n.doubleSpring=="number"?n.doubleSpring:1,c=e*o,u=Math.sqrt(c/i),f=t/(2*Math.sqrt(c*i));a.follower={omega:u,zeta:f}}return a}function _(n,e,t,i,r,s){const a=-2*s*r*i*e,o=s*i*i*(t-n),c=e+a+o;return{position:n+s*c,velocity:c}}function B(n,e,t,i){const r=Math.min(i,.033);if(t.follower){const u=n._leader??{position:n.position,velocity:n.velocity},f=_(u.position,u.velocity,e,t.omega,t.zeta,r),g=_(n.position,n.velocity,f.position,t.follower.omega,t.follower.zeta,r);return{position:g.position,velocity:g.velocity,_leader:f}}const{omega:s,zeta:a}=t,o=_(n.position,n.velocity,e,s,a,r);return{position:o.position,velocity:o.velocity}}const j=.01,X=.01,K=.05;function Z(n,e){const t=Math.abs(e-n.position),i=Math.abs(n.velocity),r=t<j&&i<X,s=n;if(s._leader){const a=Math.abs(e-s._leader.position),o=Math.abs(s._leader.velocity);return a<j&&o<X&&r}return r}function ut(n){const{from:e,to:t,spring:i,velocity:r=0,onUpdate:s,onComplete:a,onStart:o}=n;let c={position:e,velocity:r},u=!0,f=0,g=!1;const S=$(i),y=l=>{if(u){if(g||(g=!0,o==null||o()),c=B(c,t,S,l),Z(c,t)){if(f+=Math.min(l,.033),f>=K){c={position:t,velocity:0},u=!1,s(c.position),D.unsubscribe(y),a();return}}else f=0;s(c.position)}};return D.subscribe(y),{stop:()=>{u&&(u=!1,D.unsubscribe(y))},getPosition:()=>c.position,getVelocity:()=>c.velocity,isRunning:()=>u}}const I=1e3/60;function ft(n,e,t,i=0){const r=$(t),s=600;let a={position:n,velocity:i},o=0;const c=[];for(let u=0;u<s;u++){const f=u*I;if(c.push({time:f,position:a.position,velocity:a.velocity}),a=B(a,e,r,I/1e3),Z(a,e)){if(o+=I/1e3,o>=K){c.push({time:(u+1)*I,position:e,velocity:0});break}}else o=0}return c}function G(n,e){if(n.length===0)return{position:0,velocity:0};const t=n[0],i=n[n.length-1];if(e<=0)return{position:t.position,velocity:t.velocity};if(e>=i.time)return{position:i.position,velocity:i.velocity};let r=0,s=n.length-1;for(;r<s-1;){const u=Math.floor((r+s)/2);n[u].time<=e?r=u:s=u}const a=n[r],o=n[s],c=(e-a.time)/(o.time-a.time);return{position:a.position+(o.position-a.position)*c,velocity:a.velocity+(o.velocity-a.velocity)*c}}function dt(n,e){return n.map(t=>e(t.position))}function mt(n){const{element:e,from:t,to:i,spring:r,velocity:s=0,style:a,onComplete:o,onStart:c}=n,u=ft(t,i,r,s);if(u.length===0)return c==null||c(),o(),{stop:()=>{},getPosition:()=>i,getVelocity:()=>0,isRunning:()=>!1};const f=dt(u,a),g=u[u.length-1],S=g.time,y=e.animate(f,{duration:S,fill:"forwards",easing:"linear"});let l=!0;const d=performance.now();return c==null||c(),y.onfinish=()=>{l&&(l=!1,o())},{stop:()=>{l&&(l=!1,y.cancel())},getPosition:()=>{if(!l)return g.position;const T=performance.now()-d;return G(u,T).position},getVelocity:()=>{if(!l)return 0;const T=performance.now()-d;return G(u,T).velocity},isRunning:()=>l}}function gt(n){const{from:e,to:t,spring:i,velocity:r,onComplete:s,onStart:a,tick:o,css:c}=n;if(o&&c)throw new Error("Cannot use both 'tick' and 'css' options together");return!o&&!c?(a==null||a(),s(),{stop:()=>{},getPosition:()=>t,getVelocity:()=>0,isRunning:()=>!1}):c?mt({element:c.element,from:e,to:t,spring:i,velocity:r,style:c.style,onComplete:s,onStart:a}):ut({from:e,to:t,spring:i,velocity:r,onUpdate:o,onComplete:s,onStart:a})}class J{}class F extends J{constructor(t){super();m(this,"options");m(this,"controls",null);m(this,"isAnimating",!1);m(this,"currentValue");m(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=gt({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{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 r=new F(i);return r.setValue(t.position),r.setVelocity(t.velocity),r}}class z extends J{constructor(t){super();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,"rafId",null);m(this,"from");m(this,"to");this.config=t.config,this.from=t.from,this.to=t.to,this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.springs.forEach(t=>{const i=this.generateId(),r=new F({from:this.from,to:this.to,spring:t.spring,tick:t.tick,css:t.css,onComplete:()=>this.onAnimatorComplete(i),onStart:t.onStart});this.animators.set(i,{id:i,item:t,animator:r,started:!1}),this.springOrder.push(i)})}getAnimatorProgress(t){const i=t.animator.getCurrentState(),r=Math.abs(i.to-i.from);return r===0?1:Math.abs(i.position-i.from)/r}getOrderedIds(){return this.direction==="forward"?this.springOrder:[...this.springOrder].reverse()}onAnimatorComplete(t){var r,s,a,o,c,u;const i=this.animators.get(t);!i||this.completedAnimators.has(t)||(this.completedAnimators.add(t),this.completedCount++,(s=(r=i.item).onComplete)==null||s.call(r),(o=(a=this.config).onProgress)==null||o.call(a,this.completedCount,this.config.springs.length),this.completedCount===this.config.springs.length&&(this.stopScheduler(),(u=(c=this.config).onEnd)==null||u.call(c)))}checkAndStartSprings(){const t=this.getOrderedIds();for(let i=0;i<t.length;i++){const r=t[i],s=this.animators.get(r);if(!s||s.started)continue;if(i===0){this.startAnimator(r);continue}const a=t[i-1],o=this.animators.get(a);if(!o||!o.started)continue;const c=this.getAnimatorProgress(o),u=s.item.normalizedOffset;c>=u&&this.startAnimator(r)}}startAnimator(t){const i=this.animators.get(t);!i||i.started||(i.started=!0,this.direction==="forward"?i.animator.forward():i.animator.backward())}startScheduler(){const t=()=>{this.checkAndStartSprings(),this.getIsAnimating()&&(this.rafId=requestAnimationFrame(t))};t()}stopScheduler(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null)}getFirstAnimator(){var i;const t=this.springOrder[0];return t?((i=this.animators.get(t))==null?void 0:i.animator)??null:null}forward(){var t,i;this.stop(),this.direction="forward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(i=(t=this.config).onStart)==null||i.call(t),this.startScheduler()}backward(){var t,i;this.stop(),this.direction="backward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(i=(t=this.config).onStart)==null||i.call(t),this.startScheduler()}resetStartedFlags(){this.animators.forEach(t=>{t.started=!1})}stop(){this.stopScheduler(),this.animators.forEach(t=>{t.animator.stop(),t.started=!1})}reverse(){this.direction=this.direction==="forward"?"backward":"forward",this.animators.forEach(t=>{if(!t.started)return;const i=t.animator.getCurrentState();if(i.position===i.to){const s=F.fromState({position:this.to,velocity:0},{from:this.to,to:this.from,spring:t.item.spring,tick:t.item.tick,css:t.item.css,onComplete:()=>this.onAnimatorComplete(t.id),onStart:t.item.onStart});s.forward(),t.animator=s}else t.animator.reverse()})}getCurrentState(){const t=this.getFirstAnimator();return t?t.getCurrentState():{position:0,velocity:0,from:0,to:1}}getCurrentValue(){const t=this.getFirstAnimator();return(t==null?void 0:t.getCurrentValue())??0}getVelocity(){const t=this.getFirstAnimator();return(t==null?void 0:t.getVelocity())??0}setValue(t){const i=this.getFirstAnimator();i==null||i.setValue(t)}setVelocity(t){const i=this.getFirstAnimator();i==null||i.setVelocity(t)}getIsAnimating(){for(const t of this.animators.values())if(t.animator.getIsAnimating())return!0;return!1}static fromState(t,i){const r=new z(i);return r.setValue(t.position),r.setVelocity(t.velocity),r}}const Y=Symbol.for("TRANSITION_STRATEGY"),Q=n=>({runIn:async e=>{const{currentAnimation:t}=n;if(t&&t.direction==="out"){const r=t.controller.getCurrentValue(),s=t.controller.getVelocity();if(t.controller.stop(),e.out)return{config:await e.out,state:{position:r,velocity:s},from:1,to:0,direction:"backward"}}return e.in?{config:await e.in,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"}},runOut:async e=>{const{currentAnimation:t}=n;if(t&&t.direction==="in"){const r=t.controller.getCurrentValue(),s=t.controller.getVelocity();if(t.controller.stop(),e.in)return{config:await e.in,state:{position:r,velocity:s},from:0,to:1,direction:"backward"}}return e.out?{config:await e.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}}),tt=()=>({runIn:async n=>n.in?{config:await n.in,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"},runOut:async n=>n.out?{config:await n.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}),U="data-ssgoi-scope",W="data-ssgoi-scope-ready";function ht(){return n=>{if(n)return n.setAttribute(U,""),queueMicrotask(()=>{queueMicrotask(()=>{n.setAttribute(W,"true")})}),()=>{}}}function et(n){return n.hasAttribute(W)}function it(n){return n.closest(`[${U}]`)}function pt(n,e){var y;let t=null,i=null,r=null,s=null;const a={get currentAnimation(){return t}},o=((y=e==null?void 0:e.strategy)==null?void 0:y.call(e,a))||Q(a),c=async l=>{var E;i&&(i.remove(),i=null);const d=n(),T=d.in&&d.in(l),k=!(e!=null&&e.strategy)&&d.out?d.out(l):void 0;if(!T)return;const P={in:A.normalizeToMultiSpring(T),out:k?A.normalizeToMultiSpring(k):void 0},v=await o.runIn(P);if(!v.config){t&&(t.direction="in");return}const p=v.config;(E=p.prepare)==null||E.call(p,l),p.wait&&await p.wait();const w=A.normalizeMultiSpringSchedule({...p,onEnd:()=>{var C;t=null,(C=p.onEnd)==null||C.call(p)}},l),h=z.fromState(v.state,{config:w,from:v.from,to:v.to});t={controller:h,direction:"in"},v.direction==="forward"?h.forward():h.backward()},u=async l=>{var C;i=l;const d=n(),T=!(e!=null&&e.strategy)&&d.in?d.in(l):void 0,k=d.out&&d.out(l);if(!k)return;const P={in:T?A.normalizeToMultiSpring(T):void 0,out:A.normalizeToMultiSpring(k)},v=await o.runOut(P);if(!v.config){t&&(t.direction="out"),i&&(i.remove(),i=null);return}const p=v.config;(C=p.prepare)==null||C.call(p,l),E(),p.wait&&await p.wait();const w=A.normalizeMultiSpringSchedule({...p,onEnd:()=>{var R,V;(R=p.onEnd)==null||R.call(p),i&&(i.remove(),i=null),t=null,(V=e==null?void 0:e.onCleanupEnd)==null||V.call(e)}},l),h=z.fromState(v.state,{config:w,from:v.from,to:v.to});t={controller:h,direction:"out"},v.direction==="forward"?h.forward():h.backward();function E(){!r||!i||(s&&r.contains(s)?r.insertBefore(i,s):r.appendChild(i))}};let f=null,g=!1;const S=l=>()=>{if(g)return;g=!0;const d=l.cloneNode(!0);f?queueMicrotask(()=>{document.contains(f)&&u(d)}):u(d)};return l=>{if(l)return requestAnimationFrame(()=>{r=l.parentElement,s=l.nextElementSibling}),g=!1,(e==null?void 0:e.scope)==="local"?queueMicrotask(()=>{f=it(l),!(f&&!et(f))&&c(l)}):c(l),S(l)}}const M=new Map;let b=null,q=!1;function nt(n){if(n instanceof HTMLElement&&M.has(n)){const t=M.get(n);M.delete(n),queueMicrotask(()=>{t()})}const e=n.childNodes;for(let t=0;t<e.length;t++){const i=e[t];i&&nt(i)}}function wt(){q||typeof document>"u"||(q=!0,b=new MutationObserver(n=>{for(const e of n){const t=e.removedNodes;for(let i=0;i<t.length;i++){const r=t[i];r&&nt(r)}}}),document.body?b.observe(document.body,{childList:!0,subtree:!0}):document.addEventListener("DOMContentLoaded",()=>{b==null||b.observe(document.body,{childList:!0,subtree:!0})},{once:!0}))}function ot(n,e){wt(),M.set(n,e)}function St(n){return M.has(n)}function yt(){return M.size}function vt(n){const e=M.get(n);return e?(M.delete(n),e(),!0):!1}function Ct(){M.clear(),b==null||b.disconnect(),b=null,q=!1}const x=new Map,N=new Map,H=new Map;function Tt(n,e,t){x.set(n,e);let i=N.get(n);if(i)return i;const r=e;return i=pt(()=>{const s=x.get(n);return s||(console.warn(`Transition "${String(n)}" not found`),{})},{strategy:t==null?void 0:t.strategy,scope:t==null?void 0:t.scope,onCleanupEnd:()=>{x.get(n)===r&&At(n)}}),N.set(n,i),i}function At(n){x.delete(n),N.delete(n),H.delete(n)}function Et(n,e="manual"){const t=Tt(n.key,{in:n.in,out:n.out},{strategy:n[Y],scope:n.scope});if(e==="manual")return t;let i=H.get(n.key);return i||(i=r=>{if(r){const s=t(r);s&&ot(r,s)}},H.set(n.key,i),i)}function bt(n){const e=n.filter(t=>t.symmetric).map(t=>({from:t.to,to:t.from,transition:t.transition}));return[...n,...e]}function Mt(n){let e=!1,t=0,i=0,r=!1;const s=50,a=l=>{if(!n)return;const d=l.touches[0];d&&(r=d.clientX<s,r&&(t=d.clientX,i=d.clientY))},o=l=>{if(!n||!r)return;const d=l.touches[0];if(!d)return;const T=d.clientX-t,k=d.clientY-i;T>window.outerWidth/2-5&&Math.abs(T)>Math.abs(k)?e=!0:e=!1},c=()=>{n&&(r=!1,t=0,i=0)},u=()=>e,f=()=>{typeof window>"u"||n&&(window.addEventListener("touchstart",a,{passive:!0}),window.addEventListener("touchmove",o,{passive:!0}),window.addEventListener("touchend",c,{passive:!0}))},g=()=>{typeof window>"u"||(window.removeEventListener("touchstart",a),window.removeEventListener("touchmove",o),window.removeEventListener("touchend",c))};let S=0;return{initialize:f,cleanup:g,isSwipePending:u,resetSwipeDetection:()=>{S++,S>1&&(S=0,e=!1)}}}const kt=n=>{let e=n.parentElement;for(;e&&e!==document.body;){const t=window.getComputedStyle(e),i=t.overflow+t.overflowY+t.overflowX;if(i.includes("auto")||i.includes("scroll")||e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)return e;e=e.parentElement}return document.documentElement},Rt=n=>{let e=n.parentElement;for(;e&&e!==document.body;){const t=window.getComputedStyle(e).position;if(t==="relative"||t==="absolute"||t==="fixed"||t==="sticky")return e;e=e.parentElement}return document.body};function Pt(){let n=null,e=null;const t=new Map;let i=null;const r=()=>{n&&i&&t.set(i,{x:n.scrollLeft,y:n.scrollTop})};return{initializeContext:(f,g)=>{e=f,n||(n=kt(f),(n===document.documentElement?window:n).addEventListener("scroll",r,{passive:!0})),i=g},calculateScrollOffset:(f,g)=>{const S=f&&t.has(f)?t.get(f):{x:0,y:0},y=g&&t.has(g)?t.get(g):{x:0,y:0};return{x:-y.x+S.x,y:-y.y+S.y}},getScrollContainer:()=>n,getPositionedParentElement:()=>e?Rt(e):document.body,getScrollPosition:f=>f&&t.has(f)?t.get(f):{x:0,y:0}}}function O(n,e){if(e==="*")return!0;if(e.endsWith("/*")){const t=e.slice(0,-2);return n===t||n.startsWith(t+"/")}return n===e}function Vt(n,e,t){for(const i of t)if(O(n,i.from)&&O(e,i.to))return i.transition;for(const i of t)if((i.from==="*"||O(n,i.from))&&(i.to==="*"||O(e,i.to)))return i.transition;return null}function It(n,e){const{transitions:t=[],defaultTransition:i,middleware:r=(w,h)=>({from:w,to:h}),skipOnIosSwipe:s=!0}=n,{outFirst:a=!0}=e||{};let o=null;const c=bt(t),{initializeContext:u,calculateScrollOffset:f,getScrollContainer:g,getPositionedParentElement:S,getScrollPosition:y}=Pt(),l=Mt(s);l.initialize();function d(){if(o!=null&&o.from&&(o!=null&&o.to)){const{from:w,to:h}=r(o.from,o.to),C=Vt(w,h,c)||i,R=f(o.from,o.to),V={scrollOffset:R,scroll:y(o.from),get scrollingElement(){return g()||document.documentElement},get positionedParent(){return S()}},rt={scrollOffset:R,get scroll(){return o?y(o.to):{x:0,y:0}},get scrollingElement(){return g()||document.documentElement},get positionedParent(){return S()}};C&&(C.out&&o.outResolve&&o.outResolve(L=>C.out(L,V)),C.in&&o.inResolve&&o.inResolve(L=>C.in(L,rt))),o=null}}function T(){o&&(o.inResolve&&o.inResolve(()=>({})),o.outResolve&&o.outResolve(()=>({})),o=null)}const v=a?async(w,h)=>l.isSwipePending()?(l.resetSwipeDetection(),()=>({})):h==="in"&&(!o||!o.from)?()=>({}):(o||(o={}),h==="out"?(o.from=w,new Promise(E=>{o.outResolve=E,d()})):(o.to=w,new Promise(E=>{o.inResolve=E,d()}))):async(w,h)=>l.isSwipePending()?(l.resetSwipeDetection(),()=>({})):(o&&(h==="out"&&o.from&&o.from!==w||h==="in"&&o.to&&o.to!==w)&&T(),o||(o={}),h==="out"?(o.from=w,new Promise(C=>{o.outResolve=C,d()})):(o.to=w,new Promise(C=>{o.inResolve=C,d()})));return w=>({key:w,in:async h=>(u(h,w),(await v(w,"in"))(h)),out:async h=>(await v(w,"out"))(h),[Y]:tt})}exports.isCssAnimation=A.isCssAnimation;exports.isMultiSpring=A.isMultiSpring;exports.isSingleSpring=A.isSingleSpring;exports.isTickAnimation=A.isTickAnimation;exports.normalizeMultiSpringSchedule=A.normalizeMultiSpringSchedule;exports.normalizeToMultiSpring=A.normalizeToMultiSpring;exports.validateAnimationMode=A.validateAnimationMode;exports.validateSpringItem=A.validateSpringItem;exports.jaeminInternal=at.jaeminInternal;exports.SCOPE_ATTR=U;exports.SCOPE_READY_ATTR=W;exports.TRANSITION_STRATEGY=Y;exports.createDefaultStrategy=Q;exports.createPageTransitionStrategy=tt;exports.createSggoiTransitionContext=It;exports.createTransitionScope=ht;exports.findScope=it;exports.getWatchedCount=yt;exports.isScopeReady=et;exports.isWatched=St;exports.resetObserver=Ct;exports.transition=Et;exports.triggerUnmount=vt;exports.watchUnmount=ot;
1
+ "use strict";var st=Object.defineProperty;var ct=(n,e,t)=>e in n?st(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var m=(n,e,t)=>ct(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("./types.cjs");class at{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,"maxDeltaTime",33);m(this,"gap",1e3/240);m(this,"nextTime",this.gap);m(this,"tick",()=>{const e=Date.now();let i=e-this.lastUpdate;i>this.lagThreshold||i<0?(this.startTime+=i-this.adjustedLag,i=this.adjustedLag):i>this.maxDeltaTime&&(i=this.maxDeltaTime),this.lastUpdate=e;const r=e-this.startTime,s=r-this.nextTime;if(s>0){const a=i/1e3;this.elapsed=r/1e3,this.nextTime+=s+(s>=this.gap?4:this.gap-s),this.listeners.forEach(o=>{o(a,this.elapsed)})}this.listeners.size>0?this.rafId=requestAnimationFrame(this.tick):(this.isRunning=!1,this.rafId=null)})}subscribe(e){return this.listeners.add(e),this.isRunning||(this.isRunning=!0,this.rafId=requestAnimationFrame(this.tick)),()=>{this.unsubscribe(e)}}unsubscribe(e){this.listeners.delete(e),this.listeners.size===0&&this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.isRunning=!1,this.rafId=null)}lagSmoothing(e,t){this.lagThreshold=e,this.adjustedLag=Math.min(t,e)}fps(e){this.gap=1e3/e,this.nextTime=this.elapsed*1e3+this.gap}getListenerCount(){return this.listeners.size}getElapsed(){return this.elapsed}}const D=new at;function $(n){const e=n.stiffness,t=n.damping,i=1,r=Math.sqrt(e/i),s=t/(2*Math.sqrt(e*i)),a={omega:r,zeta:s};if(n.doubleSpring){const o=typeof n.doubleSpring=="number"?n.doubleSpring:1,c=e*o,u=Math.sqrt(c/i),f=t/(2*Math.sqrt(c*i));a.follower={omega:u,zeta:f}}return a}function _(n,e,t,i,r,s){const a=-2*s*r*i*e,o=s*i*i*(t-n),c=e+a+o;return{position:n+s*c,velocity:c}}function B(n,e,t,i){const r=Math.min(i,.033);if(t.follower){const u=n._leader??{position:n.position,velocity:n.velocity},f=_(u.position,u.velocity,e,t.omega,t.zeta,r),g=_(n.position,n.velocity,f.position,t.follower.omega,t.follower.zeta,r);return{position:g.position,velocity:g.velocity,_leader:f}}const{omega:s,zeta:a}=t,o=_(n.position,n.velocity,e,s,a,r);return{position:o.position,velocity:o.velocity}}const X=.01,j=.01,K=.05;function Z(n,e){const t=Math.abs(e-n.position),i=Math.abs(n.velocity),r=t<X&&i<j,s=n;if(s._leader){const a=Math.abs(e-s._leader.position),o=Math.abs(s._leader.velocity);return a<X&&o<j&&r}return r}function lt(n){const{from:e,to:t,spring:i,velocity:r=0,onUpdate:s,onComplete:a,onStart:o}=n;let c={position:e,velocity:r},u=!0,f=0,g=!1;const S=$(i),y=l=>{if(u){if(g||(g=!0,o==null||o()),c=B(c,t,S,l),Z(c,t)){if(f+=Math.min(l,.033),f>=K){c={position:t,velocity:0},u=!1,s(c.position),D.unsubscribe(y),a();return}}else f=0;s(c.position)}};return D.subscribe(y),{stop:()=>{u&&(u=!1,D.unsubscribe(y))},getPosition:()=>c.position,getVelocity:()=>c.velocity,isRunning:()=>u}}const I=1e3/60;function ut(n,e,t,i=0){const r=$(t),s=600;let a={position:n,velocity:i},o=0;const c=[];for(let u=0;u<s;u++){const f=u*I;if(c.push({time:f,position:a.position,velocity:a.velocity}),a=B(a,e,r,I/1e3),Z(a,e)){if(o+=I/1e3,o>=K){c.push({time:(u+1)*I,position:e,velocity:0});break}}else o=0}return c}function G(n,e){if(n.length===0)return{position:0,velocity:0};const t=n[0],i=n[n.length-1];if(e<=0)return{position:t.position,velocity:t.velocity};if(e>=i.time)return{position:i.position,velocity:i.velocity};let r=0,s=n.length-1;for(;r<s-1;){const u=Math.floor((r+s)/2);n[u].time<=e?r=u:s=u}const a=n[r],o=n[s],c=(e-a.time)/(o.time-a.time);return{position:a.position+(o.position-a.position)*c,velocity:a.velocity+(o.velocity-a.velocity)*c}}function ft(n,e){return n.map(t=>e(t.position))}function dt(n){const{element:e,from:t,to:i,spring:r,velocity:s=0,style:a,onComplete:o,onStart:c}=n,u=ut(t,i,r,s);if(u.length===0)return c==null||c(),o(),{stop:()=>{},getPosition:()=>i,getVelocity:()=>0,isRunning:()=>!1};const f=ft(u,a),g=u[u.length-1],S=g.time,y=e.animate(f,{duration:S,fill:"forwards",easing:"linear"});let l=!0;const d=performance.now();return c==null||c(),y.onfinish=()=>{l&&(l=!1,o())},{stop:()=>{l&&(l=!1,y.cancel())},getPosition:()=>{if(!l)return g.position;const T=performance.now()-d;return G(u,T).position},getVelocity:()=>{if(!l)return 0;const T=performance.now()-d;return G(u,T).velocity},isRunning:()=>l}}function mt(n){const{from:e,to:t,spring:i,velocity:r,onComplete:s,onStart:a,tick:o,css:c}=n;if(o&&c)throw new Error("Cannot use both 'tick' and 'css' options together");return!o&&!c?(a==null||a(),s(),{stop:()=>{},getPosition:()=>t,getVelocity:()=>0,isRunning:()=>!1}):c?dt({element:c.element,from:e,to:t,spring:i,velocity:r,style:c.style,onComplete:s,onStart:a}):lt({from:e,to:t,spring:i,velocity:r,onUpdate:o,onComplete:s,onStart:a})}class J{}class F extends J{constructor(t){super();m(this,"options");m(this,"controls",null);m(this,"isAnimating",!1);m(this,"currentValue");m(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=mt({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{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 r=new F(i);return r.setValue(t.position),r.setVelocity(t.velocity),r}}class z extends J{constructor(t){super();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,"rafId",null);m(this,"from");m(this,"to");this.config=t.config,this.from=t.from,this.to=t.to,this.initializeAnimators()}generateId(){return`spring_${this.idCounter++}`}initializeAnimators(){this.config.springs.forEach(t=>{const i=this.generateId(),r=new F({from:this.from,to:this.to,spring:t.spring,tick:t.tick,css:t.css,onComplete:()=>this.onAnimatorComplete(i),onStart:t.onStart});this.animators.set(i,{id:i,item:t,animator:r,started:!1}),this.springOrder.push(i)})}getAnimatorProgress(t){const i=t.animator.getCurrentState(),r=Math.abs(i.to-i.from);return r===0?1:Math.abs(i.position-i.from)/r}getOrderedIds(){return this.direction==="forward"?this.springOrder:[...this.springOrder].reverse()}onAnimatorComplete(t){var r,s,a,o,c,u;const i=this.animators.get(t);!i||this.completedAnimators.has(t)||(this.completedAnimators.add(t),this.completedCount++,(s=(r=i.item).onComplete)==null||s.call(r),(o=(a=this.config).onProgress)==null||o.call(a,this.completedCount,this.config.springs.length),this.completedCount===this.config.springs.length&&(this.stopScheduler(),(u=(c=this.config).onEnd)==null||u.call(c)))}checkAndStartSprings(){const t=this.getOrderedIds();for(let i=0;i<t.length;i++){const r=t[i],s=this.animators.get(r);if(!s||s.started)continue;if(i===0){this.startAnimator(r);continue}const a=t[i-1],o=this.animators.get(a);if(!o||!o.started)continue;const c=this.getAnimatorProgress(o),u=s.item.normalizedOffset;c>=u&&this.startAnimator(r)}}startAnimator(t){const i=this.animators.get(t);!i||i.started||(i.started=!0,this.direction==="forward"?i.animator.forward():i.animator.backward())}startScheduler(){const t=()=>{this.checkAndStartSprings(),this.getIsAnimating()&&(this.rafId=requestAnimationFrame(t))};t()}stopScheduler(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null)}getFirstAnimator(){var i;const t=this.springOrder[0];return t?((i=this.animators.get(t))==null?void 0:i.animator)??null:null}forward(){var t,i;this.stop(),this.direction="forward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(i=(t=this.config).onStart)==null||i.call(t),this.startScheduler()}backward(){var t,i;this.stop(),this.direction="backward",this.completedCount=0,this.completedAnimators.clear(),this.resetStartedFlags(),(i=(t=this.config).onStart)==null||i.call(t),this.startScheduler()}resetStartedFlags(){this.animators.forEach(t=>{t.started=!1})}stop(){this.stopScheduler(),this.animators.forEach(t=>{t.animator.stop(),t.started=!1})}reverse(){this.direction=this.direction==="forward"?"backward":"forward",this.animators.forEach(t=>{if(!t.started)return;const i=t.animator.getCurrentState();if(i.position===i.to){const s=F.fromState({position:this.to,velocity:0},{from:this.to,to:this.from,spring:t.item.spring,tick:t.item.tick,css:t.item.css,onComplete:()=>this.onAnimatorComplete(t.id),onStart:t.item.onStart});s.forward(),t.animator=s}else t.animator.reverse()})}getCurrentState(){const t=this.getFirstAnimator();return t?t.getCurrentState():{position:0,velocity:0,from:0,to:1}}getCurrentValue(){const t=this.getFirstAnimator();return(t==null?void 0:t.getCurrentValue())??0}getVelocity(){const t=this.getFirstAnimator();return(t==null?void 0:t.getVelocity())??0}setValue(t){const i=this.getFirstAnimator();i==null||i.setValue(t)}setVelocity(t){const i=this.getFirstAnimator();i==null||i.setVelocity(t)}getIsAnimating(){for(const t of this.animators.values())if(t.animator.getIsAnimating())return!0;return!1}static fromState(t,i){const r=new z(i);return r.setValue(t.position),r.setVelocity(t.velocity),r}}const Y=Symbol.for("TRANSITION_STRATEGY"),Q=n=>({runIn:async e=>{const{currentAnimation:t}=n;if(t&&t.direction==="out"){const r=t.controller.getCurrentValue(),s=t.controller.getVelocity();if(t.controller.stop(),e.out)return{config:await e.out,state:{position:r,velocity:s},from:1,to:0,direction:"backward"}}return e.in?{config:await e.in,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"}},runOut:async e=>{const{currentAnimation:t}=n;if(t&&t.direction==="in"){const r=t.controller.getCurrentValue(),s=t.controller.getVelocity();if(t.controller.stop(),e.in)return{config:await e.in,state:{position:r,velocity:s},from:0,to:1,direction:"backward"}}return e.out?{config:await e.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}}),tt=()=>({runIn:async n=>n.in?{config:await n.in,state:{position:0,velocity:0},from:0,to:1,direction:"forward"}:{state:{position:0,velocity:0},from:0,to:1,direction:"forward"},runOut:async n=>n.out?{config:await n.out,state:{position:1,velocity:0},from:1,to:0,direction:"forward"}:{state:{position:1,velocity:0},from:1,to:0,direction:"forward"}}),U="data-ssgoi-scope",W="data-ssgoi-scope-ready";function gt(){return n=>{if(n)return n.setAttribute(U,""),queueMicrotask(()=>{queueMicrotask(()=>{n.setAttribute(W,"true")})}),()=>{}}}function et(n){return n.hasAttribute(W)}function it(n){return n.closest(`[${U}]`)}function ht(n,e){var y;let t=null,i=null,r=null,s=null;const a={get currentAnimation(){return t}},o=((y=e==null?void 0:e.strategy)==null?void 0:y.call(e,a))||Q(a),c=async l=>{var E;i&&(i.remove(),i=null);const d=n(),T=d.in&&d.in(l),k=!(e!=null&&e.strategy)&&d.out?d.out(l):void 0;if(!T)return;const P={in:A.normalizeToMultiSpring(T),out:k?A.normalizeToMultiSpring(k):void 0},v=await o.runIn(P);if(!v.config){t&&(t.direction="in");return}const p=v.config;(E=p.prepare)==null||E.call(p,l),p.wait&&await p.wait();const w=A.normalizeMultiSpringSchedule({...p,onEnd:()=>{var C;t=null,(C=p.onEnd)==null||C.call(p)}},l),h=z.fromState(v.state,{config:w,from:v.from,to:v.to});t={controller:h,direction:"in"},v.direction==="forward"?h.forward():h.backward()},u=async l=>{var C;i=l;const d=n(),T=!(e!=null&&e.strategy)&&d.in?d.in(l):void 0,k=d.out&&d.out(l);if(!k)return;const P={in:T?A.normalizeToMultiSpring(T):void 0,out:A.normalizeToMultiSpring(k)},v=await o.runOut(P);if(!v.config){t&&(t.direction="out"),i&&(i.remove(),i=null);return}const p=v.config;(C=p.prepare)==null||C.call(p,l),E(),p.wait&&await p.wait();const w=A.normalizeMultiSpringSchedule({...p,onEnd:()=>{var R,V;(R=p.onEnd)==null||R.call(p),i&&(i.remove(),i=null),t=null,(V=e==null?void 0:e.onCleanupEnd)==null||V.call(e)}},l),h=z.fromState(v.state,{config:w,from:v.from,to:v.to});t={controller:h,direction:"out"},v.direction==="forward"?h.forward():h.backward();function E(){!r||!i||(s&&r.contains(s)?r.insertBefore(i,s):r.appendChild(i))}};let f=null,g=!1;const S=l=>()=>{if(g)return;g=!0;const d=l.cloneNode(!0);f?queueMicrotask(()=>{document.contains(f)&&u(d)}):u(d)};return l=>{if(l)return requestAnimationFrame(()=>{r=l.parentElement,s=l.nextElementSibling}),g=!1,(e==null?void 0:e.scope)==="local"?queueMicrotask(()=>{f=it(l),!(f&&!et(f))&&c(l)}):c(l),S(l)}}const M=new Map;let b=null,q=!1;function nt(n){if(n instanceof HTMLElement&&M.has(n)){const t=M.get(n);M.delete(n),queueMicrotask(()=>{t()})}const e=n.childNodes;for(let t=0;t<e.length;t++){const i=e[t];i&&nt(i)}}function pt(){q||typeof document>"u"||(q=!0,b=new MutationObserver(n=>{for(const e of n){const t=e.removedNodes;for(let i=0;i<t.length;i++){const r=t[i];r&&nt(r)}}}),document.body?b.observe(document.body,{childList:!0,subtree:!0}):document.addEventListener("DOMContentLoaded",()=>{b==null||b.observe(document.body,{childList:!0,subtree:!0})},{once:!0}))}function ot(n,e){pt(),M.set(n,e)}function wt(n){return M.has(n)}function St(){return M.size}function yt(n){const e=M.get(n);return e?(M.delete(n),e(),!0):!1}function vt(){M.clear(),b==null||b.disconnect(),b=null,q=!1}const x=new Map,N=new Map,H=new Map;function Ct(n,e,t){x.set(n,e);let i=N.get(n);if(i)return i;const r=e;return i=ht(()=>{const s=x.get(n);return s||(console.warn(`Transition "${String(n)}" not found`),{})},{strategy:t==null?void 0:t.strategy,scope:t==null?void 0:t.scope,onCleanupEnd:()=>{x.get(n)===r&&Tt(n)}}),N.set(n,i),i}function Tt(n){x.delete(n),N.delete(n),H.delete(n)}function At(n,e="manual"){const t=Ct(n.key,{in:n.in,out:n.out},{strategy:n[Y],scope:n.scope});if(e==="manual")return t;let i=H.get(n.key);return i||(i=r=>{if(r){const s=t(r);s&&ot(r,s)}},H.set(n.key,i),i)}function Et(n){const e=n.filter(t=>t.symmetric).map(t=>({from:t.to,to:t.from,transition:t.transition}));return[...n,...e]}function bt(n){let e=!1,t=0,i=0,r=!1;const s=50,a=l=>{if(!n)return;const d=l.touches[0];d&&(r=d.clientX<s,r&&(t=d.clientX,i=d.clientY))},o=l=>{if(!n||!r)return;const d=l.touches[0];if(!d)return;const T=d.clientX-t,k=d.clientY-i;T>window.outerWidth/2-5&&Math.abs(T)>Math.abs(k)?e=!0:e=!1},c=()=>{n&&(r=!1,t=0,i=0)},u=()=>e,f=()=>{typeof window>"u"||n&&(window.addEventListener("touchstart",a,{passive:!0}),window.addEventListener("touchmove",o,{passive:!0}),window.addEventListener("touchend",c,{passive:!0}))},g=()=>{typeof window>"u"||(window.removeEventListener("touchstart",a),window.removeEventListener("touchmove",o),window.removeEventListener("touchend",c))};let S=0;return{initialize:f,cleanup:g,isSwipePending:u,resetSwipeDetection:()=>{S++,S>1&&(S=0,e=!1)}}}const Mt=n=>{let e=n.parentElement;for(;e&&e!==document.body;){const t=window.getComputedStyle(e),i=t.overflow+t.overflowY+t.overflowX;if(i.includes("auto")||i.includes("scroll")||e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)return e;e=e.parentElement}return document.documentElement},kt=n=>{let e=n.parentElement;for(;e&&e!==document.body;){const t=window.getComputedStyle(e).position;if(t==="relative"||t==="absolute"||t==="fixed"||t==="sticky")return e;e=e.parentElement}return document.body};function Rt(){let n=null,e=null;const t=new Map;let i=null;const r=()=>{n&&i&&t.set(i,{x:n.scrollLeft,y:n.scrollTop})};return{initializeContext:(f,g)=>{e=f,n||(n=Mt(f),(n===document.documentElement?window:n).addEventListener("scroll",r,{passive:!0})),i=g},calculateScrollOffset:(f,g)=>{const S=f&&t.has(f)?t.get(f):{x:0,y:0},y=g&&t.has(g)?t.get(g):{x:0,y:0};return{x:-y.x+S.x,y:-y.y+S.y}},getScrollContainer:()=>n,getPositionedParentElement:()=>e?kt(e):document.body,getScrollPosition:f=>f&&t.has(f)?t.get(f):{x:0,y:0}}}function O(n,e){if(e==="*")return!0;if(e.endsWith("/*")){const t=e.slice(0,-2);return n===t||n.startsWith(t+"/")}return n===e}function Pt(n,e,t){for(const i of t)if(O(n,i.from)&&O(e,i.to))return i.transition;for(const i of t)if((i.from==="*"||O(n,i.from))&&(i.to==="*"||O(e,i.to)))return i.transition;return null}function Vt(n,e){const{transitions:t=[],defaultTransition:i,middleware:r=(w,h)=>({from:w,to:h}),skipOnIosSwipe:s=!0}=n,{outFirst:a=!0}=e||{};let o=null;const c=Et(t),{initializeContext:u,calculateScrollOffset:f,getScrollContainer:g,getPositionedParentElement:S,getScrollPosition:y}=Rt(),l=bt(s);l.initialize();function d(){if(o!=null&&o.from&&(o!=null&&o.to)){const{from:w,to:h}=r(o.from,o.to),C=Pt(w,h,c)||i,R=f(o.from,o.to),V={scrollOffset:R,scroll:y(o.from),get scrollingElement(){return g()||document.documentElement},get positionedParent(){return S()}},rt={scrollOffset:R,get scroll(){return o?y(o.to):{x:0,y:0}},get scrollingElement(){return g()||document.documentElement},get positionedParent(){return S()}};C&&(C.out&&o.outResolve&&o.outResolve(L=>C.out(L,V)),C.in&&o.inResolve&&o.inResolve(L=>C.in(L,rt))),o=null}}function T(){o&&(o.inResolve&&o.inResolve(()=>({})),o.outResolve&&o.outResolve(()=>({})),o=null)}const v=a?async(w,h)=>l.isSwipePending()?(l.resetSwipeDetection(),()=>({})):h==="in"&&(!o||!o.from)?()=>({}):(o||(o={}),h==="out"?(o.from=w,new Promise(E=>{o.outResolve=E,d()})):(o.to=w,new Promise(E=>{o.inResolve=E,d()}))):async(w,h)=>l.isSwipePending()?(l.resetSwipeDetection(),()=>({})):(o&&(h==="out"&&o.from&&o.from!==w||h==="in"&&o.to&&o.to!==w)&&T(),o||(o={}),h==="out"?(o.from=w,new Promise(C=>{o.outResolve=C,d()})):(o.to=w,new Promise(C=>{o.inResolve=C,d()})));return w=>({key:w,in:async h=>(u(h,w),(await v(w,"in"))(h)),out:async h=>(await v(w,"out"))(h),[Y]:tt})}exports.isCssAnimation=A.isCssAnimation;exports.isMultiSpring=A.isMultiSpring;exports.isSingleSpring=A.isSingleSpring;exports.isTickAnimation=A.isTickAnimation;exports.normalizeMultiSpringSchedule=A.normalizeMultiSpringSchedule;exports.normalizeToMultiSpring=A.normalizeToMultiSpring;exports.validateAnimationMode=A.validateAnimationMode;exports.validateSpringItem=A.validateSpringItem;exports.SCOPE_ATTR=U;exports.SCOPE_READY_ATTR=W;exports.TRANSITION_STRATEGY=Y;exports.createDefaultStrategy=Q;exports.createPageTransitionStrategy=tt;exports.createSggoiTransitionContext=Vt;exports.createTransitionScope=gt;exports.findScope=it;exports.getWatchedCount=St;exports.isScopeReady=et;exports.isWatched=wt;exports.resetObserver=vt;exports.transition=At;exports.triggerUnmount=yt;exports.watchUnmount=ot;
package/dist/index.d.ts CHANGED
@@ -4,5 +4,4 @@ export * from './transition/transition-scope';
4
4
  export * from './transition/unmount-observer';
5
5
  export * from './ssgoi-transition/create-ssgoi-transition-context';
6
6
  export * from './transition/transition-strategy';
7
- export { jaeminInternal } from './view-transitions/jaemin';
8
7
  //# 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,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oDAAoD,CAAC;AACnE,cAAc,kCAAkC,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oDAAoD,CAAC;AACnE,cAAc,kCAAkC,CAAC"}
package/dist/index.js CHANGED
@@ -3,7 +3,6 @@ var it = (i, e, t) => e in i ? nt(i, e, { enumerable: !0, configurable: !0, writ
3
3
  var m = (i, e, t) => it(i, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { normalizeToMultiSpring as P, normalizeMultiSpringSchedule as Y } from "./types.js";
5
5
  import { isCssAnimation as zt, isMultiSpring as Dt, isSingleSpring as _t, isTickAnimation as qt, validateAnimationMode as Ht, validateSpringItem as Nt } from "./types.js";
6
- import { j as Ut } from "./jaemin-BWkrXq0V.js";
7
6
  class ot {
8
7
  constructor() {
9
8
  m(this, "listeners", /* @__PURE__ */ new Set());
@@ -831,31 +830,31 @@ function Pt(i) {
831
830
  function It() {
832
831
  b.clear(), T == null || T.disconnect(), T = null, q = !1;
833
832
  }
834
- const O = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map();
833
+ const x = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map();
835
834
  function wt(i, e, t) {
836
- O.set(i, e);
835
+ x.set(i, e);
837
836
  let n = H.get(i);
838
837
  if (n)
839
838
  return n;
840
839
  const r = e;
841
840
  return n = ht(
842
841
  () => {
843
- const s = O.get(i);
842
+ const s = x.get(i);
844
843
  return s || (console.warn(`Transition "${String(i)}" not found`), {});
845
844
  },
846
845
  {
847
846
  strategy: t == null ? void 0 : t.strategy,
848
847
  scope: t == null ? void 0 : t.scope,
849
848
  onCleanupEnd: () => {
850
- O.get(i) === r && yt(i);
849
+ x.get(i) === r && yt(i);
851
850
  }
852
851
  }
853
852
  ), H.set(i, n), n;
854
853
  }
855
854
  function yt(i) {
856
- O.delete(i), H.delete(i), N.delete(i);
855
+ x.delete(i), H.delete(i), N.delete(i);
857
856
  }
858
- function xt(i, e = "manual") {
857
+ function Ot(i, e = "manual") {
859
858
  const t = wt(
860
859
  i.key,
861
860
  {
@@ -961,7 +960,7 @@ function Et() {
961
960
  getScrollPosition: (f) => f && t.has(f) ? t.get(f) : { x: 0, y: 0 }
962
961
  };
963
962
  }
964
- function x(i, e) {
963
+ function O(i, e) {
965
964
  if (e === "*")
966
965
  return !0;
967
966
  if (e.endsWith("/*")) {
@@ -972,14 +971,14 @@ function x(i, e) {
972
971
  }
973
972
  function Tt(i, e, t) {
974
973
  for (const n of t)
975
- if (x(i, n.from) && x(e, n.to))
974
+ if (O(i, n.from) && O(e, n.to))
976
975
  return n.transition;
977
976
  for (const n of t)
978
- if ((n.from === "*" || x(i, n.from)) && (n.to === "*" || x(e, n.to)))
977
+ if ((n.from === "*" || O(i, n.from)) && (n.to === "*" || O(e, n.to)))
979
978
  return n.transition;
980
979
  return null;
981
980
  }
982
- function Ot(i, e) {
981
+ function xt(i, e) {
983
982
  const {
984
983
  transitions: t = [],
985
984
  defaultTransition: n,
@@ -1063,7 +1062,7 @@ export {
1063
1062
  Z as TRANSITION_STRATEGY,
1064
1063
  ut as createDefaultStrategy,
1065
1064
  ft as createPageTransitionStrategy,
1066
- Ot as createSggoiTransitionContext,
1065
+ xt as createSggoiTransitionContext,
1067
1066
  Vt as createTransitionScope,
1068
1067
  mt as findScope,
1069
1068
  Rt as getWatchedCount,
@@ -1073,11 +1072,10 @@ export {
1073
1072
  _t as isSingleSpring,
1074
1073
  qt as isTickAnimation,
1075
1074
  Mt as isWatched,
1076
- Ut as jaeminInternal,
1077
1075
  Y as normalizeMultiSpringSchedule,
1078
1076
  P as normalizeToMultiSpring,
1079
1077
  It as resetObserver,
1080
- xt as transition,
1078
+ Ot as transition,
1081
1079
  Pt as triggerUnmount,
1082
1080
  Ht as validateAnimationMode,
1083
1081
  Nt as validateSpringItem,
@@ -1,13 +1,10 @@
1
- import { Transition, TransitionKey } from '../types';
1
+ import { SpringConfig, Transition, TransitionKey } from '../types';
2
2
  interface BlurOptions {
3
3
  amount?: number | string;
4
4
  opacity?: number;
5
5
  scale?: boolean;
6
6
  fade?: boolean;
7
- spring?: {
8
- stiffness?: number;
9
- damping?: number;
10
- };
7
+ spring?: Partial<SpringConfig>;
11
8
  key?: TransitionKey;
12
9
  }
13
10
  export declare const blur: (options?: BlurOptions) => Transition;
@@ -1 +1 @@
1
- {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/blur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvE,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,UA+ChD,CAAC"}
1
+ {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/blur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,UAgDhD,CAAC"}
@@ -1,14 +1,11 @@
1
- import { Transition, TransitionKey } from '../types';
1
+ import { SpringConfig, Transition, TransitionKey } from '../types';
2
2
  interface BounceOptions {
3
3
  height?: number;
4
4
  intensity?: number;
5
5
  scale?: boolean;
6
6
  fade?: boolean;
7
7
  direction?: "up" | "down";
8
- spring?: {
9
- stiffness?: number;
10
- damping?: number;
11
- };
8
+ spring?: Partial<SpringConfig>;
12
9
  key?: TransitionKey;
13
10
  }
14
11
  export declare const bounce: (options?: BounceOptions) => Transition;
@@ -1 +1 @@
1
- {"version":3,"file":"bounce.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/bounce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvE,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,UAwDpD,CAAC"}
1
+ {"version":3,"file":"bounce.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/bounce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,MAAM,GAAI,UAAS,aAAkB,KAAG,UAyDpD,CAAC"}
@@ -1,11 +1,8 @@
1
- import { Transition, TransitionKey } from '../types';
1
+ import { SpringConfig, Transition, TransitionKey } from '../types';
2
2
  interface FadeOptions {
3
3
  from?: number;
4
4
  to?: number;
5
- spring?: {
6
- stiffness?: number;
7
- damping?: number;
8
- };
5
+ spring?: Partial<SpringConfig>;
9
6
  key?: TransitionKey;
10
7
  }
11
8
  export declare const fade: (options?: FadeOptions) => Transition;
@@ -1 +1 @@
1
- {"version":3,"file":"fade.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/fade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvE,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,UAuBhD,CAAC"}
1
+ {"version":3,"file":"fade.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/fade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,UAwBhD,CAAC"}
@@ -1,12 +1,9 @@
1
- import { Transition, TransitionKey } from '../types';
1
+ import { SpringConfig, Transition, TransitionKey } from '../types';
2
2
  interface FlyOptions {
3
3
  x?: number | string;
4
4
  y?: number | string;
5
5
  opacity?: number;
6
- spring?: {
7
- stiffness?: number;
8
- damping?: number;
9
- };
6
+ spring?: Partial<SpringConfig>;
10
7
  key?: TransitionKey;
11
8
  }
12
9
  export declare const fly: (options?: FlyOptions) => Transition;
@@ -1 +1 @@
1
- {"version":3,"file":"fly.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/fly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvE,UAAU,UAAU;IAClB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,GAAG,GAAI,UAAS,UAAe,KAAG,UA2C9C,CAAC"}
1
+ {"version":3,"file":"fly.d.ts","sourceRoot":"","sources":["../../src/lib/transitions/fly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,UAAU,UAAU;IAClB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,aAAa,CAAC;CACrB;AAED,eAAO,MAAM,GAAG,GAAI,UAAS,UAAe,KAAG,UA4C9C,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=($={})=>{const{from:t=0,to:c=1,spring:n,key:a}=$,s={stiffness:(n==null?void 0:n.stiffness)??300,damping:(n==null?void 0:n.damping)??30};return{in:()=>({spring:s,css:e=>({opacity:t+(c-t)*e})}),out:()=>({spring:s,css:e=>({opacity:t+(c-t)*e})}),...a&&{key:a}}},k=($={})=>{const{start:t=0,opacity:c=0,axis:n="both",spring:a,key:s}=$,e={stiffness:(a==null?void 0:a.stiffness)??300,damping:(a==null?void 0:a.damping)??30},l=r=>{switch(n){case"x":return`scaleX(${r})`;case"y":return`scaleY(${r})`;case"both":default:return`scale(${r})`}},o=r=>{const f=t+(1-t)*r;return{transform:l(f),opacity:c+(1-c)*r}};return{in:()=>({spring:e,css:o}),out:()=>({spring:e,css:o}),...s&&{key:s}}},w=($={})=>{const{direction:t,distance:c=100,opacity:n=0,fade:a=!0,axis:s,spring:e,key:l}=$,o={stiffness:(e==null?void 0:e.stiffness)??400,damping:(e==null?void 0:e.damping)??35},f=t||(s==="x"?"left":s==="y"?"up":"left"),i=y=>{const u=1-y;if(typeof c=="number"){const d=u*c;switch(f){case"left":return`translate3d(${-d}px, 0, 0)`;case"right":return`translate3d(${d}px, 0, 0)`;case"up":return`translate3d(0, ${-d}px, 0)`;case"down":return`translate3d(0, ${d}px, 0)`}}else switch(f){case"left":return`translate3d(calc(-1 * ${c} * ${u}), 0, 0)`;case"right":return`translate3d(calc(${c} * ${u}), 0, 0)`;case"up":return`translate3d(0, calc(-1 * ${c} * ${u}), 0)`;case"down":return`translate3d(0, calc(${c} * ${u}), 0)`}},m=y=>{const u={transform:i(y)};return a&&(u.opacity=n+(1-n)*y),u};return{in:()=>({spring:o,css:m}),out:()=>({spring:o,css:m}),...l&&{key:l}}},C=($={})=>{const{degrees:t=360,clockwise:c=!0,scale:n=!1,fade:a=!0,origin:s="center",axis:e="2d",perspective:l=800,spring:o,key:r}=$,f={stiffness:(o==null?void 0:o.stiffness)??500,damping:(o==null?void 0:o.damping)??25},i=c?t:-t,m=u=>{const d=(1-u)*i;switch(e){case"x":return`perspective(${l}px) rotateX(${d}deg)`;case"y":return`perspective(${l}px) rotateY(${d}deg)`;case"z":return`rotateZ(${d}deg)`;case"2d":default:return`rotate(${d}deg)`}},y=u=>{const d={},p=[m(u)];return n&&p.push(`scale(${u})`),d.transform=p.join(" "),d.transformOrigin=s,a&&(d.opacity=u),d};return{in:()=>({spring:f,css:y}),out:()=>({spring:f,css:y}),...r&&{key:r}}},M=($={})=>{const{height:t=20,intensity:c=1,scale:n=!0,fade:a=!0,direction:s="up",spring:e,key:l}=$,o={stiffness:(e==null?void 0:e.stiffness)??800,damping:(e==null?void 0:e.damping)??15},r=f=>{const i={},m=[],y=Math.sin(f*Math.PI*(1+c)),u=1-f,d=y*t*u;if(s==="up"?m.push(`translateY(${-Math.abs(d)}px)`):m.push(`translateY(${Math.abs(d)}px)`),n){const p=.8+f*.2+y*.05*u;m.push(`scale(${p})`)}return i.transform=m.join(" "),a&&(i.opacity=f),i};return{in:()=>({spring:o,css:r}),out:()=>({spring:o,css:r}),...l&&{key:l}}},P=($={})=>{const{amount:t=10,opacity:c=0,scale:n=!1,fade:a=!0,spring:s,key:e}=$,l={stiffness:(s==null?void 0:s.stiffness)??300,damping:(s==null?void 0:s.damping)??30},o=r=>{const f=1-r,i={};return typeof t=="number"?i.filter=`blur(${f*t}px)`:i.filter=`blur(calc(${t} * ${f}))`,n&&(i.transform=`scale(${.8+r*.2})`),a&&(i.opacity=c+(1-c)*r),i};return{in:()=>({spring:l,css:o}),out:()=>({spring:l,css:o}),...e&&{key:e}}},S=($={})=>{const{x:t=0,y:c=-100,opacity:n=0,spring:a,key:s}=$,e={stiffness:(a==null?void 0:a.stiffness)??400,damping:(a==null?void 0:a.damping)??35},l=o=>{const r=1-o;let f,i;return typeof t=="number"?f=`${r*t}px`:f=`calc(${t} * ${r})`,typeof c=="number"?i=`${r*c}px`:i=`calc(${c} * ${r})`,{transform:`translate3d(${f}, ${i}, 0)`,opacity:n+(1-n)*o}};return{in:()=>({spring:e,css:l}),out:()=>({spring:e,css:l}),...s&&{key:s}}},z=($={})=>{const{shape:t="circle",origin:c="center",scale:n=1.5,fade:a=!1,spring:s,key:e}=$,l={stiffness:(s==null?void 0:s.stiffness)??300,damping:(s==null?void 0:s.damping)??30},o=()=>{switch(c){case"top":return"50% 0%";case"bottom":return"50% 100%";case"left":return"0% 50%";case"right":return"100% 50%";case"top-left":return"0% 0%";case"top-right":return"100% 0%";case"bottom-left":return"0% 100%";case"bottom-right":return"100% 100%";case"center":default:return"50% 50%"}},r=i=>{const m=i*n*100,y=o();switch(t){case"ellipse":return`ellipse(${m}% ${m*.75}% at ${y})`;case"square":{const u=i*n*100,[d,p]=y.split(" "),h=parseFloat(d),b=parseFloat(p),g=u/2;return`polygon(${h-g}% ${b-g}%, ${h+g}% ${b-g}%, ${h+g}% ${b+g}%, ${h-g}% ${b+g}%)`}case"circle":default:return`circle(${m}% at ${y})`}},f=i=>{const m={clipPath:r(i)};return a&&(m.opacity=i),m};return{in:()=>({spring:l,css:f}),out:()=>({spring:l,css:f}),...e&&{key:e}}},T=($={})=>{const{spring:t,key:c}=$,n={stiffness:(t==null?void 0:t.stiffness)??1e3,damping:(t==null?void 0:t.damping)??100};return{in:()=>({spring:n,css:()=>({})}),out:()=>({spring:n,css:()=>({})}),...c&&{key:c}}};exports.blur=P;exports.bounce=M;exports.fade=x;exports.fly=S;exports.mask=z;exports.none=T;exports.rotate=C;exports.scale=k;exports.slide=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=($={})=>{const{from:t=0,to:n=1,spring:a,key:c}=$,s={stiffness:(a==null?void 0:a.stiffness)??300,damping:(a==null?void 0:a.damping)??30,doubleSpring:(a==null?void 0:a.doubleSpring)??!1};return{in:()=>({spring:s,css:e=>({opacity:t+(n-t)*e})}),out:()=>({spring:s,css:e=>({opacity:t+(n-t)*e})}),...c&&{key:c}}},p=($={})=>{const{start:t=0,opacity:n=0,axis:a="both",spring:c,key:s}=$,e={stiffness:(c==null?void 0:c.stiffness)??300,damping:(c==null?void 0:c.damping)??30,doubleSpring:(c==null?void 0:c.doubleSpring)??!1},f=l=>{switch(a){case"x":return`scaleX(${l})`;case"y":return`scaleY(${l})`;case"both":default:return`scale(${l})`}},r=l=>{const u=t+(1-t)*l;return{transform:f(u),opacity:n+(1-n)*l}};return{in:()=>({spring:e,css:r}),out:()=>({spring:e,css:r}),...s&&{key:s}}},k=($={})=>{const{direction:t,distance:n=100,opacity:a=0,fade:c=!0,axis:s,spring:e,key:f}=$,r={stiffness:(e==null?void 0:e.stiffness)??400,damping:(e==null?void 0:e.damping)??35,doubleSpring:(e==null?void 0:e.doubleSpring)??!1},u=t||(s==="x"?"left":s==="y"?"up":"left"),o=y=>{const i=1-y;if(typeof n=="number"){const d=i*n;switch(u){case"left":return`translate3d(${-d}px, 0, 0)`;case"right":return`translate3d(${d}px, 0, 0)`;case"up":return`translate3d(0, ${-d}px, 0)`;case"down":return`translate3d(0, ${d}px, 0)`}}else switch(u){case"left":return`translate3d(calc(-1 * ${n} * ${i}), 0, 0)`;case"right":return`translate3d(calc(${n} * ${i}), 0, 0)`;case"up":return`translate3d(0, calc(-1 * ${n} * ${i}), 0)`;case"down":return`translate3d(0, calc(${n} * ${i}), 0)`}},m=y=>{const i={transform:o(y)};return c&&(i.opacity=a+(1-a)*y),i};return{in:()=>({spring:r,css:m}),out:()=>({spring:r,css:m}),...f&&{key:f}}},w=($={})=>{const{degrees:t=360,clockwise:n=!0,scale:a=!1,fade:c=!0,origin:s="center",axis:e="2d",perspective:f=800,spring:r,key:l}=$,u={stiffness:(r==null?void 0:r.stiffness)??500,damping:(r==null?void 0:r.damping)??25,doubleSpring:(r==null?void 0:r.doubleSpring)??!1},o=n?t:-t,m=i=>{const d=(1-i)*o;switch(e){case"x":return`perspective(${f}px) rotateX(${d}deg)`;case"y":return`perspective(${f}px) rotateY(${d}deg)`;case"z":return`rotateZ(${d}deg)`;case"2d":default:return`rotate(${d}deg)`}},y=i=>{const d={},g=[m(i)];return a&&g.push(`scale(${i})`),d.transform=g.join(" "),d.transformOrigin=s,c&&(d.opacity=i),d};return{in:()=>({spring:u,css:y}),out:()=>({spring:u,css:y}),...l&&{key:l}}},C=($={})=>{const{height:t=20,intensity:n=1,scale:a=!0,fade:c=!0,direction:s="up",spring:e,key:f}=$,r={stiffness:(e==null?void 0:e.stiffness)??800,damping:(e==null?void 0:e.damping)??15,doubleSpring:(e==null?void 0:e.doubleSpring)??!1},l=u=>{const o={},m=[],y=Math.sin(u*Math.PI*(1+n)),i=1-u,d=y*t*i;if(s==="up"?m.push(`translateY(${-Math.abs(d)}px)`):m.push(`translateY(${Math.abs(d)}px)`),a){const g=.8+u*.2+y*.05*i;m.push(`scale(${g})`)}return o.transform=m.join(" "),c&&(o.opacity=u),o};return{in:()=>({spring:r,css:l}),out:()=>({spring:r,css:l}),...f&&{key:f}}},M=($={})=>{const{amount:t=10,opacity:n=0,scale:a=!1,fade:c=!0,spring:s,key:e}=$,f={stiffness:(s==null?void 0:s.stiffness)??300,damping:(s==null?void 0:s.damping)??30,doubleSpring:(s==null?void 0:s.doubleSpring)??!1},r=l=>{const u=1-l,o={};return typeof t=="number"?o.filter=`blur(${u*t}px)`:o.filter=`blur(calc(${t} * ${u}))`,a&&(o.transform=`scale(${.8+l*.2})`),c&&(o.opacity=n+(1-n)*l),o};return{in:()=>({spring:f,css:r}),out:()=>({spring:f,css:r}),...e&&{key:e}}},P=($={})=>{const{x:t=0,y:n=-100,opacity:a=0,spring:c,key:s}=$,e={stiffness:(c==null?void 0:c.stiffness)??400,damping:(c==null?void 0:c.damping)??35,doubleSpring:(c==null?void 0:c.doubleSpring)??!1},f=r=>{const l=1-r;let u,o;return typeof t=="number"?u=`${l*t}px`:u=`calc(${t} * ${l})`,typeof n=="number"?o=`${l*n}px`:o=`calc(${n} * ${l})`,{transform:`translate3d(${u}, ${o}, 0)`,opacity:a+(1-a)*r}};return{in:()=>({spring:e,css:f}),out:()=>({spring:e,css:f}),...s&&{key:s}}},z=($={})=>{const{shape:t="circle",origin:n="center",scale:a=1.5,fade:c=!1,spring:s,key:e}=$,f={stiffness:(s==null?void 0:s.stiffness)??300,damping:(s==null?void 0:s.damping)??30,doubleSpring:(s==null?void 0:s.doubleSpring)??!1},r=()=>{switch(n){case"top":return"50% 0%";case"bottom":return"50% 100%";case"left":return"0% 50%";case"right":return"100% 50%";case"top-left":return"0% 0%";case"top-right":return"100% 0%";case"bottom-left":return"0% 100%";case"bottom-right":return"100% 100%";case"center":default:return"50% 50%"}},l=o=>{const m=o*a*100,y=r();switch(t){case"ellipse":return`ellipse(${m}% ${m*.75}% at ${y})`;case"square":{const i=o*a*100,[d,g]=y.split(" "),h=parseFloat(d),S=parseFloat(g),b=i/2;return`polygon(${h-b}% ${S-b}%, ${h+b}% ${S-b}%, ${h+b}% ${S+b}%, ${h-b}% ${S+b}%)`}case"circle":default:return`circle(${m}% at ${y})`}},u=o=>{const m={clipPath:l(o)};return c&&(m.opacity=o),m};return{in:()=>({spring:f,css:u}),out:()=>({spring:f,css:u}),...e&&{key:e}}},T=($={})=>{const{spring:t,key:n}=$,a={stiffness:(t==null?void 0:t.stiffness)??1e3,damping:(t==null?void 0:t.damping)??100,doubleSpring:(t==null?void 0:t.doubleSpring)??!1};return{in:()=>({spring:a,css:()=>({})}),out:()=>({spring:a,css:()=>({})}),...n&&{key:n}}};exports.blur=M;exports.bounce=C;exports.fade=x;exports.fly=P;exports.mask=z;exports.none=T;exports.rotate=w;exports.scale=p;exports.slide=k;