sonner 1.7.1 → 1.7.3

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/index.tsx","../src/assets.tsx","../src/hooks.tsx","../src/state.ts","#style-inject:#style-inject","../src/styles.css","../src/types.ts"],"sourcesContent":["'use client';\n\nimport React, { forwardRef } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { CloseIcon, getAsset, Loader } from './assets';\nimport { useIsDocumentHidden } from './hooks';\nimport { toast, ToastState } from './state';\nimport './styles.css';\nimport {\n isAction,\n type ExternalToast,\n type HeightT,\n type ToasterProps,\n type ToastProps,\n type ToastT,\n type ToastToDismiss,\n} from './types';\n\n// Visible toasts amount\nconst VISIBLE_TOASTS_AMOUNT = 3;\n\n// Viewport padding\nconst VIEWPORT_OFFSET = '32px';\n\n// Default lifetime of a toasts (in ms)\nconst TOAST_LIFETIME = 4000;\n\n// Default toast width\nconst TOAST_WIDTH = 356;\n\n// Default gap between toasts\nconst GAP = 14;\n\n// Threshold to dismiss a toast\nconst SWIPE_THRESHOLD = 20;\n\n// Equal to exit animation duration\nconst TIME_BEFORE_UNMOUNT = 200;\n\nfunction _cn(...classes: (string | undefined)[]) {\n return classes.filter(Boolean).join(' ');\n}\n\nconst Toast = (props: ToastProps) => {\n const {\n invert: ToasterInvert,\n toast,\n unstyled,\n interacting,\n setHeights,\n visibleToasts,\n heights,\n index,\n toasts,\n expanded,\n removeToast,\n defaultRichColors,\n closeButton: closeButtonFromToaster,\n style,\n cancelButtonStyle,\n actionButtonStyle,\n className = '',\n descriptionClassName = '',\n duration: durationFromToaster,\n position,\n gap,\n loadingIcon: loadingIconProp,\n expandByDefault,\n classNames,\n icons,\n closeButtonAriaLabel = 'Close toast',\n pauseWhenPageIsHidden,\n cn,\n } = props;\n const [mounted, setMounted] = React.useState(false);\n const [removed, setRemoved] = React.useState(false);\n const [swiping, setSwiping] = React.useState(false);\n const [swipeOut, setSwipeOut] = React.useState(false);\n const [isSwiped, setIsSwiped] = React.useState(false);\n const [offsetBeforeRemove, setOffsetBeforeRemove] = React.useState(0);\n const [initialHeight, setInitialHeight] = React.useState(0);\n const remainingTime = React.useRef(toast.duration || durationFromToaster || TOAST_LIFETIME);\n const dragStartTime = React.useRef<Date | null>(null);\n const toastRef = React.useRef<HTMLLIElement>(null);\n const isFront = index === 0;\n const isVisible = index + 1 <= visibleToasts;\n const toastType = toast.type;\n const dismissible = toast.dismissible !== false;\n const toastClassname = toast.className || '';\n const toastDescriptionClassname = toast.descriptionClassName || '';\n // Height index is used to calculate the offset as it gets updated before the toast array, which means we can calculate the new layout faster.\n const heightIndex = React.useMemo(\n () => heights.findIndex((height) => height.toastId === toast.id) || 0,\n [heights, toast.id],\n );\n const closeButton = React.useMemo(\n () => toast.closeButton ?? closeButtonFromToaster,\n [toast.closeButton, closeButtonFromToaster],\n );\n const duration = React.useMemo(\n () => toast.duration || durationFromToaster || TOAST_LIFETIME,\n [toast.duration, durationFromToaster],\n );\n const closeTimerStartTimeRef = React.useRef(0);\n const offset = React.useRef(0);\n const lastCloseTimerStartTimeRef = React.useRef(0);\n const pointerStartRef = React.useRef<{ x: number; y: number } | null>(null);\n const [y, x] = position.split('-');\n const toastsHeightBefore = React.useMemo(() => {\n return heights.reduce((prev, curr, reducerIndex) => {\n // Calculate offset up until current toast\n if (reducerIndex >= heightIndex) {\n return prev;\n }\n\n return prev + curr.height;\n }, 0);\n }, [heights, heightIndex]);\n const isDocumentHidden = useIsDocumentHidden();\n\n const invert = toast.invert || ToasterInvert;\n const disabled = toastType === 'loading';\n\n offset.current = React.useMemo(() => heightIndex * gap + toastsHeightBefore, [heightIndex, toastsHeightBefore]);\n\n React.useEffect(() => {\n // Trigger enter animation without using CSS animation\n setMounted(true);\n }, []);\n\n React.useEffect(() => {\n const toastNode = toastRef.current;\n if (toastNode) {\n const height = toastNode.getBoundingClientRect().height;\n // Add toast height to heights array after the toast is mounted\n setInitialHeight(height);\n setHeights((h) => [{ toastId: toast.id, height, position: toast.position }, ...h]);\n return () => setHeights((h) => h.filter((height) => height.toastId !== toast.id));\n }\n }, [setHeights, toast.id]);\n\n React.useLayoutEffect(() => {\n if (!mounted) return;\n const toastNode = toastRef.current;\n const originalHeight = toastNode.style.height;\n toastNode.style.height = 'auto';\n const newHeight = toastNode.getBoundingClientRect().height;\n toastNode.style.height = originalHeight;\n\n setInitialHeight(newHeight);\n\n setHeights((heights) => {\n const alreadyExists = heights.find((height) => height.toastId === toast.id);\n if (!alreadyExists) {\n return [{ toastId: toast.id, height: newHeight, position: toast.position }, ...heights];\n } else {\n return heights.map((height) => (height.toastId === toast.id ? { ...height, height: newHeight } : height));\n }\n });\n }, [mounted, toast.title, toast.description, setHeights, toast.id]);\n\n const deleteToast = React.useCallback(() => {\n // Save the offset for the exit swipe animation\n setRemoved(true);\n setOffsetBeforeRemove(offset.current);\n setHeights((h) => h.filter((height) => height.toastId !== toast.id));\n\n setTimeout(() => {\n removeToast(toast);\n }, TIME_BEFORE_UNMOUNT);\n }, [toast, removeToast, setHeights, offset]);\n\n React.useEffect(() => {\n if ((toast.promise && toastType === 'loading') || toast.duration === Infinity || toast.type === 'loading') return;\n let timeoutId: NodeJS.Timeout;\n\n // Pause the timer on each hover\n const pauseTimer = () => {\n if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {\n // Get the elapsed time since the timer started\n const elapsedTime = new Date().getTime() - closeTimerStartTimeRef.current;\n\n remainingTime.current = remainingTime.current - elapsedTime;\n }\n\n lastCloseTimerStartTimeRef.current = new Date().getTime();\n };\n\n const startTimer = () => {\n // setTimeout(, Infinity) behaves as if the delay is 0.\n // As a result, the toast would be closed immediately, giving the appearance that it was never rendered.\n // See: https://github.com/denysdovhan/wtfjs?tab=readme-ov-file#an-infinite-timeout\n if (remainingTime.current === Infinity) return;\n\n closeTimerStartTimeRef.current = new Date().getTime();\n\n // Let the toast know it has started\n timeoutId = setTimeout(() => {\n toast.onAutoClose?.(toast);\n deleteToast();\n }, remainingTime.current);\n };\n\n if (expanded || interacting || (pauseWhenPageIsHidden && isDocumentHidden)) {\n pauseTimer();\n } else {\n startTimer();\n }\n\n return () => clearTimeout(timeoutId);\n }, [expanded, interacting, toast, toastType, pauseWhenPageIsHidden, isDocumentHidden, deleteToast]);\n\n React.useEffect(() => {\n if (toast.delete) {\n deleteToast();\n }\n }, [deleteToast, toast.delete]);\n\n function getLoadingIcon() {\n if (icons?.loading) {\n return (\n <div\n className={cn(classNames?.loader, toast?.classNames?.loader, 'sonner-loader')}\n data-visible={toastType === 'loading'}\n >\n {icons.loading}\n </div>\n );\n }\n\n if (loadingIconProp) {\n return (\n <div\n className={cn(classNames?.loader, toast?.classNames?.loader, 'sonner-loader')}\n data-visible={toastType === 'loading'}\n >\n {loadingIconProp}\n </div>\n );\n }\n return <Loader className={cn(classNames?.loader, toast?.classNames?.loader)} visible={toastType === 'loading'} />;\n }\n\n return (\n <li\n tabIndex={0}\n ref={toastRef}\n className={cn(\n className,\n toastClassname,\n classNames?.toast,\n toast?.classNames?.toast,\n classNames?.default,\n classNames?.[toastType],\n toast?.classNames?.[toastType],\n )}\n data-sonner-toast=\"\"\n data-rich-colors={toast.richColors ?? defaultRichColors}\n data-styled={!Boolean(toast.jsx || toast.unstyled || unstyled)}\n data-mounted={mounted}\n data-promise={Boolean(toast.promise)}\n data-swiped={isSwiped}\n data-removed={removed}\n data-visible={isVisible}\n data-y-position={y}\n data-x-position={x}\n data-index={index}\n data-front={isFront}\n data-swiping={swiping}\n data-dismissible={dismissible}\n data-type={toastType}\n data-invert={invert}\n data-swipe-out={swipeOut}\n data-expanded={Boolean(expanded || (expandByDefault && mounted))}\n style={\n {\n '--index': index,\n '--toasts-before': index,\n '--z-index': toasts.length - index,\n '--offset': `${removed ? offsetBeforeRemove : offset.current}px`,\n '--initial-height': expandByDefault ? 'auto' : `${initialHeight}px`,\n ...style,\n ...toast.style,\n } as React.CSSProperties\n }\n onPointerDown={(event) => {\n if (disabled || !dismissible) return;\n dragStartTime.current = new Date();\n setOffsetBeforeRemove(offset.current);\n // Ensure we maintain correct pointer capture even when going outside of the toast (e.g. when swiping)\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n if ((event.target as HTMLElement).tagName === 'BUTTON') return;\n setSwiping(true);\n pointerStartRef.current = { x: event.clientX, y: event.clientY };\n }}\n onPointerUp={() => {\n if (swipeOut || !dismissible) return;\n\n pointerStartRef.current = null;\n const swipeAmount = Number(toastRef.current?.style.getPropertyValue('--swipe-amount').replace('px', '') || 0);\n const timeTaken = new Date().getTime() - dragStartTime.current?.getTime();\n const velocity = Math.abs(swipeAmount) / timeTaken;\n\n // Remove only if threshold is met\n if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {\n setOffsetBeforeRemove(offset.current);\n toast.onDismiss?.(toast);\n deleteToast();\n setSwipeOut(true);\n setIsSwiped(false);\n return;\n }\n\n toastRef.current?.style.setProperty('--swipe-amount', '0px');\n setSwiping(false);\n }}\n onPointerMove={(event) => {\n if (!pointerStartRef.current || !dismissible) return;\n\n const yPosition = event.clientY - pointerStartRef.current.y;\n const isHighlighted = window.getSelection()?.toString().length > 0;\n const swipeAmount = y === 'top' ? Math.min(0, yPosition) : Math.max(0, yPosition);\n\n if (Math.abs(swipeAmount) > 0) {\n setIsSwiped(true);\n }\n\n if (isHighlighted) return;\n\n toastRef.current?.style.setProperty('--swipe-amount', `${swipeAmount}px`);\n }}\n >\n {closeButton && !toast.jsx ? (\n <button\n aria-label={closeButtonAriaLabel}\n data-disabled={disabled}\n data-close-button\n onClick={\n disabled || !dismissible\n ? () => {}\n : () => {\n deleteToast();\n toast.onDismiss?.(toast);\n }\n }\n className={cn(classNames?.closeButton, toast?.classNames?.closeButton)}\n >\n {icons?.close ?? CloseIcon}\n </button>\n ) : null}\n {/* TODO: This can be cleaner */}\n {toast.jsx || React.isValidElement(toast.title) ? (\n toast.jsx ? (\n toast.jsx\n ) : typeof toast.title === 'function' ? (\n toast.title()\n ) : (\n toast.title\n )\n ) : (\n <>\n {toastType || toast.icon || toast.promise ? (\n <div data-icon=\"\" className={cn(classNames?.icon, toast?.classNames?.icon)}>\n {toast.promise || (toast.type === 'loading' && !toast.icon) ? toast.icon || getLoadingIcon() : null}\n {toast.type !== 'loading' ? toast.icon || icons?.[toastType] || getAsset(toastType) : null}\n </div>\n ) : null}\n\n <div data-content=\"\" className={cn(classNames?.content, toast?.classNames?.content)}>\n <div data-title=\"\" className={cn(classNames?.title, toast?.classNames?.title)}>\n {typeof toast.title === 'function' ? toast.title() : toast.title}\n </div>\n {toast.description ? (\n <div\n data-description=\"\"\n className={cn(\n descriptionClassName,\n toastDescriptionClassname,\n classNames?.description,\n toast?.classNames?.description,\n )}\n >\n {typeof toast.description === 'function' ? toast.description() : toast.description}\n </div>\n ) : null}\n </div>\n {React.isValidElement(toast.cancel) ? (\n toast.cancel\n ) : toast.cancel && isAction(toast.cancel) ? (\n <button\n data-button\n data-cancel\n style={toast.cancelButtonStyle || cancelButtonStyle}\n onClick={(event) => {\n // We need to check twice because typescript\n if (!isAction(toast.cancel)) return;\n if (!dismissible) return;\n toast.cancel.onClick?.(event);\n deleteToast();\n }}\n className={cn(classNames?.cancelButton, toast?.classNames?.cancelButton)}\n >\n {toast.cancel.label}\n </button>\n ) : null}\n {React.isValidElement(toast.action) ? (\n toast.action\n ) : toast.action && isAction(toast.action) ? (\n <button\n data-button\n data-action\n style={toast.actionButtonStyle || actionButtonStyle}\n onClick={(event) => {\n // We need to check twice because typescript\n if (!isAction(toast.action)) return;\n toast.action.onClick?.(event);\n if (event.defaultPrevented) return;\n deleteToast();\n }}\n className={cn(classNames?.actionButton, toast?.classNames?.actionButton)}\n >\n {toast.action.label}\n </button>\n ) : null}\n </>\n )}\n </li>\n );\n};\n\nfunction getDocumentDirection(): ToasterProps['dir'] {\n if (typeof window === 'undefined') return 'ltr';\n if (typeof document === 'undefined') return 'ltr'; // For Fresh purpose\n\n const dirAttribute = document.documentElement.getAttribute('dir');\n\n if (dirAttribute === 'auto' || !dirAttribute) {\n return window.getComputedStyle(document.documentElement).direction as ToasterProps['dir'];\n }\n\n return dirAttribute as ToasterProps['dir'];\n}\n\nfunction useSonner() {\n const [activeToasts, setActiveToasts] = React.useState<ToastT[]>([]);\n\n React.useEffect(() => {\n return ToastState.subscribe((toast) => {\n setActiveToasts((currentToasts) => {\n if ('dismiss' in toast && toast.dismiss) {\n return currentToasts.filter((t) => t.id !== toast.id);\n }\n\n const existingToastIndex = currentToasts.findIndex((t) => t.id === toast.id);\n if (existingToastIndex !== -1) {\n const updatedToasts = [...currentToasts];\n updatedToasts[existingToastIndex] = { ...updatedToasts[existingToastIndex], ...toast };\n return updatedToasts;\n } else {\n return [toast, ...currentToasts];\n }\n });\n });\n }, []);\n\n return {\n toasts: activeToasts,\n };\n}\n\nconst Toaster = forwardRef<HTMLElement, ToasterProps>(function Toaster(props, ref) {\n const {\n invert,\n position = 'bottom-right',\n hotkey = ['altKey', 'KeyT'],\n expand,\n closeButton,\n className,\n offset,\n theme = 'light',\n richColors,\n duration,\n style,\n visibleToasts = VISIBLE_TOASTS_AMOUNT,\n toastOptions,\n dir = getDocumentDirection(),\n gap = GAP,\n loadingIcon,\n icons,\n containerAriaLabel = 'Notifications',\n pauseWhenPageIsHidden,\n cn = _cn,\n } = props;\n const [toasts, setToasts] = React.useState<ToastT[]>([]);\n const possiblePositions = React.useMemo(() => {\n return Array.from(\n new Set([position].concat(toasts.filter((toast) => toast.position).map((toast) => toast.position))),\n );\n }, [toasts, position]);\n const [heights, setHeights] = React.useState<HeightT[]>([]);\n const [expanded, setExpanded] = React.useState(false);\n const [interacting, setInteracting] = React.useState(false);\n const [actualTheme, setActualTheme] = React.useState(\n theme !== 'system'\n ? theme\n : typeof window !== 'undefined'\n ? window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches\n ? 'dark'\n : 'light'\n : 'light',\n );\n\n const listRef = React.useRef<HTMLOListElement>(null);\n const hotkeyLabel = hotkey.join('+').replace(/Key/g, '').replace(/Digit/g, '');\n const lastFocusedElementRef = React.useRef<HTMLElement>(null);\n const isFocusWithinRef = React.useRef(false);\n\n const removeToast = React.useCallback((toastToRemove: ToastT) => {\n setToasts((toasts) => {\n if (!toasts.find((toast) => toast.id === toastToRemove.id)?.delete) {\n ToastState.dismiss(toastToRemove.id);\n }\n\n return toasts.filter(({ id }) => id !== toastToRemove.id);\n });\n }, []);\n\n React.useEffect(() => {\n return ToastState.subscribe((toast) => {\n if ((toast as ToastToDismiss).dismiss) {\n setToasts((toasts) => toasts.map((t) => (t.id === toast.id ? { ...t, delete: true } : t)));\n return;\n }\n\n // Prevent batching, temp solution.\n setTimeout(() => {\n ReactDOM.flushSync(() => {\n setToasts((toasts) => {\n const indexOfExistingToast = toasts.findIndex((t) => t.id === toast.id);\n\n // Update the toast if it already exists\n if (indexOfExistingToast !== -1) {\n return [\n ...toasts.slice(0, indexOfExistingToast),\n { ...toasts[indexOfExistingToast], ...toast },\n ...toasts.slice(indexOfExistingToast + 1),\n ];\n }\n\n return [toast, ...toasts];\n });\n });\n });\n });\n }, []);\n\n React.useEffect(() => {\n if (theme !== 'system') {\n setActualTheme(theme);\n return;\n }\n\n if (theme === 'system') {\n // check if current preference is dark\n if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {\n // it's currently dark\n setActualTheme('dark');\n } else {\n // it's not dark\n setActualTheme('light');\n }\n }\n\n if (typeof window === 'undefined') return;\n const darkMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n\n try {\n // Chrome & Firefox\n darkMediaQuery.addEventListener('change', ({ matches }) => {\n if (matches) {\n setActualTheme('dark');\n } else {\n setActualTheme('light');\n }\n });\n } catch (error) {\n // Safari < 14\n darkMediaQuery.addListener(({ matches }) => {\n try {\n if (matches) {\n setActualTheme('dark');\n } else {\n setActualTheme('light');\n }\n } catch (e) {\n console.error(e);\n }\n });\n }\n }, [theme]);\n\n React.useEffect(() => {\n // Ensure expanded is always false when no toasts are present / only one left\n if (toasts.length <= 1) {\n setExpanded(false);\n }\n }, [toasts]);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n const isHotkeyPressed = hotkey.every((key) => (event as any)[key] || event.code === key);\n\n if (isHotkeyPressed) {\n setExpanded(true);\n listRef.current?.focus();\n }\n\n if (\n event.code === 'Escape' &&\n (document.activeElement === listRef.current || listRef.current?.contains(document.activeElement))\n ) {\n setExpanded(false);\n }\n };\n document.addEventListener('keydown', handleKeyDown);\n\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [hotkey]);\n\n React.useEffect(() => {\n if (listRef.current) {\n return () => {\n if (lastFocusedElementRef.current) {\n lastFocusedElementRef.current.focus({ preventScroll: true });\n lastFocusedElementRef.current = null;\n isFocusWithinRef.current = false;\n }\n };\n }\n }, [listRef.current]);\n\n return (\n // Remove item from normal navigation flow, only available via hotkey\n <section\n aria-label={`${containerAriaLabel} ${hotkeyLabel}`}\n tabIndex={-1}\n aria-live=\"polite\"\n aria-relevant=\"additions text\"\n aria-atomic=\"false\"\n >\n {possiblePositions.map((position, index) => {\n const [y, x] = position.split('-');\n\n if (!toasts.length) return null;\n\n return (\n <ol\n key={position}\n dir={dir === 'auto' ? getDocumentDirection() : dir}\n tabIndex={-1}\n ref={listRef}\n className={className}\n data-sonner-toaster\n data-theme={actualTheme}\n data-y-position={y}\n data-lifted={expanded && toasts.length > 1 && !expand}\n data-x-position={x}\n style={\n {\n '--front-toast-height': `${heights[0]?.height || 0}px`,\n '--offset': typeof offset === 'number' ? `${offset}px` : offset || VIEWPORT_OFFSET,\n '--width': `${TOAST_WIDTH}px`,\n '--gap': `${gap}px`,\n ...style,\n } as React.CSSProperties\n }\n onBlur={(event) => {\n if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {\n isFocusWithinRef.current = false;\n if (lastFocusedElementRef.current) {\n lastFocusedElementRef.current.focus({ preventScroll: true });\n lastFocusedElementRef.current = null;\n }\n }\n }}\n onFocus={(event) => {\n const isNotDismissible =\n event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';\n\n if (isNotDismissible) return;\n\n if (!isFocusWithinRef.current) {\n isFocusWithinRef.current = true;\n lastFocusedElementRef.current = event.relatedTarget as HTMLElement;\n }\n }}\n onMouseEnter={() => setExpanded(true)}\n onMouseMove={() => setExpanded(true)}\n onMouseLeave={() => {\n // Avoid setting expanded to false when interacting with a toast, e.g. swiping\n if (!interacting) {\n setExpanded(false);\n }\n }}\n onPointerDown={(event) => {\n const isNotDismissible =\n event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';\n\n if (isNotDismissible) return;\n setInteracting(true);\n }}\n onPointerUp={() => setInteracting(false)}\n >\n {toasts\n .filter((toast) => (!toast.position && index === 0) || toast.position === position)\n .map((toast, index) => (\n <Toast\n key={toast.id}\n icons={icons}\n index={index}\n toast={toast}\n defaultRichColors={richColors}\n duration={toastOptions?.duration ?? duration}\n className={toastOptions?.className}\n descriptionClassName={toastOptions?.descriptionClassName}\n invert={invert}\n visibleToasts={visibleToasts}\n closeButton={toastOptions?.closeButton ?? closeButton}\n interacting={interacting}\n position={position}\n style={toastOptions?.style}\n unstyled={toastOptions?.unstyled}\n classNames={toastOptions?.classNames}\n cancelButtonStyle={toastOptions?.cancelButtonStyle}\n actionButtonStyle={toastOptions?.actionButtonStyle}\n removeToast={removeToast}\n toasts={toasts.filter((t) => t.position == toast.position)}\n heights={heights.filter((h) => h.position == toast.position)}\n setHeights={setHeights}\n expandByDefault={expand}\n gap={gap}\n loadingIcon={loadingIcon}\n expanded={expanded}\n pauseWhenPageIsHidden={pauseWhenPageIsHidden}\n cn={cn}\n />\n ))}\n </ol>\n );\n })}\n </section>\n );\n});\nexport { toast, Toaster, type ExternalToast, type ToastT, type ToasterProps, useSonner };\nexport { type ToastClassnames, type ToastToDismiss, type Action } from './types';\n","'use client';\nimport React from 'react';\nimport type { ToastTypes } from './types';\n\nexport const getAsset = (type: ToastTypes): JSX.Element | null => {\n switch (type) {\n case 'success':\n return SuccessIcon;\n\n case 'info':\n return InfoIcon;\n\n case 'warning':\n return WarningIcon;\n\n case 'error':\n return ErrorIcon;\n\n default:\n return null;\n }\n};\n\nconst bars = Array(12).fill(0);\n\nexport const Loader = ({ visible, className }: { visible: boolean, className?: string }) => {\n return (\n <div className={['sonner-loading-wrapper', className].filter(Boolean).join(' ')} data-visible={visible}>\n <div className=\"sonner-spinner\">\n {bars.map((_, i) => (\n <div className=\"sonner-loading-bar\" key={`spinner-bar-${i}`} />\n ))}\n </div>\n </div>\n );\n};\n\nconst SuccessIcon = (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" height=\"20\" width=\"20\">\n <path\n fillRule=\"evenodd\"\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nconst WarningIcon = (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" height=\"20\" width=\"20\">\n <path\n fillRule=\"evenodd\"\n d=\"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nconst InfoIcon = (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" height=\"20\" width=\"20\">\n <path\n fillRule=\"evenodd\"\n d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nconst ErrorIcon = (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" height=\"20\" width=\"20\">\n <path\n fillRule=\"evenodd\"\n d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const CloseIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n);\n","import React from 'react';\n\nexport const useIsDocumentHidden = () => {\n const [isDocumentHidden, setIsDocumentHidden] = React.useState(document.hidden);\n\n React.useEffect(() => {\n const callback = () => {\n setIsDocumentHidden(document.hidden);\n };\n document.addEventListener('visibilitychange', callback);\n return () => window.removeEventListener('visibilitychange', callback);\n }, []);\n\n return isDocumentHidden;\n};\n","import type { ExternalToast, PromiseData, PromiseT, ToastT, ToastToDismiss, ToastTypes } from './types';\n\nimport React from 'react';\n\nlet toastsCounter = 1;\n\ntype titleT = (() => React.ReactNode) | React.ReactNode;\n\nclass Observer {\n subscribers: Array<(toast: ExternalToast | ToastToDismiss) => void>;\n toasts: Array<ToastT | ToastToDismiss>;\n\n constructor() {\n this.subscribers = [];\n this.toasts = [];\n }\n\n // We use arrow functions to maintain the correct `this` reference\n subscribe = (subscriber: (toast: ToastT | ToastToDismiss) => void) => {\n this.subscribers.push(subscriber);\n\n return () => {\n const index = this.subscribers.indexOf(subscriber);\n this.subscribers.splice(index, 1);\n };\n };\n\n publish = (data: ToastT) => {\n this.subscribers.forEach((subscriber) => subscriber(data));\n };\n\n addToast = (data: ToastT) => {\n this.publish(data);\n this.toasts = [...this.toasts, data];\n };\n\n create = (\n data: ExternalToast & {\n message?: titleT;\n type?: ToastTypes;\n promise?: PromiseT;\n jsx?: React.ReactElement;\n },\n ) => {\n const { message, ...rest } = data;\n const id = typeof data?.id === 'number' || data.id?.length > 0 ? data.id : toastsCounter++;\n const alreadyExists = this.toasts.find((toast) => {\n return toast.id === id;\n });\n const dismissible = data.dismissible === undefined ? true : data.dismissible;\n\n if (alreadyExists) {\n this.toasts = this.toasts.map((toast) => {\n if (toast.id === id) {\n this.publish({ ...toast, ...data, id, title: message });\n return {\n ...toast,\n ...data,\n id,\n dismissible,\n title: message,\n };\n }\n\n return toast;\n });\n } else {\n this.addToast({ title: message, ...rest, dismissible, id });\n }\n\n return id;\n };\n\n dismiss = (id?: number | string) => {\n if (!id) {\n this.toasts.forEach((toast) => {\n this.subscribers.forEach((subscriber) => subscriber({ id: toast.id, dismiss: true }));\n });\n }\n\n this.subscribers.forEach((subscriber) => subscriber({ id, dismiss: true }));\n return id;\n };\n\n message = (message: titleT | React.ReactNode, data?: ExternalToast) => {\n return this.create({ ...data, message });\n };\n\n error = (message: titleT | React.ReactNode, data?: ExternalToast) => {\n return this.create({ ...data, message, type: 'error' });\n };\n\n success = (message: titleT | React.ReactNode, data?: ExternalToast) => {\n return this.create({ ...data, type: 'success', message });\n };\n\n info = (message: titleT | React.ReactNode, data?: ExternalToast) => {\n return this.create({ ...data, type: 'info', message });\n };\n\n warning = (message: titleT | React.ReactNode, data?: ExternalToast) => {\n return this.create({ ...data, type: 'warning', message });\n };\n\n loading = (message: titleT | React.ReactNode, data?: ExternalToast) => {\n return this.create({ ...data, type: 'loading', message });\n };\n\n promise = <ToastData>(promise: PromiseT<ToastData>, data?: PromiseData<ToastData>) => {\n if (!data) {\n // Nothing to show\n return;\n }\n\n let id: string | number | undefined = undefined;\n if (data.loading !== undefined) {\n id = this.create({\n ...data,\n promise,\n type: 'loading',\n message: data.loading,\n description: typeof data.description !== 'function' ? data.description : undefined,\n });\n }\n\n const p = promise instanceof Promise ? promise : promise();\n\n let shouldDismiss = id !== undefined;\n let result: ['resolve', ToastData] | ['reject', unknown];\n\n const originalPromise = p\n .then(async (response) => {\n result = ['resolve', response];\n const isReactElementResponse = React.isValidElement(response);\n if (isReactElementResponse) {\n shouldDismiss = false;\n this.create({ id, type: 'default', message: response });\n } else if (isHttpResponse(response) && !response.ok) {\n shouldDismiss = false;\n const message =\n typeof data.error === 'function' ? await data.error(`HTTP error! status: ${response.status}`) : data.error;\n const description =\n typeof data.description === 'function'\n ? await data.description(`HTTP error! status: ${response.status}`)\n : data.description;\n this.create({ id, type: 'error', message, description });\n } else if (data.success !== undefined) {\n shouldDismiss = false;\n const message = typeof data.success === 'function' ? await data.success(response) : data.success;\n const description =\n typeof data.description === 'function' ? await data.description(response) : data.description;\n this.create({ id, type: 'success', message, description });\n }\n })\n .catch(async (error) => {\n result = ['reject', error];\n if (data.error !== undefined) {\n shouldDismiss = false;\n const message = typeof data.error === 'function' ? await data.error(error) : data.error;\n const description = typeof data.description === 'function' ? await data.description(error) : data.description;\n this.create({ id, type: 'error', message, description });\n }\n })\n .finally(() => {\n if (shouldDismiss) {\n // Toast is still in load state (and will be indefinitely — dismiss it)\n this.dismiss(id);\n id = undefined;\n }\n\n data.finally?.();\n });\n\n const unwrap = () =>\n new Promise<ToastData>((resolve, reject) =>\n originalPromise.then(() => (result[0] === 'reject' ? reject(result[1]) : resolve(result[1]))).catch(reject),\n );\n\n if (typeof id !== 'string' && typeof id !== 'number') {\n // cannot Object.assign on undefined\n return { unwrap };\n } else {\n return Object.assign(id, { unwrap });\n }\n };\n\n custom = (jsx: (id: number | string) => React.ReactElement, data?: ExternalToast) => {\n const id = data?.id || toastsCounter++;\n this.create({ jsx: jsx(id), id, ...data });\n return id;\n };\n}\n\nexport const ToastState = new Observer();\n\n// bind this to the toast function\nconst toastFunction = (message: titleT, data?: ExternalToast) => {\n const id = data?.id || toastsCounter++;\n\n ToastState.addToast({\n title: message,\n ...data,\n id,\n });\n return id;\n};\n\nconst isHttpResponse = (data: any): data is Response => {\n return (\n data &&\n typeof data === 'object' &&\n 'ok' in data &&\n typeof data.ok === 'boolean' &&\n 'status' in data &&\n typeof data.status === 'number'\n );\n};\n\nconst basicToast = toastFunction;\n\nconst getHistory = () => ToastState.toasts;\n\n// We use `Object.assign` to maintain the correct types as we would lose them otherwise\nexport const toast = Object.assign(\n basicToast,\n {\n success: ToastState.success,\n info: ToastState.info,\n warning: ToastState.warning,\n error: ToastState.error,\n custom: ToastState.custom,\n message: ToastState.message,\n promise: ToastState.promise,\n dismiss: ToastState.dismiss,\n loading: ToastState.loading,\n },\n { getHistory },\n);\n","\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\":where(html[dir=\\\"ltr\\\"]),:where([data-sonner-toaster][dir=\\\"ltr\\\"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir=\\\"rtl\\\"]),:where([data-sonner-toaster][dir=\\\"rtl\\\"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted=\\\"true\\\"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted=\\\"true\\\"]){transform:none}}:where([data-sonner-toaster][data-x-position=\\\"right\\\"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position=\\\"left\\\"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position=\\\"center\\\"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position=\\\"top\\\"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position=\\\"bottom\\\"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled=\\\"true\\\"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position=\\\"top\\\"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position=\\\"bottom\\\"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise=\\\"true\\\"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme=\\\"dark\\\"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled=\\\"true\\\"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping=\\\"true\\\"]):before{content:\\\"\\\";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position=\\\"top\\\"][data-swiping=\\\"true\\\"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position=\\\"bottom\\\"][data-swiping=\\\"true\\\"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping=\\\"false\\\"][data-removed=\\\"true\\\"]):before{content:\\\"\\\";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:\\\"\\\";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted=\\\"true\\\"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded=\\\"false\\\"][data-front=\\\"false\\\"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded=\\\"false\\\"][data-front=\\\"false\\\"][data-styled=\\\"true\\\"])>*{opacity:0}:where([data-sonner-toast][data-visible=\\\"false\\\"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted=\\\"true\\\"][data-expanded=\\\"true\\\"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed=\\\"true\\\"][data-front=\\\"true\\\"][data-swipe-out=\\\"false\\\"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed=\\\"true\\\"][data-front=\\\"false\\\"][data-swipe-out=\\\"false\\\"][data-expanded=\\\"true\\\"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed=\\\"true\\\"][data-front=\\\"false\\\"][data-swipe-out=\\\"false\\\"][data-expanded=\\\"false\\\"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed=\\\"true\\\"][data-front=\\\"false\\\"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\\n\")","import React from 'react';\n\nexport type ToastTypes = 'normal' | 'action' | 'success' | 'info' | 'warning' | 'error' | 'loading' | 'default';\n\nexport type PromiseT<Data = any> = Promise<Data> | (() => Promise<Data>);\n\nexport type PromiseTResult<Data = any> =\n | string\n | React.ReactNode\n | ((data: Data) => React.ReactNode | string | Promise<React.ReactNode | string>);\n\nexport type PromiseExternalToast = Omit<ExternalToast, 'description'>;\n\nexport type PromiseData<ToastData = any> = PromiseExternalToast & {\n loading?: string | React.ReactNode;\n success?: PromiseTResult<ToastData>;\n error?: PromiseTResult;\n description?: PromiseTResult;\n finally?: () => void | Promise<void>;\n};\n\nexport interface ToastClassnames {\n toast?: string;\n title?: string;\n description?: string;\n loader?: string;\n closeButton?: string;\n cancelButton?: string;\n actionButton?: string;\n success?: string;\n error?: string;\n info?: string;\n warning?: string;\n loading?: string;\n default?: string;\n content?: string;\n icon?: string;\n}\n\nexport interface ToastIcons {\n success?: React.ReactNode;\n info?: React.ReactNode;\n warning?: React.ReactNode;\n error?: React.ReactNode;\n loading?: React.ReactNode;\n close?: React.ReactNode;\n}\n\nexport interface Action {\n label: React.ReactNode;\n onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n actionButtonStyle?: React.CSSProperties;\n}\n\nexport interface ToastT {\n id: number | string;\n title?: (() => React.ReactNode) | React.ReactNode;\n type?: ToastTypes;\n icon?: React.ReactNode;\n jsx?: React.ReactNode;\n richColors?: boolean;\n invert?: boolean;\n closeButton?: boolean;\n dismissible?: boolean;\n description?: (() => React.ReactNode) | React.ReactNode;\n duration?: number;\n delete?: boolean;\n action?: Action | React.ReactNode;\n cancel?: Action | React.ReactNode;\n onDismiss?: (toast: ToastT) => void;\n onAutoClose?: (toast: ToastT) => void;\n promise?: PromiseT;\n cancelButtonStyle?: React.CSSProperties;\n actionButtonStyle?: React.CSSProperties;\n style?: React.CSSProperties;\n unstyled?: boolean;\n className?: string;\n classNames?: ToastClassnames;\n descriptionClassName?: string;\n position?: Position;\n}\n\nexport function isAction(action: Action | React.ReactNode): action is Action {\n return (action as Action).label !== undefined;\n}\n\nexport type Position = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center';\nexport interface HeightT {\n height: number;\n toastId: number | string;\n position: Position;\n}\n\ninterface ToastOptions {\n className?: string;\n closeButton?: boolean;\n descriptionClassName?: string;\n style?: React.CSSProperties;\n cancelButtonStyle?: React.CSSProperties;\n actionButtonStyle?: React.CSSProperties;\n duration?: number;\n unstyled?: boolean;\n classNames?: ToastClassnames;\n}\n\ntype CnFunction = (...classes: Array<string | undefined>) => string;\n\nexport interface ToasterProps {\n invert?: boolean;\n theme?: 'light' | 'dark' | 'system';\n position?: Position;\n hotkey?: string[];\n richColors?: boolean;\n expand?: boolean;\n duration?: number;\n gap?: number;\n visibleToasts?: number;\n closeButton?: boolean;\n toastOptions?: ToastOptions;\n className?: string;\n style?: React.CSSProperties;\n offset?: string | number;\n dir?: 'rtl' | 'ltr' | 'auto';\n /**\n * @deprecated Please use the `icons` prop instead:\n * ```jsx\n * <Toaster\n * icons={{ loading: <LoadingIcon /> }}\n * />\n * ```\n */\n loadingIcon?: React.ReactNode;\n icons?: ToastIcons;\n containerAriaLabel?: string;\n pauseWhenPageIsHidden?: boolean;\n cn?: CnFunction;\n}\n\nexport interface ToastProps {\n toast: ToastT;\n toasts: ToastT[];\n index: number;\n expanded: boolean;\n invert: boolean;\n heights: HeightT[];\n setHeights: React.Dispatch<React.SetStateAction<HeightT[]>>;\n removeToast: (toast: ToastT) => void;\n gap?: number;\n position: Position;\n visibleToasts: number;\n expandByDefault: boolean;\n closeButton: boolean;\n interacting: boolean;\n style?: React.CSSProperties;\n cancelButtonStyle?: React.CSSProperties;\n actionButtonStyle?: React.CSSProperties;\n duration?: number;\n className?: string;\n unstyled?: boolean;\n descriptionClassName?: string;\n loadingIcon?: React.ReactNode;\n classNames?: ToastClassnames;\n icons?: ToastIcons;\n closeButtonAriaLabel?: string;\n pauseWhenPageIsHidden: boolean;\n cn: CnFunction;\n defaultRichColors?: boolean;\n}\n\nexport enum SwipeStateTypes {\n SwipedOut = 'SwipedOut',\n SwipedBack = 'SwipedBack',\n NotSwiped = 'NotSwiped',\n}\n\nexport type Theme = 'light' | 'dark';\n\nexport interface ToastToDismiss {\n id: number | string;\n dismiss: boolean;\n}\n\nexport type ExternalToast = Omit<ToastT, 'id' | 'type' | 'title' | 'jsx' | 'delete' | 'promise'> & {\n id?: number | string;\n};\n"],"mappings":"8kBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,GAAA,UAAAC,GAAA,cAAAC,KAAA,eAAAC,GAAAL,IAEA,IAAAM,EAAkC,oBAClCC,GAAqB,wBCFrB,IAAAC,EAAkB,oBAGLC,GAAYC,GAAyC,CAChE,OAAQA,EAAM,CACZ,IAAK,UACH,OAAOC,GAET,IAAK,OACH,OAAOC,GAET,IAAK,UACH,OAAOC,GAET,IAAK,QACH,OAAOC,GAET,QACE,OAAO,IACX,CACF,EAEMC,GAAO,MAAM,EAAE,EAAE,KAAK,CAAC,EAEhBC,GAAS,CAAC,CAAE,QAAAC,EAAS,UAAAC,CAAU,IAExC,EAAAC,QAAA,cAAC,OAAI,UAAW,CAAC,yBAA0BD,CAAS,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAA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A,EAAe,EAAK,GAEtCvG,EACE,OAAQP,GAAW,CAACA,EAAM,UAAYM,IAAU,GAAMN,EAAM,WAAakB,CAAQ,EACjF,IAAI,CAAClB,EAAOM,IAAO,CA5sBlC,IAAAlB,GAAAC,GA6sBgB,SAAAwC,QAAA,cAAC3C,GAAA,CACC,IAAKc,EAAM,GACX,MAAOuB,EACP,MAAOjB,EACP,MAAON,EACP,kBAAmBsG,EACnB,UAAUlH,GAAAmH,GAAA,YAAAA,EAAc,WAAd,KAAAnH,GAA0BkE,EACpC,UAAWiD,GAAA,YAAAA,EAAc,UACzB,qBAAsBA,GAAA,YAAAA,EAAc,qBACpC,OAAQpC,EACR,cAAe/D,GACf,aAAaf,GAAAkH,GAAA,YAAAA,EAAc,cAAd,KAAAlH,GAA6BgE,EAC1C,YAAanD,EACb,SAAUgB,EACV,MAAOqF,GAAA,YAAAA,EAAc,MACrB,SAAUA,GAAA,YAAAA,EAAc,SACxB,WAAYA,GAAA,YAAAA,EAAc,WAC1B,kBAAmBA,GAAA,YAAAA,EAAc,kBACjC,kBAAmBA,GAAA,YAAAA,EAAc,kBACjC,YAAa9F,GACb,OAAQF,EAAO,OAAQuF,GAAMA,EAAE,UAAY9F,EAAM,QAAQ,EACzD,QAASK,EAAQ,OAAQiE,GAAMA,EAAE,UAAYtE,EAAM,QAAQ,EAC3D,WAAYG,EACZ,gBAAiBiG,EACjB,IAAKjF,EACL,YAAasF,GACb,SAAUjG,EACV,sBAAuBiB,GACvB,GAAIC,EACN,EACD,CACL,EA9FyB,IAgG7B,CAAC,CACH,CAEJ,CAAC","names":["src_exports","__export","Toaster","toast","useSonner","__toCommonJS","import_react","import_react_dom","import_react","getAsset","type","SuccessIcon","InfoIcon","WarningIcon","ErrorIcon","bars","Loader","visible","className","React","_","i","CloseIcon","import_react","useIsDocumentHidden","isDocumentHidden","setIsDocumentHidden","React","callback","import_react","toastsCounter","Observer","subscriber","index","data","_a","message","rest","id","alreadyExists","toast","dismissible","promise","p","shouldDismiss","result","originalPromise","response","React","isHttpResponse","description","error","unwrap","resolve","reject","jsx","ToastState","toastFunction","basicToast","getHistory","styleInject","css","insertAt","head","style","styleInject","isAction","action","VISIBLE_TOASTS_AMOUNT","VIEWPORT_OFFSET","TOAST_LIFETIME","TOAST_WIDTH","GAP","SWIPE_THRESHOLD","TIME_BEFORE_UNMOUNT","_cn","classes","Toast","props","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","_k","ToasterInvert","toast","unstyled","interacting","setHeights","visibleToasts","heights","index","toasts","expanded","removeToast","defaultRichColors","closeButtonFromToaster","style","cancelButtonStyle","actionButtonStyle","className","descriptionClassName","durationFromToaster","position","gap","loadingIconProp","expandByDefault","classNames","icons","closeButtonAriaLabel","pauseWhenPageIsHidden","cn","mounted","setMounted","React","removed","setRemoved","swiping","setSwiping","swipeOut","setSwipeOut","isSwiped","setIsSwiped","offsetBeforeRemove","setOffsetBeforeRemove","initialHeight","setInitialHeight","remainingTime","dragStartTime","toastRef","isFront","isVisible","toastType","dismissible","toastClassname","toastDescriptionClassname","heightIndex","height","closeButton","duration","closeTimerStartTimeRef","offset","lastCloseTimerStartTimeRef","pointerStartRef","y","x","toastsHeightBefore","prev","curr","reducerIndex","isDocumentHidden","useIsDocumentHidden","invert","disabled","toastNode","h","originalHeight","newHeight","deleteToast","timeoutId","elapsedTime","getLoadingIcon","Loader","event","swipeAmount","timeTaken","velocity","yPosition","isHighlighted","CloseIcon","getAsset","isAction","getDocumentDirection","dirAttribute","useSonner","activeToasts","setActiveToasts","ToastState","currentToasts","t","existingToastIndex","updatedToasts","Toaster","ref","hotkey","expand","theme","richColors","toastOptions","dir","loadingIcon","containerAriaLabel","setToasts","possiblePositions","setExpanded","setInteracting","actualTheme","setActualTheme","listRef","hotkeyLabel","lastFocusedElementRef","isFocusWithinRef","toastToRemove","id","ReactDOM","indexOfExistingToast","darkMediaQuery","matches","error","e","handleKeyDown","key"]}
1
+ {"version":3,"sources":["../src/index.tsx","../src/assets.tsx","../src/hooks.tsx","../src/state.ts","#style-inject:#style-inject","../src/styles.css","../src/types.ts"],"sourcesContent":["'use client';\n\nimport React, { forwardRef, isValidElement } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { CloseIcon, getAsset, Loader } from './assets';\nimport { useIsDocumentHidden } from './hooks';\nimport { toast, ToastState } from './state';\nimport './styles.css';\nimport {\n isAction,\n SwipeDirection,\n type ExternalToast,\n type HeightT,\n type ToasterProps,\n type ToastProps,\n type ToastT,\n type ToastToDismiss,\n} from './types';\n\n// Visible toasts amount\nconst VISIBLE_TOASTS_AMOUNT = 3;\n\n// Viewport padding\nconst VIEWPORT_OFFSET = '32px';\n\n// Mobile viewport padding\nconst MOBILE_VIEWPORT_OFFSET = '16px';\n\n// Default lifetime of a toasts (in ms)\nconst TOAST_LIFETIME = 4000;\n\n// Default toast width\nconst TOAST_WIDTH = 356;\n\n// Default gap between toasts\nconst GAP = 14;\n\n// Threshold to dismiss a toast\nconst SWIPE_THRESHOLD = 20;\n\n// Equal to exit animation duration\nconst TIME_BEFORE_UNMOUNT = 200;\n\nfunction cn(...classes: (string | undefined)[]) {\n return classes.filter(Boolean).join(' ');\n}\n\nfunction getDefaultSwipeDirections(position: string): Array<SwipeDirection> {\n const [y, x] = position.split('-');\n const directions: Array<SwipeDirection> = [];\n\n if (y) {\n directions.push(y as SwipeDirection);\n }\n\n if (x) {\n directions.push(x as SwipeDirection);\n }\n\n return directions;\n}\n\nconst Toast = (props: ToastProps) => {\n const {\n invert: ToasterInvert,\n toast,\n unstyled,\n interacting,\n setHeights,\n visibleToasts,\n heights,\n index,\n toasts,\n expanded,\n removeToast,\n defaultRichColors,\n closeButton: closeButtonFromToaster,\n style,\n cancelButtonStyle,\n actionButtonStyle,\n className = '',\n descriptionClassName = '',\n duration: durationFromToaster,\n position,\n gap,\n loadingIcon: loadingIconProp,\n expandByDefault,\n classNames,\n icons,\n closeButtonAriaLabel = 'Close toast',\n pauseWhenPageIsHidden,\n } = props;\n const [swipeDirection, setSwipeDirection] = React.useState<'x' | 'y' | null>(null);\n const [swipeOutDirection, setSwipeOutDirection] = React.useState<'left' | 'right' | 'up' | 'down' | null>(null);\n const [mounted, setMounted] = React.useState(false);\n const [removed, setRemoved] = React.useState(false);\n const [swiping, setSwiping] = React.useState(false);\n const [swipeOut, setSwipeOut] = React.useState(false);\n const [isSwiped, setIsSwiped] = React.useState(false);\n const [offsetBeforeRemove, setOffsetBeforeRemove] = React.useState(0);\n const [initialHeight, setInitialHeight] = React.useState(0);\n const remainingTime = React.useRef(toast.duration || durationFromToaster || TOAST_LIFETIME);\n const dragStartTime = React.useRef<Date | null>(null);\n const toastRef = React.useRef<HTMLLIElement>(null);\n const isFront = index === 0;\n const isVisible = index + 1 <= visibleToasts;\n const toastType = toast.type;\n const dismissible = toast.dismissible !== false;\n const toastClassname = toast.className || '';\n const toastDescriptionClassname = toast.descriptionClassName || '';\n // Height index is used to calculate the offset as it gets updated before the toast array, which means we can calculate the new layout faster.\n const heightIndex = React.useMemo(\n () => heights.findIndex((height) => height.toastId === toast.id) || 0,\n [heights, toast.id],\n );\n const closeButton = React.useMemo(\n () => toast.closeButton ?? closeButtonFromToaster,\n [toast.closeButton, closeButtonFromToaster],\n );\n const duration = React.useMemo(\n () => toast.duration || durationFromToaster || TOAST_LIFETIME,\n [toast.duration, durationFromToaster],\n );\n const closeTimerStartTimeRef = React.useRef(0);\n const offset = React.useRef(0);\n const lastCloseTimerStartTimeRef = React.useRef(0);\n const pointerStartRef = React.useRef<{ x: number; y: number } | null>(null);\n const [y, x] = position.split('-');\n const toastsHeightBefore = React.useMemo(() => {\n return heights.reduce((prev, curr, reducerIndex) => {\n // Calculate offset up until current toast\n if (reducerIndex >= heightIndex) {\n return prev;\n }\n\n return prev + curr.height;\n }, 0);\n }, [heights, heightIndex]);\n const isDocumentHidden = useIsDocumentHidden();\n\n const invert = toast.invert || ToasterInvert;\n const disabled = toastType === 'loading';\n\n offset.current = React.useMemo(() => heightIndex * gap + toastsHeightBefore, [heightIndex, toastsHeightBefore]);\n\n React.useEffect(() => {\n remainingTime.current = duration;\n }, [duration]);\n\n React.useEffect(() => {\n // Trigger enter animation without using CSS animation\n setMounted(true);\n }, []);\n\n React.useEffect(() => {\n const toastNode = toastRef.current;\n if (toastNode) {\n const height = toastNode.getBoundingClientRect().height;\n // Add toast height to heights array after the toast is mounted\n setInitialHeight(height);\n setHeights((h) => [{ toastId: toast.id, height, position: toast.position }, ...h]);\n return () => setHeights((h) => h.filter((height) => height.toastId !== toast.id));\n }\n }, [setHeights, toast.id]);\n\n React.useLayoutEffect(() => {\n if (!mounted) return;\n const toastNode = toastRef.current;\n const originalHeight = toastNode.style.height;\n toastNode.style.height = 'auto';\n const newHeight = toastNode.getBoundingClientRect().height;\n toastNode.style.height = originalHeight;\n\n setInitialHeight(newHeight);\n\n setHeights((heights) => {\n const alreadyExists = heights.find((height) => height.toastId === toast.id);\n if (!alreadyExists) {\n return [{ toastId: toast.id, height: newHeight, position: toast.position }, ...heights];\n } else {\n return heights.map((height) => (height.toastId === toast.id ? { ...height, height: newHeight } : height));\n }\n });\n }, [mounted, toast.title, toast.description, setHeights, toast.id]);\n\n const deleteToast = React.useCallback(() => {\n // Save the offset for the exit swipe animation\n setRemoved(true);\n setOffsetBeforeRemove(offset.current);\n setHeights((h) => h.filter((height) => height.toastId !== toast.id));\n\n setTimeout(() => {\n removeToast(toast);\n }, TIME_BEFORE_UNMOUNT);\n }, [toast, removeToast, setHeights, offset]);\n\n React.useEffect(() => {\n if ((toast.promise && toastType === 'loading') || toast.duration === Infinity || toast.type === 'loading') return;\n let timeoutId: NodeJS.Timeout;\n\n // Pause the timer on each hover\n const pauseTimer = () => {\n if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {\n // Get the elapsed time since the timer started\n const elapsedTime = new Date().getTime() - closeTimerStartTimeRef.current;\n\n remainingTime.current = remainingTime.current - elapsedTime;\n }\n\n lastCloseTimerStartTimeRef.current = new Date().getTime();\n };\n\n const startTimer = () => {\n // setTimeout(, Infinity) behaves as if the delay is 0.\n // As a result, the toast would be closed immediately, giving the appearance that it was never rendered.\n // See: https://github.com/denysdovhan/wtfjs?tab=readme-ov-file#an-infinite-timeout\n if (remainingTime.current === Infinity) return;\n\n closeTimerStartTimeRef.current = new Date().getTime();\n\n // Let the toast know it has started\n timeoutId = setTimeout(() => {\n toast.onAutoClose?.(toast);\n deleteToast();\n }, remainingTime.current);\n };\n\n if (expanded || interacting || (pauseWhenPageIsHidden && isDocumentHidden)) {\n pauseTimer();\n } else {\n startTimer();\n }\n\n return () => clearTimeout(timeoutId);\n }, [expanded, interacting, toast, toastType, pauseWhenPageIsHidden, isDocumentHidden, deleteToast]);\n\n React.useEffect(() => {\n if (toast.delete) {\n deleteToast();\n }\n }, [deleteToast, toast.delete]);\n\n function getLoadingIcon() {\n if (icons?.loading) {\n return (\n <div\n className={cn(classNames?.loader, toast?.classNames?.loader, 'sonner-loader')}\n data-visible={toastType === 'loading'}\n >\n {icons.loading}\n </div>\n );\n }\n\n if (loadingIconProp) {\n return (\n <div\n className={cn(classNames?.loader, toast?.classNames?.loader, 'sonner-loader')}\n data-visible={toastType === 'loading'}\n >\n {loadingIconProp}\n </div>\n );\n }\n return <Loader className={cn(classNames?.loader, toast?.classNames?.loader)} visible={toastType === 'loading'} />;\n }\n\n return (\n <li\n tabIndex={0}\n ref={toastRef}\n className={cn(\n className,\n toastClassname,\n classNames?.toast,\n toast?.classNames?.toast,\n classNames?.default,\n classNames?.[toastType],\n toast?.classNames?.[toastType],\n )}\n data-sonner-toast=\"\"\n data-rich-colors={toast.richColors ?? defaultRichColors}\n data-styled={!Boolean(toast.jsx || toast.unstyled || unstyled)}\n data-mounted={mounted}\n data-promise={Boolean(toast.promise)}\n data-swiped={isSwiped}\n data-removed={removed}\n data-visible={isVisible}\n data-y-position={y}\n data-x-position={x}\n data-index={index}\n data-front={isFront}\n data-swiping={swiping}\n data-dismissible={dismissible}\n data-type={toastType}\n data-invert={invert}\n data-swipe-out={swipeOut}\n data-swipe-direction={swipeOutDirection}\n data-expanded={Boolean(expanded || (expandByDefault && mounted))}\n style={\n {\n '--index': index,\n '--toasts-before': index,\n '--z-index': toasts.length - index,\n '--offset': `${removed ? offsetBeforeRemove : offset.current}px`,\n '--initial-height': expandByDefault ? 'auto' : `${initialHeight}px`,\n ...style,\n ...toast.style,\n } as React.CSSProperties\n }\n onPointerDown={(event) => {\n if (disabled || !dismissible) return;\n dragStartTime.current = new Date();\n setOffsetBeforeRemove(offset.current);\n // Ensure we maintain correct pointer capture even when going outside of the toast (e.g. when swiping)\n (event.target as HTMLElement).setPointerCapture(event.pointerId);\n if ((event.target as HTMLElement).tagName === 'BUTTON') return;\n setSwiping(true);\n pointerStartRef.current = { x: event.clientX, y: event.clientY };\n }}\n onPointerUp={() => {\n if (swipeOut || !dismissible) return;\n\n pointerStartRef.current = null;\n const swipeAmountX = Number(\n toastRef.current?.style.getPropertyValue('--swipe-amount-x').replace('px', '') || 0,\n );\n const swipeAmountY = Number(\n toastRef.current?.style.getPropertyValue('--swipe-amount-y').replace('px', '') || 0,\n );\n const timeTaken = new Date().getTime() - dragStartTime.current?.getTime();\n\n const swipeAmount = swipeDirection === 'x' ? swipeAmountX : swipeAmountY;\n const velocity = Math.abs(swipeAmount) / timeTaken;\n\n if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {\n setOffsetBeforeRemove(offset.current);\n toast.onDismiss?.(toast);\n\n if (swipeDirection === 'x') {\n setSwipeOutDirection(swipeAmountX > 0 ? 'right' : 'left');\n } else {\n setSwipeOutDirection(swipeAmountY > 0 ? 'down' : 'up');\n }\n\n deleteToast();\n setSwipeOut(true);\n setIsSwiped(false);\n return;\n }\n\n setSwiping(false);\n setSwipeDirection(null);\n }}\n onPointerMove={(event) => {\n if (!pointerStartRef.current || !dismissible) return;\n\n const isHighlighted = window.getSelection()?.toString().length > 0;\n if (isHighlighted) return;\n\n const yDelta = event.clientY - pointerStartRef.current.y;\n const xDelta = event.clientX - pointerStartRef.current.x;\n\n const swipeDirections = props.swipeDirections ?? getDefaultSwipeDirections(position);\n\n // Determine swipe direction if not already locked\n if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {\n setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? 'x' : 'y');\n }\n\n let swipeAmount = { x: 0, y: 0 };\n\n // Only apply swipe in the locked direction\n if (swipeDirection === 'y') {\n // Handle vertical swipes\n if (swipeDirections.includes('top') || swipeDirections.includes('bottom')) {\n if (swipeDirections.includes('top') && yDelta < 0) {\n swipeAmount.y = yDelta;\n } else if (swipeDirections.includes('bottom') && yDelta > 0) {\n swipeAmount.y = yDelta;\n }\n }\n } else if (swipeDirection === 'x') {\n // Handle horizontal swipes\n if (swipeDirections.includes('left') || swipeDirections.includes('right')) {\n if (swipeDirections.includes('left') && xDelta < 0) {\n swipeAmount.x = xDelta;\n } else if (swipeDirections.includes('right') && xDelta > 0) {\n swipeAmount.x = xDelta;\n }\n }\n }\n\n if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {\n setIsSwiped(true);\n }\n\n // Apply transform using both x and y values\n toastRef.current?.style.setProperty('--swipe-amount-x', `${swipeAmount.x}px`);\n toastRef.current?.style.setProperty('--swipe-amount-y', `${swipeAmount.y}px`);\n }}\n >\n {closeButton && !toast.jsx ? (\n <button\n aria-label={closeButtonAriaLabel}\n data-disabled={disabled}\n data-close-button\n onClick={\n disabled || !dismissible\n ? () => {}\n : () => {\n deleteToast();\n toast.onDismiss?.(toast);\n }\n }\n className={cn(classNames?.closeButton, toast?.classNames?.closeButton)}\n >\n {icons?.close ?? CloseIcon}\n </button>\n ) : null}\n {/* TODO: This can be cleaner */}\n {toast.jsx || isValidElement(toast.title) ? (\n toast.jsx ? (\n toast.jsx\n ) : typeof toast.title === 'function' ? (\n toast.title()\n ) : (\n toast.title\n )\n ) : (\n <>\n {toastType || toast.icon || toast.promise ? (\n <div data-icon=\"\" className={cn(classNames?.icon, toast?.classNames?.icon)}>\n {toast.promise || (toast.type === 'loading' && !toast.icon) ? toast.icon || getLoadingIcon() : null}\n {toast.type !== 'loading' ? toast.icon || icons?.[toastType] || getAsset(toastType) : null}\n </div>\n ) : null}\n\n <div data-content=\"\" className={cn(classNames?.content, toast?.classNames?.content)}>\n <div data-title=\"\" className={cn(classNames?.title, toast?.classNames?.title)}>\n {typeof toast.title === 'function' ? toast.title() : toast.title}\n </div>\n {toast.description ? (\n <div\n data-description=\"\"\n className={cn(\n descriptionClassName,\n toastDescriptionClassname,\n classNames?.description,\n toast?.classNames?.description,\n )}\n >\n {typeof toast.description === 'function' ? toast.description() : toast.description}\n </div>\n ) : null}\n </div>\n {isValidElement(toast.cancel) ? (\n toast.cancel\n ) : toast.cancel && isAction(toast.cancel) ? (\n <button\n data-button\n data-cancel\n style={toast.cancelButtonStyle || cancelButtonStyle}\n onClick={(event) => {\n // We need to check twice because typescript\n if (!isAction(toast.cancel)) return;\n if (!dismissible) return;\n toast.cancel.onClick?.(event);\n deleteToast();\n }}\n className={cn(classNames?.cancelButton, toast?.classNames?.cancelButton)}\n >\n {toast.cancel.label}\n </button>\n ) : null}\n {isValidElement(toast.action) ? (\n toast.action\n ) : toast.action && isAction(toast.action) ? (\n <button\n data-button\n data-action\n style={toast.actionButtonStyle || actionButtonStyle}\n onClick={(event) => {\n // We need to check twice because typescript\n if (!isAction(toast.action)) return;\n toast.action.onClick?.(event);\n if (event.defaultPrevented) return;\n deleteToast();\n }}\n className={cn(classNames?.actionButton, toast?.classNames?.actionButton)}\n >\n {toast.action.label}\n </button>\n ) : null}\n </>\n )}\n </li>\n );\n};\n\nfunction getDocumentDirection(): ToasterProps['dir'] {\n if (typeof window === 'undefined') return 'ltr';\n if (typeof document === 'undefined') return 'ltr'; // For Fresh purpose\n\n const dirAttribute = document.documentElement.getAttribute('dir');\n\n if (dirAttribute === 'auto' || !dirAttribute) {\n return window.getComputedStyle(document.documentElement).direction as ToasterProps['dir'];\n }\n\n return dirAttribute as ToasterProps['dir'];\n}\n\nfunction assignOffset(defaultOffset: ToasterProps['offset'], mobileOffset: ToasterProps['mobileOffset']) {\n const styles = {} as React.CSSProperties;\n\n [defaultOffset, mobileOffset].forEach((offset, index) => {\n const isMobile = index === 1;\n const prefix = isMobile ? '--mobile-offset' : '--offset';\n const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;\n\n function assignAll(offset: string | number) {\n ['top', 'right', 'bottom', 'left'].forEach((key) => {\n styles[`${prefix}-${key}`] = typeof offset === 'number' ? `${offset}px` : offset;\n });\n }\n\n if (typeof offset === 'number' || typeof offset === 'string') {\n assignAll(offset);\n } else if (typeof offset === 'object') {\n ['top', 'right', 'bottom', 'left'].forEach((key) => {\n if (offset[key] === undefined) {\n styles[`${prefix}-${key}`] = defaultValue;\n } else {\n styles[`${prefix}-${key}`] = typeof offset[key] === 'number' ? `${offset[key]}px` : offset[key];\n }\n });\n } else {\n assignAll(defaultValue);\n }\n });\n\n return styles;\n}\n\nfunction useSonner() {\n const [activeToasts, setActiveToasts] = React.useState<ToastT[]>([]);\n\n React.useEffect(() => {\n return ToastState.subscribe((toast) => {\n if ((toast as ToastToDismiss).dismiss) {\n setTimeout(() => {\n ReactDOM.flushSync(() => {\n setActiveToasts((toasts) => toasts.filter((t) => t.id !== toast.id));\n });\n });\n return;\n }\n\n // Prevent batching, temp solution.\n setTimeout(() => {\n ReactDOM.flushSync(() => {\n setActiveToasts((toasts) => {\n const indexOfExistingToast = toasts.findIndex((t) => t.id === toast.id);\n\n // Update the toast if it already exists\n if (indexOfExistingToast !== -1) {\n return [\n ...toasts.slice(0, indexOfExistingToast),\n { ...toasts[indexOfExistingToast], ...toast },\n ...toasts.slice(indexOfExistingToast + 1),\n ];\n }\n\n return [toast, ...toasts];\n });\n });\n });\n });\n }, []);\n\n return {\n toasts: activeToasts,\n };\n}\n\nconst Toaster = forwardRef<HTMLElement, ToasterProps>(function Toaster(props, ref) {\n const {\n invert,\n position = 'bottom-right',\n hotkey = ['altKey', 'KeyT'],\n expand,\n closeButton,\n className,\n offset,\n mobileOffset,\n theme = 'light',\n richColors,\n duration,\n style,\n visibleToasts = VISIBLE_TOASTS_AMOUNT,\n toastOptions,\n dir = getDocumentDirection(),\n gap = GAP,\n loadingIcon,\n icons,\n containerAriaLabel = 'Notifications',\n pauseWhenPageIsHidden,\n } = props;\n const [toasts, setToasts] = React.useState<ToastT[]>([]);\n const possiblePositions = React.useMemo(() => {\n return Array.from(\n new Set([position].concat(toasts.filter((toast) => toast.position).map((toast) => toast.position))),\n );\n }, [toasts, position]);\n const [heights, setHeights] = React.useState<HeightT[]>([]);\n const [expanded, setExpanded] = React.useState(false);\n const [interacting, setInteracting] = React.useState(false);\n const [actualTheme, setActualTheme] = React.useState(\n theme !== 'system'\n ? theme\n : typeof window !== 'undefined'\n ? window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches\n ? 'dark'\n : 'light'\n : 'light',\n );\n\n const listRef = React.useRef<HTMLOListElement>(null);\n const hotkeyLabel = hotkey.join('+').replace(/Key/g, '').replace(/Digit/g, '');\n const lastFocusedElementRef = React.useRef<HTMLElement>(null);\n const isFocusWithinRef = React.useRef(false);\n\n const removeToast = React.useCallback((toastToRemove: ToastT) => {\n setToasts((toasts) => {\n if (!toasts.find((toast) => toast.id === toastToRemove.id)?.delete) {\n ToastState.dismiss(toastToRemove.id);\n }\n\n return toasts.filter(({ id }) => id !== toastToRemove.id);\n });\n }, []);\n\n React.useEffect(() => {\n return ToastState.subscribe((toast) => {\n if ((toast as ToastToDismiss).dismiss) {\n setToasts((toasts) => toasts.map((t) => (t.id === toast.id ? { ...t, delete: true } : t)));\n return;\n }\n\n // Prevent batching, temp solution.\n setTimeout(() => {\n ReactDOM.flushSync(() => {\n setToasts((toasts) => {\n const indexOfExistingToast = toasts.findIndex((t) => t.id === toast.id);\n\n // Update the toast if it already exists\n if (indexOfExistingToast !== -1) {\n return [\n ...toasts.slice(0, indexOfExistingToast),\n { ...toasts[indexOfExistingToast], ...toast },\n ...toasts.slice(indexOfExistingToast + 1),\n ];\n }\n\n return [toast, ...toasts];\n });\n });\n });\n });\n }, []);\n\n React.useEffect(() => {\n if (theme !== 'system') {\n setActualTheme(theme);\n return;\n }\n\n if (theme === 'system') {\n // check if current preference is dark\n if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {\n // it's currently dark\n setActualTheme('dark');\n } else {\n // it's not dark\n setActualTheme('light');\n }\n }\n\n if (typeof window === 'undefined') return;\n const darkMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n\n try {\n // Chrome & Firefox\n darkMediaQuery.addEventListener('change', ({ matches }) => {\n if (matches) {\n setActualTheme('dark');\n } else {\n setActualTheme('light');\n }\n });\n } catch (error) {\n // Safari < 14\n darkMediaQuery.addListener(({ matches }) => {\n try {\n if (matches) {\n setActualTheme('dark');\n } else {\n setActualTheme('light');\n }\n } catch (e) {\n console.error(e);\n }\n });\n }\n }, [theme]);\n\n React.useEffect(() => {\n // Ensure expanded is always false when no toasts are present / only one left\n if (toasts.length <= 1) {\n setExpanded(false);\n }\n }, [toasts]);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n const isHotkeyPressed = hotkey.every((key) => (event as any)[key] || event.code === key);\n\n if (isHotkeyPressed) {\n setExpanded(true);\n listRef.current?.focus();\n }\n\n if (\n event.code === 'Escape' &&\n (document.activeElement === listRef.current || listRef.current?.contains(document.activeElement))\n ) {\n setExpanded(false);\n }\n };\n document.addEventListener('keydown', handleKeyDown);\n\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [hotkey]);\n\n React.useEffect(() => {\n if (listRef.current) {\n return () => {\n if (lastFocusedElementRef.current) {\n lastFocusedElementRef.current.focus({ preventScroll: true });\n lastFocusedElementRef.current = null;\n isFocusWithinRef.current = false;\n }\n };\n }\n }, [listRef.current]);\n\n return (\n // Remove item from normal navigation flow, only available via hotkey\n <section\n ref={ref}\n aria-label={`${containerAriaLabel} ${hotkeyLabel}`}\n tabIndex={-1}\n aria-live=\"polite\"\n aria-relevant=\"additions text\"\n aria-atomic=\"false\"\n suppressHydrationWarning\n >\n {possiblePositions.map((position, index) => {\n const [y, x] = position.split('-');\n\n if (!toasts.length) return null;\n\n return (\n <ol\n key={position}\n dir={dir === 'auto' ? getDocumentDirection() : dir}\n tabIndex={-1}\n ref={listRef}\n className={className}\n data-sonner-toaster\n data-theme={actualTheme}\n data-y-position={y}\n data-lifted={expanded && toasts.length > 1 && !expand}\n data-x-position={x}\n style={\n {\n '--front-toast-height': `${heights[0]?.height || 0}px`,\n '--width': `${TOAST_WIDTH}px`,\n '--gap': `${gap}px`,\n ...style,\n ...assignOffset(offset, mobileOffset),\n } as React.CSSProperties\n }\n onBlur={(event) => {\n if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {\n isFocusWithinRef.current = false;\n if (lastFocusedElementRef.current) {\n lastFocusedElementRef.current.focus({ preventScroll: true });\n lastFocusedElementRef.current = null;\n }\n }\n }}\n onFocus={(event) => {\n const isNotDismissible =\n event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';\n\n if (isNotDismissible) return;\n\n if (!isFocusWithinRef.current) {\n isFocusWithinRef.current = true;\n lastFocusedElementRef.current = event.relatedTarget as HTMLElement;\n }\n }}\n onMouseEnter={() => setExpanded(true)}\n onMouseMove={() => setExpanded(true)}\n onMouseLeave={() => {\n // Avoid setting expanded to false when interacting with a toast, e.g. swiping\n if (!interacting) {\n setExpanded(false);\n }\n }}\n onPointerDown={(event) => {\n const isNotDismissible =\n event.target instanceof HTMLElement && event.target.dataset.dismissible === 'false';\n\n if (isNotDismissible) return;\n setInteracting(true);\n }}\n onPointerUp={() => setInteracting(false)}\n >\n {toasts\n .filter((toast) => (!toast.position && index === 0) || toast.position === position)\n .map((toast, index) => (\n <Toast\n key={toast.id}\n icons={icons}\n index={index}\n toast={toast}\n defaultRichColors={richColors}\n duration={toastOptions?.duration ?? duration}\n className={toastOptions?.className}\n descriptionClassName={toastOptions?.descriptionClassName}\n invert={invert}\n visibleToasts={visibleToasts}\n closeButton={toastOptions?.closeButton ?? closeButton}\n interacting={interacting}\n position={position}\n style={toastOptions?.style}\n unstyled={toastOptions?.unstyled}\n classNames={toastOptions?.classNames}\n cancelButtonStyle={toastOptions?.cancelButtonStyle}\n actionButtonStyle={toastOptions?.actionButtonStyle}\n removeToast={removeToast}\n toasts={toasts.filter((t) => t.position == toast.position)}\n heights={heights.filter((h) => h.position == toast.position)}\n setHeights={setHeights}\n expandByDefault={expand}\n gap={gap}\n loadingIcon={loadingIcon}\n expanded={expanded}\n pauseWhenPageIsHidden={pauseWhenPageIsHidden}\n swipeDirections={props.swipeDirections}\n />\n ))}\n </ol>\n );\n })}\n </section>\n );\n});\nexport { toast, Toaster, type ExternalToast, type ToastT, type ToasterProps, useSonner };\nexport { type ToastClassnames, type ToastToDismiss, type Action } from './types';\n","'use client';\nimport React from 'react';\nimport type { ToastTypes } from './types';\n\nexport const getAsset = (type: ToastTypes): JSX.Element | null => {\n switch (type) {\n case 'success':\n return SuccessIcon;\n\n case 'info':\n return InfoIcon;\n\n case 'warning':\n return WarningIcon;\n\n case 'error':\n return ErrorIcon;\n\n default:\n return null;\n }\n};\n\nconst bars = Array(12).fill(0);\n\nexport const Loader = ({ visible, className }: { visible: boolean, className?: string }) => {\n return (\n <div className={['sonner-loading-wrapper', className].filter(Boolean).join(' ')} data-visible={visible}>\n <div className=\"sonner-spinner\">\n {bars.map((_, i) => (\n <div className=\"sonner-loading-bar\" key={`spinner-bar-${i}`} />\n ))}\n </div>\n </div>\n );\n};\n\nconst SuccessIcon = (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" height=\"20\" width=\"20\">\n <path\n fillRule=\"evenodd\"\n d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nconst WarningIcon = (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" height=\"20\" width=\"20\">\n <path\n fillRule=\"evenodd\"\n d=\"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nconst InfoIcon = (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" height=\"20\" width=\"20\">\n <path\n fillRule=\"evenodd\"\n d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nconst ErrorIcon = (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" height=\"20\" width=\"20\">\n <path\n fillRule=\"evenodd\"\n d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z\"\n clipRule=\"evenodd\"\n />\n </svg>\n);\n\nexport const CloseIcon = (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n </svg>\n);\n","import React from 'react';\n\nexport const useIsDocumentHidden = () => {\n const [isDocumentHidden, setIsDocumentHidden] = React.useState(document.hidden);\n\n React.useEffect(() => {\n const callback = () => {\n setIsDocumentHidden(document.hidden);\n };\n document.addEventListener('visibilitychange', callback);\n return () => window.removeEventListener('visibilitychange', callback);\n }, []);\n\n return isDocumentHidden;\n};\n","import type { ExternalToast, PromiseData, PromiseT, ToastT, ToastToDismiss, ToastTypes } from './types';\n\nimport React from 'react';\n\nlet toastsCounter = 1;\n\ntype titleT = (() => React.ReactNode) | React.ReactNode;\n\nclass Observer {\n subscribers: Array<(toast: ExternalToast | ToastToDismiss) => void>;\n toasts: Array<ToastT | ToastToDismiss>;\n dismissedToasts: Set<string | number>;\n\n constructor() {\n this.subscribers = [];\n this.toasts = [];\n this.dismissedToasts = new Set();\n }\n\n // We use arrow functions to maintain the correct `this` reference\n subscribe = (subscriber: (toast: ToastT | ToastToDismiss) => void) => {\n this.subscribers.push(subscriber);\n\n return () => {\n const index = this.subscribers.indexOf(subscriber);\n this.subscribers.splice(index, 1);\n };\n };\n\n publish = (data: ToastT) => {\n this.subscribers.forEach((subscriber) => subscriber(data));\n };\n\n addToast = (data: ToastT) => {\n this.publish(data);\n this.toasts = [...this.toasts, data];\n };\n\n create = (\n data: ExternalToast & {\n message?: titleT;\n type?: ToastTypes;\n promise?: PromiseT;\n jsx?: React.ReactElement;\n },\n ) => {\n const { message, ...rest } = data;\n const id = typeof data?.id === 'number' || data.id?.length > 0 ? data.id : toastsCounter++;\n const alreadyExists = this.toasts.find((toast) => {\n return toast.id === id;\n });\n const dismissible = data.dismissible === undefined ? true : data.dismissible;\n\n if (this.dismissedToasts.has(id)) {\n this.dismissedToasts.delete(id);\n }\n\n if (alreadyExists) {\n this.toasts = this.toasts.map((toast) => {\n if (toast.id === id) {\n this.publish({ ...toast, ...data, id, title: message });\n return {\n ...toast,\n ...data,\n id,\n dismissible,\n title: message,\n };\n }\n\n return toast;\n });\n } else {\n this.addToast({ title: message, ...rest, dismissible, id });\n }\n\n return id;\n };\n\n dismiss = (id?: number | string) => {\n this.dismissedToasts.add(id);\n\n if (!id) {\n this.toasts.forEach((toast) => {\n this.subscribers.forEach((subscriber) => subscriber({ id: toast.id, dismiss: true }));\n });\n }\n this.subscribers.forEach((subscriber) => subscriber({ id, dismiss: true }));\n return id;\n };\n\n message = (message: titleT | React.ReactNode, data?: ExternalToast) => {\n return this.create({ ...data, message });\n };\n\n error = (message: titleT | React.ReactNode, data?: ExternalToast) => {\n return this.create({ ...data, message, type: 'error' });\n };\n\n success = (message: titleT | React.ReactNode, data?: ExternalToast) => {\n return this.create({ ...data, type: 'success', message });\n };\n\n info = (message: titleT | React.ReactNode, data?: ExternalToast) => {\n return this.create({ ...data, type: 'info', message });\n };\n\n warning = (message: titleT | React.ReactNode, data?: ExternalToast) => {\n return this.create({ ...data, type: 'warning', message });\n };\n\n loading = (message: titleT | React.ReactNode, data?: ExternalToast) => {\n return this.create({ ...data, type: 'loading', message });\n };\n\n promise = <ToastData>(promise: PromiseT<ToastData>, data?: PromiseData<ToastData>) => {\n if (!data) {\n // Nothing to show\n return;\n }\n\n let id: string | number | undefined = undefined;\n if (data.loading !== undefined) {\n id = this.create({\n ...data,\n promise,\n type: 'loading',\n message: data.loading,\n description: typeof data.description !== 'function' ? data.description : undefined,\n });\n }\n\n const p = promise instanceof Promise ? promise : promise();\n\n let shouldDismiss = id !== undefined;\n let result: ['resolve', ToastData] | ['reject', unknown];\n\n const originalPromise = p\n .then(async (response) => {\n result = ['resolve', response];\n const isReactElementResponse = React.isValidElement(response);\n if (isReactElementResponse) {\n shouldDismiss = false;\n this.create({ id, type: 'default', message: response });\n } else if (isHttpResponse(response) && !response.ok) {\n shouldDismiss = false;\n const message =\n typeof data.error === 'function' ? await data.error(`HTTP error! status: ${response.status}`) : data.error;\n const description =\n typeof data.description === 'function'\n ? await data.description(`HTTP error! status: ${response.status}`)\n : data.description;\n this.create({ id, type: 'error', message, description });\n } else if (data.success !== undefined) {\n shouldDismiss = false;\n const message = typeof data.success === 'function' ? await data.success(response) : data.success;\n const description =\n typeof data.description === 'function' ? await data.description(response) : data.description;\n this.create({ id, type: 'success', message, description });\n }\n })\n .catch(async (error) => {\n result = ['reject', error];\n if (data.error !== undefined) {\n shouldDismiss = false;\n const message = typeof data.error === 'function' ? await data.error(error) : data.error;\n const description = typeof data.description === 'function' ? await data.description(error) : data.description;\n this.create({ id, type: 'error', message, description });\n }\n })\n .finally(() => {\n if (shouldDismiss) {\n // Toast is still in load state (and will be indefinitely — dismiss it)\n this.dismiss(id);\n id = undefined;\n }\n\n data.finally?.();\n });\n\n const unwrap = () =>\n new Promise<ToastData>((resolve, reject) =>\n originalPromise.then(() => (result[0] === 'reject' ? reject(result[1]) : resolve(result[1]))).catch(reject),\n );\n\n if (typeof id !== 'string' && typeof id !== 'number') {\n // cannot Object.assign on undefined\n return { unwrap };\n } else {\n return Object.assign(id, { unwrap });\n }\n };\n\n custom = (jsx: (id: number | string) => React.ReactElement, data?: ExternalToast) => {\n const id = data?.id || toastsCounter++;\n this.create({ jsx: jsx(id), id, ...data });\n return id;\n };\n\n getActiveToasts = () => {\n return this.toasts.filter((toast) => !this.dismissedToasts.has(toast.id));\n };\n}\n\nexport const ToastState = new Observer();\n\n// bind this to the toast function\nconst toastFunction = (message: titleT, data?: ExternalToast) => {\n const id = data?.id || toastsCounter++;\n\n ToastState.addToast({\n title: message,\n ...data,\n id,\n });\n return id;\n};\n\nconst isHttpResponse = (data: any): data is Response => {\n return (\n data &&\n typeof data === 'object' &&\n 'ok' in data &&\n typeof data.ok === 'boolean' &&\n 'status' in data &&\n typeof data.status === 'number'\n );\n};\n\nconst basicToast = toastFunction;\n\nconst getHistory = () => ToastState.toasts;\nconst getToasts = () => ToastState.getActiveToasts();\n\n// We use `Object.assign` to maintain the correct types as we would lose them otherwise\nexport const toast = Object.assign(\n basicToast,\n {\n success: ToastState.success,\n info: ToastState.info,\n warning: ToastState.warning,\n error: ToastState.error,\n custom: ToastState.custom,\n message: ToastState.message,\n promise: ToastState.promise,\n dismiss: ToastState.dismiss,\n loading: ToastState.loading,\n },\n { getHistory, getToasts },\n);\n","\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n ","import styleInject from '#style-inject';styleInject(\":where(html[dir=\\\"ltr\\\"]),:where([data-sonner-toaster][dir=\\\"ltr\\\"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir=\\\"rtl\\\"]),:where([data-sonner-toaster][dir=\\\"rtl\\\"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted=\\\"true\\\"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted=\\\"true\\\"]){transform:none}}:where([data-sonner-toaster][data-x-position=\\\"right\\\"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position=\\\"left\\\"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position=\\\"center\\\"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position=\\\"top\\\"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position=\\\"bottom\\\"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled=\\\"true\\\"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position=\\\"top\\\"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position=\\\"bottom\\\"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise=\\\"true\\\"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme=\\\"dark\\\"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled=\\\"true\\\"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping=\\\"true\\\"]):before{content:\\\"\\\";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position=\\\"top\\\"][data-swiping=\\\"true\\\"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position=\\\"bottom\\\"][data-swiping=\\\"true\\\"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping=\\\"false\\\"][data-removed=\\\"true\\\"]):before{content:\\\"\\\";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:\\\"\\\";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted=\\\"true\\\"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded=\\\"false\\\"][data-front=\\\"false\\\"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded=\\\"false\\\"][data-front=\\\"false\\\"][data-styled=\\\"true\\\"])>*{opacity:0}:where([data-sonner-toast][data-visible=\\\"false\\\"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted=\\\"true\\\"][data-expanded=\\\"true\\\"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed=\\\"true\\\"][data-front=\\\"true\\\"][data-swipe-out=\\\"false\\\"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed=\\\"true\\\"][data-front=\\\"false\\\"][data-swipe-out=\\\"false\\\"][data-expanded=\\\"true\\\"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed=\\\"true\\\"][data-front=\\\"false\\\"][data-swipe-out=\\\"false\\\"][data-expanded=\\\"false\\\"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed=\\\"true\\\"][data-front=\\\"false\\\"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\\n\")","import React from 'react';\n\nexport type ToastTypes = 'normal' | 'action' | 'success' | 'info' | 'warning' | 'error' | 'loading' | 'default';\n\nexport type PromiseT<Data = any> = Promise<Data> | (() => Promise<Data>);\n\nexport type PromiseTResult<Data = any> =\n | string\n | React.ReactNode\n | ((data: Data) => React.ReactNode | string | Promise<React.ReactNode | string>);\n\nexport type PromiseExternalToast = Omit<ExternalToast, 'description'>;\n\nexport type PromiseData<ToastData = any> = PromiseExternalToast & {\n loading?: string | React.ReactNode;\n success?: PromiseTResult<ToastData>;\n error?: PromiseTResult;\n description?: PromiseTResult;\n finally?: () => void | Promise<void>;\n};\n\nexport interface ToastClassnames {\n toast?: string;\n title?: string;\n description?: string;\n loader?: string;\n closeButton?: string;\n cancelButton?: string;\n actionButton?: string;\n success?: string;\n error?: string;\n info?: string;\n warning?: string;\n loading?: string;\n default?: string;\n content?: string;\n icon?: string;\n}\n\nexport interface ToastIcons {\n success?: React.ReactNode;\n info?: React.ReactNode;\n warning?: React.ReactNode;\n error?: React.ReactNode;\n loading?: React.ReactNode;\n close?: React.ReactNode;\n}\n\nexport interface Action {\n label: React.ReactNode;\n onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n actionButtonStyle?: React.CSSProperties;\n}\n\nexport interface ToastT {\n id: number | string;\n title?: (() => React.ReactNode) | React.ReactNode;\n type?: ToastTypes;\n icon?: React.ReactNode;\n jsx?: React.ReactNode;\n richColors?: boolean;\n invert?: boolean;\n closeButton?: boolean;\n dismissible?: boolean;\n description?: (() => React.ReactNode) | React.ReactNode;\n duration?: number;\n delete?: boolean;\n action?: Action | React.ReactNode;\n cancel?: Action | React.ReactNode;\n onDismiss?: (toast: ToastT) => void;\n onAutoClose?: (toast: ToastT) => void;\n promise?: PromiseT;\n cancelButtonStyle?: React.CSSProperties;\n actionButtonStyle?: React.CSSProperties;\n style?: React.CSSProperties;\n unstyled?: boolean;\n className?: string;\n classNames?: ToastClassnames;\n descriptionClassName?: string;\n position?: Position;\n}\n\nexport function isAction(action: Action | React.ReactNode): action is Action {\n return (action as Action).label !== undefined;\n}\n\nexport type Position = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center';\nexport interface HeightT {\n height: number;\n toastId: number | string;\n position: Position;\n}\n\ninterface ToastOptions {\n className?: string;\n closeButton?: boolean;\n descriptionClassName?: string;\n style?: React.CSSProperties;\n cancelButtonStyle?: React.CSSProperties;\n actionButtonStyle?: React.CSSProperties;\n duration?: number;\n unstyled?: boolean;\n classNames?: ToastClassnames;\n}\n\ntype Offset =\n | {\n top?: string | number;\n right?: string | number;\n bottom?: string | number;\n left?: string | number;\n }\n | string\n | number;\n\nexport interface ToasterProps {\n invert?: boolean;\n theme?: 'light' | 'dark' | 'system';\n position?: Position;\n hotkey?: string[];\n richColors?: boolean;\n expand?: boolean;\n duration?: number;\n gap?: number;\n visibleToasts?: number;\n closeButton?: boolean;\n toastOptions?: ToastOptions;\n className?: string;\n style?: React.CSSProperties;\n offset?: Offset;\n mobileOffset?: Offset;\n dir?: 'rtl' | 'ltr' | 'auto';\n swipeDirections?: SwipeDirection[];\n /**\n * @deprecated Please use the `icons` prop instead:\n * ```jsx\n * <Toaster\n * icons={{ loading: <LoadingIcon /> }}\n * />\n * ```\n */\n loadingIcon?: React.ReactNode;\n icons?: ToastIcons;\n containerAriaLabel?: string;\n pauseWhenPageIsHidden?: boolean;\n}\n\nexport type SwipeDirection = 'top' | 'right' | 'bottom' | 'left';\n\nexport interface ToastProps {\n toast: ToastT;\n toasts: ToastT[];\n index: number;\n swipeDirections?: SwipeDirection[];\n expanded: boolean;\n invert: boolean;\n heights: HeightT[];\n setHeights: React.Dispatch<React.SetStateAction<HeightT[]>>;\n removeToast: (toast: ToastT) => void;\n gap?: number;\n position: Position;\n visibleToasts: number;\n expandByDefault: boolean;\n closeButton: boolean;\n interacting: boolean;\n style?: React.CSSProperties;\n cancelButtonStyle?: React.CSSProperties;\n actionButtonStyle?: React.CSSProperties;\n duration?: number;\n className?: string;\n unstyled?: boolean;\n descriptionClassName?: string;\n loadingIcon?: React.ReactNode;\n classNames?: ToastClassnames;\n icons?: ToastIcons;\n closeButtonAriaLabel?: string;\n pauseWhenPageIsHidden: boolean;\n defaultRichColors?: boolean;\n}\n\nexport enum SwipeStateTypes {\n SwipedOut = 'SwipedOut',\n SwipedBack = 'SwipedBack',\n NotSwiped = 'NotSwiped',\n}\n\nexport type Theme = 'light' | 'dark';\n\nexport interface ToastToDismiss {\n id: number | string;\n dismiss: boolean;\n}\n\nexport type ExternalToast = Omit<ToastT, 'id' | 'type' | 'title' | 'jsx' | 'delete' | 'promise'> & {\n id?: number | string;\n};\n"],"mappings":"+kBAAA,IAAAA,GAAA,GAAAC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AQF,EAAO,OAAQmG,GAAMA,EAAE,UAAY1G,EAAM,QAAQ,EACzD,QAASK,GAAQ,OAAQiE,GAAMA,EAAE,UAAYtE,EAAM,QAAQ,EAC3D,WAAYG,GACZ,gBAAiB4G,EACjB,IAAK7F,GACL,YAAakG,EACb,SAAU5G,EACV,sBAAuBgB,GACvB,gBAAiBrC,EAAM,gBACzB,EACD,CACL,EA9FyB,IAgG7B,CAAC,CACH,CAEJ,CAAC","names":["src_exports","__export","Toaster","toast","useSonner","__toCommonJS","import_react","import_react_dom","import_react","getAsset","type","SuccessIcon","InfoIcon","WarningIcon","ErrorIcon","bars","Loader","visible","className","React","_","i","CloseIcon","import_react","useIsDocumentHidden","isDocumentHidden","setIsDocumentHidden","React","callback","import_react","toastsCounter","Observer","subscriber","index","data","_a","message","rest","id","alreadyExists","toast","dismissible","promise","p","shouldDismiss","result","originalPromise","response","React","isHttpResponse","description","error","unwrap","resolve","reject","jsx","ToastState","toastFunction","basicToast","getHistory","getToasts","styleInject","css","insertAt","head","style","styleInject","isAction","action","VISIBLE_TOASTS_AMOUNT","VIEWPORT_OFFSET","MOBILE_VIEWPORT_OFFSET","TOAST_LIFETIME","TOAST_WIDTH","GAP","SWIPE_THRESHOLD","TIME_BEFORE_UNMOUNT","cn","classes","getDefaultSwipeDirections","position","y","x","directions","Toast","props","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","_k","ToasterInvert","toast","unstyled","interacting","setHeights","visibleToasts","heights","index","toasts","expanded","removeToast","defaultRichColors","closeButtonFromToaster","style","cancelButtonStyle","actionButtonStyle","className","descriptionClassName","durationFromToaster","gap","loadingIconProp","expandByDefault","classNames","icons","closeButtonAriaLabel","pauseWhenPageIsHidden","swipeDirection","setSwipeDirection","React","swipeOutDirection","setSwipeOutDirection","mounted","setMounted","removed","setRemoved","swiping","setSwiping","swipeOut","setSwipeOut","isSwiped","setIsSwiped","offsetBeforeRemove","setOffsetBeforeRemove","initialHeight","setInitialHeight","remainingTime","dragStartTime","toastRef","isFront","isVisible","toastType","dismissible","toastClassname","toastDescriptionClassname","heightIndex","height","closeButton","duration","closeTimerStartTimeRef","offset","lastCloseTimerStartTimeRef","pointerStartRef","toastsHeightBefore","prev","curr","reducerIndex","isDocumentHidden","useIsDocumentHidden","invert","disabled","toastNode","h","originalHeight","newHeight","deleteToast","timeoutId","elapsedTime","getLoadingIcon","Loader","event","swipeAmountX","swipeAmountY","timeTaken","swipeAmount","velocity","yDelta","xDelta","swipeDirections","CloseIcon","getAsset","isAction","getDocumentDirection","dirAttribute","assignOffset","defaultOffset","mobileOffset","styles","isMobile","prefix","defaultValue","assignAll","key","useSonner","activeToasts","setActiveToasts","ToastState","ReactDOM","t","indexOfExistingToast","Toaster","ref","hotkey","expand","theme","richColors","toastOptions","dir","loadingIcon","containerAriaLabel","setToasts","possiblePositions","setExpanded","setInteracting","actualTheme","setActualTheme","listRef","hotkeyLabel","lastFocusedElementRef","isFocusWithinRef","toastToRemove","id","darkMediaQuery","matches","error","e","handleKeyDown"]}
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- "use client";import e,{forwardRef as ee}from"react";import oe from"react-dom";import S from"react";var kt=r=>{switch(r){case"success":return Vt;case"info":return Kt;case"warning":return Ot;case"error":return Jt;default:return null}},Ut=Array(12).fill(0),Dt=({visible:r,className:o})=>S.createElement("div",{className:["sonner-loading-wrapper",o].filter(Boolean).join(" "),"data-visible":r},S.createElement("div",{className:"sonner-spinner"},Ut.map((t,s)=>S.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),Vt=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Ot=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Kt=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Jt=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},S.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Ht=S.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},S.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),S.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}));import Mt from"react";var At=()=>{let[r,o]=Mt.useState(document.hidden);return Mt.useEffect(()=>{let t=()=>{o(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),r};import Xt from"react";var ft=1,mt=class{constructor(){this.subscribe=o=>(this.subscribers.push(o),()=>{let t=this.subscribers.indexOf(o);this.subscribers.splice(t,1)});this.publish=o=>{this.subscribers.forEach(t=>t(o))};this.addToast=o=>{this.publish(o),this.toasts=[...this.toasts,o]};this.create=o=>{var P;let{message:t,...s}=o,g=typeof(o==null?void 0:o.id)=="number"||((P=o.id)==null?void 0:P.length)>0?o.id:ft++,l=this.toasts.find(h=>h.id===g),E=o.dismissible===void 0?!0:o.dismissible;return l?this.toasts=this.toasts.map(h=>h.id===g?(this.publish({...h,...o,id:g,title:t}),{...h,...o,id:g,dismissible:E,title:t}):h):this.addToast({title:t,...s,dismissible:E,id:g}),g};this.dismiss=o=>(o||this.toasts.forEach(t=>{this.subscribers.forEach(s=>s({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:o,dismiss:!0})),o);this.message=(o,t)=>this.create({...t,message:o});this.error=(o,t)=>this.create({...t,message:o,type:"error"});this.success=(o,t)=>this.create({...t,type:"success",message:o});this.info=(o,t)=>this.create({...t,type:"info",message:o});this.warning=(o,t)=>this.create({...t,type:"warning",message:o});this.loading=(o,t)=>this.create({...t,type:"loading",message:o});this.promise=(o,t)=>{if(!t)return;let s;t.loading!==void 0&&(s=this.create({...t,promise:o,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let g=o instanceof Promise?o:o(),l=s!==void 0,E,P=g.then(async c=>{if(E=["resolve",c],Xt.isValidElement(c))l=!1,this.create({id:s,type:"default",message:c});else if(Qt(c)&&!c.ok){l=!1;let k=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,j=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:s,type:"error",message:k,description:j})}else if(t.success!==void 0){l=!1;let k=typeof t.success=="function"?await t.success(c):t.success,j=typeof t.description=="function"?await t.description(c):t.description;this.create({id:s,type:"success",message:k,description:j})}}).catch(async c=>{if(E=["reject",c],t.error!==void 0){l=!1;let y=typeof t.error=="function"?await t.error(c):t.error,k=typeof t.description=="function"?await t.description(c):t.description;this.create({id:s,type:"error",message:y,description:k})}}).finally(()=>{var c;l&&(this.dismiss(s),s=void 0),(c=t.finally)==null||c.call(t)}),h=()=>new Promise((c,y)=>P.then(()=>E[0]==="reject"?y(E[1]):c(E[1])).catch(y));return typeof s!="string"&&typeof s!="number"?{unwrap:h}:Object.assign(s,{unwrap:h})};this.custom=(o,t)=>{let s=(t==null?void 0:t.id)||ft++;return this.create({jsx:o(s),id:s,...t}),s};this.subscribers=[],this.toasts=[]}},T=new mt,Gt=(r,o)=>{let t=(o==null?void 0:o.id)||ft++;return T.addToast({title:r,...o,id:t}),t},Qt=r=>r&&typeof r=="object"&&"ok"in r&&typeof r.ok=="boolean"&&"status"in r&&typeof r.status=="number",qt=Gt,Zt=()=>T.toasts,te=Object.assign(qt,{success:T.success,info:T.info,warning:T.warning,error:T.error,custom:T.custom,message:T.message,promise:T.promise,dismiss:T.dismiss,loading:T.loading},{getHistory:Zt});function pt(r,{insertAt:o}={}){if(!r||typeof document=="undefined")return;let t=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",o==="top"&&t.firstChild?t.insertBefore(s,t.firstChild):t.appendChild(s),s.styleSheet?s.styleSheet.cssText=r:s.appendChild(document.createTextNode(r))}pt(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
2
- `);function V(r){return r.label!==void 0}var ae=3,ne="32px",Lt=4e3,se=356,re=14,ie=20,le=200;function de(...r){return r.filter(Boolean).join(" ")}var ce=r=>{var xt,vt,wt,Tt,Rt,St,Et,Nt,Pt,Ct,Bt;let{invert:o,toast:t,unstyled:s,interacting:g,setHeights:l,visibleToasts:E,heights:P,index:h,toasts:c,expanded:y,removeToast:k,defaultRichColors:j,closeButton:O,style:st,cancelButtonStyle:i,actionButtonStyle:K,className:J="",descriptionClassName:rt="",duration:_,position:it,gap:lt,loadingIcon:X,expandByDefault:C,classNames:a,icons:N,closeButtonAriaLabel:G="Close toast",pauseWhenPageIsHidden:Q,cn:R}=r,[B,q]=e.useState(!1),[U,dt]=e.useState(!1),[M,A]=e.useState(!1),[Z,L]=e.useState(!1),[Y,tt]=e.useState(!1),[d,u]=e.useState(0),[b,w]=e.useState(0),D=e.useRef(t.duration||_||Lt),f=e.useRef(null),H=e.useRef(null),et=h===0,ot=h+1<=E,x=t.type,F=t.dismissible!==!1,jt=t.className||"",Yt=t.descriptionClassName||"",at=e.useMemo(()=>P.findIndex(n=>n.toastId===t.id)||0,[P,t.id]),Ft=e.useMemo(()=>{var n;return(n=t.closeButton)!=null?n:O},[t.closeButton,O]),ue=e.useMemo(()=>t.duration||_||Lt,[t.duration,_]),ct=e.useRef(0),$=e.useRef(0),gt=e.useRef(0),nt=e.useRef(null),[ht,$t]=it.split("-"),bt=e.useMemo(()=>P.reduce((n,m,p)=>p>=at?n:n+m.height,0),[P,at]),yt=At(),Wt=t.invert||o,ut=x==="loading";$.current=e.useMemo(()=>at*lt+bt,[at,bt]),e.useEffect(()=>{q(!0)},[]),e.useEffect(()=>{let n=H.current;if(n){let m=n.getBoundingClientRect().height;return w(m),l(p=>[{toastId:t.id,height:m,position:t.position},...p]),()=>l(p=>p.filter(v=>v.toastId!==t.id))}},[l,t.id]),e.useLayoutEffect(()=>{if(!B)return;let n=H.current,m=n.style.height;n.style.height="auto";let p=n.getBoundingClientRect().height;n.style.height=m,w(p),l(v=>v.find(I=>I.toastId===t.id)?v.map(I=>I.toastId===t.id?{...I,height:p}:I):[{toastId:t.id,height:p,position:t.position},...v])},[B,t.title,t.description,l,t.id]);let z=e.useCallback(()=>{dt(!0),u($.current),l(n=>n.filter(m=>m.toastId!==t.id)),setTimeout(()=>{k(t)},le)},[t,k,l,$]);e.useEffect(()=>{if(t.promise&&x==="loading"||t.duration===1/0||t.type==="loading")return;let n;return y||g||Q&&yt?(()=>{if(gt.current<ct.current){let v=new Date().getTime()-ct.current;D.current=D.current-v}gt.current=new Date().getTime()})():(()=>{D.current!==1/0&&(ct.current=new Date().getTime(),n=setTimeout(()=>{var v;(v=t.onAutoClose)==null||v.call(t,t),z()},D.current))})(),()=>clearTimeout(n)},[y,g,t,x,Q,yt,z]),e.useEffect(()=>{t.delete&&z()},[z,t.delete]);function _t(){var n,m,p;return N!=null&&N.loading?e.createElement("div",{className:R(a==null?void 0:a.loader,(n=t==null?void 0:t.classNames)==null?void 0:n.loader,"sonner-loader"),"data-visible":x==="loading"},N.loading):X?e.createElement("div",{className:R(a==null?void 0:a.loader,(m=t==null?void 0:t.classNames)==null?void 0:m.loader,"sonner-loader"),"data-visible":x==="loading"},X):e.createElement(Dt,{className:R(a==null?void 0:a.loader,(p=t==null?void 0:t.classNames)==null?void 0:p.loader),visible:x==="loading"})}return e.createElement("li",{tabIndex:0,ref:H,className:R(J,jt,a==null?void 0:a.toast,(xt=t==null?void 0:t.classNames)==null?void 0:xt.toast,a==null?void 0:a.default,a==null?void 0:a[x],(vt=t==null?void 0:t.classNames)==null?void 0:vt[x]),"data-sonner-toast":"","data-rich-colors":(wt=t.richColors)!=null?wt:j,"data-styled":!(t.jsx||t.unstyled||s),"data-mounted":B,"data-promise":!!t.promise,"data-swiped":Y,"data-removed":U,"data-visible":ot,"data-y-position":ht,"data-x-position":$t,"data-index":h,"data-front":et,"data-swiping":M,"data-dismissible":F,"data-type":x,"data-invert":Wt,"data-swipe-out":Z,"data-expanded":!!(y||C&&B),style:{"--index":h,"--toasts-before":h,"--z-index":c.length-h,"--offset":`${U?d:$.current}px`,"--initial-height":C?"auto":`${b}px`,...st,...t.style},onPointerDown:n=>{ut||!F||(f.current=new Date,u($.current),n.target.setPointerCapture(n.pointerId),n.target.tagName!=="BUTTON"&&(A(!0),nt.current={x:n.clientX,y:n.clientY}))},onPointerUp:()=>{var v,W,I,It;if(Z||!F)return;nt.current=null;let n=Number(((v=H.current)==null?void 0:v.style.getPropertyValue("--swipe-amount").replace("px",""))||0),m=new Date().getTime()-((W=f.current)==null?void 0:W.getTime()),p=Math.abs(n)/m;if(Math.abs(n)>=ie||p>.11){u($.current),(I=t.onDismiss)==null||I.call(t,t),z(),L(!0),tt(!1);return}(It=H.current)==null||It.style.setProperty("--swipe-amount","0px"),A(!1)},onPointerMove:n=>{var W,I;if(!nt.current||!F)return;let m=n.clientY-nt.current.y,p=((W=window.getSelection())==null?void 0:W.toString().length)>0,v=ht==="top"?Math.min(0,m):Math.max(0,m);Math.abs(v)>0&&tt(!0),!p&&((I=H.current)==null||I.style.setProperty("--swipe-amount",`${v}px`))}},Ft&&!t.jsx?e.createElement("button",{"aria-label":G,"data-disabled":ut,"data-close-button":!0,onClick:ut||!F?()=>{}:()=>{var n;z(),(n=t.onDismiss)==null||n.call(t,t)},className:R(a==null?void 0:a.closeButton,(Tt=t==null?void 0:t.classNames)==null?void 0:Tt.closeButton)},(Rt=N==null?void 0:N.close)!=null?Rt:Ht):null,t.jsx||e.isValidElement(t.title)?t.jsx?t.jsx:typeof t.title=="function"?t.title():t.title:e.createElement(e.Fragment,null,x||t.icon||t.promise?e.createElement("div",{"data-icon":"",className:R(a==null?void 0:a.icon,(St=t==null?void 0:t.classNames)==null?void 0:St.icon)},t.promise||t.type==="loading"&&!t.icon?t.icon||_t():null,t.type!=="loading"?t.icon||(N==null?void 0:N[x])||kt(x):null):null,e.createElement("div",{"data-content":"",className:R(a==null?void 0:a.content,(Et=t==null?void 0:t.classNames)==null?void 0:Et.content)},e.createElement("div",{"data-title":"",className:R(a==null?void 0:a.title,(Nt=t==null?void 0:t.classNames)==null?void 0:Nt.title)},typeof t.title=="function"?t.title():t.title),t.description?e.createElement("div",{"data-description":"",className:R(rt,Yt,a==null?void 0:a.description,(Pt=t==null?void 0:t.classNames)==null?void 0:Pt.description)},typeof t.description=="function"?t.description():t.description):null),e.isValidElement(t.cancel)?t.cancel:t.cancel&&V(t.cancel)?e.createElement("button",{"data-button":!0,"data-cancel":!0,style:t.cancelButtonStyle||i,onClick:n=>{var m,p;V(t.cancel)&&F&&((p=(m=t.cancel).onClick)==null||p.call(m,n),z())},className:R(a==null?void 0:a.cancelButton,(Ct=t==null?void 0:t.classNames)==null?void 0:Ct.cancelButton)},t.cancel.label):null,e.isValidElement(t.action)?t.action:t.action&&V(t.action)?e.createElement("button",{"data-button":!0,"data-action":!0,style:t.actionButtonStyle||K,onClick:n=>{var m,p;V(t.action)&&((p=(m=t.action).onClick)==null||p.call(m,n),!n.defaultPrevented&&z())},className:R(a==null?void 0:a.actionButton,(Bt=t==null?void 0:t.classNames)==null?void 0:Bt.actionButton)},t.action.label):null))};function zt(){if(typeof window=="undefined"||typeof document=="undefined")return"ltr";let r=document.documentElement.getAttribute("dir");return r==="auto"||!r?window.getComputedStyle(document.documentElement).direction:r}function Ce(){let[r,o]=e.useState([]);return e.useEffect(()=>T.subscribe(t=>{o(s=>{if("dismiss"in t&&t.dismiss)return s.filter(l=>l.id!==t.id);let g=s.findIndex(l=>l.id===t.id);if(g!==-1){let l=[...s];return l[g]={...l[g],...t},l}else return[t,...s]})}),[]),{toasts:r}}var Be=ee(function(o,t){let{invert:s,position:g="bottom-right",hotkey:l=["altKey","KeyT"],expand:E,closeButton:P,className:h,offset:c,theme:y="light",richColors:k,duration:j,style:O,visibleToasts:st=ae,toastOptions:i,dir:K=zt(),gap:J=re,loadingIcon:rt,icons:_,containerAriaLabel:it="Notifications",pauseWhenPageIsHidden:lt,cn:X=de}=o,[C,a]=e.useState([]),N=e.useMemo(()=>Array.from(new Set([g].concat(C.filter(d=>d.position).map(d=>d.position)))),[C,g]),[G,Q]=e.useState([]),[R,B]=e.useState(!1),[q,U]=e.useState(!1),[dt,M]=e.useState(y!=="system"?y:typeof window!="undefined"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),A=e.useRef(null),Z=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=e.useRef(null),Y=e.useRef(!1),tt=e.useCallback(d=>{a(u=>{var b;return(b=u.find(w=>w.id===d.id))!=null&&b.delete||T.dismiss(d.id),u.filter(({id:w})=>w!==d.id)})},[]);return e.useEffect(()=>T.subscribe(d=>{if(d.dismiss){a(u=>u.map(b=>b.id===d.id?{...b,delete:!0}:b));return}setTimeout(()=>{oe.flushSync(()=>{a(u=>{let b=u.findIndex(w=>w.id===d.id);return b!==-1?[...u.slice(0,b),{...u[b],...d},...u.slice(b+1)]:[d,...u]})})})}),[]),e.useEffect(()=>{if(y!=="system"){M(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?M("dark"):M("light")),typeof window=="undefined")return;let d=window.matchMedia("(prefers-color-scheme: dark)");try{d.addEventListener("change",({matches:u})=>{M(u?"dark":"light")})}catch(u){d.addListener(({matches:b})=>{try{M(b?"dark":"light")}catch(w){console.error(w)}})}},[y]),e.useEffect(()=>{C.length<=1&&B(!1)},[C]),e.useEffect(()=>{let d=u=>{var w,D;l.every(f=>u[f]||u.code===f)&&(B(!0),(w=A.current)==null||w.focus()),u.code==="Escape"&&(document.activeElement===A.current||(D=A.current)!=null&&D.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[l]),e.useEffect(()=>{if(A.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,Y.current=!1)}},[A.current]),e.createElement("section",{"aria-label":`${it} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false"},N.map((d,u)=>{var D;let[b,w]=d.split("-");return C.length?e.createElement("ol",{key:d,dir:K==="auto"?zt():K,tabIndex:-1,ref:A,className:h,"data-sonner-toaster":!0,"data-theme":dt,"data-y-position":b,"data-lifted":R&&C.length>1&&!E,"data-x-position":w,style:{"--front-toast-height":`${((D=G[0])==null?void 0:D.height)||0}px`,"--offset":typeof c=="number"?`${c}px`:c||ne,"--width":`${se}px`,"--gap":`${J}px`,...O},onBlur:f=>{Y.current&&!f.currentTarget.contains(f.relatedTarget)&&(Y.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:f=>{f.target instanceof HTMLElement&&f.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,L.current=f.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{q||B(!1)},onPointerDown:f=>{f.target instanceof HTMLElement&&f.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},C.filter(f=>!f.position&&u===0||f.position===d).map((f,H)=>{var et,ot;return e.createElement(ce,{key:f.id,icons:_,index:H,toast:f,defaultRichColors:k,duration:(et=i==null?void 0:i.duration)!=null?et:j,className:i==null?void 0:i.className,descriptionClassName:i==null?void 0:i.descriptionClassName,invert:s,visibleToasts:st,closeButton:(ot=i==null?void 0:i.closeButton)!=null?ot:P,interacting:q,position:d,style:i==null?void 0:i.style,unstyled:i==null?void 0:i.unstyled,classNames:i==null?void 0:i.classNames,cancelButtonStyle:i==null?void 0:i.cancelButtonStyle,actionButtonStyle:i==null?void 0:i.actionButtonStyle,removeToast:tt,toasts:C.filter(x=>x.position==f.position),heights:G.filter(x=>x.position==f.position),setHeights:Q,expandByDefault:E,gap:J,loadingIcon:rt,expanded:R,pauseWhenPageIsHidden:lt,cn:X})})):null}))});export{Be as Toaster,te as toast,Ce as useSonner};
1
+ "use client";import o,{forwardRef as fe,isValidElement as xt}from"react";import vt from"react-dom";import E from"react";var jt=n=>{switch(n){case"success":return ee;case"info":return ae;case"warning":return oe;case"error":return se;default:return null}},te=Array(12).fill(0),Yt=({visible:n,className:e})=>E.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":n},E.createElement("div",{className:"sonner-spinner"},te.map((t,a)=>E.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),ee=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),oe=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),ae=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),se=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},E.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Ot=E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},E.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),E.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}));import $t from"react";var Ft=()=>{let[n,e]=$t.useState(document.hidden);return $t.useEffect(()=>{let t=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",t),()=>window.removeEventListener("visibilitychange",t)},[]),n};import re from"react";var bt=1,yt=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)});this.publish=e=>{this.subscribers.forEach(t=>t(e))};this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]};this.create=e=>{var S;let{message:t,...a}=e,u=typeof(e==null?void 0:e.id)=="number"||((S=e.id)==null?void 0:S.length)>0?e.id:bt++,f=this.toasts.find(g=>g.id===u),w=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),f?this.toasts=this.toasts.map(g=>g.id===u?(this.publish({...g,...e,id:u,title:t}),{...g,...e,id:u,dismissible:w,title:t}):g):this.addToast({title:t,...a,dismissible:w,id:u}),u};this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(a=>a({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e);this.message=(e,t)=>this.create({...t,message:e});this.error=(e,t)=>this.create({...t,message:e,type:"error"});this.success=(e,t)=>this.create({...t,type:"success",message:e});this.info=(e,t)=>this.create({...t,type:"info",message:e});this.warning=(e,t)=>this.create({...t,type:"warning",message:e});this.loading=(e,t)=>this.create({...t,type:"loading",message:e});this.promise=(e,t)=>{if(!t)return;let a;t.loading!==void 0&&(a=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let u=e instanceof Promise?e:e(),f=a!==void 0,w,S=u.then(async i=>{if(w=["resolve",i],re.isValidElement(i))f=!1,this.create({id:a,type:"default",message:i});else if(ie(i)&&!i.ok){f=!1;let T=typeof t.error=="function"?await t.error(`HTTP error! status: ${i.status}`):t.error,F=typeof t.description=="function"?await t.description(`HTTP error! status: ${i.status}`):t.description;this.create({id:a,type:"error",message:T,description:F})}else if(t.success!==void 0){f=!1;let T=typeof t.success=="function"?await t.success(i):t.success,F=typeof t.description=="function"?await t.description(i):t.description;this.create({id:a,type:"success",message:T,description:F})}}).catch(async i=>{if(w=["reject",i],t.error!==void 0){f=!1;let D=typeof t.error=="function"?await t.error(i):t.error,T=typeof t.description=="function"?await t.description(i):t.description;this.create({id:a,type:"error",message:D,description:T})}}).finally(()=>{var i;f&&(this.dismiss(a),a=void 0),(i=t.finally)==null||i.call(t)}),g=()=>new Promise((i,D)=>S.then(()=>w[0]==="reject"?D(w[1]):i(w[1])).catch(D));return typeof a!="string"&&typeof a!="number"?{unwrap:g}:Object.assign(a,{unwrap:g})};this.custom=(e,t)=>{let a=(t==null?void 0:t.id)||bt++;return this.create({jsx:e(a),id:a,...t}),a};this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id));this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},v=new yt,ne=(n,e)=>{let t=(e==null?void 0:e.id)||bt++;return v.addToast({title:n,...e,id:t}),t},ie=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",le=ne,ce=()=>v.toasts,de=()=>v.getActiveToasts(),ue=Object.assign(le,{success:v.success,info:v.info,warning:v.warning,error:v.error,custom:v.custom,message:v.message,promise:v.promise,dismiss:v.dismiss,loading:v.loading},{getHistory:ce,getToasts:de});function wt(n,{insertAt:e}={}){if(!n||typeof document=="undefined")return;let t=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",e==="top"&&t.firstChild?t.insertBefore(a,t.firstChild):t.appendChild(a),a.styleSheet?a.styleSheet.cssText=n:a.appendChild(document.createTextNode(n))}wt(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
2
+ `);function tt(n){return n.label!==void 0}var pe=3,me="32px",ge="16px",Wt=4e3,he=356,be=14,ye=20,we=200;function I(...n){return n.filter(Boolean).join(" ")}function xe(n){let[e,t]=n.split("-"),a=[];return e&&a.push(e),t&&a.push(t),a}var ve=n=>{var Dt,Pt,Nt,Bt,Ct,kt,It,Mt,Ht,At,Lt;let{invert:e,toast:t,unstyled:a,interacting:u,setHeights:f,visibleToasts:w,heights:S,index:g,toasts:i,expanded:D,removeToast:T,defaultRichColors:F,closeButton:et,style:ut,cancelButtonStyle:ft,actionButtonStyle:l,className:ot="",descriptionClassName:at="",duration:K,position:st,gap:pt,loadingIcon:rt,expandByDefault:B,classNames:s,icons:P,closeButtonAriaLabel:nt="Close toast",pauseWhenPageIsHidden:it}=n,[j,M]=o.useState(null),[lt,X]=o.useState(null),[W,H]=o.useState(!1),[A,mt]=o.useState(!1),[L,Y]=o.useState(!1),[ct,d]=o.useState(!1),[h,y]=o.useState(!1),[R,z]=o.useState(0),[p,_]=o.useState(0),O=o.useRef(t.duration||K||Wt),J=o.useRef(null),C=o.useRef(null),Vt=g===0,Ut=g+1<=w,N=t.type,V=t.dismissible!==!1,Kt=t.className||"",Xt=t.descriptionClassName||"",dt=o.useMemo(()=>S.findIndex(r=>r.toastId===t.id)||0,[S,t.id]),Jt=o.useMemo(()=>{var r;return(r=t.closeButton)!=null?r:et},[t.closeButton,et]),Tt=o.useMemo(()=>t.duration||K||Wt,[t.duration,K]),gt=o.useRef(0),U=o.useRef(0),St=o.useRef(0),G=o.useRef(null),[Gt,Qt]=st.split("-"),Rt=o.useMemo(()=>S.reduce((r,m,c)=>c>=dt?r:r+m.height,0),[S,dt]),Et=Ft(),qt=t.invert||e,ht=N==="loading";U.current=o.useMemo(()=>dt*pt+Rt,[dt,Rt]),o.useEffect(()=>{O.current=Tt},[Tt]),o.useEffect(()=>{H(!0)},[]),o.useEffect(()=>{let r=C.current;if(r){let m=r.getBoundingClientRect().height;return _(m),f(c=>[{toastId:t.id,height:m,position:t.position},...c]),()=>f(c=>c.filter(b=>b.toastId!==t.id))}},[f,t.id]),o.useLayoutEffect(()=>{if(!W)return;let r=C.current,m=r.style.height;r.style.height="auto";let c=r.getBoundingClientRect().height;r.style.height=m,_(c),f(b=>b.find(x=>x.toastId===t.id)?b.map(x=>x.toastId===t.id?{...x,height:c}:x):[{toastId:t.id,height:c,position:t.position},...b])},[W,t.title,t.description,f,t.id]);let $=o.useCallback(()=>{mt(!0),z(U.current),f(r=>r.filter(m=>m.toastId!==t.id)),setTimeout(()=>{T(t)},we)},[t,T,f,U]);o.useEffect(()=>{if(t.promise&&N==="loading"||t.duration===1/0||t.type==="loading")return;let r;return D||u||it&&Et?(()=>{if(St.current<gt.current){let b=new Date().getTime()-gt.current;O.current=O.current-b}St.current=new Date().getTime()})():(()=>{O.current!==1/0&&(gt.current=new Date().getTime(),r=setTimeout(()=>{var b;(b=t.onAutoClose)==null||b.call(t,t),$()},O.current))})(),()=>clearTimeout(r)},[D,u,t,N,it,Et,$]),o.useEffect(()=>{t.delete&&$()},[$,t.delete]);function Zt(){var r,m,c;return P!=null&&P.loading?o.createElement("div",{className:I(s==null?void 0:s.loader,(r=t==null?void 0:t.classNames)==null?void 0:r.loader,"sonner-loader"),"data-visible":N==="loading"},P.loading):rt?o.createElement("div",{className:I(s==null?void 0:s.loader,(m=t==null?void 0:t.classNames)==null?void 0:m.loader,"sonner-loader"),"data-visible":N==="loading"},rt):o.createElement(Yt,{className:I(s==null?void 0:s.loader,(c=t==null?void 0:t.classNames)==null?void 0:c.loader),visible:N==="loading"})}return o.createElement("li",{tabIndex:0,ref:C,className:I(ot,Kt,s==null?void 0:s.toast,(Dt=t==null?void 0:t.classNames)==null?void 0:Dt.toast,s==null?void 0:s.default,s==null?void 0:s[N],(Pt=t==null?void 0:t.classNames)==null?void 0:Pt[N]),"data-sonner-toast":"","data-rich-colors":(Nt=t.richColors)!=null?Nt:F,"data-styled":!(t.jsx||t.unstyled||a),"data-mounted":W,"data-promise":!!t.promise,"data-swiped":h,"data-removed":A,"data-visible":Ut,"data-y-position":Gt,"data-x-position":Qt,"data-index":g,"data-front":Vt,"data-swiping":L,"data-dismissible":V,"data-type":N,"data-invert":qt,"data-swipe-out":ct,"data-swipe-direction":lt,"data-expanded":!!(D||B&&W),style:{"--index":g,"--toasts-before":g,"--z-index":i.length-g,"--offset":`${A?R:U.current}px`,"--initial-height":B?"auto":`${p}px`,...ut,...t.style},onPointerDown:r=>{ht||!V||(J.current=new Date,z(U.current),r.target.setPointerCapture(r.pointerId),r.target.tagName!=="BUTTON"&&(Y(!0),G.current={x:r.clientX,y:r.clientY}))},onPointerUp:()=>{var x,Q,q,Z;if(ct||!V)return;G.current=null;let r=Number(((x=C.current)==null?void 0:x.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),m=Number(((Q=C.current)==null?void 0:Q.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),c=new Date().getTime()-((q=J.current)==null?void 0:q.getTime()),b=j==="x"?r:m,k=Math.abs(b)/c;if(Math.abs(b)>=ye||k>.11){z(U.current),(Z=t.onDismiss)==null||Z.call(t,t),X(j==="x"?r>0?"right":"left":m>0?"down":"up"),$(),d(!0),y(!1);return}Y(!1),M(null)},onPointerMove:r=>{var Q,q,Z,zt;if(!G.current||!V||((Q=window.getSelection())==null?void 0:Q.toString().length)>0)return;let c=r.clientY-G.current.y,b=r.clientX-G.current.x,k=(q=n.swipeDirections)!=null?q:xe(st);!j&&(Math.abs(b)>1||Math.abs(c)>1)&&M(Math.abs(b)>Math.abs(c)?"x":"y");let x={x:0,y:0};j==="y"?(k.includes("top")||k.includes("bottom"))&&(k.includes("top")&&c<0||k.includes("bottom")&&c>0)&&(x.y=c):j==="x"&&(k.includes("left")||k.includes("right"))&&(k.includes("left")&&b<0||k.includes("right")&&b>0)&&(x.x=b),(Math.abs(x.x)>0||Math.abs(x.y)>0)&&y(!0),(Z=C.current)==null||Z.style.setProperty("--swipe-amount-x",`${x.x}px`),(zt=C.current)==null||zt.style.setProperty("--swipe-amount-y",`${x.y}px`)}},Jt&&!t.jsx?o.createElement("button",{"aria-label":nt,"data-disabled":ht,"data-close-button":!0,onClick:ht||!V?()=>{}:()=>{var r;$(),(r=t.onDismiss)==null||r.call(t,t)},className:I(s==null?void 0:s.closeButton,(Bt=t==null?void 0:t.classNames)==null?void 0:Bt.closeButton)},(Ct=P==null?void 0:P.close)!=null?Ct:Ot):null,t.jsx||xt(t.title)?t.jsx?t.jsx:typeof t.title=="function"?t.title():t.title:o.createElement(o.Fragment,null,N||t.icon||t.promise?o.createElement("div",{"data-icon":"",className:I(s==null?void 0:s.icon,(kt=t==null?void 0:t.classNames)==null?void 0:kt.icon)},t.promise||t.type==="loading"&&!t.icon?t.icon||Zt():null,t.type!=="loading"?t.icon||(P==null?void 0:P[N])||jt(N):null):null,o.createElement("div",{"data-content":"",className:I(s==null?void 0:s.content,(It=t==null?void 0:t.classNames)==null?void 0:It.content)},o.createElement("div",{"data-title":"",className:I(s==null?void 0:s.title,(Mt=t==null?void 0:t.classNames)==null?void 0:Mt.title)},typeof t.title=="function"?t.title():t.title),t.description?o.createElement("div",{"data-description":"",className:I(at,Xt,s==null?void 0:s.description,(Ht=t==null?void 0:t.classNames)==null?void 0:Ht.description)},typeof t.description=="function"?t.description():t.description):null),xt(t.cancel)?t.cancel:t.cancel&&tt(t.cancel)?o.createElement("button",{"data-button":!0,"data-cancel":!0,style:t.cancelButtonStyle||ft,onClick:r=>{var m,c;tt(t.cancel)&&V&&((c=(m=t.cancel).onClick)==null||c.call(m,r),$())},className:I(s==null?void 0:s.cancelButton,(At=t==null?void 0:t.classNames)==null?void 0:At.cancelButton)},t.cancel.label):null,xt(t.action)?t.action:t.action&&tt(t.action)?o.createElement("button",{"data-button":!0,"data-action":!0,style:t.actionButtonStyle||l,onClick:r=>{var m,c;tt(t.action)&&((c=(m=t.action).onClick)==null||c.call(m,r),!r.defaultPrevented&&$())},className:I(s==null?void 0:s.actionButton,(Lt=t==null?void 0:t.classNames)==null?void 0:Lt.actionButton)},t.action.label):null))};function _t(){if(typeof window=="undefined"||typeof document=="undefined")return"ltr";let n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function Te(n,e){let t={};return[n,e].forEach((a,u)=>{let f=u===1,w=f?"--mobile-offset":"--offset",S=f?ge:me;function g(i){["top","right","bottom","left"].forEach(D=>{t[`${w}-${D}`]=typeof i=="number"?`${i}px`:i})}typeof a=="number"||typeof a=="string"?g(a):typeof a=="object"?["top","right","bottom","left"].forEach(i=>{a[i]===void 0?t[`${w}-${i}`]=S:t[`${w}-${i}`]=typeof a[i]=="number"?`${a[i]}px`:a[i]}):g(S)}),t}function Oe(){let[n,e]=o.useState([]);return o.useEffect(()=>v.subscribe(t=>{if(t.dismiss){setTimeout(()=>{vt.flushSync(()=>{e(a=>a.filter(u=>u.id!==t.id))})});return}setTimeout(()=>{vt.flushSync(()=>{e(a=>{let u=a.findIndex(f=>f.id===t.id);return u!==-1?[...a.slice(0,u),{...a[u],...t},...a.slice(u+1)]:[t,...a]})})})}),[]),{toasts:n}}var $e=fe(function(e,t){let{invert:a,position:u="bottom-right",hotkey:f=["altKey","KeyT"],expand:w,closeButton:S,className:g,offset:i,mobileOffset:D,theme:T="light",richColors:F,duration:et,style:ut,visibleToasts:ft=pe,toastOptions:l,dir:ot=_t(),gap:at=be,loadingIcon:K,icons:st,containerAriaLabel:pt="Notifications",pauseWhenPageIsHidden:rt}=e,[B,s]=o.useState([]),P=o.useMemo(()=>Array.from(new Set([u].concat(B.filter(d=>d.position).map(d=>d.position)))),[B,u]),[nt,it]=o.useState([]),[j,M]=o.useState(!1),[lt,X]=o.useState(!1),[W,H]=o.useState(T!=="system"?T:typeof window!="undefined"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),A=o.useRef(null),mt=f.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=o.useRef(null),Y=o.useRef(!1),ct=o.useCallback(d=>{s(h=>{var y;return(y=h.find(R=>R.id===d.id))!=null&&y.delete||v.dismiss(d.id),h.filter(({id:R})=>R!==d.id)})},[]);return o.useEffect(()=>v.subscribe(d=>{if(d.dismiss){s(h=>h.map(y=>y.id===d.id?{...y,delete:!0}:y));return}setTimeout(()=>{vt.flushSync(()=>{s(h=>{let y=h.findIndex(R=>R.id===d.id);return y!==-1?[...h.slice(0,y),{...h[y],...d},...h.slice(y+1)]:[d,...h]})})})}),[]),o.useEffect(()=>{if(T!=="system"){H(T);return}if(T==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window=="undefined")return;let d=window.matchMedia("(prefers-color-scheme: dark)");try{d.addEventListener("change",({matches:h})=>{H(h?"dark":"light")})}catch(h){d.addListener(({matches:y})=>{try{H(y?"dark":"light")}catch(R){console.error(R)}})}},[T]),o.useEffect(()=>{B.length<=1&&M(!1)},[B]),o.useEffect(()=>{let d=h=>{var R,z;f.every(p=>h[p]||h.code===p)&&(M(!0),(R=A.current)==null||R.focus()),h.code==="Escape"&&(document.activeElement===A.current||(z=A.current)!=null&&z.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[f]),o.useEffect(()=>{if(A.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,Y.current=!1)}},[A.current]),o.createElement("section",{ref:t,"aria-label":`${pt} ${mt}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},P.map((d,h)=>{var z;let[y,R]=d.split("-");return B.length?o.createElement("ol",{key:d,dir:ot==="auto"?_t():ot,tabIndex:-1,ref:A,className:g,"data-sonner-toaster":!0,"data-theme":W,"data-y-position":y,"data-lifted":j&&B.length>1&&!w,"data-x-position":R,style:{"--front-toast-height":`${((z=nt[0])==null?void 0:z.height)||0}px`,"--width":`${he}px`,"--gap":`${at}px`,...ut,...Te(i,D)},onBlur:p=>{Y.current&&!p.currentTarget.contains(p.relatedTarget)&&(Y.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:p=>{p.target instanceof HTMLElement&&p.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,L.current=p.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{lt||M(!1)},onPointerDown:p=>{p.target instanceof HTMLElement&&p.target.dataset.dismissible==="false"||X(!0)},onPointerUp:()=>X(!1)},B.filter(p=>!p.position&&h===0||p.position===d).map((p,_)=>{var O,J;return o.createElement(ve,{key:p.id,icons:st,index:_,toast:p,defaultRichColors:F,duration:(O=l==null?void 0:l.duration)!=null?O:et,className:l==null?void 0:l.className,descriptionClassName:l==null?void 0:l.descriptionClassName,invert:a,visibleToasts:ft,closeButton:(J=l==null?void 0:l.closeButton)!=null?J:S,interacting:lt,position:d,style:l==null?void 0:l.style,unstyled:l==null?void 0:l.unstyled,classNames:l==null?void 0:l.classNames,cancelButtonStyle:l==null?void 0:l.cancelButtonStyle,actionButtonStyle:l==null?void 0:l.actionButtonStyle,removeToast:ct,toasts:B.filter(C=>C.position==p.position),heights:nt.filter(C=>C.position==p.position),setHeights:it,expandByDefault:w,gap:at,loadingIcon:K,expanded:j,pauseWhenPageIsHidden:rt,swipeDirections:e.swipeDirections})})):null}))});export{$e as Toaster,ue as toast,Oe as useSonner};
3
3
  //# sourceMappingURL=index.mjs.map