import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{ki as t}from"./lucide-icons-BjbcRgLk.js";var n=e(t(),1),r={feed:`feed`,play:`play`,clean:`clean`,medicine:`medicate`,boost:`feed`},i={feed:{primary:1800},medicate:{primary:1800},play:{primary:2e3},clean:{primary:1500},clean_complete:{primary:1200,secondary:1500},social_hearts:{primary:2500}};function a(e,t){switch(e){case`feed`:return{type:e,phase:t,emotion:`blissful`,bodyAnimation:`animate-reaction-wiggle`,sparkles:!1,bubbles:!1,hearts:!1};case`medicate`:return{type:e,phase:t,emotion:`adoring`,bodyAnimation:null,sparkles:!1,bubbles:!1,hearts:!1};case`play`:return{type:e,phase:t,emotion:`excited`,bodyAnimation:`animate-reaction-bounce`,sparkles:!1,bubbles:!1,hearts:!1};case`clean`:return{type:e,phase:t,emotion:null,bodyAnimation:null,sparkles:!0,bubbles:!1,hearts:!1};case`clean_complete`:return t===`primary`?{type:e,phase:t,emotion:null,bodyAnimation:null,sparkles:!1,bubbles:!0,hearts:!1}:{type:e,phase:t,emotion:`blissful`,bodyAnimation:null,sparkles:!0,bubbles:!1,hearts:!1};case`social_hearts`:return{type:e,phase:t,emotion:null,bodyAnimation:null,sparkles:!1,bubbles:!1,hearts:!0}}}var o={emotionOverride:null,bodyAnimation:null,sparkles:!1,bubbles:!1,hearts:!1,isActive:!1};function s(){let[e,t]=(0,n.useState)(null),r=(0,n.useRef)(null),s=(0,n.useCallback)(()=>{r.current!==null&&(clearTimeout(r.current),r.current=null)},[]),c=(0,n.useCallback)((e,n,o)=>{s(),r.current=setTimeout(()=>{let o=i[e];n===`primary`&&o.secondary!==void 0?(t(a(e,`secondary`)),r.current=setTimeout(()=>{t(null),r.current=null},o.secondary)):(t(null),r.current=null)},o)},[s]),l=(0,n.useCallback)(e=>{s();let n=a(e,`primary`);t(n);let r=i[e];c(e,`primary`,r.primary)},[s,c]);return{state:e?{emotionOverride:e.emotion,bodyAnimation:e.bodyAnimation,sparkles:e.sparkles,bubbles:e.bubbles,hearts:e.hearts,isActive:!0}:o,trigger:l}}export{s as n,r as t};