{"version":3,"file":"ToastMessage.DxR2axSO.mjs","names":[],"sources":["https:/framerusercontent.com/modules/8yBHxwFkO9PuVhGCPaj8/eqqHk9m3xa5fB2MdAMLH/ToastMessage.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{createPortal}from\"react-dom\";import{AnimatePresence,motion}from\"framer-motion\";// EVENT REGISTRY (Unchanged Logic)\nexport const toastEvents={open:null,set(fn){this.open=fn;}};// Modern Spring Physics\nconst transition={type:\"spring\",stiffness:500,damping:30,mass:1};// --- Icons ---\nconst CheckIcon=()=>/*#__PURE__*/_jsx(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M20 6L9 17L4 12\",stroke:\"currentColor\",strokeWidth:\"2.5\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})});const ErrorIcon=()=>/*#__PURE__*/_jsxs(\"svg\",{width:\"20\",height:\"20\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:[/*#__PURE__*/_jsx(\"circle\",{cx:\"12\",cy:\"12\",r:\"10\",stroke:\"currentColor\",strokeWidth:\"2\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M12 8V12\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M12 16H12.01\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\"})]});export function withToast(Component){return props=>{const[visible,setVisible]=useState(false);const[toastData,setToastData]=useState({message:\"\",type:\"success\"});useEffect(()=>{toastEvents.set(payload=>{if(payload)setToastData(payload);setVisible(true);// Auto hide in 3 seconds\nconst timer=setTimeout(()=>setVisible(false),3e3);return()=>clearTimeout(timer);});},[]);const isSuccess=toastData.type!==\"error\";return /*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx(AnimatePresence,{children:visible&&/*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0,y:-20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-20,scale:.95},transition:transition,style:{position:\"fixed\",top:\"64px\",left:0,right:0,display:\"flex\",justifyContent:\"center\",zIndex:99999,pointerEvents:\"none\"},children:/*#__PURE__*/_jsxs(motion.div,{style:{pointerEvents:\"auto\",display:\"flex\",alignItems:\"center\",gap:\"12px\",// 1. Increased opacity slightly to prevent background bleeding too much\nbackground:\"rgba(255, 255, 255, 0.95)\",backdropFilter:\"blur(16px)\",WebkitBackdropFilter:\"blur(16px)\",padding:\"10px 20px 10px 16px\",borderRadius:\"99px\",// --- THE FIX IS HERE ---\n// Old Border: rgba(0,0,0,0.05) -> Invisible\n// New Border: rgba(0,0,0,0.15) -> Crisp grey outline\n// New Shadow: slightly stronger drop shadow for \"lift\"\nboxShadow:\"0 10px 40px -10px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.15)\",maxWidth:\"90vw\",minWidth:\"300px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"32px\",height:\"32px\",borderRadius:\"50%\",flexShrink:0,background:isSuccess?\"#DCFCE7\":\"#FEE2E2\",color:isSuccess?\"#16A34A\":\"#DC2626\"},children:isSuccess?/*#__PURE__*/_jsx(CheckIcon,{}):/*#__PURE__*/_jsx(ErrorIcon,{})}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontSize:\"14px\",fontWeight:600,color:\"#1F2937\",fontFamily:\"'Inter', sans-serif\",lineHeight:\"1.2\"},children:isSuccess?\"Success\":\"Error\"}),/*#__PURE__*/_jsx(\"span\",{style:{fontSize:\"13px\",fontWeight:400,color:\"#6B7280\",fontFamily:\"'Inter', sans-serif\",marginTop:\"2px\"},children:toastData.message})]})]})}),document.body)})})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"toastEvents\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withToast\":{\"type\":\"reactHoc\",\"name\":\"withToast\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ToastMessage.map"],"mappings":"wKAA+E,IAAsC,IAAoC,IAAkD,CAC9L,EAAY,CAAC,KAAK,KAAK,IAAI,EAAG,CAAC,KAAK,KAAK,GAAK"}