robot-toast 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/styles-injector.ts","../src/robot-data.ts","../src/toast.ts","../src/utils.ts","../src/types.ts","../src/index.ts"],"names":["_InjectStyles","styleId","styles","styleElement","InjectStyles","styles_injector_default","svgToDataUrl","svgContent","ROBOT_SVG","ROBOT_IMAGES","_nextId","nextId","STACK_GAP","ToastItem","id","options","onRemove","resolved","positionIsLeft","initialSide","fn","bottomPx","w","classes","r","variant","img","ext","box","key","value","camelCaseKey","g","closeBtn","e","text","pContainer","pBar","rtl","robotHidden","messageHidden","showMessage","msgEnterClass","onMsgEntered","side","transitionSuffix","enterClass","onRobotEntered","done","afterMsg","exitClass","afterRobot","message","typeSpeed","el","index","active","tick","elapsed","onEnter","onLeave","onBlur","onFocus","onPointerDown","rect","onPointerMove","wRect","maxX","maxY","newLeft","newTop","onPointerUp","midX","centerX","snapToLeft","newRobotSide","finalLeft","finalTop","robotOnLeft","snapClass","_RobotToastManager","limit","toast","t","q","doneId","next","groups","pos","list","offset","RobotToastManager","ensureRobotToastReady","timeout","resolve","reject","startTime","interval","showRobotToast","err","closeAllRobotToasts","getRobotToastInstance","TOAST_POSITIONS","TOAST_TYPES","TOAST_THEMES","TOAST_TRANSITIONS","normalise","input","registerGlobal","api"],"mappings":"aAKA,IAAMA,CAAAA,CAAN,MAAMA,CAAa,CAGjB,WAAA,EAAc,CACR,OAAO,QAAA,CAAa,GAAA,EAAeA,CAAAA,CAAa,QAAA,GAIpDA,CAAAA,CAAa,SAAW,IAAA,CACxB,IAAA,CAAK,SAAA,EAAU,EACjB,CAEQ,SAAA,EAAkB,CACxB,IAAMC,CAAAA,CAAU,oBAAA,CAGhB,GAAI,QAAA,CAAS,cAAA,CAAeA,CAAO,CAAA,CACjC,OAGF,IAAMC,CAAAA,CAAS;AA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E,IAAA,CAAK5E,CAAO,CAAA,CAClF,SAAU,IAAM4E,CAAAA,CAAkB,WAAA,EAAY,CAAE,UAAS,CACzD,SAAA,CAAY7E,CAAAA,EAAe6E,CAAAA,CAAkB,WAAA,EAAY,CAAE,SAAA,CAAU7E,CAAE,EACvE,WAAA,CAAa,IAAM6E,CAAAA,CAAkB,WAAA,EACvC,CAAA,CAEA,MAAA,CAAO,UAAA,CAAakB,EACtB,CAEAD,CAAAA,EAAe","file":"index.js","sourcesContent":["/**\r\n * Style injection for RobotToast\r\n * Injects all required CSS into the document when instantiated\r\n */\r\n\r\nclass InjectStyles {\r\n private static injected = false;\r\n\r\n constructor() {\r\n if (typeof document === 'undefined' || InjectStyles.injected) {\r\n return;\r\n }\r\n\r\n InjectStyles.injected = true;\r\n this.injectCSS();\r\n }\r\n\r\n private injectCSS(): void {\r\n const styleId = 'robot-toast-styles';\r\n\r\n // Check if styles already exist\r\n if (document.getElementById(styleId)) {\r\n return;\r\n }\r\n\r\n const styles = `\r\n/* RobotToast v2 - CSS Styles */\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* WRAPPER - Fixed positioning container for each toast */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n.robot-toast-wrapper {\r\n position: fixed;\r\n display: flex;\r\n align-items: center;\r\n gap: 12px;\r\n opacity: 0;\r\n z-index: 99999;\r\n pointer-events: auto;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-visible {\r\n opacity: 1;\r\n}\r\n\r\n/* Position presets */\r\n.robot-toast-wrapper.robot-toast-top-right {\r\n top: 20px;\r\n right: 20px;\r\n flex-direction: row;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-top-left {\r\n top: 20px;\r\n left: 20px;\r\n flex-direction: row;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-top-center {\r\n top: 20px;\r\n left: 50%;\r\n transform: translateX(-50%);\r\n flex-direction: row;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-bottom-right {\r\n bottom: 20px;\r\n right: 20px;\r\n flex-direction: row;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-bottom-left {\r\n bottom: 20px;\r\n left: 20px;\r\n flex-direction: row;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-bottom-center {\r\n bottom: 20px;\r\n left: 50%;\r\n transform: translateX(-50%);\r\n flex-direction: row;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-rtl {\r\n direction: rtl;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-dragging .robot-toast-message {\r\n box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* ROBOT - The animated character */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n.robot-toast-robot {\r\n width: 65px;\r\n height: 70px;\r\n flex-shrink: 0;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n opacity: 0;\r\n}\r\n\r\n.robot-toast-robot img {\r\n width: 100%;\r\n height: 100%;\r\n object-fit: contain;\r\n display: block;\r\n}\r\n\r\n.robot-toast-robot.robot-enter-left {\r\n animation: robot-enter-left 0.7s ease-out forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-enter-right {\r\n animation: robot-enter-right 0.7s ease-out forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-exit-left {\r\n animation: robot-exit-left 0.5s ease-in forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-exit-right {\r\n animation: robot-exit-right 0.5s ease-in forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-idle {\r\n opacity: 1;\r\n animation: robot-idle 2s ease-in-out infinite;\r\n}\r\n\r\n.robot-toast-robot.robot-snap-left {\r\n animation: robot-snap-left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-snap-right {\r\n animation: robot-snap-right 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* MESSAGE BOX - Toast content container */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n.robot-toast-message {\r\n position: relative;\r\n width: fit-content;\r\n min-width: 120px;\r\n max-width: min(400px, calc(100vw - 120px));\r\n padding: 14px 40px 0 14px;\r\n border-radius: 8px;\r\n margin: 0;\r\n opacity: 0;\r\n display: flex;\r\n flex-direction: column;\r\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);\r\n user-select: none;\r\n cursor: default;\r\n box-sizing: border-box;\r\n}\r\n\r\n.robot-toast-message.robot-toast-empty {\r\n display: none;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-light {\r\n background: #ffffff;\r\n color: #333333;\r\n border: 1px solid #e0e0e0;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-dark {\r\n background: #2d2d2d;\r\n color: #f0f0f0;\r\n border: 1px solid #444444;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-colored {\r\n color: #ffffff;\r\n}\r\n\r\n/* Type-specific colors for colored theme */\r\n.robot-toast-message.robot-toast-theme-colored.robot-toast-type-default {\r\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-colored.robot-toast-type-info {\r\n background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-colored.robot-toast-type-success {\r\n background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-colored.robot-toast-type-warning {\r\n background: linear-gradient(135deg, #fb6e3b 0%, #f5a623 100%);\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-colored.robot-toast-type-error {\r\n background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);\r\n}\r\n\r\n/* Light theme type-specific colors */\r\n.robot-toast-message.robot-toast-theme-light.robot-toast-type-info {\r\n border-left: 4px solid #2193b0;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-light.robot-toast-type-success {\r\n border-left: 4px solid #11998e;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-light.robot-toast-type-warning {\r\n border-left: 4px solid #fb6e3b;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-light.robot-toast-type-error {\r\n border-left: 4px solid #eb3349;\r\n}\r\n\r\n/* Dark theme type-specific colors */\r\n.robot-toast-message.robot-toast-theme-dark.robot-toast-type-info {\r\n border-left: 4px solid #6dd5ed;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-dark.robot-toast-type-success {\r\n border-left: 4px solid #38ef7d;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-dark.robot-toast-type-warning {\r\n border-left: 4px solid #f5a623;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-dark.robot-toast-type-error {\r\n border-left: 4px solid #f45c43;\r\n}\r\n\r\n.robot-toast-message.message-enter {\r\n animation: message-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;\r\n}\r\n\r\n.robot-toast-message.message-exit {\r\n animation: message-exit 0.3s ease-in forwards;\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* CLOSE BUTTON */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n.robot-toast-close {\r\n position: absolute;\r\n top: 4px;\r\n right: 4px;\r\n background: none;\r\n border: none;\r\n font-size: 24px;\r\n cursor: pointer;\r\n opacity: 0.6;\r\n transition: opacity 0.2s;\r\n padding: 0;\r\n width: 28px;\r\n height: 28px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n color: currentColor;\r\n}\r\n\r\n.robot-toast-close:hover {\r\n opacity: 1;\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* DRAG HINT */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n.robot-toast-drag-hint {\r\n position: absolute;\r\n left: 8px;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n display: flex;\r\n flex-direction: column;\r\n gap: 3px;\r\n opacity: 0.4;\r\n}\r\n\r\n.robot-toast-drag-hint span {\r\n display: block;\r\n width: 4px;\r\n height: 4px;\r\n border-radius: 50%;\r\n background: currentColor;\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* MESSAGE TEXT */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n.robot-toast-text {\r\n padding-bottom: 12px;\r\n font-size: 14px;\r\n line-height: 1.5;\r\n word-break: break-word;\r\n white-space: pre-wrap;\r\n font-weight: 500;\r\n min-width: 0;\r\n min-height: 1.5em;\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* PROGRESS BAR */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n.robot-toast-progress-container {\r\n width: 100%;\r\n height: 3px;\r\n background: rgba(0, 0, 0, 0.1);\r\n border-radius: 2px;\r\n overflow: hidden;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-dark .robot-toast-progress-container {\r\n background: rgba(255, 255, 255, 0.15);\r\n}\r\n\r\n.robot-toast-progress-bar {\r\n height: 100%;\r\n background: currentColor;\r\n transform-origin: left;\r\n transform: scaleX(1); /* ← starts full */\r\n}\r\n\r\n.robot-toast-theme-light.robot-toast-type-success .robot-toast-progress-bar { background: #11998e; }\r\n.robot-toast-theme-light.robot-toast-type-error .robot-toast-progress-bar { background: #eb3349; }\r\n.robot-toast-theme-light.robot-toast-type-warning .robot-toast-progress-bar { background: #fb6e3b; }\r\n.robot-toast-theme-light.robot-toast-type-info .robot-toast-progress-bar { background: #2193b0; }\r\n\r\n/* Dark theme progress bar colors */\r\n.robot-toast-theme-dark.robot-toast-type-success .robot-toast-progress-bar { background: #38ef7d; }\r\n.robot-toast-theme-dark.robot-toast-type-error .robot-toast-progress-bar { background: #f45c43; }\r\n.robot-toast-theme-dark.robot-toast-type-warning .robot-toast-progress-bar { background: #f5a623; }\r\n.robot-toast-theme-dark.robot-toast-type-info .robot-toast-progress-bar { background: #6dd5ed; }\r\n\r\n\r\n.robot-toast-progress-bar.robot-toast-progress-auto {\r\n animation: robot-progress-countdown linear forwards;\r\n opacity: 0.8;\r\n}\r\n\r\n.robot-toast-progress-bar.robot-toast-progress-paused {\r\n animation-play-state: paused !important;\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* ANIMATIONS */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n@keyframes robot-enter-left {\r\n 0% { opacity: 0; transform: translateY(-80px) translateX(-30px) scaleY(1.1) scaleX(0.9); }\r\n 40% { opacity: 1; transform: translateY(10px) scaleY(0.85) scaleX(1.1); }\r\n 65% { transform: translateY(-6px) scaleY(1.05) scaleX(0.97); }\r\n 85% { transform: translateY(2px) scaleY(0.98); }\r\n 100% { opacity: 1; transform: translateY(0) scale(1); }\r\n}\r\n\r\n@keyframes robot-enter-right {\r\n 0% { opacity: 0; transform: translateY(-80px) translateX(30px) scaleY(1.1) scaleX(0.9); }\r\n 40% { opacity: 1; transform: translateY(10px) scaleY(0.85) scaleX(1.1); }\r\n 65% { transform: translateY(-6px) scaleY(1.05) scaleX(0.97); }\r\n 85% { transform: translateY(2px) scaleY(0.98); }\r\n 100% { opacity: 1; transform: translateY(0) scale(1); }\r\n}\r\n\r\n@keyframes robot-exit-left {\r\n 0% { opacity: 1; transform: scale(1); }\r\n 20% { transform: scaleY(0.85) scaleX(1.1) translateY(5px); }\r\n 100% { opacity: 0; transform: translateY(-80px) translateX(-30px) scaleY(1.1) scaleX(0.9); }\r\n}\r\n\r\n@keyframes robot-exit-right {\r\n 0% { opacity: 1; transform: scale(1); }\r\n 20% { transform: scaleY(0.85) scaleX(1.1) translateY(5px); }\r\n 100% { opacity: 0; transform: translateY(-80px) translateX(30px) scaleY(1.1) scaleX(0.9); }\r\n}\r\n\r\n\r\n@keyframes robot-idle {\r\n 0%, 100% {\r\n transform: translateY(0);\r\n }\r\n 50% {\r\n transform: translateY(-4px);\r\n }\r\n}\r\n\r\n@keyframes robot-snap-left {\r\n from {\r\n transform: scaleX(0.8);\r\n }\r\n to {\r\n transform: scaleX(1);\r\n }\r\n}\r\n\r\n@keyframes robot-snap-right {\r\n from {\r\n transform: scaleX(0.8);\r\n }\r\n to {\r\n transform: scaleX(1);\r\n }\r\n}\r\n\r\n@keyframes message-enter {\r\n from {\r\n opacity: 0;\r\n transform: scale(0.8);\r\n }\r\n to {\r\n opacity: 1;\r\n transform: scale(1);\r\n }\r\n}\r\n\r\n@keyframes message-exit {\r\n from {\r\n opacity: 1;\r\n transform: scale(1);\r\n }\r\n to {\r\n opacity: 0;\r\n transform: scale(0.8);\r\n }\r\n}\r\n\r\n@keyframes robot-progress-countdown {\r\n from { transform: scaleX(1); }\r\n to { transform: scaleX(0); }\r\n}\r\n\r\n/* Slide transition animations */\r\n.robot-toast-robot.robot-enter-left-slide {\r\n animation: robot-enter-left-slide 0.5s ease-out forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-enter-right-slide {\r\n animation: robot-enter-right-slide 0.5s ease-out forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-exit-left-slide {\r\n animation: robot-exit-left-slide 0.4s ease-in forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-exit-right-slide {\r\n animation: robot-exit-right-slide 0.4s ease-in forwards;\r\n}\r\n\r\n/* Zoom transition animations */\r\n.robot-toast-robot.robot-enter-left-zoom,\r\n.robot-toast-robot.robot-enter-right-zoom {\r\n animation: robot-enter-zoom 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-exit-left-zoom,\r\n.robot-toast-robot.robot-exit-right-zoom {\r\n animation: robot-exit-zoom 0.4s ease-in forwards;\r\n}\r\n\r\n/* Flip transition animations */\r\n.robot-toast-robot.robot-enter-left-flip {\r\n animation: robot-enter-left-flip 0.6s ease-out forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-enter-right-flip {\r\n animation: robot-enter-right-flip 0.6s ease-out forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-exit-left-flip {\r\n animation: robot-exit-left-flip 0.4s ease-in forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-exit-right-flip {\r\n animation: robot-exit-right-flip 0.4s ease-in forwards;\r\n}\r\n\r\n@keyframes robot-enter-left-slide {\r\n from { opacity: 0; transform: translateX(-60px); }\r\n to { opacity: 1; transform: translateX(0); }\r\n}\r\n\r\n@keyframes robot-enter-right-slide {\r\n from { opacity: 0; transform: translateX(60px); }\r\n to { opacity: 1; transform: translateX(0); }\r\n}\r\n\r\n@keyframes robot-exit-left-slide {\r\n from { opacity: 1; transform: translateX(0); }\r\n to { opacity: 0; transform: translateX(-60px); }\r\n}\r\n\r\n@keyframes robot-exit-right-slide {\r\n from { opacity: 1; transform: translateX(0); }\r\n to { opacity: 0; transform: translateX(60px); }\r\n}\r\n\r\n@keyframes robot-enter-zoom {\r\n from { opacity: 0; transform: scale(0.2); }\r\n to { opacity: 1; transform: scale(1); }\r\n}\r\n\r\n@keyframes robot-exit-zoom {\r\n from { opacity: 1; transform: scale(1); }\r\n to { opacity: 0; transform: scale(0.2); }\r\n}\r\n\r\n@keyframes robot-enter-left-flip {\r\n from { opacity: 0; transform: perspective(600px) rotateY(90deg); }\r\n to { opacity: 1; transform: perspective(600px) rotateY(0deg); }\r\n}\r\n\r\n@keyframes robot-enter-right-flip {\r\n from { opacity: 0; transform: perspective(600px) rotateY(-90deg); }\r\n to { opacity: 1; transform: perspective(600px) rotateY(0deg); }\r\n}\r\n\r\n@keyframes robot-exit-left-flip {\r\n from { opacity: 1; transform: perspective(600px) rotateY(0deg); }\r\n to { opacity: 0; transform: perspective(600px) rotateY(90deg); }\r\n}\r\n\r\n@keyframes robot-exit-right-flip {\r\n from { opacity: 1; transform: perspective(600px) rotateY(0deg); }\r\n to { opacity: 0; transform: perspective(600px) rotateY(-90deg); }\r\n}\r\n\r\n/* message-enter variants */\r\n.robot-toast-message.message-enter-slide {\r\n animation: message-enter-slide 0.35s ease-out forwards;\r\n}\r\n.robot-toast-message.message-enter-zoom {\r\n animation: message-enter-zoom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;\r\n}\r\n.robot-toast-message.message-enter-flip {\r\n animation: message-enter-flip 0.4s ease-out forwards;\r\n}\r\n\r\n@keyframes message-enter-slide {\r\n from { opacity: 0; transform: translateY(10px); }\r\n to { opacity: 1; transform: translateY(0); }\r\n}\r\n@keyframes message-enter-zoom {\r\n from { opacity: 0; transform: scale(0.5); }\r\n to { opacity: 1; transform: scale(1); }\r\n}\r\n@keyframes message-enter-flip {\r\n from { opacity: 0; transform: perspective(400px) rotateX(-20deg); }\r\n to { opacity: 1; transform: perspective(400px) rotateX(0deg); }\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* RESPONSIVE - Mobile / small-screen tweaks */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n@media (max-width: 600px) {\r\n .robot-toast-wrapper {\r\n gap: 8px;\r\n max-width: calc(100vw - 24px);\r\n }\r\n\r\n .robot-toast-wrapper.robot-toast-top-right,\r\n .robot-toast-wrapper.robot-toast-bottom-right {\r\n right: 12px;\r\n }\r\n .robot-toast-wrapper.robot-toast-top-left,\r\n .robot-toast-wrapper.robot-toast-bottom-left {\r\n left: 12px;\r\n }\r\n .robot-toast-wrapper.robot-toast-top-right,\r\n .robot-toast-wrapper.robot-toast-top-left,\r\n .robot-toast-wrapper.robot-toast-top-center { top: 12px; }\r\n .robot-toast-wrapper.robot-toast-bottom-right,\r\n .robot-toast-wrapper.robot-toast-bottom-left,\r\n .robot-toast-wrapper.robot-toast-bottom-center { bottom: 12px; }\r\n\r\n .robot-toast-wrapper.robot-toast-top-center,\r\n .robot-toast-wrapper.robot-toast-bottom-center {\r\n width: calc(100vw - 24px);\r\n justify-content: center;\r\n }\r\n\r\n .robot-toast-robot {\r\n width: 48px;\r\n height: 52px;\r\n }\r\n\r\n .robot-toast-message {\r\n min-width: 100px;\r\n max-width: calc(100vw - 48px - 24px - 8px);\r\n font-size: 13px;\r\n padding: 12px 36px 0 12px;\r\n }\r\n\r\n .robot-toast-text {\r\n font-size: 13px;\r\n padding-bottom: 10px;\r\n }\r\n\r\n .robot-toast-close {\r\n width: 24px;\r\n height: 24px;\r\n font-size: 20px;\r\n }\r\n}\r\n\r\n@media (max-width: 360px) {\r\n .robot-toast-robot {\r\n width: 40px;\r\n height: 44px;\r\n }\r\n .robot-toast-message {\r\n max-width: calc(100vw - 40px - 20px - 8px);\r\n }\r\n}\r\n `;\r\n\r\n const styleElement = document.createElement('style');\r\n styleElement.id = styleId;\r\n styleElement.textContent = styles;\r\n document.head.appendChild(styleElement);\r\n }\r\n}\r\n\r\nexport default InjectStyles;\r\n","/**\r\n * Built-in robot SVG images as base64 data URLs\r\n * These are embedded directly in the package, no external files needed\r\n */\r\n\r\nfunction svgToDataUrl(svgContent: string): string {\r\n const encoded = Buffer.from(svgContent, 'utf-8').toString('base64');\r\n return `data:image/svg+xml;base64,${encoded}`;\r\n}\r\n\r\nconst ROBOT_SVG = {\r\n wave: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n \r\n <path d=\"M 25 60 Q 15 65, 20 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 95 45, 85 25\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#FF6B6B\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <circle cx=\"40\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n <path d=\"M 55 38 Q 60 33, 65 38\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n\r\n base: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n \r\n <path d=\"M 25 60 Q 15 70, 25 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 85 70, 75 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#4D96FF\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <circle cx=\"40\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n <circle cx=\"60\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n \r\n <line x1=\"45\" y1=\"46\" x2=\"55\" y2=\"46\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n\r\n success: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <circle cx=\"20\" cy=\"20\" r=\"3\" fill=\"#FF6B6B\" />\r\n <rect x=\"80\" y=\"25\" width=\"6\" height=\"6\" fill=\"#4D96FF\" transform=\"rotate(45 80 25)\"/>\r\n <circle cx=\"75\" cy=\"10\" r=\"2\" fill=\"#FFD93D\" />\r\n\r\n <path d=\"M 25 55 Q 10 40, 20 20\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 55 Q 90 40, 80 20\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"50\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"15\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"15\" x2=\"50\" y2=\"5\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"3\" r=\"4\" fill=\"#4ECB71\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <path d=\"M 35 32 Q 40 25, 45 32\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n <path d=\"M 55 32 Q 60 25, 65 32\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n\r\n error: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n \r\n <path d=\"M 85 15 L 95 35 L 75 35 Z\" fill=\"#FF6B6B\" stroke=\"#2B3A55\" stroke-width=\"2\" stroke-linejoin=\"round\"/>\r\n <text x=\"85\" y=\"32\" font-family=\"sans-serif\" font-size=\"14\" fill=\"#FFF\" font-weight=\"bold\" text-anchor=\"middle\">!</text>\r\n\r\n <path d=\"M 25 55 Q 10 50, 20 35\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 90 70, 80 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"23\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"48\" y1=\"20\" x2=\"40\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"40\" cy=\"8\" r=\"4\" fill=\"#FF6B6B\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <path d=\"M 34 34 L 42 42 M 42 34 L 34 42\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n <path d=\"M 54 34 L 62 42 M 62 34 L 54 42\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n \r\n <path d=\"M 38 48 L 42 45 L 46 48 L 50 45 L 54 48 L 58 45\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n</svg>`,\r\n\r\n angry: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <path d=\"M 20 30 Q 10 25, 15 15 Q 25 10, 30 20\" fill=\"none\" stroke=\"#A8B2C1\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n <path d=\"M 80 30 Q 90 25, 85 15 Q 75 10, 70 20\" fill=\"none\" stroke=\"#A8B2C1\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n \r\n <path d=\"M 25 60 L 15 75\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"15\" cy=\"75\" r=\"5\" fill=\"#2B3A55\"/>\r\n <path d=\"M 75 60 L 85 75\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"85\" cy=\"75\" r=\"5\" fill=\"#2B3A55\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"25\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"25\" x2=\"50\" y2=\"15\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"13\" r=\"4\" fill=\"#FF3333\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <path d=\"M 32 35 L 48 42\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 68 35 L 52 42\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"40\" y=\"48\" width=\"20\" height=\"6\" rx=\"2\" fill=\"#FFF\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <line x1=\"45\" y1=\"48\" x2=\"45\" y2=\"54\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <line x1=\"50\" y1=\"48\" x2=\"50\" y2=\"54\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <line x1=\"55\" y1=\"48\" x2=\"55\" y2=\"54\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n</svg>`,\r\n\r\n angry2: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <path d=\"M 15 30 Q 10 20, 20 15 M 20 35 Q 15 25, 25 20\" fill=\"none\" stroke=\"#FF6B6B\" stroke-width=\"3\" stroke-linecap=\"round\" opacity=\"0.7\"/>\r\n <path d=\"M 85 30 Q 90 20, 80 15 M 80 35 Q 85 25, 75 20\" fill=\"none\" stroke=\"#FF6B6B\" stroke-width=\"3\" stroke-linecap=\"round\" opacity=\"0.7\"/>\r\n\r\n <path d=\"M 25 60 L 20 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 L 80 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#FF6B6B\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <circle cx=\"40\" cy=\"38\" r=\"3\" fill=\"#2B3A55\"/>\r\n <circle cx=\"60\" cy=\"38\" r=\"3\" fill=\"#2B3A55\"/>\r\n <path d=\"M 32 32 L 45 36 M 68 32 L 55 36\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <path d=\"M 40 50 Q 50 44, 60 50\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n\r\n shock: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <path d=\"M 75 15 Q 95 15, 95 30 Q 95 45, 80 45 L 70 50 L 72 42 Q 60 40, 60 30 Q 60 15, 75 15 Z\" fill=\"#FFF\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n\r\n <path d=\"M 25 60 Q 15 70, 30 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 85 40, 70 25\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#4D96FF\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <circle cx=\"40\" cy=\"36\" r=\"4\" fill=\"#2B3A55\"/>\r\n <circle cx=\"60\" cy=\"36\" r=\"4\" fill=\"#2B3A55\"/>\r\n <ellipse cx=\"50\" cy=\"46\" rx=\"6\" ry=\"3\" fill=\"#2B3A55\"/>\r\n</svg>`,\r\n\r\n think: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <circle cx=\"80\" cy=\"20\" r=\"10\" fill=\"#FFF\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n <text x=\"80\" y=\"25\" font-family=\"sans-serif\" font-size=\"14\" fill=\"#2B3A55\" font-weight=\"bold\" text-anchor=\"middle\">?</text>\r\n\r\n <path d=\"M 25 60 Q 15 65, 20 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 85 55, 65 50\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <g transform=\"rotate(-5 50 37)\">\r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#FFD93D\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <circle cx=\"40\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n <circle cx=\"60\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n </g>\r\n</svg>`,\r\n\r\n search: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <path d=\"M 40 38 L 10 20 A 30 30 0 0 0 10 56 Z\" fill=\"#4ECB71\" opacity=\"0.3\"/>\r\n\r\n <path d=\"M 25 60 Q 15 70, 25 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 85 70, 75 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#4ECB71\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <circle cx=\"60\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n \r\n <circle cx=\"40\" cy=\"38\" r=\"6\" fill=\"none\" stroke=\"#4ECB71\" stroke-width=\"2\"/>\r\n <circle cx=\"40\" cy=\"38\" r=\"2\" fill=\"#4ECB71\"/>\r\n</svg>`,\r\n\r\n loading: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <g stroke=\"#2B3A55\" stroke-width=\"2\" fill=\"#FFD93D\">\r\n <circle cx=\"85\" cy=\"30\" r=\"6\" />\r\n <path d=\"M85 22V24 M85 36V38 M93 30H91 M77 30H79\" stroke-linecap=\"round\"/>\r\n <circle cx=\"15\" cy=\"75\" r=\"5\" fill=\"#A8B2C1\"/>\r\n <path d=\"M15 68V70 M15 80V82 M22 75H20 M8 75H10\" stroke-linecap=\"round\"/>\r\n </g>\r\n\r\n <path d=\"M 25 60 Q 15 55, 30 45\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 28 43 L 22 37 M 32 47 L 36 43\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n\r\n <path d=\"M 75 60 Q 85 65, 80 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#FFD93D\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <circle cx=\"40\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n <circle cx=\"60\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n</svg>`,\r\n\r\n sleep: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <text x=\"75\" y=\"25\" font-family=\"sans-serif\" font-size=\"12\" fill=\"#2B3A55\" font-weight=\"bold\">Z</text>\r\n <text x=\"85\" y=\"15\" font-family=\"sans-serif\" font-size=\"10\" fill=\"#2B3A55\" font-weight=\"bold\">z</text>\r\n\r\n <path d=\"M 25 60 Q 15 70, 25 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 85 70, 75 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"25\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <path d=\"M 50 25 Q 45 15, 35 12\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"35\" cy=\"12\" r=\"4\" fill=\"#A8B2C1\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <path d=\"M 35 42 Q 40 46, 45 42\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n <path d=\"M 55 42 Q 60 46, 65 42\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n\r\n 'head-palm': `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n \r\n <path d=\"M 25 60 Q 20 40, 35 35\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 80 70, 78 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"22\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <path d=\"M 50 22 Q 55 12, 65 15\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"65\" cy=\"15\" r=\"4\" fill=\"#A8B2C1\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <path d=\"M 55 40 Q 60 36, 65 40\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"30\" y=\"28\" width=\"20\" height=\"20\" rx=\"8\" fill=\"#E2F0FF\" stroke=\"#2B3A55\" stroke-width=\"4\" transform=\"rotate(-10 40 38)\"/>\r\n\r\n <line x1=\"55\" y1=\"50\" x2=\"65\" y2=\"50\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n\r\n type: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n \r\n <rect x=\"30\" y=\"80\" width=\"40\" height=\"10\" rx=\"2\" fill=\"#A8B2C1\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n <line x1=\"35\" y1=\"85\" x2=\"65\" y2=\"85\" stroke=\"#2B3A55\" stroke-width=\"2\" stroke-dasharray=\"4 2\"/>\r\n\r\n <path d=\"M 25 60 Q 25 75, 40 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 75 75, 60 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"22\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"22\" x2=\"50\" y2=\"12\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"10\" r=\"4\" fill=\"#4D96FF\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <ellipse cx=\"40\" cy=\"40\" rx=\"4\" ry=\"2\" fill=\"#2B3A55\"/>\r\n <ellipse cx=\"60\" cy=\"40\" rx=\"4\" ry=\"2\" fill=\"#2B3A55\"/>\r\n</svg>`,\r\n\r\n validation: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n \r\n <path d=\"M 25 60 Q 15 70, 25 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n\r\n <path d=\"M 75 60 Q 85 50, 85 35\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"80\" cy=\"32\" r=\"5\" fill=\"#B8D8FF\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#4ECB71\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <circle cx=\"40\" cy=\"36\" r=\"4\" fill=\"#2B3A55\"/>\r\n <path d=\"M 55 36 Q 60 31, 65 36\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n <path d=\"M 40 46 Q 50 52, 60 46\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n \r\n validation2: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <path d=\"M 25 60 Q 15 70, 25 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n\r\n <path d=\"M 75 60 Q 85 55, 85 45\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 85 45 C 80 45, 78 40, 80 35 C 82 30, 88 30, 90 35 C 92 40, 95 40, 95 48 C 95 52, 90 55, 85 52\" fill=\"#E2F0FF\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#4ECB71\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <path d=\"M 35 36 Q 40 42, 45 36\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n <path d=\"M 55 36 Q 60 42, 65 36\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n\r\n base2: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#FFFFFF\" />\r\n <stop offset=\"100%\" stop-color=\"#D0E3FF\" />\r\n </linearGradient>\r\n \r\n <linearGradient id=\"darkGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#A8B2C1\" />\r\n <stop offset=\"100%\" stop-color=\"#7B8CA5\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"6\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"6\" r=\"5\" fill=\"#FFD93D\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n\r\n <path d=\"M 32 60 Q 15 65, 18 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"18\" cy=\"80\" r=\"4\" fill=\"url(#darkGrad)\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n \r\n <path d=\"M 68 60 Q 85 65, 82 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"82\" cy=\"80\" r=\"4\" fill=\"url(#darkGrad)\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n\r\n <rect x=\"42\" y=\"48\" width=\"16\" height=\"12\" fill=\"url(#darkGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n\r\n <path d=\"M 36 56 L 64 56 L 68 85 C 68 90, 62 94, 50 94 C 38 94, 32 90, 32 85 Z\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linejoin=\"round\"/>\r\n \r\n <rect x=\"42\" y=\"66\" width=\"16\" height=\"8\" rx=\"4\" fill=\"#4D96FF\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n\r\n <rect x=\"16\" y=\"28\" width=\"10\" height=\"16\" rx=\"3\" fill=\"url(#darkGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n <rect x=\"74\" y=\"28\" width=\"10\" height=\"16\" rx=\"3\" fill=\"url(#darkGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n\r\n <rect x=\"22\" y=\"20\" width=\"56\" height=\"34\" rx=\"14\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n\r\n <circle cx=\"36\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n <circle cx=\"64\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n \r\n <ellipse cx=\"28\" cy=\"43\" rx=\"4\" ry=\"2\" fill=\"#FF6B6B\" opacity=\"0.5\"/>\r\n <ellipse cx=\"72\" cy=\"43\" rx=\"4\" ry=\"2\" fill=\"#FF6B6B\" opacity=\"0.5\"/>\r\n\r\n <path d=\"M 46 44 Q 50 48, 54 44\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n};\r\n\r\nexport const ROBOT_IMAGES = {\r\n wave: svgToDataUrl(ROBOT_SVG.wave),\r\n base: svgToDataUrl(ROBOT_SVG.base),\r\n base2: svgToDataUrl(ROBOT_SVG.base2),\r\n success: svgToDataUrl(ROBOT_SVG.success),\r\n error: svgToDataUrl(ROBOT_SVG.error),\r\n angry: svgToDataUrl(ROBOT_SVG.angry),\r\n angry2: svgToDataUrl(ROBOT_SVG.angry2),\r\n shock: svgToDataUrl(ROBOT_SVG.shock),\r\n think: svgToDataUrl(ROBOT_SVG.think),\r\n search: svgToDataUrl(ROBOT_SVG.search),\r\n loading: svgToDataUrl(ROBOT_SVG.loading),\r\n sleep: svgToDataUrl(ROBOT_SVG.sleep),\r\n 'head-palm': svgToDataUrl(ROBOT_SVG['head-palm']),\r\n type: svgToDataUrl(ROBOT_SVG.type),\r\n validation: svgToDataUrl(ROBOT_SVG.validation),\r\n validation2: svgToDataUrl(ROBOT_SVG.validation2),\r\n} as const;\r\n","/**\r\n * RobotToast v2\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * • Multi-toast support with configurable limit + queue\r\n * • Each toast is a self-contained ToastItem instance – no shared mutable state\r\n * • Sequenced robot enter → message pop-in, message pop-out → robot exit\r\n * • Full XY drag with viewport clamping; on drop the robot snaps to the\r\n * nearest screen edge (left / right) with a personality animation\r\n * • Progress bar auto-animates for the countdown; pauses correctly on hover\r\n * and drag; resumes with exact remaining time\r\n * • All event listeners are tracked and fully removed on close\r\n * • SVG-only enforcement for custom robot images; always renders at fixed size\r\n * • SSR-safe (all DOM access is guarded by typeof window / document checks)\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n */\r\n\r\nimport type { RobotToastOptions, ToastQueueItem } from './types';\r\nimport InjectStyles from './styles-injector';\r\nimport { ROBOT_IMAGES } from './robot-data';\r\n\r\n// ─── Unique ID counter ────────────────────────────────────────────────────────\r\nlet _nextId = 1;\r\nfunction nextId(): number { return _nextId++; }\r\n\r\n// ─── Vertical offset step between stacked toasts (px) ────────────────────────\r\nconst STACK_GAP = 16;\r\n\r\n/* ═══════════════════════════════════════════════════════════════════════════\r\n ToastItem – one live toast on screen\r\n ═══════════════════════════════════════════════════════════════════════════ */\r\nclass ToastItem {\r\n readonly id: number;\r\n private options: {\r\n message: string;\r\n autoClose: boolean | number;\r\n position: NonNullable<RobotToastOptions['position']>;\r\n type: NonNullable<RobotToastOptions['type']>;\r\n theme: NonNullable<RobotToastOptions['theme']>;\r\n style?: Record<string, string | number>;\r\n typeSpeed: number;\r\n robotVariant: string;\r\n hideProgressBar: boolean;\r\n pauseOnFocusLoss: boolean;\r\n draggable: boolean;\r\n nearScreen: boolean;\r\n pauseOnHover: boolean;\r\n rtl: boolean;\r\n transition: NonNullable<RobotToastOptions['transition']>;\r\n onOpen?: () => void;\r\n onClose?: () => void;\r\n };\r\n\r\n // DOM refs\r\n private wrapper: HTMLDivElement;\r\n private robotEl: HTMLDivElement;\r\n private messageBox: HTMLDivElement;\r\n private progressBar: HTMLDivElement | null = null;\r\n private messageText: HTMLDivElement;\r\n\r\n // Timer state\r\n private autoCloseDuration: number; // ms; 0 = no auto-close\r\n private remainingTime: number; // ms left on the countdown\r\n private timerStart: number | null = null; // when the current timer was set\r\n private closeTimeout: ReturnType<typeof setTimeout> | null = null;\r\n\r\n // Interaction state\r\n private isDragging = false;\r\n private dragOffsetX = 0;\r\n private dragOffsetY = 0;\r\n private currentRobotSide: 'left' | 'right';\r\n private isHovered = false;\r\n private isFocusLost = false;\r\n private isClosed = false;\r\n\r\n // Cleanup\r\n private cleanupFns: Array<() => void> = [];\r\n\r\n // Callback to notify the manager when this toast dies\r\n private onRemove: (id: number) => void;\r\n\r\n constructor(id: number, options: RobotToastOptions, onRemove: (id: number) => void) {\r\n this.id = id;\r\n this.onRemove = onRemove;\r\n\r\n // ── Resolve all options with defaults ──────────────────────────────────\r\n const resolved = {\r\n message: options.message,\r\n autoClose: options.autoClose ?? 5000,\r\n position: options.position ?? 'bottom-right',\r\n type: options.type ?? 'default',\r\n theme: options.theme ?? 'light',\r\n style: options.style,\r\n typeSpeed: options.typeSpeed ?? 30,\r\n robotVariant: options.robotVariant ?? '',\r\n hideProgressBar: options.hideProgressBar ?? false,\r\n pauseOnFocusLoss: options.pauseOnFocusLoss ?? true,\r\n draggable: options.draggable ?? true,\r\n nearScreen: options.nearScreen ?? true,\r\n pauseOnHover: options.pauseOnHover ?? true,\r\n rtl: options.rtl ?? false,\r\n transition: options.transition ?? 'bounce',\r\n onOpen: options.onOpen,\r\n onClose: options.onClose,\r\n };\r\n\r\n this.options = resolved;\r\n \r\n // Determine initial robot side based on nearScreen\r\n // nearScreen: true → robot near screen edge (position's side)\r\n // nearScreen: false → robot away from screen edge (opposite side)\r\n const positionIsLeft = resolved.position.includes('left');\r\n \r\n let initialSide: 'left' | 'right';\r\n if (resolved.nearScreen) {\r\n // Robot near edge: follow position\r\n initialSide = positionIsLeft ? 'left' : 'right';\r\n } else {\r\n // Robot away from edge: opposite of position\r\n initialSide = positionIsLeft ? 'right' : 'left';\r\n }\r\n this.currentRobotSide = initialSide;\r\n this.autoCloseDuration = typeof resolved.autoClose === 'number'\r\n ? resolved.autoClose\r\n : (resolved.autoClose ? 5000 : 0);\r\n this.remainingTime = this.autoCloseDuration;\r\n\r\n // ── Build DOM ──────────────────────────────────────────────────────────\r\n this.wrapper = this.buildWrapper();\r\n this.robotEl = this.buildRobot();\r\n this.messageBox = this.buildMessageBox();\r\n this.messageText = this.messageBox.querySelector('.robot-toast-text')!;\r\n this.progressBar = this.messageBox.querySelector('.robot-toast-progress-bar');\r\n\r\n // Empty message → hide message box entirely (only the robot shows)\r\n if (resolved.message === '') {\r\n this.messageBox.classList.add('robot-toast-empty');\r\n }\r\n\r\n this.assembleLayout();\r\n document.body.appendChild(this.wrapper);\r\n\r\n // ── Wire interactions ──────────────────────────────────────────────────\r\n if (resolved.draggable) this.initDrag();\r\n if (resolved.pauseOnFocusLoss) this.initFocusWatcher();\r\n if (resolved.pauseOnHover) this.initHoverWatcher();\r\n\r\n // ── Kick off the entrance sequence ─────────────────────────────────────\r\n requestAnimationFrame(() => this.playEntrance());\r\n }\r\n\r\n // ── Public API ─────────────────────────────────────────────────────────────\r\n\r\n close(): void {\r\n if (this.isClosed) return;\r\n this.isClosed = true;\r\n\r\n this.cancelTimer();\r\n this.cleanupFns.forEach(fn => fn());\r\n this.cleanupFns = [];\r\n\r\n this.playExit(() => {\r\n if (this.wrapper.parentNode) {\r\n this.wrapper.parentNode.removeChild(this.wrapper);\r\n }\r\n this.options.onClose?.();\r\n this.onRemove(this.id);\r\n });\r\n }\r\n\r\n /** Shift this toast vertically by `delta` px (used by manager for stacking) */\r\n shiftVertical(bottomPx: number): void {\r\n const pos = this.options.position;\r\n if (pos.startsWith('bottom')) {\r\n this.wrapper.style.bottom = `${bottomPx}px`;\r\n } else {\r\n this.wrapper.style.top = `${bottomPx}px`;\r\n }\r\n }\r\n\r\n getWrapperHeight(): number {\r\n return this.wrapper.getBoundingClientRect().height || 90;\r\n }\r\n\r\n // ── DOM builders ───────────────────────────────────────────────────────────\r\n\r\n private buildWrapper(): HTMLDivElement {\r\n const w = document.createElement('div');\r\n const classes = ['robot-toast-wrapper', `robot-toast-${this.options.position}`];\r\n if (this.options.rtl) classes.push('robot-toast-rtl');\r\n w.className = classes.join(' ');\r\n return w;\r\n }\r\n\r\n private buildRobot(): HTMLDivElement {\r\n const r = document.createElement('div');\r\n r.className = 'robot-toast-robot';\r\n\r\n const variant = this.options.robotVariant;\r\n\r\n if (variant === 'none') {\r\n // 'none' = no robot image at all, hide the container\r\n r.style.display = 'none';\r\n } else if (variant) {\r\n // Check if it's a built-in robot (data URL)\r\n if (variant in ROBOT_IMAGES) {\r\n // Use embedded data URL\r\n const img = document.createElement('img');\r\n img.src = ROBOT_IMAGES[variant as keyof typeof ROBOT_IMAGES];\r\n img.alt = 'Robot';\r\n img.setAttribute('width', '65');\r\n img.setAttribute('height', '70');\r\n img.style.cssText = 'width:100%;height:100%;object-fit:contain;display:block;';\r\n img.onerror = () => { r.innerHTML = this.getBuiltinSVG(); };\r\n r.appendChild(img);\r\n } else {\r\n // Custom image – user provides full path, fall back to built-in SVG on error\r\n const ALLOWED_FORMATS = ['.svg', '.png', '.jpg', '.jpeg', '.gif', '.webp'];\r\n const isAllowed = ALLOWED_FORMATS.some(ext => variant.toLowerCase().endsWith(ext));\r\n\r\n if (!isAllowed) {\r\n r.innerHTML = this.getBuiltinSVG();\r\n } else {\r\n const img = document.createElement('img');\r\n img.src = variant; // User provides full path directly\r\n img.alt = 'Robot';\r\n img.setAttribute('width', '65');\r\n img.setAttribute('height', '70');\r\n img.style.cssText = 'width:100%;height:100%;object-fit:contain;display:block;';\r\n img.onerror = () => { r.innerHTML = this.getBuiltinSVG(); };\r\n r.appendChild(img);\r\n }\r\n }\r\n } else {\r\n // Empty string / undefined = built-in robot\r\n r.innerHTML = this.getBuiltinSVG();\r\n }\r\n\r\n return r;\r\n }\r\n\r\n private buildMessageBox(): HTMLDivElement {\r\n const box = document.createElement('div');\r\n const classes = [\r\n 'robot-toast-message',\r\n `robot-toast-type-${this.options.type}`,\r\n `robot-toast-theme-${this.options.theme}`,\r\n ].filter(Boolean);\r\n box.className = classes.join(' ');\r\n box.style.cursor = this.options.draggable ? 'grab' : 'default';\r\n\r\n // Apply inline styles if provided (takes precedence over theme colors)\r\n if (this.options.style) {\r\n Object.entries(this.options.style).forEach(([key, value]) => {\r\n const camelCaseKey = key.replace(/-([a-z])/g, g => g[1].toUpperCase());\r\n (box.style as any)[camelCaseKey] = value;\r\n });\r\n }\r\n\r\n // Close button\r\n const closeBtn = document.createElement('button');\r\n closeBtn.className = 'robot-toast-close';\r\n closeBtn.innerHTML = '&times;';\r\n closeBtn.title = 'Dismiss';\r\n closeBtn.addEventListener('click', (e) => { e.stopPropagation(); this.close(); });\r\n box.appendChild(closeBtn);\r\n\r\n // Message text\r\n const text = document.createElement('div');\r\n text.className = 'robot-toast-text';\r\n box.appendChild(text);\r\n\r\n // Progress bar\r\n const pContainer = document.createElement('div');\r\n pContainer.className = 'robot-toast-progress-container';\r\n if (this.options.hideProgressBar) pContainer.style.display = 'none';\r\n\r\n const pBar = document.createElement('div');\r\n pBar.className = 'robot-toast-progress-bar';\r\n\r\n pContainer.appendChild(pBar);\r\n box.appendChild(pContainer);\r\n\r\n return box;\r\n }\r\n\r\n private assembleLayout(): void {\r\n const { rtl } = this.options;\r\n this.wrapper.innerHTML = '';\r\n\r\n // Decide order: rtl flips everything, robot side controls natural order\r\n const robotOnLeft = rtl ? this.currentRobotSide === 'right' : this.currentRobotSide === 'left';\r\n\r\n if (robotOnLeft) {\r\n this.wrapper.appendChild(this.robotEl);\r\n this.wrapper.appendChild(this.messageBox);\r\n } else {\r\n this.wrapper.appendChild(this.messageBox);\r\n this.wrapper.appendChild(this.robotEl);\r\n }\r\n }\r\n\r\n // ── Sequenced animations ───────────────────────────────────────────────────\r\n\r\n private playEntrance(): void {\r\n // Step 1 – wrapper becomes visible\r\n this.wrapper.classList.add('robot-toast-visible');\r\n\r\n const robotHidden = this.options.robotVariant === 'none';\r\n const messageHidden = this.options.message === '';\r\n\r\n const showMessage = () => {\r\n if (messageHidden) {\r\n // No text box – skip pop-in, still fire onOpen and start timer\r\n this.options.onOpen?.();\r\n this.afterTypingComplete();\r\n return;\r\n }\r\n // Message pops in\r\n const msgEnterClass = this.options.transition === 'bounce'\r\n ? 'message-enter'\r\n : `message-enter-${this.options.transition}`;\r\n this.messageBox.classList.add(msgEnterClass);\r\n\r\n const onMsgEntered = () => {\r\n this.messageBox.removeEventListener('animationend', onMsgEntered);\r\n this.messageBox.classList.remove(msgEnterClass);\r\n this.messageBox.style.opacity = '1';\r\n this.messageBox.style.transform = 'none';\r\n\r\n this.options.onOpen?.();\r\n this.startTyping();\r\n };\r\n this.messageBox.addEventListener('animationend', onMsgEntered, { once: true });\r\n };\r\n\r\n if (robotHidden) {\r\n // No robot – skip robot entrance, go straight to message\r\n showMessage();\r\n } else {\r\n // Step 2 – robot runs in with selected transition style\r\n const side = this.currentRobotSide === 'left' ? 'left' : 'right';\r\n const transitionSuffix = this.options.transition !== 'bounce' ? `-${this.options.transition}` : '';\r\n const enterClass = `robot-enter-${side}${transitionSuffix}`;\r\n this.robotEl.classList.add(enterClass);\r\n\r\n const onRobotEntered = () => {\r\n this.robotEl.removeEventListener('animationend', onRobotEntered);\r\n this.robotEl.style.opacity = '1';\r\n this.robotEl.classList.remove(enterClass);\r\n this.robotEl.classList.add('robot-idle');\r\n showMessage();\r\n };\r\n this.robotEl.addEventListener('animationend', onRobotEntered, { once: true });\r\n }\r\n }\r\n\r\n private playExit(done: () => void): void {\r\n const robotHidden = this.options.robotVariant === 'none';\r\n const messageHidden = this.options.message === '';\r\n\r\n const afterMsg = () => {\r\n this.messageBox.removeEventListener('animationend', afterMsg);\r\n\r\n if (robotHidden) {\r\n // No robot – skip robot exit, just fade wrapper\r\n this.wrapper.classList.remove('robot-toast-visible');\r\n setTimeout(done, 260);\r\n } else {\r\n this.robotEl.classList.remove('robot-idle', 'robot-snap-left', 'robot-snap-right');\r\n\r\n // Step 2 – robot runs out with selected transition style\r\n const side = this.currentRobotSide === 'left' ? 'left' : 'right';\r\n const transitionSuffix = this.options.transition !== 'bounce' ? `-${this.options.transition}` : '';\r\n const exitClass = `robot-exit-${side}${transitionSuffix}`;\r\n this.robotEl.classList.add(exitClass);\r\n\r\n const afterRobot = () => {\r\n this.robotEl.removeEventListener('animationend', afterRobot);\r\n this.wrapper.classList.remove('robot-toast-visible');\r\n setTimeout(done, 260);\r\n };\r\n this.robotEl.addEventListener('animationend', afterRobot, { once: true });\r\n }\r\n };\r\n\r\n if (messageHidden) {\r\n // No text box – skip the collapse step entirely\r\n afterMsg();\r\n } else {\r\n this.messageBox.classList.add('message-exit');\r\n this.messageBox.addEventListener('animationend', afterMsg, { once: true });\r\n }\r\n }\r\n\r\n // ── Typing effect ──────────────────────────────────────────────────────────\r\n\r\n private startTyping(): void {\r\n const { message, typeSpeed } = this.options;\r\n const el = this.messageText;\r\n\r\n if (typeSpeed === 0) {\r\n // Instant – no animation\r\n el.textContent = message;\r\n this.afterTypingComplete();\r\n return;\r\n }\r\n\r\n let index = 0;\r\n let active = true;\r\n\r\n // Register cleanup so that if toast is closed mid-type the loop stops\r\n this.cleanupFns.push(() => { active = false; });\r\n\r\n const tick = () => {\r\n if (!active) return;\r\n if (index < message.length) {\r\n el.textContent += message.charAt(index++);\r\n setTimeout(tick, typeSpeed);\r\n } else {\r\n this.afterTypingComplete();\r\n }\r\n };\r\n tick();\r\n }\r\n\r\n private afterTypingComplete(): void {\r\n // Always start auto-progress-bar animation (unless hidden)\r\n if (this.autoCloseDuration > 0 && !this.options.hideProgressBar && this.progressBar) {\r\n this.progressBar.style.animationDuration = `${this.autoCloseDuration}ms`; // set duration FIRST\r\n void this.progressBar.offsetWidth; // flush\r\n this.progressBar.classList.add('robot-toast-progress-auto'); // THEN start\r\n if (this.isHovered || this.isFocusLost) {\r\n this.progressBar.classList.add('robot-toast-progress-paused');\r\n }\r\n }\r\n\r\n // Start the close timer unless something is currently pausing it\r\n if (!this.isHovered && !this.isFocusLost) {\r\n this.startTimer();\r\n }\r\n }\r\n\r\n // ── Timer management ───────────────────────────────────────────────────────\r\n\r\n private startTimer(): void {\r\n if (this.autoCloseDuration <= 0 || this.remainingTime <= 0) return;\r\n this.timerStart = Date.now();\r\n this.closeTimeout = setTimeout(() => this.close(), this.remainingTime);\r\n }\r\n\r\n private pauseTimer(): void {\r\n if (this.closeTimeout) {\r\n clearTimeout(this.closeTimeout);\r\n this.closeTimeout = null;\r\n if (this.timerStart !== null) {\r\n const elapsed = Date.now() - this.timerStart;\r\n this.remainingTime = Math.max(0, this.remainingTime - elapsed);\r\n this.timerStart = null;\r\n }\r\n }\r\n this.progressBar?.classList.add('robot-toast-progress-paused');\r\n }\r\n\r\n private resumeTimer(): void {\r\n if (this.isHovered || this.isFocusLost || this.isDragging) return;\r\n this.progressBar?.classList.remove('robot-toast-progress-paused');\r\n this.startTimer();\r\n }\r\n\r\n private cancelTimer(): void {\r\n if (this.closeTimeout) {\r\n clearTimeout(this.closeTimeout);\r\n this.closeTimeout = null;\r\n }\r\n }\r\n\r\n // ── Hover watcher ──────────────────────────────────────────────────────────\r\n\r\n private initHoverWatcher(): void {\r\n const onEnter = () => {\r\n this.isHovered = true;\r\n this.pauseTimer();\r\n };\r\n const onLeave = () => {\r\n this.isHovered = false;\r\n this.resumeTimer();\r\n };\r\n this.wrapper.addEventListener('mouseenter', onEnter);\r\n this.wrapper.addEventListener('mouseleave', onLeave);\r\n this.cleanupFns.push(() => {\r\n this.wrapper.removeEventListener('mouseenter', onEnter);\r\n this.wrapper.removeEventListener('mouseleave', onLeave);\r\n });\r\n }\r\n\r\n // ── Focus watcher ──────────────────────────────────────────────────────────\r\n\r\n private initFocusWatcher(): void {\r\n const onBlur = () => {\r\n this.isFocusLost = true;\r\n this.pauseTimer();\r\n };\r\n const onFocus = () => {\r\n this.isFocusLost = false;\r\n this.resumeTimer();\r\n };\r\n window.addEventListener('blur', onBlur);\r\n window.addEventListener('focus', onFocus);\r\n this.cleanupFns.push(() => {\r\n window.removeEventListener('blur', onBlur);\r\n window.removeEventListener('focus', onFocus);\r\n });\r\n }\r\n\r\n // ── Drag ──────────────────────────────────────────────────────────────────\r\n\r\n private initDrag(): void {\r\n this.messageBox.style.cursor = 'grab';\r\n\r\n // ── Pointer events (covers both mouse & touch via pointer API) ──────────\r\n const onPointerDown = (e: PointerEvent) => {\r\n if ((e.target as HTMLElement).closest('.robot-toast-close')) return;\r\n // Only primary button / first touch\r\n if (e.button !== undefined && e.button !== 0) return;\r\n\r\n e.preventDefault();\r\n this.isDragging = true;\r\n this.pauseTimer();\r\n\r\n // \"Detach\" the wrapper from its CSS-positioned slot by converting its\r\n // current visual position into explicit inline top/left values.\r\n const rect = this.wrapper.getBoundingClientRect();\r\n this.wrapper.classList.add('robot-toast-dragging');\r\n\r\n // Inline position so the wrapper sits exactly where it was\r\n this.wrapper.style.top = `${rect.top}px`;\r\n this.wrapper.style.left = `${rect.left}px`;\r\n this.wrapper.style.right = 'auto';\r\n this.wrapper.style.bottom = 'auto';\r\n this.wrapper.style.transform = 'none';\r\n\r\n // Offset = where inside the wrapper the pointer grabbed\r\n this.dragOffsetX = e.clientX - rect.left;\r\n this.dragOffsetY = e.clientY - rect.top;\r\n\r\n this.messageBox.style.cursor = 'grabbing';\r\n this.wrapper.setPointerCapture(e.pointerId);\r\n };\r\n\r\n const onPointerMove = (e: PointerEvent) => {\r\n if (!this.isDragging) return;\r\n e.preventDefault();\r\n\r\n const wRect = this.wrapper.getBoundingClientRect();\r\n const maxX = window.innerWidth - wRect.width;\r\n const maxY = window.innerHeight - wRect.height;\r\n\r\n const newLeft = Math.max(0, Math.min(e.clientX - this.dragOffsetX, maxX));\r\n const newTop = Math.max(0, Math.min(e.clientY - this.dragOffsetY, maxY));\r\n\r\n this.wrapper.style.left = `${newLeft}px`;\r\n this.wrapper.style.top = `${newTop}px`;\r\n };\r\n\r\n const onPointerUp = (e: PointerEvent) => {\r\n if (!this.isDragging) return;\r\n this.isDragging = false;\r\n this.wrapper.classList.remove('robot-toast-dragging');\r\n this.messageBox.style.cursor = 'grab';\r\n\r\n // ── Snap to nearest horizontal screen edge ────────────────────────────\r\n const wRect = this.wrapper.getBoundingClientRect();\r\n const midX = wRect.left + wRect.width / 2;\r\n const centerX = window.innerWidth / 2;\r\n \r\n // Determine which edge to snap to based on which half the center is in\r\n const snapToLeft = midX < centerX;\r\n \r\n // Determine robot side based on nearScreen setting\r\n const newRobotSide: 'left' | 'right' = this.options.nearScreen \r\n ? (snapToLeft ? 'left' : 'right')\r\n : (snapToLeft ? 'right' : 'left');\r\n \r\n // Determine final resting left position (20px margin from edge)\r\n const finalLeft = snapToLeft ? 20 : window.innerWidth - wRect.width - 20;\r\n const finalTop = Math.max(20, Math.min(wRect.top, window.innerHeight - wRect.height - 20));\r\n\r\n // Re-enable transitions for the snap glide\r\n this.wrapper.style.transition =\r\n 'left 0.45s cubic-bezier(0.34,1.56,0.64,1), top 0.4s cubic-bezier(0.34,1.56,0.64,1)';\r\n this.wrapper.style.left = `${finalLeft}px`;\r\n this.wrapper.style.top = `${finalTop}px`;\r\n\r\n // Update robot side if it changed\r\n if (newRobotSide !== this.currentRobotSide) {\r\n this.currentRobotSide = newRobotSide;\r\n\r\n // Use CSS order to visually reorder (no DOM detach = no animation restart)\r\n const robotOnLeft = newRobotSide === 'left';\r\n this.robotEl.style.order = robotOnLeft ? '0' : '1';\r\n this.messageBox.style.order = robotOnLeft ? '1' : '0';\r\n\r\n // Snap animation\r\n const snapClass = newRobotSide === 'left' ? 'robot-snap-left' : 'robot-snap-right';\r\n this.robotEl.classList.remove('robot-idle', 'robot-snap-left', 'robot-snap-right');\r\n this.robotEl.classList.add(snapClass);\r\n this.robotEl.addEventListener('animationend', () => {\r\n this.robotEl.style.opacity = '1';\r\n this.robotEl.classList.remove(snapClass);\r\n this.robotEl.classList.add('robot-idle');\r\n }, { once: true });\r\n }\r\n const clearTransition = () => {\r\n this.wrapper.style.transition = '';\r\n };\r\n setTimeout(clearTransition, 500);\r\n\r\n // Resume the auto-close timer\r\n this.resumeTimer();\r\n };\r\n\r\n this.wrapper.addEventListener('pointerdown', onPointerDown);\r\n this.wrapper.addEventListener('pointermove', onPointerMove);\r\n this.wrapper.addEventListener('pointerup', onPointerUp);\r\n this.wrapper.addEventListener('pointercancel', onPointerUp);\r\n\r\n this.cleanupFns.push(() => {\r\n this.wrapper.removeEventListener('pointerdown', onPointerDown);\r\n this.wrapper.removeEventListener('pointermove', onPointerMove);\r\n this.wrapper.removeEventListener('pointerup', onPointerUp);\r\n this.wrapper.removeEventListener('pointercancel', onPointerUp);\r\n });\r\n }\r\n\r\n // ── Built-in robot SVG ─────────────────────────────────────────────────────\r\n\r\n private getBuiltinSVG(): string {\r\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 120\"\r\n width=\"100%\" height=\"100%\" role=\"img\" aria-label=\"Robot\">\r\n <defs>\r\n <linearGradient id=\"rtGrad${this.id}\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\"/>\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\"/>\r\n </linearGradient>\r\n <linearGradient id=\"rtAccent${this.id}\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#7CB9FF\"/>\r\n <stop offset=\"100%\" stop-color=\"#4A90D9\"/>\r\n </linearGradient>\r\n </defs>\r\n <!-- Antenna -->\r\n <line x1=\"50\" y1=\"4\" x2=\"50\" y2=\"18\" stroke=\"#2B3A55\" stroke-width=\"2.5\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"4\" r=\"4\" fill=\"#FF6B6B\"/>\r\n <!-- Head -->\r\n <rect x=\"24\" y=\"18\" width=\"52\" height=\"40\" rx=\"10\" ry=\"10\"\r\n fill=\"url(#rtGrad${this.id})\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <!-- Eyes -->\r\n <circle cx=\"38\" cy=\"36\" r=\"6\" fill=\"#2B3A55\"/>\r\n <circle cx=\"62\" cy=\"36\" r=\"6\" fill=\"#2B3A55\"/>\r\n <circle cx=\"40\" cy=\"34\" r=\"2\" fill=\"#ffffff\"/>\r\n <circle cx=\"64\" cy=\"34\" r=\"2\" fill=\"#ffffff\"/>\r\n <!-- Mouth -->\r\n <path d=\"M 38 50 Q 50 58 62 50\" stroke=\"#2B3A55\" stroke-width=\"2\"\r\n fill=\"none\" stroke-linecap=\"round\"/>\r\n <!-- Neck -->\r\n <rect x=\"44\" y=\"58\" width=\"12\" height=\"8\" rx=\"3\"\r\n fill=\"url(#rtAccent${this.id})\" stroke=\"#2B3A55\" stroke-width=\"1.5\"/>\r\n <!-- Body -->\r\n <rect x=\"22\" y=\"66\" width=\"56\" height=\"44\" rx=\"10\" ry=\"10\"\r\n fill=\"url(#rtGrad${this.id})\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <!-- Chest panel -->\r\n <rect x=\"34\" y=\"76\" width=\"32\" height=\"20\" rx=\"5\"\r\n fill=\"url(#rtAccent${this.id})\" stroke=\"#2B3A55\" stroke-width=\"1.5\"/>\r\n <circle cx=\"42\" cy=\"86\" r=\"3\" fill=\"#FF6B6B\"/>\r\n <circle cx=\"50\" cy=\"86\" r=\"3\" fill=\"#FFD700\"/>\r\n <circle cx=\"58\" cy=\"86\" r=\"3\" fill=\"#6BFF8A\"/>\r\n <!-- Arms -->\r\n <rect x=\"4\" y=\"68\" width=\"18\" height=\"30\" rx=\"9\"\r\n fill=\"url(#rtGrad${this.id})\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <rect x=\"78\" y=\"68\" width=\"18\" height=\"30\" rx=\"9\"\r\n fill=\"url(#rtGrad${this.id})\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <!-- Legs -->\r\n <rect x=\"30\" y=\"110\" width=\"16\" height=\"10\" rx=\"5\"\r\n fill=\"url(#rtAccent${this.id})\" stroke=\"#2B3A55\" stroke-width=\"1.5\"/>\r\n <rect x=\"54\" y=\"110\" width=\"16\" height=\"10\" rx=\"5\"\r\n fill=\"url(#rtAccent${this.id})\" stroke=\"#2B3A55\" stroke-width=\"1.5\"/>\r\n </svg>`;\r\n }\r\n}\r\n\r\n/* ═══════════════════════════════════════════════════════════════════════════\r\n RobotToastManager – global singleton that owns all ToastItems\r\n ═══════════════════════════════════════════════════════════════════════════ */\r\nclass RobotToastManager {\r\n private static _instance: RobotToastManager | null = null;\r\n\r\n private activeToasts: ToastItem[] = [];\r\n private queue: ToastQueueItem[] = [];\r\n private globalLimit = 0; // 0 = unlimited; overridden per-show call\r\n\r\n private constructor() {\r\n new InjectStyles();\r\n }\r\n\r\n static getInstance(): RobotToastManager {\r\n if (!RobotToastManager._instance) {\r\n RobotToastManager._instance = new RobotToastManager();\r\n }\r\n return RobotToastManager._instance;\r\n }\r\n\r\n // ── Public API ─────────────────────────────────────────────────────────────\r\n\r\n show(options: RobotToastOptions): number {\r\n if (typeof document === 'undefined') return -1;\r\n\r\n const id = nextId();\r\n const limit = options.limit ?? this.globalLimit;\r\n\r\n if (limit > 0 && this.activeToasts.length >= limit) {\r\n // Queue it for later\r\n this.queue.push({ options, id });\r\n return id;\r\n }\r\n\r\n this.spawnToast(options, id);\r\n return id;\r\n }\r\n\r\n closeAll(): void {\r\n this.queue = [];\r\n [...this.activeToasts].forEach(t => t.close());\r\n }\r\n\r\n closeById(id: number): void {\r\n const toast = this.activeToasts.find(t => t.id === id);\r\n if (toast) toast.close();\r\n\r\n // Also remove from queue if it hasn't spawned yet\r\n this.queue = this.queue.filter(q => q.id !== id);\r\n }\r\n\r\n // ── Internal ───────────────────────────────────────────────────────────────\r\n\r\n private spawnToast(options: RobotToastOptions, id: number): void {\r\n const toast = new ToastItem(id, options, (doneId) => this.handleRemoved(doneId));\r\n const newestOnTop = options.newestOnTop ?? false;\r\n\r\n if (newestOnTop) {\r\n this.activeToasts.unshift(toast);\r\n } else {\r\n this.activeToasts.push(toast);\r\n }\r\n\r\n this.restack();\r\n }\r\n\r\n private handleRemoved(id: number): void {\r\n this.activeToasts = this.activeToasts.filter(t => t.id !== id);\r\n this.restack();\r\n\r\n // Dequeue next if any\r\n if (this.queue.length > 0) {\r\n const next = this.queue.shift()!;\r\n // Small delay so the stack reflows are visible\r\n setTimeout(() => this.spawnToast(next.options, next.id), 120);\r\n }\r\n }\r\n\r\n /**\r\n * Recalculate the vertical position of every active toast so they stack\r\n * neatly without overlap. Works for both top-* and bottom-* positions.\r\n */\r\n private restack(): void {\r\n // Group by position string\r\n const groups: Record<string, ToastItem[]> = {};\r\n this.activeToasts.forEach(t => {\r\n const pos = (t as any).options.position as string;\r\n if (!groups[pos]) groups[pos] = [];\r\n groups[pos].push(t);\r\n });\r\n\r\n Object.keys(groups).forEach(pos => {\r\n const list = groups[pos];\r\n let offset = 20; // initial edge margin px\r\n\r\n list.forEach((toast) => {\r\n toast.shiftVertical(offset);\r\n offset += toast.getWrapperHeight() + STACK_GAP;\r\n });\r\n });\r\n }\r\n}\r\n\r\nexport { RobotToastManager as default, RobotToastManager };","/**\r\n * RobotToast Utilities v2\r\n * Helper functions for safer access to the RobotToast API.\r\n * Handles async readiness checks, SSR guards, and error boundaries.\r\n * Useful when loading robot-toast via a CDN <script> tag.\r\n */\r\n\r\nimport type { RobotToastOptions, RobotToastAPI } from './types';\r\n\r\n/**\r\n * Wait for window.RobotToast to be available, up to `timeout` ms.\r\n * Resolves immediately if it is already loaded.\r\n * Useful when the library is loaded via a <script> tag and you need\r\n * to call it from another script that may execute first.\r\n */\r\nexport function ensureRobotToastReady(timeout = 5000): Promise<RobotToastAPI> {\r\n return new Promise((resolve, reject) => {\r\n if (typeof window === 'undefined') {\r\n reject(new Error('[RobotToast] Cannot run outside of a browser environment.'));\r\n return;\r\n }\r\n\r\n if (window.RobotToast) {\r\n resolve(window.RobotToast);\r\n return;\r\n }\r\n\r\n const startTime = Date.now();\r\n const interval = setInterval(() => {\r\n if (window.RobotToast) {\r\n clearInterval(interval);\r\n resolve(window.RobotToast);\r\n return;\r\n }\r\n if (Date.now() - startTime >= timeout) {\r\n clearInterval(interval);\r\n reject(new Error(`[RobotToast] Failed to load within ${timeout}ms.`));\r\n }\r\n }, 80);\r\n });\r\n}\r\n\r\n/**\r\n * Show a robot toast notification.\r\n * Waits for the library to be ready before showing.\r\n * Returns the toast id or -1 on failure.\r\n */\r\nexport async function showRobotToast(options: RobotToastOptions): Promise<number> {\r\n try {\r\n const api = await ensureRobotToastReady();\r\n return api.show(options);\r\n } catch (err) {\r\n console.error('[RobotToast] showRobotToast failed:', err);\r\n return -1;\r\n }\r\n}\r\n\r\n/**\r\n * Close all visible toasts and clear the queue.\r\n */\r\nexport async function closeAllRobotToasts(): Promise<void> {\r\n try {\r\n const api = await ensureRobotToastReady();\r\n api.closeAll();\r\n } catch (err) {\r\n console.error('[RobotToast] closeAllRobotToasts failed:', err);\r\n }\r\n}\r\n\r\n/**\r\n * Close a specific toast by the id returned from show().\r\n */\r\nexport async function closeRobotToastById(id: number): Promise<void> {\r\n try {\r\n const api = await ensureRobotToastReady();\r\n api.closeById(id);\r\n } catch (err) {\r\n console.error('[RobotToast] closeRobotToastById failed:', err);\r\n }\r\n}\r\n\r\n/**\r\n * Get the RobotToast API instance.\r\n */\r\nexport async function getRobotToastInstance(): Promise<RobotToastAPI> {\r\n return ensureRobotToastReady();\r\n}","/**\r\n * RobotToast Types & Constants\r\n * Type definitions and constant arrays for the robot toast notification library\r\n */\r\n\r\n/** Array of all valid toast positions */\r\nexport const TOAST_POSITIONS = [\r\n 'top-right',\r\n 'top-left',\r\n 'top-center',\r\n 'bottom-right',\r\n 'bottom-left',\r\n 'bottom-center',\r\n] as const;\r\n\r\n/** Array of all valid toast types */\r\nexport const TOAST_TYPES = ['default', 'info', 'success', 'warning', 'error'] as const;\r\n\r\n/** Array of all valid toast themes */\r\nexport const TOAST_THEMES = ['light', 'dark', 'colored'] as const;\r\n\r\n/** Array of all valid transition animations */\r\nexport const TOAST_TRANSITIONS = ['bounce', 'slide', 'zoom', 'flip'] as const;\r\n\r\n/** Type derived from TOAST_POSITIONS constant */\r\nexport type ToastPosition = typeof TOAST_POSITIONS[number];\r\n\r\n/** Type derived from TOAST_TYPES constant */\r\nexport type ToastType = typeof TOAST_TYPES[number];\r\n\r\n/** Type derived from TOAST_THEMES constant */\r\nexport type ToastTheme = typeof TOAST_THEMES[number];\r\n\r\n/** Type derived from TOAST_TRANSITIONS constant */\r\nexport type TransitionType = typeof TOAST_TRANSITIONS[number];\r\n\r\nexport interface RobotToastOptions {\r\n /** The message text to display in the toast */\r\n message: string;\r\n\r\n /** Auto-close duration in ms, or false to disable. Default: 5000 */\r\n autoClose?: boolean | number;\r\n\r\n /** Position of the toast on screen. Default: 'bottom-right' */\r\n position?: ToastPosition;\r\n\r\n /** Toast type/style. Default: 'default' */\r\n type?: ToastType;\r\n\r\n /** Visual theme. Default: 'light' */\r\n theme?: ToastTheme;\r\n\r\n /**\r\n * Inline style object to apply directly to the message box element.\r\n * This allows runtime customization of colors, fonts, backgrounds, etc.\r\n * Example: { color: 'red', backgroundColor: 'blue' }\r\n * This takes precedence over className for conflicting properties.\r\n */\r\n style?: Record<string, string | number>;\r\n\r\n /** Typing speed in ms per character. 0 = instant. Default: 30 */\r\n typeSpeed?: number;\r\n\r\n /**\r\n * Robot image to display.\r\n * - Built-in: 'wave', 'error', 'success', 'base', 'base2', 'angry', 'angry2', 'shock',\r\n * 'think', 'search', 'loading', 'sleep', 'head-palm', 'type', 'validation', 'validation2'\r\n * (these use embedded data URLs, no external files needed)\r\n * - Custom: any path accessible in your app (e.g., 'dxd/bird.jpg', 'public/my-robot.svg')\r\n * - None: 'none' to hide the robot entirely\r\n * Accepted formats for custom images: svg, png, jpg, jpeg, gif, webp.\r\n * Anything unrecognized falls back to the built-in robot.\r\n */\r\n robotVariant?: string;\r\n\r\n /** Hide the countdown progress bar. Default: false */\r\n hideProgressBar?: boolean;\r\n\r\n /** Pause the auto-close countdown when the window loses focus. Default: true */\r\n pauseOnFocusLoss?: boolean;\r\n\r\n /** Allow the user to drag the toast around the screen. Default: true */\r\n draggable?: boolean;\r\n\r\n /**\r\n * Position the robot near the screen edge (true) or away from it (false).\r\n * - true: robot appears between screen edge and message bubble\r\n * - false: message bubble appears between screen edge and robot\r\n * The position is automatically determined by the toast position and this setting.\r\n * Default: true\r\n */\r\n nearScreen?: boolean;\r\n\r\n /** Pause the auto-close countdown while the cursor is over the toast. Default: true */\r\n pauseOnHover?: boolean;\r\n\r\n /**\r\n * Maximum number of toasts visible simultaneously.\r\n * Excess toasts are queued and shown as soon as a slot opens.\r\n * 0 = unlimited (queue still works, all show in parallel). Default: 0\r\n */\r\n limit?: number;\r\n\r\n /** Stack newest toasts on top of older ones. Default: false */\r\n newestOnTop?: boolean;\r\n\r\n /** Right-to-left layout (message on the right, robot on the left). Default: false */\r\n rtl?: boolean;\r\n\r\n /** Entry / exit transition style. Default: 'bounce' */\r\n transition?: TransitionType;\r\n\r\n /** Called when the toast finishes its enter animation and is fully visible. */\r\n onOpen?: () => void;\r\n\r\n /** Called after the toast has fully exited the screen. */\r\n onClose?: () => void;\r\n}\r\n\r\n/** Internal representation of a queued toast item */\r\nexport interface ToastQueueItem {\r\n options: RobotToastOptions;\r\n id: number;\r\n}\r\n\r\nexport interface RobotToastAPI {\r\n /** Show a toast notification – queued automatically when limit is reached */\r\n show: (options: RobotToastOptions) => number;\r\n /** Immediately close all visible toasts and clear the queue */\r\n closeAll: () => void;\r\n /** Close a specific toast by the id returned from show() */\r\n closeById: (id: number) => void;\r\n /** Get the RobotToastManager instance */\r\n getInstance: () => RobotToastInstance;\r\n}\r\n\r\nexport interface RobotToastInstance {\r\n show: (options: RobotToastOptions) => number;\r\n closeAll: () => void;\r\n closeById: (id: number) => void;\r\n}\r\n\r\ndeclare global {\r\n interface Window {\r\n __robotToastLoaded?: boolean;\r\n __robotToastUtilsLoaded?: boolean;\r\n RobotToast?: RobotToastAPI;\r\n RobotToastUtils?: {\r\n showRobotToast: (options: RobotToastOptions) => Promise<number>;\r\n closeAllRobotToasts: () => Promise<void>;\r\n closeRobotToastById: (id: number) => Promise<void>;\r\n getRobotToastInstance: () => Promise<RobotToastAPI>;\r\n ensureRobotToastReady: (timeout?: number) => Promise<RobotToastAPI>;\r\n };\r\n }\r\n}","/**\r\n * robot-toast v2\r\n * A lightweight, framework-agnostic toast notification library\r\n * with an animated robot character, multi-toast queue, and smooth drag.\r\n *\r\n * ── Basic usage ──────────────────────────────────────────────────────────────\r\n * import { toast } from 'robot-toast';\r\n * toast('Hello 🤖');\r\n * toast({ message: 'Hello!', position: 'top-right', type: 'success' });\r\n *\r\n * ── Typed shorthands ─────────────────────────────────────────────────────────\r\n * toast.success('Saved!');\r\n * toast.error('Something went wrong');\r\n * toast.info('Did you know…');\r\n * toast.warning('Check your input');\r\n *\r\n * ── Class / manager ──────────────────────────────────────────────────────────\r\n * import { RobotToast } from 'robot-toast';\r\n * const manager = RobotToast.getInstance();\r\n * const id = manager.show({ message: 'Hi!' });\r\n * manager.closeById(id);\r\n */\r\n\r\nimport RobotToastManager from './toast';\r\nimport type { RobotToastOptions, RobotToastAPI } from './types';\r\nimport './styles-injector'; // Auto-inject styles\r\n\r\n// ─── Core show function ────────────────────────────────────────────────────\r\n\r\ntype ToastInput = string | RobotToastOptions;\r\n\r\nfunction normalise(input: ToastInput): RobotToastOptions {\r\n return typeof input === 'string' ? { message: input } : input;\r\n}\r\n\r\n/**\r\n * Show a toast notification.\r\n * Accepts either a plain string or a full options object.\r\n * Returns the toast id (useful for closeById).\r\n *\r\n * @example\r\n * toast('Hello 🤖');\r\n * toast({ message: 'Hello!', type: 'success', position: 'top-right' });\r\n */\r\nfunction toast(input: ToastInput): number {\r\n if (typeof window === 'undefined') return -1;\r\n return RobotToastManager.getInstance().show(normalise(input));\r\n}\r\n\r\n// ── Typed shorthand helpers ───────────────────────────────────────────────────\r\ntoast.success = (input: ToastInput): number =>\r\n toast({ ...normalise(input), type: 'success' });\r\n\r\ntoast.error = (input: ToastInput): number =>\r\n toast({ ...normalise(input), type: 'error' });\r\n\r\ntoast.info = (input: ToastInput): number =>\r\n toast({ ...normalise(input), type: 'info' });\r\n\r\ntoast.warning = (input: ToastInput): number =>\r\n toast({ ...normalise(input), type: 'warning' });\r\n\r\n// ── Close helpers ─────────────────────────────────────────────────────────────\r\n/**\r\n * Close all visible toasts and clear the queue.\r\n */\r\ntoast.closeAll = (): void => {\r\n if (typeof window === 'undefined') return;\r\n RobotToastManager.getInstance().closeAll();\r\n};\r\n\r\n/**\r\n * Close a specific toast by the id returned from toast() / toast.show().\r\n */\r\ntoast.closeById = (id: number): void => {\r\n if (typeof window === 'undefined') return;\r\n RobotToastManager.getInstance().closeById(id);\r\n};\r\n\r\nexport { toast };\r\n\r\n// ─── Class export ──────────────────────────────────────────────────────────\r\n\r\nexport { default as RobotToast, RobotToastManager } from './toast';\r\n\r\n// ─── Utilities ─────────────────────────────────────────────────────────────\r\n\r\nexport {\r\n ensureRobotToastReady,\r\n showRobotToast,\r\n closeAllRobotToasts,\r\n getRobotToastInstance,\r\n} from './utils';\r\n\r\n// ─── Types ─────────────────────────────────────────────────────────────────\r\n\r\nexport type {\r\n RobotToastOptions,\r\n RobotToastAPI,\r\n RobotToastInstance,\r\n ToastQueueItem,\r\n ToastPosition,\r\n ToastType,\r\n ToastTheme,\r\n TransitionType,\r\n} from './types';\r\n\r\nexport {\r\n TOAST_POSITIONS,\r\n TOAST_TYPES,\r\n TOAST_THEMES,\r\n TOAST_TRANSITIONS,\r\n} from './types';\r\n\r\n// ─── Built-in robot images ─────────────────────────────────────────────────\r\n\r\nexport { ROBOT_IMAGES } from './robot-data';\r\n\r\n// ─── Global registration (for script-tag / CDN usage) ──────────────────────\r\n\r\nfunction registerGlobal(): void {\r\n if (typeof window === 'undefined') return;\r\n if (window.__robotToastLoaded) return;\r\n window.__robotToastLoaded = true;\r\n\r\n const api: RobotToastAPI = {\r\n show: (options: RobotToastOptions) => RobotToastManager.getInstance().show(options),\r\n closeAll: () => RobotToastManager.getInstance().closeAll(),\r\n closeById: (id: number) => RobotToastManager.getInstance().closeById(id),\r\n getInstance: () => RobotToastManager.getInstance(),\r\n };\r\n\r\n window.RobotToast = api;\r\n}\r\n\r\nregisterGlobal();"]}
1
+ {"version":3,"sources":["../src/styles-injector.ts","../src/robot-data.ts","../src/toast.ts","../src/utils.ts","../src/types.ts","../src/index.ts"],"names":["_InjectStyles","styleId","styles","styleElement","InjectStyles","styles_injector_default","svgToDataUrl","svgContent","ROBOT_SVG","ROBOT_IMAGES","_nextId","nextId","STACK_GAP","ToastItem","id","options","onRemove","resolved","positionIsLeft","initialSide","fn","bottomPx","w","classes","r","variant","img","ext","box","key","value","camelCaseKey","g","closeBtn","e","text","pContainer","pBar","rtl","robotHidden","messageHidden","showMessage","msgEnterClass","onMsgEntered","side","transitionSuffix","enterClass","onRobotEntered","done","afterMsg","exitClass","afterRobot","message","typeSpeed","el","index","active","tick","elapsed","onEnter","onLeave","onBlur","onFocus","onPointerDown","rect","onPointerMove","wRect","maxX","maxY","newLeft","newTop","onPointerUp","midX","centerX","snapToLeft","newRobotSide","finalLeft","finalTop","robotOnLeft","snapClass","_RobotToastManager","limit","toast","t","q","doneId","next","groups","pos","list","offset","RobotToastManager","ensureRobotToastReady","timeout","resolve","reject","startTime","interval","showRobotToast","err","closeAllRobotToasts","getRobotToastInstance","TOAST_POSITIONS","TOAST_TYPES","TOAST_THEMES","TOAST_TRANSITIONS","normalise","input","registerGlobal","api"],"mappings":"aAKA,IAAMA,CAAAA,CAAN,MAAMA,CAAa,CAGjB,WAAA,EAAc,CACR,OAAO,QAAA,CAAa,GAAA,EAAeA,CAAAA,CAAa,QAAA,GAIpDA,CAAAA,CAAa,SAAW,IAAA,CACxB,IAAA,CAAK,SAAA,EAAU,EACjB,CAEQ,SAAA,EAAkB,CACxB,IAAMC,CAAAA,CAAU,oBAAA,CAGhB,GAAI,QAAA,CAAS,cAAA,CAAeA,CAAO,CAAA,CACjC,OAGF,IAAMC,CAAAA,CAAS;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;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AAkB,WAAA,EAAY,CAAE,UAAS,CACzD,SAAA,CAAY7E,CAAAA,EAAe6E,CAAAA,CAAkB,WAAA,EAAY,CAAE,SAAA,CAAU7E,CAAE,EACvE,WAAA,CAAa,IAAM6E,CAAAA,CAAkB,WAAA,EACvC,CAAA,CAEA,MAAA,CAAO,UAAA,CAAakB,EACtB,CAEAD,CAAAA,EAAe","file":"index.js","sourcesContent":["/**\r\n * Style injection for RobotToast\r\n * Injects all required CSS into the document when instantiated\r\n */\r\n\r\nclass InjectStyles {\r\n private static injected = false;\r\n\r\n constructor() {\r\n if (typeof document === 'undefined' || InjectStyles.injected) {\r\n return;\r\n }\r\n\r\n InjectStyles.injected = true;\r\n this.injectCSS();\r\n }\r\n\r\n private injectCSS(): void {\r\n const styleId = 'robot-toast-styles';\r\n\r\n // Check if styles already exist\r\n if (document.getElementById(styleId)) {\r\n return;\r\n }\r\n\r\n const styles = `\r\n/* RobotToast v2 - CSS Styles */\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* WRAPPER - Fixed positioning container for each toast */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n.robot-toast-wrapper {\r\n position: fixed;\r\n display: flex;\r\n align-items: center;\r\n gap: 12px;\r\n opacity: 0;\r\n z-index: 99999;\r\n pointer-events: auto;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-visible {\r\n opacity: 1;\r\n}\r\n\r\n/* Position presets */\r\n.robot-toast-wrapper.robot-toast-top-right {\r\n top: 20px;\r\n right: 20px;\r\n flex-direction: row;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-top-left {\r\n top: 20px;\r\n left: 20px;\r\n flex-direction: row;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-top-center {\r\n top: 20px;\r\n left: 50%;\r\n transform: translateX(-50%);\r\n flex-direction: row;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-bottom-right {\r\n bottom: 20px;\r\n right: 20px;\r\n flex-direction: row;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-bottom-left {\r\n bottom: 20px;\r\n left: 20px;\r\n flex-direction: row;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-bottom-center {\r\n bottom: 20px;\r\n left: 50%;\r\n transform: translateX(-50%);\r\n flex-direction: row;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-rtl {\r\n direction: rtl;\r\n}\r\n\r\n.robot-toast-wrapper.robot-toast-dragging .robot-toast-message {\r\n box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* ROBOT - The animated character */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n.robot-toast-robot {\r\n width: 65px;\r\n height: 70px;\r\n flex-shrink: 0;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n opacity: 0;\r\n}\r\n\r\n.robot-toast-robot img {\r\n width: 100%;\r\n height: 100%;\r\n object-fit: contain;\r\n display: block;\r\n}\r\n\r\n.robot-toast-robot.robot-enter-left {\r\n animation: robot-enter-left 0.7s ease-out forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-enter-right {\r\n animation: robot-enter-right 0.7s ease-out forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-exit-left {\r\n animation: robot-exit-left 0.5s ease-in forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-exit-right {\r\n animation: robot-exit-right 0.5s ease-in forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-idle {\r\n opacity: 1;\r\n animation: robot-idle 2s ease-in-out infinite;\r\n}\r\n\r\n.robot-toast-robot.robot-snap-left {\r\n animation: robot-snap-left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-snap-right {\r\n animation: robot-snap-right 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* MESSAGE BOX - Toast content container */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n.robot-toast-message {\r\n position: relative;\r\n width: fit-content;\r\n min-width: 120px;\r\n max-width: min(400px, calc(100vw - 120px));\r\n padding: 14px 40px 0 14px;\r\n border-radius: 8px;\r\n margin: 0;\r\n opacity: 0;\r\n display: flex;\r\n flex-direction: column;\r\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);\r\n user-select: none;\r\n cursor: default;\r\n box-sizing: border-box;\r\n}\r\n\r\n.robot-toast-message.robot-toast-empty {\r\n display: none;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-light {\r\n background: #ffffff;\r\n color: #333333;\r\n border: 1px solid #e0e0e0;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-dark {\r\n background: #2d2d2d;\r\n color: #f0f0f0;\r\n border: 1px solid #444444;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-colored {\r\n color: #ffffff;\r\n}\r\n\r\n/* Type-specific colors for colored theme */\r\n.robot-toast-message.robot-toast-theme-colored.robot-toast-type-default {\r\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-colored.robot-toast-type-info {\r\n background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-colored.robot-toast-type-success {\r\n background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-colored.robot-toast-type-warning {\r\n background: linear-gradient(135deg, #fb6e3b 0%, #f5a623 100%);\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-colored.robot-toast-type-error {\r\n background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);\r\n}\r\n\r\n/* Light theme type-specific colors */\r\n.robot-toast-message.robot-toast-theme-light.robot-toast-type-info {\r\n border-left: 4px solid #2193b0;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-light.robot-toast-type-success {\r\n border-left: 4px solid #11998e;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-light.robot-toast-type-warning {\r\n border-left: 4px solid #fb6e3b;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-light.robot-toast-type-error {\r\n border-left: 4px solid #eb3349;\r\n}\r\n\r\n/* Dark theme type-specific colors */\r\n.robot-toast-message.robot-toast-theme-dark.robot-toast-type-info {\r\n border-left: 4px solid #6dd5ed;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-dark.robot-toast-type-success {\r\n border-left: 4px solid #38ef7d;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-dark.robot-toast-type-warning {\r\n border-left: 4px solid #f5a623;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-dark.robot-toast-type-error {\r\n border-left: 4px solid #f45c43;\r\n}\r\n\r\n.robot-toast-message.message-enter {\r\n animation: message-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;\r\n}\r\n\r\n.robot-toast-message.message-exit {\r\n animation: message-exit 0.3s ease-in forwards;\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* CLOSE BUTTON */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n.robot-toast-close {\r\n position: absolute;\r\n top: 4px;\r\n right: 4px;\r\n background: none;\r\n border: none;\r\n font-size: 24px;\r\n cursor: pointer;\r\n opacity: 0.6;\r\n transition: opacity 0.2s;\r\n padding: 0;\r\n width: 28px;\r\n height: 28px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n color: currentColor;\r\n}\r\n\r\n.robot-toast-close:hover {\r\n opacity: 1;\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* DRAG HINT */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n.robot-toast-drag-hint {\r\n position: absolute;\r\n left: 8px;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n display: flex;\r\n flex-direction: column;\r\n gap: 3px;\r\n opacity: 0.4;\r\n}\r\n\r\n.robot-toast-drag-hint span {\r\n display: block;\r\n width: 4px;\r\n height: 4px;\r\n border-radius: 50%;\r\n background: currentColor;\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* MESSAGE TEXT */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n.robot-toast-text {\r\n padding-bottom: 12px;\r\n font-size: 14px;\r\n line-height: 1.5;\r\n word-break: break-word;\r\n white-space: pre-wrap;\r\n font-weight: 500;\r\n min-width: 0;\r\n min-height: 1.5em;\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* PROGRESS BAR */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n.robot-toast-progress-container {\r\n width: 100%;\r\n height: 3px;\r\n background: rgba(0, 0, 0, 0.1);\r\n border-radius: 2px;\r\n overflow: hidden;\r\n}\r\n\r\n.robot-toast-message.robot-toast-theme-dark .robot-toast-progress-container {\r\n background: rgba(255, 255, 255, 0.15);\r\n}\r\n\r\n.robot-toast-progress-bar {\r\n height: 100%;\r\n background: currentColor;\r\n transform-origin: left;\r\n transform: scaleX(1); /* ← starts full */\r\n}\r\n\r\n.robot-toast-theme-light.robot-toast-type-success .robot-toast-progress-bar { background: #11998e; }\r\n.robot-toast-theme-light.robot-toast-type-error .robot-toast-progress-bar { background: #eb3349; }\r\n.robot-toast-theme-light.robot-toast-type-warning .robot-toast-progress-bar { background: #fb6e3b; }\r\n.robot-toast-theme-light.robot-toast-type-info .robot-toast-progress-bar { background: #2193b0; }\r\n\r\n/* Dark theme progress bar colors */\r\n.robot-toast-theme-dark.robot-toast-type-success .robot-toast-progress-bar { background: #38ef7d; }\r\n.robot-toast-theme-dark.robot-toast-type-error .robot-toast-progress-bar { background: #f45c43; }\r\n.robot-toast-theme-dark.robot-toast-type-warning .robot-toast-progress-bar { background: #f5a623; }\r\n.robot-toast-theme-dark.robot-toast-type-info .robot-toast-progress-bar { background: #6dd5ed; }\r\n\r\n\r\n.robot-toast-progress-bar.robot-toast-progress-auto {\r\n animation: robot-progress-countdown linear forwards;\r\n opacity: 0.8;\r\n}\r\n\r\n.robot-toast-progress-bar.robot-toast-progress-paused {\r\n animation-play-state: paused !important;\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* ANIMATIONS */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n@keyframes robot-enter-left {\r\n 0% { opacity: 0; transform: translateY(-80px) translateX(-30px) scaleY(1.1) scaleX(0.9); }\r\n 40% { opacity: 1; transform: translateY(10px) scaleY(0.85) scaleX(1.1); }\r\n 65% { transform: translateY(-6px) scaleY(1.05) scaleX(0.97); }\r\n 85% { transform: translateY(2px) scaleY(0.98); }\r\n 100% { opacity: 1; transform: translateY(0) scale(1); }\r\n}\r\n\r\n@keyframes robot-enter-right {\r\n 0% { opacity: 0; transform: translateY(-80px) translateX(30px) scaleY(1.1) scaleX(0.9); }\r\n 40% { opacity: 1; transform: translateY(10px) scaleY(0.85) scaleX(1.1); }\r\n 65% { transform: translateY(-6px) scaleY(1.05) scaleX(0.97); }\r\n 85% { transform: translateY(2px) scaleY(0.98); }\r\n 100% { opacity: 1; transform: translateY(0) scale(1); }\r\n}\r\n\r\n@keyframes robot-exit-left {\r\n 0% { opacity: 1; transform: scale(1); }\r\n 20% { transform: scaleY(0.85) scaleX(1.1) translateY(5px); }\r\n 100% { opacity: 0; transform: translateY(-80px) translateX(-30px) scaleY(1.1) scaleX(0.9); }\r\n}\r\n\r\n@keyframes robot-exit-right {\r\n 0% { opacity: 1; transform: scale(1); }\r\n 20% { transform: scaleY(0.85) scaleX(1.1) translateY(5px); }\r\n 100% { opacity: 0; transform: translateY(-80px) translateX(30px) scaleY(1.1) scaleX(0.9); }\r\n}\r\n\r\n\r\n@keyframes robot-idle {\r\n 0%, 100% {\r\n transform: translateY(0);\r\n }\r\n 50% {\r\n transform: translateY(-4px);\r\n }\r\n}\r\n\r\n@keyframes robot-snap-left {\r\n from {\r\n transform: scaleX(0.8);\r\n }\r\n to {\r\n transform: scaleX(1);\r\n }\r\n}\r\n\r\n@keyframes robot-snap-right {\r\n from {\r\n transform: scaleX(0.8);\r\n }\r\n to {\r\n transform: scaleX(1);\r\n }\r\n}\r\n\r\n@keyframes message-enter {\r\n from {\r\n opacity: 0;\r\n transform: scale(0.8);\r\n }\r\n to {\r\n opacity: 1;\r\n transform: scale(1);\r\n }\r\n}\r\n\r\n@keyframes message-exit {\r\n from {\r\n opacity: 1;\r\n transform: scale(1);\r\n }\r\n to {\r\n opacity: 0;\r\n transform: scale(0.8);\r\n }\r\n}\r\n\r\n@keyframes robot-progress-countdown {\r\n from { transform: scaleX(1); }\r\n to { transform: scaleX(0); }\r\n}\r\n\r\n/* Slide transition animations */\r\n.robot-toast-robot.robot-enter-left-slide {\r\n animation: robot-enter-left-slide 0.5s ease-out forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-enter-right-slide {\r\n animation: robot-enter-right-slide 0.5s ease-out forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-exit-left-slide {\r\n animation: robot-exit-left-slide 0.4s ease-in forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-exit-right-slide {\r\n animation: robot-exit-right-slide 0.4s ease-in forwards;\r\n}\r\n\r\n/* Zoom transition animations */\r\n.robot-toast-robot.robot-enter-left-zoom,\r\n.robot-toast-robot.robot-enter-right-zoom {\r\n animation: robot-enter-zoom 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-exit-left-zoom,\r\n.robot-toast-robot.robot-exit-right-zoom {\r\n animation: robot-exit-zoom 0.4s ease-in forwards;\r\n}\r\n\r\n/* Flip transition animations */\r\n.robot-toast-robot.robot-enter-left-flip {\r\n animation: robot-enter-left-flip 0.6s ease-out forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-enter-right-flip {\r\n animation: robot-enter-right-flip 0.6s ease-out forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-exit-left-flip {\r\n animation: robot-exit-left-flip 0.4s ease-in forwards;\r\n}\r\n\r\n.robot-toast-robot.robot-exit-right-flip {\r\n animation: robot-exit-right-flip 0.4s ease-in forwards;\r\n}\r\n\r\n@keyframes robot-enter-left-slide {\r\n from { opacity: 0; transform: translateX(-60px); }\r\n to { opacity: 1; transform: translateX(0); }\r\n}\r\n\r\n@keyframes robot-enter-right-slide {\r\n from { opacity: 0; transform: translateX(60px); }\r\n to { opacity: 1; transform: translateX(0); }\r\n}\r\n\r\n@keyframes robot-exit-left-slide {\r\n from { opacity: 1; transform: translateX(0); }\r\n to { opacity: 0; transform: translateX(-60px); }\r\n}\r\n\r\n@keyframes robot-exit-right-slide {\r\n from { opacity: 1; transform: translateX(0); }\r\n to { opacity: 0; transform: translateX(60px); }\r\n}\r\n\r\n@keyframes robot-enter-zoom {\r\n from { opacity: 0; transform: scale(0.2); }\r\n to { opacity: 1; transform: scale(1); }\r\n}\r\n\r\n@keyframes robot-exit-zoom {\r\n from { opacity: 1; transform: scale(1); }\r\n to { opacity: 0; transform: scale(0.2); }\r\n}\r\n\r\n@keyframes robot-enter-left-flip {\r\n from { opacity: 0; transform: perspective(600px) rotateY(90deg); }\r\n to { opacity: 1; transform: perspective(600px) rotateY(0deg); }\r\n}\r\n\r\n@keyframes robot-enter-right-flip {\r\n from { opacity: 0; transform: perspective(600px) rotateY(-90deg); }\r\n to { opacity: 1; transform: perspective(600px) rotateY(0deg); }\r\n}\r\n\r\n@keyframes robot-exit-left-flip {\r\n from { opacity: 1; transform: perspective(600px) rotateY(0deg); }\r\n to { opacity: 0; transform: perspective(600px) rotateY(90deg); }\r\n}\r\n\r\n@keyframes robot-exit-right-flip {\r\n from { opacity: 1; transform: perspective(600px) rotateY(0deg); }\r\n to { opacity: 0; transform: perspective(600px) rotateY(-90deg); }\r\n}\r\n\r\n/* message-enter variants */\r\n.robot-toast-message.message-enter-slide {\r\n animation: message-enter-slide 0.35s ease-out forwards;\r\n}\r\n.robot-toast-message.message-enter-zoom {\r\n animation: message-enter-zoom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;\r\n}\r\n.robot-toast-message.message-enter-flip {\r\n animation: message-enter-flip 0.4s ease-out forwards;\r\n}\r\n\r\n@keyframes message-enter-slide {\r\n from { opacity: 0; transform: translateY(10px); }\r\n to { opacity: 1; transform: translateY(0); }\r\n}\r\n@keyframes message-enter-zoom {\r\n from { opacity: 0; transform: scale(0.5); }\r\n to { opacity: 1; transform: scale(1); }\r\n}\r\n@keyframes message-enter-flip {\r\n from { opacity: 0; transform: perspective(400px) rotateX(-20deg); }\r\n to { opacity: 1; transform: perspective(400px) rotateX(0deg); }\r\n}\r\n\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n/* RESPONSIVE - Mobile / small-screen tweaks */\r\n/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */\r\n\r\n@media (max-width: 600px) {\r\n .robot-toast-wrapper {\r\n gap: 8px;\r\n max-width: calc(100vw - 24px);\r\n }\r\n\r\n .robot-toast-wrapper.robot-toast-top-right,\r\n .robot-toast-wrapper.robot-toast-bottom-right {\r\n right: 12px;\r\n }\r\n .robot-toast-wrapper.robot-toast-top-left,\r\n .robot-toast-wrapper.robot-toast-bottom-left {\r\n left: 12px;\r\n }\r\n .robot-toast-wrapper.robot-toast-top-right,\r\n .robot-toast-wrapper.robot-toast-top-left,\r\n .robot-toast-wrapper.robot-toast-top-center { top: 12px; }\r\n .robot-toast-wrapper.robot-toast-bottom-right,\r\n .robot-toast-wrapper.robot-toast-bottom-left,\r\n .robot-toast-wrapper.robot-toast-bottom-center { bottom: 12px; }\r\n\r\n .robot-toast-wrapper.robot-toast-top-center,\r\n .robot-toast-wrapper.robot-toast-bottom-center {\r\n width: calc(100vw - 24px);\r\n justify-content: center;\r\n }\r\n\r\n .robot-toast-robot {\r\n width: 48px;\r\n height: 52px;\r\n }\r\n\r\n .robot-toast-message {\r\n min-width: 100px;\r\n max-width: calc(100vw - 48px - 24px - 8px);\r\n font-size: 13px;\r\n padding: 12px 36px 0 12px;\r\n }\r\n\r\n .robot-toast-text {\r\n font-size: 13px;\r\n padding-bottom: 10px;\r\n }\r\n\r\n .robot-toast-close {\r\n width: 24px;\r\n height: 24px;\r\n font-size: 20px;\r\n }\r\n}\r\n\r\n@media (max-width: 360px) {\r\n .robot-toast-robot {\r\n width: 40px;\r\n height: 44px;\r\n }\r\n .robot-toast-message {\r\n max-width: calc(100vw - 40px - 20px - 8px);\r\n }\r\n}\r\n `;\r\n\r\n const styleElement = document.createElement('style');\r\n styleElement.id = styleId;\r\n styleElement.textContent = styles;\r\n document.head.appendChild(styleElement);\r\n }\r\n}\r\n\r\nexport default InjectStyles;\r\n","/**\r\n * Built-in robot SVG images as base64 data URLs\r\n * These are embedded directly in the package, no external files needed\r\n */\r\n\r\nfunction svgToDataUrl(svgContent: string): string {\r\n return `data:image/svg+xml;utf8,${encodeURIComponent(svgContent)}`;\r\n}\r\n\r\nconst ROBOT_SVG = {\r\n wave: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n \r\n <path d=\"M 25 60 Q 15 65, 20 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 95 45, 85 25\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#FF6B6B\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <circle cx=\"40\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n <path d=\"M 55 38 Q 60 33, 65 38\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n\r\n base: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n \r\n <path d=\"M 25 60 Q 15 70, 25 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 85 70, 75 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#4D96FF\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <circle cx=\"40\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n <circle cx=\"60\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n \r\n <line x1=\"45\" y1=\"46\" x2=\"55\" y2=\"46\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n\r\n success: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <circle cx=\"20\" cy=\"20\" r=\"3\" fill=\"#FF6B6B\" />\r\n <rect x=\"80\" y=\"25\" width=\"6\" height=\"6\" fill=\"#4D96FF\" transform=\"rotate(45 80 25)\"/>\r\n <circle cx=\"75\" cy=\"10\" r=\"2\" fill=\"#FFD93D\" />\r\n\r\n <path d=\"M 25 55 Q 10 40, 20 20\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 55 Q 90 40, 80 20\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"50\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"15\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"15\" x2=\"50\" y2=\"5\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"3\" r=\"4\" fill=\"#4ECB71\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <path d=\"M 35 32 Q 40 25, 45 32\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n <path d=\"M 55 32 Q 60 25, 65 32\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n\r\n error: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n \r\n <path d=\"M 85 15 L 95 35 L 75 35 Z\" fill=\"#FF6B6B\" stroke=\"#2B3A55\" stroke-width=\"2\" stroke-linejoin=\"round\"/>\r\n <text x=\"85\" y=\"32\" font-family=\"sans-serif\" font-size=\"14\" fill=\"#FFF\" font-weight=\"bold\" text-anchor=\"middle\">!</text>\r\n\r\n <path d=\"M 25 55 Q 10 50, 20 35\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 90 70, 80 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"23\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"48\" y1=\"20\" x2=\"40\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"40\" cy=\"8\" r=\"4\" fill=\"#FF6B6B\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <path d=\"M 34 34 L 42 42 M 42 34 L 34 42\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n <path d=\"M 54 34 L 62 42 M 62 34 L 54 42\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n \r\n <path d=\"M 38 48 L 42 45 L 46 48 L 50 45 L 54 48 L 58 45\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n</svg>`,\r\n\r\n angry: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <path d=\"M 20 30 Q 10 25, 15 15 Q 25 10, 30 20\" fill=\"none\" stroke=\"#A8B2C1\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n <path d=\"M 80 30 Q 90 25, 85 15 Q 75 10, 70 20\" fill=\"none\" stroke=\"#A8B2C1\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n \r\n <path d=\"M 25 60 L 15 75\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"15\" cy=\"75\" r=\"5\" fill=\"#2B3A55\"/>\r\n <path d=\"M 75 60 L 85 75\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"85\" cy=\"75\" r=\"5\" fill=\"#2B3A55\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"25\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"25\" x2=\"50\" y2=\"15\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"13\" r=\"4\" fill=\"#FF3333\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <path d=\"M 32 35 L 48 42\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 68 35 L 52 42\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"40\" y=\"48\" width=\"20\" height=\"6\" rx=\"2\" fill=\"#FFF\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <line x1=\"45\" y1=\"48\" x2=\"45\" y2=\"54\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <line x1=\"50\" y1=\"48\" x2=\"50\" y2=\"54\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <line x1=\"55\" y1=\"48\" x2=\"55\" y2=\"54\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n</svg>`,\r\n\r\n angry2: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <path d=\"M 15 30 Q 10 20, 20 15 M 20 35 Q 15 25, 25 20\" fill=\"none\" stroke=\"#FF6B6B\" stroke-width=\"3\" stroke-linecap=\"round\" opacity=\"0.7\"/>\r\n <path d=\"M 85 30 Q 90 20, 80 15 M 80 35 Q 85 25, 75 20\" fill=\"none\" stroke=\"#FF6B6B\" stroke-width=\"3\" stroke-linecap=\"round\" opacity=\"0.7\"/>\r\n\r\n <path d=\"M 25 60 L 20 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 L 80 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#FF6B6B\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <circle cx=\"40\" cy=\"38\" r=\"3\" fill=\"#2B3A55\"/>\r\n <circle cx=\"60\" cy=\"38\" r=\"3\" fill=\"#2B3A55\"/>\r\n <path d=\"M 32 32 L 45 36 M 68 32 L 55 36\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <path d=\"M 40 50 Q 50 44, 60 50\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n\r\n shock: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <path d=\"M 75 15 Q 95 15, 95 30 Q 95 45, 80 45 L 70 50 L 72 42 Q 60 40, 60 30 Q 60 15, 75 15 Z\" fill=\"#FFF\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n\r\n <path d=\"M 25 60 Q 15 70, 30 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 85 40, 70 25\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#4D96FF\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <circle cx=\"40\" cy=\"36\" r=\"4\" fill=\"#2B3A55\"/>\r\n <circle cx=\"60\" cy=\"36\" r=\"4\" fill=\"#2B3A55\"/>\r\n <ellipse cx=\"50\" cy=\"46\" rx=\"6\" ry=\"3\" fill=\"#2B3A55\"/>\r\n</svg>`,\r\n\r\n think: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <circle cx=\"80\" cy=\"20\" r=\"10\" fill=\"#FFF\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n <text x=\"80\" y=\"25\" font-family=\"sans-serif\" font-size=\"14\" fill=\"#2B3A55\" font-weight=\"bold\" text-anchor=\"middle\">?</text>\r\n\r\n <path d=\"M 25 60 Q 15 65, 20 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 85 55, 65 50\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <g transform=\"rotate(-5 50 37)\">\r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#FFD93D\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <circle cx=\"40\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n <circle cx=\"60\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n </g>\r\n</svg>`,\r\n\r\n search: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <path d=\"M 40 38 L 10 20 A 30 30 0 0 0 10 56 Z\" fill=\"#4ECB71\" opacity=\"0.3\"/>\r\n\r\n <path d=\"M 25 60 Q 15 70, 25 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 85 70, 75 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#4ECB71\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <circle cx=\"60\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n \r\n <circle cx=\"40\" cy=\"38\" r=\"6\" fill=\"none\" stroke=\"#4ECB71\" stroke-width=\"2\"/>\r\n <circle cx=\"40\" cy=\"38\" r=\"2\" fill=\"#4ECB71\"/>\r\n</svg>`,\r\n\r\n loading: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <g stroke=\"#2B3A55\" stroke-width=\"2\" fill=\"#FFD93D\">\r\n <circle cx=\"85\" cy=\"30\" r=\"6\" />\r\n <path d=\"M85 22V24 M85 36V38 M93 30H91 M77 30H79\" stroke-linecap=\"round\"/>\r\n <circle cx=\"15\" cy=\"75\" r=\"5\" fill=\"#A8B2C1\"/>\r\n <path d=\"M15 68V70 M15 80V82 M22 75H20 M8 75H10\" stroke-linecap=\"round\"/>\r\n </g>\r\n\r\n <path d=\"M 25 60 Q 15 55, 30 45\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 28 43 L 22 37 M 32 47 L 36 43\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n\r\n <path d=\"M 75 60 Q 85 65, 80 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#FFD93D\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <circle cx=\"40\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n <circle cx=\"60\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n</svg>`,\r\n\r\n sleep: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <text x=\"75\" y=\"25\" font-family=\"sans-serif\" font-size=\"12\" fill=\"#2B3A55\" font-weight=\"bold\">Z</text>\r\n <text x=\"85\" y=\"15\" font-family=\"sans-serif\" font-size=\"10\" fill=\"#2B3A55\" font-weight=\"bold\">z</text>\r\n\r\n <path d=\"M 25 60 Q 15 70, 25 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 85 70, 75 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"25\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <path d=\"M 50 25 Q 45 15, 35 12\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"35\" cy=\"12\" r=\"4\" fill=\"#A8B2C1\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <path d=\"M 35 42 Q 40 46, 45 42\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n <path d=\"M 55 42 Q 60 46, 65 42\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n\r\n 'head-palm': `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n \r\n <path d=\"M 25 60 Q 20 40, 35 35\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 80 70, 78 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"22\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <path d=\"M 50 22 Q 55 12, 65 15\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"65\" cy=\"15\" r=\"4\" fill=\"#A8B2C1\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <path d=\"M 55 40 Q 60 36, 65 40\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"30\" y=\"28\" width=\"20\" height=\"20\" rx=\"8\" fill=\"#E2F0FF\" stroke=\"#2B3A55\" stroke-width=\"4\" transform=\"rotate(-10 40 38)\"/>\r\n\r\n <line x1=\"55\" y1=\"50\" x2=\"65\" y2=\"50\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n\r\n type: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n \r\n <rect x=\"30\" y=\"80\" width=\"40\" height=\"10\" rx=\"2\" fill=\"#A8B2C1\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n <line x1=\"35\" y1=\"85\" x2=\"65\" y2=\"85\" stroke=\"#2B3A55\" stroke-width=\"2\" stroke-dasharray=\"4 2\"/>\r\n\r\n <path d=\"M 25 60 Q 25 75, 40 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 75 60 Q 75 75, 60 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"22\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"22\" x2=\"50\" y2=\"12\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"10\" r=\"4\" fill=\"#4D96FF\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <ellipse cx=\"40\" cy=\"40\" rx=\"4\" ry=\"2\" fill=\"#2B3A55\"/>\r\n <ellipse cx=\"60\" cy=\"40\" rx=\"4\" ry=\"2\" fill=\"#2B3A55\"/>\r\n</svg>`,\r\n\r\n validation: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n \r\n <path d=\"M 25 60 Q 15 70, 25 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n\r\n <path d=\"M 75 60 Q 85 50, 85 35\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"80\" cy=\"32\" r=\"5\" fill=\"#B8D8FF\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#4ECB71\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <circle cx=\"40\" cy=\"36\" r=\"4\" fill=\"#2B3A55\"/>\r\n <path d=\"M 55 36 Q 60 31, 65 36\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n <path d=\"M 40 46 Q 50 52, 60 46\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n \r\n validation2: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\" />\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <path d=\"M 25 60 Q 15 70, 25 85\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n\r\n <path d=\"M 75 60 Q 85 55, 85 45\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <path d=\"M 85 45 C 80 45, 78 40, 80 35 C 82 30, 88 30, 90 35 C 92 40, 95 40, 95 48 C 95 52, 90 55, 85 52\" fill=\"#E2F0FF\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n\r\n \r\n <rect x=\"35\" y=\"55\" width=\"30\" height=\"30\" rx=\"8\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <rect x=\"25\" y=\"20\" width=\"50\" height=\"35\" rx=\"12\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n \r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"10\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"8\" r=\"4\" fill=\"#4ECB71\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n \r\n <path d=\"M 35 36 Q 40 42, 45 36\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n <path d=\"M 55 36 Q 60 42, 65 36\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n\r\n base2: `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\" width=\"100%\" height=\"100%\">\r\n <defs>\r\n <linearGradient id=\"roboGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#FFFFFF\" />\r\n <stop offset=\"100%\" stop-color=\"#D0E3FF\" />\r\n </linearGradient>\r\n \r\n <linearGradient id=\"darkGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#A8B2C1\" />\r\n <stop offset=\"100%\" stop-color=\"#7B8CA5\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <line x1=\"50\" y1=\"20\" x2=\"50\" y2=\"6\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"6\" r=\"5\" fill=\"#FFD93D\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n\r\n <path d=\"M 32 60 Q 15 65, 18 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"18\" cy=\"80\" r=\"4\" fill=\"url(#darkGrad)\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n \r\n <path d=\"M 68 60 Q 85 65, 82 80\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linecap=\"round\"/>\r\n <circle cx=\"82\" cy=\"80\" r=\"4\" fill=\"url(#darkGrad)\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n\r\n <rect x=\"42\" y=\"48\" width=\"16\" height=\"12\" fill=\"url(#darkGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n\r\n <path d=\"M 36 56 L 64 56 L 68 85 C 68 90, 62 94, 50 94 C 38 94, 32 90, 32 85 Z\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\" stroke-linejoin=\"round\"/>\r\n \r\n <rect x=\"42\" y=\"66\" width=\"16\" height=\"8\" rx=\"4\" fill=\"#4D96FF\" stroke=\"#2B3A55\" stroke-width=\"3\"/>\r\n\r\n <rect x=\"16\" y=\"28\" width=\"10\" height=\"16\" rx=\"3\" fill=\"url(#darkGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n <rect x=\"74\" y=\"28\" width=\"10\" height=\"16\" rx=\"3\" fill=\"url(#darkGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n\r\n <rect x=\"22\" y=\"20\" width=\"56\" height=\"34\" rx=\"14\" fill=\"url(#roboGrad)\" stroke=\"#2B3A55\" stroke-width=\"4\"/>\r\n\r\n <circle cx=\"36\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n <circle cx=\"64\" cy=\"38\" r=\"4\" fill=\"#2B3A55\"/>\r\n \r\n <ellipse cx=\"28\" cy=\"43\" rx=\"4\" ry=\"2\" fill=\"#FF6B6B\" opacity=\"0.5\"/>\r\n <ellipse cx=\"72\" cy=\"43\" rx=\"4\" ry=\"2\" fill=\"#FF6B6B\" opacity=\"0.5\"/>\r\n\r\n <path d=\"M 46 44 Q 50 48, 54 44\" fill=\"none\" stroke=\"#2B3A55\" stroke-width=\"3\" stroke-linecap=\"round\"/>\r\n</svg>`,\r\n};\r\n\r\nexport const ROBOT_IMAGES = {\r\n wave: svgToDataUrl(ROBOT_SVG.wave),\r\n base: svgToDataUrl(ROBOT_SVG.base),\r\n base2: svgToDataUrl(ROBOT_SVG.base2),\r\n success: svgToDataUrl(ROBOT_SVG.success),\r\n error: svgToDataUrl(ROBOT_SVG.error),\r\n angry: svgToDataUrl(ROBOT_SVG.angry),\r\n angry2: svgToDataUrl(ROBOT_SVG.angry2),\r\n shock: svgToDataUrl(ROBOT_SVG.shock),\r\n think: svgToDataUrl(ROBOT_SVG.think),\r\n search: svgToDataUrl(ROBOT_SVG.search),\r\n loading: svgToDataUrl(ROBOT_SVG.loading),\r\n sleep: svgToDataUrl(ROBOT_SVG.sleep),\r\n 'head-palm': svgToDataUrl(ROBOT_SVG['head-palm']),\r\n type: svgToDataUrl(ROBOT_SVG.type),\r\n validation: svgToDataUrl(ROBOT_SVG.validation),\r\n validation2: svgToDataUrl(ROBOT_SVG.validation2),\r\n} as const;\r\n","/**\r\n * RobotToast v2\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * • Multi-toast support with configurable limit + queue\r\n * • Each toast is a self-contained ToastItem instance – no shared mutable state\r\n * • Sequenced robot enter → message pop-in, message pop-out → robot exit\r\n * • Full XY drag with viewport clamping; on drop the robot snaps to the\r\n * nearest screen edge (left / right) with a personality animation\r\n * • Progress bar auto-animates for the countdown; pauses correctly on hover\r\n * and drag; resumes with exact remaining time\r\n * • All event listeners are tracked and fully removed on close\r\n * • SVG-only enforcement for custom robot images; always renders at fixed size\r\n * • SSR-safe (all DOM access is guarded by typeof window / document checks)\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n */\r\n\r\nimport type { RobotToastOptions, ToastQueueItem } from './types';\r\nimport InjectStyles from './styles-injector';\r\nimport { ROBOT_IMAGES } from './robot-data';\r\n\r\n// ─── Unique ID counter ────────────────────────────────────────────────────────\r\nlet _nextId = 1;\r\nfunction nextId(): number { return _nextId++; }\r\n\r\n// ─── Vertical offset step between stacked toasts (px) ────────────────────────\r\nconst STACK_GAP = 16;\r\n\r\n/* ═══════════════════════════════════════════════════════════════════════════\r\n ToastItem – one live toast on screen\r\n ═══════════════════════════════════════════════════════════════════════════ */\r\nclass ToastItem {\r\n readonly id: number;\r\n private options: {\r\n message: string;\r\n autoClose: boolean | number;\r\n position: NonNullable<RobotToastOptions['position']>;\r\n type: NonNullable<RobotToastOptions['type']>;\r\n theme: NonNullable<RobotToastOptions['theme']>;\r\n style?: Record<string, string | number>;\r\n typeSpeed: number;\r\n robotVariant: string;\r\n hideProgressBar: boolean;\r\n pauseOnFocusLoss: boolean;\r\n draggable: boolean;\r\n nearScreen: boolean;\r\n pauseOnHover: boolean;\r\n rtl: boolean;\r\n transition: NonNullable<RobotToastOptions['transition']>;\r\n onOpen?: () => void;\r\n onClose?: () => void;\r\n };\r\n\r\n // DOM refs\r\n private wrapper: HTMLDivElement;\r\n private robotEl: HTMLDivElement;\r\n private messageBox: HTMLDivElement;\r\n private progressBar: HTMLDivElement | null = null;\r\n private messageText: HTMLDivElement;\r\n\r\n // Timer state\r\n private autoCloseDuration: number; // ms; 0 = no auto-close\r\n private remainingTime: number; // ms left on the countdown\r\n private timerStart: number | null = null; // when the current timer was set\r\n private closeTimeout: ReturnType<typeof setTimeout> | null = null;\r\n\r\n // Interaction state\r\n private isDragging = false;\r\n private dragOffsetX = 0;\r\n private dragOffsetY = 0;\r\n private currentRobotSide: 'left' | 'right';\r\n private isHovered = false;\r\n private isFocusLost = false;\r\n private isClosed = false;\r\n\r\n // Cleanup\r\n private cleanupFns: Array<() => void> = [];\r\n\r\n // Callback to notify the manager when this toast dies\r\n private onRemove: (id: number) => void;\r\n\r\n constructor(id: number, options: RobotToastOptions, onRemove: (id: number) => void) {\r\n this.id = id;\r\n this.onRemove = onRemove;\r\n\r\n // ── Resolve all options with defaults ──────────────────────────────────\r\n const resolved = {\r\n message: options.message,\r\n autoClose: options.autoClose ?? 5000,\r\n position: options.position ?? 'bottom-right',\r\n type: options.type ?? 'default',\r\n theme: options.theme ?? 'light',\r\n style: options.style,\r\n typeSpeed: options.typeSpeed ?? 30,\r\n robotVariant: options.robotVariant ?? '',\r\n hideProgressBar: options.hideProgressBar ?? false,\r\n pauseOnFocusLoss: options.pauseOnFocusLoss ?? true,\r\n draggable: options.draggable ?? true,\r\n nearScreen: options.nearScreen ?? true,\r\n pauseOnHover: options.pauseOnHover ?? true,\r\n rtl: options.rtl ?? false,\r\n transition: options.transition ?? 'bounce',\r\n onOpen: options.onOpen,\r\n onClose: options.onClose,\r\n };\r\n\r\n this.options = resolved;\r\n \r\n // Determine initial robot side based on nearScreen\r\n // nearScreen: true → robot near screen edge (position's side)\r\n // nearScreen: false → robot away from screen edge (opposite side)\r\n const positionIsLeft = resolved.position.includes('left');\r\n \r\n let initialSide: 'left' | 'right';\r\n if (resolved.nearScreen) {\r\n // Robot near edge: follow position\r\n initialSide = positionIsLeft ? 'left' : 'right';\r\n } else {\r\n // Robot away from edge: opposite of position\r\n initialSide = positionIsLeft ? 'right' : 'left';\r\n }\r\n this.currentRobotSide = initialSide;\r\n this.autoCloseDuration = typeof resolved.autoClose === 'number'\r\n ? resolved.autoClose\r\n : (resolved.autoClose ? 5000 : 0);\r\n this.remainingTime = this.autoCloseDuration;\r\n\r\n // ── Build DOM ──────────────────────────────────────────────────────────\r\n this.wrapper = this.buildWrapper();\r\n this.robotEl = this.buildRobot();\r\n this.messageBox = this.buildMessageBox();\r\n this.messageText = this.messageBox.querySelector('.robot-toast-text')!;\r\n this.progressBar = this.messageBox.querySelector('.robot-toast-progress-bar');\r\n\r\n // Empty message → hide message box entirely (only the robot shows)\r\n if (resolved.message === '') {\r\n this.messageBox.classList.add('robot-toast-empty');\r\n }\r\n\r\n this.assembleLayout();\r\n document.body.appendChild(this.wrapper);\r\n\r\n // ── Wire interactions ──────────────────────────────────────────────────\r\n if (resolved.draggable) this.initDrag();\r\n if (resolved.pauseOnFocusLoss) this.initFocusWatcher();\r\n if (resolved.pauseOnHover) this.initHoverWatcher();\r\n\r\n // ── Kick off the entrance sequence ─────────────────────────────────────\r\n requestAnimationFrame(() => this.playEntrance());\r\n }\r\n\r\n // ── Public API ─────────────────────────────────────────────────────────────\r\n\r\n close(): void {\r\n if (this.isClosed) return;\r\n this.isClosed = true;\r\n\r\n this.cancelTimer();\r\n this.cleanupFns.forEach(fn => fn());\r\n this.cleanupFns = [];\r\n\r\n this.playExit(() => {\r\n if (this.wrapper.parentNode) {\r\n this.wrapper.parentNode.removeChild(this.wrapper);\r\n }\r\n this.options.onClose?.();\r\n this.onRemove(this.id);\r\n });\r\n }\r\n\r\n /** Shift this toast vertically by `delta` px (used by manager for stacking) */\r\n shiftVertical(bottomPx: number): void {\r\n const pos = this.options.position;\r\n if (pos.startsWith('bottom')) {\r\n this.wrapper.style.bottom = `${bottomPx}px`;\r\n } else {\r\n this.wrapper.style.top = `${bottomPx}px`;\r\n }\r\n }\r\n\r\n getWrapperHeight(): number {\r\n return this.wrapper.getBoundingClientRect().height || 90;\r\n }\r\n\r\n // ── DOM builders ───────────────────────────────────────────────────────────\r\n\r\n private buildWrapper(): HTMLDivElement {\r\n const w = document.createElement('div');\r\n const classes = ['robot-toast-wrapper', `robot-toast-${this.options.position}`];\r\n if (this.options.rtl) classes.push('robot-toast-rtl');\r\n w.className = classes.join(' ');\r\n return w;\r\n }\r\n\r\n private buildRobot(): HTMLDivElement {\r\n const r = document.createElement('div');\r\n r.className = 'robot-toast-robot';\r\n\r\n const variant = this.options.robotVariant;\r\n\r\n if (variant === 'none') {\r\n // 'none' = no robot image at all, hide the container\r\n r.style.display = 'none';\r\n } else if (variant) {\r\n // Check if it's a built-in robot (data URL)\r\n if (variant in ROBOT_IMAGES) {\r\n // Use embedded data URL\r\n const img = document.createElement('img');\r\n img.src = ROBOT_IMAGES[variant as keyof typeof ROBOT_IMAGES];\r\n img.alt = 'Robot';\r\n img.setAttribute('width', '65');\r\n img.setAttribute('height', '70');\r\n img.style.cssText = 'width:100%;height:100%;object-fit:contain;display:block;';\r\n img.onerror = () => { r.innerHTML = this.getBuiltinSVG(); };\r\n r.appendChild(img);\r\n } else {\r\n // Custom image – user provides full path, fall back to built-in SVG on error\r\n const ALLOWED_FORMATS = ['.svg', '.png', '.jpg', '.jpeg', '.gif', '.webp'];\r\n const isAllowed = ALLOWED_FORMATS.some(ext => variant.toLowerCase().endsWith(ext));\r\n\r\n if (!isAllowed) {\r\n r.innerHTML = this.getBuiltinSVG();\r\n } else {\r\n const img = document.createElement('img');\r\n img.src = variant; // User provides full path directly\r\n img.alt = 'Robot';\r\n img.setAttribute('width', '65');\r\n img.setAttribute('height', '70');\r\n img.style.cssText = 'width:100%;height:100%;object-fit:contain;display:block;';\r\n img.onerror = () => { r.innerHTML = this.getBuiltinSVG(); };\r\n r.appendChild(img);\r\n }\r\n }\r\n } else {\r\n // Empty string / undefined = built-in robot\r\n r.innerHTML = this.getBuiltinSVG();\r\n }\r\n\r\n return r;\r\n }\r\n\r\n private buildMessageBox(): HTMLDivElement {\r\n const box = document.createElement('div');\r\n const classes = [\r\n 'robot-toast-message',\r\n `robot-toast-type-${this.options.type}`,\r\n `robot-toast-theme-${this.options.theme}`,\r\n ].filter(Boolean);\r\n box.className = classes.join(' ');\r\n box.style.cursor = this.options.draggable ? 'grab' : 'default';\r\n\r\n // Apply inline styles if provided (takes precedence over theme colors)\r\n if (this.options.style) {\r\n Object.entries(this.options.style).forEach(([key, value]) => {\r\n const camelCaseKey = key.replace(/-([a-z])/g, g => g[1].toUpperCase());\r\n (box.style as any)[camelCaseKey] = value;\r\n });\r\n }\r\n\r\n // Close button\r\n const closeBtn = document.createElement('button');\r\n closeBtn.className = 'robot-toast-close';\r\n closeBtn.innerHTML = '&times;';\r\n closeBtn.title = 'Dismiss';\r\n closeBtn.addEventListener('click', (e) => { e.stopPropagation(); this.close(); });\r\n box.appendChild(closeBtn);\r\n\r\n // Message text\r\n const text = document.createElement('div');\r\n text.className = 'robot-toast-text';\r\n box.appendChild(text);\r\n\r\n // Progress bar\r\n const pContainer = document.createElement('div');\r\n pContainer.className = 'robot-toast-progress-container';\r\n if (this.options.hideProgressBar) pContainer.style.display = 'none';\r\n\r\n const pBar = document.createElement('div');\r\n pBar.className = 'robot-toast-progress-bar';\r\n\r\n pContainer.appendChild(pBar);\r\n box.appendChild(pContainer);\r\n\r\n return box;\r\n }\r\n\r\n private assembleLayout(): void {\r\n const { rtl } = this.options;\r\n this.wrapper.innerHTML = '';\r\n\r\n // Decide order: rtl flips everything, robot side controls natural order\r\n const robotOnLeft = rtl ? this.currentRobotSide === 'right' : this.currentRobotSide === 'left';\r\n\r\n if (robotOnLeft) {\r\n this.wrapper.appendChild(this.robotEl);\r\n this.wrapper.appendChild(this.messageBox);\r\n } else {\r\n this.wrapper.appendChild(this.messageBox);\r\n this.wrapper.appendChild(this.robotEl);\r\n }\r\n }\r\n\r\n // ── Sequenced animations ───────────────────────────────────────────────────\r\n\r\n private playEntrance(): void {\r\n // Step 1 – wrapper becomes visible\r\n this.wrapper.classList.add('robot-toast-visible');\r\n\r\n const robotHidden = this.options.robotVariant === 'none';\r\n const messageHidden = this.options.message === '';\r\n\r\n const showMessage = () => {\r\n if (messageHidden) {\r\n // No text box – skip pop-in, still fire onOpen and start timer\r\n this.options.onOpen?.();\r\n this.afterTypingComplete();\r\n return;\r\n }\r\n // Message pops in\r\n const msgEnterClass = this.options.transition === 'bounce'\r\n ? 'message-enter'\r\n : `message-enter-${this.options.transition}`;\r\n this.messageBox.classList.add(msgEnterClass);\r\n\r\n const onMsgEntered = () => {\r\n this.messageBox.removeEventListener('animationend', onMsgEntered);\r\n this.messageBox.classList.remove(msgEnterClass);\r\n this.messageBox.style.opacity = '1';\r\n this.messageBox.style.transform = 'none';\r\n\r\n this.options.onOpen?.();\r\n this.startTyping();\r\n };\r\n this.messageBox.addEventListener('animationend', onMsgEntered, { once: true });\r\n };\r\n\r\n if (robotHidden) {\r\n // No robot – skip robot entrance, go straight to message\r\n showMessage();\r\n } else {\r\n // Step 2 – robot runs in with selected transition style\r\n const side = this.currentRobotSide === 'left' ? 'left' : 'right';\r\n const transitionSuffix = this.options.transition !== 'bounce' ? `-${this.options.transition}` : '';\r\n const enterClass = `robot-enter-${side}${transitionSuffix}`;\r\n this.robotEl.classList.add(enterClass);\r\n\r\n const onRobotEntered = () => {\r\n this.robotEl.removeEventListener('animationend', onRobotEntered);\r\n this.robotEl.style.opacity = '1';\r\n this.robotEl.classList.remove(enterClass);\r\n this.robotEl.classList.add('robot-idle');\r\n showMessage();\r\n };\r\n this.robotEl.addEventListener('animationend', onRobotEntered, { once: true });\r\n }\r\n }\r\n\r\n private playExit(done: () => void): void {\r\n const robotHidden = this.options.robotVariant === 'none';\r\n const messageHidden = this.options.message === '';\r\n\r\n const afterMsg = () => {\r\n this.messageBox.removeEventListener('animationend', afterMsg);\r\n\r\n if (robotHidden) {\r\n // No robot – skip robot exit, just fade wrapper\r\n this.wrapper.classList.remove('robot-toast-visible');\r\n setTimeout(done, 260);\r\n } else {\r\n this.robotEl.classList.remove('robot-idle', 'robot-snap-left', 'robot-snap-right');\r\n\r\n // Step 2 – robot runs out with selected transition style\r\n const side = this.currentRobotSide === 'left' ? 'left' : 'right';\r\n const transitionSuffix = this.options.transition !== 'bounce' ? `-${this.options.transition}` : '';\r\n const exitClass = `robot-exit-${side}${transitionSuffix}`;\r\n this.robotEl.classList.add(exitClass);\r\n\r\n const afterRobot = () => {\r\n this.robotEl.removeEventListener('animationend', afterRobot);\r\n this.wrapper.classList.remove('robot-toast-visible');\r\n setTimeout(done, 260);\r\n };\r\n this.robotEl.addEventListener('animationend', afterRobot, { once: true });\r\n }\r\n };\r\n\r\n if (messageHidden) {\r\n // No text box – skip the collapse step entirely\r\n afterMsg();\r\n } else {\r\n this.messageBox.classList.add('message-exit');\r\n this.messageBox.addEventListener('animationend', afterMsg, { once: true });\r\n }\r\n }\r\n\r\n // ── Typing effect ──────────────────────────────────────────────────────────\r\n\r\n private startTyping(): void {\r\n const { message, typeSpeed } = this.options;\r\n const el = this.messageText;\r\n\r\n if (typeSpeed === 0) {\r\n // Instant – no animation\r\n el.textContent = message;\r\n this.afterTypingComplete();\r\n return;\r\n }\r\n\r\n let index = 0;\r\n let active = true;\r\n\r\n // Register cleanup so that if toast is closed mid-type the loop stops\r\n this.cleanupFns.push(() => { active = false; });\r\n\r\n const tick = () => {\r\n if (!active) return;\r\n if (index < message.length) {\r\n el.textContent += message.charAt(index++);\r\n setTimeout(tick, typeSpeed);\r\n } else {\r\n this.afterTypingComplete();\r\n }\r\n };\r\n tick();\r\n }\r\n\r\n private afterTypingComplete(): void {\r\n // Always start auto-progress-bar animation (unless hidden)\r\n if (this.autoCloseDuration > 0 && !this.options.hideProgressBar && this.progressBar) {\r\n this.progressBar.style.animationDuration = `${this.autoCloseDuration}ms`; // set duration FIRST\r\n void this.progressBar.offsetWidth; // flush\r\n this.progressBar.classList.add('robot-toast-progress-auto'); // THEN start\r\n if (this.isHovered || this.isFocusLost) {\r\n this.progressBar.classList.add('robot-toast-progress-paused');\r\n }\r\n }\r\n\r\n // Start the close timer unless something is currently pausing it\r\n if (!this.isHovered && !this.isFocusLost) {\r\n this.startTimer();\r\n }\r\n }\r\n\r\n // ── Timer management ───────────────────────────────────────────────────────\r\n\r\n private startTimer(): void {\r\n if (this.autoCloseDuration <= 0 || this.remainingTime <= 0) return;\r\n this.timerStart = Date.now();\r\n this.closeTimeout = setTimeout(() => this.close(), this.remainingTime);\r\n }\r\n\r\n private pauseTimer(): void {\r\n if (this.closeTimeout) {\r\n clearTimeout(this.closeTimeout);\r\n this.closeTimeout = null;\r\n if (this.timerStart !== null) {\r\n const elapsed = Date.now() - this.timerStart;\r\n this.remainingTime = Math.max(0, this.remainingTime - elapsed);\r\n this.timerStart = null;\r\n }\r\n }\r\n this.progressBar?.classList.add('robot-toast-progress-paused');\r\n }\r\n\r\n private resumeTimer(): void {\r\n if (this.isHovered || this.isFocusLost || this.isDragging) return;\r\n this.progressBar?.classList.remove('robot-toast-progress-paused');\r\n this.startTimer();\r\n }\r\n\r\n private cancelTimer(): void {\r\n if (this.closeTimeout) {\r\n clearTimeout(this.closeTimeout);\r\n this.closeTimeout = null;\r\n }\r\n }\r\n\r\n // ── Hover watcher ──────────────────────────────────────────────────────────\r\n\r\n private initHoverWatcher(): void {\r\n const onEnter = () => {\r\n this.isHovered = true;\r\n this.pauseTimer();\r\n };\r\n const onLeave = () => {\r\n this.isHovered = false;\r\n this.resumeTimer();\r\n };\r\n this.wrapper.addEventListener('mouseenter', onEnter);\r\n this.wrapper.addEventListener('mouseleave', onLeave);\r\n this.cleanupFns.push(() => {\r\n this.wrapper.removeEventListener('mouseenter', onEnter);\r\n this.wrapper.removeEventListener('mouseleave', onLeave);\r\n });\r\n }\r\n\r\n // ── Focus watcher ──────────────────────────────────────────────────────────\r\n\r\n private initFocusWatcher(): void {\r\n const onBlur = () => {\r\n this.isFocusLost = true;\r\n this.pauseTimer();\r\n };\r\n const onFocus = () => {\r\n this.isFocusLost = false;\r\n this.resumeTimer();\r\n };\r\n window.addEventListener('blur', onBlur);\r\n window.addEventListener('focus', onFocus);\r\n this.cleanupFns.push(() => {\r\n window.removeEventListener('blur', onBlur);\r\n window.removeEventListener('focus', onFocus);\r\n });\r\n }\r\n\r\n // ── Drag ──────────────────────────────────────────────────────────────────\r\n\r\n private initDrag(): void {\r\n this.messageBox.style.cursor = 'grab';\r\n\r\n // ── Pointer events (covers both mouse & touch via pointer API) ──────────\r\n const onPointerDown = (e: PointerEvent) => {\r\n if ((e.target as HTMLElement).closest('.robot-toast-close')) return;\r\n // Only primary button / first touch\r\n if (e.button !== undefined && e.button !== 0) return;\r\n\r\n e.preventDefault();\r\n this.isDragging = true;\r\n this.pauseTimer();\r\n\r\n // \"Detach\" the wrapper from its CSS-positioned slot by converting its\r\n // current visual position into explicit inline top/left values.\r\n const rect = this.wrapper.getBoundingClientRect();\r\n this.wrapper.classList.add('robot-toast-dragging');\r\n\r\n // Inline position so the wrapper sits exactly where it was\r\n this.wrapper.style.top = `${rect.top}px`;\r\n this.wrapper.style.left = `${rect.left}px`;\r\n this.wrapper.style.right = 'auto';\r\n this.wrapper.style.bottom = 'auto';\r\n this.wrapper.style.transform = 'none';\r\n\r\n // Offset = where inside the wrapper the pointer grabbed\r\n this.dragOffsetX = e.clientX - rect.left;\r\n this.dragOffsetY = e.clientY - rect.top;\r\n\r\n this.messageBox.style.cursor = 'grabbing';\r\n this.wrapper.setPointerCapture(e.pointerId);\r\n };\r\n\r\n const onPointerMove = (e: PointerEvent) => {\r\n if (!this.isDragging) return;\r\n e.preventDefault();\r\n\r\n const wRect = this.wrapper.getBoundingClientRect();\r\n const maxX = window.innerWidth - wRect.width;\r\n const maxY = window.innerHeight - wRect.height;\r\n\r\n const newLeft = Math.max(0, Math.min(e.clientX - this.dragOffsetX, maxX));\r\n const newTop = Math.max(0, Math.min(e.clientY - this.dragOffsetY, maxY));\r\n\r\n this.wrapper.style.left = `${newLeft}px`;\r\n this.wrapper.style.top = `${newTop}px`;\r\n };\r\n\r\n const onPointerUp = (e: PointerEvent) => {\r\n if (!this.isDragging) return;\r\n this.isDragging = false;\r\n this.wrapper.classList.remove('robot-toast-dragging');\r\n this.messageBox.style.cursor = 'grab';\r\n\r\n // ── Snap to nearest horizontal screen edge ────────────────────────────\r\n const wRect = this.wrapper.getBoundingClientRect();\r\n const midX = wRect.left + wRect.width / 2;\r\n const centerX = window.innerWidth / 2;\r\n \r\n // Determine which edge to snap to based on which half the center is in\r\n const snapToLeft = midX < centerX;\r\n \r\n // Determine robot side based on nearScreen setting\r\n const newRobotSide: 'left' | 'right' = this.options.nearScreen \r\n ? (snapToLeft ? 'left' : 'right')\r\n : (snapToLeft ? 'right' : 'left');\r\n \r\n // Determine final resting left position (20px margin from edge)\r\n const finalLeft = snapToLeft ? 20 : window.innerWidth - wRect.width - 20;\r\n const finalTop = Math.max(20, Math.min(wRect.top, window.innerHeight - wRect.height - 20));\r\n\r\n // Re-enable transitions for the snap glide\r\n this.wrapper.style.transition =\r\n 'left 0.45s cubic-bezier(0.34,1.56,0.64,1), top 0.4s cubic-bezier(0.34,1.56,0.64,1)';\r\n this.wrapper.style.left = `${finalLeft}px`;\r\n this.wrapper.style.top = `${finalTop}px`;\r\n\r\n // Update robot side if it changed\r\n if (newRobotSide !== this.currentRobotSide) {\r\n this.currentRobotSide = newRobotSide;\r\n\r\n // Use CSS order to visually reorder (no DOM detach = no animation restart)\r\n const robotOnLeft = newRobotSide === 'left';\r\n this.robotEl.style.order = robotOnLeft ? '0' : '1';\r\n this.messageBox.style.order = robotOnLeft ? '1' : '0';\r\n\r\n // Snap animation\r\n const snapClass = newRobotSide === 'left' ? 'robot-snap-left' : 'robot-snap-right';\r\n this.robotEl.classList.remove('robot-idle', 'robot-snap-left', 'robot-snap-right');\r\n this.robotEl.classList.add(snapClass);\r\n this.robotEl.addEventListener('animationend', () => {\r\n this.robotEl.style.opacity = '1';\r\n this.robotEl.classList.remove(snapClass);\r\n this.robotEl.classList.add('robot-idle');\r\n }, { once: true });\r\n }\r\n const clearTransition = () => {\r\n this.wrapper.style.transition = '';\r\n };\r\n setTimeout(clearTransition, 500);\r\n\r\n // Resume the auto-close timer\r\n this.resumeTimer();\r\n };\r\n\r\n this.wrapper.addEventListener('pointerdown', onPointerDown);\r\n this.wrapper.addEventListener('pointermove', onPointerMove);\r\n this.wrapper.addEventListener('pointerup', onPointerUp);\r\n this.wrapper.addEventListener('pointercancel', onPointerUp);\r\n\r\n this.cleanupFns.push(() => {\r\n this.wrapper.removeEventListener('pointerdown', onPointerDown);\r\n this.wrapper.removeEventListener('pointermove', onPointerMove);\r\n this.wrapper.removeEventListener('pointerup', onPointerUp);\r\n this.wrapper.removeEventListener('pointercancel', onPointerUp);\r\n });\r\n }\r\n\r\n // ── Built-in robot SVG ─────────────────────────────────────────────────────\r\n\r\n private getBuiltinSVG(): string {\r\n return `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 120\"\r\n width=\"100%\" height=\"100%\" role=\"img\" aria-label=\"Robot\">\r\n <defs>\r\n <linearGradient id=\"rtGrad${this.id}\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#E2F0FF\"/>\r\n <stop offset=\"100%\" stop-color=\"#B8D8FF\"/>\r\n </linearGradient>\r\n <linearGradient id=\"rtAccent${this.id}\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\r\n <stop offset=\"0%\" stop-color=\"#7CB9FF\"/>\r\n <stop offset=\"100%\" stop-color=\"#4A90D9\"/>\r\n </linearGradient>\r\n </defs>\r\n <!-- Antenna -->\r\n <line x1=\"50\" y1=\"4\" x2=\"50\" y2=\"18\" stroke=\"#2B3A55\" stroke-width=\"2.5\" stroke-linecap=\"round\"/>\r\n <circle cx=\"50\" cy=\"4\" r=\"4\" fill=\"#FF6B6B\"/>\r\n <!-- Head -->\r\n <rect x=\"24\" y=\"18\" width=\"52\" height=\"40\" rx=\"10\" ry=\"10\"\r\n fill=\"url(#rtGrad${this.id})\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <!-- Eyes -->\r\n <circle cx=\"38\" cy=\"36\" r=\"6\" fill=\"#2B3A55\"/>\r\n <circle cx=\"62\" cy=\"36\" r=\"6\" fill=\"#2B3A55\"/>\r\n <circle cx=\"40\" cy=\"34\" r=\"2\" fill=\"#ffffff\"/>\r\n <circle cx=\"64\" cy=\"34\" r=\"2\" fill=\"#ffffff\"/>\r\n <!-- Mouth -->\r\n <path d=\"M 38 50 Q 50 58 62 50\" stroke=\"#2B3A55\" stroke-width=\"2\"\r\n fill=\"none\" stroke-linecap=\"round\"/>\r\n <!-- Neck -->\r\n <rect x=\"44\" y=\"58\" width=\"12\" height=\"8\" rx=\"3\"\r\n fill=\"url(#rtAccent${this.id})\" stroke=\"#2B3A55\" stroke-width=\"1.5\"/>\r\n <!-- Body -->\r\n <rect x=\"22\" y=\"66\" width=\"56\" height=\"44\" rx=\"10\" ry=\"10\"\r\n fill=\"url(#rtGrad${this.id})\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <!-- Chest panel -->\r\n <rect x=\"34\" y=\"76\" width=\"32\" height=\"20\" rx=\"5\"\r\n fill=\"url(#rtAccent${this.id})\" stroke=\"#2B3A55\" stroke-width=\"1.5\"/>\r\n <circle cx=\"42\" cy=\"86\" r=\"3\" fill=\"#FF6B6B\"/>\r\n <circle cx=\"50\" cy=\"86\" r=\"3\" fill=\"#FFD700\"/>\r\n <circle cx=\"58\" cy=\"86\" r=\"3\" fill=\"#6BFF8A\"/>\r\n <!-- Arms -->\r\n <rect x=\"4\" y=\"68\" width=\"18\" height=\"30\" rx=\"9\"\r\n fill=\"url(#rtGrad${this.id})\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <rect x=\"78\" y=\"68\" width=\"18\" height=\"30\" rx=\"9\"\r\n fill=\"url(#rtGrad${this.id})\" stroke=\"#2B3A55\" stroke-width=\"2\"/>\r\n <!-- Legs -->\r\n <rect x=\"30\" y=\"110\" width=\"16\" height=\"10\" rx=\"5\"\r\n fill=\"url(#rtAccent${this.id})\" stroke=\"#2B3A55\" stroke-width=\"1.5\"/>\r\n <rect x=\"54\" y=\"110\" width=\"16\" height=\"10\" rx=\"5\"\r\n fill=\"url(#rtAccent${this.id})\" stroke=\"#2B3A55\" stroke-width=\"1.5\"/>\r\n </svg>`;\r\n }\r\n}\r\n\r\n/* ═══════════════════════════════════════════════════════════════════════════\r\n RobotToastManager – global singleton that owns all ToastItems\r\n ═══════════════════════════════════════════════════════════════════════════ */\r\nclass RobotToastManager {\r\n private static _instance: RobotToastManager | null = null;\r\n\r\n private activeToasts: ToastItem[] = [];\r\n private queue: ToastQueueItem[] = [];\r\n private globalLimit = 0; // 0 = unlimited; overridden per-show call\r\n\r\n private constructor() {\r\n new InjectStyles();\r\n }\r\n\r\n static getInstance(): RobotToastManager {\r\n if (!RobotToastManager._instance) {\r\n RobotToastManager._instance = new RobotToastManager();\r\n }\r\n return RobotToastManager._instance;\r\n }\r\n\r\n // ── Public API ─────────────────────────────────────────────────────────────\r\n\r\n show(options: RobotToastOptions): number {\r\n if (typeof document === 'undefined') return -1;\r\n\r\n const id = nextId();\r\n const limit = options.limit ?? this.globalLimit;\r\n\r\n if (limit > 0 && this.activeToasts.length >= limit) {\r\n // Queue it for later\r\n this.queue.push({ options, id });\r\n return id;\r\n }\r\n\r\n this.spawnToast(options, id);\r\n return id;\r\n }\r\n\r\n closeAll(): void {\r\n this.queue = [];\r\n [...this.activeToasts].forEach(t => t.close());\r\n }\r\n\r\n closeById(id: number): void {\r\n const toast = this.activeToasts.find(t => t.id === id);\r\n if (toast) toast.close();\r\n\r\n // Also remove from queue if it hasn't spawned yet\r\n this.queue = this.queue.filter(q => q.id !== id);\r\n }\r\n\r\n // ── Internal ───────────────────────────────────────────────────────────────\r\n\r\n private spawnToast(options: RobotToastOptions, id: number): void {\r\n const toast = new ToastItem(id, options, (doneId) => this.handleRemoved(doneId));\r\n const newestOnTop = options.newestOnTop ?? false;\r\n\r\n if (newestOnTop) {\r\n this.activeToasts.unshift(toast);\r\n } else {\r\n this.activeToasts.push(toast);\r\n }\r\n\r\n this.restack();\r\n }\r\n\r\n private handleRemoved(id: number): void {\r\n this.activeToasts = this.activeToasts.filter(t => t.id !== id);\r\n this.restack();\r\n\r\n // Dequeue next if any\r\n if (this.queue.length > 0) {\r\n const next = this.queue.shift()!;\r\n // Small delay so the stack reflows are visible\r\n setTimeout(() => this.spawnToast(next.options, next.id), 120);\r\n }\r\n }\r\n\r\n /**\r\n * Recalculate the vertical position of every active toast so they stack\r\n * neatly without overlap. Works for both top-* and bottom-* positions.\r\n */\r\n private restack(): void {\r\n // Group by position string\r\n const groups: Record<string, ToastItem[]> = {};\r\n this.activeToasts.forEach(t => {\r\n const pos = (t as any).options.position as string;\r\n if (!groups[pos]) groups[pos] = [];\r\n groups[pos].push(t);\r\n });\r\n\r\n Object.keys(groups).forEach(pos => {\r\n const list = groups[pos];\r\n let offset = 20; // initial edge margin px\r\n\r\n list.forEach((toast) => {\r\n toast.shiftVertical(offset);\r\n offset += toast.getWrapperHeight() + STACK_GAP;\r\n });\r\n });\r\n }\r\n}\r\n\r\nexport { RobotToastManager as default, RobotToastManager };","/**\r\n * RobotToast Utilities v2\r\n * Helper functions for safer access to the RobotToast API.\r\n * Handles async readiness checks, SSR guards, and error boundaries.\r\n * Useful when loading robot-toast via a CDN <script> tag.\r\n */\r\n\r\nimport type { RobotToastOptions, RobotToastAPI } from './types';\r\n\r\n/**\r\n * Wait for window.RobotToast to be available, up to `timeout` ms.\r\n * Resolves immediately if it is already loaded.\r\n * Useful when the library is loaded via a <script> tag and you need\r\n * to call it from another script that may execute first.\r\n */\r\nexport function ensureRobotToastReady(timeout = 5000): Promise<RobotToastAPI> {\r\n return new Promise((resolve, reject) => {\r\n if (typeof window === 'undefined') {\r\n reject(new Error('[RobotToast] Cannot run outside of a browser environment.'));\r\n return;\r\n }\r\n\r\n if (window.RobotToast) {\r\n resolve(window.RobotToast);\r\n return;\r\n }\r\n\r\n const startTime = Date.now();\r\n const interval = setInterval(() => {\r\n if (window.RobotToast) {\r\n clearInterval(interval);\r\n resolve(window.RobotToast);\r\n return;\r\n }\r\n if (Date.now() - startTime >= timeout) {\r\n clearInterval(interval);\r\n reject(new Error(`[RobotToast] Failed to load within ${timeout}ms.`));\r\n }\r\n }, 80);\r\n });\r\n}\r\n\r\n/**\r\n * Show a robot toast notification.\r\n * Waits for the library to be ready before showing.\r\n * Returns the toast id or -1 on failure.\r\n */\r\nexport async function showRobotToast(options: RobotToastOptions): Promise<number> {\r\n try {\r\n const api = await ensureRobotToastReady();\r\n return api.show(options);\r\n } catch (err) {\r\n console.error('[RobotToast] showRobotToast failed:', err);\r\n return -1;\r\n }\r\n}\r\n\r\n/**\r\n * Close all visible toasts and clear the queue.\r\n */\r\nexport async function closeAllRobotToasts(): Promise<void> {\r\n try {\r\n const api = await ensureRobotToastReady();\r\n api.closeAll();\r\n } catch (err) {\r\n console.error('[RobotToast] closeAllRobotToasts failed:', err);\r\n }\r\n}\r\n\r\n/**\r\n * Close a specific toast by the id returned from show().\r\n */\r\nexport async function closeRobotToastById(id: number): Promise<void> {\r\n try {\r\n const api = await ensureRobotToastReady();\r\n api.closeById(id);\r\n } catch (err) {\r\n console.error('[RobotToast] closeRobotToastById failed:', err);\r\n }\r\n}\r\n\r\n/**\r\n * Get the RobotToast API instance.\r\n */\r\nexport async function getRobotToastInstance(): Promise<RobotToastAPI> {\r\n return ensureRobotToastReady();\r\n}","/**\r\n * RobotToast Types & Constants\r\n * Type definitions and constant arrays for the robot toast notification library\r\n */\r\n\r\n/** Array of all valid toast positions */\r\nexport const TOAST_POSITIONS = [\r\n 'top-right',\r\n 'top-left',\r\n 'top-center',\r\n 'bottom-right',\r\n 'bottom-left',\r\n 'bottom-center',\r\n] as const;\r\n\r\n/** Array of all valid toast types */\r\nexport const TOAST_TYPES = ['default', 'info', 'success', 'warning', 'error'] as const;\r\n\r\n/** Array of all valid toast themes */\r\nexport const TOAST_THEMES = ['light', 'dark', 'colored'] as const;\r\n\r\n/** Array of all valid transition animations */\r\nexport const TOAST_TRANSITIONS = ['bounce', 'slide', 'zoom', 'flip'] as const;\r\n\r\n/** Type derived from TOAST_POSITIONS constant */\r\nexport type ToastPosition = typeof TOAST_POSITIONS[number];\r\n\r\n/** Type derived from TOAST_TYPES constant */\r\nexport type ToastType = typeof TOAST_TYPES[number];\r\n\r\n/** Type derived from TOAST_THEMES constant */\r\nexport type ToastTheme = typeof TOAST_THEMES[number];\r\n\r\n/** Type derived from TOAST_TRANSITIONS constant */\r\nexport type TransitionType = typeof TOAST_TRANSITIONS[number];\r\n\r\nexport interface RobotToastOptions {\r\n /** The message text to display in the toast */\r\n message: string;\r\n\r\n /** Auto-close duration in ms, or false to disable. Default: 5000 */\r\n autoClose?: boolean | number;\r\n\r\n /** Position of the toast on screen. Default: 'bottom-right' */\r\n position?: ToastPosition;\r\n\r\n /** Toast type/style. Default: 'default' */\r\n type?: ToastType;\r\n\r\n /** Visual theme. Default: 'light' */\r\n theme?: ToastTheme;\r\n\r\n /**\r\n * Inline style object to apply directly to the message box element.\r\n * This allows runtime customization of colors, fonts, backgrounds, etc.\r\n * Example: { color: 'red', backgroundColor: 'blue' }\r\n * This takes precedence over className for conflicting properties.\r\n */\r\n style?: Record<string, string | number>;\r\n\r\n /** Typing speed in ms per character. 0 = instant. Default: 30 */\r\n typeSpeed?: number;\r\n\r\n /**\r\n * Robot image to display.\r\n * - Built-in: 'wave', 'error', 'success', 'base', 'base2', 'angry', 'angry2', 'shock',\r\n * 'think', 'search', 'loading', 'sleep', 'head-palm', 'type', 'validation', 'validation2'\r\n * (these use embedded data URLs, no external files needed)\r\n * - Custom: any path accessible in your app (e.g., 'dxd/bird.jpg', 'public/my-robot.svg')\r\n * - None: 'none' to hide the robot entirely\r\n * Accepted formats for custom images: svg, png, jpg, jpeg, gif, webp.\r\n * Anything unrecognized falls back to the built-in robot.\r\n */\r\n robotVariant?: string;\r\n\r\n /** Hide the countdown progress bar. Default: false */\r\n hideProgressBar?: boolean;\r\n\r\n /** Pause the auto-close countdown when the window loses focus. Default: true */\r\n pauseOnFocusLoss?: boolean;\r\n\r\n /** Allow the user to drag the toast around the screen. Default: true */\r\n draggable?: boolean;\r\n\r\n /**\r\n * Position the robot near the screen edge (true) or away from it (false).\r\n * - true: robot appears between screen edge and message bubble\r\n * - false: message bubble appears between screen edge and robot\r\n * The position is automatically determined by the toast position and this setting.\r\n * Default: true\r\n */\r\n nearScreen?: boolean;\r\n\r\n /** Pause the auto-close countdown while the cursor is over the toast. Default: true */\r\n pauseOnHover?: boolean;\r\n\r\n /**\r\n * Maximum number of toasts visible simultaneously.\r\n * Excess toasts are queued and shown as soon as a slot opens.\r\n * 0 = unlimited (queue still works, all show in parallel). Default: 0\r\n */\r\n limit?: number;\r\n\r\n /** Stack newest toasts on top of older ones. Default: false */\r\n newestOnTop?: boolean;\r\n\r\n /** Right-to-left layout (message on the right, robot on the left). Default: false */\r\n rtl?: boolean;\r\n\r\n /** Entry / exit transition style. Default: 'bounce' */\r\n transition?: TransitionType;\r\n\r\n /** Called when the toast finishes its enter animation and is fully visible. */\r\n onOpen?: () => void;\r\n\r\n /** Called after the toast has fully exited the screen. */\r\n onClose?: () => void;\r\n}\r\n\r\n/** Internal representation of a queued toast item */\r\nexport interface ToastQueueItem {\r\n options: RobotToastOptions;\r\n id: number;\r\n}\r\n\r\nexport interface RobotToastAPI {\r\n /** Show a toast notification – queued automatically when limit is reached */\r\n show: (options: RobotToastOptions) => number;\r\n /** Immediately close all visible toasts and clear the queue */\r\n closeAll: () => void;\r\n /** Close a specific toast by the id returned from show() */\r\n closeById: (id: number) => void;\r\n /** Get the RobotToastManager instance */\r\n getInstance: () => RobotToastInstance;\r\n}\r\n\r\nexport interface RobotToastInstance {\r\n show: (options: RobotToastOptions) => number;\r\n closeAll: () => void;\r\n closeById: (id: number) => void;\r\n}\r\n\r\ndeclare global {\r\n interface Window {\r\n __robotToastLoaded?: boolean;\r\n __robotToastUtilsLoaded?: boolean;\r\n RobotToast?: RobotToastAPI;\r\n RobotToastUtils?: {\r\n showRobotToast: (options: RobotToastOptions) => Promise<number>;\r\n closeAllRobotToasts: () => Promise<void>;\r\n closeRobotToastById: (id: number) => Promise<void>;\r\n getRobotToastInstance: () => Promise<RobotToastAPI>;\r\n ensureRobotToastReady: (timeout?: number) => Promise<RobotToastAPI>;\r\n };\r\n }\r\n}","/**\r\n * robot-toast v2\r\n * A lightweight, framework-agnostic toast notification library\r\n * with an animated robot character, multi-toast queue, and smooth drag.\r\n *\r\n * ── Basic usage ──────────────────────────────────────────────────────────────\r\n * import { toast } from 'robot-toast';\r\n * toast('Hello 🤖');\r\n * toast({ message: 'Hello!', position: 'top-right', type: 'success' });\r\n *\r\n * ── Typed shorthands ─────────────────────────────────────────────────────────\r\n * toast.success('Saved!');\r\n * toast.error('Something went wrong');\r\n * toast.info('Did you know…');\r\n * toast.warning('Check your input');\r\n *\r\n * ── Class / manager ──────────────────────────────────────────────────────────\r\n * import { RobotToast } from 'robot-toast';\r\n * const manager = RobotToast.getInstance();\r\n * const id = manager.show({ message: 'Hi!' });\r\n * manager.closeById(id);\r\n */\r\n\r\nimport RobotToastManager from './toast';\r\nimport type { RobotToastOptions, RobotToastAPI } from './types';\r\nimport './styles-injector'; // Auto-inject styles\r\n\r\n// ─── Core show function ────────────────────────────────────────────────────\r\n\r\ntype ToastInput = string | RobotToastOptions;\r\n\r\nfunction normalise(input: ToastInput): RobotToastOptions {\r\n return typeof input === 'string' ? { message: input } : input;\r\n}\r\n\r\n/**\r\n * Show a toast notification.\r\n * Accepts either a plain string or a full options object.\r\n * Returns the toast id (useful for closeById).\r\n *\r\n * @example\r\n * toast('Hello 🤖');\r\n * toast({ message: 'Hello!', type: 'success', position: 'top-right' });\r\n */\r\nfunction toast(input: ToastInput): number {\r\n if (typeof window === 'undefined') return -1;\r\n return RobotToastManager.getInstance().show(normalise(input));\r\n}\r\n\r\n// ── Typed shorthand helpers ───────────────────────────────────────────────────\r\ntoast.success = (input: ToastInput): number =>\r\n toast({ ...normalise(input), type: 'success' });\r\n\r\ntoast.error = (input: ToastInput): number =>\r\n toast({ ...normalise(input), type: 'error' });\r\n\r\ntoast.info = (input: ToastInput): number =>\r\n toast({ ...normalise(input), type: 'info' });\r\n\r\ntoast.warning = (input: ToastInput): number =>\r\n toast({ ...normalise(input), type: 'warning' });\r\n\r\n// ── Close helpers ─────────────────────────────────────────────────────────────\r\n/**\r\n * Close all visible toasts and clear the queue.\r\n */\r\ntoast.closeAll = (): void => {\r\n if (typeof window === 'undefined') return;\r\n RobotToastManager.getInstance().closeAll();\r\n};\r\n\r\n/**\r\n * Close a specific toast by the id returned from toast() / toast.show().\r\n */\r\ntoast.closeById = (id: number): void => {\r\n if (typeof window === 'undefined') return;\r\n RobotToastManager.getInstance().closeById(id);\r\n};\r\n\r\nexport { toast };\r\n\r\n// ─── Class export ──────────────────────────────────────────────────────────\r\n\r\nexport { default as RobotToast, RobotToastManager } from './toast';\r\n\r\n// ─── Utilities ─────────────────────────────────────────────────────────────\r\n\r\nexport {\r\n ensureRobotToastReady,\r\n showRobotToast,\r\n closeAllRobotToasts,\r\n getRobotToastInstance,\r\n} from './utils';\r\n\r\n// ─── Types ─────────────────────────────────────────────────────────────────\r\n\r\nexport type {\r\n RobotToastOptions,\r\n RobotToastAPI,\r\n RobotToastInstance,\r\n ToastQueueItem,\r\n ToastPosition,\r\n ToastType,\r\n ToastTheme,\r\n TransitionType,\r\n} from './types';\r\n\r\nexport {\r\n TOAST_POSITIONS,\r\n TOAST_TYPES,\r\n TOAST_THEMES,\r\n TOAST_TRANSITIONS,\r\n} from './types';\r\n\r\n// ─── Built-in robot images ─────────────────────────────────────────────────\r\n\r\nexport { ROBOT_IMAGES } from './robot-data';\r\n\r\n// ─── Global registration (for script-tag / CDN usage) ──────────────────────\r\n\r\nfunction registerGlobal(): void {\r\n if (typeof window === 'undefined') return;\r\n if (window.__robotToastLoaded) return;\r\n window.__robotToastLoaded = true;\r\n\r\n const api: RobotToastAPI = {\r\n show: (options: RobotToastOptions) => RobotToastManager.getInstance().show(options),\r\n closeAll: () => RobotToastManager.getInstance().closeAll(),\r\n closeById: (id: number) => RobotToastManager.getInstance().closeById(id),\r\n getInstance: () => RobotToastManager.getInstance(),\r\n };\r\n\r\n window.RobotToast = api;\r\n}\r\n\r\nregisterGlobal();"]}