@ssgoi/core 6.5.0-beta.1 → 6.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation/web-animation.d.ts +8 -0
- package/dist/animation/web-animation.d.ts.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +144 -137
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +2 -2
- package/dist/{multi-animation-CnxqLEka.js → multi-animation-Ch5rI3rB.js} +10 -0
- package/dist/multi-animation-uzEnQnrG.cjs +1 -0
- package/dist/transitions/zoom/transition.d.ts.map +1 -1
- package/dist/utils/get-client-rect.d.ts +27 -0
- package/dist/utils/get-client-rect.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/multi-animation-Dw2JTJI2.cjs +0 -1
- package/dist/transitions/zoom/get-visual-rect.d.ts +0 -25
- package/dist/transitions/zoom/get-visual-rect.d.ts.map +0 -1
|
@@ -46,6 +46,14 @@ export declare class WebAnimation extends Animation {
|
|
|
46
46
|
reverse(): void;
|
|
47
47
|
pause(): void;
|
|
48
48
|
complete(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Drop the WAAPI forwards-fill after the run has settled, letting inline
|
|
51
|
+
* styles govern the resting visual. Call only from `onComplete` (the run is
|
|
52
|
+
* already finished) — otherwise it cancels mid-flight. Unlike `complete()`,
|
|
53
|
+
* it writes no final frame, so a caller can reset the element to its natural
|
|
54
|
+
* state without the lingering fill clobbering it.
|
|
55
|
+
*/
|
|
56
|
+
releaseFill(): void;
|
|
49
57
|
get isAnimating(): boolean;
|
|
50
58
|
get isPaused(): boolean;
|
|
51
59
|
get isComplete(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-animation.d.ts","sourceRoot":"","sources":["../../src/lib/animation/web-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAiB,MAAM,QAAQ,CAAC;AACzE,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,WAAW,CAAC;IAC7C,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAQD;;;;;;;;;;;;;GAaG;AACH,qBAAa,YAAa,SAAQ,SAAS;IACzC,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,UAAU,CAAS;IAE3B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,eAAe,CAAK;IAC5B,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,KAAK,CAAqC;IAClD,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAS;gBAEd,IAAI,EAAE,mBAAmB;IAYrC,IAAI,IAAI,IAAI;IAaZ,OAAO,IAAI,IAAI;IAQf,KAAK,IAAI,IAAI;IAUb,QAAQ,IAAI,IAAI;IAWhB,IAAI,WAAW,IAAI,OAAO,CAEzB;IACD,IAAI,QAAQ,IAAI,OAAO,CAEtB;IACD,IAAI,UAAU,IAAI,OAAO,CAExB;IACD,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,QAAQ,IAAI,MAAM,CAMrB;IAED,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAcrD,IAAI,YAAY,IAAI,MAAM,CAEzB;IACD,IAAI,YAAY,CAAC,IAAI,EAAE,MAAM,EAG5B;IAED,OAAO,IAAI,IAAI,EAAE;IAcjB,WAAW,IAAI,QAAQ,EAAE;IAczB,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI;IAS9B,OAAO,CAAC,SAAS;IA6DjB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,YAAY;CAQrB"}
|
|
1
|
+
{"version":3,"file":"web-animation.d.ts","sourceRoot":"","sources":["../../src/lib/animation/web-animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAiB,MAAM,QAAQ,CAAC;AACzE,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,WAAW,CAAC;IAC7C,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAQD;;;;;;;;;;;;;GAaG;AACH,qBAAa,YAAa,SAAQ,SAAS;IACzC,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,UAAU,CAAS;IAE3B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,eAAe,CAAK;IAC5B,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,KAAK,CAAqC;IAClD,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAS;gBAEd,IAAI,EAAE,mBAAmB;IAYrC,IAAI,IAAI,IAAI;IAaZ,OAAO,IAAI,IAAI;IAQf,KAAK,IAAI,IAAI;IAUb,QAAQ,IAAI,IAAI;IAWhB;;;;;;OAMG;IACH,WAAW,IAAI,IAAI;IAInB,IAAI,WAAW,IAAI,OAAO,CAEzB;IACD,IAAI,QAAQ,IAAI,OAAO,CAEtB;IACD,IAAI,UAAU,IAAI,OAAO,CAExB;IACD,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED,IAAI,QAAQ,IAAI,MAAM,CAMrB;IAED,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAcrD,IAAI,YAAY,IAAI,MAAM,CAEzB;IACD,IAAI,YAAY,CAAC,IAAI,EAAE,MAAM,EAG5B;IAED,OAAO,IAAI,IAAI,EAAE;IAcjB,WAAW,IAAI,QAAQ,EAAE;IAczB,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI;IAS9B,OAAO,CAAC,SAAS;IA6DjB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,YAAY;CAQrB"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Yt=Object.defineProperty;var Lt=(e,t,n)=>t in e?Yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $=(e,t,n)=>Lt(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./multi-animation-Dw2JTJI2.cjs");function _(e,t){const n=[];for(let s=0;s<e.length;s++)for(let o=s+1;o<e.length;o++){const i=e[s],r=e[o];!i||!r||n.push({from:i,to:r,transition:t(),symmetric:!0})}return n}function At(e,t){return[{from:e.exit,to:e.enter,transition:t("enter")},{from:e.enter,to:e.exit,transition:t("exit")}]}function j(e,t,n){const s=[];for(let o=0;o<e.length;o++)for(let i=o+1;i<e.length;i++){const r=e[o],l=e[i];!r||!l||s.push({from:r,to:l,transition:n(t.forward)},{from:l,to:r,transition:n(t.backward)})}return s}class F{constructor(t){$(this,"omega");$(this,"zeta");$(this,"restDelta");$(this,"restSpeed");const{stiffness:n,damping:s}=t,o=1;this.omega=Math.sqrt(n/o),this.zeta=s/(2*Math.sqrt(n*o)),this.restDelta=t.restDelta??h.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??h.VELOCITY_THRESHOLD}step(t,n,s){const o=Math.min(s,.033),{omega:i,zeta:r}=this,{position:l,velocity:c}=t,a=-2*o*r*i*c,p=o*i*i*(n-l),d=c+a+p;return{position:l+o*d,velocity:d}}isSettled(t,n){const s=Math.abs(n-t.position),o=Math.abs(t.velocity);return s<this.restDelta&&o<this.restSpeed}}class Mt{constructor(t){$(this,"leader");$(this,"follower");$(this,"restDelta");$(this,"restSpeed");this.restDelta=t.restDelta??h.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??h.VELOCITY_THRESHOLD,this.leader=new F({stiffness:t.stiffness,damping:t.damping,restDelta:this.restDelta,restSpeed:this.restSpeed});let n,s,o,i;typeof t.follower=="number"?(n=t.stiffness*t.follower,s=t.damping):t.follower?(n=t.follower.stiffness,s=t.follower.damping,o=t.follower.restDelta,i=t.follower.restSpeed):(n=t.stiffness,s=t.damping),this.follower=new F({stiffness:n,damping:s,restDelta:o??this.restDelta,restSpeed:i??this.restSpeed})}step(t,n,s){const i=t._leader??{position:t.position,velocity:t.velocity},r=this.leader.step(i,n,s),l=this.follower.step(t,r.position,s);return{position:l.position,velocity:l.velocity,_leader:r}}isSettled(t,n){const s=t,o=Math.abs(n-t.position)<this.restDelta&&Math.abs(t.velocity)<this.restSpeed;return s._leader?Math.abs(n-s._leader.position)<this.restDelta&&Math.abs(s._leader.velocity)<this.restSpeed&&o:o}}const Ht=.01,Wt=500,Rt=10;class Ut{constructor(t){$(this,"acceleration");$(this,"resistance");$(this,"resistanceType");$(this,"min");$(this,"max");$(this,"bounceStiffness");$(this,"bounceDamping");$(this,"restDelta");this.acceleration=t.acceleration,this.resistance=t.resistance,this.resistanceType=t.resistanceType??"quadratic",this.min=t.min,this.max=t.max,this.bounceStiffness=t.bounceStiffness??Wt,this.bounceDamping=t.bounceDamping??Rt,this.restDelta=t.restDelta??Ht}step(t,n,s){const o=Math.min(s,.033),{acceleration:i,resistance:r,resistanceType:l,min:c,max:a}=this,{position:p,velocity:d}=t,f=c!==void 0&&p<c,m=a!==void 0&&p>a;let y;if(f||m){const S=p-(f?c:a),C=-this.bounceStiffness*S,E=-this.bounceDamping*d;y=C+E}else{const w=n>p?1:-1;let S;l==="linear"?S=r*d:S=r*d*Math.abs(d),y=w*i-S}const u=d+y*o;let b=p+u*o;if(!f&&!m){const w=n>p?1:-1;(w>0&&b>n||w<0&&b<n)&&(b=n)}return{position:b,velocity:b===n?0:u}}isSettled(t,n){return Math.abs(n-t.position)<this.restDelta}}class g{static from(t){if(t.spring&&t.inertia)throw new Error("Cannot use both 'spring' and 'inertia' together. Choose one physics type.");if(t.inertia)return new Ut({acceleration:t.inertia.acceleration,resistance:t.inertia.resistance,resistanceType:t.inertia.resistanceType,min:t.inertia.min,max:t.inertia.max,bounceStiffness:t.inertia.bounceStiffness,bounceDamping:t.inertia.bounceDamping,restDelta:t.inertia.restDelta});const n=t.spring??{stiffness:300,damping:30};if(n.doubleSpring){const s=n.doubleSpring;let o;return typeof s=="number"?o=s:typeof s=="object"&&(o={stiffness:s.stiffness,damping:s.damping}),new Mt({stiffness:n.stiffness,damping:n.damping,follower:o,restDelta:n.restDelta,restSpeed:n.restSpeed})}return new F({stiffness:n.stiffness,damping:n.damping,restDelta:n.restDelta,restSpeed:n.restSpeed})}static fromSpring(t){return g.from({spring:t})}}class Vt{constructor(t){$(this,"durationSec");this.durationSec=Math.max(1/60,t.durationSec)}step(t,n,s){const o=n-t.position;if(o===0)return t;const i=Math.sign(o),r=Math.abs(o)/this.durationSec,l=i*r*s,c=t.position+l;return(i>0?c>=n:c<=n)?{position:n,velocity:0}:{position:c,velocity:i*r}}isSettled(t,n){return Math.abs(t.position-n)<h.POSITION_THRESHOLD}}function K(e,t){function n(i){let r=0,l=0;const c=i.offsetWidth,a=i.offsetHeight;let p=i;for(;p;)r+=p.offsetTop,l+=p.offsetLeft,p=p.offsetParent;return r-=window.scrollY,l-=window.scrollX,{top:r,left:l,width:c,height:a}}const s=n(e),o=n(t);return new DOMRect(o.left-s.left,o.top-s.top,o.width,o.height)}function D(e,t){const{scrollingElement:n,positionedParent:s}=e,o=n!==s&&n.contains(s)?K(n,s).top:0;return{top:e[t].scroll.y,left:0,width:n.clientWidth,height:n.clientHeight-o}}const J=8,Q={spring:{stiffness:1e3,damping:40,doubleSpring:1.2,restDelta:.1,restSpeed:.1}};function zt({direction:e}){const t=e==="forward"?J:-J;return{out:{willChange:"transform, opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${t}px, 0, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(${t*(1-n)}px, 0, 0)`,opacity:`${n}`})}}}function Nt(){return{outPhysics:Q,inPhysics:Q,composition:{mode:"parallel",startAt:[0,0]},build:zt}}const tt=30,Xt={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},Bt={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function Zt({direction:e}){const t=e==="forward"?1:-1,n=-tt*t,s=tt*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:o=>({transform:`translate3d(${n*o}px, 0, 0)`,opacity:`${1-o}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${s}px, 0, 0)`,opacity:"0"},animate:o=>({transform:`translate3d(${s*(1-o)}px, 0, 0)`,opacity:`${o}`})}}}function qt(){return{outPhysics:Xt,inPhysics:Bt,composition:{mode:"sequence"},build:Zt}}const jt={snappy:Nt(),fluid:qt()},et=8,Kt={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},Gt={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function Jt({direction:e}){const t=e==="forward"?1:-1,n=-et*t,s=et*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:o=>({transform:`translate3d(0, ${n*o}px, 0)`,opacity:`${1-o}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${s}px, 0)`,opacity:"0"},animate:o=>({transform:`translate3d(0, ${s*(1-o)}px, 0)`,opacity:`${o}`})}}}function Qt(){return{outPhysics:Kt,inPhysics:Gt,composition:{mode:"sequence"},build:Jt}}const te=8,ee={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},ne={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function se(e){const t=te;return{out:{willChange:"opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${t}px, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(0, ${t*(1-n)}px, 0)`,opacity:`${n}`})}}}function oe(){return{outPhysics:ee,inPhysics:ne,composition:{mode:"sequence"},build:se}}const nt=Qt(),ie={snappy:nt,directional:nt,"non-directional":oe()},st={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},M=.1,H=1/3,ot=e=>Math.max(0,Math.min(1,e));function re({direction:e}){const t=e==="forward"?1:-1,n=1-t*M;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`scale(${1+t*s*M})`,opacity:`${ot(1-s/H)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${n})`,opacity:"0"},animate:s=>({transform:`scale(${n+t*s*M})`,opacity:`${ot((s-H)/(1-H))}`})}}}function ae(){return{outPhysics:st,inPhysics:st,composition:{mode:"parallel"},build:re}}const it={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},W=.1,R=1/3,rt=e=>Math.max(0,Math.min(1,e));function le(){return{out:{willChange:"opacity",startStyle:{},animate:e=>({opacity:`${rt(1-e/R)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${1-W})`,opacity:"0"},animate:e=>({transform:`scale(${1-W+e*W})`,opacity:`${rt((e-R)/(1-R))}`})}}}function ce(){return{outPhysics:it,inPhysics:it,composition:{mode:"parallel"},build:le}}const at=ae(),pe={snappy:at,directional:at,"non-directional":ce()},de={x:jt,y:ie,z:pe};function fe(e,t){const n=de[e];return n[t]??n.snappy}const ye="x",ue="snappy";function lt(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,s]of Object.entries(t.startStyle))e.style[n]=s}function Pt(e){e.style.willChange="auto",e.style.backfaceVisibility="",e.style.contain="",e.style.transform="",e.style.opacity="",e.style.clipPath=""}function he(e){Pt(e),e.style.pointerEvents=""}const me=(e={})=>{const t=e.direction??"forward",n=e.type??ye,s=e.feel??ue,o=fe(n,s),i=o.build({direction:t});return{prepare:({from:r,to:l})=>(r.then(c=>{lt(c,i.out),c.style.pointerEvents="none"}),l.then(c=>{lt(c,i.in)}),{}),animation:({from:r,to:l,context:c})=>{if(n==="z"){const d=D(c,"from"),f=D(c,"to");r.style.clipPath=`inset(${d.top}px 0 calc(100% - ${d.top+d.height}px) 0)`,l.style.clipPath=`inset(${f.top}px 0 calc(100% - ${f.top+f.height}px) 0)`}const a=new h.WebAnimation({element:r,integrator:g.from(o.outPhysics),style:d=>i.out.animate(d),onComplete:()=>he(r)}),p=new h.WebAnimation({element:l,integrator:g.from(o.inPhysics),style:d=>i.in.animate(d),onComplete:()=>Pt(l)});return new h.MultiAnimation([a,p],o.composition)}}};function ge(e,t,n){return e==="y"?t==="non-directional"?"non-directional":"directional":e!=="x"||t==="snappy"||n==="snappy"?"snappy":"fluid"}function be(e){const{paths:t}=e,n=e.type??"x",s=e.variant,o=e.feel,i=ge(n,s,o);return j(t,{forward:"forward",backward:"backward"},r=>me({type:n,direction:r,feel:i}))}const we={spring:{stiffness:200,damping:22}},Se=10,$e="horizontal",Ee="#000000";function ct(e,t,n,s,o,i){window.getComputedStyle(e).position==="static"&&(e.style.position="relative");const l=document.createElement("div");l.style.cssText=`
|
|
1
|
+
"use strict";var Yt=Object.defineProperty;var Lt=(e,t,n)=>t in e?Yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $=(e,t,n)=>Lt(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./multi-animation-uzEnQnrG.cjs");function _(e,t){const n=[];for(let s=0;s<e.length;s++)for(let o=s+1;o<e.length;o++){const i=e[s],r=e[o];!i||!r||n.push({from:i,to:r,transition:t(),symmetric:!0})}return n}function At(e,t){return[{from:e.exit,to:e.enter,transition:t("enter")},{from:e.enter,to:e.exit,transition:t("exit")}]}function j(e,t,n){const s=[];for(let o=0;o<e.length;o++)for(let i=o+1;i<e.length;i++){const r=e[o],l=e[i];!r||!l||s.push({from:r,to:l,transition:n(t.forward)},{from:l,to:r,transition:n(t.backward)})}return s}class F{constructor(t){$(this,"omega");$(this,"zeta");$(this,"restDelta");$(this,"restSpeed");const{stiffness:n,damping:s}=t,o=1;this.omega=Math.sqrt(n/o),this.zeta=s/(2*Math.sqrt(n*o)),this.restDelta=t.restDelta??u.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??u.VELOCITY_THRESHOLD}step(t,n,s){const o=Math.min(s,.033),{omega:i,zeta:r}=this,{position:l,velocity:c}=t,a=-2*o*r*i*c,p=o*i*i*(n-l),d=c+a+p;return{position:l+o*d,velocity:d}}isSettled(t,n){const s=Math.abs(n-t.position),o=Math.abs(t.velocity);return s<this.restDelta&&o<this.restSpeed}}class Mt{constructor(t){$(this,"leader");$(this,"follower");$(this,"restDelta");$(this,"restSpeed");this.restDelta=t.restDelta??u.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??u.VELOCITY_THRESHOLD,this.leader=new F({stiffness:t.stiffness,damping:t.damping,restDelta:this.restDelta,restSpeed:this.restSpeed});let n,s,o,i;typeof t.follower=="number"?(n=t.stiffness*t.follower,s=t.damping):t.follower?(n=t.follower.stiffness,s=t.follower.damping,o=t.follower.restDelta,i=t.follower.restSpeed):(n=t.stiffness,s=t.damping),this.follower=new F({stiffness:n,damping:s,restDelta:o??this.restDelta,restSpeed:i??this.restSpeed})}step(t,n,s){const i=t._leader??{position:t.position,velocity:t.velocity},r=this.leader.step(i,n,s),l=this.follower.step(t,r.position,s);return{position:l.position,velocity:l.velocity,_leader:r}}isSettled(t,n){const s=t,o=Math.abs(n-t.position)<this.restDelta&&Math.abs(t.velocity)<this.restSpeed;return s._leader?Math.abs(n-s._leader.position)<this.restDelta&&Math.abs(s._leader.velocity)<this.restSpeed&&o:o}}const Ht=.01,Wt=500,Rt=10;class Ut{constructor(t){$(this,"acceleration");$(this,"resistance");$(this,"resistanceType");$(this,"min");$(this,"max");$(this,"bounceStiffness");$(this,"bounceDamping");$(this,"restDelta");this.acceleration=t.acceleration,this.resistance=t.resistance,this.resistanceType=t.resistanceType??"quadratic",this.min=t.min,this.max=t.max,this.bounceStiffness=t.bounceStiffness??Wt,this.bounceDamping=t.bounceDamping??Rt,this.restDelta=t.restDelta??Ht}step(t,n,s){const o=Math.min(s,.033),{acceleration:i,resistance:r,resistanceType:l,min:c,max:a}=this,{position:p,velocity:d}=t,f=c!==void 0&&p<c,m=a!==void 0&&p>a;let y;if(f||m){const S=p-(f?c:a),E=-this.bounceStiffness*S,C=-this.bounceDamping*d;y=E+C}else{const w=n>p?1:-1;let S;l==="linear"?S=r*d:S=r*d*Math.abs(d),y=w*i-S}const h=d+y*o;let b=p+h*o;if(!f&&!m){const w=n>p?1:-1;(w>0&&b>n||w<0&&b<n)&&(b=n)}return{position:b,velocity:b===n?0:h}}isSettled(t,n){return Math.abs(n-t.position)<this.restDelta}}class g{static from(t){if(t.spring&&t.inertia)throw new Error("Cannot use both 'spring' and 'inertia' together. Choose one physics type.");if(t.inertia)return new Ut({acceleration:t.inertia.acceleration,resistance:t.inertia.resistance,resistanceType:t.inertia.resistanceType,min:t.inertia.min,max:t.inertia.max,bounceStiffness:t.inertia.bounceStiffness,bounceDamping:t.inertia.bounceDamping,restDelta:t.inertia.restDelta});const n=t.spring??{stiffness:300,damping:30};if(n.doubleSpring){const s=n.doubleSpring;let o;return typeof s=="number"?o=s:typeof s=="object"&&(o={stiffness:s.stiffness,damping:s.damping}),new Mt({stiffness:n.stiffness,damping:n.damping,follower:o,restDelta:n.restDelta,restSpeed:n.restSpeed})}return new F({stiffness:n.stiffness,damping:n.damping,restDelta:n.restDelta,restSpeed:n.restSpeed})}static fromSpring(t){return g.from({spring:t})}}class Vt{constructor(t){$(this,"durationSec");this.durationSec=Math.max(1/60,t.durationSec)}step(t,n,s){const o=n-t.position;if(o===0)return t;const i=Math.sign(o),r=Math.abs(o)/this.durationSec,l=i*r*s,c=t.position+l;return(i>0?c>=n:c<=n)?{position:n,velocity:0}:{position:c,velocity:i*r}}isSettled(t,n){return Math.abs(t.position-n)<u.POSITION_THRESHOLD}}function K(e,t){function n(i){let r=0,l=0;const c=i.offsetWidth,a=i.offsetHeight;let p=i;for(;p;)r+=p.offsetTop,l+=p.offsetLeft,p=p.offsetParent;return r-=window.scrollY,l-=window.scrollX,{top:r,left:l,width:c,height:a}}const s=n(e),o=n(t);return new DOMRect(o.left-s.left,o.top-s.top,o.width,o.height)}function J(e,t){const n=e.getBoundingClientRect(),s=t.getBoundingClientRect(),o=e.offsetWidth>0?n.width/e.offsetWidth:1,i=e.offsetHeight>0?n.height/e.offsetHeight:1;return new DOMRect((s.left-n.left)/o,(s.top-n.top)/i,s.width/o,s.height/i)}function D(e,t){const{scrollingElement:n,positionedParent:s}=e,o=n!==s&&n.contains(s)?K(n,s).top:0;return{top:e[t].scroll.y,left:0,width:n.clientWidth,height:n.clientHeight-o}}const Q=8,tt={spring:{stiffness:1e3,damping:40,doubleSpring:1.2,restDelta:.1,restSpeed:.1}};function zt({direction:e}){const t=e==="forward"?Q:-Q;return{out:{willChange:"transform, opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${t}px, 0, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(${t*(1-n)}px, 0, 0)`,opacity:`${n}`})}}}function Nt(){return{outPhysics:tt,inPhysics:tt,composition:{mode:"parallel",startAt:[0,0]},build:zt}}const et=30,Xt={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},Bt={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function Zt({direction:e}){const t=e==="forward"?1:-1,n=-et*t,s=et*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:o=>({transform:`translate3d(${n*o}px, 0, 0)`,opacity:`${1-o}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${s}px, 0, 0)`,opacity:"0"},animate:o=>({transform:`translate3d(${s*(1-o)}px, 0, 0)`,opacity:`${o}`})}}}function qt(){return{outPhysics:Xt,inPhysics:Bt,composition:{mode:"sequence"},build:Zt}}const jt={snappy:Nt(),fluid:qt()},nt=8,Kt={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},Gt={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function Jt({direction:e}){const t=e==="forward"?1:-1,n=-nt*t,s=nt*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:o=>({transform:`translate3d(0, ${n*o}px, 0)`,opacity:`${1-o}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${s}px, 0)`,opacity:"0"},animate:o=>({transform:`translate3d(0, ${s*(1-o)}px, 0)`,opacity:`${o}`})}}}function Qt(){return{outPhysics:Kt,inPhysics:Gt,composition:{mode:"sequence"},build:Jt}}const te=8,ee={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},ne={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function se(e){const t=te;return{out:{willChange:"opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${t}px, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(0, ${t*(1-n)}px, 0)`,opacity:`${n}`})}}}function oe(){return{outPhysics:ee,inPhysics:ne,composition:{mode:"sequence"},build:se}}const st=Qt(),ie={snappy:st,directional:st,"non-directional":oe()},ot={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},M=.1,H=1/3,it=e=>Math.max(0,Math.min(1,e));function re({direction:e}){const t=e==="forward"?1:-1,n=1-t*M;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`scale(${1+t*s*M})`,opacity:`${it(1-s/H)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${n})`,opacity:"0"},animate:s=>({transform:`scale(${n+t*s*M})`,opacity:`${it((s-H)/(1-H))}`})}}}function ae(){return{outPhysics:ot,inPhysics:ot,composition:{mode:"parallel"},build:re}}const rt={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},W=.1,R=1/3,at=e=>Math.max(0,Math.min(1,e));function le(){return{out:{willChange:"opacity",startStyle:{},animate:e=>({opacity:`${at(1-e/R)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${1-W})`,opacity:"0"},animate:e=>({transform:`scale(${1-W+e*W})`,opacity:`${at((e-R)/(1-R))}`})}}}function ce(){return{outPhysics:rt,inPhysics:rt,composition:{mode:"parallel"},build:le}}const lt=ae(),pe={snappy:lt,directional:lt,"non-directional":ce()},de={x:jt,y:ie,z:pe};function fe(e,t){const n=de[e];return n[t]??n.snappy}const ye="x",he="snappy";function ct(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,s]of Object.entries(t.startStyle))e.style[n]=s}function Pt(e){e.style.willChange="auto",e.style.backfaceVisibility="",e.style.contain="",e.style.transform="",e.style.opacity="",e.style.clipPath=""}function ue(e){Pt(e),e.style.pointerEvents=""}const me=(e={})=>{const t=e.direction??"forward",n=e.type??ye,s=e.feel??he,o=fe(n,s),i=o.build({direction:t});return{prepare:({from:r,to:l})=>(r.then(c=>{ct(c,i.out),c.style.pointerEvents="none"}),l.then(c=>{ct(c,i.in)}),{}),animation:({from:r,to:l,context:c})=>{if(n==="z"){const d=D(c,"from"),f=D(c,"to");r.style.clipPath=`inset(${d.top}px 0 calc(100% - ${d.top+d.height}px) 0)`,l.style.clipPath=`inset(${f.top}px 0 calc(100% - ${f.top+f.height}px) 0)`}const a=new u.WebAnimation({element:r,integrator:g.from(o.outPhysics),style:d=>i.out.animate(d),onComplete:()=>ue(r)}),p=new u.WebAnimation({element:l,integrator:g.from(o.inPhysics),style:d=>i.in.animate(d),onComplete:()=>Pt(l)});return new u.MultiAnimation([a,p],o.composition)}}};function ge(e,t,n){return e==="y"?t==="non-directional"?"non-directional":"directional":e!=="x"||t==="snappy"||n==="snappy"?"snappy":"fluid"}function be(e){const{paths:t}=e,n=e.type??"x",s=e.variant,o=e.feel,i=ge(n,s,o);return j(t,{forward:"forward",backward:"backward"},r=>me({type:n,direction:r,feel:i}))}const we={spring:{stiffness:200,damping:22}},Se=10,$e="horizontal",Ce="#000000";function pt(e,t,n,s,o,i){window.getComputedStyle(e).position==="static"&&(e.style.position="relative");const l=document.createElement("div");l.style.cssText=`
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
transform: scaleY(${o==="hidden"?0:1});
|
|
28
28
|
transform-origin: ${i==="left"?"top":"bottom"} center;
|
|
29
29
|
will-change: transform;
|
|
30
|
-
`}c.push(p),l.appendChild(p)}return e.appendChild(l),{container:l,blinds:c}}const
|
|
30
|
+
`}c.push(p),l.appendChild(p)}return e.appendChild(l),{container:l,blinds:c}}const Ee=(e={})=>{const t=e.blindCount??Se,n=e.direction??$e,s=e.blindColor??Ce,o=e.physics??we;return{prepare:async({from:i,to:r})=>{const l=await i,c=await r;l.style.zIndex="1000";const a=pt(l,t,n,s,"hidden","left");c.style.position="relative",c.style.zIndex="0";const p=pt(c,t,n,s,"closed","right");return{fromEl:l,fromBlinds:a.blinds,fromContainer:a.container,toBlinds:p.blinds,toContainer:p.container}},animation:({fromEl:i,fromBlinds:r,fromContainer:l,toBlinds:c,toContainer:a})=>{const p=r.map(y=>new u.WebAnimation({element:y,integrator:g.from(o),style:h=>({transform:n==="horizontal"?`scaleX(${h})`:`scaleY(${h})`})})),d=c.map((y,h)=>new u.WebAnimation({element:y,integrator:g.from(o),style:(b,w)=>({transform:n==="horizontal"?`scaleX(${w})`:`scaleY(${w})`}),onComplete:h===c.length-1?()=>{a.remove(),l.remove(),i.style.zIndex="",i.style.position=""}:void 0})),f=new u.MultiAnimation(p,{mode:"parallel"}),m=new u.MultiAnimation(d,{mode:"parallel"});return new u.MultiAnimation([f,m],{mode:"sequence"})}}};function xe(e){const{paths:t,type:n="horizontal"}=e;return _(t,()=>Ee({direction:n}))}const Ae={spring:{stiffness:200,damping:20,doubleSpring:.7}},I=.5;function Pe(e){const t=e==="enter"?-100:100,n=e==="enter"?100:-100;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(${t*s}%, 0, 0)`,opacity:`${I+(1-I)*(1-s)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${n}%, 0, 0)`,opacity:`${I}`},animate:s=>({transform:`translate3d(${n*(1-s)}%, 0, 0)`,opacity:`${I+(1-I)*s}`})}}}function _e(){return{physics:Ae,build:Pe}}const De={spring:{stiffness:170,damping:22}};function Oe(e){const t=e==="enter"?-20:100,n=e==="enter"?100:-20;return{out:{willChange:"transform",startStyle:{},animate:s=>({transform:`translate3d(${t*s}%, 0, 0)`})},in:{willChange:"transform",startStyle:{transform:`translate3d(${n}%, 0, 0)`},animate:s=>({transform:`translate3d(${n*(1-s)}%, 0, 0)`})}}}function Ie(){return{physics:De,build:Oe}}const Te={parallax:Ie(),crossfade:_e()},ve="parallax";function dt(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,s]of Object.entries(t.startStyle))e.style[n]=s}const Fe=(e={})=>{const t=e.direction??"enter",n=Te[e.type??ve],s=n.physics,o=n.build(t);return{prepare:({from:i,to:r})=>(i.then(l=>{dt(l,o.out),l.style.pointerEvents="none",l.style.zIndex=t==="enter"?"-1":"100"}),r.then(l=>{dt(l,o.in)}),{}),animation:({from:i,to:r})=>{const l=new u.WebAnimation({element:i,integrator:g.from(s),style:a=>o.out.animate(a),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform="",i.style.opacity="",i.style.pointerEvents="",i.style.zIndex=""}}),c=new u.WebAnimation({element:r,integrator:g.from(s),style:a=>o.in.animate(a),onComplete:()=>{r.style.willChange="auto",r.style.backfaceVisibility="",r.style.contain="",r.style.transform="",r.style.opacity=""}});return new u.MultiAnimation([l,c],{mode:"parallel"})}}};function ke(e){return e==="slide"||e==="crossfade"?"crossfade":"parallax"}function Ye(e){const{enter:t,exit:n}=e,s=e.type,o=ke(s);return At({enter:t,exit:n},i=>Fe({direction:i,type:o}))}const Le={spring:{stiffness:180,damping:20,doubleSpring:!0}},Me={spring:{stiffness:170,damping:20,doubleSpring:!0}},He=(e={})=>{const t=e.physics??Me,n=e.physics??Le;return{prepare:({to:s})=>(s.then(o=>{o.style.opacity="0",o.style.willChange="opacity"}),{}),animation:({from:s,to:o})=>{const i=new u.WebAnimation({element:s,integrator:g.from(n),style:(l,c)=>({opacity:c}),onComplete:()=>{s.style.willChange="auto",s.style.opacity=""}}),r=new u.WebAnimation({element:o,integrator:g.from(t),style:l=>({opacity:l}),onComplete:()=>{o.style.willChange="auto",o.style.opacity=""}});return new u.MultiAnimation([i,r],{mode:"sequence"})}}};function We(e){const{paths:t}=e;return _(t,()=>He())}const U={scaleDown:{stiffness:20,damping:7},translate:{stiffness:15,damping:7},scaleUp:{stiffness:20,damping:7}},O={scaleDown:0,translate:.2,scaleUp:.8},Re=.8,Ue="white",ft=1e3/60,Ve=600;function ze(e){const{items:t,from:n,to:s,recordFrame:o}=e,i=ft/1e3,r=Math.abs(s-n),l=t.map(a=>({item:a,integrator:new F({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);o(0);let c=0;for(let a=1;a<=Ve;a++){const p=a*ft;c=p;for(const d of l)!d.started||d.settled||(d.state=d.integrator.step(d.state,s,i),d.integrator.isSettled(d.state,s)?(d.settleTime+=i,d.settleTime>=u.SETTLE_THRESHOLD&&(d.state={position:s,velocity:0},d.settled=!0)):d.settleTime=0,d.item.tick(d.state.position));for(let d=1;d<l.length;d++){const f=l[d];if(f.started)continue;const m=l[d-1];if(!m.started)continue;(r===0?1:Math.abs(m.state.position-n)/r)>=f.item.offset&&(f.started=!0)}if(o(p),l.every(d=>d.settled))return p}return c}function V(e,t){return e!=null&&e.spring?{stiffness:e.spring.stiffness,damping:e.spring.damping}:t}function yt(e){const{rect:t,scale:n,direction:s,override:o}=e,i=s==="out"?{scale:1,translateY:-t.top}:{scale:n,translateY:-t.top+t.height},r=V(o,U.scaleDown),l=V(o,U.translate),c=V(o,U.scaleUp),a=s==="out"?1:0,p=s==="out"?0:1,d=s==="out"?[{spring:r,offset:O.scaleDown,tick:y=>{const h=1-y;i.scale=1-(1-n)*h}},{spring:l,offset:O.translate,tick:y=>{const h=1-y;i.translateY=-t.top-t.height*h}},{spring:c,offset:O.scaleUp,tick:y=>{const h=1-y;i.scale=n+(1-n)*h}}]:[{spring:r,offset:O.scaleDown,tick:y=>{i.scale=1-(1-n)*y}},{spring:l,offset:O.translate,tick:y=>{i.translateY=-t.top+t.height*(1-y)}},{spring:c,offset:O.scaleUp,tick:y=>{i.scale=n+(1-n)*y}}],f=[],m=ze({items:d,from:a,to:p,recordFrame:y=>f.push({time:y,scale:i.scale,translateY:i.translateY})});return{snapshots:f,totalDuration:m}}function Ne(e,t){if(e.length===0)return{time:0,scale:1,translateY:0};if(e.length===1||t<=0)return e[0];if(t>=1)return e[e.length-1];const n=t*(e.length-1),s=Math.floor(n),o=Math.ceil(n);if(s===o)return e[s];const i=e[s],r=e[o],l=n-s;return{time:i.time+(r.time-i.time)*l,scale:i.scale+(r.scale-i.scale)*l,translateY:i.translateY+(r.translateY-i.translateY)*l}}const Xe=[[1,1],[-1,1],[1,-1],[-1,-1]];function Be(e,t){const o=(i,r,l)=>{const c=document.createElement("div");Object.assign(c.style,{position:"fixed",pointerEvents:"none",zIndex:"9999",width:"15px",height:"15px",...i});const a=document.createElement("div");Object.assign(a.style,{position:"absolute",width:"15px",height:"1px",backgroundColor:e,[l]:"0",[r]:"0"});const p=document.createElement("div");return Object.assign(p.style,{position:"absolute",width:"1px",height:"15px",backgroundColor:e,[l]:"0",[r]:"0"}),c.appendChild(a),c.appendChild(p),c};return{topLeft:o({top:`${t.top-1}px`,left:`${t.left-1}px`},"left","top"),topRight:o({top:`${t.top-1}px`,left:`${t.left+t.width-15+1}px`},"right","top"),bottomLeft:o({top:`${t.top+t.height-15+1}px`,left:`${t.left-1}px`},"left","bottom"),bottomRight:o({top:`${t.top+t.height-15+1}px`,left:`${t.left+t.width-15+1}px`},"right","bottom")}}function ht(e,t){const n=t.left+t.width/2,s=t.top+t.height/2;e.style.transformOrigin=`${n}px ${s}px`}function ut(e,t){e.style.clipPath=`polygon(
|
|
31
31
|
${t.left}px ${t.top}px,
|
|
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 z(e,t,n,s,o){const i=n/1e3;return new h.WebAnimation({element:e,integrator:new Vt({durationSec:i}),lowerBound:0,upperBound:1,style:r=>s(Ne(t,r)),onComplete:o})}const Ze=(e={})=>{var o;const t=((o=e.border)==null?void 0:o.color)??Ue,n=Re,s=e.physics;return{prepare:({from:i,to:r,context:l})=>{const c=D(l,"from"),a=D(l,"to"),p=K(document.body,l.positionedParent),d=Be(t,{...c,top:p.top});for(const f of["topLeft","topRight","bottomLeft","bottomRight"])l.positionedParent.appendChild(d[f]);return i.then(f=>{yt(f,c),ut(f,c),f.style.transform=`translateY(${-c.top}px)`}),r.then(f=>{yt(f,a),ut(f,a),f.style.transform=`translateY(${-a.top+a.height}px) scale(${n})`}),{borders:d,fromRect:c,toRect:a}},animation:({from:i,to:r,context:l,borders:c,fromRect:a,toRect:p})=>{const d=ft({rect:a,scale:n,direction:"out",override:s}),f=ft({rect:p,scale:n,direction:"in",override:s}),m=z(i,d.snapshots,d.totalDuration,S=>({transform:`translateY(${S.translateY}px) scale(${S.scale})`}),()=>{i.style.clipPath="",i.style.transformOrigin="",i.style.transform=""}),y=z(r,f.snapshots,f.totalDuration,S=>({transform:`translateY(${S.translateY}px) scale(${S.scale})`}),()=>{r.style.clipPath="",r.style.transformOrigin="",r.style.transform=""}),u=Xe.map(([S,C],E)=>{const x=["topLeft","topRight","bottomLeft","bottomRight"][E];return z(c[x],d.snapshots,d.totalDuration,P=>{const A=(a.width-a.width*P.scale)/2*.7*S,L=(a.height-a.height*P.scale)/2*.7*C;return{transform:`translate(${A}px, ${L}px)`}})}),b=new h.MultiAnimation([m,y,...u],{mode:"parallel"}),w=b.onComplete;return b.onComplete=()=>{w==null||w();const S=l.positionedParent;for(const C of["topLeft","topRight","bottomLeft","bottomRight"]){const E=c[C];E.parentElement===S&&S.removeChild(E)}},b}}};function qe(e){const{paths:t,options:n}=e,s=(n==null?void 0:n.borderColor)!==void 0?{border:{color:n.borderColor}}:void 0;return _(t,()=>Ze(s))}const ht="data-hero-enter-key",mt="data-hero-exit-key",N="data-hero-key";class je{constructor(){$(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 Ke=()=>new je;class Ge{contribute(t){const{from:n,to:s,physics:o,onComplete:i}=t,r=n.style.opacity,l=s.style.opacity,c=n.style.willChange,a=s.style.willChange;return s.style.opacity="0",n.style.willChange="opacity",s.style.willChange="opacity",i(()=>{n.style.opacity=r,s.style.opacity=l,n.style.willChange=c,s.style.willChange=a}),[new h.WebAnimation({element:n,integrator:g.from(o),style:(p,d)=>({opacity:d})}),new h.WebAnimation({element:s,integrator:g.from(o),style:p=>({opacity:p})})]}}const Je=()=>new Ge,Qe={static:Ke,fade:Je},tn={spring:{stiffness:320,damping:30}},en=()=>tn,nn={spring:{stiffness:300,damping:30,doubleSpring:1}},sn=()=>nn,on={default:en,smooth:sn},rn=700,an="data-hero-aspect-ratio",ln="data-hero-radius";function cn(e){if(!e)return null;if(e.includes("/")){const[n,s]=e.split("/"),o=parseFloat(n??""),i=parseFloat(s??"");return!Number.isFinite(o)||!Number.isFinite(i)||o<=0||i<=0?null:o/i}const t=parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function gt(e){const t=e.getAttribute(ln);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function k(e){return e.left+e.width/2}function Y(e){return e.top+e.height/2}function pn(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 dn(e,t,n){const s=e.width/e.height;let o,i;return n==="contain"?s>t?(i=e.height,o=i*t):(o=e.width,i=o/t):s>t?(o=e.width,i=o/t):(i=e.height,o=i*t),{left:e.left+(e.width-o)/2,top:e.top+(e.height-i)/2,width:o,height:i}}function bt(e,t,n){const s=K(e,t),o=cn(t.getAttribute(an));if(o===null)return{bbox:s,content:s,window:s,clipInset:{top:0,right:0,bottom:0,left:0}};const i=dn(s,o,n),r=n==="cover"?s:i;return{bbox:s,content:i,window:r,clipInset:pn(i,r)}}function fn(e,t,n,s){const o=n.width/s,i=n.height/s,r=e.width/2+(k(n)-k(t))/s-o/2,l=e.height/2+(Y(n)-Y(t))/s-i/2;return{top:Math.max(0,l),right:Math.max(0,e.width-r-o),bottom:Math.max(0,e.height-l-i),left:Math.max(0,r)}}function T(e,t){const n=new Map,s=e.querySelectorAll(`[${t}]`);for(const o of Array.from(s)){const i=o.getAttribute(t);i&&(n.has(i)||n.set(i,o))}return n}function yn(e,t){const n=[],s=T(t,ht),o=T(e,mt);for(const[l,c]of s){const a=o.get(l);a&&n.push({key:l,fromEl:a,toEl:c,fromFit:"cover",toFit:"contain"})}const i=T(e,ht),r=T(t,mt);for(const[l,c]of i){const a=r.get(l);a&&n.push({key:l,fromEl:c,toEl:a,fromFit:"contain",toFit:"cover"})}return n}function un(e,t){const n=[],s=Array.from(t.querySelectorAll(`[${N}]`));for(const o of s){const i=o.getAttribute(N);if(!i)continue;const r=e.querySelector(`[${N}="${i}"]`);r&&n.push({key:i,fromEl:r,toEl:o,fromFit:"contain",toFit:"contain"})}return n}function hn(e,t){const n=yn(e,t);return n.length>0?n:un(e,t)}function mn(e,t,n){const{fromEl:s,toEl:o}=t,i=bt(e,s,t.fromFit),r=bt(e,o,t.toFit),l=i.content,c=i.window,a=r.content,p=r.window,d=r.clipInset,f=gt(s),m=gt(o);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),u=k(l),b=Y(l),w=k(a),S=Y(a),C=u-w,E=b-S;if(Math.abs(E)>n)return null;const x=fn(a,l,c,y);return{toContent:a,hasRadius:f>0||m>0,styleFor:(P,A)=>{const L=A*C,Ot=A*E,G=P+A*y,It=(f*A+m*P)/G,Tt=x.top*A+d.top*P,vt=x.right*A+d.right*P,Ft=x.bottom*A+d.bottom*P,kt=x.left*A+d.left*P;return{transform:`translate(${L}px, ${Ot}px) scale(${G})`,clipPath:`inset(${Tt}px ${vt}px ${Ft}px ${kt}px round ${It}px)`}}}}function gn(e,t){e.style.transform=t.transform,e.style.clipPath=t.clipPath}class bn{contribute(t){const{resolved:n,physics:s,positionedParent:o,maxDistance:i,onComplete:r}=t,l=[];for(const c of n.pairs){const{fromEl:a,toEl:p}=c,d=mn(o,c,i);if(!d)continue;const f=p.cloneNode(!0);f.style.position="absolute",f.style.left=`${d.toContent.left}px`,f.style.top=`${d.toContent.top}px`,f.style.width=`${d.toContent.width}px`,f.style.height=`${d.toContent.height}px`,f.style.margin="0",f.style.transformOrigin="center center",f.style.zIndex="1000",f.style.willChange="transform, clip-path",f.style.pointerEvents="none",f.style.maxWidth="none",f.style.maxHeight="none",d.hasRadius&&(f.style.borderRadius="0"),gn(f,d.styleFor(0,1)),o.appendChild(f);const m=a.style.opacity,y=p.style.opacity;a.style.opacity="0",p.style.opacity="0",r(()=>{a.style.opacity=m,p.style.opacity=y,f.parentElement&&f.parentElement.removeChild(f)}),l.push(new h.WebAnimation({element:f,integrator:g.from(s),style:d.styleFor}))}return l}}function wn(e){return[new bn,Qe[e.type]()]}const Sn=e=>{const t=wn(e),n=on[e.variant](),s=rn;return{prepare:o=>{var l;const i=Promise.all([o.from,o.to]).then(([c,a])=>({pairs:hn(c,a)})),r={from:o.from,to:o.to,resolved:i};for(const c of t)(l=c.prepare)==null||l.call(c,r);return i.then(c=>({resolved:c}))},animation:({from:o,to:i,context:r,resolved:l})=>{if(l.pairs.length===0)return new h.MultiAnimation([],{mode:"parallel"});const c=[],a=y=>{c.push(y)},p={from:o,to:i,resolved:l,physics:n,positionedParent:r.positionedParent,maxDistance:s,onComplete:a},d=[];for(const y of t)y.contribute&&d.push(...y.contribute(p));if(d.length===0)return new h.MultiAnimation([],{mode:"parallel"});const f=new h.MultiAnimation(d,{mode:"parallel"}),m=f.onComplete;return f.onComplete=()=>{m==null||m();for(const y of c)try{y()}catch(u){console.error("[hero] cleanup error",u)}},f}}};function $n(e){const{paths:t}=e,n=e.type??"static",s=e.variant??"default";return _(t,()=>Sn({type:n,variant:s}))}const En={spring:{stiffness:50,damping:30}},Cn={spring:{stiffness:80,damping:25}},xn=(e={})=>{const t=e.physics??En,n=e.initialRotation??45,s=e.initialScale??.01,o=e.rotationTriggerPoint??.8;return{prepare:({from:i,to:r,context:l})=>(i.then(c=>{c.style.opacity="1"}),r.then(c=>{const a=D(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 d=a.left+a.width/2,f=a.top+a.height/2;c.style.transformOrigin=`${d}px ${f}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(${s}) translateZ(0)`,c.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",c.style.opacity="1"}),{}),animation:({from:i,to:r})=>{const l=new h.WebAnimation({element:i,integrator:g.from(Cn),style:(a,p)=>({opacity:p}),onComplete:()=>{i.style.opacity=""}}),c=new h.WebAnimation({element:r,integrator:g.from(t),style:a=>{let p;if(a<=.05)p=s;else if(a<=o){const y=(a-.05)/(o-.05),u=Math.pow(y,9);p=s+(.8-s)*u}else{const y=(a-o)/(1-o);p=.8+.2*(1-Math.pow(1-y,3))}const d=.7;let f;if(a<=d)f=n;else{const y=(a-d)/(1-d),u=1-Math.pow(1-y,2);f=n*(1-u)}let m;if(a<=d)m=1;else{const y=(a-d)/(1-d);m=1-Math.pow(y,.5)}return{transform:`rotate(${f.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,"--border-radius-scale":m.toFixed(4)}},onComplete:()=>{r.style.willChange="",r.style.backfaceVisibility="",r.style.removeProperty("--max-border-radius"),r.style.removeProperty("--border-radius-scale"),r.style.transform="",r.style.transformOrigin="",r.style.position="",r.style.zIndex="",r.style.top="",r.style.left="",r.style.width="",r.style.height="",r.style.overflow="",r.style.borderRadius=""}});return new h.MultiAnimation([l,c],{mode:"parallel"})}}};function An(e){const{paths:t}=e;return _(t,()=>xn())}const Pn={spring:{stiffness:100,damping:30}},_n=(e={})=>{const t=e.physics??Pn;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),s.then(o=>{o.style.opacity="0",o.style.transform="rotate(-180deg)",o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),{}),animation:({from:n,to:s})=>{const o=new h.WebAnimation({element:n,integrator:g.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=""}}),i=new h.WebAnimation({element:s,integrator:g.from(t),style:(r,l)=>({transform:`rotate(${-l*180}deg)`,opacity:r>.5?1:0}),onComplete:()=>{s.style.willChange="auto",s.style.transform="",s.style.transformOrigin="",s.style.opacity=""}});return new h.MultiAnimation([o,i],{mode:"parallel"})}}};function Dn(e){const{paths:t}=e;return _(t,()=>_n())}const On={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},wt=(e={})=>{const t=e.direction??"up",n=e.physics??On,s=t==="up";return{prepare:({from:o,to:i})=>(o.then(r=>{r.style.zIndex=s?"-1":"1",r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}),animation:({from:o,to:i})=>{const r=o.offsetHeight,l=i.offsetHeight,c=window.innerHeight,a=Math.max(Math.min(r,l),c),p=new h.WebAnimation({element:o,integrator:g.from(n),style:f=>({transform:`translate3d(0, ${s?-a*f:a*f}px, 0)`}),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform="",o.style.pointerEvents="",o.style.zIndex=""}}),d=new h.WebAnimation({element:i,integrator:g.from(n),style:(f,m)=>({transform:`translate3d(0, ${s?m*a:m*-a}px, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new h.MultiAnimation([p,d],{mode:"parallel"})}}};function In(e){const{paths:t,type:n="directional"}=e;return n==="non-directional"?_(t,()=>wt({direction:"up"})):j(t,{forward:"up",backward:"down"},s=>wt({direction:s}))}const Tn={spring:{stiffness:200,damping:24}},vn={inertia:{acceleration:25,resistance:1.2}},X=.2;function Fn(){return{enterPhysics:Tn,exitPhysics:vn,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-X*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-X+X*e})`,opacity:e})}}}const kn={spring:{stiffness:300,damping:30}},Yn={inertia:{acceleration:30,resistance:1}};function Ln(){return{enterPhysics:kn,exitPhysics:Yn,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const Mn={static:Ln(),"background-scale":Fn()},Hn="static",Wn="transform",Rn=(e={})=>{const t=e.direction??"enter",n=Mn[e.type??Hn],s=t==="enter"?n.enterPhysics:n.exitPhysics,o=n.background,i=o.willChange!=="";return{prepare:({from:r,to:l})=>{const c=t==="enter"?l:r,a=t==="enter"?r:l;return c.then(p=>{p.style.willChange=Wn,p.style.backfaceVisibility="hidden",p.style.contain="layout paint",t==="exit"&&(p.style.pointerEvents="none",p.style.zIndex="100")}),a.then(p=>{i&&(p.style.willChange=o.willChange,p.style.backfaceVisibility="hidden",p.style.contain="layout paint"),t==="enter"&&(p.style.pointerEvents="none",p.style.zIndex="-1")}),{}},animation:({from:r,to:l,context:c})=>{const a=t==="enter"?l:r,p=t==="enter"?r:l,d=D(c,t==="enter"?"to":"from"),f=()=>{r.style.pointerEvents="",r.style.zIndex=""};a.style.clipPath=`inset(${d.top}px 0 calc(100% - ${d.top+d.height}px) 0)`;const m=t==="enter"?(E,x)=>({transform:`translate3d(0, ${x*d.height}px, 0)`}):E=>({transform:`translate3d(0, ${E*d.height}px, 0)`}),y=new h.WebAnimation({element:a,integrator:g.from(s),style:m,onComplete:()=>{a.style.willChange="auto",a.style.backfaceVisibility="",a.style.contain="",a.style.clipPath="",a.style.transform="",f()}});if(!i)return new h.MultiAnimation([y],{mode:"parallel"});const u=D(c,t==="enter"?"from":"to"),b=u.left+u.width/2,w=u.top+u.height/2;p.style.clipPath=`inset(${u.top}px 0 calc(100% - ${u.top+u.height}px) 0)`,p.style.transformOrigin=`${b}px ${w}px`;const S=t==="enter"?(E,x)=>o.enterStyle(E,x):E=>o.exitStyle(E),C=new h.WebAnimation({element:p,integrator:g.from(s),style:S,onComplete:t==="exit"?()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.contain="",p.style.clipPath="",p.style.transformOrigin=""}:()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.contain="",p.style.clipPath="",p.style.transformOrigin="",p.style.transform="",p.style.opacity=""}});return new h.MultiAnimation([y,C],{mode:"parallel"})}}};function Un(e){return e==="scale"||e==="background-scale"?"background-scale":"static"}function Vn(e){const{enter:t,exit:n}=e,s=e.type,o=Un(s);return At({enter:t,exit:n},i=>Rn({direction:i,type:o}))}const zn={spring:{stiffness:170,damping:22,doubleSpring:.8}},Nn=(e={})=>{const t=e.direction??"left",n=e.physics??zn,s=t==="left";return{prepare:({from:o,to:i})=>(o.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{const 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:o,to:i})=>{const r=new h.WebAnimation({element:o,integrator:g.from(n),style:c=>({transform:`translate3d(${s?-100*c:100*c}%, 0, 0)`}),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform="",o.style.pointerEvents=""}}),l=new h.WebAnimation({element:i,integrator:g.from(n),style:(c,a)=>({transform:`translate3d(${s?a*100:a*-100}%, 0, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new h.MultiAnimation([r,l],{mode:"parallel"})}}};function Xn(e){const{paths:t}=e;return j(t,{forward:"left",backward:"right"},n=>Nn({direction:n}))}const Bn={spring:{stiffness:17,damping:6}},B=20,v=800,Zn=(e={})=>{const t=e.physics??Bn;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.pointerEvents="none",o.style.transform=`perspective(${v}px) rotateY(0deg) translate3d(0%, 0, 0)`}),s.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.transform=`perspective(${v}px) rotateY(${B}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:s})=>{const o=new h.WebAnimation({element:n,integrator:g.from(t),style:r=>{const l=-r*B,c=r*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=""}}),i=new h.WebAnimation({element:s,integrator:g.from(t),style:(r,l)=>{const c=l*B,a=-l*100;return{transform:`perspective(${v}px) rotateY(${c}deg) translate3d(${a}%, 0, 0)`}},onComplete:()=>{s.style.transform="",s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain=""}});return new h.MultiAnimation([o,i],{mode:"sequence"})}}};function qn(e){const{paths:t}=e;return _(t,()=>Zn())}function St(e,t){const n=e.getBoundingClientRect(),s=t.getBoundingClientRect();return new DOMRect(s.left-n.left,s.top-n.top,s.width,s.height)}function jn({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const r=t.left-e.left+(t.width-e.width)/2-s.x,l=t.top-e.top+(t.height-e.height)/2-s.y,c=t.width/e.width,a=t.height/e.height,p=e.top/n.height*100,d=(n.width-(e.left+e.width))/n.width*100,f=(n.height-(e.top+e.height))/n.height*100,m=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:y=>{const u=1-y,b=1+(c-1)*u,w=1+(a-1)*u,C=(i*u+o*(1-u))/((b+w)/2);return{clipPath:`inset(${p*u}% ${d*u}% ${f*u}% ${m*u}% round ${C}px)`,transform:`translate(${r*u}px, ${l*u}px) scale(${b}, ${w})`}}}}function Kn({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const r=t.left-e.left+(t.width-e.width)/2+s.x,l=t.top-e.top+(t.height-e.height)/2+s.y,c=t.width/e.width,a=t.height/e.height,p=e.top/n.height*100,d=(n.width-(e.left+e.width))/n.width*100,f=(n.height-(e.top+e.height))/n.height*100,m=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:y=>{const u=1-y,b=1+(c-1)*u,w=1+(a-1)*u,C=(o*(1-u)+i*u)/((b+w)/2);return{clipPath:`inset(${p*u}% ${d*u}% ${f*u}% ${m*u}% round ${C}px)`,transform:`translate(${r*u-s.x}px, ${l*u}px) scale(${b}, ${w})`}}}}const Gn={spring:{stiffness:430,damping:33,doubleSpring:1}},_t=.12,Jn=18;function Qn(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-_t*t})`}}}}function ts(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-_t*t})`}}}}const Z={willChange:"backdrop-filter",initialStyle:{position:"absolute",inset:"0",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,s=`blur(${Jn*n}px)`;return{backdropFilter:s,WebkitBackdropFilter:s}}};class es{constructor(){$(this,"physics",Gn)}contribute(t){const{from:n,to:s,resolved:o,physics:i}=t,r=o.mode==="enter",l=r?n:s,c=r?Qn():ts();return c&&(l.style.transformOrigin=c.transformOrigin),[new h.WebAnimation({element:l,integrator:g.from(i),style:r?(a,p)=>c.animate(p):a=>c.animate(a)})]}}class ns{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,Z.initialStyle),n.style.willChange=Z.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;return n?(n.style.zIndex=t.resolved.mode==="enter"?"-1":"1",[new h.WebAnimation({element:n,integrator:g.from(t.physics),style:s=>Z.style(t.resolved.mode,s)})]):[]}}const ss={spring:{stiffness:430,damping:33,doubleSpring:1}};function os({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2+n.x,o=e.top-t.top+(e.height-t.height)/2+n.y,i=e.width/t.width,r=e.height/t.height,l=Math.max(i,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${s*a-n.x}px, ${o*a}px) scale(${1+(l-1)*a})`}}}}function is({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2-n.x,o=e.top-t.top+(e.height-t.height)/2-n.y,i=e.width/t.width,r=e.height/t.height,l=Math.max(i,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${s*a}px, ${o*a}px) scale(${1+(l-1)*a})`}}}}class rs{constructor(){$(this,"physics",ss)}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:r}=t,l=o.mode==="enter",c=l?n:s,a=l?os(i):is(i);return a&&(c.style.transformOrigin=a.transformOrigin),[new h.WebAnimation({element:c,integrator:g.from(r),style:l?(p,d)=>a.animate(d):p=>a.animate(p)})]}}const as={spring:{stiffness:530,damping:34,doubleSpring:1}};class ls{constructor(){$(this,"physics",as)}contribute(t){return[]}}const cs={expand:()=>new rs,static:()=>new ls,blur:()=>new es};function ps(e){return cs[e]()}const q="data-zoom-enter-key",$t="data-zoom-exit-key",ds="data-zoom-radius";function Et(e){const t=e.getAttribute(ds);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function fs(e,t){const n=[];let s=t;for(;s&&s!==e;){const o=s.parentElement;if(!o)break;for(const i of Array.from(o.children))i!==s&&i instanceof HTMLElement&&n.push(i);s=o}return n}function Ct(e){const t=e.querySelectorAll(`[${q}]`);return t.length!==1?null:t[0]}function xt(e,t){const n=e.querySelectorAll(`[${$t}]`);for(const s of n)if(s.getAttribute($t)===t)return s;return null}function ys(e,t){const n=Ct(e),s=Ct(t);if(!n&&s){const o=s.getAttribute(q);if(!o)return null;const i=xt(e,o);return i?{mode:"enter",enterEl:s,exitEl:i}:null}if(n&&!s){const o=n.getAttribute(q);if(!o)return null;const i=xt(t,o);return i?{mode:"exit",enterEl:n,exitEl:i}:null}return null}function us(e,t,n,s){return{enterRect:St(e.mode==="enter"?n:t,e.enterEl),exitRect:St(e.mode==="enter"?t:n,e.exitEl),pageRect:e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),scrollOffset:s,enterRadius:Et(e.enterEl),exitRadius:Et(e.exitEl)}}class hs{prepare(t){t.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:r,onComplete:l}=t,c=o.mode==="enter",a=c?jn(i):Kn(i),p=c?s:n,d=c?"t":"u";a&&(p.style.transformOrigin=a.transformOrigin);const f=c?"-2":"2",m=n.style.zIndex;return n.style.zIndex=f,l(()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.transformOrigin="",p.style.contain="",n.style.zIndex=m,n.style.willChange="auto",n.style.backfaceVisibility="",n.style.transformOrigin="",n.style.contain="",n.style.transform="",n.style.clipPath=""}),[new h.WebAnimation({element:p,integrator:g.from(r),style:d==="t"?y=>a.animate(y):(y,u)=>a.animate(u)})]}}class ms{contribute(t){const{resolved:n,physics:s,from:o,to:i,onComplete:r}=t,l=n.mode==="enter"?i:o,c=fs(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 d=c[p];d&&(d.style.opacity=a[p]??"")}}),c.map(p=>new h.WebAnimation({element:p,integrator:g.from(s),style:(d,f)=>({opacity:n.mode==="enter"?d:f})}))}}class Dt{contribute(){return[]}}const gs={default:()=>new Dt,fade:()=>new ms};function bs(e){return gs[e]()}class ws extends Dt{}function Ss(e){const t=ps(e.type);return{strategies:[new hs,t,bs(e.variant),new ws,...e.type==="blur"?[new ns]:[]],physics:t.physics}}const $s=e=>{const{strategies:t,physics:n}=Ss(e);return{prepare:s=>{const o={from:s.from,to:s.to,context:{positionedParent:s.context.positionedParent},createElement:s.createElement},i={};for(const r of t){if(!r.prepare)continue;const l=r.prepare(o);l&&Object.assign(i,l)}return i},animation:({from:s,to:o,context:i,...r})=>{const l=ys(s,o);if(!l)return new h.MultiAnimation([],{mode:"parallel"});const c=us(l,s,o,i.scrollOffset),a=[],d={from:s,to:o,resolved:l,input:c,physics:n,extras:r,onComplete:y=>{a.push(y)}},f=[];for(const y of t)y.contribute&&f.push(...y.contribute(d));const m=f[0];if(m){const y=m.onComplete;m.onComplete=()=>{y==null||y();for(const u of a)try{u()}catch(b){console.error("[zoom] cleanup error",b)}}}return new h.MultiAnimation(f,{mode:"parallel"})}}};function Es(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function Cs(e){const t=Es(e);return _(e.paths,()=>$s(t))}exports.Animation=h.Animation;exports.MultiAnimation=h.MultiAnimation;exports.WebAnimation=h.WebAnimation;exports.axis=be;exports.blind=xe;exports.drill=Ye;exports.fade=We;exports.film=qe;exports.hero=$n;exports.jaemin=An;exports.rotate=Dn;exports.scroll=In;exports.sheet=Vn;exports.slide=Xn;exports.strip=qn;exports.zoom=Cs;
|
|
35
|
+
)`}function z(e,t,n,s,o){const i=n/1e3;return new u.WebAnimation({element:e,integrator:new Vt({durationSec:i}),lowerBound:0,upperBound:1,style:r=>s(Ne(t,r)),onComplete:o})}const Ze=(e={})=>{var o;const t=((o=e.border)==null?void 0:o.color)??Ue,n=Re,s=e.physics;return{prepare:({from:i,to:r,context:l})=>{const c=D(l,"from"),a=D(l,"to"),p=K(document.body,l.positionedParent),d=Be(t,{...c,top:p.top});for(const f of["topLeft","topRight","bottomLeft","bottomRight"])l.positionedParent.appendChild(d[f]);return i.then(f=>{ht(f,c),ut(f,c),f.style.transform=`translateY(${-c.top}px)`}),r.then(f=>{ht(f,a),ut(f,a),f.style.transform=`translateY(${-a.top+a.height}px) scale(${n})`}),{borders:d,fromRect:c,toRect:a}},animation:({from:i,to:r,context:l,borders:c,fromRect:a,toRect:p})=>{const d=yt({rect:a,scale:n,direction:"out",override:s}),f=yt({rect:p,scale:n,direction:"in",override:s}),m=z(i,d.snapshots,d.totalDuration,S=>({transform:`translateY(${S.translateY}px) scale(${S.scale})`}),()=>{i.style.clipPath="",i.style.transformOrigin="",i.style.transform=""}),y=z(r,f.snapshots,f.totalDuration,S=>({transform:`translateY(${S.translateY}px) scale(${S.scale})`}),()=>{r.style.clipPath="",r.style.transformOrigin="",r.style.transform=""}),h=Xe.map(([S,E],C)=>{const x=["topLeft","topRight","bottomLeft","bottomRight"][C];return z(c[x],d.snapshots,d.totalDuration,P=>{const A=(a.width-a.width*P.scale)/2*.7*S,L=(a.height-a.height*P.scale)/2*.7*E;return{transform:`translate(${A}px, ${L}px)`}})}),b=new u.MultiAnimation([m,y,...h],{mode:"parallel"}),w=b.onComplete;return b.onComplete=()=>{w==null||w();const S=l.positionedParent;for(const E of["topLeft","topRight","bottomLeft","bottomRight"]){const C=c[E];C.parentElement===S&&S.removeChild(C)}},b}}};function qe(e){const{paths:t,options:n}=e,s=(n==null?void 0:n.borderColor)!==void 0?{border:{color:n.borderColor}}:void 0;return _(t,()=>Ze(s))}const mt="data-hero-enter-key",gt="data-hero-exit-key",N="data-hero-key";class je{constructor(){$(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 Ke=()=>new je;class Ge{contribute(t){const{from:n,to:s,physics:o,onComplete:i}=t,r=n.style.opacity,l=s.style.opacity,c=n.style.willChange,a=s.style.willChange;return s.style.opacity="0",n.style.willChange="opacity",s.style.willChange="opacity",i(()=>{n.style.opacity=r,s.style.opacity=l,n.style.willChange=c,s.style.willChange=a}),[new u.WebAnimation({element:n,integrator:g.from(o),style:(p,d)=>({opacity:d})}),new u.WebAnimation({element:s,integrator:g.from(o),style:p=>({opacity:p})})]}}const Je=()=>new Ge,Qe={static:Ke,fade:Je},tn={spring:{stiffness:320,damping:30}},en=()=>tn,nn={spring:{stiffness:300,damping:30,doubleSpring:1}},sn=()=>nn,on={default:en,smooth:sn},rn=700,an="data-hero-aspect-ratio",ln="data-hero-radius";function cn(e){if(!e)return null;if(e.includes("/")){const[n,s]=e.split("/"),o=parseFloat(n??""),i=parseFloat(s??"");return!Number.isFinite(o)||!Number.isFinite(i)||o<=0||i<=0?null:o/i}const t=parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function bt(e){const t=e.getAttribute(ln);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function k(e){return e.left+e.width/2}function Y(e){return e.top+e.height/2}function pn(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 dn(e,t,n){const s=e.width/e.height;let o,i;return n==="contain"?s>t?(i=e.height,o=i*t):(o=e.width,i=o/t):s>t?(o=e.width,i=o/t):(i=e.height,o=i*t),{left:e.left+(e.width-o)/2,top:e.top+(e.height-i)/2,width:o,height:i}}function wt(e,t,n){const s=K(e,t),o=cn(t.getAttribute(an));if(o===null)return{bbox:s,content:s,window:s,clipInset:{top:0,right:0,bottom:0,left:0}};const i=dn(s,o,n),r=n==="cover"?s:i;return{bbox:s,content:i,window:r,clipInset:pn(i,r)}}function fn(e,t,n,s){const o=n.width/s,i=n.height/s,r=e.width/2+(k(n)-k(t))/s-o/2,l=e.height/2+(Y(n)-Y(t))/s-i/2;return{top:Math.max(0,l),right:Math.max(0,e.width-r-o),bottom:Math.max(0,e.height-l-i),left:Math.max(0,r)}}function T(e,t){const n=new Map,s=e.querySelectorAll(`[${t}]`);for(const o of Array.from(s)){const i=o.getAttribute(t);i&&(n.has(i)||n.set(i,o))}return n}function yn(e,t){const n=[],s=T(t,mt),o=T(e,gt);for(const[l,c]of s){const a=o.get(l);a&&n.push({key:l,fromEl:a,toEl:c,fromFit:"cover",toFit:"contain"})}const i=T(e,mt),r=T(t,gt);for(const[l,c]of i){const a=r.get(l);a&&n.push({key:l,fromEl:c,toEl:a,fromFit:"contain",toFit:"cover"})}return n}function hn(e,t){const n=[],s=Array.from(t.querySelectorAll(`[${N}]`));for(const o of s){const i=o.getAttribute(N);if(!i)continue;const r=e.querySelector(`[${N}="${i}"]`);r&&n.push({key:i,fromEl:r,toEl:o,fromFit:"contain",toFit:"contain"})}return n}function un(e,t){const n=yn(e,t);return n.length>0?n:hn(e,t)}function mn(e,t,n){const{fromEl:s,toEl:o}=t,i=wt(e,s,t.fromFit),r=wt(e,o,t.toFit),l=i.content,c=i.window,a=r.content,p=r.window,d=r.clipInset,f=bt(s),m=bt(o);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),h=k(l),b=Y(l),w=k(a),S=Y(a),E=h-w,C=b-S;if(Math.abs(C)>n)return null;const x=fn(a,l,c,y);return{toContent:a,hasRadius:f>0||m>0,styleFor:(P,A)=>{const L=A*E,Ot=A*C,G=P+A*y,It=(f*A+m*P)/G,Tt=x.top*A+d.top*P,vt=x.right*A+d.right*P,Ft=x.bottom*A+d.bottom*P,kt=x.left*A+d.left*P;return{transform:`translate(${L}px, ${Ot}px) scale(${G})`,clipPath:`inset(${Tt}px ${vt}px ${Ft}px ${kt}px round ${It}px)`}}}}function gn(e,t){e.style.transform=t.transform,e.style.clipPath=t.clipPath}class bn{contribute(t){const{resolved:n,physics:s,positionedParent:o,maxDistance:i,onComplete:r}=t,l=[];for(const c of n.pairs){const{fromEl:a,toEl:p}=c,d=mn(o,c,i);if(!d)continue;const f=p.cloneNode(!0);f.style.position="absolute",f.style.left=`${d.toContent.left}px`,f.style.top=`${d.toContent.top}px`,f.style.width=`${d.toContent.width}px`,f.style.height=`${d.toContent.height}px`,f.style.margin="0",f.style.transformOrigin="center center",f.style.zIndex="1000",f.style.willChange="transform, clip-path",f.style.pointerEvents="none",f.style.maxWidth="none",f.style.maxHeight="none",d.hasRadius&&(f.style.borderRadius="0"),gn(f,d.styleFor(0,1)),o.appendChild(f);const m=a.style.opacity,y=p.style.opacity;a.style.opacity="0",p.style.opacity="0",r(()=>{a.style.opacity=m,p.style.opacity=y,f.parentElement&&f.parentElement.removeChild(f)}),l.push(new u.WebAnimation({element:f,integrator:g.from(s),style:d.styleFor}))}return l}}function wn(e){return[new bn,Qe[e.type]()]}const Sn=e=>{const t=wn(e),n=on[e.variant](),s=rn;return{prepare:o=>{var l;const i=Promise.all([o.from,o.to]).then(([c,a])=>({pairs:un(c,a)})),r={from:o.from,to:o.to,resolved:i};for(const c of t)(l=c.prepare)==null||l.call(c,r);return i.then(c=>({resolved:c}))},animation:({from:o,to:i,context:r,resolved:l})=>{if(l.pairs.length===0)return new u.MultiAnimation([],{mode:"parallel"});const c=[],a=y=>{c.push(y)},p={from:o,to:i,resolved:l,physics:n,positionedParent:r.positionedParent,maxDistance:s,onComplete:a},d=[];for(const y of t)y.contribute&&d.push(...y.contribute(p));if(d.length===0)return new u.MultiAnimation([],{mode:"parallel"});const f=new u.MultiAnimation(d,{mode:"parallel"}),m=f.onComplete;return f.onComplete=()=>{m==null||m();for(const y of c)try{y()}catch(h){console.error("[hero] cleanup error",h)}},f}}};function $n(e){const{paths:t}=e,n=e.type??"static",s=e.variant??"default";return _(t,()=>Sn({type:n,variant:s}))}const Cn={spring:{stiffness:50,damping:30}},En={spring:{stiffness:80,damping:25}},xn=(e={})=>{const t=e.physics??Cn,n=e.initialRotation??45,s=e.initialScale??.01,o=e.rotationTriggerPoint??.8;return{prepare:({from:i,to:r,context:l})=>(i.then(c=>{c.style.opacity="1"}),r.then(c=>{const a=D(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 d=a.left+a.width/2,f=a.top+a.height/2;c.style.transformOrigin=`${d}px ${f}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(${s}) translateZ(0)`,c.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",c.style.opacity="1"}),{}),animation:({from:i,to:r})=>{const l=new u.WebAnimation({element:i,integrator:g.from(En),style:(a,p)=>({opacity:p}),onComplete:()=>{i.style.opacity=""}}),c=new u.WebAnimation({element:r,integrator:g.from(t),style:a=>{let p;if(a<=.05)p=s;else if(a<=o){const y=(a-.05)/(o-.05),h=Math.pow(y,9);p=s+(.8-s)*h}else{const y=(a-o)/(1-o);p=.8+.2*(1-Math.pow(1-y,3))}const d=.7;let f;if(a<=d)f=n;else{const y=(a-d)/(1-d),h=1-Math.pow(1-y,2);f=n*(1-h)}let m;if(a<=d)m=1;else{const y=(a-d)/(1-d);m=1-Math.pow(y,.5)}return{transform:`rotate(${f.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,"--border-radius-scale":m.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 u.MultiAnimation([l,c],{mode:"parallel"})}}};function An(e){const{paths:t}=e;return _(t,()=>xn())}const Pn={spring:{stiffness:100,damping:30}},_n=(e={})=>{const t=e.physics??Pn;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),s.then(o=>{o.style.opacity="0",o.style.transform="rotate(-180deg)",o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),{}),animation:({from:n,to:s})=>{const o=new u.WebAnimation({element:n,integrator:g.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=""}}),i=new u.WebAnimation({element:s,integrator:g.from(t),style:(r,l)=>({transform:`rotate(${-l*180}deg)`,opacity:r>.5?1:0}),onComplete:()=>{s.style.willChange="auto",s.style.transform="",s.style.transformOrigin="",s.style.opacity=""}});return new u.MultiAnimation([o,i],{mode:"parallel"})}}};function Dn(e){const{paths:t}=e;return _(t,()=>_n())}const On={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},St=(e={})=>{const t=e.direction??"up",n=e.physics??On,s=t==="up";return{prepare:({from:o,to:i})=>(o.then(r=>{r.style.zIndex=s?"-1":"1",r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}),animation:({from:o,to:i})=>{const r=o.offsetHeight,l=i.offsetHeight,c=window.innerHeight,a=Math.max(Math.min(r,l),c),p=new u.WebAnimation({element:o,integrator:g.from(n),style:f=>({transform:`translate3d(0, ${s?-a*f:a*f}px, 0)`}),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform="",o.style.pointerEvents="",o.style.zIndex=""}}),d=new u.WebAnimation({element:i,integrator:g.from(n),style:(f,m)=>({transform:`translate3d(0, ${s?m*a:m*-a}px, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new u.MultiAnimation([p,d],{mode:"parallel"})}}};function In(e){const{paths:t,type:n="directional"}=e;return n==="non-directional"?_(t,()=>St({direction:"up"})):j(t,{forward:"up",backward:"down"},s=>St({direction:s}))}const Tn={spring:{stiffness:200,damping:24}},vn={inertia:{acceleration:25,resistance:1.2}},X=.2;function Fn(){return{enterPhysics:Tn,exitPhysics:vn,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-X*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-X+X*e})`,opacity:e})}}}const kn={spring:{stiffness:300,damping:30}},Yn={inertia:{acceleration:30,resistance:1}};function Ln(){return{enterPhysics:kn,exitPhysics:Yn,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const Mn={static:Ln(),"background-scale":Fn()},Hn="static",Wn="transform",Rn=(e={})=>{const t=e.direction??"enter",n=Mn[e.type??Hn],s=t==="enter"?n.enterPhysics:n.exitPhysics,o=n.background,i=o.willChange!=="";return{prepare:({from:r,to:l})=>{const c=t==="enter"?l:r,a=t==="enter"?r:l;return c.then(p=>{p.style.willChange=Wn,p.style.backfaceVisibility="hidden",p.style.contain="layout paint",t==="exit"&&(p.style.pointerEvents="none",p.style.zIndex="100")}),a.then(p=>{i&&(p.style.willChange=o.willChange,p.style.backfaceVisibility="hidden",p.style.contain="layout paint"),t==="enter"&&(p.style.pointerEvents="none",p.style.zIndex="-1")}),{}},animation:({from:r,to:l,context:c})=>{const a=t==="enter"?l:r,p=t==="enter"?r:l,d=D(c,t==="enter"?"to":"from"),f=()=>{r.style.pointerEvents="",r.style.zIndex=""};a.style.clipPath=`inset(${d.top}px 0 calc(100% - ${d.top+d.height}px) 0)`;const m=t==="enter"?(C,x)=>({transform:`translate3d(0, ${x*d.height}px, 0)`}):C=>({transform:`translate3d(0, ${C*d.height}px, 0)`}),y=new u.WebAnimation({element:a,integrator:g.from(s),style:m,onComplete:()=>{a.style.willChange="auto",a.style.backfaceVisibility="",a.style.contain="",a.style.clipPath="",a.style.transform="",f()}});if(!i)return new u.MultiAnimation([y],{mode:"parallel"});const h=D(c,t==="enter"?"from":"to"),b=h.left+h.width/2,w=h.top+h.height/2;p.style.clipPath=`inset(${h.top}px 0 calc(100% - ${h.top+h.height}px) 0)`,p.style.transformOrigin=`${b}px ${w}px`;const S=t==="enter"?(C,x)=>o.enterStyle(C,x):C=>o.exitStyle(C),E=new u.WebAnimation({element:p,integrator:g.from(s),style:S,onComplete:t==="exit"?()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.contain="",p.style.clipPath="",p.style.transformOrigin=""}:()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.contain="",p.style.clipPath="",p.style.transformOrigin="",p.style.transform="",p.style.opacity=""}});return new u.MultiAnimation([y,E],{mode:"parallel"})}}};function Un(e){return e==="scale"||e==="background-scale"?"background-scale":"static"}function Vn(e){const{enter:t,exit:n}=e,s=e.type,o=Un(s);return At({enter:t,exit:n},i=>Rn({direction:i,type:o}))}const zn={spring:{stiffness:170,damping:22,doubleSpring:.8}},Nn=(e={})=>{const t=e.direction??"left",n=e.physics??zn,s=t==="left";return{prepare:({from:o,to:i})=>(o.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{const 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:o,to:i})=>{const r=new u.WebAnimation({element:o,integrator:g.from(n),style:c=>({transform:`translate3d(${s?-100*c:100*c}%, 0, 0)`}),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform="",o.style.pointerEvents=""}}),l=new u.WebAnimation({element:i,integrator:g.from(n),style:(c,a)=>({transform:`translate3d(${s?a*100:a*-100}%, 0, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new u.MultiAnimation([r,l],{mode:"parallel"})}}};function Xn(e){const{paths:t}=e;return j(t,{forward:"left",backward:"right"},n=>Nn({direction:n}))}const Bn={spring:{stiffness:17,damping:6}},B=20,v=800,Zn=(e={})=>{const t=e.physics??Bn;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.pointerEvents="none",o.style.transform=`perspective(${v}px) rotateY(0deg) translate3d(0%, 0, 0)`}),s.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.transform=`perspective(${v}px) rotateY(${B}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:s})=>{const o=new u.WebAnimation({element:n,integrator:g.from(t),style:r=>{const l=-r*B,c=r*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=""}}),i=new u.WebAnimation({element:s,integrator:g.from(t),style:(r,l)=>{const c=l*B,a=-l*100;return{transform:`perspective(${v}px) rotateY(${c}deg) translate3d(${a}%, 0, 0)`}},onComplete:()=>{s.style.transform="",s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain=""}});return new u.MultiAnimation([o,i],{mode:"sequence"})}}};function qn(e){const{paths:t}=e;return _(t,()=>Zn())}function jn({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const r=t.left-e.left+(t.width-e.width)/2-s.x,l=t.top-e.top+(t.height-e.height)/2-s.y,c=t.width/e.width,a=t.height/e.height,p=e.top/n.height*100,d=(n.width-(e.left+e.width))/n.width*100,f=(n.height-(e.top+e.height))/n.height*100,m=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:y=>{const h=1-y,b=1+(c-1)*h,w=1+(a-1)*h,E=(i*h+o*(1-h))/((b+w)/2);return{clipPath:`inset(${p*h}% ${d*h}% ${f*h}% ${m*h}% round ${E}px)`,transform:`translate(${r*h}px, ${l*h}px) scale(${b}, ${w})`}}}}function Kn({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const r=t.left-e.left+(t.width-e.width)/2+s.x,l=t.top-e.top+(t.height-e.height)/2+s.y,c=t.width/e.width,a=t.height/e.height,p=e.top/n.height*100,d=(n.width-(e.left+e.width))/n.width*100,f=(n.height-(e.top+e.height))/n.height*100,m=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:y=>{const h=1-y,b=1+(c-1)*h,w=1+(a-1)*h,E=(o*(1-h)+i*h)/((b+w)/2);return{clipPath:`inset(${p*h}% ${d*h}% ${f*h}% ${m*h}% round ${E}px)`,transform:`translate(${r*h-s.x}px, ${l*h}px) scale(${b}, ${w})`}}}}const Gn={spring:{stiffness:430,damping:33,doubleSpring:1}},_t=.12,Jn=18;function Qn(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-_t*t})`}}}}function ts(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-_t*t})`}}}}const Z={willChange:"backdrop-filter",initialStyle:{position:"absolute",inset:"0",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,s=`blur(${Jn*n}px)`;return{backdropFilter:s,WebkitBackdropFilter:s}}};class es{constructor(){$(this,"physics",Gn)}contribute(t){const{from:n,to:s,resolved:o,physics:i}=t,r=o.mode==="enter",l=r?n:s,c=r?Qn():ts();return c&&(l.style.transformOrigin=c.transformOrigin),[new u.WebAnimation({element:l,integrator:g.from(i),style:r?(a,p)=>c.animate(p):a=>c.animate(a)})]}}class ns{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,Z.initialStyle),n.style.willChange=Z.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;return n?(n.style.zIndex=t.resolved.mode==="enter"?"-1":"1",[new u.WebAnimation({element:n,integrator:g.from(t.physics),style:s=>Z.style(t.resolved.mode,s)})]):[]}}const ss={spring:{stiffness:430,damping:33,doubleSpring:1}};function os({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2+n.x,o=e.top-t.top+(e.height-t.height)/2+n.y,i=e.width/t.width,r=e.height/t.height,l=Math.max(i,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${s*a-n.x}px, ${o*a}px) scale(${1+(l-1)*a})`}}}}function is({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2-n.x,o=e.top-t.top+(e.height-t.height)/2-n.y,i=e.width/t.width,r=e.height/t.height,l=Math.max(i,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${s*a}px, ${o*a}px) scale(${1+(l-1)*a})`}}}}class rs{constructor(){$(this,"physics",ss)}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:r}=t,l=o.mode==="enter",c=l?n:s,a=l?os(i):is(i);return a&&(c.style.transformOrigin=a.transformOrigin),[new u.WebAnimation({element:c,integrator:g.from(r),style:l?(p,d)=>a.animate(d):p=>a.animate(p)})]}}const as={spring:{stiffness:530,damping:34,doubleSpring:1}};class ls{constructor(){$(this,"physics",as)}contribute(t){return[]}}const cs={expand:()=>new rs,static:()=>new ls,blur:()=>new es};function ps(e){return cs[e]()}const q="data-zoom-enter-key",$t="data-zoom-exit-key",ds="data-zoom-radius";function Ct(e){const t=e.getAttribute(ds);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function fs(e,t){const n=[];let s=t;for(;s&&s!==e;){const o=s.parentElement;if(!o)break;for(const i of Array.from(o.children))i!==s&&i instanceof HTMLElement&&n.push(i);s=o}return n}function Et(e){const t=e.querySelectorAll(`[${q}]`);return t.length!==1?null:t[0]}function xt(e,t){const n=e.querySelectorAll(`[${$t}]`);for(const s of n)if(s.getAttribute($t)===t)return s;return null}function ys(e,t){const n=Et(e),s=Et(t);if(!n&&s){const o=s.getAttribute(q);if(!o)return null;const i=xt(e,o);return i?{mode:"enter",enterEl:s,exitEl:i}:null}if(n&&!s){const o=n.getAttribute(q);if(!o)return null;const i=xt(t,o);return i?{mode:"exit",enterEl:n,exitEl:i}:null}return null}function hs(e,t,n,s){return{enterRect:J(e.mode==="enter"?n:t,e.enterEl),exitRect:J(e.mode==="enter"?t:n,e.exitEl),pageRect:e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),scrollOffset:s,enterRadius:Ct(e.enterEl),exitRadius:Ct(e.exitEl)}}class us{prepare(t){t.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:r,onComplete:l}=t,c=o.mode==="enter",a=c?jn(i):Kn(i),p=c?s:n,d=c?"t":"u";a&&(p.style.transformOrigin=a.transformOrigin);const f=c?"-2":"2",m=n.style.zIndex;return n.style.zIndex=f,l(()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.transformOrigin="",p.style.contain="",n.style.zIndex=m,n.style.willChange="auto",n.style.backfaceVisibility="",n.style.transformOrigin="",n.style.contain="",n.style.transform="",n.style.clipPath=""}),[new u.WebAnimation({element:p,integrator:g.from(r),style:d==="t"?y=>a.animate(y):(y,h)=>a.animate(h)})]}}class ms{contribute(t){const{resolved:n,physics:s,from:o,to:i,onComplete:r}=t,l=n.mode==="enter"?i:o,c=fs(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 d=c[p];d&&(d.style.opacity=a[p]??"")}}),c.map(p=>new u.WebAnimation({element:p,integrator:g.from(s),style:(d,f)=>({opacity:n.mode==="enter"?d:f})}))}}class Dt{contribute(){return[]}}const gs={default:()=>new Dt,fade:()=>new ms};function bs(e){return gs[e]()}class ws extends Dt{}function Ss(e){const t=ps(e.type);return{strategies:[new us,t,bs(e.variant),new ws,...e.type==="blur"?[new ns]:[]],physics:t.physics}}const $s=e=>{const{strategies:t,physics:n}=Ss(e);return{prepare:s=>{const o={from:s.from,to:s.to,context:{positionedParent:s.context.positionedParent},createElement:s.createElement},i={};for(const r of t){if(!r.prepare)continue;const l=r.prepare(o);l&&Object.assign(i,l)}return i},animation:({from:s,to:o,context:i,...r})=>{const l=ys(s,o);if(!l)return new u.MultiAnimation([],{mode:"parallel"});const c=hs(l,s,o,i.scrollOffset),a=[],d={from:s,to:o,resolved:l,input:c,physics:n,extras:r,onComplete:y=>{a.push(y)}},f=[];for(const y of t)y.contribute&&f.push(...y.contribute(d));const m=f[0];if(m){const y=m.onComplete;m.onComplete=()=>{y==null||y();for(const h of a)try{h()}catch(b){console.error("[zoom] cleanup error",b)}}}for(const y of f){if(!(y instanceof u.WebAnimation))continue;const h=y.onComplete;y.onComplete=()=>{h==null||h(),y.releaseFill()}}return new u.MultiAnimation(f,{mode:"parallel"})}}};function Cs(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function Es(e){const t=Cs(e);return _(e.paths,()=>$s(t))}exports.Animation=u.Animation;exports.MultiAnimation=u.MultiAnimation;exports.WebAnimation=u.WebAnimation;exports.axis=be;exports.blind=xe;exports.drill=Ye;exports.fade=We;exports.film=qe;exports.hero=$n;exports.jaemin=An;exports.rotate=Dn;exports.scroll=In;exports.sheet=Vn;exports.slide=Xn;exports.strip=qn;exports.zoom=Es;
|