'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("@gem-sdk/core"),s=require("./icons/CloseIcon.js");const g=t.forwardRef((g,i)=>{let{style:a,className:o,duration:n=4.5,eventKey:p,content:u,closable:c,props:l,type:d,onClick:f,onNoticeClose:x}=g,[b,h]=t.useState(!1),w=t.useRef(),m=t.useCallback(()=>{x?.(p)},[x,p]);return t.useEffect(()=>{!b&&n&&(w.current=setTimeout(()=>{m()},1e3*n));let e=w.current;return()=>{e&&clearTimeout(e)}},[n,b,m]),e.jsxs("div",{"aria-hidden":!0,...l,ref:i,className:r.cls("gp-flex gp-gap-2 gp-rounded gp-px-4 gp-py-2 gp-shadow-md",{"gp-bg-g-info gp-text-white":"info"===d,"gp-bg-g-success gp-text-white":"success"===d,"gp-bg-g-error gp-text-white":"error"===d,"gp-bg-g-warning gp-text-white":"warning"===d,"gp-bg-white gp-text-black":"default"===d||!d},o),style:a,onMouseEnter:()=>{h(!0)},onMouseLeave:()=>{h(!1)},onClick:f,children:[e.jsx("div",{children:u}),c&&e.jsx("button",{tabIndex:0,onClick:e=>{e.preventDefault(),e.stopPropagation(),m()},children:e.jsx(s.default,{className:"gp-w-4"})})]})});g.displayName="Notify",exports.default=g;
