"use client"
import{a as f}from"./chunk-IJQZZYOI.mjs";import{l as s}from"./chunk-N5W2RDOL.mjs";import{cva as v}from"class-variance-authority";import{createContext as C,useContext as x,useEffect as g,useRef as h,useState as b}from"react";import{jsx as i}from"react/jsx-runtime";var L=v("w-full group/card border-gray-200 bg-white",{variants:{variant:{compact:"first-of-type:rounded-t-xl last-of-type:rounded-b-xl first-of-type:border-t border-b border-x hover:bg-gray-50 transition-colors",loose:"border rounded-xl transition-[filter] hover:[filter:drop-shadow(0_8px_12px_#222A350d)_drop-shadow(0_32px_80px_#2f30370f)]"}}}),y="w-full py-2.5 px-4",E=C({hovered:!1});function M({outerClassName:c,innerClassName:u,children:p,onClick:d}){let{variant:m}=x(f),t=h(null),[o,a]=b(!1);return g(()=>{if(!o||!t.current)return;let r=setInterval(()=>{var n;((n=t.current)==null?void 0:n.matches(":hover"))===!1&&a(!1)},1e3);return()=>clearInterval(r)},[o]),i("li",{ref:t,className:s(L({variant:m}),c),onPointerEnter:()=>a(!0),onPointerLeave:()=>a(!1),children:i("div",{className:s(y,u),onClick:d?r=>{if(!document.getElementById("modal-backdrop")){for(let e=r.target,l=0;e&&e!==r.currentTarget&&l<100;e=e.parentElement,l++)if(["button","a","input","textarea"].includes(e.tagName.toLowerCase()))return;d()}}:void 0,children:i(E.Provider,{value:{hovered:o},children:p})})})}export{E as a,M as b};
