@ssgoi/core 6.2.0 → 6.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Yt=Object.defineProperty;var kt=(e,t,n)=>t in e?Yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $=(e,t,n)=>kt(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./multi-animation-Dw2JTJI2.cjs");function T(e,t){const n=[];for(let s=0;s<e.length;s++)for(let o=s+1;o<e.length;o++){const i=e[s],r=e[o];!i||!r||n.push({from:i,to:r,transition:t(),symmetric:!0})}return n}function _t(e,t){return[{from:e.exit,to:e.enter,transition:t("enter")},{from:e.enter,to:e.exit,transition:t("exit")}]}function lt(e,t,n){const s=[];for(let o=0;o<e.length;o++)for(let i=o+1;i<e.length;i++){const r=e[o],c=e[i];!r||!c||s.push({from:r,to:c,transition:n(t.forward)},{from:c,to:r,transition:n(t.backward)})}return s}class N{constructor(t){$(this,"omega");$(this,"zeta");$(this,"restDelta");$(this,"restSpeed");const{stiffness:n,damping:s}=t,o=1;this.omega=Math.sqrt(n/o),this.zeta=s/(2*Math.sqrt(n*o)),this.restDelta=t.restDelta??h.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??h.VELOCITY_THRESHOLD}step(t,n,s){const o=Math.min(s,.033),{omega:i,zeta:r}=this,{position:c,velocity:l}=t,a=-2*o*r*i*l,p=o*i*i*(n-c),f=l+a+p;return{position:c+o*f,velocity:f}}isSettled(t,n){const s=Math.abs(n-t.position),o=Math.abs(t.velocity);return s<this.restDelta&&o<this.restSpeed}}class Mt{constructor(t){$(this,"leader");$(this,"follower");$(this,"restDelta");$(this,"restSpeed");this.restDelta=t.restDelta??h.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??h.VELOCITY_THRESHOLD,this.leader=new N({stiffness:t.stiffness,damping:t.damping,restDelta:this.restDelta,restSpeed:this.restSpeed});let n,s,o,i;typeof t.follower=="number"?(n=t.stiffness*t.follower,s=t.damping):t.follower?(n=t.follower.stiffness,s=t.follower.damping,o=t.follower.restDelta,i=t.follower.restSpeed):(n=t.stiffness,s=t.damping),this.follower=new N({stiffness:n,damping:s,restDelta:o??this.restDelta,restSpeed:i??this.restSpeed})}step(t,n,s){const i=t._leader??{position:t.position,velocity:t.velocity},r=this.leader.step(i,n,s),c=this.follower.step(t,r.position,s);return{position:c.position,velocity:c.velocity,_leader:r}}isSettled(t,n){const s=t,o=Math.abs(n-t.position)<this.restDelta&&Math.abs(t.velocity)<this.restSpeed;return s._leader?Math.abs(n-s._leader.position)<this.restDelta&&Math.abs(s._leader.velocity)<this.restSpeed&&o:o}}const Ht=.01,Wt=500,Ut=10;class zt{constructor(t){$(this,"acceleration");$(this,"resistance");$(this,"resistanceType");$(this,"min");$(this,"max");$(this,"bounceStiffness");$(this,"bounceDamping");$(this,"restDelta");this.acceleration=t.acceleration,this.resistance=t.resistance,this.resistanceType=t.resistanceType??"quadratic",this.min=t.min,this.max=t.max,this.bounceStiffness=t.bounceStiffness??Wt,this.bounceDamping=t.bounceDamping??Ut,this.restDelta=t.restDelta??Ht}step(t,n,s){const o=Math.min(s,.033),{acceleration:i,resistance:r,resistanceType:c,min:l,max:a}=this,{position:p,velocity:f}=t,m=l!==void 0&&p<l,u=a!==void 0&&p>a;let d;if(m||u){const w=p-(m?l:a),E=-this.bounceStiffness*w,C=-this.bounceDamping*f;d=E+C}else{const S=n>p?1:-1;let w;c==="linear"?w=r*f:w=r*f*Math.abs(f),d=S*i-w}const y=f+d*o;let g=p+y*o;if(!m&&!u){const S=n>p?1:-1;(S>0&&g>n||S<0&&g<n)&&(g=n)}return{position:g,velocity:g===n?0:y}}isSettled(t,n){return Math.abs(n-t.position)<this.restDelta}}class b{static from(t){if(t.spring&&t.inertia)throw new Error("Cannot use both 'spring' and 'inertia' together. Choose one physics type.");if(t.inertia)return new zt({acceleration:t.inertia.acceleration,resistance:t.inertia.resistance,resistanceType:t.inertia.resistanceType,min:t.inertia.min,max:t.inertia.max,bounceStiffness:t.inertia.bounceStiffness,bounceDamping:t.inertia.bounceDamping,restDelta:t.inertia.restDelta});const n=t.spring??{stiffness:300,damping:30};if(n.doubleSpring){const s=n.doubleSpring;let o;return typeof s=="number"?o=s:typeof s=="object"&&(o={stiffness:s.stiffness,damping:s.damping}),new Mt({stiffness:n.stiffness,damping:n.damping,follower:o,restDelta:n.restDelta,restSpeed:n.restSpeed})}return new N({stiffness:n.stiffness,damping:n.damping,restDelta:n.restDelta,restSpeed:n.restSpeed})}static fromSpring(t){return b.from({spring:t})}}class Xt{constructor(t){$(this,"durationSec");this.durationSec=Math.max(1/60,t.durationSec)}step(t,n,s){const o=n-t.position;if(o===0)return t;const i=Math.sign(o),r=Math.abs(o)/this.durationSec,c=i*r*s,l=t.position+c;return(i>0?l>=n:l<=n)?{position:n,velocity:0}:{position:l,velocity:i*r}}isSettled(t,n){return Math.abs(t.position-n)<h.POSITION_THRESHOLD}}const ct=8,pt={spring:{stiffness:1e3,damping:40,doubleSpring:1.2}};function Nt({direction:e}){const t=e==="forward"?ct:-ct;return{out:{willChange:"transform, opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${t}px, 0, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(${t*(1-n)}px, 0, 0)`,opacity:`${n}`})}}}function Vt(){return{outPhysics:pt,inPhysics:pt,composition:{mode:"parallel",startAt:[0,0]},build:Nt}}const ft=30,Bt={inertia:{acceleration:150,resistance:1.5}},Rt={spring:{stiffness:180,damping:34}};function qt({direction:e}){const t=e==="forward"?1:-1,n=-ft*t,s=ft*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:o=>({transform:`translate3d(${n*o}px, 0, 0)`,opacity:`${1-o}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${s}px, 0, 0)`,opacity:"0"},animate:o=>({transform:`translate3d(${s*(1-o)}px, 0, 0)`,opacity:`${o}`})}}}function Zt(){return{outPhysics:Bt,inPhysics:Rt,composition:{mode:"sequence"},build:qt}}const jt={snappy:Vt(),fluid:Zt()},dt=8,Kt={inertia:{acceleration:150,resistance:1.5}},Gt={spring:{stiffness:180,damping:34}};function Jt({direction:e}){const t=e==="forward"?1:-1,n=-dt*t,s=dt*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:o=>({transform:`translate3d(0, ${n*o}px, 0)`,opacity:`${1-o}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${s}px, 0)`,opacity:"0"},animate:o=>({transform:`translate3d(0, ${s*(1-o)}px, 0)`,opacity:`${o}`})}}}function Qt(){return{outPhysics:Kt,inPhysics:Gt,composition:{mode:"sequence"},build:Jt}}const te=8,ee={inertia:{acceleration:150,resistance:1.5}},ne={spring:{stiffness:180,damping:34}};function se(e){const t=te;return{out:{willChange:"opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${t}px, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(0, ${t*(1-n)}px, 0)`,opacity:`${n}`})}}}function oe(){return{outPhysics:ee,inPhysics:ne,composition:{mode:"sequence"},build:se}}const mt=Qt(),ie={snappy:mt,directional:mt,"non-directional":oe()},ht={spring:{stiffness:280,damping:30}},U=.05;function re(){return{out:{willChange:"transform, opacity",startStyle:{},animate:e=>({transform:`scale(${1+e*U})`,opacity:`${1-e}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${1-U})`,opacity:"0"},animate:e=>({transform:`scale(${1-U+e*U})`,opacity:`${e}`})}}}function ae(){return{outPhysics:ht,inPhysics:ht,composition:{mode:"parallel"},build:re}}const le=ae(),ce={x:jt,y:ie,z:{snappy:le}};function pe(e,t){const n=ce[e];return n[t]??n.snappy}const fe="x",de="snappy";function yt(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,s]of Object.entries(t.startStyle))e.style[n]=s}function me(e){e.style.willChange="auto",e.style.backfaceVisibility="",e.style.contain="",e.style.transform="",e.style.opacity=""}const he=(e={})=>{const t=e.direction??"forward",n=e.type??fe,s=e.feel??de,o=pe(n,s),i=o.build({direction:t});return{prepare:({from:r,to:c})=>(r.then(l=>{yt(l,i.out),l.style.pointerEvents="none"}),c.then(l=>{yt(l,i.in)}),{}),animation:({from:r,to:c})=>{const l=new h.WebAnimation({element:r,integrator:b.from(o.outPhysics),style:p=>i.out.animate(p)}),a=new h.WebAnimation({element:c,integrator:b.from(o.inPhysics),style:p=>i.in.animate(p),onComplete:()=>me(c)});return new h.MultiAnimation([l,a],o.composition)}}};function ye(e,t,n){return e==="y"?t==="non-directional"?"non-directional":"directional":e!=="x"||t==="snappy"||n==="snappy"?"snappy":"fluid"}function ue(e){const{paths:t}=e,n=e.type??"x",s=e.variant,o=e.feel,i=ye(n,s,o);return lt(t,{forward:"forward",backward:"backward"},r=>he({type:n,direction:r,feel:i}))}const ge={spring:{stiffness:200,damping:22}},be=10,we="horizontal",Se="#000000";function ut(e,t,n,s,o,i){window.getComputedStyle(e).position==="static"&&(e.style.position="relative");const c=document.createElement("div");c.style.cssText=`
1
+ "use strict";var Yt=Object.defineProperty;var kt=(e,t,n)=>t in e?Yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $=(e,t,n)=>kt(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./multi-animation-Dw2JTJI2.cjs");function T(e,t){const n=[];for(let s=0;s<e.length;s++)for(let o=s+1;o<e.length;o++){const i=e[s],r=e[o];!i||!r||n.push({from:i,to:r,transition:t(),symmetric:!0})}return n}function _t(e,t){return[{from:e.exit,to:e.enter,transition:t("enter")},{from:e.enter,to:e.exit,transition:t("exit")}]}function lt(e,t,n){const s=[];for(let o=0;o<e.length;o++)for(let i=o+1;i<e.length;i++){const r=e[o],c=e[i];!r||!c||s.push({from:r,to:c,transition:n(t.forward)},{from:c,to:r,transition:n(t.backward)})}return s}class N{constructor(t){$(this,"omega");$(this,"zeta");$(this,"restDelta");$(this,"restSpeed");const{stiffness:n,damping:s}=t,o=1;this.omega=Math.sqrt(n/o),this.zeta=s/(2*Math.sqrt(n*o)),this.restDelta=t.restDelta??h.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??h.VELOCITY_THRESHOLD}step(t,n,s){const o=Math.min(s,.033),{omega:i,zeta:r}=this,{position:c,velocity:l}=t,a=-2*o*r*i*l,p=o*i*i*(n-c),f=l+a+p;return{position:c+o*f,velocity:f}}isSettled(t,n){const s=Math.abs(n-t.position),o=Math.abs(t.velocity);return s<this.restDelta&&o<this.restSpeed}}class Mt{constructor(t){$(this,"leader");$(this,"follower");$(this,"restDelta");$(this,"restSpeed");this.restDelta=t.restDelta??h.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??h.VELOCITY_THRESHOLD,this.leader=new N({stiffness:t.stiffness,damping:t.damping,restDelta:this.restDelta,restSpeed:this.restSpeed});let n,s,o,i;typeof t.follower=="number"?(n=t.stiffness*t.follower,s=t.damping):t.follower?(n=t.follower.stiffness,s=t.follower.damping,o=t.follower.restDelta,i=t.follower.restSpeed):(n=t.stiffness,s=t.damping),this.follower=new N({stiffness:n,damping:s,restDelta:o??this.restDelta,restSpeed:i??this.restSpeed})}step(t,n,s){const i=t._leader??{position:t.position,velocity:t.velocity},r=this.leader.step(i,n,s),c=this.follower.step(t,r.position,s);return{position:c.position,velocity:c.velocity,_leader:r}}isSettled(t,n){const s=t,o=Math.abs(n-t.position)<this.restDelta&&Math.abs(t.velocity)<this.restSpeed;return s._leader?Math.abs(n-s._leader.position)<this.restDelta&&Math.abs(s._leader.velocity)<this.restSpeed&&o:o}}const Ht=.01,Wt=500,Ut=10;class zt{constructor(t){$(this,"acceleration");$(this,"resistance");$(this,"resistanceType");$(this,"min");$(this,"max");$(this,"bounceStiffness");$(this,"bounceDamping");$(this,"restDelta");this.acceleration=t.acceleration,this.resistance=t.resistance,this.resistanceType=t.resistanceType??"quadratic",this.min=t.min,this.max=t.max,this.bounceStiffness=t.bounceStiffness??Wt,this.bounceDamping=t.bounceDamping??Ut,this.restDelta=t.restDelta??Ht}step(t,n,s){const o=Math.min(s,.033),{acceleration:i,resistance:r,resistanceType:c,min:l,max:a}=this,{position:p,velocity:f}=t,m=l!==void 0&&p<l,u=a!==void 0&&p>a;let d;if(m||u){const w=p-(m?l:a),E=-this.bounceStiffness*w,C=-this.bounceDamping*f;d=E+C}else{const S=n>p?1:-1;let w;c==="linear"?w=r*f:w=r*f*Math.abs(f),d=S*i-w}const y=f+d*o;let g=p+y*o;if(!m&&!u){const S=n>p?1:-1;(S>0&&g>n||S<0&&g<n)&&(g=n)}return{position:g,velocity:g===n?0:y}}isSettled(t,n){return Math.abs(n-t.position)<this.restDelta}}class b{static from(t){if(t.spring&&t.inertia)throw new Error("Cannot use both 'spring' and 'inertia' together. Choose one physics type.");if(t.inertia)return new zt({acceleration:t.inertia.acceleration,resistance:t.inertia.resistance,resistanceType:t.inertia.resistanceType,min:t.inertia.min,max:t.inertia.max,bounceStiffness:t.inertia.bounceStiffness,bounceDamping:t.inertia.bounceDamping,restDelta:t.inertia.restDelta});const n=t.spring??{stiffness:300,damping:30};if(n.doubleSpring){const s=n.doubleSpring;let o;return typeof s=="number"?o=s:typeof s=="object"&&(o={stiffness:s.stiffness,damping:s.damping}),new Mt({stiffness:n.stiffness,damping:n.damping,follower:o,restDelta:n.restDelta,restSpeed:n.restSpeed})}return new N({stiffness:n.stiffness,damping:n.damping,restDelta:n.restDelta,restSpeed:n.restSpeed})}static fromSpring(t){return b.from({spring:t})}}class Xt{constructor(t){$(this,"durationSec");this.durationSec=Math.max(1/60,t.durationSec)}step(t,n,s){const o=n-t.position;if(o===0)return t;const i=Math.sign(o),r=Math.abs(o)/this.durationSec,c=i*r*s,l=t.position+c;return(i>0?l>=n:l<=n)?{position:n,velocity:0}:{position:l,velocity:i*r}}isSettled(t,n){return Math.abs(t.position-n)<h.POSITION_THRESHOLD}}const ct=8,pt={spring:{stiffness:1e3,damping:40,doubleSpring:1.2}};function Nt({direction:e}){const t=e==="forward"?ct:-ct;return{out:{willChange:"transform, opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${t}px, 0, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(${t*(1-n)}px, 0, 0)`,opacity:`${n}`})}}}function Vt(){return{outPhysics:pt,inPhysics:pt,composition:{mode:"parallel",startAt:[0,0]},build:Nt}}const ft=30,Bt={inertia:{acceleration:150,resistance:1.5}},Rt={spring:{stiffness:180,damping:34}};function Zt({direction:e}){const t=e==="forward"?1:-1,n=-ft*t,s=ft*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:o=>({transform:`translate3d(${n*o}px, 0, 0)`,opacity:`${1-o}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${s}px, 0, 0)`,opacity:"0"},animate:o=>({transform:`translate3d(${s*(1-o)}px, 0, 0)`,opacity:`${o}`})}}}function qt(){return{outPhysics:Bt,inPhysics:Rt,composition:{mode:"sequence"},build:Zt}}const jt={snappy:Vt(),fluid:qt()},dt=8,Kt={inertia:{acceleration:150,resistance:1.5}},Gt={spring:{stiffness:180,damping:34}};function Jt({direction:e}){const t=e==="forward"?1:-1,n=-dt*t,s=dt*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:o=>({transform:`translate3d(0, ${n*o}px, 0)`,opacity:`${1-o}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${s}px, 0)`,opacity:"0"},animate:o=>({transform:`translate3d(0, ${s*(1-o)}px, 0)`,opacity:`${o}`})}}}function Qt(){return{outPhysics:Kt,inPhysics:Gt,composition:{mode:"sequence"},build:Jt}}const te=8,ee={inertia:{acceleration:150,resistance:1.5}},ne={spring:{stiffness:180,damping:34}};function se(e){const t=te;return{out:{willChange:"opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${t}px, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(0, ${t*(1-n)}px, 0)`,opacity:`${n}`})}}}function oe(){return{outPhysics:ee,inPhysics:ne,composition:{mode:"sequence"},build:se}}const mt=Qt(),ie={snappy:mt,directional:mt,"non-directional":oe()},ht={spring:{stiffness:280,damping:30}},U=.05;function re(){return{out:{willChange:"transform, opacity",startStyle:{},animate:e=>({transform:`scale(${1+e*U})`,opacity:`${1-e}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${1-U})`,opacity:"0"},animate:e=>({transform:`scale(${1-U+e*U})`,opacity:`${e}`})}}}function ae(){return{outPhysics:ht,inPhysics:ht,composition:{mode:"parallel"},build:re}}const le=ae(),ce={x:jt,y:ie,z:{snappy:le}};function pe(e,t){const n=ce[e];return n[t]??n.snappy}const fe="x",de="snappy";function yt(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,s]of Object.entries(t.startStyle))e.style[n]=s}function me(e){e.style.willChange="auto",e.style.backfaceVisibility="",e.style.contain="",e.style.transform="",e.style.opacity=""}const he=(e={})=>{const t=e.direction??"forward",n=e.type??fe,s=e.feel??de,o=pe(n,s),i=o.build({direction:t});return{prepare:({from:r,to:c})=>(r.then(l=>{yt(l,i.out),l.style.pointerEvents="none"}),c.then(l=>{yt(l,i.in)}),{}),animation:({from:r,to:c})=>{const l=new h.WebAnimation({element:r,integrator:b.from(o.outPhysics),style:p=>i.out.animate(p)}),a=new h.WebAnimation({element:c,integrator:b.from(o.inPhysics),style:p=>i.in.animate(p),onComplete:()=>me(c)});return new h.MultiAnimation([l,a],o.composition)}}};function ye(e,t,n){return e==="y"?t==="non-directional"?"non-directional":"directional":e!=="x"||t==="snappy"||n==="snappy"?"snappy":"fluid"}function ue(e){const{paths:t}=e,n=e.type??"x",s=e.variant,o=e.feel,i=ye(n,s,o);return lt(t,{forward:"forward",backward:"backward"},r=>he({type:n,direction:r,feel:i}))}const ge={spring:{stiffness:200,damping:22}},be=10,we="horizontal",Se="#000000";function ut(e,t,n,s,o,i){window.getComputedStyle(e).position==="static"&&(e.style.position="relative");const c=document.createElement("div");c.style.cssText=`
2
2
  position: absolute;
3
3
  top: 0;
4
4
  left: 0;
@@ -32,4 +32,4 @@
32
32
  ${t.left+t.width}px ${t.top}px,
33
33
  ${t.left+t.width}px ${t.top+t.height}px,
34
34
  ${t.left}px ${t.top+t.height}px
35
- )`}function nt(e,t,n,s,o){const i=n/1e3;return new h.WebAnimation({element:e,integrator:new Xt({durationSec:i}),lowerBound:0,upperBound:1,style:r=>s(Xe(t,r)),onComplete:o})}const Be=(e={})=>{var o;const t=((o=e.border)==null?void 0:o.color)??We,n=He,s=e.physics;return{prepare:({from:i,to:r,context:c})=>{const l=k(c,"from"),a=k(c,"to"),p=Y(document.body,c.positionedParent),f=Ve(t,{...l,top:p.top});for(const m of["topLeft","topRight","bottomLeft","bottomRight"])c.positionedParent.appendChild(f[m]);return i.then(m=>{St(m,l),xt(m,l),m.style.transform=`translateY(${-l.top}px)`}),r.then(m=>{St(m,a),xt(m,a),m.style.transform=`translateY(${-a.top+a.height}px) scale(${n})`}),{borders:f,fromRect:l,toRect:a}},animation:({from:i,to:r,context:c,borders:l,fromRect:a,toRect:p})=>{const f=wt({rect:a,scale:n,direction:"out",override:s}),m=wt({rect:p,scale:n,direction:"in",override:s}),u=nt(i,f.snapshots,f.totalDuration,w=>({transform:`translateY(${w.translateY}px) scale(${w.scale})`}),()=>{i.style.clipPath="",i.style.transformOrigin=""}),d=nt(r,m.snapshots,m.totalDuration,w=>({transform:`translateY(${w.translateY}px) scale(${w.scale})`}),()=>{r.style.clipPath="",r.style.transformOrigin="",r.style.transform=""}),y=Ne.map(([w,E],C)=>{const O=["topLeft","topRight","bottomLeft","bottomRight"][C];return nt(l[O],f.snapshots,f.totalDuration,v=>{const D=(a.width-a.width*v.scale)/2*.7*w,_=(a.height-a.height*v.scale)/2*.7*E;return{transform:`translate(${D}px, ${_}px)`}})}),g=new h.MultiAnimation([u,d,...y],{mode:"parallel"}),S=g.onComplete;return g.onComplete=()=>{S==null||S();const w=c.positionedParent;for(const E of["topLeft","topRight","bottomLeft","bottomRight"]){const C=l[E];C.parentElement===w&&w.removeChild(C)}},g}}};function Re(e){const{paths:t,options:n}=e,s=(n==null?void 0:n.borderColor)!==void 0?{border:{color:n.borderColor}}:void 0;return T(t,()=>Be(s))}const $t="data-hero-enter-key",Et="data-hero-exit-key",st="data-hero-key";class qe{prepare(t){t.from.then(n=>{n.style.opacity="0"})}}const Ze=()=>new qe;class je{contribute(t){const{from:n,to:s,physics:o,onComplete:i}=t,r=n.style.opacity,c=s.style.opacity,l=n.style.willChange,a=s.style.willChange;return s.style.opacity="0",n.style.willChange="opacity",s.style.willChange="opacity",i(()=>{n.style.opacity=r,s.style.opacity=c,n.style.willChange=l,s.style.willChange=a}),[new h.WebAnimation({element:n,integrator:b.from(o),style:(p,f)=>({opacity:f})}),new h.WebAnimation({element:s,integrator:b.from(o),style:p=>({opacity:p})})]}}const Ke=()=>new je,Ge={static:Ze,fade:Ke},Je={spring:{stiffness:300,damping:30}},Qe=700,tn="data-hero-aspect-ratio";function en(e){if(!e)return null;if(e.includes("/")){const[n,s]=e.split("/"),o=parseFloat(n??""),i=parseFloat(s??"");return!Number.isFinite(o)||!Number.isFinite(i)||i===0?null:o/i}const t=parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function V(e,t){const n=Y(e,t),s=en(t.getAttribute(tn));if(s===null)return{visible:n,bbox:n,letterbox:{top:0,right:0,bottom:0,left:0}};const o=n.width/n.height;let i,r;o>s?(r=n.height,i=r*s):(i=n.width,r=i/s);const c=(n.width-i)/2,l=(n.height-r)/2;return{visible:{left:n.left+c,top:n.top+l,width:i,height:r},bbox:n,letterbox:{top:l,right:c,bottom:l,left:c}}}function z(e,t){const n=new Map,s=e.querySelectorAll(`[${t}]`);for(const o of Array.from(s)){const i=o.getAttribute(t);i&&(n.has(i)||n.set(i,o))}return n}function nn(e,t){const n=[],s=z(t,$t),o=z(e,Et);for(const[c,l]of s){const a=o.get(c);a&&n.push({key:c,fromEl:a,toEl:l})}const i=z(e,$t),r=z(t,Et);for(const[c,l]of i){const a=r.get(c);a&&n.push({key:c,fromEl:l,toEl:a})}return n}function sn(e,t){const n=[],s=Array.from(t.querySelectorAll(`[${st}]`));for(const o of s){const i=o.getAttribute(st);if(!i)continue;const r=e.querySelector(`[${st}="${i}"]`);r&&n.push({key:i,fromEl:r,toEl:o})}return n}function on(e,t){const n=nn(e,t);return n.length>0?n:sn(e,t)}let rn=class{contribute(t){const{from:n,to:s,resolved:o,physics:i,scrollOffset:r,maxDistance:c,onComplete:l}=t,a=[];for(const{fromEl:p,toEl:f}of o.pairs){const m=V(n,p),u=V(s,f),d=m.visible,y=u.visible,g=u.bbox,S=u.letterbox,w=Math.max(d.width/y.width,d.height/y.height),E=d.left+d.width/2,C=d.top+d.height/2,O=g.left+g.width/2,v=g.top+g.height/2,D=E-O-r.x,_=C-v-r.y;if(Math.abs(_)>c)continue;const M=d.width/w,H=d.height/w,x=Math.max(0,(y.width-M)/2),L=Math.max(0,(y.height-H)/2),W=f.style.transform,B=f.style.position,R=f.style.transformOrigin,q=f.style.clipPath,A=f.style.zIndex,Z=f.style.willChange;f.style.position="relative",f.style.transformOrigin="center center",f.style.zIndex="1000",f.style.willChange="transform, clip-path",l(()=>{f.style.transform=W,f.style.position=B,f.style.transformOrigin=R,f.style.clipPath=q,f.style.zIndex=A,f.style.willChange=Z}),a.push(new h.WebAnimation({element:f,integrator:b.from(i),style:(j,P)=>{const K=P*D,G=P*_,J=j+P*w,Q=S.top+P*L,Dt=S.right+P*x,Lt=S.bottom+P*L,Ft=S.left+P*x;return{transform:`translate(${K}px, ${G}px) scale(${J})`,clipPath:`inset(${Q}px ${Dt}px ${Lt}px ${Ft}px)`}}}))}return a}};class an{contribute(t){const{resolved:n,physics:s,positionedParent:o,maxDistance:i,onComplete:r}=t,c=[];for(const{fromEl:l,toEl:a}of n.pairs){const p=V(o,l),f=V(o,a),m=p.visible,u=f.visible,d=f.bbox,y=f.letterbox;if(m.width===0||m.height===0||u.width===0||u.height===0)continue;const g=Math.max(m.width/u.width,m.height/u.height),S=m.left+m.width/2,w=m.top+m.height/2,E=d.left+d.width/2,C=d.top+d.height/2,O=S-E,v=w-C;if(Math.abs(v)>i)continue;const D=m.width/g,_=m.height/g,M=Math.max(0,(u.width-D)/2),H=Math.max(0,(u.height-_)/2),x=a.cloneNode(!0);x.style.position="absolute",x.style.left=`${d.left}px`,x.style.top=`${d.top}px`,x.style.width=`${d.width}px`,x.style.height=`${d.height}px`,x.style.margin="0",x.style.transformOrigin="center center",x.style.zIndex="1000",x.style.willChange="transform, clip-path",x.style.pointerEvents="none",x.style.maxWidth="none",x.style.maxHeight="none";const L=(q,A)=>{const Z=A*O,j=A*v,P=q+A*g,K=y.top+A*H,G=y.right+A*M,J=y.bottom+A*H,Q=y.left+A*M;return{transform:`translate(${Z}px, ${j}px) scale(${P})`,clipPath:`inset(${K}px ${G}px ${J}px ${Q}px)`}},W=L(0,1);x.style.transform=W.transform,x.style.clipPath=W.clipPath,o.appendChild(x);const B=l.style.opacity,R=a.style.opacity;l.style.opacity="0",a.style.opacity="0",r(()=>{l.style.opacity=B,a.style.opacity=R,x.parentElement&&x.parentElement.removeChild(x)}),c.push(new h.WebAnimation({element:x,integrator:b.from(s),style:L}))}return c}}const ln={static:()=>new rn,fade:()=>new an};function cn(e){return[ln[e.type](),Ge[e.type]()]}const pn=e=>{const t=cn(e),n=Je,s=Qe;return{prepare:o=>{var c;const i=Promise.all([o.from,o.to]).then(([l,a])=>({pairs:on(l,a)})),r={from:o.from,to:o.to,resolved:i};for(const l of t)(c=l.prepare)==null||c.call(l,r);return i.then(l=>({resolved:l}))},animation:({from:o,to:i,context:r,resolved:c})=>{if(c.pairs.length===0)return new h.MultiAnimation([],{mode:"parallel"});const l=[],a=d=>{l.push(d)},p={from:o,to:i,resolved:c,physics:n,scrollOffset:r.scrollOffset,positionedParent:r.positionedParent,maxDistance:s,onComplete:a},f=[];for(const d of t)d.contribute&&f.push(...d.contribute(p));if(f.length===0)return new h.MultiAnimation([],{mode:"parallel"});const m=new h.MultiAnimation(f,{mode:"parallel"}),u=m.onComplete;return m.onComplete=()=>{u==null||u();for(const d of l)try{d()}catch(y){console.error("[hero] cleanup error",y)}},m}}};function fn(e){const{paths:t}=e,n=e.type??"static";return e.variant,T(t,()=>pn({type:n}))}const dn={spring:{stiffness:50,damping:30}},mn={spring:{stiffness:80,damping:25}},hn=(e={})=>{const t=e.physics??dn,n=e.initialRotation??45,s=e.initialScale??.01,o=e.rotationTriggerPoint??.8;return{prepare:({from:i,to:r,context:c})=>(i.then(l=>{l.style.opacity="1"}),r.then(l=>{const a=k(c,"to"),p=Math.min(a.width,a.height)*.4;l.style.setProperty("--max-border-radius",`${p}px`),l.style.setProperty("--border-radius-scale","1"),l.style.willChange="transform",l.style.backfaceVisibility="hidden";const f=a.left+a.width/2,m=a.top+a.height/2;l.style.transformOrigin=`${f}px ${m}px`,l.style.position="fixed",l.style.top=`${a.top}px`,l.style.left=`${a.left}px`,l.style.width=`${a.width}px`,l.style.height=`${a.height}px`,l.style.zIndex="1000",l.style.overflow="hidden",l.style.transform=`rotate(${n}deg) scale(${s}) translateZ(0)`,l.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",l.style.opacity="1"}),{}),animation:({from:i,to:r})=>{const c=new h.WebAnimation({element:i,integrator:b.from(mn),style:(a,p)=>({opacity:p})}),l=new h.WebAnimation({element:r,integrator:b.from(t),style:a=>{let p;if(a<=.05)p=s;else if(a<=o){const d=(a-.05)/(o-.05),y=Math.pow(d,9);p=s+(.8-s)*y}else{const d=(a-o)/(1-o);p=.8+.2*(1-Math.pow(1-d,3))}const f=.7;let m;if(a<=f)m=n;else{const d=(a-f)/(1-f),y=1-Math.pow(1-d,2);m=n*(1-y)}let u;if(a<=f)u=1;else{const d=(a-f)/(1-f);u=1-Math.pow(d,.5)}return{transform:`rotate(${m.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,"--border-radius-scale":u.toFixed(4)}},onComplete:()=>{r.style.willChange="",r.style.backfaceVisibility="",r.style.removeProperty("--max-border-radius"),r.style.removeProperty("--border-radius-scale"),r.style.transform="",r.style.transformOrigin="",r.style.position="",r.style.zIndex="",r.style.top="",r.style.left="",r.style.width="",r.style.height="",r.style.overflow="",r.style.borderRadius=""}});return new h.MultiAnimation([c,l],{mode:"parallel"})}}};function yn(e){const{paths:t}=e;return T(t,()=>hn())}const un={spring:{stiffness:100,damping:30}},gn=(e={})=>{const t=e.physics??un;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),s.then(o=>{o.style.opacity="0",o.style.transform="rotate(-180deg)",o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),{}),animation:({from:n,to:s})=>{const o=new h.WebAnimation({element:n,integrator:b.from(t),style:r=>({transform:`rotate(${r*180}deg)`,opacity:r<.5?1:0})}),i=new h.WebAnimation({element:s,integrator:b.from(t),style:(r,c)=>({transform:`rotate(${-c*180}deg)`,opacity:r>.5?1:0}),onComplete:()=>{s.style.willChange="auto",s.style.transform="",s.style.transformOrigin="",s.style.opacity=""}});return new h.MultiAnimation([o,i],{mode:"parallel"})}}};function bn(e){const{paths:t}=e;return T(t,()=>gn())}const wn={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},Ct=(e={})=>{const t=e.direction??"up",n=e.physics??wn,s=t==="up";return{prepare:({from:o,to:i})=>(o.then(r=>{r.style.zIndex=s?"-1":"1",r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}),animation:({from:o,to:i})=>{const r=o.offsetHeight,c=i.offsetHeight,l=window.innerHeight,a=Math.max(Math.min(r,c),l),p=new h.WebAnimation({element:o,integrator:b.from(n),style:m=>({transform:`translate3d(0, ${s?-a*m:a*m}px, 0)`})}),f=new h.WebAnimation({element:i,integrator:b.from(n),style:(m,u)=>({transform:`translate3d(0, ${s?u*a:u*-a}px, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new h.MultiAnimation([p,f],{mode:"parallel"})}}};function Sn(e){const{paths:t,type:n="directional"}=e;return n==="non-directional"?T(t,()=>Ct({direction:"up"})):lt(t,{forward:"up",backward:"down"},s=>Ct({direction:s}))}const xn={spring:{stiffness:200,damping:24}},$n={inertia:{acceleration:25,resistance:1.2}},ot=.2;function En(){return{enterPhysics:xn,exitPhysics:$n,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-ot*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-ot+ot*e})`,opacity:e})}}}const Cn={spring:{stiffness:300,damping:30}},An={inertia:{acceleration:70,resistance:1.2}};function Pn(){return{enterPhysics:Cn,exitPhysics:An,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const Tn={static:Pn(),"background-scale":En()},vn="static",_n="transform",In=(e={})=>{const t=e.direction??"enter",n=Tn[e.type??vn],s=t==="enter"?n.enterPhysics:n.exitPhysics,o=n.background,i=o.willChange!=="";return{prepare:({from:r,to:c})=>{const l=t==="enter"?c:r,a=t==="enter"?r:c;return l.then(p=>{p.style.willChange=_n,p.style.backfaceVisibility="hidden",p.style.contain="layout paint",t==="exit"&&(p.style.pointerEvents="none",p.style.zIndex="100")}),a.then(p=>{i&&(p.style.willChange=o.willChange,p.style.backfaceVisibility="hidden",p.style.contain="layout paint"),t==="enter"&&(p.style.pointerEvents="none",p.style.zIndex="-1")}),{}},animation:({from:r,to:c,context:l})=>{const a=t==="enter"?c:r,p=t==="enter"?r:c,f=k(l,t==="enter"?"to":"from");a.style.clipPath=`inset(${f.top}px 0 calc(100% - ${f.top+f.height}px) 0)`;const m=t==="enter"?(E,C)=>({transform:`translate3d(0, ${C*f.height}px, 0)`}):E=>({transform:`translate3d(0, ${E*f.height}px, 0)`}),u=new h.WebAnimation({element:a,integrator:b.from(s),style:m,onComplete:()=>{a.style.willChange="auto",a.style.backfaceVisibility="",a.style.contain="",a.style.clipPath="",a.style.transform=""}});if(!i)return new h.MultiAnimation([u],{mode:"parallel"});const d=k(l,t==="enter"?"from":"to"),y=d.left+d.width/2,g=d.top+d.height/2;p.style.clipPath=`inset(${d.top}px 0 calc(100% - ${d.top+d.height}px) 0)`,p.style.transformOrigin=`${y}px ${g}px`;const S=t==="enter"?(E,C)=>o.enterStyle(E,C):E=>o.exitStyle(E),w=new h.WebAnimation({element:p,integrator:b.from(s),style:S,onComplete:t==="exit"?()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.contain="",p.style.clipPath="",p.style.transformOrigin=""}:void 0});return new h.MultiAnimation([u,w],{mode:"parallel"})}}};function On(e){return e==="scale"||e==="background-scale"?"background-scale":"static"}function Dn(e){const{enter:t,exit:n}=e,s=e.type,o=On(s);return _t({enter:t,exit:n},i=>In({direction:i,type:o}))}const Ln={spring:{stiffness:170,damping:22,doubleSpring:.8}},Fn=(e={})=>{const t=e.direction??"left",n=e.physics??Ln,s=t==="left";return{prepare:({from:o,to:i})=>(o.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{const c=s?100:-100;r.style.transform=`translate3d(${c}%, 0, 0)`,r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}),animation:({from:o,to:i})=>{const r=new h.WebAnimation({element:o,integrator:b.from(n),style:l=>({transform:`translate3d(${s?-100*l:100*l}%, 0, 0)`})}),c=new h.WebAnimation({element:i,integrator:b.from(n),style:(l,a)=>({transform:`translate3d(${s?a*100:a*-100}%, 0, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new h.MultiAnimation([r,c],{mode:"parallel"})}}};function Yn(e){const{paths:t}=e;return lt(t,{forward:"left",backward:"right"},n=>Fn({direction:n}))}const kn={spring:{stiffness:17,damping:6}},it=20,X=800,Mn=(e={})=>{const t=e.physics??kn;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.pointerEvents="none",o.style.transform=`perspective(${X}px) rotateY(0deg) translate3d(0%, 0, 0)`}),s.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.transform=`perspective(${X}px) rotateY(${it}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:s})=>{const o=new h.WebAnimation({element:n,integrator:b.from(t),style:r=>{const c=-r*it,l=r*100;return{transform:`perspective(${X}px) rotateY(${c}deg) translate3d(${l}%, 0, 0)`}}}),i=new h.WebAnimation({element:s,integrator:b.from(t),style:(r,c)=>{const l=c*it,a=-c*100;return{transform:`perspective(${X}px) rotateY(${l}deg) translate3d(${a}%, 0, 0)`}},onComplete:()=>{s.style.transform="",s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain=""}});return new h.MultiAnimation([o,i],{mode:"sequence"})}}};function Hn(e){const{paths:t}=e;return T(t,()=>Mn())}function Wn({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const r=t.left-e.left+(t.width-e.width)/2-s.x,c=t.top-e.top+(t.height-e.height)/2-s.y,l=t.width/e.width,a=t.height/e.height,p=e.top/n.height*100,f=(n.width-(e.left+e.width))/n.width*100,m=(n.height-(e.top+e.height))/n.height*100,u=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:d=>{const y=1-d,g=1+(l-1)*y,S=1+(a-1)*y,E=(i*y+o*(1-y))/((g+S)/2);return{clipPath:`inset(${p*y}% ${f*y}% ${m*y}% ${u*y}% round ${E}px)`,transform:`translate(${r*y}px, ${c*y}px) scale(${g}, ${S})`}}}}function Un({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const r=t.left-e.left+(t.width-e.width)/2+s.x,c=t.top-e.top+(t.height-e.height)/2+s.y,l=t.width/e.width,a=t.height/e.height,p=e.top/n.height*100,f=(n.width-(e.left+e.width))/n.width*100,m=(n.height-(e.top+e.height))/n.height*100,u=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:d=>{const y=1-d,g=1+(l-1)*y,S=1+(a-1)*y,E=(o*(1-y)+i*y)/((g+S)/2);return{clipPath:`inset(${p*y}% ${f*y}% ${m*y}% ${u*y}% round ${E}px)`,transform:`translate(${r*y-s.x}px, ${c*y}px) scale(${g}, ${S})`}}}}const zn={spring:{stiffness:200,damping:24}},It=.12,Xn=18;function Nn(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-It*t})`}}}}function Vn(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-It*t})`}}}}const rt={willChange:"backdrop-filter",initialStyle:{position:"absolute",inset:"0",pointerEvents:"none",zIndex:"1",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,s=`blur(${Xn*n}px)`;return{backdropFilter:s,WebkitBackdropFilter:s}}};class Bn{constructor(){$(this,"physics",zn)}contribute(t){const{from:n,to:s,resolved:o,physics:i}=t,r=o.mode==="enter",c=r?n:s,l=r?Nn():Vn();return l&&(c.style.transformOrigin=l.transformOrigin),[new h.WebAnimation({element:c,integrator:b.from(i),style:r?(a,p)=>l.animate(p):a=>l.animate(a)})]}}class Rn{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,rt.initialStyle),n.style.willChange=rt.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;return n?[new h.WebAnimation({element:n,integrator:b.from(t.physics),style:s=>rt.style(t.resolved.mode,s)})]:[]}}const qn={spring:{stiffness:340,damping:30,doubleSpring:1}};function Zn({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2+n.x,o=e.top-t.top+(e.height-t.height)/2+n.y,i=e.width/t.width,r=e.height/t.height,c=Math.max(i,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:l=>{const a=1-l;return{transform:`translate(${s*a-n.x}px, ${o*a}px) scale(${1+(c-1)*a})`,opacity:`${1-a}`}}}}function jn({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2-n.x,o=e.top-t.top+(e.height-t.height)/2-n.y,i=e.width/t.width,r=e.height/t.height,c=Math.max(i,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:l=>{const a=1-l;return{transform:`translate(${s*a}px, ${o*a}px) scale(${1+(c-1)*a})`,opacity:`${l}`}}}}class Kn{constructor(){$(this,"physics",qn)}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:r}=t,c=o.mode==="enter",l=c?n:s,a=c?Zn(i):jn(i);return a&&(l.style.transformOrigin=a.transformOrigin),[new h.WebAnimation({element:l,integrator:b.from(r),style:c?(p,f)=>a.animate(f):p=>a.animate(p)})]}}const Gn={spring:{stiffness:420,damping:34}};class Jn{constructor(){$(this,"physics",Gn)}contribute(t){return[]}}const Qn={expand:()=>new Kn,static:()=>new Jn,blur:()=>new Bn};function ts(e){return Qn[e]()}const at="data-zoom-enter-key",At="data-zoom-exit-key",es="data-zoom-radius";function Pt(e){const t=e.getAttribute(es);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function ns(e,t){const n=[];let s=t;for(;s&&s!==e;){const o=s.parentElement;if(!o)break;for(const i of Array.from(o.children))i!==s&&i instanceof HTMLElement&&n.push(i);s=o}return n}function Tt(e){const t=e.querySelectorAll(`[${at}]`);return t.length!==1?null:t[0]}function vt(e,t){const n=e.querySelectorAll(`[${At}]`);for(const s of n)if(s.getAttribute(At)===t)return s;return null}function ss(e,t){const n=Tt(e),s=Tt(t);if(!n&&s){const o=s.getAttribute(at);if(!o)return null;const i=vt(e,o);return i?{mode:"enter",enterEl:s,exitEl:i}:null}if(n&&!s){const o=n.getAttribute(at);if(!o)return null;const i=vt(t,o);return i?{mode:"exit",enterEl:n,exitEl:i}:null}return null}function os(e,t,n,s){return{enterRect:Y(e.mode==="enter"?n:t,e.enterEl),exitRect:Y(e.mode==="enter"?t:n,e.exitEl),pageRect:e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),scrollOffset:s,enterRadius:Pt(e.enterEl),exitRadius:Pt(e.exitEl)}}class is{prepare(t){t.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:r,onComplete:c}=t,l=o.mode==="enter",a=l?Wn(i):Un(i),p=l?s:n,f=l?"t":"u";a&&(p.style.transformOrigin=a.transformOrigin);const m=p.style.zIndex;return p.style.zIndex="2",c(()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.transformOrigin="",p.style.contain="",p.style.zIndex=m}),[new h.WebAnimation({element:p,integrator:b.from(r),style:f==="t"?u=>a.animate(u):(u,d)=>a.animate(d)})]}}class rs{contribute(t){const{resolved:n,physics:s,from:o,to:i,onComplete:r}=t,c=n.mode==="enter"?i:o,l=ns(c,n.enterEl);if(l.length===0)return[];const a=l.map(p=>p.style.opacity);if(n.mode==="enter")for(const p of l)p.style.opacity="0";return r(()=>{for(let p=0;p<l.length;p++){const f=l[p];f&&(f.style.opacity=a[p]??"")}}),l.map(p=>new h.WebAnimation({element:p,integrator:b.from(s),style:(f,m)=>({opacity:n.mode==="enter"?f:m})}))}}class Ot{contribute(){return[]}}const as={default:()=>new Ot,fade:()=>new rs};function ls(e){return as[e]()}class cs extends Ot{}function ps(e){const t=ts(e.type);return{strategies:[new is,t,ls(e.variant),new cs,...e.type==="blur"?[new Rn]:[]],physics:t.physics}}const fs=e=>{const{strategies:t,physics:n}=ps(e);return{prepare:s=>{const o={from:s.from,to:s.to,context:{positionedParent:s.context.positionedParent},createElement:s.createElement},i={};for(const r of t){if(!r.prepare)continue;const c=r.prepare(o);c&&Object.assign(i,c)}return i},animation:({from:s,to:o,context:i,...r})=>{const c=ss(s,o);if(!c)return new h.MultiAnimation([],{mode:"parallel"});const l=os(c,s,o,i.scrollOffset),a=[],f={from:s,to:o,resolved:c,input:l,physics:n,extras:r,onComplete:d=>{a.push(d)}},m=[];for(const d of t)d.contribute&&m.push(...d.contribute(f));const u=m[0];if(u){const d=u.onComplete;u.onComplete=()=>{d==null||d();for(const y of a)try{y()}catch(g){console.error("[zoom] cleanup error",g)}}}return new h.MultiAnimation(m,{mode:"parallel"})}}};function ds(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function ms(e){const t=ds(e);return T(e.paths,()=>fs(t))}exports.Animation=h.Animation;exports.MultiAnimation=h.MultiAnimation;exports.WebAnimation=h.WebAnimation;exports.axis=ue;exports.blind=$e;exports.drill=Le;exports.fade=Me;exports.film=Re;exports.hero=fn;exports.jaemin=yn;exports.rotate=bn;exports.scroll=Sn;exports.sheet=Dn;exports.slide=Yn;exports.strip=Hn;exports.zoom=ms;
35
+ )`}function nt(e,t,n,s,o){const i=n/1e3;return new h.WebAnimation({element:e,integrator:new Xt({durationSec:i}),lowerBound:0,upperBound:1,style:r=>s(Xe(t,r)),onComplete:o})}const Be=(e={})=>{var o;const t=((o=e.border)==null?void 0:o.color)??We,n=He,s=e.physics;return{prepare:({from:i,to:r,context:c})=>{const l=k(c,"from"),a=k(c,"to"),p=Y(document.body,c.positionedParent),f=Ve(t,{...l,top:p.top});for(const m of["topLeft","topRight","bottomLeft","bottomRight"])c.positionedParent.appendChild(f[m]);return i.then(m=>{St(m,l),xt(m,l),m.style.transform=`translateY(${-l.top}px)`}),r.then(m=>{St(m,a),xt(m,a),m.style.transform=`translateY(${-a.top+a.height}px) scale(${n})`}),{borders:f,fromRect:l,toRect:a}},animation:({from:i,to:r,context:c,borders:l,fromRect:a,toRect:p})=>{const f=wt({rect:a,scale:n,direction:"out",override:s}),m=wt({rect:p,scale:n,direction:"in",override:s}),u=nt(i,f.snapshots,f.totalDuration,w=>({transform:`translateY(${w.translateY}px) scale(${w.scale})`}),()=>{i.style.clipPath="",i.style.transformOrigin=""}),d=nt(r,m.snapshots,m.totalDuration,w=>({transform:`translateY(${w.translateY}px) scale(${w.scale})`}),()=>{r.style.clipPath="",r.style.transformOrigin="",r.style.transform=""}),y=Ne.map(([w,E],C)=>{const O=["topLeft","topRight","bottomLeft","bottomRight"][C];return nt(l[O],f.snapshots,f.totalDuration,v=>{const D=(a.width-a.width*v.scale)/2*.7*w,_=(a.height-a.height*v.scale)/2*.7*E;return{transform:`translate(${D}px, ${_}px)`}})}),g=new h.MultiAnimation([u,d,...y],{mode:"parallel"}),S=g.onComplete;return g.onComplete=()=>{S==null||S();const w=c.positionedParent;for(const E of["topLeft","topRight","bottomLeft","bottomRight"]){const C=l[E];C.parentElement===w&&w.removeChild(C)}},g}}};function Re(e){const{paths:t,options:n}=e,s=(n==null?void 0:n.borderColor)!==void 0?{border:{color:n.borderColor}}:void 0;return T(t,()=>Be(s))}const $t="data-hero-enter-key",Et="data-hero-exit-key",st="data-hero-key";class Ze{prepare(t){t.from.then(n=>{n.style.opacity="0"})}}const qe=()=>new Ze;class je{contribute(t){const{from:n,to:s,physics:o,onComplete:i}=t,r=n.style.opacity,c=s.style.opacity,l=n.style.willChange,a=s.style.willChange;return s.style.opacity="0",n.style.willChange="opacity",s.style.willChange="opacity",i(()=>{n.style.opacity=r,s.style.opacity=c,n.style.willChange=l,s.style.willChange=a}),[new h.WebAnimation({element:n,integrator:b.from(o),style:(p,f)=>({opacity:f})}),new h.WebAnimation({element:s,integrator:b.from(o),style:p=>({opacity:p})})]}}const Ke=()=>new je,Ge={static:qe,fade:Ke},Je={spring:{stiffness:300,damping:30}},Qe=700,tn="data-hero-aspect-ratio";function en(e){if(!e)return null;if(e.includes("/")){const[n,s]=e.split("/"),o=parseFloat(n??""),i=parseFloat(s??"");return!Number.isFinite(o)||!Number.isFinite(i)||i===0?null:o/i}const t=parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function V(e,t){const n=Y(e,t),s=en(t.getAttribute(tn));if(s===null)return{visible:n,bbox:n,letterbox:{top:0,right:0,bottom:0,left:0}};const o=n.width/n.height;let i,r;o>s?(r=n.height,i=r*s):(i=n.width,r=i/s);const c=(n.width-i)/2,l=(n.height-r)/2;return{visible:{left:n.left+c,top:n.top+l,width:i,height:r},bbox:n,letterbox:{top:l,right:c,bottom:l,left:c}}}function z(e,t){const n=new Map,s=e.querySelectorAll(`[${t}]`);for(const o of Array.from(s)){const i=o.getAttribute(t);i&&(n.has(i)||n.set(i,o))}return n}function nn(e,t){const n=[],s=z(t,$t),o=z(e,Et);for(const[c,l]of s){const a=o.get(c);a&&n.push({key:c,fromEl:a,toEl:l})}const i=z(e,$t),r=z(t,Et);for(const[c,l]of i){const a=r.get(c);a&&n.push({key:c,fromEl:l,toEl:a})}return n}function sn(e,t){const n=[],s=Array.from(t.querySelectorAll(`[${st}]`));for(const o of s){const i=o.getAttribute(st);if(!i)continue;const r=e.querySelector(`[${st}="${i}"]`);r&&n.push({key:i,fromEl:r,toEl:o})}return n}function on(e,t){const n=nn(e,t);return n.length>0?n:sn(e,t)}let rn=class{contribute(t){const{from:n,to:s,resolved:o,physics:i,scrollOffset:r,maxDistance:c,onComplete:l}=t,a=[];for(const{fromEl:p,toEl:f}of o.pairs){const m=V(n,p),u=V(s,f),d=m.visible,y=u.visible,g=u.bbox,S=u.letterbox,w=Math.max(d.width/y.width,d.height/y.height),E=d.left+d.width/2,C=d.top+d.height/2,O=g.left+g.width/2,v=g.top+g.height/2,D=E-O-r.x,_=C-v-r.y;if(Math.abs(_)>c)continue;const M=d.width/w,H=d.height/w,x=Math.max(0,(y.width-M)/2),L=Math.max(0,(y.height-H)/2),W=f.style.transform,B=f.style.position,R=f.style.transformOrigin,Z=f.style.clipPath,A=f.style.zIndex,q=f.style.willChange;f.style.position="relative",f.style.transformOrigin="center center",f.style.zIndex="1000",f.style.willChange="transform, clip-path",l(()=>{f.style.transform=W,f.style.position=B,f.style.transformOrigin=R,f.style.clipPath=Z,f.style.zIndex=A,f.style.willChange=q}),a.push(new h.WebAnimation({element:f,integrator:b.from(i),style:(j,P)=>{const K=P*D,G=P*_,J=j+P*w,Q=S.top+P*L,Dt=S.right+P*x,Lt=S.bottom+P*L,Ft=S.left+P*x;return{transform:`translate(${K}px, ${G}px) scale(${J})`,clipPath:`inset(${Q}px ${Dt}px ${Lt}px ${Ft}px)`}}}))}return a}};class an{contribute(t){const{resolved:n,physics:s,positionedParent:o,maxDistance:i,onComplete:r}=t,c=[];for(const{fromEl:l,toEl:a}of n.pairs){const p=V(o,l),f=V(o,a),m=p.visible,u=f.visible,d=f.bbox,y=f.letterbox;if(m.width===0||m.height===0||u.width===0||u.height===0)continue;const g=Math.max(m.width/u.width,m.height/u.height),S=m.left+m.width/2,w=m.top+m.height/2,E=d.left+d.width/2,C=d.top+d.height/2,O=S-E,v=w-C;if(Math.abs(v)>i)continue;const D=m.width/g,_=m.height/g,M=Math.max(0,(u.width-D)/2),H=Math.max(0,(u.height-_)/2),x=a.cloneNode(!0);x.style.position="absolute",x.style.left=`${d.left}px`,x.style.top=`${d.top}px`,x.style.width=`${d.width}px`,x.style.height=`${d.height}px`,x.style.margin="0",x.style.transformOrigin="center center",x.style.zIndex="1000",x.style.willChange="transform, clip-path",x.style.pointerEvents="none",x.style.maxWidth="none",x.style.maxHeight="none";const L=(Z,A)=>{const q=A*O,j=A*v,P=Z+A*g,K=y.top+A*H,G=y.right+A*M,J=y.bottom+A*H,Q=y.left+A*M;return{transform:`translate(${q}px, ${j}px) scale(${P})`,clipPath:`inset(${K}px ${G}px ${J}px ${Q}px)`}},W=L(0,1);x.style.transform=W.transform,x.style.clipPath=W.clipPath,o.appendChild(x);const B=l.style.opacity,R=a.style.opacity;l.style.opacity="0",a.style.opacity="0",r(()=>{l.style.opacity=B,a.style.opacity=R,x.parentElement&&x.parentElement.removeChild(x)}),c.push(new h.WebAnimation({element:x,integrator:b.from(s),style:L}))}return c}}const ln={static:()=>new rn,fade:()=>new an};function cn(e){return[ln[e.type](),Ge[e.type]()]}const pn=e=>{const t=cn(e),n=Je,s=Qe;return{prepare:o=>{var c;const i=Promise.all([o.from,o.to]).then(([l,a])=>({pairs:on(l,a)})),r={from:o.from,to:o.to,resolved:i};for(const l of t)(c=l.prepare)==null||c.call(l,r);return i.then(l=>({resolved:l}))},animation:({from:o,to:i,context:r,resolved:c})=>{if(c.pairs.length===0)return new h.MultiAnimation([],{mode:"parallel"});const l=[],a=d=>{l.push(d)},p={from:o,to:i,resolved:c,physics:n,scrollOffset:r.scrollOffset,positionedParent:r.positionedParent,maxDistance:s,onComplete:a},f=[];for(const d of t)d.contribute&&f.push(...d.contribute(p));if(f.length===0)return new h.MultiAnimation([],{mode:"parallel"});const m=new h.MultiAnimation(f,{mode:"parallel"}),u=m.onComplete;return m.onComplete=()=>{u==null||u();for(const d of l)try{d()}catch(y){console.error("[hero] cleanup error",y)}},m}}};function fn(e){const{paths:t}=e,n=e.type??"static";return e.variant,T(t,()=>pn({type:n}))}const dn={spring:{stiffness:50,damping:30}},mn={spring:{stiffness:80,damping:25}},hn=(e={})=>{const t=e.physics??dn,n=e.initialRotation??45,s=e.initialScale??.01,o=e.rotationTriggerPoint??.8;return{prepare:({from:i,to:r,context:c})=>(i.then(l=>{l.style.opacity="1"}),r.then(l=>{const a=k(c,"to"),p=Math.min(a.width,a.height)*.4;l.style.setProperty("--max-border-radius",`${p}px`),l.style.setProperty("--border-radius-scale","1"),l.style.willChange="transform",l.style.backfaceVisibility="hidden";const f=a.left+a.width/2,m=a.top+a.height/2;l.style.transformOrigin=`${f}px ${m}px`,l.style.position="fixed",l.style.top=`${a.top}px`,l.style.left=`${a.left}px`,l.style.width=`${a.width}px`,l.style.height=`${a.height}px`,l.style.zIndex="1000",l.style.overflow="hidden",l.style.transform=`rotate(${n}deg) scale(${s}) translateZ(0)`,l.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",l.style.opacity="1"}),{}),animation:({from:i,to:r})=>{const c=new h.WebAnimation({element:i,integrator:b.from(mn),style:(a,p)=>({opacity:p})}),l=new h.WebAnimation({element:r,integrator:b.from(t),style:a=>{let p;if(a<=.05)p=s;else if(a<=o){const d=(a-.05)/(o-.05),y=Math.pow(d,9);p=s+(.8-s)*y}else{const d=(a-o)/(1-o);p=.8+.2*(1-Math.pow(1-d,3))}const f=.7;let m;if(a<=f)m=n;else{const d=(a-f)/(1-f),y=1-Math.pow(1-d,2);m=n*(1-y)}let u;if(a<=f)u=1;else{const d=(a-f)/(1-f);u=1-Math.pow(d,.5)}return{transform:`rotate(${m.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,"--border-radius-scale":u.toFixed(4)}},onComplete:()=>{r.style.willChange="",r.style.backfaceVisibility="",r.style.removeProperty("--max-border-radius"),r.style.removeProperty("--border-radius-scale"),r.style.transform="",r.style.transformOrigin="",r.style.position="",r.style.zIndex="",r.style.top="",r.style.left="",r.style.width="",r.style.height="",r.style.overflow="",r.style.borderRadius=""}});return new h.MultiAnimation([c,l],{mode:"parallel"})}}};function yn(e){const{paths:t}=e;return T(t,()=>hn())}const un={spring:{stiffness:100,damping:30}},gn=(e={})=>{const t=e.physics??un;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),s.then(o=>{o.style.opacity="0",o.style.transform="rotate(-180deg)",o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),{}),animation:({from:n,to:s})=>{const o=new h.WebAnimation({element:n,integrator:b.from(t),style:r=>({transform:`rotate(${r*180}deg)`,opacity:r<.5?1:0})}),i=new h.WebAnimation({element:s,integrator:b.from(t),style:(r,c)=>({transform:`rotate(${-c*180}deg)`,opacity:r>.5?1:0}),onComplete:()=>{s.style.willChange="auto",s.style.transform="",s.style.transformOrigin="",s.style.opacity=""}});return new h.MultiAnimation([o,i],{mode:"parallel"})}}};function bn(e){const{paths:t}=e;return T(t,()=>gn())}const wn={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},Ct=(e={})=>{const t=e.direction??"up",n=e.physics??wn,s=t==="up";return{prepare:({from:o,to:i})=>(o.then(r=>{r.style.zIndex=s?"-1":"1",r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}),animation:({from:o,to:i})=>{const r=o.offsetHeight,c=i.offsetHeight,l=window.innerHeight,a=Math.max(Math.min(r,c),l),p=new h.WebAnimation({element:o,integrator:b.from(n),style:m=>({transform:`translate3d(0, ${s?-a*m:a*m}px, 0)`})}),f=new h.WebAnimation({element:i,integrator:b.from(n),style:(m,u)=>({transform:`translate3d(0, ${s?u*a:u*-a}px, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new h.MultiAnimation([p,f],{mode:"parallel"})}}};function Sn(e){const{paths:t,type:n="directional"}=e;return n==="non-directional"?T(t,()=>Ct({direction:"up"})):lt(t,{forward:"up",backward:"down"},s=>Ct({direction:s}))}const xn={spring:{stiffness:200,damping:24}},$n={inertia:{acceleration:25,resistance:1.2}},ot=.2;function En(){return{enterPhysics:xn,exitPhysics:$n,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-ot*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-ot+ot*e})`,opacity:e})}}}const Cn={spring:{stiffness:300,damping:30}},An={inertia:{acceleration:70,resistance:1.2}};function Pn(){return{enterPhysics:Cn,exitPhysics:An,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const Tn={static:Pn(),"background-scale":En()},vn="static",_n="transform",In=(e={})=>{const t=e.direction??"enter",n=Tn[e.type??vn],s=t==="enter"?n.enterPhysics:n.exitPhysics,o=n.background,i=o.willChange!=="";return{prepare:({from:r,to:c})=>{const l=t==="enter"?c:r,a=t==="enter"?r:c;return l.then(p=>{p.style.willChange=_n,p.style.backfaceVisibility="hidden",p.style.contain="layout paint",t==="exit"&&(p.style.pointerEvents="none",p.style.zIndex="100")}),a.then(p=>{i&&(p.style.willChange=o.willChange,p.style.backfaceVisibility="hidden",p.style.contain="layout paint"),t==="enter"&&(p.style.pointerEvents="none",p.style.zIndex="-1")}),{}},animation:({from:r,to:c,context:l})=>{const a=t==="enter"?c:r,p=t==="enter"?r:c,f=k(l,t==="enter"?"to":"from");a.style.clipPath=`inset(${f.top}px 0 calc(100% - ${f.top+f.height}px) 0)`;const m=t==="enter"?(E,C)=>({transform:`translate3d(0, ${C*f.height}px, 0)`}):E=>({transform:`translate3d(0, ${E*f.height}px, 0)`}),u=new h.WebAnimation({element:a,integrator:b.from(s),style:m,onComplete:()=>{a.style.willChange="auto",a.style.backfaceVisibility="",a.style.contain="",a.style.clipPath="",a.style.transform=""}});if(!i)return new h.MultiAnimation([u],{mode:"parallel"});const d=k(l,t==="enter"?"from":"to"),y=d.left+d.width/2,g=d.top+d.height/2;p.style.clipPath=`inset(${d.top}px 0 calc(100% - ${d.top+d.height}px) 0)`,p.style.transformOrigin=`${y}px ${g}px`;const S=t==="enter"?(E,C)=>o.enterStyle(E,C):E=>o.exitStyle(E),w=new h.WebAnimation({element:p,integrator:b.from(s),style:S,onComplete:t==="exit"?()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.contain="",p.style.clipPath="",p.style.transformOrigin=""}:void 0});return new h.MultiAnimation([u,w],{mode:"parallel"})}}};function On(e){return e==="scale"||e==="background-scale"?"background-scale":"static"}function Dn(e){const{enter:t,exit:n}=e,s=e.type,o=On(s);return _t({enter:t,exit:n},i=>In({direction:i,type:o}))}const Ln={spring:{stiffness:170,damping:22,doubleSpring:.8}},Fn=(e={})=>{const t=e.direction??"left",n=e.physics??Ln,s=t==="left";return{prepare:({from:o,to:i})=>(o.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{const c=s?100:-100;r.style.transform=`translate3d(${c}%, 0, 0)`,r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}),animation:({from:o,to:i})=>{const r=new h.WebAnimation({element:o,integrator:b.from(n),style:l=>({transform:`translate3d(${s?-100*l:100*l}%, 0, 0)`})}),c=new h.WebAnimation({element:i,integrator:b.from(n),style:(l,a)=>({transform:`translate3d(${s?a*100:a*-100}%, 0, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new h.MultiAnimation([r,c],{mode:"parallel"})}}};function Yn(e){const{paths:t}=e;return lt(t,{forward:"left",backward:"right"},n=>Fn({direction:n}))}const kn={spring:{stiffness:17,damping:6}},it=20,X=800,Mn=(e={})=>{const t=e.physics??kn;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.pointerEvents="none",o.style.transform=`perspective(${X}px) rotateY(0deg) translate3d(0%, 0, 0)`}),s.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.transform=`perspective(${X}px) rotateY(${it}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:s})=>{const o=new h.WebAnimation({element:n,integrator:b.from(t),style:r=>{const c=-r*it,l=r*100;return{transform:`perspective(${X}px) rotateY(${c}deg) translate3d(${l}%, 0, 0)`}}}),i=new h.WebAnimation({element:s,integrator:b.from(t),style:(r,c)=>{const l=c*it,a=-c*100;return{transform:`perspective(${X}px) rotateY(${l}deg) translate3d(${a}%, 0, 0)`}},onComplete:()=>{s.style.transform="",s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain=""}});return new h.MultiAnimation([o,i],{mode:"sequence"})}}};function Hn(e){const{paths:t}=e;return T(t,()=>Mn())}function Wn({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const r=t.left-e.left+(t.width-e.width)/2-s.x,c=t.top-e.top+(t.height-e.height)/2-s.y,l=t.width/e.width,a=t.height/e.height,p=e.top/n.height*100,f=(n.width-(e.left+e.width))/n.width*100,m=(n.height-(e.top+e.height))/n.height*100,u=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:d=>{const y=1-d,g=1+(l-1)*y,S=1+(a-1)*y,E=(i*y+o*(1-y))/((g+S)/2);return{clipPath:`inset(${p*y}% ${f*y}% ${m*y}% ${u*y}% round ${E}px)`,transform:`translate(${r*y}px, ${c*y}px) scale(${g}, ${S})`}}}}function Un({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const r=t.left-e.left+(t.width-e.width)/2+s.x,c=t.top-e.top+(t.height-e.height)/2+s.y,l=t.width/e.width,a=t.height/e.height,p=e.top/n.height*100,f=(n.width-(e.left+e.width))/n.width*100,m=(n.height-(e.top+e.height))/n.height*100,u=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:d=>{const y=1-d,g=1+(l-1)*y,S=1+(a-1)*y,E=(o*(1-y)+i*y)/((g+S)/2);return{clipPath:`inset(${p*y}% ${f*y}% ${m*y}% ${u*y}% round ${E}px)`,transform:`translate(${r*y-s.x}px, ${c*y}px) scale(${g}, ${S})`}}}}const zn={spring:{stiffness:430,damping:33,doubleSpring:1}},It=.12,Xn=18;function Nn(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-It*t})`}}}}function Vn(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-It*t})`}}}}const rt={willChange:"backdrop-filter",initialStyle:{position:"absolute",inset:"0",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,s=`blur(${Xn*n}px)`;return{backdropFilter:s,WebkitBackdropFilter:s}}};class Bn{constructor(){$(this,"physics",zn)}contribute(t){const{from:n,to:s,resolved:o,physics:i}=t,r=o.mode==="enter",c=r?n:s,l=r?Nn():Vn();return l&&(c.style.transformOrigin=l.transformOrigin),[new h.WebAnimation({element:c,integrator:b.from(i),style:r?(a,p)=>l.animate(p):a=>l.animate(a)})]}}class Rn{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,rt.initialStyle),n.style.willChange=rt.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;return n?(n.style.zIndex=t.resolved.mode==="enter"?"-1":"1",[new h.WebAnimation({element:n,integrator:b.from(t.physics),style:s=>rt.style(t.resolved.mode,s)})]):[]}}const Zn={spring:{stiffness:430,damping:33,doubleSpring:1}};function qn({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2+n.x,o=e.top-t.top+(e.height-t.height)/2+n.y,i=e.width/t.width,r=e.height/t.height,c=Math.max(i,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:l=>{const a=1-l;return{transform:`translate(${s*a-n.x}px, ${o*a}px) scale(${1+(c-1)*a})`}}}}function jn({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2-n.x,o=e.top-t.top+(e.height-t.height)/2-n.y,i=e.width/t.width,r=e.height/t.height,c=Math.max(i,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:l=>{const a=1-l;return{transform:`translate(${s*a}px, ${o*a}px) scale(${1+(c-1)*a})`}}}}class Kn{constructor(){$(this,"physics",Zn)}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:r}=t,c=o.mode==="enter",l=c?n:s,a=c?qn(i):jn(i);return a&&(l.style.transformOrigin=a.transformOrigin),[new h.WebAnimation({element:l,integrator:b.from(r),style:c?(p,f)=>a.animate(f):p=>a.animate(p)})]}}const Gn={spring:{stiffness:530,damping:34,doubleSpring:1}};class Jn{constructor(){$(this,"physics",Gn)}contribute(t){return[]}}const Qn={expand:()=>new Kn,static:()=>new Jn,blur:()=>new Bn};function ts(e){return Qn[e]()}const at="data-zoom-enter-key",At="data-zoom-exit-key",es="data-zoom-radius";function Pt(e){const t=e.getAttribute(es);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function ns(e,t){const n=[];let s=t;for(;s&&s!==e;){const o=s.parentElement;if(!o)break;for(const i of Array.from(o.children))i!==s&&i instanceof HTMLElement&&n.push(i);s=o}return n}function Tt(e){const t=e.querySelectorAll(`[${at}]`);return t.length!==1?null:t[0]}function vt(e,t){const n=e.querySelectorAll(`[${At}]`);for(const s of n)if(s.getAttribute(At)===t)return s;return null}function ss(e,t){const n=Tt(e),s=Tt(t);if(!n&&s){const o=s.getAttribute(at);if(!o)return null;const i=vt(e,o);return i?{mode:"enter",enterEl:s,exitEl:i}:null}if(n&&!s){const o=n.getAttribute(at);if(!o)return null;const i=vt(t,o);return i?{mode:"exit",enterEl:n,exitEl:i}:null}return null}function os(e,t,n,s){return{enterRect:Y(e.mode==="enter"?n:t,e.enterEl),exitRect:Y(e.mode==="enter"?t:n,e.exitEl),pageRect:e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),scrollOffset:s,enterRadius:Pt(e.enterEl),exitRadius:Pt(e.exitEl)}}class is{prepare(t){t.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:r,onComplete:c}=t,l=o.mode==="enter",a=l?Wn(i):Un(i),p=l?s:n,f=l?"t":"u";a&&(p.style.transformOrigin=a.transformOrigin);const m=l?"-2":"2",u=n.style.zIndex;return n.style.zIndex=m,c(()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.transformOrigin="",p.style.contain="",n.style.zIndex=u}),[new h.WebAnimation({element:p,integrator:b.from(r),style:f==="t"?d=>a.animate(d):(d,y)=>a.animate(y)})]}}class rs{contribute(t){const{resolved:n,physics:s,from:o,to:i,onComplete:r}=t,c=n.mode==="enter"?i:o,l=ns(c,n.enterEl);if(l.length===0)return[];const a=l.map(p=>p.style.opacity);if(n.mode==="enter")for(const p of l)p.style.opacity="0";return r(()=>{for(let p=0;p<l.length;p++){const f=l[p];f&&(f.style.opacity=a[p]??"")}}),l.map(p=>new h.WebAnimation({element:p,integrator:b.from(s),style:(f,m)=>({opacity:n.mode==="enter"?f:m})}))}}class Ot{contribute(){return[]}}const as={default:()=>new Ot,fade:()=>new rs};function ls(e){return as[e]()}class cs extends Ot{}function ps(e){const t=ts(e.type);return{strategies:[new is,t,ls(e.variant),new cs,...e.type==="blur"?[new Rn]:[]],physics:t.physics}}const fs=e=>{const{strategies:t,physics:n}=ps(e);return{prepare:s=>{const o={from:s.from,to:s.to,context:{positionedParent:s.context.positionedParent},createElement:s.createElement},i={};for(const r of t){if(!r.prepare)continue;const c=r.prepare(o);c&&Object.assign(i,c)}return i},animation:({from:s,to:o,context:i,...r})=>{const c=ss(s,o);if(!c)return new h.MultiAnimation([],{mode:"parallel"});const l=os(c,s,o,i.scrollOffset),a=[],f={from:s,to:o,resolved:c,input:l,physics:n,extras:r,onComplete:d=>{a.push(d)}},m=[];for(const d of t)d.contribute&&m.push(...d.contribute(f));const u=m[0];if(u){const d=u.onComplete;u.onComplete=()=>{d==null||d();for(const y of a)try{y()}catch(g){console.error("[zoom] cleanup error",g)}}}return new h.MultiAnimation(m,{mode:"parallel"})}}};function ds(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function ms(e){const t=ds(e);return T(e.paths,()=>fs(t))}exports.Animation=h.Animation;exports.MultiAnimation=h.MultiAnimation;exports.WebAnimation=h.WebAnimation;exports.axis=ue;exports.blind=$e;exports.drill=Le;exports.fade=Me;exports.film=Re;exports.hero=fn;exports.jaemin=yn;exports.rotate=bn;exports.scroll=Sn;exports.sheet=Dn;exports.slide=Yn;exports.strip=Hn;exports.zoom=ms;
package/dist/index.js CHANGED
@@ -1679,7 +1679,11 @@ function Dn({
1679
1679
  };
1680
1680
  }
1681
1681
  const Fn = {
1682
- spring: { stiffness: 200, damping: 24 }
1682
+ spring: {
1683
+ stiffness: 430,
1684
+ damping: 33,
1685
+ doubleSpring: 1
1686
+ }
1683
1687
  }, Ft = 0.12, Ln = 18;
1684
1688
  function Yn() {
1685
1689
  return {
@@ -1709,10 +1713,13 @@ const at = {
1709
1713
  position: "absolute",
1710
1714
  inset: "0",
1711
1715
  pointerEvents: "none",
1712
- // Sits above the background page but below the zoomed page (z-index 2
1713
- // in transition.ts). backdrop-filter therefore blurs the background,
1714
- // while the zoom tile stays sharp as it expands on top.
1715
- zIndex: "1",
1716
+ // z-index is mode-dependent and applied in OverlayStrategy.contribute
1717
+ // once `resolved.mode` is known. Sits between the background page and
1718
+ // the zoomed tile:
1719
+ // enter — tile (`to`) is default(0), background (`from`) at -2,
1720
+ // overlay at -1.
1721
+ // exit — tile (`from`) is at +2, background (`to`) default(0),
1722
+ // overlay at +1.
1716
1723
  backdropFilter: "blur(0px)",
1717
1724
  WebkitBackdropFilter: "blur(0px)"
1718
1725
  },
@@ -1746,17 +1753,21 @@ class Mn {
1746
1753
  }
1747
1754
  contribute(t) {
1748
1755
  const n = t.extras.overlay;
1749
- return n ? [
1756
+ return n ? (n.style.zIndex = t.resolved.mode === "enter" ? "-1" : "1", [
1750
1757
  new b({
1751
1758
  element: n,
1752
1759
  integrator: g.from(t.physics),
1753
1760
  style: (s) => at.style(t.resolved.mode, s)
1754
1761
  })
1755
- ] : [];
1762
+ ]) : [];
1756
1763
  }
1757
1764
  }
1758
1765
  const Un = {
1759
- spring: { stiffness: 340, damping: 30, doubleSpring: 1 }
1766
+ spring: {
1767
+ stiffness: 430,
1768
+ damping: 33,
1769
+ doubleSpring: 1
1770
+ }
1760
1771
  };
1761
1772
  function zn({
1762
1773
  enterRect: e,
@@ -1769,8 +1780,7 @@ function zn({
1769
1780
  animate: (l) => {
1770
1781
  const a = 1 - l;
1771
1782
  return {
1772
- transform: `translate(${s * a - n.x}px, ${o * a}px) scale(${1 + (c - 1) * a})`,
1773
- opacity: `${1 - a}`
1783
+ transform: `translate(${s * a - n.x}px, ${o * a}px) scale(${1 + (c - 1) * a})`
1774
1784
  };
1775
1785
  }
1776
1786
  };
@@ -1786,8 +1796,7 @@ function Xn({
1786
1796
  animate: (l) => {
1787
1797
  const a = 1 - l;
1788
1798
  return {
1789
- transform: `translate(${s * a}px, ${o * a}px) scale(${1 + (c - 1) * a})`,
1790
- opacity: `${l}`
1799
+ transform: `translate(${s * a}px, ${o * a}px) scale(${1 + (c - 1) * a})`
1791
1800
  };
1792
1801
  }
1793
1802
  };
@@ -1808,7 +1817,11 @@ class Nn {
1808
1817
  }
1809
1818
  }
1810
1819
  const Vn = {
1811
- spring: { stiffness: 420, damping: 34 }
1820
+ spring: {
1821
+ stiffness: 530,
1822
+ damping: 34,
1823
+ doubleSpring: 1
1824
+ }
1812
1825
  };
1813
1826
  class Bn {
1814
1827
  constructor() {
@@ -1897,9 +1910,9 @@ class Gn {
1897
1910
  contribute(t) {
1898
1911
  const { from: n, to: s, resolved: o, input: r, physics: i, onComplete: c } = t, l = o.mode === "enter", a = l ? An(r) : Dn(r), p = l ? s : n, f = l ? "t" : "u";
1899
1912
  a && (p.style.transformOrigin = a.transformOrigin);
1900
- const h = p.style.zIndex;
1901
- return p.style.zIndex = "2", c(() => {
1902
- p.style.willChange = "auto", p.style.backfaceVisibility = "", p.style.transformOrigin = "", p.style.contain = "", p.style.zIndex = h;
1913
+ const h = l ? "-2" : "2", m = n.style.zIndex;
1914
+ return n.style.zIndex = h, c(() => {
1915
+ p.style.willChange = "auto", p.style.backfaceVisibility = "", p.style.transformOrigin = "", p.style.contain = "", n.style.zIndex = m;
1903
1916
  }), [
1904
1917
  new b({
1905
1918
  element: p,
@@ -1907,7 +1920,7 @@ class Gn {
1907
1920
  // Enter: tile expands as `t` (0 → 1). Exit: tile shrinks as `u` —
1908
1921
  // the legacy convention from v5's outAnim path. Either way, feed
1909
1922
  // the progress that matches the tileConfig's authored direction.
1910
- style: f === "t" ? (m) => a.animate(m) : (m, d) => a.animate(d)
1923
+ style: f === "t" ? (d) => a.animate(d) : (d, y) => a.animate(y)
1911
1924
  })
1912
1925
  ];
1913
1926
  }
package/dist/internal.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var ue=Object.defineProperty;var fe=(e,n,t)=>n in e?ue(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var W=(e,n,t)=>fe(e,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./multi-animation-Dw2JTJI2.cjs");class se extends H.Animation{constructor(){super(...arguments);W(this,"child",null);W(this,"_state","idle");W(this,"_settled",!1);W(this,"listeners",new Set)}attach(t){const o=this.child;if(this.child=t,this._settled=!1,o){const m=o.getPose();o.complete(),t.matchInto(m)}t.playbackRate=this.playbackRate;const c=t.onComplete;t.onComplete=()=>{c==null||c(),this.child===t&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const d=t.onUpdate;t.onUpdate=m=>{var w;d==null||d(m),(w=this.onUpdate)==null||w.call(this,m),this.notify()},this._state==="paused"?t.pause():this._state==="reversing"?t.reverse():(this._state="playing",t.play()),this.notify()}play(){var t;this._state="playing",this._settled=!1,(t=this.child)==null||t.play(),this.notify()}reverse(){var t;this._state="reversing",this._settled=!1,(t=this.child)==null||t.reverse(),this.notify()}pause(){var t;this._state="paused",(t=this.child)==null||t.pause(),this.notify()}complete(){var t;(t=this.child)==null||t.complete(),this.notify()}get isAnimating(){var t;return((t=this.child)==null?void 0:t.isAnimating)??!1}get isPaused(){return this._state==="paused"}get isComplete(){return this._settled&&!this.child}get isReversing(){var t;return((t=this.child)==null?void 0:t.isReversing)??this._state==="reversing"}get progress(){var t;return((t=this.child)==null?void 0:t.progress)??0}findTimeForProgress(t){var o;return((o=this.child)==null?void 0:o.findTimeForProgress(t))??null}get playbackRate(){return super.playbackRate}set playbackRate(t){super.playbackRate=t,this.child&&(this.child.playbackRate=t),this.notify()}getPose(){var t;return((t=this.child)==null?void 0:t.getPose())??[]}getTimeline(){var t;return((t=this.child)==null?void 0:t.getTimeline())??[]}matchInto(t){var o;(o=this.child)==null||o.matchInto(t)}get activeChild(){return this.child}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){for(const t of this.listeners)t()}}const de=(e,n)=>{var t;e.style.position="absolute",e.style.width="100%",e.style.top=`${-1*(((t=n==null?void 0:n.scrollOffset)==null?void 0:t.y)??0)}px`,e.style.left="0"},Q=new Set(["auto","scroll","overlay"]),me=e=>{let n=e.parentElement;for(;n&&n!==document.body;){const t=window.getComputedStyle(n);if(Q.has(t.overflowY)||Q.has(t.overflowX))return n;n=n.parentElement}return document.documentElement},he=e=>{let n=e.parentElement;for(;n&&n!==document.body;){const t=window.getComputedStyle(n).position;if(t==="relative"||t==="absolute"||t==="fixed"||t==="sticky")return n;n=n.parentElement}return document.body};function ge(e){const n=Object.keys(e);return Promise.all(n.map(t=>e[t])).then(t=>{const o={};return n.forEach((c,d)=>{o[c]=t[d]}),o})}function ye(e){const n=e.filter(t=>t.symmetric).map(t=>({from:t.to,to:t.from,transition:t.transition}));return[...e,...n]}function F(e,n){if(n==="*")return!0;if(n.endsWith("/*")){const t=n.slice(0,-1);return e.startsWith(t)&&e.length>t.length}return e===n}function pe(e,n,t){for(const o of t)if(F(e,o.from)&&F(n,o.to))return o.transition;for(const o of t)if((o.from==="*"||F(e,o.from))&&(o.to==="*"||F(n,o.to)))return o.transition;return null}const ve=768,Ee=10,we=10;function Se(e={}){const{preserveScroll:n=i=>i}=e,t=typeof n=="function"?n:()=>n;let o=null,c=!1,d=!1;const m=()=>{const i=(o==null?void 0:o.clientWidth)??0,l=i>0?i:typeof window<"u"?window.innerWidth:0;return l>0&&l<ve},w=()=>(d||(c=m(),d=!0),c),y=i=>{var v;const l=t(w());if(l===!1)return{preserves:!1,shared:!1,storageKey:`path:${i}`};if(l===!0)return{preserves:!0,shared:!1,storageKey:`path:${i}`};const g=((v=l.exclude)==null?void 0:v.some(r=>F(i,r)))??!1,p=!g&&!!l.key;return{preserves:!g,shared:p,storageKey:p?`shared:${l.key}`:`path:${i}`}},x=i=>y(i).preserves;let R=null;const h=new Map;let T=null,A=!1,O=0;const I=()=>{o&&T&&!A&&h.set(y(T).storageKey,{x:o.scrollLeft,y:o.scrollTop})},L=i=>{if(!o)return;const l=y(i);if(l.preserves&&l.shared&&!h.has(l.storageKey))return;const g=l.preserves&&h.has(l.storageKey)?h.get(l.storageKey):{x:0,y:0};let p=0;const v=()=>{if(!o)return;o.scrollTo({top:g.y,left:g.x}),!(Math.abs(o.scrollTop-g.y)<1&&Math.abs(o.scrollLeft-g.x)<1)&&p<Ee&&(p++,requestAnimationFrame(v))};requestAnimationFrame(v)};return{initializeContext:(i,l)=>{A=!0;const g=++O;R=i,o||(o=me(i),c=m(),d=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{c=m()}).observe(o),(o===document.documentElement?window:o).addEventListener("scroll",I,{passive:!0})),T=l,L(l);let p=0;const v=()=>{g===O&&(p++,p>=we?A=!1:requestAnimationFrame(v))};requestAnimationFrame(v)},calculateScrollOffset:(i,l)=>{const g=i?y(i).storageKey:null,p=g&&h.has(g)?h.get(g):{x:0,y:0},v=l?y(l):null,r=v!=null&&v.preserves?v.storageKey:null,s=r&&h.has(r)?h.get(r):{x:0,y:0};return{x:-s.x+p.x,y:-s.y+p.y}},evictScrollPosition:i=>{h.delete(y(i).storageKey)},shouldPreserve:x,getScrollContainer:()=>o,getPositionedParentElement:()=>R?he(R):document.body,getScrollPosition:i=>{const l=i?y(i).storageKey:null;return l&&h.has(l)?h.get(l):{x:0,y:0}}}}const ee=30,te=8,ne=1.2,oe=30,be=600;function Te(){let e=null,n=!1,t=!1,o=null,c=null,d=!1;const m=(a,u)=>{for(let f=0;f<a.length;f++){const E=a.item(f);if(E&&E.identifier===u)return E}return null},w=()=>{o!==null&&(clearTimeout(o),o=null)},y=()=>{c!==null&&(clearTimeout(c),c=null)},x=()=>{n=!0,t=!0,w(),y(),o=setTimeout(()=>{n=!1,t=!1,o=null},be)},R=a=>{if(a.touches.length!==1){e=null;return}const u=a.touches.item(0);if(!u){e=null;return}const f=window.innerWidth,E=u.clientX<=ee,P=u.clientX>=f-ee;if(!E&&!P){e=null;return}e={identifier:u.identifier,startX:u.clientX,startY:u.clientY,fromLeftEdge:E,moved:!1}},h=a=>{if(!e)return;if(a.touches.length!==1){e=null;return}const u=m(a.touches,e.identifier);if(!u){e=null;return}const f=u.clientX-e.startX,E=u.clientY-e.startY,P=Math.abs(f),i=Math.abs(E);if(i>te&&i>P*ne){e=null;return}const l=e.fromLeftEdge?f>0:f<0;P>te&&P>i*ne&&l&&(e.moved=!0)},T=a=>{if(!e)return;const u=m(a.changedTouches,e.identifier);if(!u){e=null;return}const f=u.clientX-e.startX,E=e.fromLeftEdge?f>0:f<0;if(e.moved&&E&&Math.abs(f)>=oe){x(),e=null;return}e.moved&&Math.abs(f)>=oe&&x(),e=null},A=()=>{e&&(e.moved&&x(),e=null)};return{initialize:()=>{if(typeof window>"u"||d)return;d=!0;const a={passive:!0,capture:!0};window.addEventListener("touchstart",R,a),window.addEventListener("touchmove",h,a),window.addEventListener("touchend",T,a),window.addEventListener("touchcancel",A,a)},destroy:()=>{if(typeof window>"u"||!d)return;d=!1;const a={capture:!0};window.removeEventListener("touchstart",R,a),window.removeEventListener("touchmove",h,a),window.removeEventListener("touchend",T,a),window.removeEventListener("touchcancel",A,a),w(),y(),e=null,n=!1,t=!1},isSwipeBack:()=>{const a=n||t;return a&&w(),a},onPageEnter:()=>{n=!1,w(),y(),c=setTimeout(()=>{t=!1,c=null},0)}}}function Pe(){let e=null;function n(){var o,c;e&&((o=e.outResolve)==null||o.call(e,null),(c=e.inResolve)==null||c.call(e,null),e=null)}function t(){if(e!=null&&e.from&&(e!=null&&e.to)&&(e!=null&&e.outResolve)&&(e!=null&&e.inResolve)){if(e.from===e.to){n();return}const o={from:e.from,to:e.to};e.outResolve(o),e.inResolve(o),e=null}}return{trigger(o,c){var m;c==="out"&&(e==null?void 0:e.to)===o&&!e.from&&((m=e.inResolve)==null||m.call(e,null),e={}),e&&(c==="out"&&e.from&&e.from!==o||c==="in"&&e.to&&e.to!==o)&&n(),e||(e={}),c==="out"?e.from=o:e.to=o},get(o){return new Promise(c=>{e||(e={}),o==="out"?e.outResolve=c:e.inResolve=c,t()})}}}const X=new Map;let z=null,re=!1;function ie(e){if(e instanceof HTMLElement&&X.has(e)){const n=X.get(e);X.delete(e),queueMicrotask(n)}for(const n of Array.from(e.childNodes))ie(n)}function Re(){if(re||typeof document>"u")return;re=!0,z=new MutationObserver(n=>{for(const t of n)for(const o of Array.from(t.removedNodes))ie(o)});const e=()=>{z==null||z.observe(document.body,{childList:!0,subtree:!0})};document.body?e():document.addEventListener("DOMContentLoaded",e,{once:!0})}function Ae(e,n){return Re(),X.set(e,n),()=>{X.delete(e)}}function xe(e){return Array.isArray(e)}function le(e){const n=[];for(const t of e)xe(t)?n.push(...le(t)):n.push(t);return n}function Le(e,n={}){const{transitions:t=[],middleware:o=(r,s)=>({from:r,to:s}),preserveScroll:c=r=>r}=e,d=n.host??new se,m=Pe(),w=ye(le(t)),y=Te();y.initialize();const{initializeContext:x,calculateScrollOffset:R,evictScrollPosition:h,shouldPreserve:T,getScrollContainer:A,getPositionedParentElement:O,getScrollPosition:I}=Se({preserveScroll:c});let L=null,k=null;const a=new WeakMap,u=r=>{a.set(r,{parent:r.parentElement,nextSibling:r.nextElementSibling})},f=r=>{const s=a.get(r);return s||{parent:r.parentElement,nextSibling:r.nextElementSibling}},E=(r,s,b,S,B)=>{const K=S.element,D=B.element,{parent:M,nextSibling:C}=S.parent?{parent:S.parent,nextSibling:S.nextSibling}:f(K),_=K.cloneNode(!0),q={scrollOffset:R(s,b),from:{scroll:I(s)},to:{scroll:I(b)},get scrollingElement(){return A()||document.documentElement},get positionedParent(){return O()}};de(_,q),T(s)||h(s);const j=Promise.resolve(_),Z=Promise.resolve(D),J=[],ce={from:j,to:Z,context:q,createElement:((Y,$="div")=>{const N=document.createElement($);return N.setAttribute("data-ssgoi-id",Y),J.push(N),N})},ae=Promise.resolve(r.prepare?r.prepare(ce):{});ge({from:j,to:Z,extras:ae}).then(({from:Y,to:$,extras:N})=>{M&&(C&&M.contains(C)?M.insertBefore(_,C):M.appendChild(_));const G=r.animation({from:Y,to:$,context:q,...N}),U=G.onComplete;G.onComplete=()=>{U==null||U(),_.parentElement&&_.parentElement.removeChild(_);for(const V of J)V.parentElement&&V.parentElement.removeChild(V)},d.attach(G)})},P=(r,s)=>{const b=y.isSwipeBack();m.trigger(r,s),m.get(s).then(S=>{if(s==="in"&&y.onPageEnter(),!S)return;if(b){s==="out"&&S.from&&!T(S.from)&&h(S.from),L=null,k=null;return}if(s!=="in")return;const{from:B,to:K}=o(S.from,S.to),D=pe(B,K,w),M=L,C=k;L=null,k=null,!(!D||!M||!C)&&E(D,B,K,M,C)})},i=(r,s)=>{const b=f(r);L={element:r,parent:b.parent,nextSibling:b.nextSibling},P(s,"out")},l=new WeakSet,g=(r,s)=>{l.has(s)||(l.add(s),u(s),x(s,r),k={element:s,parent:s.parentElement,nextSibling:s.nextElementSibling},P(r,"in"),Ae(s,()=>i(s,r)))},p=new Map;return{register:g,refFor:r=>{let s=p.get(r);return s||(s=b=>{b&&g(r,b)},p.set(r,s)),s}}}exports.Animation=H.Animation;exports.MultiAnimation=H.MultiAnimation;exports.WebAnimation=H.WebAnimation;exports.HostAnimation=se;exports.createSggoiTransitionContext=Le;
1
+ "use strict";var ut=Object.defineProperty;var ft=(t,n,e)=>n in t?ut(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var W=(t,n,e)=>ft(t,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./multi-animation-Dw2JTJI2.cjs");class st extends H.Animation{constructor(){super(...arguments);W(this,"child",null);W(this,"_state","idle");W(this,"_settled",!1);W(this,"listeners",new Set)}attach(e){const o=this.child;if(this.child=e,this._settled=!1,o){const m=o.getPose();o.complete(),e.matchInto(m)}e.playbackRate=this.playbackRate;const c=e.onComplete;e.onComplete=()=>{c==null||c(),this.child===e&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const d=e.onUpdate;e.onUpdate=m=>{var S;d==null||d(m),(S=this.onUpdate)==null||S.call(this,m),this.notify()},this._state==="paused"?e.pause():this._state==="reversing"?e.reverse():(this._state="playing",e.play()),this.notify()}play(){var e;this._state="playing",this._settled=!1,(e=this.child)==null||e.play(),this.notify()}reverse(){var e;this._state="reversing",this._settled=!1,(e=this.child)==null||e.reverse(),this.notify()}pause(){var e;this._state="paused",(e=this.child)==null||e.pause(),this.notify()}complete(){var e;(e=this.child)==null||e.complete(),this.notify()}get isAnimating(){var e;return((e=this.child)==null?void 0:e.isAnimating)??!1}get isPaused(){return this._state==="paused"}get isComplete(){return this._settled&&!this.child}get isReversing(){var e;return((e=this.child)==null?void 0:e.isReversing)??this._state==="reversing"}get progress(){var e;return((e=this.child)==null?void 0:e.progress)??0}findTimeForProgress(e){var o;return((o=this.child)==null?void 0:o.findTimeForProgress(e))??null}get playbackRate(){return super.playbackRate}set playbackRate(e){super.playbackRate=e,this.child&&(this.child.playbackRate=e),this.notify()}getPose(){var e;return((e=this.child)==null?void 0:e.getPose())??[]}getTimeline(){var e;return((e=this.child)==null?void 0:e.getTimeline())??[]}matchInto(e){var o;(o=this.child)==null||o.matchInto(e)}get activeChild(){return this.child}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){for(const e of this.listeners)e()}}const dt=(t,n)=>{var e;t.style.position="absolute",t.style.width="100%",t.style.top=`${-1*(((e=n==null?void 0:n.scrollOffset)==null?void 0:e.y)??0)}px`,t.style.left="0"},Q=new Set(["auto","scroll","overlay"]),mt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n);if(Q.has(e.overflowY)||Q.has(e.overflowX))return n;n=n.parentElement}return document.documentElement},ht=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return n;n=n.parentElement}return document.body};function gt(t){const n=Object.keys(t);return Promise.all(n.map(e=>t[e])).then(e=>{const o={};return n.forEach((c,d)=>{o[c]=e[d]}),o})}function yt(t){const n=t.filter(e=>e.symmetric).map(e=>({from:e.to,to:e.from,transition:e.transition}));return[...t,...n]}function F(t,n){if(n==="*")return!0;if(n.endsWith("/*")){const e=n.slice(0,-1);return t.startsWith(e)&&t.length>e.length}return t===n}function pt(t,n,e){for(const o of e)if(F(t,o.from)&&F(n,o.to))return o.transition;for(const o of e)if((o.from==="*"||F(t,o.from))&&(o.to==="*"||F(n,o.to)))return o.transition;return null}const vt=768,Et=10,wt=10;function St(t={}){const{preserveScroll:n=i=>i}=t,e=typeof n=="function"?n:()=>n;let o=null,c=!1,d=!1;const m=()=>{const i=(o==null?void 0:o.clientWidth)??0,l=i>0?i:typeof window<"u"?window.innerWidth:0;return l>0&&l<vt},S=()=>(d||(c=m(),d=!0),c),y=i=>{var v;const l=e(S());if(l===!1)return{preserves:!1,shared:!1,storageKey:`path:${i}`};if(l===!0)return{preserves:!0,shared:!1,storageKey:`path:${i}`};const g=((v=l.exclude)==null?void 0:v.some(r=>F(i,r)))??!1,p=!g&&!!l.key;return{preserves:!g,shared:p,storageKey:p?`shared:${l.key}`:`path:${i}`}},x=i=>y(i).preserves;let R=null;const h=new Map;let T=null,A=!1,O=0;const I=()=>{o&&T&&!A&&h.set(y(T).storageKey,{x:o.scrollLeft,y:o.scrollTop})},L=i=>{if(!o)return;const l=y(i);if(l.preserves&&l.shared&&!h.has(l.storageKey))return;const g=l.preserves&&h.has(l.storageKey)?h.get(l.storageKey):{x:0,y:0};let p=0;const v=()=>{if(!o)return;o.scrollTo({top:g.y,left:g.x}),!(Math.abs(o.scrollTop-g.y)<1&&Math.abs(o.scrollLeft-g.x)<1)&&p<Et&&(p++,requestAnimationFrame(v))};requestAnimationFrame(v)};return{initializeContext:(i,l)=>{A=!0;const g=++O;R=i,o||(o=mt(i),c=m(),d=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{c=m()}).observe(o),(o===document.documentElement?window:o).addEventListener("scroll",I,{passive:!0})),T=l,L(l);let p=0;const v=()=>{g===O&&(p++,p>=wt?A=!1:requestAnimationFrame(v))};requestAnimationFrame(v)},calculateScrollOffset:(i,l)=>{const g=i?y(i).storageKey:null,p=g&&h.has(g)?h.get(g):{x:0,y:0},v=l?y(l):null,r=v!=null&&v.preserves?v.storageKey:null,s=r&&h.has(r)?h.get(r):{x:0,y:0};return{x:-s.x+p.x,y:-s.y+p.y}},evictScrollPosition:i=>{h.delete(y(i).storageKey)},shouldPreserve:x,getScrollContainer:()=>o,getPositionedParentElement:()=>R?ht(R):document.body,getScrollPosition:i=>{const l=i?y(i).storageKey:null;return l&&h.has(l)?h.get(l):{x:0,y:0}}}}const tt=30,et=8,nt=1.2,ot=30,bt=600;function Tt(){let t=null,n=!1,e=!1,o=null,c=null,d=!1;const m=(a,u)=>{for(let f=0;f<a.length;f++){const E=a.item(f);if(E&&E.identifier===u)return E}return null},S=()=>{o!==null&&(clearTimeout(o),o=null)},y=()=>{c!==null&&(clearTimeout(c),c=null)},x=()=>{n=!0,e=!0,S(),y(),o=setTimeout(()=>{n=!1,e=!1,o=null},bt)},R=a=>{if(a.touches.length!==1){t=null;return}const u=a.touches.item(0);if(!u){t=null;return}const f=window.innerWidth,E=u.clientX<=tt,P=u.clientX>=f-tt;if(!E&&!P){t=null;return}t={identifier:u.identifier,startX:u.clientX,startY:u.clientY,fromLeftEdge:E,moved:!1}},h=a=>{if(!t)return;if(a.touches.length!==1){t=null;return}const u=m(a.touches,t.identifier);if(!u){t=null;return}const f=u.clientX-t.startX,E=u.clientY-t.startY,P=Math.abs(f),i=Math.abs(E);if(i>et&&i>P*nt){t=null;return}const l=t.fromLeftEdge?f>0:f<0;P>et&&P>i*nt&&l&&(t.moved=!0)},T=a=>{if(!t)return;const u=m(a.changedTouches,t.identifier);if(!u){t=null;return}const f=u.clientX-t.startX,E=t.fromLeftEdge?f>0:f<0;if(t.moved&&E&&Math.abs(f)>=ot){x(),t=null;return}t.moved&&Math.abs(f)>=ot&&x(),t=null},A=()=>{t&&(t.moved&&x(),t=null)};return{initialize:()=>{if(typeof window>"u"||d)return;d=!0;const a={passive:!0,capture:!0};window.addEventListener("touchstart",R,a),window.addEventListener("touchmove",h,a),window.addEventListener("touchend",T,a),window.addEventListener("touchcancel",A,a)},destroy:()=>{if(typeof window>"u"||!d)return;d=!1;const a={capture:!0};window.removeEventListener("touchstart",R,a),window.removeEventListener("touchmove",h,a),window.removeEventListener("touchend",T,a),window.removeEventListener("touchcancel",A,a),S(),y(),t=null,n=!1,e=!1},isSwipeBack:()=>{const a=n||e;return a&&S(),a},onPageEnter:()=>{n=!1,S(),y(),c=setTimeout(()=>{e=!1,c=null},0)}}}function Pt(){let t=null;function n(){var o,c;t&&((o=t.outResolve)==null||o.call(t,null),(c=t.inResolve)==null||c.call(t,null),t=null)}function e(){if(t!=null&&t.from&&(t!=null&&t.to)&&(t!=null&&t.outResolve)&&(t!=null&&t.inResolve)){if(t.from===t.to){n();return}const o={from:t.from,to:t.to};t.outResolve(o),t.inResolve(o),t=null}}return{trigger(o,c){var m;c==="out"&&(t==null?void 0:t.to)===o&&!t.from&&((m=t.inResolve)==null||m.call(t,null),t={}),t&&(c==="out"&&t.from&&t.from!==o||c==="in"&&t.to&&t.to!==o)&&n(),t||(t={}),c==="out"?t.from=o:t.to=o},get(o){return new Promise(c=>{t||(t={}),o==="out"?t.outResolve=c:t.inResolve=c,e()})}}}const X=new Map;let z=null,rt=!1;function it(t){if(t instanceof HTMLElement&&X.has(t)){const n=X.get(t);X.delete(t),queueMicrotask(n)}for(const n of Array.from(t.childNodes))it(n)}function Rt(){if(rt||typeof document>"u")return;rt=!0,z=new MutationObserver(n=>{for(const e of n)for(const o of Array.from(e.removedNodes))it(o)});const t=()=>{z==null||z.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function At(t,n){return Rt(),X.set(t,n),()=>{X.delete(t)}}function xt(t){return Array.isArray(t)}function lt(t){const n=[];for(const e of t)xt(e)?n.push(...lt(e)):n.push(e);return n}function Lt(t,n={}){const{transitions:e=[],middleware:o=(r,s)=>({from:r,to:s}),preserveScroll:c=r=>r}=t,d=n.host??new st,m=Pt(),S=yt(lt(e)),y=Tt();y.initialize();const{initializeContext:x,calculateScrollOffset:R,evictScrollPosition:h,shouldPreserve:T,getScrollContainer:A,getPositionedParentElement:O,getScrollPosition:I}=St({preserveScroll:c});let L=null,k=null;const a=new WeakMap,u=r=>{a.set(r,{parent:r.parentElement,nextSibling:r.nextElementSibling})},f=r=>{const s=a.get(r);return s||{parent:r.parentElement,nextSibling:r.nextElementSibling}},E=(r,s,b,w,B)=>{const K=w.element,D=B.element,{parent:M,nextSibling:C}=w.parent?{parent:w.parent,nextSibling:w.nextSibling}:f(K),_=K.cloneNode(!0),q={scrollOffset:R(s,b),from:{scroll:I(s)},to:{scroll:I(b)},get scrollingElement(){return A()||document.documentElement},get positionedParent(){return O()}};dt(_,q),T(s)||h(s);const j=Promise.resolve(_),Z=Promise.resolve(D),J=[],ct={from:j,to:Z,context:q,createElement:((Y,$="div")=>{const N=document.createElement($);return N.setAttribute("data-ssgoi-id",Y),J.push(N),N})},at=Promise.resolve(r.prepare?r.prepare(ct):{});gt({from:j,to:Z,extras:at}).then(({from:Y,to:$,extras:N})=>{M&&(C&&M.contains(C)?M.insertBefore(_,C):M.appendChild(_));const G=r.animation({from:Y,to:$,context:q,...N}),U=G.onComplete;G.onComplete=()=>{U==null||U(),_.parentElement&&_.parentElement.removeChild(_);for(const V of J)V.parentElement&&V.parentElement.removeChild(V)},d.attach(G)})},P=(r,s)=>{const b=y.isSwipeBack();m.trigger(r,s),m.get(s).then(w=>{if(s==="in"&&y.onPageEnter(),!w)return;if(b){s==="out"&&w.from&&!T(w.from)&&h(w.from),L=null,k=null;return}if(s!=="in")return;const{from:B,to:K}=o(w.from,w.to),D=pt(B,K,S),M=L,C=k;L=null,k=null,!(!D||!M||!C)&&E(D,B,K,M,C)})},i=(r,s)=>{const b=f(r);L={element:r,parent:b.parent,nextSibling:b.nextSibling};const w=r.getAttribute("data-ssgoi-transition")??s;P(w,"out")},l=new WeakSet,g=(r,s)=>{l.has(s)||(l.add(s),u(s),x(s,r),k={element:s,parent:s.parentElement,nextSibling:s.nextElementSibling},P(r,"in"),At(s,()=>i(s,r)))},p=new Map;return{register:g,refFor:r=>{let s=p.get(r);return s||(s=b=>{b&&g(r,b)},p.set(r,s)),s}}}exports.Animation=H.Animation;exports.MultiAnimation=H.MultiAnimation;exports.WebAnimation=H.WebAnimation;exports.HostAnimation=st;exports.createSggoiTransitionContext=Lt;
package/dist/internal.js CHANGED
@@ -24,8 +24,8 @@ class fe extends ue {
24
24
  };
25
25
  const d = t.onUpdate;
26
26
  t.onUpdate = (h) => {
27
- var w;
28
- d == null || d(h), (w = this.onUpdate) == null || w.call(this, h), this.notify();
27
+ var S;
28
+ d == null || d(h), (S = this.onUpdate) == null || S.call(this, h), this.notify();
29
29
  }, this._state === "paused" ? t.pause() : this._state === "reversing" ? t.reverse() : (this._state = "playing", t.play()), this.notify();
30
30
  }
31
31
  play() {
@@ -162,9 +162,9 @@ function Se(e = {}) {
162
162
  const h = () => {
163
163
  const i = (o == null ? void 0 : o.clientWidth) ?? 0, l = i > 0 ? i : typeof window < "u" ? window.innerWidth : 0;
164
164
  return l > 0 && l < ve;
165
- }, w = () => (d || (c = h(), d = !0), c), y = (i) => {
165
+ }, S = () => (d || (c = h(), d = !0), c), y = (i) => {
166
166
  var v;
167
- const l = t(w());
167
+ const l = t(S());
168
168
  if (l === !1)
169
169
  return { preserves: !1, shared: !1, storageKey: `path:${i}` };
170
170
  if (l === !0)
@@ -176,7 +176,7 @@ function Se(e = {}) {
176
176
  storageKey: p ? `shared:${l.key}` : `path:${i}`
177
177
  };
178
178
  }, x = (i) => y(i).preserves;
179
- let P = null;
179
+ let R = null;
180
180
  const m = /* @__PURE__ */ new Map();
181
181
  let T = null, A = !1, O = 0;
182
182
  const I = () => {
@@ -204,7 +204,7 @@ function Se(e = {}) {
204
204
  initializeContext: (i, l) => {
205
205
  A = !0;
206
206
  const g = ++O;
207
- P = i, o || (o = he(i), c = h(), d = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
207
+ R = i, o || (o = he(i), c = h(), d = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
208
208
  c = h();
209
209
  }).observe(o), (o === document.documentElement ? window : o).addEventListener("scroll", I, {
210
210
  passive: !0
@@ -227,7 +227,7 @@ function Se(e = {}) {
227
227
  },
228
228
  shouldPreserve: x,
229
229
  getScrollContainer: () => o,
230
- getPositionedParentElement: () => P ? me(P) : document.body,
230
+ getPositionedParentElement: () => R ? me(R) : document.body,
231
231
  getScrollPosition: (i) => {
232
232
  const l = i ? y(i).storageKey : null;
233
233
  return l && m.has(l) ? m.get(l) : { x: 0, y: 0 };
@@ -243,15 +243,15 @@ function Te() {
243
243
  if (E && E.identifier === u) return E;
244
244
  }
245
245
  return null;
246
- }, w = () => {
246
+ }, S = () => {
247
247
  o !== null && (clearTimeout(o), o = null);
248
248
  }, y = () => {
249
249
  c !== null && (clearTimeout(c), c = null);
250
250
  }, x = () => {
251
- n = !0, t = !0, w(), y(), o = setTimeout(() => {
251
+ n = !0, t = !0, S(), y(), o = setTimeout(() => {
252
252
  n = !1, t = !1, o = null;
253
253
  }, be);
254
- }, P = (a) => {
254
+ }, R = (a) => {
255
255
  if (a.touches.length !== 1) {
256
256
  e = null;
257
257
  return;
@@ -261,8 +261,8 @@ function Te() {
261
261
  e = null;
262
262
  return;
263
263
  }
264
- const f = window.innerWidth, E = u.clientX <= Q, R = u.clientX >= f - Q;
265
- if (!E && !R) {
264
+ const f = window.innerWidth, E = u.clientX <= Q, P = u.clientX >= f - Q;
265
+ if (!E && !P) {
266
266
  e = null;
267
267
  return;
268
268
  }
@@ -284,13 +284,13 @@ function Te() {
284
284
  e = null;
285
285
  return;
286
286
  }
287
- const f = u.clientX - e.startX, E = u.clientY - e.startY, R = Math.abs(f), i = Math.abs(E);
288
- if (i > ee && i > R * te) {
287
+ const f = u.clientX - e.startX, E = u.clientY - e.startY, P = Math.abs(f), i = Math.abs(E);
288
+ if (i > ee && i > P * te) {
289
289
  e = null;
290
290
  return;
291
291
  }
292
292
  const l = e.fromLeftEdge ? f > 0 : f < 0;
293
- R > ee && R > i * te && l && (e.moved = !0);
293
+ P > ee && P > i * te && l && (e.moved = !0);
294
294
  }, T = (a) => {
295
295
  if (!e) return;
296
296
  const u = h(a.changedTouches, e.identifier);
@@ -311,22 +311,22 @@ function Te() {
311
311
  if (typeof window > "u" || d) return;
312
312
  d = !0;
313
313
  const a = { passive: !0, capture: !0 };
314
- window.addEventListener("touchstart", P, a), window.addEventListener("touchmove", m, a), window.addEventListener("touchend", T, a), window.addEventListener("touchcancel", A, a);
314
+ window.addEventListener("touchstart", R, a), window.addEventListener("touchmove", m, a), window.addEventListener("touchend", T, a), window.addEventListener("touchcancel", A, a);
315
315
  }, destroy: () => {
316
316
  if (typeof window > "u" || !d) return;
317
317
  d = !1;
318
318
  const a = { capture: !0 };
319
- window.removeEventListener("touchstart", P, a), window.removeEventListener("touchmove", m, a), window.removeEventListener("touchend", T, a), window.removeEventListener("touchcancel", A, a), w(), y(), e = null, n = !1, t = !1;
319
+ window.removeEventListener("touchstart", R, a), window.removeEventListener("touchmove", m, a), window.removeEventListener("touchend", T, a), window.removeEventListener("touchcancel", A, a), S(), y(), e = null, n = !1, t = !1;
320
320
  }, isSwipeBack: () => {
321
321
  const a = n || t;
322
- return a && w(), a;
322
+ return a && S(), a;
323
323
  }, onPageEnter: () => {
324
- n = !1, w(), y(), c = setTimeout(() => {
324
+ n = !1, S(), y(), c = setTimeout(() => {
325
325
  t = !1, c = null;
326
326
  }, 0);
327
327
  } };
328
328
  }
329
- function Re() {
329
+ function Pe() {
330
330
  let e = null;
331
331
  function n() {
332
332
  var o, c;
@@ -364,7 +364,7 @@ function re(e) {
364
364
  for (const n of Array.from(e.childNodes))
365
365
  re(n);
366
366
  }
367
- function Pe() {
367
+ function Re() {
368
368
  if (oe || typeof document > "u") return;
369
369
  oe = !0, z = new MutationObserver((n) => {
370
370
  for (const t of n)
@@ -377,7 +377,7 @@ function Pe() {
377
377
  document.body ? e() : document.addEventListener("DOMContentLoaded", e, { once: !0 });
378
378
  }
379
379
  function Ae(e, n) {
380
- return Pe(), X.set(e, n), () => {
380
+ return Re(), X.set(e, n), () => {
381
381
  X.delete(e);
382
382
  };
383
383
  }
@@ -395,13 +395,13 @@ function Ce(e, n = {}) {
395
395
  transitions: t = [],
396
396
  middleware: o = (r, s) => ({ from: r, to: s }),
397
397
  preserveScroll: c = (r) => r
398
- } = e, d = n.host ?? new fe(), h = Re(), w = ye(
398
+ } = e, d = n.host ?? new fe(), h = Pe(), S = ye(
399
399
  se(t)
400
400
  ), y = Te();
401
401
  y.initialize();
402
402
  const {
403
403
  initializeContext: x,
404
- calculateScrollOffset: P,
404
+ calculateScrollOffset: R,
405
405
  evictScrollPosition: m,
406
406
  shouldPreserve: T,
407
407
  getScrollContainer: A,
@@ -420,9 +420,9 @@ function Ce(e, n = {}) {
420
420
  parent: r.parentElement,
421
421
  nextSibling: r.nextElementSibling
422
422
  };
423
- }, E = (r, s, b, S, B) => {
424
- const K = S.element, D = B.element, { parent: _, nextSibling: C } = S.parent ? { parent: S.parent, nextSibling: S.nextSibling } : f(K), M = K.cloneNode(!0), H = {
425
- scrollOffset: P(s, b),
423
+ }, E = (r, s, b, w, B) => {
424
+ const K = w.element, D = B.element, { parent: _, nextSibling: C } = w.parent ? { parent: w.parent, nextSibling: w.nextSibling } : f(K), M = K.cloneNode(!0), H = {
425
+ scrollOffset: R(s, b),
426
426
  from: { scroll: I(s) },
427
427
  to: { scroll: I(b) },
428
428
  get scrollingElement() {
@@ -462,22 +462,22 @@ function Ce(e, n = {}) {
462
462
  U.parentElement && U.parentElement.removeChild(U);
463
463
  }, d.attach($);
464
464
  });
465
- }, R = (r, s) => {
465
+ }, P = (r, s) => {
466
466
  const b = y.isSwipeBack();
467
- h.trigger(r, s), h.get(s).then((S) => {
468
- if (s === "in" && y.onPageEnter(), !S) return;
467
+ h.trigger(r, s), h.get(s).then((w) => {
468
+ if (s === "in" && y.onPageEnter(), !w) return;
469
469
  if (b) {
470
- s === "out" && S.from && !T(S.from) && m(S.from), L = null, k = null;
470
+ s === "out" && w.from && !T(w.from) && m(w.from), L = null, k = null;
471
471
  return;
472
472
  }
473
473
  if (s !== "in") return;
474
474
  const { from: B, to: K } = o(
475
- S.from,
476
- S.to
475
+ w.from,
476
+ w.to
477
477
  ), D = pe(
478
478
  B,
479
479
  K,
480
- w
480
+ S
481
481
  ), _ = L, C = k;
482
482
  L = null, k = null, !(!D || !_ || !C) && E(D, B, K, _, C);
483
483
  });
@@ -487,13 +487,15 @@ function Ce(e, n = {}) {
487
487
  element: r,
488
488
  parent: b.parent,
489
489
  nextSibling: b.nextSibling
490
- }, R(s, "out");
490
+ };
491
+ const w = r.getAttribute("data-ssgoi-transition") ?? s;
492
+ P(w, "out");
491
493
  }, l = /* @__PURE__ */ new WeakSet(), g = (r, s) => {
492
494
  l.has(s) || (l.add(s), u(s), x(s, r), k = {
493
495
  element: s,
494
496
  parent: s.parentElement,
495
497
  nextSibling: s.nextElementSibling
496
- }, R(r, "in"), Ae(s, () => i(s, r)));
498
+ }, P(r, "in"), Ae(s, () => i(s, r)));
497
499
  }, p = /* @__PURE__ */ new Map();
498
500
  return { register: g, refFor: (r) => {
499
501
  let s = p.get(r);
@@ -1 +1 @@
1
- {"version":3,"file":"create-ssgoi-transition-context.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-ssgoi-transition-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EACX,YAAY,EAMb,MAAM,QAAQ,CAAC;AAQhB,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAiC5D;;;;;;;;;GASG;AACH,MAAM,WAAW,mCAAmC;IAClD;;;;OAIG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,WAAW,EACpB,cAAc,GAAE,mCAAwC,GACvD,YAAY,CAuPd"}
1
+ {"version":3,"file":"create-ssgoi-transition-context.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-ssgoi-transition-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EACX,YAAY,EAMb,MAAM,QAAQ,CAAC;AAQhB,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAiC5D;;;;;;;;;GASG;AACH,MAAM,WAAW,mCAAmC;IAClD;;;;OAIG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,WAAW,EACpB,cAAc,GAAE,mCAAwC,GACvD,YAAY,CA2Pd"}
@@ -3,11 +3,8 @@ import { PresetConfig } from '../utils';
3
3
  import { FadeOptions, FadeType, FadeVariant } from './types';
4
4
  export type { FadeOptions, FadeType, FadeVariant } from './types';
5
5
  /**
6
- * Fade preset configuration.
7
- *
8
- * Default `type` is `"fade-through"` (sequential fade-out → fade-in).
9
- * The `"cross-fade"` type and `"smooth"` variant are tracked on the TODO
10
- * board and intentionally not part of the public type yet.
6
+ * Fade preset configuration. Default `type` is `"fade-through"` —
7
+ * sequential fade-out → fade-in.
11
8
  */
12
9
  export type FadeConfig = PresetConfig<{
13
10
  paths: readonly string[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/fade/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAkC,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,CACnC;IAAE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,EAC5B,QAAQ,EACR,WAAW,EACX,WAAW,CACZ,CAAC;AAEF,wBAAgB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,mBAAmB,EAAE,CAG9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/fade/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAkC,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7E,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElE;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,CACnC;IAAE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,EAC5B,QAAQ,EACR,WAAW,EACX,WAAW,CACZ,CAAC;AAEF,wBAAgB,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,mBAAmB,EAAE,CAG9D"}
@@ -1,12 +1,6 @@
1
1
  /**
2
- * Public option shapes for the fade preset.
3
- *
4
- * Default `type` is `"fade-through"` — the current sequential
5
- * fade-out → fade-in behavior.
6
- *
7
- * Not yet exposed (tracked separately on the TODO board):
8
- * - `type: "cross-fade"` (simultaneous fade)
9
- * - `variant: "smooth"`
2
+ * Public option shapes for the fade preset. Default `type` is
3
+ * `"fade-through"` — the sequential fade-out → fade-in behavior.
10
4
  */
11
5
  export type FadeType = "fade-through";
12
6
  export type FadeVariant = "default";
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/fade/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,QAAQ,GAAG,cAAc,CAAC;AAEtC,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC;AAEpC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/fade/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,QAAQ,GAAG,cAAc,CAAC;AAEtC,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC;AAEpC,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/zoom/provider/blur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAEV,iBAAiB,EACjB,UAAU,EAEV,cAAc,EACd,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAoC,MAAM,oBAAoB,CAAC;AAGjF,eAAO,MAAM,YAAY,EAAE,cAE1B,CAAC;AAmEF,qBAAa,sBAAuB,YAAW,YAAY;IACzD,QAAQ,CAAC,OAAO,iBAAgB;IAEhC,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,EAAE;CAkBhD;AAQD,qBAAa,eAAgB,YAAW,YAAY;IAClD,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAQjD,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,EAAE;CAWhD;AAMD,wBAAgB,kBAAkB,IAAI,YAAY,CASjD"}
1
+ {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/zoom/provider/blur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAEV,iBAAiB,EACjB,UAAU,EAEV,cAAc,EACd,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,SAAS,EAGV,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,YAAY,EAAE,cAM1B,CAAC;AAsEF,qBAAa,sBAAuB,YAAW,YAAY;IACzD,QAAQ,CAAC,OAAO,iBAAgB;IAEhC,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,EAAE;CAkBhD;AAQD,qBAAa,eAAgB,YAAW,YAAY;IAClD,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAQjD,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,EAAE;CAehD;AAMD,wBAAgB,kBAAkB,IAAI,YAAY,CASjD"}
@@ -1 +1 @@
1
- {"version":3,"file":"expand.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/zoom/provider/expand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAGV,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAoC,MAAM,oBAAoB,CAAC;AAEjF,eAAO,MAAM,cAAc,EAAE,cAE5B,CAAC;AAuFF,qBAAa,wBAAyB,YAAW,YAAY;IAC3D,QAAQ,CAAC,OAAO,iBAAkB;IAElC,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,EAAE;CAoBhD;AAUD,wBAAgB,oBAAoB,IAAI,YAAY,CAQnD"}
1
+ {"version":3,"file":"expand.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/zoom/provider/expand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAGV,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,SAAS,EAGV,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,cAAc,EAAE,cAM5B,CAAC;AAqFF,qBAAa,wBAAyB,YAAW,YAAY;IAC3D,QAAQ,CAAC,OAAO,iBAAkB;IAElC,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,EAAE;CAoBhD;AAUD,wBAAgB,oBAAoB,IAAI,YAAY,CAQnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/zoom/provider/static.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAEV,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,eAAO,MAAM,cAAc,EAAE,cAE5B,CAAC;AAgBF,qBAAa,wBAAyB,YAAW,YAAY;IAC3D,QAAQ,CAAC,OAAO,iBAAkB;IAElC,UAAU,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,EAAE;CAGjD;AAMD,wBAAgB,oBAAoB,IAAI,YAAY,CAQnD"}
1
+ {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/zoom/provider/static.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAEV,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,eAAO,MAAM,cAAc,EAAE,cAM5B,CAAC;AAgBF,qBAAa,wBAAyB,YAAW,YAAY;IAC3D,QAAQ,CAAC,OAAO,iBAAkB;IAElC,UAAU,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,EAAE;CAGjD;AAMD,wBAAgB,oBAAoB,IAAI,YAAY,CAQnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/zoom/transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAa/D,OAAO,KAAK,EACV,qBAAqB,EAGrB,UAAU,EAKX,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA4Q5E,eAAO,MAAM,IAAI,GACf,SAAS,qBAAqB,KAC7B,gBAAgB,CAAC,UAAU,CAmF7B,CAAC"}
1
+ {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../../src/lib/transitions/zoom/transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAU/D,OAAO,KAAK,EACV,qBAAqB,EAGrB,UAAU,EAKX,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAqR5E,eAAO,MAAM,IAAI,GACf,SAAS,qBAAqB,KAC7B,gBAAgB,CAAC,UAAU,CAoF7B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssgoi/core",
3
- "version": "6.2.0",
3
+ "version": "6.2.2",
4
4
  "description": "Core animation engine for SSGOI - Native app-like page transitions with spring physics",
5
5
  "private": false,
6
6
  "type": "module",