function n(n,e,o){return new Promise((i=>{if((null==o?void 0:o.duration)===1/0)throw new Error("Promise-based animations must be finite.");const r=n.animate(e,{...o,duration:window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:o.duration});r.addEventListener("cancel",i,{once:!0}),r.addEventListener("finish",i,{once:!0})}))}function e(n){var e;return Promise.all(((null===(e=null==n?void 0:n.getAnimations)||void 0===e?void 0:e.call(n))||[]).map((n=>new Promise((e=>{const o=requestAnimationFrame(e);n.addEventListener("cancel",(()=>o),{once:!0}),n.addEventListener("finish",(()=>o),{once:!0}),n.cancel()})))))}function o(n,e){return n.map((n=>({...n,height:"auto"===n.height?`${e}px`:n.height})))}const i=new Map,r=new WeakMap;function t(n,e){i.set(n,function(n){return null!=n?n:{keyframes:[],options:{duration:0}}}(e))}function s(n,e){const o=r.get(n);if(null==o?void 0:o[e])return o[e];return i.get(e)||{keyframes:[],options:{duration:0}}}export{n as a,t as b,o as c,s as g,e as s}