import{o as e}from"./rolldown-runtime-iuO8RvI4.js";import{t as r}from"./preload-helper-DxVatP6Z.js";import{Mi as s,ki as t}from"./vendor-frame-CwiylG4Y.js";import{bt as a}from"./shared-frame-DbQbH4Yr.js";import{Hd as n}from"./shared-4-6CEyRAHb.js";import{b as o}from"./shared-10-DEXHYEQf.js";var i=e(s()),l=t(),c=new Set(["entrance","exit","tickle"]),m=(0,i.memo)(({size:e=32,state:s,color:t="var(--cds-clay, #d97757)",className:m})=>{const f=(0,i.useRef)(null),[d,p]=(0,i.useState)(null),u=o();(0,i.useEffect)(()=>{if(u||d)return;let e=!0;return r(()=>import("./cf2613ee5-S-oybV1-.js").then(r=>{e&&r&&p(r.animations)}),[]).catch(()=>{}),()=>{e=!1}},[u,d]);const h=!u&&d?d[s]:null;if((0,i.useEffect)(()=>{const e=f.current;if(!h||!e||"function"!=typeof e.animate)return;const{frameCount:r,speed:t}=h,a=Array.from({length:r},(e,s)=>({transform:`translateY(-${s*(100/r)}%)`})),n=e.animate(a,{duration:t*r,iterations:c.has(s)?1:1/0,easing:`steps(${r}, jump-none)`,fill:"forwards"});return()=>n.cancel()},[h,s]),!h)return(0,l.jsx)(n,{size:e,color:t,className:m});const{svg:j,width:g,height:v}=h;return(0,l.jsx)("span",{"data-cds":"Spark","aria-hidden":!0,className:a("inline-block overflow-hidden select-none","[@media(max-resolution:1.99dppx)]:[clip-path:inset(1px_0)]",m),style:{width:e,aspectRatio:g/v,color:t},children:(0,l.jsx)("span",{ref:f,className:"block [&>svg]:block [&>svg]:w-full [&>svg]:fill-current",dangerouslySetInnerHTML:{__html:j}})})});export{m as SparkAnimated};