@ssgoi/core 7.1.0 → 7.1.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 +11 -11
- package/dist/index.js +1152 -977
- package/dist/transitions/hero/transition.d.ts +12 -0
- package/dist/transitions/hero/transition.d.ts.map +1 -1
- package/dist/transitions/inset-clip.d.ts +16 -0
- package/dist/transitions/inset-clip.d.ts.map +1 -0
- package/dist/transitions/media-geometry.d.ts +10 -0
- package/dist/transitions/media-geometry.d.ts.map +1 -1
- package/dist/transitions/zoom/transition.d.ts.map +1 -1
- package/dist/transitions/zoom/zoom-element.d.ts.map +1 -1
- package/dist/utils/get-client-rect.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var pe=Object.defineProperty;var de=(t,e,n)=>e in t?pe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var T=(t,e,n)=>de(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./multi-animation-B5hEmEgN.cjs"),b=require("./page-motion-gH3WomQO.cjs"),Nt=require("./timeline-Zoo1I4XU.cjs");class ue{constructor(e){T(this,"durationSec");this.durationSec=Math.max(1/60,e.durationSec)}step(e,n,o){const i=n-e.position;if(i===0)return e;const r=Math.sign(i),s=Math.abs(i)/this.durationSec,l=r*s*o,c=e.position+l;return(r>0?c>=n:c<=n)?{position:n,velocity:0}:{position:c,velocity:r*s}}isSettled(e,n){return Math.abs(e.position-n)<Nt.POSITION_THRESHOLD}}function dt(t,e){function n(r){let s=0,l=0;const c=r.offsetWidth,a=r.offsetHeight;let d=r;for(;d;)s+=d.offsetTop,l+=d.offsetLeft,d=d.offsetParent;return s-=window.scrollY,l-=window.scrollX,{top:s,left:l,width:c,height:a}}const o=n(t),i=n(e);return new DOMRect(i.left-o.left,i.top-o.top,i.width,i.height)}function k(t,e){const n=t.getBoundingClientRect(),o=e.getBoundingClientRect(),i=(l,c)=>c>0&&Math.abs(l-c)>.5?l/c:1,r=i(n.width,t.offsetWidth),s=i(n.height,t.offsetHeight);return new DOMRect((o.left-n.left)/r,(o.top-n.top)/s,o.width/r,o.height/s)}function F(t,e){const{scrollingElement:n,positionedParent:o}=t,i=n!==o&&n.contains(o)?dt(n,o).top:0;return{top:t[e].scroll.y,left:0,width:n.clientWidth,height:n.clientHeight-i}}function zt(t,e){const{scrollingElement:n,positionedParent:o}=t,i=n!==o&&n.contains(o)?dt(n,o).top:0;return{top:t[e].scroll.y-i,height:n.clientHeight}}const mt=8,gt={spring:{stiffness:600,damping:40,doubleSpring:1.2}};function fe({direction:t}){const e=t==="forward"?mt:-mt;return{out:{willChange:"transform, opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${e}px, 0, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(${e*(1-n)}px, 0, 0)`,opacity:`${n}`})}}}function he(){return{outPhysics:gt,inPhysics:gt,composition:{mode:"parallel",startAt:[0,0]},build:fe}}const bt=30,ye={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},me={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function ge({direction:t}){const e=t==="forward"?1:-1,n=-bt*e,o=bt*e;return{out:{willChange:"transform, opacity",startStyle:{},animate:i=>({transform:`translate3d(${n*i}px, 0, 0)`,opacity:`${1-i}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${o}px, 0, 0)`,opacity:"0"},animate:i=>({transform:`translate3d(${o*(1-i)}px, 0, 0)`,opacity:`${i}`})}}}function be(){return{outPhysics:ye,inPhysics:me,composition:{mode:"sequence"},build:ge}}const we={snappy:he(),fluid:be()},wt=8,Se={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},Ce={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function xe({direction:t}){const e=t==="forward"?1:-1,n=-wt*e,o=wt*e;return{out:{willChange:"transform, opacity",startStyle:{},animate:i=>({transform:`translate3d(0, ${n*i}px, 0)`,opacity:`${1-i}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${o}px, 0)`,opacity:"0"},animate:i=>({transform:`translate3d(0, ${o*(1-i)}px, 0)`,opacity:`${i}`})}}}function $e(){return{outPhysics:Se,inPhysics:Ce,composition:{mode:"sequence"},build:xe}}const Ee=40,Pe={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},Ae={spring:{stiffness:400,damping:30,doubleSpring:1.2,restDelta:.1,restSpeed:.1}};function Ie(t){const e=Ee;return{out:{willChange:"opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${e}px, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(0, ${e*(1-n)}px, 0)`,opacity:`${n}`})}}}function Re(){return{outPhysics:Pe,inPhysics:Ae,composition:{mode:"parallel",startAt:[0,0]},build:Ie}}const St=$e(),ve={snappy:St,directional:St,"non-directional":Re()},Ct={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},U=.1,B=1/3,xt=t=>Math.max(0,Math.min(1,t));function _e({direction:t}){const e=t==="forward"?1:-1,n=1-e*U;return{out:{willChange:"transform, opacity",startStyle:{},animate:o=>({transform:`scale(${1+e*o*U})`,opacity:`${xt(1-o/B)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${n})`,opacity:"0"},animate:o=>({transform:`scale(${n+e*o*U})`,opacity:`${xt((o-B)/(1-B))}`})}}}function Oe(){return{outPhysics:Ct,inPhysics:Ct,composition:{mode:"parallel"},build:_e}}const $t={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},Z=.1,G=1/3,Et=t=>Math.max(0,Math.min(1,t));function Me(){return{out:{willChange:"opacity",startStyle:{},animate:t=>({opacity:`${Et(1-t/G)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${1-Z})`,opacity:"0"},animate:t=>({transform:`scale(${1-Z+t*Z})`,opacity:`${Et((t-G)/(1-G))}`})}}}function Fe(){return{outPhysics:$t,inPhysics:$t,composition:{mode:"parallel"},build:Me}}const Pt=Oe(),Te={snappy:Pt,directional:Pt,"non-directional":Fe()},Ye={x:we,y:ve,z:Te};function De(t,e){const n=Ye[t];return n[e]??n.snappy}const Le="x",ke="snappy";function At(t,e){t.style.willChange=e.willChange,t.style.backfaceVisibility="hidden",t.style.contain="layout paint";for(const[n,o]of Object.entries(e.startStyle))t.style[n]=o}function Vt(t){t.style.willChange="auto",t.style.backfaceVisibility="",t.style.contain="",t.style.transform="",t.style.opacity="",t.style.clipPath=""}function He(t){Vt(t),t.style.pointerEvents=""}const We=(t={})=>{const e=t.type??Le,n=t.feel??ke,o=De(e,n);return{prepare:({from:i,to:r,context:s})=>{const l=o.build({direction:s.direction});return i.then(c=>{At(c,l.out),c.style.pointerEvents="none"}),r.then(c=>{At(c,l.in)}),{}},animation:({from:i,to:r,context:s})=>{const l=o.build({direction:s.direction});if(e==="z"){const d=F(s,"from"),p=F(s,"to");i.style.clipPath=`inset(${d.top}px 0 calc(100% - ${d.top+d.height}px) 0)`,r.style.clipPath=`inset(${p.top}px 0 calc(100% - ${p.top+p.height}px) 0)`}const c=new m.WebAnimation({element:i,integrator:b.IntegratorProvider.from(o.outPhysics),style:d=>l.out.animate(d),onComplete:()=>He(i)}),a=new m.WebAnimation({element:r,integrator:b.IntegratorProvider.from(o.inPhysics),style:d=>l.in.animate(d),onComplete:()=>Vt(r)});return new m.MultiAnimation([c,a],o.composition)}}};function Ne(t,e,n){return t==="y"?e==="non-directional"?"non-directional":"directional":t!=="x"||e==="snappy"||n==="snappy"?"snappy":"fluid"}function ze(t={}){const e=t.type??"x",n=t.variant,o=t.feel,i=Ne(e,n,o);return We({type:e,feel:i})}const Ve={spring:{stiffness:200,damping:22}},Xe=10,Ue="horizontal",Be="#000000";function It(t,e,n,o,i,r){window.getComputedStyle(t).position==="static"&&(t.style.position="relative");const l=document.createElement("div");l.style.cssText=`
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -7,29 +7,29 @@
|
|
|
7
7
|
pointer-events: none;
|
|
8
8
|
z-index: 9999;
|
|
9
9
|
overflow: hidden;
|
|
10
|
-
`;const c=[];for(let a=0;a<e;a++){const
|
|
10
|
+
`;const c=[];for(let a=0;a<e;a++){const d=document.createElement("div");if(n==="horizontal"){const p=100/e;d.style.cssText=`
|
|
11
11
|
position: absolute;
|
|
12
|
-
top: ${
|
|
12
|
+
top: ${p*a}%;
|
|
13
13
|
left: 0;
|
|
14
14
|
width: 100%;
|
|
15
|
-
height: calc(${
|
|
15
|
+
height: calc(${p}% + 1px);
|
|
16
16
|
background: ${o};
|
|
17
17
|
transform: scaleX(${i==="hidden"?0:1});
|
|
18
|
-
transform-origin: ${
|
|
18
|
+
transform-origin: ${r} center;
|
|
19
19
|
will-change: transform;
|
|
20
|
-
`}else{const
|
|
20
|
+
`}else{const p=100/e;d.style.cssText=`
|
|
21
21
|
position: absolute;
|
|
22
22
|
top: 0;
|
|
23
|
-
left: ${
|
|
24
|
-
width: calc(${
|
|
23
|
+
left: ${p*a}%;
|
|
24
|
+
width: calc(${p}% + 1px);
|
|
25
25
|
height: 100%;
|
|
26
26
|
background: ${o};
|
|
27
27
|
transform: scaleY(${i==="hidden"?0:1});
|
|
28
|
-
transform-origin: ${
|
|
28
|
+
transform-origin: ${r==="left"?"top":"bottom"} center;
|
|
29
29
|
will-change: transform;
|
|
30
|
-
`}c.push(
|
|
30
|
+
`}c.push(d),l.appendChild(d)}return t.appendChild(l),{container:l,blinds:c}}const Ze=(t={})=>{const e=t.blindCount??Xe,n=t.direction??Ue,o=t.blindColor??Be,i=t.physics??Ve;return{prepare:async({from:r,to:s})=>{const l=await r,c=await s;l.style.zIndex="1000";const a=It(l,e,n,o,"hidden","left");c.style.position="relative",c.style.zIndex="0";const d=It(c,e,n,o,"closed","right");return{fromEl:l,fromBlinds:a.blinds,fromContainer:a.container,toBlinds:d.blinds,toContainer:d.container}},animation:({fromEl:r,fromBlinds:s,fromContainer:l,toBlinds:c,toContainer:a})=>{const d=s.map(f=>new m.WebAnimation({element:f,integrator:b.IntegratorProvider.from(i),style:y=>({transform:n==="horizontal"?`scaleX(${y})`:`scaleY(${y})`})})),p=c.map((f,y)=>new m.WebAnimation({element:f,integrator:b.IntegratorProvider.from(i),style:(g,C)=>({transform:n==="horizontal"?`scaleX(${C})`:`scaleY(${C})`}),onComplete:y===c.length-1?()=>{a.remove(),l.remove(),r.style.zIndex="",r.style.position=""}:void 0})),u=new m.MultiAnimation(d,{mode:"parallel"}),h=new m.MultiAnimation(p,{mode:"parallel"});return new m.MultiAnimation([u,h],{mode:"sequence"})}}};function Ge(t={}){const{type:e="horizontal"}=t;return Ze({direction:e})}const je={spring:{stiffness:250,damping:23,doubleSpring:.7}},L=.5;function qe(t){const e=t==="enter"?-100:100,n=t==="enter"?100:-100;return{out:{willChange:"transform, opacity",startStyle:{},animate:o=>({transform:`translate3d(${e*o}%, 0, 0)`,opacity:`${L+(1-L)*(1-o)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${n}%, 0, 0)`,opacity:`${L}`},animate:o=>({transform:`translate3d(${n*(1-o)}%, 0, 0)`,opacity:`${L+(1-L)*o}`})}}}function Ke(){return{physics:je,build:qe}}const Je={spring:{stiffness:230,damping:25,doubleSpring:{stiffness:600,damping:50}}};function Qe(t){const e=t==="enter"?-20:100,n=t==="enter"?100:-20;return{out:{willChange:"transform",startStyle:{},animate:o=>({transform:`translate3d(${e*o}%, 0, 0)`})},in:{willChange:"transform",startStyle:{transform:`translate3d(${n}%, 0, 0)`},animate:o=>({transform:`translate3d(${n*(1-o)}%, 0, 0)`})}}}function tn(){return{physics:Je,build:Qe}}const en={parallax:tn(),crossfade:Ke()},v="0",Xt="1",_="2",nn="parallax";function Rt(t,e){t.style.willChange=e.willChange,t.style.backfaceVisibility="hidden",t.style.contain="layout paint";for(const[n,o]of Object.entries(e.startStyle))t.style[n]=o}const on=(t={})=>{const e=en[t.type??nn],n=e.physics;return{prepare:({from:o,to:i,context:r})=>{const s=r.direction==="forward"?"enter":"exit",l=e.build(s),c=s==="enter"?v:_,a=s==="enter"?_:v;return o.then(d=>{Rt(d,l.out),d.style.pointerEvents="none",d.style.zIndex=c}),i.then(d=>{Rt(d,l.in),d.style.position="relative",d.style.zIndex=a}),{}},animation:({from:o,to:i,context:r})=>{const s=r.direction==="forward"?"enter":"exit",l=e.build(s),c=s==="enter"?_:v,a=new m.WebAnimation({element:o,integrator:b.IntegratorProvider.from(n),style:p=>l.out.animate(p),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform="",o.style.opacity="",o.style.pointerEvents="",o.style.zIndex=""}}),d=new m.WebAnimation({element:i,integrator:b.IntegratorProvider.from(n),style:p=>l.in.animate(p),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform="",i.style.opacity="",i.style.position==="relative"&&(i.style.position=""),i.style.zIndex===c&&(i.style.zIndex="")}});for(const p of[a,d]){const u=p.onComplete;p.onComplete=()=>{u==null||u(),p.releaseFill()}}return new m.MultiAnimation([a,d],{mode:"parallel"})}}};function rn(t){return t==="slide"||t==="crossfade"?"crossfade":"parallax"}function sn(t={}){const e=t.type,n=rn(e);return on({type:n})}const an=(t={})=>{const e=t.physics??b.FADE_IN_PHYSICS,n=t.physics??b.FADE_OUT_PHYSICS;return{prepare:({to:o})=>(o.then(i=>{i.style.opacity="0",i.style.willChange="opacity"}),{}),animation:({from:o,to:i})=>{const r=new m.WebAnimation({element:o,integrator:b.IntegratorProvider.from(n),style:l=>({opacity:b.pageMotionStyle("fade","out","forward",l).opacity}),onComplete:()=>{o.style.willChange="auto",o.style.opacity=""}}),s=new m.WebAnimation({element:i,integrator:b.IntegratorProvider.from(e),style:l=>({opacity:b.pageMotionStyle("fade","in","forward",l).opacity}),onComplete:()=>{i.style.willChange="auto",i.style.opacity=""}});return new m.MultiAnimation([r,s],{mode:"sequence"})}}};function ln(t={}){return an()}const j={scaleDown:{stiffness:20,damping:7},translate:{stiffness:15,damping:7},scaleUp:{stiffness:20,damping:7}},Y={scaleDown:0,translate:.2,scaleUp:.8},cn=.8,pn="white",vt=1e3/60,dn=600;function un(t){const{items:e,from:n,to:o,recordFrame:i}=t,r=vt/1e3,s=Math.abs(o-n),l=e.map(a=>({item:a,integrator:new b.SpringIntegrator({stiffness:a.spring.stiffness,damping:a.spring.damping}),state:{position:n,velocity:0},started:!1,settled:!1,settleTime:0}));for(let a=0;a<l.length;a++)(a===0||l[a].item.offset===0)&&(l[a].started=!0);i(0);let c=0;for(let a=1;a<=dn;a++){const d=a*vt;c=d;for(const p of l)!p.started||p.settled||(p.state=p.integrator.step(p.state,o,r),p.integrator.isSettled(p.state,o)?(p.settleTime+=r,p.settleTime>=Nt.SETTLE_THRESHOLD&&(p.state={position:o,velocity:0},p.settled=!0)):p.settleTime=0,p.item.tick(p.state.position));for(let p=1;p<l.length;p++){const u=l[p];if(u.started)continue;const h=l[p-1];if(!h.started)continue;(s===0?1:Math.abs(h.state.position-n)/s)>=u.item.offset&&(u.started=!0)}if(i(d),l.every(p=>p.settled))return d}return c}function q(t,e){return t!=null&&t.spring?{stiffness:t.spring.stiffness,damping:t.spring.damping}:e}function _t(t){const{rect:e,scale:n,direction:o,override:i}=t,r=o==="out"?{scale:1,translateY:-e.top}:{scale:n,translateY:-e.top+e.height},s=q(i,j.scaleDown),l=q(i,j.translate),c=q(i,j.scaleUp),a=o==="out"?1:0,d=o==="out"?0:1,p=o==="out"?[{spring:s,offset:Y.scaleDown,tick:f=>{const y=1-f;r.scale=1-(1-n)*y}},{spring:l,offset:Y.translate,tick:f=>{const y=1-f;r.translateY=-e.top-e.height*y}},{spring:c,offset:Y.scaleUp,tick:f=>{const y=1-f;r.scale=n+(1-n)*y}}]:[{spring:s,offset:Y.scaleDown,tick:f=>{r.scale=1-(1-n)*f}},{spring:l,offset:Y.translate,tick:f=>{r.translateY=-e.top+e.height*(1-f)}},{spring:c,offset:Y.scaleUp,tick:f=>{r.scale=n+(1-n)*f}}],u=[],h=un({items:p,from:a,to:d,recordFrame:f=>u.push({time:f,scale:r.scale,translateY:r.translateY})});return{snapshots:u,totalDuration:h}}function fn(t,e){if(t.length===0)return{time:0,scale:1,translateY:0};if(t.length===1||e<=0)return t[0];if(e>=1)return t[t.length-1];const n=e*(t.length-1),o=Math.floor(n),i=Math.ceil(n);if(o===i)return t[o];const r=t[o],s=t[i],l=n-o;return{time:r.time+(s.time-r.time)*l,scale:r.scale+(s.scale-r.scale)*l,translateY:r.translateY+(s.translateY-r.translateY)*l}}const hn=[[1,1],[-1,1],[1,-1],[-1,-1]];function yn(t,e){const i=(r,s,l)=>{const c=document.createElement("div");Object.assign(c.style,{position:"fixed",pointerEvents:"none",zIndex:"9999",width:"15px",height:"15px",...r});const a=document.createElement("div");Object.assign(a.style,{position:"absolute",width:"15px",height:"1px",backgroundColor:t,[l]:"0",[s]:"0"});const d=document.createElement("div");return Object.assign(d.style,{position:"absolute",width:"1px",height:"15px",backgroundColor:t,[l]:"0",[s]:"0"}),c.appendChild(a),c.appendChild(d),c};return{topLeft:i({top:`${e.top-1}px`,left:`${e.left-1}px`},"left","top"),topRight:i({top:`${e.top-1}px`,left:`${e.left+e.width-15+1}px`},"right","top"),bottomLeft:i({top:`${e.top+e.height-15+1}px`,left:`${e.left-1}px`},"left","bottom"),bottomRight:i({top:`${e.top+e.height-15+1}px`,left:`${e.left+e.width-15+1}px`},"right","bottom")}}function Ot(t,e){const n=e.left+e.width/2,o=e.top+e.height/2;t.style.transformOrigin=`${n}px ${o}px`}function Mt(t,e){t.style.clipPath=`polygon(
|
|
31
31
|
${e.left}px ${e.top}px,
|
|
32
32
|
${e.left+e.width}px ${e.top}px,
|
|
33
33
|
${e.left+e.width}px ${e.top+e.height}px,
|
|
34
34
|
${e.left}px ${e.top+e.height}px
|
|
35
|
-
)`}function q(t,e,n,o,i){const s=n/1e3;return new m.WebAnimation({element:t,integrator:new ne({durationSec:s}),lowerBound:0,upperBound:1,style:r=>o(nn(e,r)),onComplete:i})}const sn=(t={})=>{var i;const e=((i=t.border)==null?void 0:i.color)??Qe,n=Je,o=t.physics;return{prepare:({from:s,to:r,context:l})=>{const c=O(l,"from"),a=O(l,"to"),p=k(document.body,l.positionedParent),u=rn(e,{...c,top:p.top});for(const d of["topLeft","topRight","bottomLeft","bottomRight"])l.positionedParent.appendChild(u[d]);return s.then(d=>{$t(d,c),Et(d,c),d.style.transform=`translateY(${-c.top}px)`}),r.then(d=>{$t(d,a),Et(d,a),d.style.transform=`translateY(${-a.top+a.height}px) scale(${n})`}),{borders:u,fromRect:c,toRect:a}},animation:({from:s,to:r,context:l,borders:c,fromRect:a,toRect:p})=>{const u=Ct({rect:a,scale:n,direction:"out",override:o}),d=Ct({rect:p,scale:n,direction:"in",override:o}),y=q(s,u.snapshots,u.totalDuration,w=>({transform:`translateY(${w.translateY}px) scale(${w.scale})`}),()=>{s.style.clipPath="",s.style.transformOrigin="",s.style.transform=""}),f=q(r,d.snapshots,d.totalDuration,w=>({transform:`translateY(${w.translateY}px) scale(${w.scale})`}),()=>{r.style.clipPath="",r.style.transformOrigin="",r.style.transform=""}),h=on.map(([w,$],x)=>{const C=["topLeft","topRight","bottomLeft","bottomRight"][x];return q(c[C],u.snapshots,u.totalDuration,A=>{const P=(a.width-a.width*A.scale)/2*.7*w,E=(a.height-a.height*A.scale)/2*.7*$;return{transform:`translate(${P}px, ${E}px)`}})}),b=new m.MultiAnimation([y,f,...h],{mode:"parallel"}),S=b.onComplete;return b.onComplete=()=>{S==null||S();const w=l.positionedParent;for(const $ of["topLeft","topRight","bottomLeft","bottomRight"]){const x=c[$];x.parentElement===w&&w.removeChild(x)}},b}}};function an(t={}){const{options:e}=t,n=(e==null?void 0:e.borderColor)!==void 0?{border:{color:e.borderColor}}:void 0;return sn(n)}function ln(t){if(!t)return null;if(t.includes("/")){const n=t.split("/");if(n.length!==2)return null;const o=Number.parseFloat(n[0]??""),i=Number.parseFloat(n[1]??"");return Number.isFinite(o)&&Number.isFinite(i)&&o>0&&i>0?o/i:null}const e=Number.parseFloat(t);return Number.isFinite(e)&&e>0?e:null}function cn(t){return t==="contain"||t==="cover"?t:null}function ot(t){return t.tagName==="IMG"}function pn(t){if(ot(t))return t;if(t.tagName==="PICTURE"||t.tagName==="VIDEO")return null;const e=[];for(const n of Array.from(t.children)){const o=n;ot(o)&&e.push(o)}return e.length===1?e[0]??null:null}function un(t){var c,a;if(!ot(t))return null;const e=t,n=e.naturalWidth,o=e.naturalHeight;if(typeof n=="number"&&typeof o=="number"&&Number.isFinite(n)&&Number.isFinite(o)&&n>0&&o>0)return n/o;const i=((c=t.getAttribute("width"))==null?void 0:c.trim())??"",s=((a=t.getAttribute("height"))==null?void 0:a.trim())??"",r=i===""?Number.NaN:Number(i),l=s===""?Number.NaN:Number(s);return Number.isFinite(r)&&Number.isFinite(l)&&r>0&&l>0?r/l:null}function dn(t){const e=t.trim().toLowerCase().replace(/\s+/g," ");return e===""||e==="center"||e==="center center"||e==="50% 50%"}function V(t){if(typeof getComputedStyle=="function")try{return getComputedStyle(t)}catch{}return t.style}function fn(t){const e=V(t),n=dn(e.objectPosition??"");return{fit:n?cn(e.objectFit??null):null,centered:n}}function Ht(t){if(!t)return 0;const e=/^(-?(?:\d+\.?\d*|\.\d+))px$/.exec(t.trim());if(!e)return null;const n=Number.parseFloat(e[1]??"");return Number.isFinite(n)&&n>=0?n:null}function Pt(t){const e=V(t),n=[e.borderTopLeftRadius,e.borderTopRightRadius,e.borderBottomRightRadius,e.borderBottomLeftRadius].map(Ht),o=n[0];if(o==null)return{radius:0,supported:!1};const i=n.every(s=>s!==null&&Math.abs(s-o)<.001);return{radius:i?o:0,supported:i}}function yn(t,e){var i;if(!e)return null;const n=(i=t.getAttribute(e))==null?void 0:i.trim();if(n==null||n==="")return null;const o=Number.parseFloat(n);return Number.isFinite(o)&&o>=0?o:null}function hn(t){const e=V(t);return[e.paddingTop,e.paddingRight,e.paddingBottom,e.paddingLeft,e.borderTopWidth,e.borderRightWidth,e.borderBottomWidth,e.borderLeftWidth].every(o=>o?Ht(o)===0:!0)}function mn(t){const e=V(t),n=o=>o==="hidden"||o==="clip";return n(e.overflowX)&&n(e.overflowY)}function _(t){return t.left+t.width/2}function R(t){return t.top+t.height/2}function at(t,e){return{top:Math.max(0,e.top-t.top),right:Math.max(0,t.left+t.width-(e.left+e.width)),bottom:Math.max(0,t.top+t.height-(e.top+e.height)),left:Math.max(0,e.left-t.left)}}function gn(t,e){const n=Math.max(t.left,e.left),o=Math.max(t.top,e.top),i=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height);return i>n&&s>o?{left:n,top:o,width:i-n,height:s-o}:null}function At(t,e){return Math.abs(t.left-e.left)<.01&&Math.abs(t.top-e.top)<.01&&Math.abs(t.width-e.width)<.01&&Math.abs(t.height-e.height)<.01}function bn(t,e,n){const o=t.width/t.height;let i,s;return n==="contain"?o>e?(s=t.height,i=s*e):(i=t.width,s=i/e):o>e?(i=t.width,s=i/e):(s=t.height,i=s*e),{left:t.left+(t.width-i)/2,top:t.top+(t.height-s)/2,width:i,height:s}}function Wt(t,e,n){const o=e!==null&&n!==null&&t.width>0&&t.height>0?bn(t,e,n):t,i=n==="contain"?o:t;return{bbox:t,content:o,window:i,clipInset:at(o,i),aspectRatio:e,fit:n,radius:0,radiusSource:"none",bboxRadius:0,bboxRadiusSource:"none",contentAware:e!==null&&n!==null,mediaElement:null}}function it(t,e,n){return{...Wt(t,null,null),radius:e,radiusSource:n,bboxRadius:e,bboxRadiusSource:n}}function Nt(t,e){const n=t.aspectRatio,o=e.aspectRatio;return t.contentAware&&e.contentAware&&n!==null&&o!==null&&Math.abs(n-o)/Math.max(n,o)<.01}function It(t){return it(t.bbox,t.bboxRadius,t.bboxRadiusSource)}function zt(t,e){return Nt(t,e)?[t,e]:[It(t),It(e)]}function rt(t,e,n,o){const i=pn(t),s=i?n(i):e,r=o.legacyAspectRatioAttribute?ln(t.getAttribute(o.legacyAspectRatioAttribute)??(i==null?void 0:i.getAttribute(o.legacyAspectRatioAttribute))??null):null,l=r??(i?un(i):null),c=i?fn(i):{fit:null,centered:!0},a=c.centered&&(i===null||hn(i))?c.fit??(r!==null?o.fallbackFit??null:null):null,p=Wt(s,l,a),u=mn(t),y=i!==null&&i!==t&&u?gn(p.window,e):p.window,f=yn(t,o.legacyRadiusAttribute),h=i===t||u,b=h?Pt(t):{radius:0,supported:!0},S=f??b.radius,w=f!==null?"legacy":b.supported?b.radius>0?"computed":"none":"unsupported",$=[];y&&h&&At(y,e)&&$.push(b),y&&i&&At(y,s)&&$.push(Pt(i));const x=$.every(E=>E.supported),C=Math.max(0,...$.map(E=>E.radius)),A=f??C,P=f!==null?"legacy":x?C>0?"computed":"none":"unsupported";return!y||P==="unsupported"?it(e,S,w):{...p,bbox:e,window:y,clipInset:at(p.content,y),radius:A,radiusSource:P,bboxRadius:S,bboxRadiusSource:w,mediaElement:p.contentAware?i:null}}function Vt(t,e,n,o,i){const s=n.width/o,r=n.height/i;return{left:_(t)+(_(n)-_(e))/o-s/2,top:R(t)+(R(n)-R(e))/i-r/2,width:s,height:r}}const wn={enter:"contain",exit:"cover",legacy:"contain"};function M(t){return wn[t]}const vt="data-hero-enter-key",_t="data-hero-exit-key",K="data-hero-key";class Sn{constructor(){F(this,"previousFromOpacity","")}prepare(e){e.from.then(n=>{this.previousFromOpacity=n.style.opacity,n.style.opacity="0"})}contribute(e){return e.onComplete(()=>{e.from.style.opacity=this.previousFromOpacity}),[]}}const xn=()=>new Sn;class Cn{contribute(e){const{from:n,to:o,physics:i,onComplete:s}=e,r=n.style.opacity,l=o.style.opacity,c=n.style.willChange,a=o.style.willChange;return o.style.opacity="0",n.style.willChange="opacity",o.style.willChange="opacity",s(()=>{n.style.opacity=r,o.style.opacity=l,n.style.willChange=c,o.style.willChange=a}),[new m.WebAnimation({element:n,integrator:g.IntegratorProvider.from(i),style:(p,u)=>({opacity:u})}),new m.WebAnimation({element:o,integrator:g.IntegratorProvider.from(i),style:p=>({opacity:p})})]}}const $n=()=>new Cn,En={static:xn,fade:$n},Pn={spring:{stiffness:320,damping:30}},An=()=>Pn,In={spring:{stiffness:300,damping:30,doubleSpring:1}},vn=()=>In,_n={default:An,smooth:vn},Rn=700,On="data-hero-aspect-ratio",Fn="data-hero-radius";function Rt(t,e,n){const o=k(t,e);return rt(e,o,i=>k(t,i),{fallbackFit:n,legacyAspectRatioAttribute:On,legacyRadiusAttribute:Fn})}function N(t,e){const n=new Map,o=t.querySelectorAll(`[${e}]`);for(const i of Array.from(o)){const s=i.getAttribute(e);s&&(n.has(s)||n.set(s,i))}return n}function Tn(t,e){const n=[],o=N(e,vt),i=N(t,_t);for(const[l,c]of o){const a=i.get(l);a&&n.push({key:l,fromEl:a,toEl:c,fromFit:M("exit"),toFit:M("enter")})}const s=N(t,vt),r=N(e,_t);for(const[l,c]of s){const a=r.get(l);a&&n.push({key:l,fromEl:c,toEl:a,fromFit:M("enter"),toFit:M("exit")})}return n}function Mn(t,e){const n=[],o=Array.from(e.querySelectorAll(`[${K}]`));for(const i of o){const s=i.getAttribute(K);if(!s)continue;const r=t.querySelector(`[${K}="${s}"]`);r&&n.push({key:s,fromEl:r,toEl:i,fromFit:M("legacy"),toFit:M("legacy")})}return n}function Yn(t,e){const n=Tn(t,e);return n.length>0?n:Mn(t,e)}function Dn(t,e){return zt(t,e)}function kn(t,e){return t.radiusSource==="unsupported"||e.radiusSource==="unsupported"?!1:t.mediaElement!==null||e.mediaElement!==null||t.radiusSource==="computed"||t.radiusSource==="legacy"||e.radiusSource==="computed"||e.radiusSource==="legacy"}function Ln(t,e,n){const{fromEl:o,toEl:i}=e,[s,r]=Dn(Rt(t,o,e.fromFit),Rt(t,i,e.toFit)),l=s.content,c=s.window,a=r.content,p=r.window,u=r.clipInset,d=s.radiusSource==="unsupported"||r.radiusSource==="unsupported",y=d?0:s.radius,f=d?0:r.radius;if(l.width===0||l.height===0||c.width===0||c.height===0||a.width===0||a.height===0||p.width===0||p.height===0)return null;const h=Math.max(l.width/a.width,l.height/a.height),b=_(l),S=R(l),w=_(a),$=R(a),x=b-w,C=S-$;if(Math.abs(C)>n)return null;const A=at(a,Vt(a,l,c,h,h));return{toContent:a,fromVisualEl:s.mediaElement??o,toVisualEl:r.mediaElement??i,resetCloneRadius:kn(s,r),styleFor:(P,E)=>{const L=E*x,Y=E*C,H=P+E*h,jt=Math.max(0,y*E+f*P)/Math.max(Math.abs(H),1e-6),qt=A.top*E+u.top*P,Kt=A.right*E+u.right*P,Jt=A.bottom*E+u.bottom*P,Qt=A.left*E+u.left*P;return{transform:`translate(${L}px, ${Y}px) scale(${H})`,clipPath:`inset(${qt}px ${Kt}px ${Jt}px ${Qt}px round ${jt}px)`}}}}function Hn(t,e){t.style.transform=e.transform,t.style.clipPath=e.clipPath}class Wn{contribute(e){const{resolved:n,physics:o,positionedParent:i,maxDistance:s,onComplete:r}=e,l=[];for(const c of n.pairs){const a=Ln(i,c,s);if(!a)continue;const{fromVisualEl:p,toVisualEl:u}=a,d=u.cloneNode(!0);d.style.position="absolute",d.style.left=`${a.toContent.left}px`,d.style.top=`${a.toContent.top}px`,d.style.width=`${a.toContent.width}px`,d.style.height=`${a.toContent.height}px`,d.style.margin="0",d.style.transformOrigin="center center",d.style.zIndex="1000",d.style.willChange="transform, clip-path",d.style.pointerEvents="none",d.style.maxWidth="none",d.style.maxHeight="none",a.resetCloneRadius&&(d.style.borderRadius="0"),Hn(d,a.styleFor(0,1)),i.appendChild(d);const y=p.style.opacity,f=u.style.opacity;p.style.opacity="0",u.style.opacity="0",r(()=>{p.style.opacity=y,u.style.opacity=f,d.parentElement&&d.parentElement.removeChild(d)}),l.push(new m.WebAnimation({element:d,integrator:g.IntegratorProvider.from(o),style:a.styleFor}))}return l}}function Nn(t){return[new Wn,En[t.type]()]}const zn=t=>{const e=Nn(t),n=_n[t.variant](),o=Rn;return{prepare:i=>{var l;const s=Promise.all([i.from,i.to]).then(([c,a])=>({pairs:Yn(c,a)})),r={from:i.from,to:i.to,resolved:s};for(const c of e)(l=c.prepare)==null||l.call(c,r);return s.then(c=>({resolved:c}))},animation:({from:i,to:s,context:r,resolved:l})=>{if(l.pairs.length===0)return new m.MultiAnimation([],{mode:"parallel"});const c=[],a=f=>{c.push(f)},p={from:i,to:s,resolved:l,physics:n,positionedParent:r.positionedParent,maxDistance:o,onComplete:a},u=[];for(const f of e)f.contribute&&u.push(...f.contribute(p));if(u.length===0)return new m.MultiAnimation([],{mode:"parallel"});const d=new m.MultiAnimation(u,{mode:"parallel"}),y=d.onComplete;return d.onComplete=()=>{y==null||y();for(const f of c)try{f()}catch(h){console.error("[hero] cleanup error",h)}},d}}};function Vn(t={}){const e=t.type??"static",n=t.variant??"default";return zn({type:e,variant:n})}const Un={spring:{stiffness:50,damping:30}},Xn={spring:{stiffness:80,damping:25}},Bn=(t={})=>{const e=t.physics??Un,n=t.initialRotation??45,o=t.initialScale??.01,i=t.rotationTriggerPoint??.8;return{prepare:({from:s,to:r,context:l})=>(s.then(c=>{c.style.opacity="1"}),r.then(c=>{const a=O(l,"to"),p=Math.min(a.width,a.height)*.4;c.style.setProperty("--max-border-radius",`${p}px`),c.style.setProperty("--border-radius-scale","1"),c.style.willChange="transform",c.style.backfaceVisibility="hidden";const u=a.left+a.width/2,d=a.top+a.height/2;c.style.transformOrigin=`${u}px ${d}px`,c.style.position="fixed",c.style.top=`${a.top}px`,c.style.left=`${a.left}px`,c.style.width=`${a.width}px`,c.style.height=`${a.height}px`,c.style.zIndex="1000",c.style.overflow="hidden",c.style.transform=`rotate(${n}deg) scale(${o}) translateZ(0)`,c.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",c.style.opacity="1"}),{}),animation:({from:s,to:r})=>{const l=new m.WebAnimation({element:s,integrator:g.IntegratorProvider.from(Xn),style:(a,p)=>({opacity:p}),onComplete:()=>{s.style.opacity=""}}),c=new m.WebAnimation({element:r,integrator:g.IntegratorProvider.from(e),style:a=>{let p;if(a<=.05)p=o;else if(a<=i){const f=(a-.05)/(i-.05),h=Math.pow(f,9);p=o+(.8-o)*h}else{const f=(a-i)/(1-i);p=.8+.2*(1-Math.pow(1-f,3))}const u=.7;let d;if(a<=u)d=n;else{const f=(a-u)/(1-u),h=1-Math.pow(1-f,2);d=n*(1-h)}let y;if(a<=u)y=1;else{const f=(a-u)/(1-u);y=1-Math.pow(f,.5)}return{transform:`rotate(${d.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,"--border-radius-scale":y.toFixed(4)}},onComplete:()=>{r.style.willChange="",r.style.backfaceVisibility="",r.style.removeProperty("--max-border-radius"),r.style.removeProperty("--border-radius-scale"),r.style.transform="",r.style.transformOrigin="",r.style.position="",r.style.zIndex="",r.style.top="",r.style.left="",r.style.width="",r.style.height="",r.style.overflow="",r.style.borderRadius=""}});return new m.MultiAnimation([l,c],{mode:"parallel"})}}};function Zn(t={}){return Bn()}const Gn={spring:{stiffness:100,damping:30}},jn=(t={})=>{const e=t.physics??Gn;return{prepare:({from:n,to:o})=>(n.then(i=>{i.style.transformOrigin="center center",i.style.willChange="transform, opacity"}),o.then(i=>{i.style.opacity="0",i.style.transform="rotate(-180deg)",i.style.transformOrigin="center center",i.style.willChange="transform, opacity"}),{}),animation:({from:n,to:o})=>{const i=new m.WebAnimation({element:n,integrator:g.IntegratorProvider.from(e),style:r=>({transform:`rotate(${r*180}deg)`,opacity:r<.5?1:0}),onComplete:()=>{n.style.willChange="auto",n.style.transform="",n.style.transformOrigin="",n.style.opacity=""}}),s=new m.WebAnimation({element:o,integrator:g.IntegratorProvider.from(e),style:(r,l)=>({transform:`rotate(${-l*180}deg)`,opacity:r>.5?1:0}),onComplete:()=>{o.style.willChange="auto",o.style.transform="",o.style.transformOrigin="",o.style.opacity=""}});return new m.MultiAnimation([i,s],{mode:"parallel"})}}};function qn(t={}){return jn()}const Kn={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},Jn=(t={})=>{const e=t.physics??Kn,n=t.directional??!0;return{prepare:({from:o,to:i,context:s})=>{const r=!n||s.direction==="forward",l=r?I:v,c=r?v:I;return o.then(a=>{a.style.zIndex=l,a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.pointerEvents="none"}),i.then(a=>{a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.position="relative",a.style.zIndex=c}),{}},animation:({from:o,to:i,context:s})=>{const r=!n||s.direction==="forward",l=r?v:I,c=o.offsetHeight,a=i.offsetHeight,p=window.innerHeight,u=Math.max(Math.min(c,a),p),d=new m.WebAnimation({element:o,integrator:g.IntegratorProvider.from(e),style:f=>({transform:`translate3d(0, ${r?-u*f:u*f}px, 0)`}),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform="",o.style.pointerEvents="",o.style.zIndex=""}}),y=new m.WebAnimation({element:i,integrator:g.IntegratorProvider.from(e),style:(f,h)=>({transform:`translate3d(0, ${r?h*u:h*-u}px, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform="",i.style.position==="relative"&&(i.style.position=""),i.style.zIndex===l&&(i.style.zIndex="")}});for(const f of[d,y]){const h=f.onComplete;f.onComplete=()=>{h==null||h(),f.releaseFill()}}return new m.MultiAnimation([d,y],{mode:"parallel"})}}};function Qn(t={}){const{type:e="directional"}=t;return Jn({directional:e==="directional"})}const to={spring:{stiffness:200,damping:24}},eo={inertia:{acceleration:25,resistance:1.2}},J=.2;function no(){return{enterPhysics:to,exitPhysics:eo,background:{willChange:"transform, opacity",enterStyle:(t,e)=>({transform:`scale(${1-J*t})`,opacity:e}),exitStyle:t=>({transform:`scale(${1-J+J*t})`,opacity:t})}}}const oo={spring:{stiffness:200,damping:24}},io={inertia:{acceleration:25,resistance:1.2}},Q=.08,ro=16,tt=.6,so=t=>`blur(${Math.max(0,t).toFixed(2)}px)`;function ao(){return{enterPhysics:oo,exitPhysics:io,background:{willChange:"transform, opacity",enterStyle:t=>({transform:`scale(${1-Q*t})`,opacity:1-(1-tt)*t}),exitStyle:t=>({transform:`scale(${1-Q+Q*t})`,opacity:tt+(1-tt)*t})},overlay:{willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(t,e)=>{const n=t==="enter"?e:1-e,o=so(ro*n);return{backdropFilter:o,WebkitBackdropFilter:o}}}}}const lo={spring:{stiffness:190,damping:25}},co={spring:{stiffness:190,damping:25}};function po(){return{enterPhysics:lo,exitPhysics:co,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const uo={static:po(),"background-scale":no(),blur:ao()},fo="static",yo="transform",ho=(t={})=>{const e=uo[t.type??fo],n=e.background,o=e.overlay,i=n.willChange!=="";return{prepare:({from:s,to:r,context:l,createElement:c})=>{const a=l.direction==="forward"?"enter":"exit",p=a==="enter"?r:s,u=a==="enter"?s:r;p.then(y=>{y.style.willChange=yo,y.style.backfaceVisibility="hidden",y.style.contain="layout paint",y.style.zIndex=v,a==="enter"?y.style.position="relative":y.style.pointerEvents="none"}),u.then(y=>{i&&(y.style.willChange=n.willChange,y.style.backfaceVisibility="hidden",y.style.contain="layout paint"),y.style.zIndex=I,a==="enter"?y.style.pointerEvents="none":y.style.position="relative"});let d;return o&&(d=c("sheet-overlay"),Object.assign(d.style,o.initialStyle),d.style.willChange=o.willChange,l.positionedParent.appendChild(d)),{overlay:d}},animation:({from:s,to:r,context:l,overlay:c})=>{const a=l.direction==="forward"?"enter":"exit",p=a==="enter"?e.enterPhysics:e.exitPhysics,u=a==="enter"?r:s,d=a==="enter"?s:r,y=O(l,a==="enter"?"to":"from"),f=()=>{s.style.pointerEvents="",s.style.zIndex=""},h=()=>{const x=a==="enter"?v:I;r.style.position==="relative"&&(r.style.position=""),r.style.zIndex===x&&(r.style.zIndex="")},b=x=>{const C=x.onComplete;x.onComplete=()=>{C==null||C(),x.releaseFill()}};u.style.clipPath=`inset(${y.top}px 0 calc(100% - ${y.top+y.height}px) 0)`;const S=a==="enter"?(x,C)=>({transform:`translate3d(0, ${C*y.height}px, 0)`}):x=>({transform:`translate3d(0, ${x*y.height}px, 0)`}),w=new m.WebAnimation({element:u,integrator:g.IntegratorProvider.from(p),style:S,onComplete:()=>{u.style.willChange="auto",u.style.backfaceVisibility="",u.style.contain="",u.style.clipPath="",u.style.transform="",f(),h()}});b(w);const $=[w];if(i){const x=d.scrollHeight;x>0&&(d.style.height=`${x}px`);const C=O(l,a==="enter"?"from":"to"),A=C.left+C.width/2,P=C.top+C.height/2;d.style.clipPath=`inset(${C.top}px 0 calc(100% - ${C.top+C.height}px) 0)`,d.style.transformOrigin=`${A}px ${P}px`;const E=a==="enter"?(Y,H)=>n.enterStyle(Y,H):Y=>n.exitStyle(Y),L=new m.WebAnimation({element:d,integrator:g.IntegratorProvider.from(p),style:E,onComplete:()=>{d.style.willChange="auto",d.style.backfaceVisibility="",d.style.contain="",d.style.clipPath="",d.style.transformOrigin="",d.style.transform="",d.style.opacity="",d.style.height=""}});b(L),$.push(L)}if(c&&o){c.style.zIndex=Lt;const x=Dt(l,"to");c.style.top=`${x.top}px`,c.style.height=`${x.height}px`,$.push(new m.WebAnimation({element:c,integrator:g.IntegratorProvider.from(p),style:C=>o.style(a,C)}))}return new m.MultiAnimation($,{mode:"parallel"})}}};function mo(t){return t==="scale"||t==="background-scale"?"background-scale":t==="blur"?"blur":"static"}function go(t={}){const e=t.type,n=mo(e);return ho({type:n})}const bo=(t={})=>{const e=t.physics??g.SLIDE_PHYSICS;return{prepare:({from:n,to:o,context:i})=>{const s=i.direction==="forward";return n.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),o.then(r=>{const l=s?100:-100;r.style.transform=`translate3d(${l}%, 0, 0)`,r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}},animation:({from:n,to:o,context:i})=>{const s=new m.WebAnimation({element:n,integrator:g.IntegratorProvider.from(e),style:l=>({transform:`translate3d(${100*g.pageMotionStyle("slide","out",i.direction,l).x}%, 0, 0)`}),onComplete:()=>{n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.transform="",n.style.pointerEvents=""}}),r=new m.WebAnimation({element:o,integrator:g.IntegratorProvider.from(e),style:l=>({transform:`translate3d(${100*g.pageMotionStyle("slide","in",i.direction,l).x}%, 0, 0)`}),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform=""}});return new m.MultiAnimation([s,r],{mode:"parallel"})}}};function wo(t={}){return bo()}const So={spring:{stiffness:17,damping:6}},et=20,z=800,xo=(t={})=>{const e=t.physics??So;return{prepare:({from:n,to:o})=>(n.then(i=>{i.style.willChange="transform",i.style.backfaceVisibility="hidden",i.style.contain="layout paint",i.style.pointerEvents="none",i.style.transform=`perspective(${z}px) rotateY(0deg) translate3d(0%, 0, 0)`}),o.then(i=>{i.style.willChange="transform",i.style.backfaceVisibility="hidden",i.style.contain="layout paint",i.style.transform=`perspective(${z}px) rotateY(${et}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:o})=>{const i=new m.WebAnimation({element:n,integrator:g.IntegratorProvider.from(e),style:r=>{const l=-r*et,c=r*100;return{transform:`perspective(${z}px) rotateY(${l}deg) translate3d(${c}%, 0, 0)`}},onComplete:()=>{n.style.transform="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.pointerEvents=""}}),s=new m.WebAnimation({element:o,integrator:g.IntegratorProvider.from(e),style:(r,l)=>{const c=l*et,a=-l*100;return{transform:`perspective(${z}px) rotateY(${c}deg) translate3d(${a}%, 0, 0)`}},onComplete:()=>{o.style.transform="",o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain=""}});return new m.MultiAnimation([i,s],{mode:"sequence"})}}};function Co(t={}){return xo()}function $o(t,e){return e.left>=t.left-.01&&e.top>=t.top-.01&&e.left+e.width<=t.left+t.width+.01&&e.top+e.height<=t.top+t.height+.01}function Ut(t){const e=()=>({enterContent:t.enterRect,exitContent:t.exitRect,startWindow:t.enterRect,scaleX:t.exitRect.width/t.enterRect.width,scaleY:t.exitRect.height/t.enterRect.height}),{enterMedia:n,exitMedia:o}=t;if(!n||!o||!Nt(n,o))return e();const i=n.content,s=o.content;if(i.width<=0||i.height<=0||s.width<=0||s.height<=0)return e();const r=s.width/i.width,l=s.height/i.height,c=Vt(i,s,o.window,r,l);return $o(n.window,c)?{enterContent:i,exitContent:s,startWindow:c,scaleX:r,scaleY:l}:e()}function Xt(t,e){return{top:t.top/e.height*100,right:(e.width-(t.left+t.width))/e.width*100,bottom:(e.height-(t.top+t.height))/e.height*100,left:t.left/e.width*100}}function Bt(t,e,n){return{x:t/Math.max(Math.abs(e),1e-6),y:t/Math.max(Math.abs(n),1e-6)}}function Eo(t){const{pageRect:e,scrollOffset:n,enterRadius:o,exitRadius:i}=t,s=Ut(t),{enterContent:r,exitContent:l,startWindow:c,scaleX:a,scaleY:p}=s,u=l.left-r.left+(l.width-r.width)/2-n.x,d=l.top-r.top+(l.height-r.height)/2-n.y,y=Xt(c,e);return{transformOrigin:`${_(r)}px ${R(r)}px`,animate:f=>{const h=1-f,b=1+(a-1)*h,S=1+(p-1)*h,w=Math.max(0,i*h+o*(1-h)),$=Bt(w,b,S);return{clipPath:`inset(${y.top*h}% ${y.right*h}% ${y.bottom*h}% ${y.left*h}% round ${$.x}px / ${$.y}px)`,transform:`translate(${u*h}px, ${d*h}px) scale(${b}, ${S})`}}}}function Po(t){const{pageRect:e,scrollOffset:n,enterRadius:o,exitRadius:i}=t,s=Ut(t),{enterContent:r,exitContent:l,startWindow:c,scaleX:a,scaleY:p}=s,u=l.left-r.left+(l.width-r.width)/2+n.x,d=l.top-r.top+(l.height-r.height)/2+n.y,y=Xt(c,e);return{transformOrigin:`${_(r)}px ${R(r)}px`,animate:f=>{const h=1-f,b=1+(a-1)*h,S=1+(p-1)*h,w=Math.max(0,o*(1-h)+i*h),$=Bt(w,b,S);return{clipPath:`inset(${y.top*h}% ${y.right*h}% ${y.bottom*h}% ${y.left*h}% round ${$.x}px / ${$.y}px)`,transform:`translate(${u*h-n.x}px, ${d*h}px) scale(${b}, ${S})`}}}}const Ao={spring:{stiffness:380,damping:30,restDelta:.1,restSpeed:.1,doubleSpring:{stiffness:260,damping:30}}},Zt=.12,Io=18;function vo(){return{transformOrigin:"50% 50%",animate:t=>{const e=1-t;return{transform:`scale(${1-Zt*e})`}}}}function _o(){return{transformOrigin:"50% 50%",animate:t=>{const e=1-t;return{transform:`scale(${1-Zt*e})`}}}}const nt={willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(t,e)=>{const n=t==="enter"?e:1-e,o=`blur(${Io*n}px)`;return{backdropFilter:o,WebkitBackdropFilter:o}}};class Ro{constructor(){F(this,"physics",Ao)}contribute(e){const{from:n,to:o,resolved:i,physics:s}=e,r=i.mode==="enter",l=r?n:o,c=r?vo():_o();return c&&(l.style.transformOrigin=c.transformOrigin),[new m.WebAnimation({element:l,integrator:g.IntegratorProvider.from(s),style:r?(a,p)=>c.animate(p):a=>c.animate(a)})]}}class Oo{prepare(e){const n=e.createElement("zoom-overlay");return Object.assign(n.style,nt.initialStyle),n.style.willChange=nt.willChange,e.context.positionedParent.appendChild(n),{overlay:n}}contribute(e){const n=e.extras.overlay;if(!n)return[];n.style.zIndex=Lt;const o=Dt(e.context,"to");return n.style.top=`${o.top}px`,n.style.height=`${o.height}px`,[new m.WebAnimation({element:n,integrator:g.IntegratorProvider.from(e.physics),style:i=>nt.style(e.resolved.mode,i)})]}}const Fo={spring:{stiffness:380,damping:30,doubleSpring:{stiffness:260,damping:30}}};function To({enterRect:t,exitRect:e,scrollOffset:n}){const o=t.left-e.left+(t.width-e.width)/2+n.x,i=t.top-e.top+(t.height-e.height)/2+n.y,s=t.width/e.width,r=t.height/e.height,l=Math.max(s,r);return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${o*a-n.x}px, ${i*a}px) scale(${1+(l-1)*a})`}}}}function Mo({enterRect:t,exitRect:e,scrollOffset:n}){const o=t.left-e.left+(t.width-e.width)/2-n.x,i=t.top-e.top+(t.height-e.height)/2-n.y,s=t.width/e.width,r=t.height/e.height,l=Math.max(s,r);return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${o*a}px, ${i*a}px) scale(${1+(l-1)*a})`}}}}class Yo{constructor(){F(this,"physics",Fo)}contribute(e){const{from:n,to:o,resolved:i,input:s,physics:r}=e,l=i.mode==="enter",c=l?n:o,a=l?To(s):Mo(s);return a&&(c.style.transformOrigin=a.transformOrigin),[new m.WebAnimation({element:c,integrator:g.IntegratorProvider.from(r),style:l?(p,u)=>a.animate(u):p=>a.animate(p)})]}}const Do={spring:{stiffness:530,damping:34,doubleSpring:1}};class ko{constructor(){F(this,"physics",Do)}contribute(e){return[]}}const Lo={expand:()=>new Yo,static:()=>new ko,blur:()=>new Ro};function Ho(t){return Lo[t]()}const st="data-zoom-enter-key",Ot="data-zoom-exit-key",Ft="data-zoom-radius";function Wo(t,e){return Math.abs(t.left-e.left)<.01&&Math.abs(t.top-e.top)<.01&&Math.abs(t.width-e.width)<.01&&Math.abs(t.height-e.height)<.01}function No(t,e){const n=[];let o=e;for(;o&&o!==t;){const i=o.parentElement;if(!i)break;for(const s of Array.from(i.children))s!==o&&s instanceof HTMLElement&&n.push(s);o=i}return n}function Tt(t){const e=t.querySelectorAll(`[${st}]`);return e.length!==1?null:e[0]}function Mt(t,e){const n=t.querySelectorAll(`[${Ot}]`);for(const o of n)if(o.getAttribute(Ot)===e)return o;return null}function zo(t,e,n){if(n==="forward"){const r=Tt(e);if(!r)return null;const l=r.getAttribute(st);if(!l)return null;const c=Mt(t,l);return c?{mode:"enter",enterEl:r,exitEl:c}:null}const o=Tt(t);if(!o)return null;const i=o.getAttribute(st);if(!i)return null;const s=Mt(e,i);return s?{mode:"exit",enterEl:o,exitEl:s}:null}function Vo(t,e,n,o){const i=t.mode==="enter"?n:e,s=t.mode==="enter"?e:n,r=W(i,t.enterEl),l=W(s,t.exitEl),c=rt(t.enterEl,r,b=>W(i,b),{legacyRadiusAttribute:Ft}),a=rt(t.exitEl,l,b=>W(s,b),{legacyRadiusAttribute:Ft}),[p,u]=zt(c,a),d=p.contentAware&&u.contentAware,y=t.mode==="enter"?n.getBoundingClientRect():e.getBoundingClientRect(),f={left:0,top:0,width:y.width,height:y.height},h=p.radiusSource==="legacy"||Wo(p.window,f)?p.radius:0;return{enterRect:r,exitRect:l,...d?{enterMedia:p,exitMedia:u}:{},pageRect:y,scrollOffset:o,enterRadius:h,exitRadius:u.radius}}class Uo{prepare(e){e.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(e){const{from:n,to:o,resolved:i,input:s,physics:r,onComplete:l}=e,c=i.mode==="enter",a=c?Eo(s):Po(s),p=c?o:n,u=c?"t":"u";a&&(p.style.transformOrigin=a.transformOrigin);const d=c?I:v,y=c?v:I,f=n.style.zIndex;n.style.zIndex=d;const h=o.style.zIndex,b=o.style.position;return o.style.zIndex=y,o.style.position="relative",l(()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.transformOrigin="",p.style.contain="",n.style.zIndex=f,o.style.zIndex===y&&(o.style.zIndex=h),o.style.position==="relative"&&(o.style.position=b),o.style.transformOrigin="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.transformOrigin="",n.style.contain="",n.style.transform="",n.style.clipPath=""}),[new m.WebAnimation({element:p,integrator:g.IntegratorProvider.from(r),style:u==="t"?S=>a.animate(S):(S,w)=>a.animate(w)})]}}class Xo{contribute(e){const{resolved:n,physics:o,from:i,to:s,onComplete:r}=e,l=n.mode==="enter"?s:i,c=No(l,n.enterEl);if(c.length===0)return[];const a=c.map(p=>p.style.opacity);if(n.mode==="enter")for(const p of c)p.style.opacity="0";return r(()=>{for(let p=0;p<c.length;p++){const u=c[p];u&&(u.style.opacity=a[p]??"")}}),c.map(p=>new m.WebAnimation({element:p,integrator:g.IntegratorProvider.from(o),style:(u,d)=>({opacity:n.mode==="enter"?u:d})}))}}class Gt{contribute(){return[]}}const Bo={default:()=>new Gt,fade:()=>new Xo};function Zo(t){return Bo[t]()}class Go extends Gt{}function jo(t){const e=Ho(t.type);return{strategies:[new Uo,e,Zo(t.variant),new Go,...t.type==="blur"?[new Oo]:[]],physics:e.physics}}const qo=t=>{const{strategies:e,physics:n}=jo(t);return{prepare:o=>{const i={from:o.from,to:o.to,context:{positionedParent:o.context.positionedParent},createElement:o.createElement},s={};for(const r of e){if(!r.prepare)continue;const l=r.prepare(i);l&&Object.assign(s,l)}return s},animation:({from:o,to:i,context:s,...r})=>{const l=zo(o,i,s.direction);if(!l)return new m.MultiAnimation([],{mode:"parallel"});const c=Vo(l,o,i,s.scrollOffset),a=[],u={from:o,to:i,resolved:l,input:c,physics:n,context:s,extras:r,onComplete:f=>{a.push(f)}},d=[];for(const f of e)f.contribute&&d.push(...f.contribute(u));const y=d[0];if(y){const f=y.onComplete;y.onComplete=()=>{f==null||f();for(const h of a)try{h()}catch(b){console.error("[zoom] cleanup error",b)}}}for(const f of d){if(!(f instanceof m.WebAnimation))continue;const h=f.onComplete;f.onComplete=()=>{h==null||h(),f.releaseFill()}}return new m.MultiAnimation(d,{mode:"parallel"})}}};function Ko(t){const e=t.type??"static",n=t.variant??(t.fade?"fade":"default");return{type:e,variant:n}}function Jo(t={}){const e=Ko(t);return qo(e)}exports.Animation=m.Animation;exports.MultiAnimation=m.MultiAnimation;exports.WebAnimation=m.WebAnimation;exports.axis=Fe;exports.blind=Le;exports.drill=je;exports.fade=Ke;exports.film=an;exports.hero=Vn;exports.jaemin=Zn;exports.rotate=qn;exports.scroll=Qn;exports.sheet=go;exports.slide=wo;exports.strip=Co;exports.zoom=Jo;
|
|
35
|
+
)`}function K(t,e,n,o,i){const r=n/1e3;return new m.WebAnimation({element:t,integrator:new ue({durationSec:r}),lowerBound:0,upperBound:1,style:s=>o(fn(e,s)),onComplete:i})}const mn=(t={})=>{var i;const e=((i=t.border)==null?void 0:i.color)??pn,n=cn,o=t.physics;return{prepare:({from:r,to:s,context:l})=>{const c=F(l,"from"),a=F(l,"to"),d=dt(document.body,l.positionedParent),p=yn(e,{...c,top:d.top});for(const u of["topLeft","topRight","bottomLeft","bottomRight"])l.positionedParent.appendChild(p[u]);return r.then(u=>{Ot(u,c),Mt(u,c),u.style.transform=`translateY(${-c.top}px)`}),s.then(u=>{Ot(u,a),Mt(u,a),u.style.transform=`translateY(${-a.top+a.height}px) scale(${n})`}),{borders:p,fromRect:c,toRect:a}},animation:({from:r,to:s,context:l,borders:c,fromRect:a,toRect:d})=>{const p=_t({rect:a,scale:n,direction:"out",override:o}),u=_t({rect:d,scale:n,direction:"in",override:o}),h=K(r,p.snapshots,p.totalDuration,S=>({transform:`translateY(${S.translateY}px) scale(${S.scale})`}),()=>{r.style.clipPath="",r.style.transformOrigin="",r.style.transform=""}),f=K(s,u.snapshots,u.totalDuration,S=>({transform:`translateY(${S.translateY}px) scale(${S.scale})`}),()=>{s.style.clipPath="",s.style.transformOrigin="",s.style.transform=""}),y=hn.map(([S,$],w)=>{const x=["topLeft","topRight","bottomLeft","bottomRight"][w];return K(c[x],p.snapshots,p.totalDuration,I=>{const E=(a.width-a.width*I.scale)/2*.7*S,P=(a.height-a.height*I.scale)/2*.7*$;return{transform:`translate(${E}px, ${P}px)`}})}),g=new m.MultiAnimation([h,f,...y],{mode:"parallel"}),C=g.onComplete;return g.onComplete=()=>{C==null||C();const S=l.positionedParent;for(const $ of["topLeft","topRight","bottomLeft","bottomRight"]){const w=c[$];w.parentElement===S&&S.removeChild(w)}},g}}};function gn(t={}){const{options:e}=t,n=(e==null?void 0:e.borderColor)!==void 0?{border:{color:e.borderColor}}:void 0;return mn(n)}function bn(t){if(!t)return null;if(t.includes("/")){const n=t.split("/");if(n.length!==2)return null;const o=Number.parseFloat(n[0]??""),i=Number.parseFloat(n[1]??"");return Number.isFinite(o)&&Number.isFinite(i)&&o>0&&i>0?o/i:null}const e=Number.parseFloat(t);return Number.isFinite(e)&&e>0?e:null}function wn(t){return t==="contain"||t==="cover"?t:null}function rt(t){return t.tagName==="IMG"}function Sn(t){if(rt(t))return t;if(t.tagName==="PICTURE"||t.tagName==="VIDEO")return null;const e=[];for(const n of Array.from(t.children)){const o=n;rt(o)&&e.push(o)}return e.length===1?e[0]??null:null}function Cn(t){var c,a;if(!rt(t))return null;const e=t,n=e.naturalWidth,o=e.naturalHeight;if(typeof n=="number"&&typeof o=="number"&&Number.isFinite(n)&&Number.isFinite(o)&&n>0&&o>0)return n/o;const i=((c=t.getAttribute("width"))==null?void 0:c.trim())??"",r=((a=t.getAttribute("height"))==null?void 0:a.trim())??"",s=i===""?Number.NaN:Number(i),l=r===""?Number.NaN:Number(r);return Number.isFinite(s)&&Number.isFinite(l)&&s>0&&l>0?s/l:null}function xn(t){const e=t.trim().toLowerCase().replace(/\s+/g," ");return e===""||e==="center"||e==="center center"||e==="50% 50%"}function N(t){if(typeof getComputedStyle=="function")try{return getComputedStyle(t)}catch{}return t.style}function $n(t){const e=N(t),n=xn(e.objectPosition??"");return{fit:n?wn(e.objectFit??null):null,centered:n}}function ut(t){if(!t)return 0;const e=/^(-?(?:\d+\.?\d*|\.\d+))px$/.exec(t.trim());if(!e)return null;const n=Number.parseFloat(e[1]??"");return Number.isFinite(n)&&n>=0?n:null}function st(t){const e=N(t),n=[e.borderTopLeftRadius,e.borderTopRightRadius,e.borderBottomRightRadius,e.borderBottomLeftRadius].map(ut),o=n[0];if(o==null)return{radius:0,supported:!1};const i=n.every(r=>r!==null&&Math.abs(r-o)<.001);return{radius:i?o:0,supported:i}}function En(t,e){var i;if(!e)return null;const n=(i=t.getAttribute(e))==null?void 0:i.trim();if(n==null||n==="")return null;const o=Number.parseFloat(n);return Number.isFinite(o)&&o>=0?o:null}function Pn(t){const e=N(t);return[e.paddingTop,e.paddingRight,e.paddingBottom,e.paddingLeft,e.borderTopWidth,e.borderRightWidth,e.borderBottomWidth,e.borderLeftWidth].every(o=>o?ut(o)===0:!0)}function An(t){const e=N(t),n=o=>o==="hidden"||o==="clip";return n(e.overflowX)&&n(e.overflowY)}function O(t){return t.left+t.width/2}function M(t){return t.top+t.height/2}function W(t,e){return{top:Math.max(0,e.top-t.top),right:Math.max(0,t.left+t.width-(e.left+e.width)),bottom:Math.max(0,t.top+t.height-(e.top+e.height)),left:Math.max(0,e.left-t.left)}}function at(t,e){const n=Math.max(t.left,e.left),o=Math.max(t.top,e.top),i=Math.min(t.left+t.width,e.left+e.width),r=Math.min(t.top+t.height,e.top+e.height);return i>n&&r>o?{left:n,top:o,width:i-n,height:r-o}:null}function H(t,e){return Math.abs(t.left-e.left)<.01&&Math.abs(t.top-e.top)<.01&&Math.abs(t.width-e.width)<.01&&Math.abs(t.height-e.height)<.01}function In(t,e,n){const o=t.width/t.height;let i,r;return n==="contain"?o>e?(r=t.height,i=r*e):(i=t.width,r=i/e):o>e?(i=t.width,r=i/e):(r=t.height,i=r*e),{left:t.left+(t.width-i)/2,top:t.top+(t.height-r)/2,width:i,height:r}}function Ut(t,e,n){const o=e!==null&&n!==null&&t.width>0&&t.height>0?In(t,e,n):t,i=n==="contain"?o:t;return{bbox:t,content:o,window:i,clipInset:W(o,i),aspectRatio:e,fit:n,radius:0,radiusSource:"none",bboxRadius:0,bboxRadiusSource:"none",contentAware:e!==null&&n!==null,mediaElement:null}}function lt(t,e,n){return{...Ut(t,null,null),radius:e,radiusSource:n,bboxRadius:e,bboxRadiusSource:n}}function Bt(t,e){const n=t.aspectRatio,o=e.aspectRatio;return t.contentAware&&e.contentAware&&n!==null&&o!==null&&Math.abs(n-o)/Math.max(n,o)<.01}function Ft(t){return lt(t.bbox,t.bboxRadius,t.bboxRadiusSource)}function Zt(t,e){return Bt(t,e)?[t,e]:[Ft(t),Ft(e)]}function Rn(t,e,n,o){const i=Sn(t),r=i?n(i):e,s=o.legacyAspectRatioAttribute?bn(t.getAttribute(o.legacyAspectRatioAttribute)??(i==null?void 0:i.getAttribute(o.legacyAspectRatioAttribute))??null):null,l=s??(i?Cn(i):null),c=i?$n(i):{fit:null,centered:!0},a=c.centered&&(i===null||Pn(i))?c.fit??(s!==null?o.fallbackFit??null:null):null,d=Ut(r,l,a),p=An(t),h=i!==null&&i!==t&&p?at(d.window,e):d.window,f=En(t,o.legacyRadiusAttribute),y=i===t||p,g=y?st(t):{radius:0,supported:!0},C=f??g.radius,S=f!==null?"legacy":g.supported?g.radius>0?"computed":"none":"unsupported",$=[];h&&y&&H(h,e)&&$.push(g),h&&i&&H(h,r)&&$.push(st(i));const w=$.every(P=>P.supported),x=Math.max(0,...$.map(P=>P.radius)),I=f??x,E=f!==null?"legacy":w?x>0?"computed":"none":"unsupported";return!h||E==="unsupported"?lt(e,C,S):{...d,bbox:e,window:h,clipInset:W(d.content,h),radius:I,radiusSource:E,bboxRadius:C,bboxRadiusSource:S,mediaElement:d.contentAware?i:null}}function ct(t,e,n,o){const i=Rn(t,e,n,o);if(!o.clipRoot||i.radiusSource==="unsupported")return i;let r=i.window,s=i.radius,l=[s,s,s,s],c=i.radiusSource,a=t.parentElement;for(;a&&a!==o.clipRoot;){const p=N(a),u=y=>y==="hidden"||y==="clip"||y==="auto"||y==="scroll",h=u(p.overflowX),f=u(p.overflowY);if(h||f){if(![p.borderTopWidth,p.borderRightWidth,p.borderBottomWidth,p.borderLeftWidth].every(E=>ut(E)===0)||a.offsetWidth&&a.clientWidth&&a.offsetWidth-a.clientWidth>1||a.offsetHeight&&a.clientHeight&&a.offsetHeight-a.clientHeight>1)return i;const g=n(a),C={left:h?g.left:r.left,top:f?g.top:r.top,width:h?g.width:r.width,height:f?g.height:r.height},S=at(r,C);if(!S)return i;const $=st(a);if(!$.supported)return i;if(h&&f&&H(r,g))c!=="legacy"&&(s=Math.max(s,$.radius),l=l.map(E=>Math.max(E,$.radius)),s>0&&(c="computed"));else if($.radius>0){const E={left:g.left+$.radius,top:g.top+$.radius,width:g.width-2*$.radius,height:g.height-2*$.radius};if(!H(at(r,E)??g,r))return i}const w=W(r,S),x=[[w.top,w.left],[w.top,w.right],[w.bottom,w.right],[w.bottom,w.left]];for(let E=0;E<4;E++){const P=Math.max(...x[E]),R=l[E];if(P>.01&&P<R)return i;P>.01&&(l[E]=0)}const I=Math.max(...l);if(S.width<I||S.height<I)return i;r=S}a=a.parentElement}const d=H(i.bbox,r);return{...i,window:r,clipInset:W(i.content,r),radius:s,radiusSource:c,...l.some(p=>p!==s)?{cornerRadii:l}:{},...d?{bboxRadius:s,bboxRadiusSource:c}:{}}}function Gt(t,e,n,o,i){const r=n.width/o,s=n.height/i;return{left:O(t)+(O(n)-O(e))/o-r/2,top:M(t)+(M(n)-M(e))/i-s/2,width:r,height:s}}const vn={enter:"contain",exit:"cover",legacy:"contain"};function D(t){return vn[t]}function ft(t,e,n){const o=(l,c)=>`${c>0?l/c*100:0}%`,i=[o(e.top,t.height),o(e.right,t.width),o(e.bottom,t.height),o(e.left,t.width)].join(" "),r=n.map(l=>o(l.x,t.width)).join(" "),s=n.map(l=>o(l.y,t.height)).join(" ");return`inset(${i} round ${r} / ${s})`}const Tt="data-hero-enter-key",Yt="data-hero-exit-key",J="data-hero-key";class _n{constructor(){T(this,"previousFromOpacity","")}prepare(e){e.from.then(n=>{this.previousFromOpacity=n.style.opacity,n.style.opacity="0"})}contribute(e){return e.onComplete(()=>{e.from.style.opacity=this.previousFromOpacity}),[]}}const On=()=>new _n;class Mn{contribute(e){const{from:n,to:o,physics:i,onComplete:r}=e,s=n.style.opacity,l=o.style.opacity,c=n.style.willChange,a=o.style.willChange;return o.style.opacity="0",n.style.willChange="opacity",o.style.willChange="opacity",r(()=>{n.style.opacity=s,o.style.opacity=l,n.style.willChange=c,o.style.willChange=a}),[new m.WebAnimation({element:n,integrator:b.IntegratorProvider.from(i),style:(d,p)=>({opacity:p})}),new m.WebAnimation({element:o,integrator:b.IntegratorProvider.from(i),style:d=>({opacity:d})})]}}const Fn=()=>new Mn,Tn={static:On,fade:Fn},Yn={spring:{stiffness:320,damping:30}},Dn=()=>Yn,Ln={spring:{stiffness:300,damping:30,doubleSpring:1}},kn=()=>Ln,Hn={default:Dn,smooth:kn},Wn=700,Nn="data-hero-aspect-ratio",zn="data-hero-radius";function Dt(t,e,n,o){const i=s=>{const l=k(t,s);return{left:l.left+t.scrollLeft,top:l.top+t.scrollTop,width:l.width,height:l.height}},r=i(e);return ct(e,r,i,{clipRoot:o,fallbackFit:n,legacyAspectRatioAttribute:Nn,legacyRadiusAttribute:zn})}function z(t,e){const n=new Map,o=t.querySelectorAll(`[${e}]`);for(const i of Array.from(o)){const r=i.getAttribute(e);r&&(n.has(r)||n.set(r,i))}return n}function Vn(t,e){const n=[],o=z(e,Tt),i=z(t,Yt);for(const[l,c]of o){const a=i.get(l);a&&n.push({key:l,fromEl:a,toEl:c,fromFit:D("exit"),toFit:D("enter")})}const r=z(t,Tt),s=z(e,Yt);for(const[l,c]of r){const a=s.get(l);a&&n.push({key:l,fromEl:c,toEl:a,fromFit:D("enter"),toFit:D("exit")})}return n}function Xn(t,e){const n=[],o=Array.from(e.querySelectorAll(`[${J}]`));for(const i of o){const r=i.getAttribute(J);if(!r)continue;const s=t.querySelector(`[${J}="${r}"]`);s&&n.push({key:r,fromEl:s,toEl:i,fromFit:D("legacy"),toFit:D("legacy")})}return n}function Un(t,e){const n=Vn(t,e);return n.length>0?n:Xn(t,e)}function Bn(t,e){return Zt(t,e)}function Zn(t,e){return t.radiusSource==="unsupported"||e.radiusSource==="unsupported"?!1:t.mediaElement!==null||e.mediaElement!==null||t.radiusSource==="computed"||t.radiusSource==="legacy"||e.radiusSource==="computed"||e.radiusSource==="legacy"}function Gn(t,e,n,o,i){const{fromEl:r,toEl:s}=e,[l,c]=Bn(Dt(t,r,e.fromFit,o),Dt(t,s,e.toFit,i)),a=l.content,d=l.window,p=c.content,u=c.window,h=c.clipInset,f=l.radiusSource==="unsupported"||c.radiusSource==="unsupported",y=f?0:l.radius,g=f?0:c.radius;if(a.width===0||a.height===0||d.width===0||d.height===0||p.width===0||p.height===0||u.width===0||u.height===0)return null;const C=Math.max(a.width/p.width,a.height/p.height),S=O(a),$=M(a),w=O(p),x=M(p),I=S-w,E=$-x;if(Math.abs(E)>n)return null;const P=W(p,Gt(p,a,d,C,C));return{toContent:p,fromVisualEl:l.mediaElement??r,toVisualEl:c.mediaElement??s,resetCloneRadius:Zn(l,c),styleFor:(R,A)=>{const X=A*I,te=A*E,ht=R+A*C,ee=l.cornerRadii??[y,y,y,y],ne=c.cornerRadii??[g,g,g,g],oe=ee.map((le,ce)=>{const yt=Math.max(0,le*A+ne[ce]*R)/Math.max(Math.abs(ht),1e-6);return{x:yt,y:yt}}),ie=P.top*A+h.top*R,re=P.right*A+h.right*R,se=P.bottom*A+h.bottom*R,ae=P.left*A+h.left*R;return{transform:`translate(${X}px, ${te}px) scale(${ht})`,clipPath:ft(p,{top:ie,right:re,bottom:se,left:ae},oe)}}}}function jn(t,e){t.style.transform=e.transform,t.style.clipPath=e.clipPath}class qn{contribute(e){const{resolved:n,physics:o,positionedParent:i,maxDistance:r,onComplete:s}=e,l=[];for(const c of n.pairs){const a=Gn(i,c,r,e.from,e.to);if(!a)continue;const{fromVisualEl:d,toVisualEl:p}=a,u=p.cloneNode(!0);u.style.position="absolute",u.style.left=`${a.toContent.left}px`,u.style.top=`${a.toContent.top}px`,u.style.width=`${a.toContent.width}px`,u.style.height=`${a.toContent.height}px`,u.style.margin="0",u.style.transformOrigin="center center",u.style.zIndex="1000",u.style.willChange="transform, clip-path",u.style.pointerEvents="none",u.style.maxWidth="none",u.style.maxHeight="none",a.resetCloneRadius&&(u.style.borderRadius="0"),jn(u,a.styleFor(0,1)),i.appendChild(u);const h=d.style.opacity,f=p.style.opacity;d.style.opacity="0",p.style.opacity="0",s(()=>{d.style.opacity=h,p.style.opacity=f,u.parentElement&&u.parentElement.removeChild(u)}),l.push(new m.WebAnimation({element:u,integrator:b.IntegratorProvider.from(o),style:a.styleFor}))}return l}}function Kn(t){return[new qn,Tn[t.type]()]}const Jn=t=>{const e=Kn(t),n=Hn[t.variant](),o=Wn;return{prepare:i=>{var l;const r=Promise.all([i.from,i.to]).then(([c,a])=>({pairs:Un(c,a)})),s={from:i.from,to:i.to,resolved:r};for(const c of e)(l=c.prepare)==null||l.call(c,s);return r.then(c=>({resolved:c}))},animation:({from:i,to:r,context:s,resolved:l})=>{if(l.pairs.length===0)return new m.MultiAnimation([],{mode:"parallel"});const c=[],a=f=>{c.push(f)},d={from:i,to:r,resolved:l,physics:n,positionedParent:s.positionedParent,maxDistance:o,onComplete:a},p=[];for(const f of e)f.contribute&&p.push(...f.contribute(d));if(p.length===0)return new m.MultiAnimation([],{mode:"parallel"});const u=new m.MultiAnimation(p,{mode:"parallel"}),h=u.onComplete;return u.onComplete=()=>{h==null||h();for(const f of c)try{f()}catch(y){console.error("[hero] cleanup error",y)}},u}}};function Qn(t={}){const e=t.type??"static",n=t.variant??"default";return Jn({type:e,variant:n})}const to={spring:{stiffness:50,damping:30}},eo={spring:{stiffness:80,damping:25}},no=(t={})=>{const e=t.physics??to,n=t.initialRotation??45,o=t.initialScale??.01,i=t.rotationTriggerPoint??.8;return{prepare:({from:r,to:s,context:l})=>(r.then(c=>{c.style.opacity="1"}),s.then(c=>{const a=F(l,"to"),d=Math.min(a.width,a.height)*.4;c.style.setProperty("--max-border-radius",`${d}px`),c.style.setProperty("--border-radius-scale","1"),c.style.willChange="transform",c.style.backfaceVisibility="hidden";const p=a.left+a.width/2,u=a.top+a.height/2;c.style.transformOrigin=`${p}px ${u}px`,c.style.position="fixed",c.style.top=`${a.top}px`,c.style.left=`${a.left}px`,c.style.width=`${a.width}px`,c.style.height=`${a.height}px`,c.style.zIndex="1000",c.style.overflow="hidden",c.style.transform=`rotate(${n}deg) scale(${o}) translateZ(0)`,c.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",c.style.opacity="1"}),{}),animation:({from:r,to:s})=>{const l=new m.WebAnimation({element:r,integrator:b.IntegratorProvider.from(eo),style:(a,d)=>({opacity:d}),onComplete:()=>{r.style.opacity=""}}),c=new m.WebAnimation({element:s,integrator:b.IntegratorProvider.from(e),style:a=>{let d;if(a<=.05)d=o;else if(a<=i){const f=(a-.05)/(i-.05),y=Math.pow(f,9);d=o+(.8-o)*y}else{const f=(a-i)/(1-i);d=.8+.2*(1-Math.pow(1-f,3))}const p=.7;let u;if(a<=p)u=n;else{const f=(a-p)/(1-p),y=1-Math.pow(1-f,2);u=n*(1-y)}let h;if(a<=p)h=1;else{const f=(a-p)/(1-p);h=1-Math.pow(f,.5)}return{transform:`rotate(${u.toFixed(2)}deg) scale(${d.toFixed(4)}) translateZ(0)`,"--border-radius-scale":h.toFixed(4)}},onComplete:()=>{s.style.willChange="",s.style.backfaceVisibility="",s.style.removeProperty("--max-border-radius"),s.style.removeProperty("--border-radius-scale"),s.style.transform="",s.style.transformOrigin="",s.style.position="",s.style.zIndex="",s.style.top="",s.style.left="",s.style.width="",s.style.height="",s.style.overflow="",s.style.borderRadius=""}});return new m.MultiAnimation([l,c],{mode:"parallel"})}}};function oo(t={}){return no()}const io={spring:{stiffness:100,damping:30}},ro=(t={})=>{const e=t.physics??io;return{prepare:({from:n,to:o})=>(n.then(i=>{i.style.transformOrigin="center center",i.style.willChange="transform, opacity"}),o.then(i=>{i.style.opacity="0",i.style.transform="rotate(-180deg)",i.style.transformOrigin="center center",i.style.willChange="transform, opacity"}),{}),animation:({from:n,to:o})=>{const i=new m.WebAnimation({element:n,integrator:b.IntegratorProvider.from(e),style:s=>({transform:`rotate(${s*180}deg)`,opacity:s<.5?1:0}),onComplete:()=>{n.style.willChange="auto",n.style.transform="",n.style.transformOrigin="",n.style.opacity=""}}),r=new m.WebAnimation({element:o,integrator:b.IntegratorProvider.from(e),style:(s,l)=>({transform:`rotate(${-l*180}deg)`,opacity:s>.5?1:0}),onComplete:()=>{o.style.willChange="auto",o.style.transform="",o.style.transformOrigin="",o.style.opacity=""}});return new m.MultiAnimation([i,r],{mode:"parallel"})}}};function so(t={}){return ro()}const ao={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},lo=(t={})=>{const e=t.physics??ao,n=t.directional??!0;return{prepare:({from:o,to:i,context:r})=>{const s=!n||r.direction==="forward",l=s?v:_,c=s?_:v;return o.then(a=>{a.style.zIndex=l,a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.pointerEvents="none"}),i.then(a=>{a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.position="relative",a.style.zIndex=c}),{}},animation:({from:o,to:i,context:r})=>{const s=!n||r.direction==="forward",l=s?_:v,c=o.offsetHeight,a=i.offsetHeight,d=window.innerHeight,p=Math.max(Math.min(c,a),d),u=new m.WebAnimation({element:o,integrator:b.IntegratorProvider.from(e),style:f=>({transform:`translate3d(0, ${s?-p*f:p*f}px, 0)`}),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform="",o.style.pointerEvents="",o.style.zIndex=""}}),h=new m.WebAnimation({element:i,integrator:b.IntegratorProvider.from(e),style:(f,y)=>({transform:`translate3d(0, ${s?y*p:y*-p}px, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform="",i.style.position==="relative"&&(i.style.position=""),i.style.zIndex===l&&(i.style.zIndex="")}});for(const f of[u,h]){const y=f.onComplete;f.onComplete=()=>{y==null||y(),f.releaseFill()}}return new m.MultiAnimation([u,h],{mode:"parallel"})}}};function co(t={}){const{type:e="directional"}=t;return lo({directional:e==="directional"})}const po={spring:{stiffness:200,damping:24}},uo={inertia:{acceleration:25,resistance:1.2}},Q=.2;function fo(){return{enterPhysics:po,exitPhysics:uo,background:{willChange:"transform, opacity",enterStyle:(t,e)=>({transform:`scale(${1-Q*t})`,opacity:e}),exitStyle:t=>({transform:`scale(${1-Q+Q*t})`,opacity:t})}}}const ho={spring:{stiffness:200,damping:24}},yo={inertia:{acceleration:25,resistance:1.2}},tt=.08,mo=16,et=.6,go=t=>`blur(${Math.max(0,t).toFixed(2)}px)`;function bo(){return{enterPhysics:ho,exitPhysics:yo,background:{willChange:"transform, opacity",enterStyle:t=>({transform:`scale(${1-tt*t})`,opacity:1-(1-et)*t}),exitStyle:t=>({transform:`scale(${1-tt+tt*t})`,opacity:et+(1-et)*t})},overlay:{willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(t,e)=>{const n=t==="enter"?e:1-e,o=go(mo*n);return{backdropFilter:o,WebkitBackdropFilter:o}}}}}const wo={spring:{stiffness:190,damping:25}},So={spring:{stiffness:190,damping:25}};function Co(){return{enterPhysics:wo,exitPhysics:So,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const xo={static:Co(),"background-scale":fo(),blur:bo()},$o="static",Eo="transform",Po=(t={})=>{const e=xo[t.type??$o],n=e.background,o=e.overlay,i=n.willChange!=="";return{prepare:({from:r,to:s,context:l,createElement:c})=>{const a=l.direction==="forward"?"enter":"exit",d=a==="enter"?s:r,p=a==="enter"?r:s;d.then(h=>{h.style.willChange=Eo,h.style.backfaceVisibility="hidden",h.style.contain="layout paint",h.style.zIndex=_,a==="enter"?h.style.position="relative":h.style.pointerEvents="none"}),p.then(h=>{i&&(h.style.willChange=n.willChange,h.style.backfaceVisibility="hidden",h.style.contain="layout paint"),h.style.zIndex=v,a==="enter"?h.style.pointerEvents="none":h.style.position="relative"});let u;return o&&(u=c("sheet-overlay"),Object.assign(u.style,o.initialStyle),u.style.willChange=o.willChange,l.positionedParent.appendChild(u)),{overlay:u}},animation:({from:r,to:s,context:l,overlay:c})=>{const a=l.direction==="forward"?"enter":"exit",d=a==="enter"?e.enterPhysics:e.exitPhysics,p=a==="enter"?s:r,u=a==="enter"?r:s,h=F(l,a==="enter"?"to":"from"),f=()=>{r.style.pointerEvents="",r.style.zIndex=""},y=()=>{const w=a==="enter"?_:v;s.style.position==="relative"&&(s.style.position=""),s.style.zIndex===w&&(s.style.zIndex="")},g=w=>{const x=w.onComplete;w.onComplete=()=>{x==null||x(),w.releaseFill()}};p.style.clipPath=`inset(${h.top}px 0 calc(100% - ${h.top+h.height}px) 0)`;const C=a==="enter"?(w,x)=>({transform:`translate3d(0, ${x*h.height}px, 0)`}):w=>({transform:`translate3d(0, ${w*h.height}px, 0)`}),S=new m.WebAnimation({element:p,integrator:b.IntegratorProvider.from(d),style:C,onComplete:()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.contain="",p.style.clipPath="",p.style.transform="",f(),y()}});g(S);const $=[S];if(i){const w=u.scrollHeight;w>0&&(u.style.height=`${w}px`);const x=F(l,a==="enter"?"from":"to"),I=x.left+x.width/2,E=x.top+x.height/2;u.style.clipPath=`inset(${x.top}px 0 calc(100% - ${x.top+x.height}px) 0)`,u.style.transformOrigin=`${I}px ${E}px`;const P=a==="enter"?(A,X)=>n.enterStyle(A,X):A=>n.exitStyle(A),R=new m.WebAnimation({element:u,integrator:b.IntegratorProvider.from(d),style:P,onComplete:()=>{u.style.willChange="auto",u.style.backfaceVisibility="",u.style.contain="",u.style.clipPath="",u.style.transformOrigin="",u.style.transform="",u.style.opacity="",u.style.height=""}});g(R),$.push(R)}if(c&&o){c.style.zIndex=Xt;const w=zt(l,"to");c.style.top=`${w.top}px`,c.style.height=`${w.height}px`,$.push(new m.WebAnimation({element:c,integrator:b.IntegratorProvider.from(d),style:x=>o.style(a,x)}))}return new m.MultiAnimation($,{mode:"parallel"})}}};function Ao(t){return t==="scale"||t==="background-scale"?"background-scale":t==="blur"?"blur":"static"}function Io(t={}){const e=t.type,n=Ao(e);return Po({type:n})}const Ro=(t={})=>{const e=t.physics??b.SLIDE_PHYSICS;return{prepare:({from:n,to:o,context:i})=>{const r=i.direction==="forward";return n.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.pointerEvents="none"}),o.then(s=>{const l=r?100:-100;s.style.transform=`translate3d(${l}%, 0, 0)`,s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint"}),{}},animation:({from:n,to:o,context:i})=>{const r=new m.WebAnimation({element:n,integrator:b.IntegratorProvider.from(e),style:l=>({transform:`translate3d(${100*b.pageMotionStyle("slide","out",i.direction,l).x}%, 0, 0)`}),onComplete:()=>{n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.transform="",n.style.pointerEvents=""}}),s=new m.WebAnimation({element:o,integrator:b.IntegratorProvider.from(e),style:l=>({transform:`translate3d(${100*b.pageMotionStyle("slide","in",i.direction,l).x}%, 0, 0)`}),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform=""}});return new m.MultiAnimation([r,s],{mode:"parallel"})}}};function vo(t={}){return Ro()}const _o={spring:{stiffness:17,damping:6}},nt=20,V=800,Oo=(t={})=>{const e=t.physics??_o;return{prepare:({from:n,to:o})=>(n.then(i=>{i.style.willChange="transform",i.style.backfaceVisibility="hidden",i.style.contain="layout paint",i.style.pointerEvents="none",i.style.transform=`perspective(${V}px) rotateY(0deg) translate3d(0%, 0, 0)`}),o.then(i=>{i.style.willChange="transform",i.style.backfaceVisibility="hidden",i.style.contain="layout paint",i.style.transform=`perspective(${V}px) rotateY(${nt}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:o})=>{const i=new m.WebAnimation({element:n,integrator:b.IntegratorProvider.from(e),style:s=>{const l=-s*nt,c=s*100;return{transform:`perspective(${V}px) rotateY(${l}deg) translate3d(${c}%, 0, 0)`}},onComplete:()=>{n.style.transform="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.pointerEvents=""}}),r=new m.WebAnimation({element:o,integrator:b.IntegratorProvider.from(e),style:(s,l)=>{const c=l*nt,a=-l*100;return{transform:`perspective(${V}px) rotateY(${c}deg) translate3d(${a}%, 0, 0)`}},onComplete:()=>{o.style.transform="",o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain=""}});return new m.MultiAnimation([i,r],{mode:"sequence"})}}};function Mo(t={}){return Oo()}function Fo(t,e){return e.left>=t.left-.01&&e.top>=t.top-.01&&e.left+e.width<=t.left+t.width+.01&&e.top+e.height<=t.top+t.height+.01}function jt(t){const e=()=>({enterContent:t.enterRect,exitContent:t.exitRect,startWindow:t.enterRect,scaleX:t.exitRect.width/t.enterRect.width,scaleY:t.exitRect.height/t.enterRect.height}),{enterMedia:n,exitMedia:o}=t;if(!n||!o||!Bt(n,o))return e();const i=n.content,r=o.content;if(i.width<=0||i.height<=0||r.width<=0||r.height<=0)return e();const s=r.width/i.width,l=r.height/i.height,c=Gt(i,r,o.window,s,l);return Fo(n.window,c)?{enterContent:i,exitContent:r,startWindow:c,scaleX:s,scaleY:l,exitCornerRadii:o.cornerRadii}:e()}function qt(t,e){return{top:t.top,right:e.width-(t.left+t.width),bottom:e.height-(t.top+t.height),left:t.left}}function To(t,e,n){return{x:t/Math.max(Math.abs(e),1e-6),y:t/Math.max(Math.abs(n),1e-6)}}function Kt(t,e,n,o,i,r){return(n??[t]).map(s=>To(Math.max(0,s*o+e*(1-o)),i,r))}function Yo(t){const{pageRect:e,scrollOffset:n,enterRadius:o,exitRadius:i}=t,r=jt(t),{enterContent:s,exitContent:l,startWindow:c,scaleX:a,scaleY:d}=r,p=l.left-s.left+(l.width-s.width)/2-n.x,u=l.top-s.top+(l.height-s.height)/2-n.y,h=qt(c,e);return{transformOrigin:`${O(s)}px ${M(s)}px`,animate:f=>{const y=1-f,g=1+(a-1)*y,C=1+(d-1)*y,S=Kt(i,o,r.exitCornerRadii,y,g,C);return{clipPath:ft(e,{top:h.top*y,right:h.right*y,bottom:h.bottom*y,left:h.left*y},S),transform:`translate(${p*y}px, ${u*y}px) scale(${g}, ${C})`}}}}function Do(t){const{pageRect:e,scrollOffset:n,enterRadius:o,exitRadius:i}=t,r=jt(t),{enterContent:s,exitContent:l,startWindow:c,scaleX:a,scaleY:d}=r,p=l.left-s.left+(l.width-s.width)/2+n.x,u=l.top-s.top+(l.height-s.height)/2+n.y,h=qt(c,e);return{transformOrigin:`${O(s)}px ${M(s)}px`,animate:f=>{const y=1-f,g=1+(a-1)*y,C=1+(d-1)*y,S=Kt(i,o,r.exitCornerRadii,y,g,C);return{clipPath:ft(e,{top:h.top*y,right:h.right*y,bottom:h.bottom*y,left:h.left*y},S),transform:`translate(${p*y-n.x}px, ${u*y}px) scale(${g}, ${C})`}}}}const Lo={spring:{stiffness:380,damping:30,restDelta:.1,restSpeed:.1,doubleSpring:{stiffness:260,damping:30}}},Jt=.12,ko=18;function Ho(){return{transformOrigin:"50% 50%",animate:t=>{const e=1-t;return{transform:`scale(${1-Jt*e})`}}}}function Wo(){return{transformOrigin:"50% 50%",animate:t=>{const e=1-t;return{transform:`scale(${1-Jt*e})`}}}}const ot={willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(t,e)=>{const n=t==="enter"?e:1-e,o=`blur(${ko*n}px)`;return{backdropFilter:o,WebkitBackdropFilter:o}}};class No{constructor(){T(this,"physics",Lo)}contribute(e){const{from:n,to:o,resolved:i,physics:r}=e,s=i.mode==="enter",l=s?n:o,c=s?Ho():Wo();return c&&(l.style.transformOrigin=c.transformOrigin),[new m.WebAnimation({element:l,integrator:b.IntegratorProvider.from(r),style:s?(a,d)=>c.animate(d):a=>c.animate(a)})]}}class zo{prepare(e){const n=e.createElement("zoom-overlay");return Object.assign(n.style,ot.initialStyle),n.style.willChange=ot.willChange,e.context.positionedParent.appendChild(n),{overlay:n}}contribute(e){const n=e.extras.overlay;if(!n)return[];n.style.zIndex=Xt;const o=zt(e.context,"to");return n.style.top=`${o.top}px`,n.style.height=`${o.height}px`,[new m.WebAnimation({element:n,integrator:b.IntegratorProvider.from(e.physics),style:i=>ot.style(e.resolved.mode,i)})]}}const Vo={spring:{stiffness:380,damping:30,doubleSpring:{stiffness:260,damping:30}}};function Xo({enterRect:t,exitRect:e,scrollOffset:n}){const o=t.left-e.left+(t.width-e.width)/2+n.x,i=t.top-e.top+(t.height-e.height)/2+n.y,r=t.width/e.width,s=t.height/e.height,l=Math.max(r,s);return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${o*a-n.x}px, ${i*a}px) scale(${1+(l-1)*a})`}}}}function Uo({enterRect:t,exitRect:e,scrollOffset:n}){const o=t.left-e.left+(t.width-e.width)/2-n.x,i=t.top-e.top+(t.height-e.height)/2-n.y,r=t.width/e.width,s=t.height/e.height,l=Math.max(r,s);return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${o*a}px, ${i*a}px) scale(${1+(l-1)*a})`}}}}class Bo{constructor(){T(this,"physics",Vo)}contribute(e){const{from:n,to:o,resolved:i,input:r,physics:s}=e,l=i.mode==="enter",c=l?n:o,a=l?Xo(r):Uo(r);return a&&(c.style.transformOrigin=a.transformOrigin),[new m.WebAnimation({element:c,integrator:b.IntegratorProvider.from(s),style:l?(d,p)=>a.animate(p):d=>a.animate(d)})]}}const Zo={spring:{stiffness:530,damping:34,doubleSpring:1}};class Go{constructor(){T(this,"physics",Zo)}contribute(e){return[]}}const jo={expand:()=>new Bo,static:()=>new Go,blur:()=>new No};function qo(t){return jo[t]()}const pt="data-zoom-enter-key",Lt="data-zoom-exit-key",kt="data-zoom-radius";function Ko(t,e){return Math.abs(t.left-e.left)<.01&&Math.abs(t.top-e.top)<.01&&Math.abs(t.width-e.width)<.01&&Math.abs(t.height-e.height)<.01}function Jo(t,e){const n=[];let o=e;for(;o&&o!==t;){const i=o.parentElement;if(!i)break;for(const r of Array.from(i.children))r!==o&&r instanceof HTMLElement&&n.push(r);o=i}return n}function Ht(t){const e=t.querySelectorAll(`[${pt}]`);return e.length!==1?null:e[0]}function Wt(t,e){const n=t.querySelectorAll(`[${Lt}]`);for(const o of n)if(o.getAttribute(Lt)===e)return o;return null}function Qo(t,e,n){if(n==="forward"){const s=Ht(e);if(!s)return null;const l=s.getAttribute(pt);if(!l)return null;const c=Wt(t,l);return c?{mode:"enter",enterEl:s,exitEl:c}:null}const o=Ht(t);if(!o)return null;const i=o.getAttribute(pt);if(!i)return null;const r=Wt(e,i);return r?{mode:"exit",enterEl:o,exitEl:r}:null}function ti(t,e,n,o){const i=t.mode==="enter"?n:e,r=t.mode==="enter"?e:n,s=k(i,t.enterEl),l=k(r,t.exitEl),c=ct(t.enterEl,s,g=>k(i,g),{clipRoot:i,legacyRadiusAttribute:kt}),a=ct(t.exitEl,l,g=>k(r,g),{clipRoot:r,legacyRadiusAttribute:kt}),[d,p]=Zt(c,a),u=d.contentAware&&p.contentAware,h=t.mode==="enter"?n.getBoundingClientRect():e.getBoundingClientRect(),f={left:0,top:0,width:h.width,height:h.height},y=d.radiusSource==="legacy"||Ko(d.window,f)?d.radius:0;return{enterRect:s,exitRect:l,...u?{enterMedia:d,exitMedia:p}:{},pageRect:h,scrollOffset:o,enterRadius:y,exitRadius:p.radius}}const it=new WeakMap;function ei(t){const e=it.get(t)??{opacity:t.style.opacity,users:0};e.users++,it.set(t,e),t.style.opacity="0";let n=!1;return()=>{n||(n=!0,!(--e.users>0)&&(t.style.opacity==="0"&&(t.style.opacity=e.opacity),it.delete(t)))}}class ni{prepare(e){e.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(e){const{from:n,to:o,resolved:i,input:r,physics:s,onComplete:l}=e,c=i.mode==="enter",a=c?Yo(r):Do(r),d=c?o:n,p=c?"t":"u";l(ei(i.exitEl)),a&&(d.style.transformOrigin=a.transformOrigin);const u=c?v:_,h=c?_:v,f=n.style.zIndex;n.style.zIndex=u;const y=o.style.zIndex,g=o.style.position;return o.style.zIndex=h,o.style.position="relative",l(()=>{d.style.willChange="auto",d.style.backfaceVisibility="",d.style.transformOrigin="",d.style.contain="",n.style.zIndex=f,o.style.zIndex===h&&(o.style.zIndex=y),o.style.position==="relative"&&(o.style.position=g),o.style.transformOrigin="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.transformOrigin="",n.style.contain="",n.style.transform="",n.style.clipPath=""}),[new m.WebAnimation({element:d,integrator:b.IntegratorProvider.from(s),style:p==="t"?C=>a.animate(C):(C,S)=>a.animate(S)})]}}class oi{contribute(e){const{resolved:n,physics:o,from:i,to:r,onComplete:s}=e,l=n.mode==="enter"?r:i,c=Jo(l,n.enterEl);if(c.length===0)return[];const a=c.map(d=>d.style.opacity);if(n.mode==="enter")for(const d of c)d.style.opacity="0";return s(()=>{for(let d=0;d<c.length;d++){const p=c[d];p&&(p.style.opacity=a[d]??"")}}),c.map(d=>new m.WebAnimation({element:d,integrator:b.IntegratorProvider.from(o),style:(p,u)=>({opacity:n.mode==="enter"?p:u})}))}}class Qt{contribute(){return[]}}const ii={default:()=>new Qt,fade:()=>new oi};function ri(t){return ii[t]()}class si extends Qt{}function ai(t){const e=qo(t.type);return{strategies:[new ni,e,ri(t.variant),new si,...t.type==="blur"?[new zo]:[]],physics:e.physics}}const li=t=>{const{strategies:e,physics:n}=ai(t);return{prepare:o=>{const i={from:o.from,to:o.to,context:{positionedParent:o.context.positionedParent},createElement:o.createElement},r={};for(const s of e){if(!s.prepare)continue;const l=s.prepare(i);l&&Object.assign(r,l)}return r},animation:({from:o,to:i,context:r,...s})=>{const l=Qo(o,i,r.direction);if(!l)return new m.MultiAnimation([],{mode:"parallel"});const c=ti(l,o,i,r.scrollOffset),a=[],p={from:o,to:i,resolved:l,input:c,physics:n,context:r,extras:s,onComplete:f=>{a.push(f)}},u=[];for(const f of e)f.contribute&&u.push(...f.contribute(p));const h=u[0];if(h){const f=h.onComplete;h.onComplete=()=>{f==null||f();for(const y of a)try{y()}catch(g){console.error("[zoom] cleanup error",g)}}}for(const f of u){if(!(f instanceof m.WebAnimation))continue;const y=f.onComplete;f.onComplete=()=>{y==null||y(),f.releaseFill()}}return new m.MultiAnimation(u,{mode:"parallel"})}}};function ci(t){const e=t.type??"static",n=t.variant??(t.fade?"fade":"default");return{type:e,variant:n}}function pi(t={}){const e=ci(t);return li(e)}exports.Animation=m.Animation;exports.MultiAnimation=m.MultiAnimation;exports.WebAnimation=m.WebAnimation;exports.axis=ze;exports.blind=Ge;exports.drill=sn;exports.fade=ln;exports.film=gn;exports.hero=Qn;exports.jaemin=oo;exports.rotate=so;exports.scroll=co;exports.sheet=Io;exports.slide=vo;exports.strip=Mo;exports.zoom=pi;
|