import{B as f}from"#entry";function y(n){const i=new f(n),o=getComputedStyle(n),t=o.transform;if(t){let e,r,s,a,m;if(t.startsWith("matrix3d("))e=t.slice(9,-1).split(/, /),r=Number(e[0]),s=Number(e[5]),a=Number(e[12]),m=Number(e[13]);else if(t.startsWith("matrix("))e=t.slice(7,-1).split(/, /),r=Number(e[0]),s=Number(e[3]),a=Number(e[4]),m=Number(e[5]);else return new f(i);const u=o.transformOrigin,h=i.x-a-(1-r)*parseFloat(u),c=i.y-m-(1-s)*parseFloat(u.slice(u.indexOf(" ")+1)),d=r?i.width/r:n.offsetWidth+1,l=s?i.height/s:n.offsetHeight+1;return new f({x:h,y:c,width:d,height:l})}else return new f(i)}function p(n,i,o){if(typeof n.animate>"u")return{finished:Promise.resolve()};let t;try{t=n.animate(i,o)}catch{return{finished:Promise.resolve()}}return typeof t.finished>"u"&&(t.finished=new Promise(e=>{t.onfinish=()=>{e(t)}})),t}export{p as a,y as n};
