@ssgoi/core 7.0.3 → 7.0.4
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 +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -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 K(e,t,n,i,s){const o=n/1e3;return new m.WebAnimation({element:e,integrator:new ae({durationSec:o}),lowerBound:0,upperBound:1,style:r=>i(pn(t,r)),onComplete:s})}const fn=(e={})=>{var s;const t=((s=e.border)==null?void 0:s.color)??an,n=rn,i=e.physics;return{prepare:({from:o,to:r,context:l})=>{const c=T(l,"from"),a=T(l,"to"),p=Y(document.body,l.positionedParent),u=dn(t,{...c,top:p.top});for(const d of["topLeft","topRight","bottomLeft","bottomRight"])l.positionedParent.appendChild(u[d]);return o.then(d=>{Et(d,c),At(d,c),d.style.transform=`translateY(${-c.top}px)`}),r.then(d=>{Et(d,a),At(d,a),d.style.transform=`translateY(${-a.top+a.height}px) scale(${n})`}),{borders:u,fromRect:c,toRect:a}},animation:({from:o,to:r,context:l,borders:c,fromRect:a,toRect:p})=>{const u=$t({rect:a,scale:n,direction:"out",override:i}),d=$t({rect:p,scale:n,direction:"in",override:i}),h=K(o,u.snapshots,u.totalDuration,b=>({transform:`translateY(${b.translateY}px) scale(${b.scale})`}),()=>{o.style.clipPath="",o.style.transformOrigin="",o.style.transform=""}),f=K(r,d.snapshots,d.totalDuration,b=>({transform:`translateY(${b.translateY}px) scale(${b.scale})`}),()=>{r.style.clipPath="",r.style.transformOrigin="",r.style.transform=""}),y=un.map(([b,$],x)=>{const C=["topLeft","topRight","bottomLeft","bottomRight"][x];return K(c[C],u.snapshots,u.totalDuration,_=>{const P=(a.width-a.width*_.scale)/2*.7*b,A=(a.height-a.height*_.scale)/2*.7*$;return{transform:`translate(${P}px, ${A}px)`}})}),g=new m.MultiAnimation([h,f,...y],{mode:"parallel"}),S=g.onComplete;return g.onComplete=()=>{S==null||S();const b=l.positionedParent;for(const $ of["topLeft","topRight","bottomLeft","bottomRight"]){const x=c[$];x.parentElement===b&&b.removeChild(x)}},g}}};function hn(e={}){const{options:t}=e,n=(t==null?void 0:t.borderColor)!==void 0?{border:{color:t.borderColor}}:void 0;return fn(n)}function yn(e){if(!e)return null;if(e.includes("/")){const n=e.split("/");if(n.length!==2)return null;const i=Number.parseFloat(n[0]??""),s=Number.parseFloat(n[1]??"");return Number.isFinite(i)&&Number.isFinite(s)&&i>0&&s>0?i/s:null}const t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function mn(e){return e==="contain"||e==="cover"?e:null}function st(e){return e.tagName==="IMG"}function gn(e){if(st(e))return e;if(e.tagName==="PICTURE"||e.tagName==="VIDEO")return null;const t=[];for(const n of Array.from(e.children)){const i=n;st(i)&&t.push(i)}return t.length===1?t[0]??null:null}function bn(e){var c,a;if(!st(e))return null;const t=e,n=t.naturalWidth,i=t.naturalHeight;if(typeof n=="number"&&typeof i=="number"&&Number.isFinite(n)&&Number.isFinite(i)&&n>0&&i>0)return n/i;const s=((c=e.getAttribute("width"))==null?void 0:c.trim())??"",o=((a=e.getAttribute("height"))==null?void 0:a.trim())??"",r=s===""?Number.NaN:Number(s),l=o===""?Number.NaN:Number(o);return Number.isFinite(r)&&Number.isFinite(l)&&r>0&&l>0?r/l:null}function wn(e){const t=e.trim().toLowerCase().replace(/\s+/g," ");return t===""||t==="center"||t==="center center"||t==="50% 50%"}function V(e){if(typeof getComputedStyle=="function")try{return getComputedStyle(e)}catch{}return e.style}function Sn(e){const t=V(e),n=wn(t.objectPosition??"");return{fit:n?mn(t.objectFit??null):null,centered:n}}function Ht(e){if(!e)return 0;const t=/^(-?(?:\d+\.?\d*|\.\d+))px$/.exec(e.trim());if(!t)return null;const n=Number.parseFloat(t[1]??"");return Number.isFinite(n)&&n>=0?n:null}function Pt(e){const t=V(e),n=[t.borderTopLeftRadius,t.borderTopRightRadius,t.borderBottomRightRadius,t.borderBottomLeftRadius].map(Ht),i=n[0];if(i==null)return{radius:0,supported:!1};const s=n.every(o=>o!==null&&Math.abs(o-i)<.001);return{radius:s?i:0,supported:s}}function xn(e,t){var s;if(!t)return null;const n=(s=e.getAttribute(t))==null?void 0:s.trim();if(n==null||n==="")return null;const i=Number.parseFloat(n);return Number.isFinite(i)&&i>=0?i:null}function Cn(e){const t=V(e);return[t.paddingTop,t.paddingRight,t.paddingBottom,t.paddingLeft,t.borderTopWidth,t.borderRightWidth,t.borderBottomWidth,t.borderLeftWidth].every(i=>i?Ht(i)===0:!0)}function $n(e){const t=V(e),n=i=>i==="hidden"||i==="clip";return n(t.overflowX)&&n(t.overflowY)}function O(e){return e.left+e.width/2}function v(e){return e.top+e.height/2}function lt(e,t){return{top:Math.max(0,t.top-e.top),right:Math.max(0,e.left+e.width-(t.left+t.width)),bottom:Math.max(0,e.top+e.height-(t.top+t.height)),left:Math.max(0,t.left-e.left)}}function En(e,t){const n=Math.max(e.left,t.left),i=Math.max(e.top,t.top),s=Math.min(e.left+e.width,t.left+t.width),o=Math.min(e.top+e.height,t.top+t.height);return s>n&&o>i?{left:n,top:i,width:s-n,height:o-i}:null}function _t(e,t){return Math.abs(e.left-t.left)<.01&&Math.abs(e.top-t.top)<.01&&Math.abs(e.width-t.width)<.01&&Math.abs(e.height-t.height)<.01}function An(e,t,n){const i=e.width/e.height;let s,o;return n==="contain"?i>t?(o=e.height,s=o*t):(s=e.width,o=s/t):i>t?(s=e.width,o=s/t):(o=e.height,s=o*t),{left:e.left+(e.width-s)/2,top:e.top+(e.height-o)/2,width:s,height:o}}function Nt(e,t,n){const i=t!==null&&n!==null&&e.width>0&&e.height>0?An(e,t,n):e,s=n==="contain"?i:e;return{bbox:e,content:i,window:s,clipInset:lt(i,s),aspectRatio:t,fit:n,radius:0,radiusSource:"none",bboxRadius:0,bboxRadiusSource:"none",contentAware:t!==null&&n!==null,mediaElement:null}}function ot(e,t,n){return{...Nt(e,null,null),radius:t,radiusSource:n,bboxRadius:t,bboxRadiusSource:n}}function Wt(e,t){const n=e.aspectRatio,i=t.aspectRatio;return e.contentAware&&t.contentAware&&n!==null&&i!==null&&Math.abs(n-i)/Math.max(n,i)<.01}function It(e){return ot(e.bbox,e.bboxRadius,e.bboxRadiusSource)}function zt(e,t){return Wt(e,t)?[e,t]:[It(e),It(t)]}function rt(e,t,n,i){const s=gn(e),o=s?n(s):t,r=i.legacyAspectRatioAttribute?yn(e.getAttribute(i.legacyAspectRatioAttribute)??(s==null?void 0:s.getAttribute(i.legacyAspectRatioAttribute))??null):null,l=r??(s?bn(s):null),c=s?Sn(s):{fit:null,centered:!0},a=c.centered&&(s===null||Cn(s))?c.fit??(r!==null?i.fallbackFit??null:null):null,p=Nt(o,l,a),u=$n(e),h=s!==null&&s!==e&&u?En(p.window,t):p.window,f=xn(e,i.legacyRadiusAttribute),y=s===e||u,g=y?Pt(e):{radius:0,supported:!0},S=f??g.radius,b=f!==null?"legacy":g.supported?g.radius>0?"computed":"none":"unsupported",$=[];h&&y&&_t(h,t)&&$.push(g),h&&s&&_t(h,o)&&$.push(Pt(s));const x=$.every(A=>A.supported),C=Math.max(0,...$.map(A=>A.radius)),_=f??C,P=f!==null?"legacy":x?C>0?"computed":"none":"unsupported";return!h||P==="unsupported"?ot(t,S,b):{...p,bbox:t,window:h,clipInset:lt(p.content,h),radius:_,radiusSource:P,bboxRadius:S,bboxRadiusSource:b,mediaElement:p.contentAware?s:null}}function Ut(e,t,n,i,s){const o=n.width/i,r=n.height/s;return{left:O(e)+(O(n)-O(t))/i-o/2,top:v(e)+(v(n)-v(t))/s-r/2,width:o,height:r}}const Pn={enter:"contain",exit:"cover",legacy:"contain"};function F(e){return Pn[e]}const Rt="data-hero-enter-key",Ot="data-hero-exit-key",J="data-hero-key";class _n{constructor(){E(this,"previousFromOpacity","")}prepare(t){t.from.then(n=>{this.previousFromOpacity=n.style.opacity,n.style.opacity="0"})}contribute(t){return t.onComplete(()=>{t.from.style.opacity=this.previousFromOpacity}),[]}}const In=()=>new _n;class Rn{contribute(t){const{from:n,to:i,physics:s,onComplete:o}=t,r=n.style.opacity,l=i.style.opacity,c=n.style.willChange,a=i.style.willChange;return i.style.opacity="0",n.style.willChange="opacity",i.style.willChange="opacity",o(()=>{n.style.opacity=r,i.style.opacity=l,n.style.willChange=c,i.style.willChange=a}),[new m.WebAnimation({element:n,integrator:w.from(s),style:(p,u)=>({opacity:u})}),new m.WebAnimation({element:i,integrator:w.from(s),style:p=>({opacity:p})})]}}const On=()=>new Rn,vn={static:In,fade:On},Tn={spring:{stiffness:320,damping:30}},Dn=()=>Tn,Fn={spring:{stiffness:300,damping:30,doubleSpring:1}},Mn=()=>Fn,Ln={default:Dn,smooth:Mn},Yn=700,kn="data-hero-aspect-ratio",Hn="data-hero-radius";function vt(e,t,n){const i=Y(e,t);return rt(t,i,s=>Y(e,s),{fallbackFit:n,legacyAspectRatioAttribute:kn,legacyRadiusAttribute:Hn})}function W(e,t){const n=new Map,i=e.querySelectorAll(`[${t}]`);for(const s of Array.from(i)){const o=s.getAttribute(t);o&&(n.has(o)||n.set(o,s))}return n}function Nn(e,t){const n=[],i=W(t,Rt),s=W(e,Ot);for(const[l,c]of i){const a=s.get(l);a&&n.push({key:l,fromEl:a,toEl:c,fromFit:F("exit"),toFit:F("enter")})}const o=W(e,Rt),r=W(t,Ot);for(const[l,c]of o){const a=r.get(l);a&&n.push({key:l,fromEl:c,toEl:a,fromFit:F("enter"),toFit:F("exit")})}return n}function Wn(e,t){const n=[],i=Array.from(t.querySelectorAll(`[${J}]`));for(const s of i){const o=s.getAttribute(J);if(!o)continue;const r=e.querySelector(`[${J}="${o}"]`);r&&n.push({key:o,fromEl:r,toEl:s,fromFit:F("legacy"),toFit:F("legacy")})}return n}function zn(e,t){const n=Nn(e,t);return n.length>0?n:Wn(e,t)}function Un(e,t){return zt(e,t)}function Vn(e,t){return e.radiusSource==="unsupported"||t.radiusSource==="unsupported"?!1:e.mediaElement!==null||t.mediaElement!==null||e.radiusSource==="computed"||e.radiusSource==="legacy"||t.radiusSource==="computed"||t.radiusSource==="legacy"}function Xn(e,t,n){const{fromEl:i,toEl:s}=t,[o,r]=Un(vt(e,i,t.fromFit),vt(e,s,t.toFit)),l=o.content,c=o.window,a=r.content,p=r.window,u=r.clipInset,d=o.radiusSource==="unsupported"||r.radiusSource==="unsupported",h=d?0:o.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 y=Math.max(l.width/a.width,l.height/a.height),g=O(l),S=v(l),b=O(a),$=v(a),x=g-b,C=S-$;if(Math.abs(C)>n)return null;const _=lt(a,Ut(a,l,c,y,y));return{toContent:a,fromVisualEl:o.mediaElement??i,toVisualEl:r.mediaElement??s,resetCloneRadius:Vn(o,r),styleFor:(P,A)=>{const k=A*x,M=A*C,H=P+A*y,jt=Math.max(0,h*A+f*P)/Math.max(Math.abs(H),1e-6),qt=_.top*A+u.top*P,Kt=_.right*A+u.right*P,Jt=_.bottom*A+u.bottom*P,Qt=_.left*A+u.left*P;return{transform:`translate(${k}px, ${M}px) scale(${H})`,clipPath:`inset(${qt}px ${Kt}px ${Jt}px ${Qt}px round ${jt}px)`}}}}function Bn(e,t){e.style.transform=t.transform,e.style.clipPath=t.clipPath}class Zn{contribute(t){const{resolved:n,physics:i,positionedParent:s,maxDistance:o,onComplete:r}=t,l=[];for(const c of n.pairs){const a=Xn(s,c,o);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"),Bn(d,a.styleFor(0,1)),s.appendChild(d);const h=p.style.opacity,f=u.style.opacity;p.style.opacity="0",u.style.opacity="0",r(()=>{p.style.opacity=h,u.style.opacity=f,d.parentElement&&d.parentElement.removeChild(d)}),l.push(new m.WebAnimation({element:d,integrator:w.from(i),style:a.styleFor}))}return l}}function Gn(e){return[new Zn,vn[e.type]()]}const jn=e=>{const t=Gn(e),n=Ln[e.variant](),i=Yn;return{prepare:s=>{var l;const o=Promise.all([s.from,s.to]).then(([c,a])=>({pairs:zn(c,a)})),r={from:s.from,to:s.to,resolved:o};for(const c of t)(l=c.prepare)==null||l.call(c,r);return o.then(c=>({resolved:c}))},animation:({from:s,to:o,context:r,resolved:l})=>{if(l.pairs.length===0)return new m.MultiAnimation([],{mode:"parallel"});const c=[],a=f=>{c.push(f)},p={from:s,to:o,resolved:l,physics:n,positionedParent:r.positionedParent,maxDistance:i,onComplete:a},u=[];for(const f of t)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"}),h=d.onComplete;return d.onComplete=()=>{h==null||h();for(const f of c)try{f()}catch(y){console.error("[hero] cleanup error",y)}},d}}};function qn(e={}){const t=e.type??"static",n=e.variant??"default";return jn({type:t,variant:n})}const Kn={spring:{stiffness:50,damping:30}},Jn={spring:{stiffness:80,damping:25}},Qn=(e={})=>{const t=e.physics??Kn,n=e.initialRotation??45,i=e.initialScale??.01,s=e.rotationTriggerPoint??.8;return{prepare:({from:o,to:r,context:l})=>(o.then(c=>{c.style.opacity="1"}),r.then(c=>{const a=T(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(${i}) translateZ(0)`,c.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",c.style.opacity="1"}),{}),animation:({from:o,to:r})=>{const l=new m.WebAnimation({element:o,integrator:w.from(Jn),style:(a,p)=>({opacity:p}),onComplete:()=>{o.style.opacity=""}}),c=new m.WebAnimation({element:r,integrator:w.from(t),style:a=>{let p;if(a<=.05)p=i;else if(a<=s){const f=(a-.05)/(s-.05),y=Math.pow(f,9);p=i+(.8-i)*y}else{const f=(a-s)/(1-s);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),y=1-Math.pow(1-f,2);d=n*(1-y)}let h;if(a<=u)h=1;else{const f=(a-u)/(1-u);h=1-Math.pow(f,.5)}return{transform:`rotate(${d.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,"--border-radius-scale":h.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 ti(e={}){return Qn()}const ei={spring:{stiffness:100,damping:30}},ni=(e={})=>{const t=e.physics??ei;return{prepare:({from:n,to:i})=>(n.then(s=>{s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),i.then(s=>{s.style.opacity="0",s.style.transform="rotate(-180deg)",s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),{}),animation:({from:n,to:i})=>{const s=new m.WebAnimation({element:n,integrator:w.from(t),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=""}}),o=new m.WebAnimation({element:i,integrator:w.from(t),style:(r,l)=>({transform:`rotate(${-l*180}deg)`,opacity:r>.5?1:0}),onComplete:()=>{i.style.willChange="auto",i.style.transform="",i.style.transformOrigin="",i.style.opacity=""}});return new m.MultiAnimation([s,o],{mode:"parallel"})}}};function ii(e={}){return ni()}const si={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},oi=(e={})=>{const t=e.physics??si,n=e.directional??!0;return{prepare:({from:i,to:s,context:o})=>{const r=!n||o.direction==="forward",l=r?I:R,c=r?R:I;return i.then(a=>{a.style.zIndex=l,a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.pointerEvents="none"}),s.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:i,to:s,context:o})=>{const r=!n||o.direction==="forward",l=r?R:I,c=i.offsetHeight,a=s.offsetHeight,p=window.innerHeight,u=Math.max(Math.min(c,a),p),d=new m.WebAnimation({element:i,integrator:w.from(t),style:f=>({transform:`translate3d(0, ${r?-u*f:u*f}px, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform="",i.style.pointerEvents="",i.style.zIndex=""}}),h=new m.WebAnimation({element:s,integrator:w.from(t),style:(f,y)=>({transform:`translate3d(0, ${r?y*u:y*-u}px, 0)`}),onComplete:()=>{s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain="",s.style.transform="",s.style.position==="relative"&&(s.style.position=""),s.style.zIndex===l&&(s.style.zIndex="")}});for(const f of[d,h]){const y=f.onComplete;f.onComplete=()=>{y==null||y(),f.releaseFill()}}return new m.MultiAnimation([d,h],{mode:"parallel"})}}};function ri(e={}){const{type:t="directional"}=e;return oi({directional:t==="directional"})}const ai={spring:{stiffness:200,damping:24}},li={inertia:{acceleration:25,resistance:1.2}},Q=.2;function ci(){return{enterPhysics:ai,exitPhysics:li,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-Q*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-Q+Q*e})`,opacity:e})}}}const pi={spring:{stiffness:200,damping:24}},ui={inertia:{acceleration:25,resistance:1.2}},tt=.08,di=16,et=.6,fi=e=>`blur(${Math.max(0,e).toFixed(2)}px)`;function hi(){return{enterPhysics:pi,exitPhysics:ui,background:{willChange:"transform, opacity",enterStyle:e=>({transform:`scale(${1-tt*e})`,opacity:1-(1-et)*e}),exitStyle:e=>({transform:`scale(${1-tt+tt*e})`,opacity:et+(1-et)*e})},overlay:{willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,i=fi(di*n);return{backdropFilter:i,WebkitBackdropFilter:i}}}}}const yi={spring:{stiffness:230,damping:25}},mi={spring:{stiffness:230,damping:25}};function gi(){return{enterPhysics:yi,exitPhysics:mi,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const bi={static:gi(),"background-scale":ci(),blur:hi()},wi="static",Si="transform",xi=(e={})=>{const t=bi[e.type??wi],n=t.background,i=t.overlay,s=n.willChange!=="";return{prepare:({from:o,to:r,context:l,createElement:c})=>{const a=l.direction==="forward"?"enter":"exit",p=a==="enter"?r:o,u=a==="enter"?o:r;p.then(h=>{h.style.willChange=Si,h.style.backfaceVisibility="hidden",h.style.contain="layout paint",h.style.zIndex=R,a==="enter"?h.style.position="relative":h.style.pointerEvents="none"}),u.then(h=>{s&&(h.style.willChange=n.willChange,h.style.backfaceVisibility="hidden",h.style.contain="layout paint"),h.style.zIndex=I,a==="enter"?h.style.pointerEvents="none":h.style.position="relative"});let d;return i&&(d=c("sheet-overlay"),Object.assign(d.style,i.initialStyle),d.style.willChange=i.willChange,l.positionedParent.appendChild(d)),{overlay:d}},animation:({from:o,to:r,context:l,overlay:c})=>{const a=l.direction==="forward"?"enter":"exit",p=a==="enter"?t.enterPhysics:t.exitPhysics,u=a==="enter"?r:o,d=a==="enter"?o:r,h=T(l,a==="enter"?"to":"from"),f=()=>{o.style.pointerEvents="",o.style.zIndex=""},y=()=>{const x=a==="enter"?R:I;r.style.position==="relative"&&(r.style.position=""),r.style.zIndex===x&&(r.style.zIndex="")},g=x=>{const C=x.onComplete;x.onComplete=()=>{C==null||C(),x.releaseFill()}};u.style.clipPath=`inset(${h.top}px 0 calc(100% - ${h.top+h.height}px) 0)`;const S=a==="enter"?(x,C)=>({transform:`translate3d(0, ${C*h.height}px, 0)`}):x=>({transform:`translate3d(0, ${x*h.height}px, 0)`}),b=new m.WebAnimation({element:u,integrator:w.from(p),style:S,onComplete:()=>{u.style.willChange="auto",u.style.backfaceVisibility="",u.style.contain="",u.style.clipPath="",u.style.transform="",f(),y()}});g(b);const $=[b];if(s){const x=d.scrollHeight;x>0&&(d.style.height=`${x}px`);const C=T(l,a==="enter"?"from":"to"),_=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=`${_}px ${P}px`;const A=a==="enter"?(M,H)=>n.enterStyle(M,H):M=>n.exitStyle(M),k=new m.WebAnimation({element:d,integrator:w.from(p),style:A,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=""}});g(k),$.push(k)}if(c&&i){c.style.zIndex=kt;const x=Lt(l,"to");c.style.top=`${x.top}px`,c.style.height=`${x.height}px`,$.push(new m.WebAnimation({element:c,integrator:w.from(p),style:C=>i.style(a,C)}))}return new m.MultiAnimation($,{mode:"parallel"})}}};function Ci(e){return e==="scale"||e==="background-scale"?"background-scale":e==="blur"?"blur":"static"}function $i(e={}){const t=e.type,n=Ci(t);return xi({type:n})}const Ei={spring:{stiffness:170,damping:22,doubleSpring:.8}},Ai=(e={})=>{const t=e.physics??Ei;return{prepare:({from:n,to:i,context:s})=>{const o=s.direction==="forward";return n.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{const l=o?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:i,context:s})=>{const o=s.direction==="forward",r=new m.WebAnimation({element:n,integrator:w.from(t),style:c=>({transform:`translate3d(${o?-100*c:100*c}%, 0, 0)`}),onComplete:()=>{n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.transform="",n.style.pointerEvents=""}}),l=new m.WebAnimation({element:i,integrator:w.from(t),style:(c,a)=>({transform:`translate3d(${o?a*100:a*-100}%, 0, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new m.MultiAnimation([r,l],{mode:"parallel"})}}};function Pi(e={}){return Ai()}const _i={spring:{stiffness:17,damping:6}},nt=20,z=800,Ii=(e={})=>{const t=e.physics??_i;return{prepare:({from:n,to:i})=>(n.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.pointerEvents="none",s.style.transform=`perspective(${z}px) rotateY(0deg) translate3d(0%, 0, 0)`}),i.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.transform=`perspective(${z}px) rotateY(${nt}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:i})=>{const s=new m.WebAnimation({element:n,integrator:w.from(t),style:r=>{const l=-r*nt,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=""}}),o=new m.WebAnimation({element:i,integrator:w.from(t),style:(r,l)=>{const c=l*nt,a=-l*100;return{transform:`perspective(${z}px) rotateY(${c}deg) translate3d(${a}%, 0, 0)`}},onComplete:()=>{i.style.transform="",i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain=""}});return new m.MultiAnimation([s,o],{mode:"sequence"})}}};function Ri(e={}){return Ii()}function Oi(e,t){return t.left>=e.left-.01&&t.top>=e.top-.01&&t.left+t.width<=e.left+e.width+.01&&t.top+t.height<=e.top+e.height+.01}function Vt(e){const t=()=>({enterContent:e.enterRect,exitContent:e.exitRect,startWindow:e.enterRect,scaleX:e.exitRect.width/e.enterRect.width,scaleY:e.exitRect.height/e.enterRect.height}),{enterMedia:n,exitMedia:i}=e;if(!n||!i||!Wt(n,i))return t();const s=n.content,o=i.content;if(s.width<=0||s.height<=0||o.width<=0||o.height<=0)return t();const r=o.width/s.width,l=o.height/s.height,c=Ut(s,o,i.window,r,l);return Oi(n.window,c)?{enterContent:s,exitContent:o,startWindow:c,scaleX:r,scaleY:l}:t()}function Xt(e,t){return{top:e.top/t.height*100,right:(t.width-(e.left+e.width))/t.width*100,bottom:(t.height-(e.top+e.height))/t.height*100,left:e.left/t.width*100}}function Bt(e,t,n){return{x:e/Math.max(Math.abs(t),1e-6),y:e/Math.max(Math.abs(n),1e-6)}}function vi(e){const{pageRect:t,scrollOffset:n,enterRadius:i,exitRadius:s}=e,o=Vt(e),{enterContent:r,exitContent:l,startWindow:c,scaleX:a,scaleY:p}=o,u=l.left-r.left+(l.width-r.width)/2-n.x,d=l.top-r.top+(l.height-r.height)/2-n.y,h=Xt(c,t);return{transformOrigin:`${O(r)}px ${v(r)}px`,animate:f=>{const y=1-f,g=1+(a-1)*y,S=1+(p-1)*y,b=Math.max(0,s*y+i*(1-y)),$=Bt(b,g,S);return{clipPath:`inset(${h.top*y}% ${h.right*y}% ${h.bottom*y}% ${h.left*y}% round ${$.x}px / ${$.y}px)`,transform:`translate(${u*y}px, ${d*y}px) scale(${g}, ${S})`}}}}function Ti(e){const{pageRect:t,scrollOffset:n,enterRadius:i,exitRadius:s}=e,o=Vt(e),{enterContent:r,exitContent:l,startWindow:c,scaleX:a,scaleY:p}=o,u=l.left-r.left+(l.width-r.width)/2+n.x,d=l.top-r.top+(l.height-r.height)/2+n.y,h=Xt(c,t);return{transformOrigin:`${O(r)}px ${v(r)}px`,animate:f=>{const y=1-f,g=1+(a-1)*y,S=1+(p-1)*y,b=Math.max(0,i*(1-y)+s*y),$=Bt(b,g,S);return{clipPath:`inset(${h.top*y}% ${h.right*y}% ${h.bottom*y}% ${h.left*y}% round ${$.x}px / ${$.y}px)`,transform:`translate(${u*y-n.x}px, ${d*y}px) scale(${g}, ${S})`}}}}const Di={spring:{stiffness:380,damping:30,restDelta:.1,restSpeed:.1,doubleSpring:{stiffness:260,damping:30}}},Zt=.12,Fi=18;function Mi(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Zt*t})`}}}}function Li(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Zt*t})`}}}}const it={willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,i=`blur(${Fi*n}px)`;return{backdropFilter:i,WebkitBackdropFilter:i}}};class Yi{constructor(){E(this,"physics",Di)}contribute(t){const{from:n,to:i,resolved:s,physics:o}=t,r=s.mode==="enter",l=r?n:i,c=r?Mi():Li();return c&&(l.style.transformOrigin=c.transformOrigin),[new m.WebAnimation({element:l,integrator:w.from(o),style:r?(a,p)=>c.animate(p):a=>c.animate(a)})]}}class ki{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,it.initialStyle),n.style.willChange=it.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;if(!n)return[];n.style.zIndex=kt;const i=Lt(t.context,"to");return n.style.top=`${i.top}px`,n.style.height=`${i.height}px`,[new m.WebAnimation({element:n,integrator:w.from(t.physics),style:s=>it.style(t.resolved.mode,s)})]}}const Hi={spring:{stiffness:380,damping:30,doubleSpring:{stiffness:260,damping:30}}};function Ni({enterRect:e,exitRect:t,scrollOffset:n}){const i=e.left-t.left+(e.width-t.width)/2+n.x,s=e.top-t.top+(e.height-t.height)/2+n.y,o=e.width/t.width,r=e.height/t.height,l=Math.max(o,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${i*a-n.x}px, ${s*a}px) scale(${1+(l-1)*a})`}}}}function Wi({enterRect:e,exitRect:t,scrollOffset:n}){const i=e.left-t.left+(e.width-t.width)/2-n.x,s=e.top-t.top+(e.height-t.height)/2-n.y,o=e.width/t.width,r=e.height/t.height,l=Math.max(o,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${i*a}px, ${s*a}px) scale(${1+(l-1)*a})`}}}}class zi{constructor(){E(this,"physics",Hi)}contribute(t){const{from:n,to:i,resolved:s,input:o,physics:r}=t,l=s.mode==="enter",c=l?n:i,a=l?Ni(o):Wi(o);return a&&(c.style.transformOrigin=a.transformOrigin),[new m.WebAnimation({element:c,integrator:w.from(r),style:l?(p,u)=>a.animate(u):p=>a.animate(p)})]}}const Ui={spring:{stiffness:530,damping:34,doubleSpring:1}};class Vi{constructor(){E(this,"physics",Ui)}contribute(t){return[]}}const Xi={expand:()=>new zi,static:()=>new Vi,blur:()=>new Yi};function Bi(e){return Xi[e]()}const at="data-zoom-enter-key",Tt="data-zoom-exit-key",Dt="data-zoom-radius";function Zi(e,t){return Math.abs(e.left-t.left)<.01&&Math.abs(e.top-t.top)<.01&&Math.abs(e.width-t.width)<.01&&Math.abs(e.height-t.height)<.01}function Gi(e,t){const n=[];let i=t;for(;i&&i!==e;){const s=i.parentElement;if(!s)break;for(const o of Array.from(s.children))o!==i&&o instanceof HTMLElement&&n.push(o);i=s}return n}function Ft(e){const t=e.querySelectorAll(`[${at}]`);return t.length!==1?null:t[0]}function Mt(e,t){const n=e.querySelectorAll(`[${Tt}]`);for(const i of n)if(i.getAttribute(Tt)===t)return i;return null}function ji(e,t,n){if(n==="forward"){const r=Ft(t);if(!r)return null;const l=r.getAttribute(at);if(!l)return null;const c=Mt(e,l);return c?{mode:"enter",enterEl:r,exitEl:c}:null}const i=Ft(e);if(!i)return null;const s=i.getAttribute(at);if(!s)return null;const o=Mt(t,s);return o?{mode:"exit",enterEl:i,exitEl:o}:null}function qi(e,t,n,i){const s=e.mode==="enter"?n:t,o=e.mode==="enter"?t:n,r=N(s,e.enterEl),l=N(o,e.exitEl),c=rt(e.enterEl,r,g=>N(s,g),{legacyRadiusAttribute:Dt}),a=rt(e.exitEl,l,g=>N(o,g),{legacyRadiusAttribute:Dt}),[p,u]=zt(c,a),d=p.contentAware&&u.contentAware,h=e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),f={left:0,top:0,width:h.width,height:h.height},y=p.radiusSource==="legacy"||Zi(p.window,f)?p.radius:0;return{enterRect:r,exitRect:l,...d?{enterMedia:p,exitMedia:u}:{},pageRect:h,scrollOffset:i,enterRadius:y,exitRadius:u.radius}}class Ki{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:i,resolved:s,input:o,physics:r,onComplete:l}=t,c=s.mode==="enter",a=c?vi(o):Ti(o),p=c?i:n,u=c?"t":"u";a&&(p.style.transformOrigin=a.transformOrigin);const d=c?I:R,h=c?R:I,f=n.style.zIndex;n.style.zIndex=d;const y=i.style.zIndex,g=i.style.position;return i.style.zIndex=h,i.style.position="relative",l(()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.transformOrigin="",p.style.contain="",n.style.zIndex=f,i.style.zIndex===h&&(i.style.zIndex=y),i.style.position==="relative"&&(i.style.position=g),i.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:w.from(r),style:u==="t"?S=>a.animate(S):(S,b)=>a.animate(b)})]}}class Ji{contribute(t){const{resolved:n,physics:i,from:s,to:o,onComplete:r}=t,l=n.mode==="enter"?o:s,c=Gi(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:w.from(i),style:(u,d)=>({opacity:n.mode==="enter"?u:d})}))}}class Gt{contribute(){return[]}}const Qi={default:()=>new Gt,fade:()=>new Ji};function ts(e){return Qi[e]()}class es extends Gt{}function ns(e){const t=Bi(e.type);return{strategies:[new Ki,t,ts(e.variant),new es,...e.type==="blur"?[new ki]:[]],physics:t.physics}}const is=e=>{const{strategies:t,physics:n}=ns(e);return{prepare:i=>{const s={from:i.from,to:i.to,context:{positionedParent:i.context.positionedParent},createElement:i.createElement},o={};for(const r of t){if(!r.prepare)continue;const l=r.prepare(s);l&&Object.assign(o,l)}return o},animation:({from:i,to:s,context:o,...r})=>{const l=ji(i,s,o.direction);if(!l)return new m.MultiAnimation([],{mode:"parallel"});const c=qi(l,i,s,o.scrollOffset),a=[],u={from:i,to:s,resolved:l,input:c,physics:n,context:o,extras:r,onComplete:f=>{a.push(f)}},d=[];for(const f of t)f.contribute&&d.push(...f.contribute(u));const h=d[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 d){if(!(f instanceof m.WebAnimation))continue;const y=f.onComplete;f.onComplete=()=>{y==null||y(),f.releaseFill()}}return new m.MultiAnimation(d,{mode:"parallel"})}}};function ss(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function os(e={}){const t=ss(e);return is(t)}exports.Animation=m.Animation;exports.MultiAnimation=m.MultiAnimation;exports.WebAnimation=m.WebAnimation;exports.axis=Ye;exports.blind=Ue;exports.drill=tn;exports.fade=on;exports.film=hn;exports.hero=qn;exports.jaemin=ti;exports.rotate=ii;exports.scroll=ri;exports.sheet=$i;exports.slide=Pi;exports.strip=Ri;exports.zoom=os;
|
|
35
|
+
)`}function K(e,t,n,i,s){const o=n/1e3;return new m.WebAnimation({element:e,integrator:new ae({durationSec:o}),lowerBound:0,upperBound:1,style:r=>i(pn(t,r)),onComplete:s})}const fn=(e={})=>{var s;const t=((s=e.border)==null?void 0:s.color)??an,n=rn,i=e.physics;return{prepare:({from:o,to:r,context:l})=>{const c=T(l,"from"),a=T(l,"to"),p=Y(document.body,l.positionedParent),u=dn(t,{...c,top:p.top});for(const d of["topLeft","topRight","bottomLeft","bottomRight"])l.positionedParent.appendChild(u[d]);return o.then(d=>{Et(d,c),At(d,c),d.style.transform=`translateY(${-c.top}px)`}),r.then(d=>{Et(d,a),At(d,a),d.style.transform=`translateY(${-a.top+a.height}px) scale(${n})`}),{borders:u,fromRect:c,toRect:a}},animation:({from:o,to:r,context:l,borders:c,fromRect:a,toRect:p})=>{const u=$t({rect:a,scale:n,direction:"out",override:i}),d=$t({rect:p,scale:n,direction:"in",override:i}),h=K(o,u.snapshots,u.totalDuration,b=>({transform:`translateY(${b.translateY}px) scale(${b.scale})`}),()=>{o.style.clipPath="",o.style.transformOrigin="",o.style.transform=""}),f=K(r,d.snapshots,d.totalDuration,b=>({transform:`translateY(${b.translateY}px) scale(${b.scale})`}),()=>{r.style.clipPath="",r.style.transformOrigin="",r.style.transform=""}),y=un.map(([b,$],x)=>{const C=["topLeft","topRight","bottomLeft","bottomRight"][x];return K(c[C],u.snapshots,u.totalDuration,_=>{const P=(a.width-a.width*_.scale)/2*.7*b,A=(a.height-a.height*_.scale)/2*.7*$;return{transform:`translate(${P}px, ${A}px)`}})}),g=new m.MultiAnimation([h,f,...y],{mode:"parallel"}),S=g.onComplete;return g.onComplete=()=>{S==null||S();const b=l.positionedParent;for(const $ of["topLeft","topRight","bottomLeft","bottomRight"]){const x=c[$];x.parentElement===b&&b.removeChild(x)}},g}}};function hn(e={}){const{options:t}=e,n=(t==null?void 0:t.borderColor)!==void 0?{border:{color:t.borderColor}}:void 0;return fn(n)}function yn(e){if(!e)return null;if(e.includes("/")){const n=e.split("/");if(n.length!==2)return null;const i=Number.parseFloat(n[0]??""),s=Number.parseFloat(n[1]??"");return Number.isFinite(i)&&Number.isFinite(s)&&i>0&&s>0?i/s:null}const t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function mn(e){return e==="contain"||e==="cover"?e:null}function st(e){return e.tagName==="IMG"}function gn(e){if(st(e))return e;if(e.tagName==="PICTURE"||e.tagName==="VIDEO")return null;const t=[];for(const n of Array.from(e.children)){const i=n;st(i)&&t.push(i)}return t.length===1?t[0]??null:null}function bn(e){var c,a;if(!st(e))return null;const t=e,n=t.naturalWidth,i=t.naturalHeight;if(typeof n=="number"&&typeof i=="number"&&Number.isFinite(n)&&Number.isFinite(i)&&n>0&&i>0)return n/i;const s=((c=e.getAttribute("width"))==null?void 0:c.trim())??"",o=((a=e.getAttribute("height"))==null?void 0:a.trim())??"",r=s===""?Number.NaN:Number(s),l=o===""?Number.NaN:Number(o);return Number.isFinite(r)&&Number.isFinite(l)&&r>0&&l>0?r/l:null}function wn(e){const t=e.trim().toLowerCase().replace(/\s+/g," ");return t===""||t==="center"||t==="center center"||t==="50% 50%"}function V(e){if(typeof getComputedStyle=="function")try{return getComputedStyle(e)}catch{}return e.style}function Sn(e){const t=V(e),n=wn(t.objectPosition??"");return{fit:n?mn(t.objectFit??null):null,centered:n}}function Ht(e){if(!e)return 0;const t=/^(-?(?:\d+\.?\d*|\.\d+))px$/.exec(e.trim());if(!t)return null;const n=Number.parseFloat(t[1]??"");return Number.isFinite(n)&&n>=0?n:null}function Pt(e){const t=V(e),n=[t.borderTopLeftRadius,t.borderTopRightRadius,t.borderBottomRightRadius,t.borderBottomLeftRadius].map(Ht),i=n[0];if(i==null)return{radius:0,supported:!1};const s=n.every(o=>o!==null&&Math.abs(o-i)<.001);return{radius:s?i:0,supported:s}}function xn(e,t){var s;if(!t)return null;const n=(s=e.getAttribute(t))==null?void 0:s.trim();if(n==null||n==="")return null;const i=Number.parseFloat(n);return Number.isFinite(i)&&i>=0?i:null}function Cn(e){const t=V(e);return[t.paddingTop,t.paddingRight,t.paddingBottom,t.paddingLeft,t.borderTopWidth,t.borderRightWidth,t.borderBottomWidth,t.borderLeftWidth].every(i=>i?Ht(i)===0:!0)}function $n(e){const t=V(e),n=i=>i==="hidden"||i==="clip";return n(t.overflowX)&&n(t.overflowY)}function O(e){return e.left+e.width/2}function v(e){return e.top+e.height/2}function lt(e,t){return{top:Math.max(0,t.top-e.top),right:Math.max(0,e.left+e.width-(t.left+t.width)),bottom:Math.max(0,e.top+e.height-(t.top+t.height)),left:Math.max(0,t.left-e.left)}}function En(e,t){const n=Math.max(e.left,t.left),i=Math.max(e.top,t.top),s=Math.min(e.left+e.width,t.left+t.width),o=Math.min(e.top+e.height,t.top+t.height);return s>n&&o>i?{left:n,top:i,width:s-n,height:o-i}:null}function _t(e,t){return Math.abs(e.left-t.left)<.01&&Math.abs(e.top-t.top)<.01&&Math.abs(e.width-t.width)<.01&&Math.abs(e.height-t.height)<.01}function An(e,t,n){const i=e.width/e.height;let s,o;return n==="contain"?i>t?(o=e.height,s=o*t):(s=e.width,o=s/t):i>t?(s=e.width,o=s/t):(o=e.height,s=o*t),{left:e.left+(e.width-s)/2,top:e.top+(e.height-o)/2,width:s,height:o}}function Nt(e,t,n){const i=t!==null&&n!==null&&e.width>0&&e.height>0?An(e,t,n):e,s=n==="contain"?i:e;return{bbox:e,content:i,window:s,clipInset:lt(i,s),aspectRatio:t,fit:n,radius:0,radiusSource:"none",bboxRadius:0,bboxRadiusSource:"none",contentAware:t!==null&&n!==null,mediaElement:null}}function ot(e,t,n){return{...Nt(e,null,null),radius:t,radiusSource:n,bboxRadius:t,bboxRadiusSource:n}}function Wt(e,t){const n=e.aspectRatio,i=t.aspectRatio;return e.contentAware&&t.contentAware&&n!==null&&i!==null&&Math.abs(n-i)/Math.max(n,i)<.01}function It(e){return ot(e.bbox,e.bboxRadius,e.bboxRadiusSource)}function zt(e,t){return Wt(e,t)?[e,t]:[It(e),It(t)]}function rt(e,t,n,i){const s=gn(e),o=s?n(s):t,r=i.legacyAspectRatioAttribute?yn(e.getAttribute(i.legacyAspectRatioAttribute)??(s==null?void 0:s.getAttribute(i.legacyAspectRatioAttribute))??null):null,l=r??(s?bn(s):null),c=s?Sn(s):{fit:null,centered:!0},a=c.centered&&(s===null||Cn(s))?c.fit??(r!==null?i.fallbackFit??null:null):null,p=Nt(o,l,a),u=$n(e),h=s!==null&&s!==e&&u?En(p.window,t):p.window,f=xn(e,i.legacyRadiusAttribute),y=s===e||u,g=y?Pt(e):{radius:0,supported:!0},S=f??g.radius,b=f!==null?"legacy":g.supported?g.radius>0?"computed":"none":"unsupported",$=[];h&&y&&_t(h,t)&&$.push(g),h&&s&&_t(h,o)&&$.push(Pt(s));const x=$.every(A=>A.supported),C=Math.max(0,...$.map(A=>A.radius)),_=f??C,P=f!==null?"legacy":x?C>0?"computed":"none":"unsupported";return!h||P==="unsupported"?ot(t,S,b):{...p,bbox:t,window:h,clipInset:lt(p.content,h),radius:_,radiusSource:P,bboxRadius:S,bboxRadiusSource:b,mediaElement:p.contentAware?s:null}}function Ut(e,t,n,i,s){const o=n.width/i,r=n.height/s;return{left:O(e)+(O(n)-O(t))/i-o/2,top:v(e)+(v(n)-v(t))/s-r/2,width:o,height:r}}const Pn={enter:"contain",exit:"cover",legacy:"contain"};function F(e){return Pn[e]}const Rt="data-hero-enter-key",Ot="data-hero-exit-key",J="data-hero-key";class _n{constructor(){E(this,"previousFromOpacity","")}prepare(t){t.from.then(n=>{this.previousFromOpacity=n.style.opacity,n.style.opacity="0"})}contribute(t){return t.onComplete(()=>{t.from.style.opacity=this.previousFromOpacity}),[]}}const In=()=>new _n;class Rn{contribute(t){const{from:n,to:i,physics:s,onComplete:o}=t,r=n.style.opacity,l=i.style.opacity,c=n.style.willChange,a=i.style.willChange;return i.style.opacity="0",n.style.willChange="opacity",i.style.willChange="opacity",o(()=>{n.style.opacity=r,i.style.opacity=l,n.style.willChange=c,i.style.willChange=a}),[new m.WebAnimation({element:n,integrator:w.from(s),style:(p,u)=>({opacity:u})}),new m.WebAnimation({element:i,integrator:w.from(s),style:p=>({opacity:p})})]}}const On=()=>new Rn,vn={static:In,fade:On},Tn={spring:{stiffness:320,damping:30}},Dn=()=>Tn,Fn={spring:{stiffness:300,damping:30,doubleSpring:1}},Mn=()=>Fn,Ln={default:Dn,smooth:Mn},Yn=700,kn="data-hero-aspect-ratio",Hn="data-hero-radius";function vt(e,t,n){const i=Y(e,t);return rt(t,i,s=>Y(e,s),{fallbackFit:n,legacyAspectRatioAttribute:kn,legacyRadiusAttribute:Hn})}function W(e,t){const n=new Map,i=e.querySelectorAll(`[${t}]`);for(const s of Array.from(i)){const o=s.getAttribute(t);o&&(n.has(o)||n.set(o,s))}return n}function Nn(e,t){const n=[],i=W(t,Rt),s=W(e,Ot);for(const[l,c]of i){const a=s.get(l);a&&n.push({key:l,fromEl:a,toEl:c,fromFit:F("exit"),toFit:F("enter")})}const o=W(e,Rt),r=W(t,Ot);for(const[l,c]of o){const a=r.get(l);a&&n.push({key:l,fromEl:c,toEl:a,fromFit:F("enter"),toFit:F("exit")})}return n}function Wn(e,t){const n=[],i=Array.from(t.querySelectorAll(`[${J}]`));for(const s of i){const o=s.getAttribute(J);if(!o)continue;const r=e.querySelector(`[${J}="${o}"]`);r&&n.push({key:o,fromEl:r,toEl:s,fromFit:F("legacy"),toFit:F("legacy")})}return n}function zn(e,t){const n=Nn(e,t);return n.length>0?n:Wn(e,t)}function Un(e,t){return zt(e,t)}function Vn(e,t){return e.radiusSource==="unsupported"||t.radiusSource==="unsupported"?!1:e.mediaElement!==null||t.mediaElement!==null||e.radiusSource==="computed"||e.radiusSource==="legacy"||t.radiusSource==="computed"||t.radiusSource==="legacy"}function Xn(e,t,n){const{fromEl:i,toEl:s}=t,[o,r]=Un(vt(e,i,t.fromFit),vt(e,s,t.toFit)),l=o.content,c=o.window,a=r.content,p=r.window,u=r.clipInset,d=o.radiusSource==="unsupported"||r.radiusSource==="unsupported",h=d?0:o.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 y=Math.max(l.width/a.width,l.height/a.height),g=O(l),S=v(l),b=O(a),$=v(a),x=g-b,C=S-$;if(Math.abs(C)>n)return null;const _=lt(a,Ut(a,l,c,y,y));return{toContent:a,fromVisualEl:o.mediaElement??i,toVisualEl:r.mediaElement??s,resetCloneRadius:Vn(o,r),styleFor:(P,A)=>{const k=A*x,M=A*C,H=P+A*y,jt=Math.max(0,h*A+f*P)/Math.max(Math.abs(H),1e-6),qt=_.top*A+u.top*P,Kt=_.right*A+u.right*P,Jt=_.bottom*A+u.bottom*P,Qt=_.left*A+u.left*P;return{transform:`translate(${k}px, ${M}px) scale(${H})`,clipPath:`inset(${qt}px ${Kt}px ${Jt}px ${Qt}px round ${jt}px)`}}}}function Bn(e,t){e.style.transform=t.transform,e.style.clipPath=t.clipPath}class Zn{contribute(t){const{resolved:n,physics:i,positionedParent:s,maxDistance:o,onComplete:r}=t,l=[];for(const c of n.pairs){const a=Xn(s,c,o);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"),Bn(d,a.styleFor(0,1)),s.appendChild(d);const h=p.style.opacity,f=u.style.opacity;p.style.opacity="0",u.style.opacity="0",r(()=>{p.style.opacity=h,u.style.opacity=f,d.parentElement&&d.parentElement.removeChild(d)}),l.push(new m.WebAnimation({element:d,integrator:w.from(i),style:a.styleFor}))}return l}}function Gn(e){return[new Zn,vn[e.type]()]}const jn=e=>{const t=Gn(e),n=Ln[e.variant](),i=Yn;return{prepare:s=>{var l;const o=Promise.all([s.from,s.to]).then(([c,a])=>({pairs:zn(c,a)})),r={from:s.from,to:s.to,resolved:o};for(const c of t)(l=c.prepare)==null||l.call(c,r);return o.then(c=>({resolved:c}))},animation:({from:s,to:o,context:r,resolved:l})=>{if(l.pairs.length===0)return new m.MultiAnimation([],{mode:"parallel"});const c=[],a=f=>{c.push(f)},p={from:s,to:o,resolved:l,physics:n,positionedParent:r.positionedParent,maxDistance:i,onComplete:a},u=[];for(const f of t)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"}),h=d.onComplete;return d.onComplete=()=>{h==null||h();for(const f of c)try{f()}catch(y){console.error("[hero] cleanup error",y)}},d}}};function qn(e={}){const t=e.type??"static",n=e.variant??"default";return jn({type:t,variant:n})}const Kn={spring:{stiffness:50,damping:30}},Jn={spring:{stiffness:80,damping:25}},Qn=(e={})=>{const t=e.physics??Kn,n=e.initialRotation??45,i=e.initialScale??.01,s=e.rotationTriggerPoint??.8;return{prepare:({from:o,to:r,context:l})=>(o.then(c=>{c.style.opacity="1"}),r.then(c=>{const a=T(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(${i}) translateZ(0)`,c.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",c.style.opacity="1"}),{}),animation:({from:o,to:r})=>{const l=new m.WebAnimation({element:o,integrator:w.from(Jn),style:(a,p)=>({opacity:p}),onComplete:()=>{o.style.opacity=""}}),c=new m.WebAnimation({element:r,integrator:w.from(t),style:a=>{let p;if(a<=.05)p=i;else if(a<=s){const f=(a-.05)/(s-.05),y=Math.pow(f,9);p=i+(.8-i)*y}else{const f=(a-s)/(1-s);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),y=1-Math.pow(1-f,2);d=n*(1-y)}let h;if(a<=u)h=1;else{const f=(a-u)/(1-u);h=1-Math.pow(f,.5)}return{transform:`rotate(${d.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,"--border-radius-scale":h.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 ti(e={}){return Qn()}const ei={spring:{stiffness:100,damping:30}},ni=(e={})=>{const t=e.physics??ei;return{prepare:({from:n,to:i})=>(n.then(s=>{s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),i.then(s=>{s.style.opacity="0",s.style.transform="rotate(-180deg)",s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),{}),animation:({from:n,to:i})=>{const s=new m.WebAnimation({element:n,integrator:w.from(t),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=""}}),o=new m.WebAnimation({element:i,integrator:w.from(t),style:(r,l)=>({transform:`rotate(${-l*180}deg)`,opacity:r>.5?1:0}),onComplete:()=>{i.style.willChange="auto",i.style.transform="",i.style.transformOrigin="",i.style.opacity=""}});return new m.MultiAnimation([s,o],{mode:"parallel"})}}};function ii(e={}){return ni()}const si={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},oi=(e={})=>{const t=e.physics??si,n=e.directional??!0;return{prepare:({from:i,to:s,context:o})=>{const r=!n||o.direction==="forward",l=r?I:R,c=r?R:I;return i.then(a=>{a.style.zIndex=l,a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.pointerEvents="none"}),s.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:i,to:s,context:o})=>{const r=!n||o.direction==="forward",l=r?R:I,c=i.offsetHeight,a=s.offsetHeight,p=window.innerHeight,u=Math.max(Math.min(c,a),p),d=new m.WebAnimation({element:i,integrator:w.from(t),style:f=>({transform:`translate3d(0, ${r?-u*f:u*f}px, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform="",i.style.pointerEvents="",i.style.zIndex=""}}),h=new m.WebAnimation({element:s,integrator:w.from(t),style:(f,y)=>({transform:`translate3d(0, ${r?y*u:y*-u}px, 0)`}),onComplete:()=>{s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain="",s.style.transform="",s.style.position==="relative"&&(s.style.position=""),s.style.zIndex===l&&(s.style.zIndex="")}});for(const f of[d,h]){const y=f.onComplete;f.onComplete=()=>{y==null||y(),f.releaseFill()}}return new m.MultiAnimation([d,h],{mode:"parallel"})}}};function ri(e={}){const{type:t="directional"}=e;return oi({directional:t==="directional"})}const ai={spring:{stiffness:200,damping:24}},li={inertia:{acceleration:25,resistance:1.2}},Q=.2;function ci(){return{enterPhysics:ai,exitPhysics:li,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-Q*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-Q+Q*e})`,opacity:e})}}}const pi={spring:{stiffness:200,damping:24}},ui={inertia:{acceleration:25,resistance:1.2}},tt=.08,di=16,et=.6,fi=e=>`blur(${Math.max(0,e).toFixed(2)}px)`;function hi(){return{enterPhysics:pi,exitPhysics:ui,background:{willChange:"transform, opacity",enterStyle:e=>({transform:`scale(${1-tt*e})`,opacity:1-(1-et)*e}),exitStyle:e=>({transform:`scale(${1-tt+tt*e})`,opacity:et+(1-et)*e})},overlay:{willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,i=fi(di*n);return{backdropFilter:i,WebkitBackdropFilter:i}}}}}const yi={spring:{stiffness:190,damping:25}},mi={spring:{stiffness:190,damping:25}};function gi(){return{enterPhysics:yi,exitPhysics:mi,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const bi={static:gi(),"background-scale":ci(),blur:hi()},wi="static",Si="transform",xi=(e={})=>{const t=bi[e.type??wi],n=t.background,i=t.overlay,s=n.willChange!=="";return{prepare:({from:o,to:r,context:l,createElement:c})=>{const a=l.direction==="forward"?"enter":"exit",p=a==="enter"?r:o,u=a==="enter"?o:r;p.then(h=>{h.style.willChange=Si,h.style.backfaceVisibility="hidden",h.style.contain="layout paint",h.style.zIndex=R,a==="enter"?h.style.position="relative":h.style.pointerEvents="none"}),u.then(h=>{s&&(h.style.willChange=n.willChange,h.style.backfaceVisibility="hidden",h.style.contain="layout paint"),h.style.zIndex=I,a==="enter"?h.style.pointerEvents="none":h.style.position="relative"});let d;return i&&(d=c("sheet-overlay"),Object.assign(d.style,i.initialStyle),d.style.willChange=i.willChange,l.positionedParent.appendChild(d)),{overlay:d}},animation:({from:o,to:r,context:l,overlay:c})=>{const a=l.direction==="forward"?"enter":"exit",p=a==="enter"?t.enterPhysics:t.exitPhysics,u=a==="enter"?r:o,d=a==="enter"?o:r,h=T(l,a==="enter"?"to":"from"),f=()=>{o.style.pointerEvents="",o.style.zIndex=""},y=()=>{const x=a==="enter"?R:I;r.style.position==="relative"&&(r.style.position=""),r.style.zIndex===x&&(r.style.zIndex="")},g=x=>{const C=x.onComplete;x.onComplete=()=>{C==null||C(),x.releaseFill()}};u.style.clipPath=`inset(${h.top}px 0 calc(100% - ${h.top+h.height}px) 0)`;const S=a==="enter"?(x,C)=>({transform:`translate3d(0, ${C*h.height}px, 0)`}):x=>({transform:`translate3d(0, ${x*h.height}px, 0)`}),b=new m.WebAnimation({element:u,integrator:w.from(p),style:S,onComplete:()=>{u.style.willChange="auto",u.style.backfaceVisibility="",u.style.contain="",u.style.clipPath="",u.style.transform="",f(),y()}});g(b);const $=[b];if(s){const x=d.scrollHeight;x>0&&(d.style.height=`${x}px`);const C=T(l,a==="enter"?"from":"to"),_=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=`${_}px ${P}px`;const A=a==="enter"?(M,H)=>n.enterStyle(M,H):M=>n.exitStyle(M),k=new m.WebAnimation({element:d,integrator:w.from(p),style:A,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=""}});g(k),$.push(k)}if(c&&i){c.style.zIndex=kt;const x=Lt(l,"to");c.style.top=`${x.top}px`,c.style.height=`${x.height}px`,$.push(new m.WebAnimation({element:c,integrator:w.from(p),style:C=>i.style(a,C)}))}return new m.MultiAnimation($,{mode:"parallel"})}}};function Ci(e){return e==="scale"||e==="background-scale"?"background-scale":e==="blur"?"blur":"static"}function $i(e={}){const t=e.type,n=Ci(t);return xi({type:n})}const Ei={spring:{stiffness:170,damping:22,doubleSpring:.8}},Ai=(e={})=>{const t=e.physics??Ei;return{prepare:({from:n,to:i,context:s})=>{const o=s.direction==="forward";return n.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{const l=o?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:i,context:s})=>{const o=s.direction==="forward",r=new m.WebAnimation({element:n,integrator:w.from(t),style:c=>({transform:`translate3d(${o?-100*c:100*c}%, 0, 0)`}),onComplete:()=>{n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.transform="",n.style.pointerEvents=""}}),l=new m.WebAnimation({element:i,integrator:w.from(t),style:(c,a)=>({transform:`translate3d(${o?a*100:a*-100}%, 0, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new m.MultiAnimation([r,l],{mode:"parallel"})}}};function Pi(e={}){return Ai()}const _i={spring:{stiffness:17,damping:6}},nt=20,z=800,Ii=(e={})=>{const t=e.physics??_i;return{prepare:({from:n,to:i})=>(n.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.pointerEvents="none",s.style.transform=`perspective(${z}px) rotateY(0deg) translate3d(0%, 0, 0)`}),i.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.transform=`perspective(${z}px) rotateY(${nt}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:i})=>{const s=new m.WebAnimation({element:n,integrator:w.from(t),style:r=>{const l=-r*nt,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=""}}),o=new m.WebAnimation({element:i,integrator:w.from(t),style:(r,l)=>{const c=l*nt,a=-l*100;return{transform:`perspective(${z}px) rotateY(${c}deg) translate3d(${a}%, 0, 0)`}},onComplete:()=>{i.style.transform="",i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain=""}});return new m.MultiAnimation([s,o],{mode:"sequence"})}}};function Ri(e={}){return Ii()}function Oi(e,t){return t.left>=e.left-.01&&t.top>=e.top-.01&&t.left+t.width<=e.left+e.width+.01&&t.top+t.height<=e.top+e.height+.01}function Vt(e){const t=()=>({enterContent:e.enterRect,exitContent:e.exitRect,startWindow:e.enterRect,scaleX:e.exitRect.width/e.enterRect.width,scaleY:e.exitRect.height/e.enterRect.height}),{enterMedia:n,exitMedia:i}=e;if(!n||!i||!Wt(n,i))return t();const s=n.content,o=i.content;if(s.width<=0||s.height<=0||o.width<=0||o.height<=0)return t();const r=o.width/s.width,l=o.height/s.height,c=Ut(s,o,i.window,r,l);return Oi(n.window,c)?{enterContent:s,exitContent:o,startWindow:c,scaleX:r,scaleY:l}:t()}function Xt(e,t){return{top:e.top/t.height*100,right:(t.width-(e.left+e.width))/t.width*100,bottom:(t.height-(e.top+e.height))/t.height*100,left:e.left/t.width*100}}function Bt(e,t,n){return{x:e/Math.max(Math.abs(t),1e-6),y:e/Math.max(Math.abs(n),1e-6)}}function vi(e){const{pageRect:t,scrollOffset:n,enterRadius:i,exitRadius:s}=e,o=Vt(e),{enterContent:r,exitContent:l,startWindow:c,scaleX:a,scaleY:p}=o,u=l.left-r.left+(l.width-r.width)/2-n.x,d=l.top-r.top+(l.height-r.height)/2-n.y,h=Xt(c,t);return{transformOrigin:`${O(r)}px ${v(r)}px`,animate:f=>{const y=1-f,g=1+(a-1)*y,S=1+(p-1)*y,b=Math.max(0,s*y+i*(1-y)),$=Bt(b,g,S);return{clipPath:`inset(${h.top*y}% ${h.right*y}% ${h.bottom*y}% ${h.left*y}% round ${$.x}px / ${$.y}px)`,transform:`translate(${u*y}px, ${d*y}px) scale(${g}, ${S})`}}}}function Ti(e){const{pageRect:t,scrollOffset:n,enterRadius:i,exitRadius:s}=e,o=Vt(e),{enterContent:r,exitContent:l,startWindow:c,scaleX:a,scaleY:p}=o,u=l.left-r.left+(l.width-r.width)/2+n.x,d=l.top-r.top+(l.height-r.height)/2+n.y,h=Xt(c,t);return{transformOrigin:`${O(r)}px ${v(r)}px`,animate:f=>{const y=1-f,g=1+(a-1)*y,S=1+(p-1)*y,b=Math.max(0,i*(1-y)+s*y),$=Bt(b,g,S);return{clipPath:`inset(${h.top*y}% ${h.right*y}% ${h.bottom*y}% ${h.left*y}% round ${$.x}px / ${$.y}px)`,transform:`translate(${u*y-n.x}px, ${d*y}px) scale(${g}, ${S})`}}}}const Di={spring:{stiffness:380,damping:30,restDelta:.1,restSpeed:.1,doubleSpring:{stiffness:260,damping:30}}},Zt=.12,Fi=18;function Mi(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Zt*t})`}}}}function Li(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Zt*t})`}}}}const it={willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,i=`blur(${Fi*n}px)`;return{backdropFilter:i,WebkitBackdropFilter:i}}};class Yi{constructor(){E(this,"physics",Di)}contribute(t){const{from:n,to:i,resolved:s,physics:o}=t,r=s.mode==="enter",l=r?n:i,c=r?Mi():Li();return c&&(l.style.transformOrigin=c.transformOrigin),[new m.WebAnimation({element:l,integrator:w.from(o),style:r?(a,p)=>c.animate(p):a=>c.animate(a)})]}}class ki{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,it.initialStyle),n.style.willChange=it.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;if(!n)return[];n.style.zIndex=kt;const i=Lt(t.context,"to");return n.style.top=`${i.top}px`,n.style.height=`${i.height}px`,[new m.WebAnimation({element:n,integrator:w.from(t.physics),style:s=>it.style(t.resolved.mode,s)})]}}const Hi={spring:{stiffness:380,damping:30,doubleSpring:{stiffness:260,damping:30}}};function Ni({enterRect:e,exitRect:t,scrollOffset:n}){const i=e.left-t.left+(e.width-t.width)/2+n.x,s=e.top-t.top+(e.height-t.height)/2+n.y,o=e.width/t.width,r=e.height/t.height,l=Math.max(o,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${i*a-n.x}px, ${s*a}px) scale(${1+(l-1)*a})`}}}}function Wi({enterRect:e,exitRect:t,scrollOffset:n}){const i=e.left-t.left+(e.width-t.width)/2-n.x,s=e.top-t.top+(e.height-t.height)/2-n.y,o=e.width/t.width,r=e.height/t.height,l=Math.max(o,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${i*a}px, ${s*a}px) scale(${1+(l-1)*a})`}}}}class zi{constructor(){E(this,"physics",Hi)}contribute(t){const{from:n,to:i,resolved:s,input:o,physics:r}=t,l=s.mode==="enter",c=l?n:i,a=l?Ni(o):Wi(o);return a&&(c.style.transformOrigin=a.transformOrigin),[new m.WebAnimation({element:c,integrator:w.from(r),style:l?(p,u)=>a.animate(u):p=>a.animate(p)})]}}const Ui={spring:{stiffness:530,damping:34,doubleSpring:1}};class Vi{constructor(){E(this,"physics",Ui)}contribute(t){return[]}}const Xi={expand:()=>new zi,static:()=>new Vi,blur:()=>new Yi};function Bi(e){return Xi[e]()}const at="data-zoom-enter-key",Tt="data-zoom-exit-key",Dt="data-zoom-radius";function Zi(e,t){return Math.abs(e.left-t.left)<.01&&Math.abs(e.top-t.top)<.01&&Math.abs(e.width-t.width)<.01&&Math.abs(e.height-t.height)<.01}function Gi(e,t){const n=[];let i=t;for(;i&&i!==e;){const s=i.parentElement;if(!s)break;for(const o of Array.from(s.children))o!==i&&o instanceof HTMLElement&&n.push(o);i=s}return n}function Ft(e){const t=e.querySelectorAll(`[${at}]`);return t.length!==1?null:t[0]}function Mt(e,t){const n=e.querySelectorAll(`[${Tt}]`);for(const i of n)if(i.getAttribute(Tt)===t)return i;return null}function ji(e,t,n){if(n==="forward"){const r=Ft(t);if(!r)return null;const l=r.getAttribute(at);if(!l)return null;const c=Mt(e,l);return c?{mode:"enter",enterEl:r,exitEl:c}:null}const i=Ft(e);if(!i)return null;const s=i.getAttribute(at);if(!s)return null;const o=Mt(t,s);return o?{mode:"exit",enterEl:i,exitEl:o}:null}function qi(e,t,n,i){const s=e.mode==="enter"?n:t,o=e.mode==="enter"?t:n,r=N(s,e.enterEl),l=N(o,e.exitEl),c=rt(e.enterEl,r,g=>N(s,g),{legacyRadiusAttribute:Dt}),a=rt(e.exitEl,l,g=>N(o,g),{legacyRadiusAttribute:Dt}),[p,u]=zt(c,a),d=p.contentAware&&u.contentAware,h=e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),f={left:0,top:0,width:h.width,height:h.height},y=p.radiusSource==="legacy"||Zi(p.window,f)?p.radius:0;return{enterRect:r,exitRect:l,...d?{enterMedia:p,exitMedia:u}:{},pageRect:h,scrollOffset:i,enterRadius:y,exitRadius:u.radius}}class Ki{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:i,resolved:s,input:o,physics:r,onComplete:l}=t,c=s.mode==="enter",a=c?vi(o):Ti(o),p=c?i:n,u=c?"t":"u";a&&(p.style.transformOrigin=a.transformOrigin);const d=c?I:R,h=c?R:I,f=n.style.zIndex;n.style.zIndex=d;const y=i.style.zIndex,g=i.style.position;return i.style.zIndex=h,i.style.position="relative",l(()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.transformOrigin="",p.style.contain="",n.style.zIndex=f,i.style.zIndex===h&&(i.style.zIndex=y),i.style.position==="relative"&&(i.style.position=g),i.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:w.from(r),style:u==="t"?S=>a.animate(S):(S,b)=>a.animate(b)})]}}class Ji{contribute(t){const{resolved:n,physics:i,from:s,to:o,onComplete:r}=t,l=n.mode==="enter"?o:s,c=Gi(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:w.from(i),style:(u,d)=>({opacity:n.mode==="enter"?u:d})}))}}class Gt{contribute(){return[]}}const Qi={default:()=>new Gt,fade:()=>new Ji};function ts(e){return Qi[e]()}class es extends Gt{}function ns(e){const t=Bi(e.type);return{strategies:[new Ki,t,ts(e.variant),new es,...e.type==="blur"?[new ki]:[]],physics:t.physics}}const is=e=>{const{strategies:t,physics:n}=ns(e);return{prepare:i=>{const s={from:i.from,to:i.to,context:{positionedParent:i.context.positionedParent},createElement:i.createElement},o={};for(const r of t){if(!r.prepare)continue;const l=r.prepare(s);l&&Object.assign(o,l)}return o},animation:({from:i,to:s,context:o,...r})=>{const l=ji(i,s,o.direction);if(!l)return new m.MultiAnimation([],{mode:"parallel"});const c=qi(l,i,s,o.scrollOffset),a=[],u={from:i,to:s,resolved:l,input:c,physics:n,context:o,extras:r,onComplete:f=>{a.push(f)}},d=[];for(const f of t)f.contribute&&d.push(...f.contribute(u));const h=d[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 d){if(!(f instanceof m.WebAnimation))continue;const y=f.onComplete;f.onComplete=()=>{y==null||y(),f.releaseFill()}}return new m.MultiAnimation(d,{mode:"parallel"})}}};function ss(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function os(e={}){const t=ss(e);return is(t)}exports.Animation=m.Animation;exports.MultiAnimation=m.MultiAnimation;exports.WebAnimation=m.WebAnimation;exports.axis=Ye;exports.blind=Ue;exports.drill=tn;exports.fade=on;exports.film=hn;exports.hero=qn;exports.jaemin=ti;exports.rotate=ii;exports.scroll=ri;exports.sheet=$i;exports.slide=Pi;exports.strip=Ri;exports.zoom=os;
|
package/dist/index.js
CHANGED
|
@@ -1792,12 +1792,12 @@ function cs() {
|
|
|
1792
1792
|
}
|
|
1793
1793
|
const ps = {
|
|
1794
1794
|
spring: {
|
|
1795
|
-
stiffness:
|
|
1795
|
+
stiffness: 190,
|
|
1796
1796
|
damping: 25
|
|
1797
1797
|
}
|
|
1798
1798
|
}, ds = {
|
|
1799
1799
|
spring: {
|
|
1800
|
-
stiffness:
|
|
1800
|
+
stiffness: 190,
|
|
1801
1801
|
damping: 25
|
|
1802
1802
|
}
|
|
1803
1803
|
};
|