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