const t=async(t,n,e="animate__")=>{n=Array.isArray(n)?n:[n];const a=n=>new Promise((a=>{if(t){const i=`${e}${n.value}`;t.classList.value=t.classList.value.split(" ").filter((t=>!t.includes(e))).join(" ");const s=n=>{null==n||n.stopPropagation(),t.classList.remove(`${e}animated`,i),t.removeEventListener("animationend",s),a("animation end")};(()=>{t.style.setProperty("--animate-duration",`${n.duration}s`),t.style.setProperty("animation-delay",`${n.delay}s`),t.style.setProperty("animation-iteration-count",`${n.infinite?"infinite":n.count}`),null==t||t.classList.add(`${e}animated`,i)})(),null==t||t.addEventListener("animationend",s,{once:!0})}else a("动画执行失败!执行动画元素不存在!")}));for(const i of n)await a(i)};export{t as u};