{"version":3,"file":"ToastDisplay.C1hPyLU2.mjs","names":["React.useState","p"],"sources":["https:/framerusercontent.com/modules/AD1Xrb7wDNwKUt3ye4Vl/vpTYLtAjtgHCB5vRLhuG/ToastDisplay.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls}from\"framer\";export function GlobalToaster(){const[toasts,setToasts]=React.useState([]);// --- LISTENER ---\nReact.useEffect(()=>{const handleMessage=event=>{// Listen for \"SHOW_TOAST\" from Next.js (Sidebar) or other Framer components\nif(event.data&&event.data.type===\"SHOW_TOAST\"){const{message,toastType,data}=event.data.payload;addToast(message,toastType,data);}};window.addEventListener(\"message\",handleMessage);return()=>window.removeEventListener(\"message\",handleMessage);},[]);const addToast=(message,type,data)=>{const id=Date.now();setToasts(prev=>[...prev,{id,message,type,data}]);// Duration: 6s for Quests, 3s for others\nconst duration=type===\"quest\"?6e3:3e3;setTimeout(()=>{setToasts(prev=>prev.filter(t=>t.id!==id));},duration);};// --- RENDER HELPERS ---\nconst getHeaderColor=type=>{if(type===\"quest\")return\"#d97706\"// Gold\n;if(type===\"error\")return\"#ef4444\"// Red\n;if(type===\"success\")return\"#16a34a\"// Green\n;return\"#000080\"// Blue (Info)\n;};const getIcon=name=>{if(!name)return\"🏆\";const lower=name.toLowerCase();if(lower.includes(\"badge\"))return\"🛡️\";if(lower.includes(\"top\")||lower.includes(\"shirt\"))return\"👕\";if(lower.includes(\"goggles\")||lower.includes(\"glasses\"))return\"🥽\";if(lower.includes(\"hat\")||lower.includes(\"cap\"))return\"🧢\";return\"📦\";};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"fixed\",bottom:\"20px\",right:\"20px\",zIndex:999999,display:\"flex\",flexDirection:\"column\",gap:\"10px\",alignItems:\"flex-end\",pointerEvents:\"none\"},children:[toasts.map(toast=>/*#__PURE__*/_jsxs(\"div\",{style:{width:toast.type===\"quest\"?\"300px\":\"250px\",backgroundColor:\"#c0c0c0\",border:\"2px solid #000\",boxShadow:\"4px 4px 0px rgba(0,0,0,0.5)\",fontFamily:\"'Courier New', monospace\",pointerEvents:\"auto\",animation:\"slideIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28)\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{backgroundColor:getHeaderColor(toast.type),color:\"white\",padding:\"4px 8px\",fontSize:\"10px\",fontWeight:\"bold\",display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",textTransform:\"uppercase\"},children:[/*#__PURE__*/_jsx(\"span\",{children:toast.type===\"quest\"?\"★ QUEST COMPLETE ★\":toast.type}),/*#__PURE__*/_jsx(\"button\",{onClick:()=>setToasts(p=>p.filter(t=>t.id!==toast.id)),style:{background:\"none\",border:\"none\",color:\"white\",cursor:\"pointer\",fontWeight:\"bold\"},children:\"X\"})]}),/*#__PURE__*/_jsxs(\"div\",{style:{padding:\"12px\",display:\"flex\",gap:\"12px\",alignItems:\"center\",color:\"black\"},children:[toast.type===\"quest\"&&/*#__PURE__*/_jsx(\"div\",{style:{width:\"40px\",height:\"40px\",backgroundColor:\"white\",border:\"2px inset #dfdfdf\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",fontSize:\"20px\"},children:getIcon(toast.data?.itemName)}),/*#__PURE__*/_jsxs(\"div\",{style:{flex:1,display:\"flex\",flexDirection:\"column\",gap:\"4px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"12px\",fontWeight:\"bold\",lineHeight:\"1.2\"},children:toast.message}),toast.type===\"quest\"&&/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",gap:\"4px\",flexWrap:\"wrap\",marginTop:\"2px\"},children:[toast.data?.xp>0&&/*#__PURE__*/_jsxs(\"span\",{style:{fontSize:\"9px\",backgroundColor:\"#22c55e\",color:\"white\",padding:\"2px 4px\",borderRadius:\"2px\"},children:[\"+\",toast.data.xp,\" XP\"]}),toast.data?.entrobucks>0&&/*#__PURE__*/_jsxs(\"span\",{style:{fontSize:\"9px\",backgroundColor:\"#eab308\",color:\"black\",padding:\"2px 4px\",borderRadius:\"2px\"},children:[\"+\",toast.data.entrobucks,\" EB\"]})]}),toast.data?.itemName&&/*#__PURE__*/_jsxs(\"div\",{style:{fontSize:\"10px\",color:\"#7e22ce\",fontWeight:\"bold\"},children:[\"+ \",toast.data.itemName]})]})]})]},toast.id)),/*#__PURE__*/_jsx(\"style\",{children:`\n                @keyframes slideIn {\n                    from { transform: translateX(120%); opacity: 0; }\n                    to { transform: translateX(0); opacity: 1; }\n                }\n            `})]});}addPropertyControls(GlobalToaster,{});\nexport const __FramerMetadata__ = {\"exports\":{\"GlobalToaster\":{\"type\":\"reactComponent\",\"name\":\"GlobalToaster\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ToastDisplay.map"],"mappings":"0LAA6H,SAAgB,GAAe,CAAC,GAAK,CAAC,EAAO,GAAWA,EAAe,EAAE,CAAC,CACvM,MAAoB,CAAC,IAAM,EAAc,GAAO,CAChD,GAAG,EAAM,MAAM,EAAM,KAAK,OAAO,aAAa,CAAC,GAAK,CAAC,UAAQ,YAAU,QAAM,EAAM,KAAK,QAAQ,EAAS,EAAQ,EAAU,EAAK,GAAqD,OAAjD,EAAO,iBAAiB,UAAU,EAAc,KAAW,EAAO,oBAAoB,UAAU,EAAc,EAAG,EAAE,CAAC,CAAC,IAAM,GAAU,EAAQ,EAAK,IAAO,CAAC,IAAM,EAAG,KAAK,KAAK,CAAC,EAAU,GAAM,CAAC,GAAG,EAAK,CAAC,KAAG,UAAQ,OAAK,OAAK,CAAC,CAAC,CACnW,IAAM,EAAS,IAAO,QAAQ,IAAI,IAAI,eAAe,CAAC,EAAU,GAAM,EAAK,OAAO,GAAG,EAAE,KAAK,EAAG,CAAC,EAAG,EAAS,EACtG,EAAe,GAAU,IAAO,QAAc,UAChD,IAAO,QAAc,UACrB,IAAO,UAAgB,UACpB,UAC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