{"version":3,"file":"Toaster.B3C9BwpP.mjs","names":["useState","useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/BenGd2lxVuOITZcYkwG0/mpSvds7Ww6QTJ7OssQaj/Toaster.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect,useRef}from\"react\";import{createPortal}from\"react-dom\";import{AnimatePresence,motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";import{dismissToast,showQueuedToast,useToastStore}from\"https://framer.com/m/GlobalStore-5Rjw.js\";// ============================================================================\n// TOAST CARD COMPONENT\n// ============================================================================\nfunction ToastCard({toast,index,total,isHovered,gap,toastWidth,borderRadius,fontFamily,expandDirection,successColor,errorColor,warningColor,infoColor,titleSize,messageSize,padding}){useEffect(()=>{if(toast.duration>0){const timer=setTimeout(()=>{dismissToast(toast.id);},toast.duration);return()=>clearTimeout(timer);}},[toast.id,toast.duration]);const colorMap={success:successColor,error:errorColor,warning:warningColor,info:infoColor};const bgColor=colorMap[toast.type]||infoColor;const toastHeight=70;const collapsedOffset=index*10;const expandedOffset=index*(toastHeight+gap);const stackOffset=isHovered?expandedOffset:collapsedOffset;const stackScale=isHovered?1:1-index*.03;const stackOpacity=isHovered?1:1-index*.15;const isUp=expandDirection===\"up\";const yOffset=isUp?-stackOffset:stackOffset;const initialY=isUp?60:-60;const exitY=isUp?60:-60;return /*#__PURE__*/_jsxs(motion.div,{layout:true,initial:{opacity:0,y:initialY,scale:.9},animate:{opacity:Math.max(.5,stackOpacity),y:yOffset,scale:Math.max(.94,stackScale)},exit:{opacity:0,y:exitY,scale:.9},transition:{type:\"spring\",stiffness:400,damping:30},onClick:()=>dismissToast(toast.id),style:{position:\"absolute\",top:isUp?undefined:0,bottom:isUp?0:undefined,left:0,width:toastWidth??\"100%\",backgroundColor:bgColor,borderRadius:borderRadius,padding:padding,cursor:\"pointer\",boxShadow:\"0 4px 12px rgba(0, 0, 0, 0.15)\",zIndex:total-index,transformOrigin:isUp?\"bottom center\":\"top center\",display:\"flex\",alignItems:\"flex-start\",gap:12,boxSizing:\"border-box\",pointerEvents:\"auto\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{width:20,height:20,borderRadius:\"50%\",backgroundColor:\"rgba(255, 255, 255, 0.2)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",fontSize:14,fontWeight:500,color:\"#fff\",flexShrink:0},children:\"\\xd7\"}),/*#__PURE__*/_jsxs(\"div\",{style:{flex:1,minWidth:0},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:fontFamily,fontSize:titleSize,fontWeight:600,color:\"#fff\",marginBottom:toast.message?2:0},children:toast.title}),toast.message&&/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:fontFamily,fontSize:messageSize,color:\"rgba(255, 255, 255, 0.85)\",lineHeight:1.4},children:toast.message})]})]});}// ============================================================================\n// MOBILE DETECTION HOOK\n// ============================================================================\nfunction useIsMobile(breakpoint=768){const[isMobile,setIsMobile]=useState(typeof window!==\"undefined\"?window.innerWidth<=breakpoint:false);useEffect(()=>{if(typeof window===\"undefined\")return;const mq=window.matchMedia(`(max-width: ${breakpoint}px)`);const handler=e=>setIsMobile(e.matches);setIsMobile(mq.matches);mq.addEventListener(\"change\",handler);return()=>mq.removeEventListener(\"change\",handler);},[breakpoint]);return isMobile;}// ============================================================================\n// TOASTER COMPONENT\n// ============================================================================\nexport default function Toaster({toastWidth=320,maxVisible=3,gap=8,expandDirection=\"up\",borderRadius=10,padding=14,fontFamily=\"Inter, system-ui, sans-serif\",titleSize=14,messageSize=13,successColor=\"#10B981\",errorColor=\"#EF4444\",warningColor=\"#F59E0B\",infoColor=\"#3B82F6\",topOffset=75,rightOffset=15,mobileMargin=12,mobileTopOffset=16,mobileBorderRadius=16,mobilePadding=16}){const[state]=useToastStore();const[isHovered,setIsHovered]=useState(false);const hoverTimeoutRef=useRef(null);const isMobile=useIsMobile();const visibleToasts=state.toasts.slice(-maxVisible);const hasToasts=visibleToasts.length>0;useEffect(()=>{showQueuedToast();},[]);const handleMouseEnter=()=>{if(hoverTimeoutRef.current){clearTimeout(hoverTimeoutRef.current);hoverTimeoutRef.current=null;}setIsHovered(true);};const handleMouseLeave=()=>{hoverTimeoutRef.current=setTimeout(()=>{setIsHovered(false);},100);};useEffect(()=>{return()=>{if(hoverTimeoutRef.current){clearTimeout(hoverTimeoutRef.current);}};},[]);// Mobile: full-width, from top, iOS-style\n// Desktop: fixed width, positioned top-right\nconst containerStyle=isMobile?{position:\"fixed\",top:mobileTopOffset,left:mobileMargin,right:mobileMargin,zIndex:1e4,pointerEvents:\"auto\"}:{position:\"fixed\",top:topOffset,right:rightOffset,width:toastWidth,height:70,zIndex:1e4,pointerEvents:\"auto\"};const effectiveWidth=isMobile?undefined:toastWidth;const effectiveBorderRadius=isMobile?mobileBorderRadius:borderRadius;const effectivePadding=isMobile?mobilePadding:padding;// On mobile, always slide down from top\nconst effectiveExpandDirection=isMobile?\"down\":expandDirection;const toastContainer=hasToasts&&typeof document!==\"undefined\"?/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(\"div\",{style:containerStyle,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,children:/*#__PURE__*/_jsx(AnimatePresence,{mode:\"popLayout\",children:visibleToasts.map((toast,index)=>/*#__PURE__*/_jsx(ToastCard,{toast:toast,index:visibleToasts.length-1-index,total:visibleToasts.length,isHovered:isHovered,gap:gap,toastWidth:effectiveWidth,borderRadius:effectiveBorderRadius,fontFamily:fontFamily,expandDirection:effectiveExpandDirection,successColor:successColor,errorColor:errorColor,warningColor:warningColor,infoColor:infoColor,titleSize:titleSize,messageSize:messageSize,padding:effectivePadding},toast.id))})}),document.body):null;return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:toastWidth,height:70,pointerEvents:\"none\"}}),toastContainer]});}addPropertyControls(Toaster,{expandDirection:{type:ControlType.Enum,title:\"Expand Direction\",options:[\"up\",\"down\"],optionTitles:[\"Up (for bottom)\",\"Down (for top)\"],defaultValue:\"up\"},topOffset:{type:ControlType.Number,title:\"Top Offset\",defaultValue:75,min:0,max:200,step:5},rightOffset:{type:ControlType.Number,title:\"Right Offset\",defaultValue:15,min:0,max:200,step:5},toastWidth:{type:ControlType.Number,title:\"Width\",defaultValue:320,min:250,max:450,step:10},maxVisible:{type:ControlType.Number,title:\"Max Visible\",defaultValue:3,min:1,max:5},gap:{type:ControlType.Number,title:\"Expanded Gap\",defaultValue:8,min:4,max:20},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:10,min:0,max:24},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:14,min:8,max:24},fontFamily:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Inter, system-ui, sans-serif\"},titleSize:{type:ControlType.Number,title:\"Title Size\",defaultValue:14,min:12,max:20},messageSize:{type:ControlType.Number,title:\"Message Size\",defaultValue:13,min:11,max:18},successColor:{type:ControlType.Color,title:\"Success Color\",defaultValue:\"#10B981\"},errorColor:{type:ControlType.Color,title:\"Error Color\",defaultValue:\"#EF4444\"},warningColor:{type:ControlType.Color,title:\"Warning Color\",defaultValue:\"#F59E0B\"},infoColor:{type:ControlType.Color,title:\"Info Color\",defaultValue:\"#3B82F6\"},mobileMargin:{type:ControlType.Number,title:\"Mobile Margin\",defaultValue:12,min:0,max:32,step:2},mobileTopOffset:{type:ControlType.Number,title:\"Mobile Top Offset\",defaultValue:16,min:0,max:80,step:2},mobileBorderRadius:{type:ControlType.Number,title:\"Mobile Radius\",defaultValue:16,min:0,max:24},mobilePadding:{type:ControlType.Number,title:\"Mobile Padding\",defaultValue:16,min:8,max:24}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Toaster\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Toaster.map"],"mappings":"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