import{O as M,n as U,B as z,R as B,al as L,bU as W,J as q,K,M as P,aY as j,bh as G,bb as F,bZ as R}from"./W1VwgJDT.mjs";import{k as J}from"./CCT7NDl_.mjs";const Y=()=>performance.now(),$={tick:a=>requestAnimationFrame(a),now:()=>Y(),tasks:new Set};function S(){const a=$.now();$.tasks.forEach(r=>{r.c(a)||($.tasks.delete(r),r.f())}),$.tasks.size!==0&&$.tick(S)}function Z(a){let r;return $.tasks.size===0&&$.tick(S),{promise:new Promise(t=>{$.tasks.add(r={c:a,f:t})}),abort(){$.tasks.delete(r)}}}function N(a,r){R(()=>{a.dispatchEvent(new CustomEvent(r))})}function D(a){if(a==="float")return"cssFloat";if(a==="offset")return"cssOffset";if(a.startsWith("--"))return a;const r=a.split("-");return r.length===1?r[0]:r[0]+r.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function I(a){const r={},t=a.split(";");for(const s of t){const[v,e]=s.split(":");if(!v||e===void 0)break;const w=D(v.trim());r[w]=e.trim()}return r}const H=a=>a;function rr(a,r,t,s){var m,g;var v=(a&K)!==0,e=(a&P)!==0,w=v&&e,u=(a&q)!==0,y=w?"both":v?"in":"out",f,p=r.inert,l=r.style.overflow,o,n;function b(){return R(()=>{var c;return f!=null?f:f=t()(r,(c=s==null?void 0:s())!=null?c:{},{direction:y})})}var h={is_global:u,in(){var c;if(r.inert=p,!v){n==null||n.abort(),(c=n==null?void 0:n.reset)==null||c.call(n);return}e||o==null||o.abort(),o=A(r,b(),n,1,()=>{N(r,"introstart")},()=>{N(r,"introend"),o==null||o.abort(),o=f=void 0,r.style.overflow=l})},out(c){if(!e){c==null||c(),f=void 0;return}r.inert=!0,n=A(r,b(),o,0,()=>{N(r,"outrostart")},()=>{N(r,"outroend"),c==null||c()})},stop:()=>{o==null||o.abort(),n==null||n.abort()}},d=M;if(((g=(m=d.nodes).t)!=null?g:m.t=[]).push(h),v&&J){var i=u;if(!i){for(var _=d.parent;_&&(_.f&U)!==0;)for(;(_=_.parent)&&(_.f&z)===0;);i=!_||(_.f&B)!==0}i&&L(()=>{W(()=>h.in())})}}function A(a,r,t,s,v,e){var w=s===1;if(j(r)){var u,y=!1;return G(()=>{if(!y){var i=r({direction:w?"in":"out"});u=A(a,i,t,s,v,e)}}),{abort:()=>{y=!0,u==null||u.abort()},deactivate:()=>u.deactivate(),reset:()=>u.reset(),t:()=>u.t()}}if(t==null||t.deactivate(),!(r!=null&&r.duration)&&!(r!=null&&r.delay))return v(),e(),{abort:F,deactivate:F,reset:F,t:()=>s};const{delay:f=0,css:p,tick:l,easing:o=H}=r;var n=[];if(w&&t===void 0&&(l&&l(0,1),p)){var b=I(p(0,1));n.push(b,b)}var h=()=>1-s,d=a.animate(n,{duration:f,fill:"forwards"});return d.onfinish=()=>{var C;d.cancel(),v();var i=(C=t==null?void 0:t.t())!=null?C:1-s;t==null||t.abort();var _=s-i,m=r.duration*Math.abs(_),g=[];if(m>0){var c=!1;if(p)for(var E=Math.ceil(m/16.666666666666668),k=0;k<=E;k+=1){var O=i+_*o(k/E),x=I(p(O,1-O));g.push(x),c||(c=x.overflow==="hidden")}c&&(a.style.overflow="hidden"),h=()=>{var T=d.currentTime;return i+_*o(T/m)},l&&Z(()=>{if(d.playState!=="running")return!1;var T=h();return l(T,1-T),!0})}d=a.animate(g,{duration:m,fill:"forwards"}),d.onfinish=()=>{h=()=>s,l==null||l(s,1-s),e()}},{abort:()=>{d&&(d.cancel(),d.effect=null,d.onfinish=F)},deactivate:()=>{e=F},reset:()=>{s===0&&(l==null||l(1,0))},t:()=>h()}}function Q(a){const r=a-1;return r*r*r+1}function ar(a,{delay:r=0,duration:t=400,easing:s=Q,axis:v="y"}={}){const e=getComputedStyle(a),w=+e.opacity,u=v==="y"?"height":"width",y=parseFloat(e[u]),f=v==="y"?["top","bottom"]:["left","right"],p=f.map(i=>`${i[0].toUpperCase()}${i.slice(1)}`),l=parseFloat(e[`padding${p[0]}`]),o=parseFloat(e[`padding${p[1]}`]),n=parseFloat(e[`margin${p[0]}`]),b=parseFloat(e[`margin${p[1]}`]),h=parseFloat(e[`border${p[0]}Width`]),d=parseFloat(e[`border${p[1]}Width`]);return{delay:r,duration:t,easing:s,css:i=>`overflow: hidden;opacity: ${Math.min(i*20,1)*w};${u}: ${i*y}px;padding-${f[0]}: ${i*l}px;padding-${f[1]}: ${i*o}px;margin-${f[0]}: ${i*n}px;margin-${f[1]}: ${i*b}px;border-${f[0]}-width: ${i*h}px;border-${f[1]}-width: ${i*d}px;min-${u}: 0`}}export{ar as s,rr as t};
