@lssm/lib.ui-kit-web 0.0.0-canary-20251120192244 → 0.0.0-canary-20251206181705
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/README.md +21 -0
- package/dist/node_modules/sonner/dist/index.js +467 -751
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/accordion.d.ts +6 -7
- package/dist/ui/accordion.js +4 -6
- package/dist/ui/alert-dialog.d.ts +13 -14
- package/dist/ui/alert-dialog.js +9 -11
- package/dist/ui/alert.d.ts +7 -8
- package/dist/ui/alert.js +4 -5
- package/dist/ui/aspect-ratio.d.ts +3 -4
- package/dist/ui/aspect-ratio.js +1 -3
- package/dist/ui/atoms/FilterSelect/FilterSelect.d.ts +1 -2
- package/dist/ui/atoms/FilterSelect/FilterSelect.js +1 -2
- package/dist/ui/atoms/FilterSelect/types.d.ts +1 -2
- package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.d.ts +1 -2
- package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.js +1 -2
- package/dist/ui/atoms/Pagination/Pagination.d.ts +1 -2
- package/dist/ui/atoms/Pagination/Pagination.js +1 -2
- package/dist/ui/atoms/Pagination/types.d.ts +1 -2
- package/dist/ui/atoms/SearchInput/SearchInput.d.ts +1 -2
- package/dist/ui/atoms/SearchInput/SearchInput.js +1 -2
- package/dist/ui/atoms/SearchInput/types.d.ts +1 -2
- package/dist/ui/avatar.d.ts +5 -6
- package/dist/ui/avatar.js +4 -6
- package/dist/ui/badge.d.ts +5 -6
- package/dist/ui/badge.js +2 -3
- package/dist/ui/breadcrumb.d.ts +9 -10
- package/dist/ui/breadcrumb.js +7 -8
- package/dist/ui/button.d.ts +6 -7
- package/dist/ui/button.js +2 -3
- package/dist/ui/calendar.d.ts +4 -5
- package/dist/ui/calendar.js +6 -8
- package/dist/ui/card.d.ts +9 -10
- package/dist/ui/card.js +8 -9
- package/dist/ui/carousel.d.ts +7 -8
- package/dist/ui/carousel.js +6 -8
- package/dist/ui/checkbox.d.ts +3 -4
- package/dist/ui/checkbox.js +4 -6
- package/dist/ui/collapsible.d.ts +5 -6
- package/dist/ui/collapsible.js +1 -3
- package/dist/ui/command.d.ts +11 -12
- package/dist/ui/command.js +9 -11
- package/dist/ui/confirm-dialog.d.ts +3 -4
- package/dist/ui/confirm-dialog.js +1 -2
- package/dist/ui/context-menu.d.ts +3 -4
- package/dist/ui/context-menu.js +10 -12
- package/dist/ui/cta.d.ts +1 -2
- package/dist/ui/cta.js +2 -3
- package/dist/ui/date-picker.d.ts +3 -4
- package/dist/ui/date-picker.js +1 -3
- package/dist/ui/date-range-picker.d.ts +3 -4
- package/dist/ui/date-range-picker.js +1 -3
- package/dist/ui/datetime-picker.d.ts +3 -4
- package/dist/ui/datetime-picker.js +1 -3
- package/dist/ui/dialog.d.ts +12 -13
- package/dist/ui/dialog.js +7 -9
- package/dist/ui/drawer.d.ts +12 -13
- package/dist/ui/drawer.js +7 -9
- package/dist/ui/dropdown-menu.d.ts +17 -18
- package/dist/ui/dropdown-menu.js +10 -12
- package/dist/ui/empty-state.d.ts +5 -6
- package/dist/ui/empty-state.js +1 -2
- package/dist/ui/empty.d.ts +10 -11
- package/dist/ui/empty.js +7 -8
- package/dist/ui/field.d.ts +15 -16
- package/dist/ui/field.js +11 -13
- package/dist/ui/focus-on-route-change.d.ts +1 -2
- package/dist/ui/focus-on-route-change.js +1 -2
- package/dist/ui/form.d.ts +8 -9
- package/dist/ui/form.js +5 -7
- package/dist/ui/hover-card.d.ts +5 -6
- package/dist/ui/hover-card.js +2 -4
- package/dist/ui/input-group.d.ts +11 -12
- package/dist/ui/input-group.js +7 -9
- package/dist/ui/input-otp.d.ts +3 -4
- package/dist/ui/input-otp.js +4 -6
- package/dist/ui/input.d.ts +3 -4
- package/dist/ui/input.js +2 -3
- package/dist/ui/label.d.ts +3 -4
- package/dist/ui/label.js +2 -4
- package/dist/ui/link.d.ts +4 -5
- package/dist/ui/link.js +2 -3
- package/dist/ui/live-region.d.ts +3 -4
- package/dist/ui/live-region.js +1 -3
- package/dist/ui/loading-button.d.ts +3 -4
- package/dist/ui/loading-button.js +2 -3
- package/dist/ui/map/MapBase.d.ts +3 -4
- package/dist/ui/map/MapBase.js +1 -3
- package/dist/ui/map/MapGeoJsonOverlay.d.ts +3 -4
- package/dist/ui/map/MapGeoJsonOverlay.js +1 -3
- package/dist/ui/map/MapHeatmapH3.d.ts +3 -4
- package/dist/ui/map/MapHeatmapH3.js +1 -3
- package/dist/ui/map/MapMarkers.d.ts +3 -4
- package/dist/ui/map/MapMarkers.js +1 -3
- package/dist/ui/marketing/FeatureGrid.d.ts +3 -4
- package/dist/ui/marketing/FeatureGrid.js +1 -2
- package/dist/ui/marketing/Hero.d.ts +3 -4
- package/dist/ui/marketing/Hero.js +1 -2
- package/dist/ui/marketing/PricingTable.d.ts +3 -4
- package/dist/ui/marketing/PricingTable.js +1 -2
- package/dist/ui/menubar.d.ts +18 -19
- package/dist/ui/menubar.js +12 -14
- package/dist/ui/molecules/Autocomplete/index.d.ts +3 -4
- package/dist/ui/molecules/Autocomplete/index.js +1 -3
- package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.d.ts +1 -2
- package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.js +1 -2
- package/dist/ui/molecules/SearchAndFilter/types.d.ts +1 -2
- package/dist/ui/molecules/SkeletonList.d.ts +3 -4
- package/dist/ui/molecules/SkeletonList.js +1 -2
- package/dist/ui/nav-layout.d.ts +8 -9
- package/dist/ui/nav-layout.js +2 -3
- package/dist/ui/navigation-menu.d.ts +12 -13
- package/dist/ui/navigation-menu.js +9 -10
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.d.ts +1 -2
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.js +1 -3
- package/dist/ui/organisms/ListPage/ListPage.d.ts +3 -4
- package/dist/ui/organisms/ListPage/ListPage.js +1 -2
- package/dist/ui/organisms/ListPage/types.d.ts +1 -2
- package/dist/ui/page-header.d.ts +5 -6
- package/dist/ui/page-header.js +1 -2
- package/dist/ui/pagination.d.ts +7 -8
- package/dist/ui/pagination.js +8 -9
- package/dist/ui/popover.d.ts +6 -7
- package/dist/ui/popover.js +2 -4
- package/dist/ui/progress.d.ts +3 -4
- package/dist/ui/progress.js +2 -4
- package/dist/ui/radio-group.d.ts +4 -5
- package/dist/ui/radio-group.js +3 -5
- package/dist/ui/resizable.d.ts +8 -9
- package/dist/ui/resizable.js +3 -5
- package/dist/ui/route-announcer.d.ts +3 -4
- package/dist/ui/route-announcer.js +1 -3
- package/dist/ui/scroll-area.d.ts +4 -5
- package/dist/ui/scroll-area.js +3 -5
- package/dist/ui/section.d.ts +6 -7
- package/dist/ui/section.js +2 -3
- package/dist/ui/select.d.ts +12 -13
- package/dist/ui/select.js +8 -10
- package/dist/ui/separator.d.ts +3 -4
- package/dist/ui/separator.js +2 -4
- package/dist/ui/sheet.d.ts +10 -11
- package/dist/ui/sheet.js +7 -9
- package/dist/ui/sidebar.d.ts +29 -30
- package/dist/ui/sidebar.js +24 -26
- package/dist/ui/skeleton.d.ts +3 -4
- package/dist/ui/skeleton.js +2 -3
- package/dist/ui/skip-link.d.ts +3 -4
- package/dist/ui/skip-link.js +2 -3
- package/dist/ui/slider.d.ts +3 -4
- package/dist/ui/slider.js +2 -4
- package/dist/ui/sonner.d.ts +3 -4
- package/dist/ui/sonner.js +3 -5
- package/dist/ui/stack.d.ts +14 -15
- package/dist/ui/stack.js +4 -5
- package/dist/ui/stat-card-group.d.ts +3 -4
- package/dist/ui/stat-card-group.js +1 -2
- package/dist/ui/stepper.d.ts +5 -6
- package/dist/ui/stepper.js +1 -2
- package/dist/ui/switch.d.ts +6 -4
- package/dist/ui/switch.js +4 -5
- package/dist/ui/table.d.ts +10 -11
- package/dist/ui/table.js +9 -11
- package/dist/ui/tabs.d.ts +6 -7
- package/dist/ui/tabs.js +5 -7
- package/dist/ui/text.d.ts +3 -4
- package/dist/ui/text.js +2 -3
- package/dist/ui/textarea.d.ts +3 -4
- package/dist/ui/textarea.js +2 -3
- package/dist/ui/time-picker.d.ts +1 -2
- package/dist/ui/time-picker.js +1 -3
- package/dist/ui/toast.d.ts +3 -4
- package/dist/ui/toast.js +7 -9
- package/dist/ui/toaster.d.ts +3 -4
- package/dist/ui/toaster.js +2 -4
- package/dist/ui/toggle-group.d.ts +4 -5
- package/dist/ui/toggle-group.js +3 -5
- package/dist/ui/toggle.d.ts +5 -6
- package/dist/ui/toggle.js +2 -4
- package/dist/ui/tooltip.d.ts +6 -7
- package/dist/ui/tooltip.js +3 -5
- package/dist/ui/typography.d.ts +13 -14
- package/dist/ui/typography.js +12 -13
- package/dist/ui/use-media-query.d.ts +1 -2
- package/dist/ui/use-media-query.js +1 -2
- package/dist/ui/use-mobile.d.ts +1 -2
- package/dist/ui/use-mobile.js +1 -2
- package/dist/ui/use-reduced-motion.d.ts +1 -2
- package/dist/ui/use-reduced-motion.js +1 -2
- package/dist/ui/use-toast.d.ts +1 -2
- package/dist/ui/use-toast.js +1 -3
- package/dist/ui/useListState.d.ts +1 -2
- package/dist/ui/useListState.js +1 -2
- package/dist/ui/usecases/UseCaseCard.d.ts +3 -4
- package/dist/ui/usecases/UseCaseCard.js +1 -2
- package/dist/ui/usecases/UserStoryCard.d.ts +3 -4
- package/dist/ui/usecases/UserStoryCard.js +1 -2
- package/dist/ui/utils.d.ts +1 -2
- package/dist/ui/utils.js +1 -2
- package/dist/ui/visually-hidden.d.ts +1 -2
- package/dist/ui/visually-hidden.js +2 -3
- package/package.json +17 -14
- package/dist/node_modules/sonner/dist/index.js.map +0 -1
- package/dist/ui/accordion.d.ts.map +0 -1
- package/dist/ui/accordion.js.map +0 -1
- package/dist/ui/alert-dialog.d.ts.map +0 -1
- package/dist/ui/alert-dialog.js.map +0 -1
- package/dist/ui/alert.d.ts.map +0 -1
- package/dist/ui/alert.js.map +0 -1
- package/dist/ui/aspect-ratio.d.ts.map +0 -1
- package/dist/ui/aspect-ratio.js.map +0 -1
- package/dist/ui/atoms/FilterSelect/FilterSelect.d.ts.map +0 -1
- package/dist/ui/atoms/FilterSelect/FilterSelect.js.map +0 -1
- package/dist/ui/atoms/FilterSelect/types.d.ts.map +0 -1
- package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.d.ts.map +0 -1
- package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.js.map +0 -1
- package/dist/ui/atoms/Pagination/Pagination.d.ts.map +0 -1
- package/dist/ui/atoms/Pagination/Pagination.js.map +0 -1
- package/dist/ui/atoms/Pagination/types.d.ts.map +0 -1
- package/dist/ui/atoms/SearchInput/SearchInput.d.ts.map +0 -1
- package/dist/ui/atoms/SearchInput/SearchInput.js.map +0 -1
- package/dist/ui/atoms/SearchInput/types.d.ts.map +0 -1
- package/dist/ui/avatar.d.ts.map +0 -1
- package/dist/ui/avatar.js.map +0 -1
- package/dist/ui/badge.d.ts.map +0 -1
- package/dist/ui/badge.js.map +0 -1
- package/dist/ui/breadcrumb.d.ts.map +0 -1
- package/dist/ui/breadcrumb.js.map +0 -1
- package/dist/ui/button.d.ts.map +0 -1
- package/dist/ui/button.js.map +0 -1
- package/dist/ui/calendar.d.ts.map +0 -1
- package/dist/ui/calendar.js.map +0 -1
- package/dist/ui/card.d.ts.map +0 -1
- package/dist/ui/card.js.map +0 -1
- package/dist/ui/carousel.d.ts.map +0 -1
- package/dist/ui/carousel.js.map +0 -1
- package/dist/ui/checkbox.d.ts.map +0 -1
- package/dist/ui/checkbox.js.map +0 -1
- package/dist/ui/collapsible.d.ts.map +0 -1
- package/dist/ui/collapsible.js.map +0 -1
- package/dist/ui/command.d.ts.map +0 -1
- package/dist/ui/command.js.map +0 -1
- package/dist/ui/confirm-dialog.d.ts.map +0 -1
- package/dist/ui/confirm-dialog.js.map +0 -1
- package/dist/ui/context-menu.d.ts.map +0 -1
- package/dist/ui/context-menu.js.map +0 -1
- package/dist/ui/cta.d.ts.map +0 -1
- package/dist/ui/cta.js.map +0 -1
- package/dist/ui/date-picker.d.ts.map +0 -1
- package/dist/ui/date-picker.js.map +0 -1
- package/dist/ui/date-range-picker.d.ts.map +0 -1
- package/dist/ui/date-range-picker.js.map +0 -1
- package/dist/ui/datetime-picker.d.ts.map +0 -1
- package/dist/ui/datetime-picker.js.map +0 -1
- package/dist/ui/dialog.d.ts.map +0 -1
- package/dist/ui/dialog.js.map +0 -1
- package/dist/ui/drawer.d.ts.map +0 -1
- package/dist/ui/drawer.js.map +0 -1
- package/dist/ui/dropdown-menu.d.ts.map +0 -1
- package/dist/ui/dropdown-menu.js.map +0 -1
- package/dist/ui/empty-state.d.ts.map +0 -1
- package/dist/ui/empty-state.js.map +0 -1
- package/dist/ui/empty.d.ts.map +0 -1
- package/dist/ui/empty.js.map +0 -1
- package/dist/ui/field.d.ts.map +0 -1
- package/dist/ui/field.js.map +0 -1
- package/dist/ui/focus-on-route-change.d.ts.map +0 -1
- package/dist/ui/focus-on-route-change.js.map +0 -1
- package/dist/ui/form.d.ts.map +0 -1
- package/dist/ui/form.js.map +0 -1
- package/dist/ui/hover-card.d.ts.map +0 -1
- package/dist/ui/hover-card.js.map +0 -1
- package/dist/ui/input-group.d.ts.map +0 -1
- package/dist/ui/input-group.js.map +0 -1
- package/dist/ui/input-otp.d.ts.map +0 -1
- package/dist/ui/input-otp.js.map +0 -1
- package/dist/ui/input.d.ts.map +0 -1
- package/dist/ui/input.js.map +0 -1
- package/dist/ui/label.d.ts.map +0 -1
- package/dist/ui/label.js.map +0 -1
- package/dist/ui/link.d.ts.map +0 -1
- package/dist/ui/link.js.map +0 -1
- package/dist/ui/live-region.d.ts.map +0 -1
- package/dist/ui/live-region.js.map +0 -1
- package/dist/ui/loading-button.d.ts.map +0 -1
- package/dist/ui/loading-button.js.map +0 -1
- package/dist/ui/map/MapBase.d.ts.map +0 -1
- package/dist/ui/map/MapBase.js.map +0 -1
- package/dist/ui/map/MapGeoJsonOverlay.d.ts.map +0 -1
- package/dist/ui/map/MapGeoJsonOverlay.js.map +0 -1
- package/dist/ui/map/MapHeatmapH3.d.ts.map +0 -1
- package/dist/ui/map/MapHeatmapH3.js.map +0 -1
- package/dist/ui/map/MapMarkers.d.ts.map +0 -1
- package/dist/ui/map/MapMarkers.js.map +0 -1
- package/dist/ui/marketing/FeatureGrid.d.ts.map +0 -1
- package/dist/ui/marketing/FeatureGrid.js.map +0 -1
- package/dist/ui/marketing/Hero.d.ts.map +0 -1
- package/dist/ui/marketing/Hero.js.map +0 -1
- package/dist/ui/marketing/PricingTable.d.ts.map +0 -1
- package/dist/ui/marketing/PricingTable.js.map +0 -1
- package/dist/ui/menubar.d.ts.map +0 -1
- package/dist/ui/menubar.js.map +0 -1
- package/dist/ui/molecules/Autocomplete/index.d.ts.map +0 -1
- package/dist/ui/molecules/Autocomplete/index.js.map +0 -1
- package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.d.ts.map +0 -1
- package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.js.map +0 -1
- package/dist/ui/molecules/SearchAndFilter/types.d.ts.map +0 -1
- package/dist/ui/molecules/SkeletonList.d.ts.map +0 -1
- package/dist/ui/molecules/SkeletonList.js.map +0 -1
- package/dist/ui/nav-layout.d.ts.map +0 -1
- package/dist/ui/nav-layout.js.map +0 -1
- package/dist/ui/navigation-menu.d.ts.map +0 -1
- package/dist/ui/navigation-menu.js.map +0 -1
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.d.ts.map +0 -1
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.js.map +0 -1
- package/dist/ui/organisms/ListPage/ListPage.d.ts.map +0 -1
- package/dist/ui/organisms/ListPage/ListPage.js.map +0 -1
- package/dist/ui/organisms/ListPage/types.d.ts.map +0 -1
- package/dist/ui/page-header.d.ts.map +0 -1
- package/dist/ui/page-header.js.map +0 -1
- package/dist/ui/pagination.d.ts.map +0 -1
- package/dist/ui/pagination.js.map +0 -1
- package/dist/ui/popover.d.ts.map +0 -1
- package/dist/ui/popover.js.map +0 -1
- package/dist/ui/progress.d.ts.map +0 -1
- package/dist/ui/progress.js.map +0 -1
- package/dist/ui/radio-group.d.ts.map +0 -1
- package/dist/ui/radio-group.js.map +0 -1
- package/dist/ui/resizable.d.ts.map +0 -1
- package/dist/ui/resizable.js.map +0 -1
- package/dist/ui/route-announcer.d.ts.map +0 -1
- package/dist/ui/route-announcer.js.map +0 -1
- package/dist/ui/scroll-area.d.ts.map +0 -1
- package/dist/ui/scroll-area.js.map +0 -1
- package/dist/ui/section.d.ts.map +0 -1
- package/dist/ui/section.js.map +0 -1
- package/dist/ui/select.d.ts.map +0 -1
- package/dist/ui/select.js.map +0 -1
- package/dist/ui/separator.d.ts.map +0 -1
- package/dist/ui/separator.js.map +0 -1
- package/dist/ui/sheet.d.ts.map +0 -1
- package/dist/ui/sheet.js.map +0 -1
- package/dist/ui/sidebar.d.ts.map +0 -1
- package/dist/ui/sidebar.js.map +0 -1
- package/dist/ui/skeleton.d.ts.map +0 -1
- package/dist/ui/skeleton.js.map +0 -1
- package/dist/ui/skip-link.d.ts.map +0 -1
- package/dist/ui/skip-link.js.map +0 -1
- package/dist/ui/slider.d.ts.map +0 -1
- package/dist/ui/slider.js.map +0 -1
- package/dist/ui/sonner.d.ts.map +0 -1
- package/dist/ui/sonner.js.map +0 -1
- package/dist/ui/stack.d.ts.map +0 -1
- package/dist/ui/stack.js.map +0 -1
- package/dist/ui/stat-card-group.d.ts.map +0 -1
- package/dist/ui/stat-card-group.js.map +0 -1
- package/dist/ui/stepper.d.ts.map +0 -1
- package/dist/ui/stepper.js.map +0 -1
- package/dist/ui/switch.d.ts.map +0 -1
- package/dist/ui/switch.js.map +0 -1
- package/dist/ui/table.d.ts.map +0 -1
- package/dist/ui/table.js.map +0 -1
- package/dist/ui/tabs.d.ts.map +0 -1
- package/dist/ui/tabs.js.map +0 -1
- package/dist/ui/text.d.ts.map +0 -1
- package/dist/ui/text.js.map +0 -1
- package/dist/ui/textarea.d.ts.map +0 -1
- package/dist/ui/textarea.js.map +0 -1
- package/dist/ui/time-picker.d.ts.map +0 -1
- package/dist/ui/time-picker.js.map +0 -1
- package/dist/ui/toast.d.ts.map +0 -1
- package/dist/ui/toast.js.map +0 -1
- package/dist/ui/toaster.d.ts.map +0 -1
- package/dist/ui/toaster.js.map +0 -1
- package/dist/ui/toggle-group.d.ts.map +0 -1
- package/dist/ui/toggle-group.js.map +0 -1
- package/dist/ui/toggle.d.ts.map +0 -1
- package/dist/ui/toggle.js.map +0 -1
- package/dist/ui/tooltip.d.ts.map +0 -1
- package/dist/ui/tooltip.js.map +0 -1
- package/dist/ui/typography.d.ts.map +0 -1
- package/dist/ui/typography.js.map +0 -1
- package/dist/ui/use-media-query.d.ts.map +0 -1
- package/dist/ui/use-media-query.js.map +0 -1
- package/dist/ui/use-mobile.d.ts.map +0 -1
- package/dist/ui/use-mobile.js.map +0 -1
- package/dist/ui/use-reduced-motion.d.ts.map +0 -1
- package/dist/ui/use-reduced-motion.js.map +0 -1
- package/dist/ui/use-toast.d.ts.map +0 -1
- package/dist/ui/use-toast.js.map +0 -1
- package/dist/ui/useListState.d.ts.map +0 -1
- package/dist/ui/useListState.js.map +0 -1
- package/dist/ui/usecases/UseCaseCard.d.ts.map +0 -1
- package/dist/ui/usecases/UseCaseCard.js.map +0 -1
- package/dist/ui/usecases/UserStoryCard.d.ts.map +0 -1
- package/dist/ui/usecases/UserStoryCard.js.map +0 -1
- package/dist/ui/utils.d.ts.map +0 -1
- package/dist/ui/utils.js.map +0 -1
- package/dist/ui/visually-hidden.d.ts.map +0 -1
- package/dist/ui/visually-hidden.js.map +0 -1
|
@@ -1,82 +1,64 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import ReactDOM from "react-dom";
|
|
3
|
+
import React, { forwardRef, isValidElement } from "react";
|
|
4
|
+
import vt from "react-dom";
|
|
6
5
|
|
|
7
6
|
//#region ../../../node_modules/sonner/dist/index.mjs
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
style.styleSheet ? style.styleSheet.cssText = code : style.appendChild(document.createTextNode(code));
|
|
15
|
-
}
|
|
16
|
-
const getAsset = (type) => {
|
|
17
|
-
switch (type) {
|
|
18
|
-
case "success": return SuccessIcon;
|
|
19
|
-
case "info": return InfoIcon;
|
|
20
|
-
case "warning": return WarningIcon;
|
|
21
|
-
case "error": return ErrorIcon;
|
|
7
|
+
var jt = (n) => {
|
|
8
|
+
switch (n) {
|
|
9
|
+
case "success": return ee;
|
|
10
|
+
case "info": return ae;
|
|
11
|
+
case "warning": return oe;
|
|
12
|
+
case "error": return se;
|
|
22
13
|
default: return null;
|
|
23
14
|
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
className: "sonner-loading-bar",
|
|
32
|
-
key: `spinner-bar-${i}`
|
|
33
|
-
}))));
|
|
34
|
-
};
|
|
35
|
-
const SuccessIcon = /* @__PURE__ */ React.createElement("svg", {
|
|
15
|
+
}, te = Array(12).fill(0), Yt = ({ visible: n, className: e }) => React.createElement("div", {
|
|
16
|
+
className: ["sonner-loading-wrapper", e].filter(Boolean).join(" "),
|
|
17
|
+
"data-visible": n
|
|
18
|
+
}, React.createElement("div", { className: "sonner-spinner" }, te.map((t, a) => React.createElement("div", {
|
|
19
|
+
className: "sonner-loading-bar",
|
|
20
|
+
key: `spinner-bar-${a}`
|
|
21
|
+
})))), ee = React.createElement("svg", {
|
|
36
22
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37
23
|
viewBox: "0 0 20 20",
|
|
38
24
|
fill: "currentColor",
|
|
39
25
|
height: "20",
|
|
40
26
|
width: "20"
|
|
41
|
-
},
|
|
27
|
+
}, React.createElement("path", {
|
|
42
28
|
fillRule: "evenodd",
|
|
43
29
|
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",
|
|
44
30
|
clipRule: "evenodd"
|
|
45
|
-
}))
|
|
46
|
-
const WarningIcon = /* @__PURE__ */ React.createElement("svg", {
|
|
31
|
+
})), oe = React.createElement("svg", {
|
|
47
32
|
xmlns: "http://www.w3.org/2000/svg",
|
|
48
33
|
viewBox: "0 0 24 24",
|
|
49
34
|
fill: "currentColor",
|
|
50
35
|
height: "20",
|
|
51
36
|
width: "20"
|
|
52
|
-
},
|
|
37
|
+
}, React.createElement("path", {
|
|
53
38
|
fillRule: "evenodd",
|
|
54
39
|
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",
|
|
55
40
|
clipRule: "evenodd"
|
|
56
|
-
}))
|
|
57
|
-
const InfoIcon = /* @__PURE__ */ React.createElement("svg", {
|
|
41
|
+
})), ae = React.createElement("svg", {
|
|
58
42
|
xmlns: "http://www.w3.org/2000/svg",
|
|
59
43
|
viewBox: "0 0 20 20",
|
|
60
44
|
fill: "currentColor",
|
|
61
45
|
height: "20",
|
|
62
46
|
width: "20"
|
|
63
|
-
},
|
|
47
|
+
}, React.createElement("path", {
|
|
64
48
|
fillRule: "evenodd",
|
|
65
49
|
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",
|
|
66
50
|
clipRule: "evenodd"
|
|
67
|
-
}))
|
|
68
|
-
const ErrorIcon = /* @__PURE__ */ React.createElement("svg", {
|
|
51
|
+
})), se = React.createElement("svg", {
|
|
69
52
|
xmlns: "http://www.w3.org/2000/svg",
|
|
70
53
|
viewBox: "0 0 20 20",
|
|
71
54
|
fill: "currentColor",
|
|
72
55
|
height: "20",
|
|
73
56
|
width: "20"
|
|
74
|
-
},
|
|
57
|
+
}, React.createElement("path", {
|
|
75
58
|
fillRule: "evenodd",
|
|
76
59
|
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",
|
|
77
60
|
clipRule: "evenodd"
|
|
78
|
-
}))
|
|
79
|
-
const CloseIcon = /* @__PURE__ */ React.createElement("svg", {
|
|
61
|
+
})), Ot = React.createElement("svg", {
|
|
80
62
|
xmlns: "http://www.w3.org/2000/svg",
|
|
81
63
|
width: "12",
|
|
82
64
|
height: "12",
|
|
@@ -86,827 +68,561 @@ const CloseIcon = /* @__PURE__ */ React.createElement("svg", {
|
|
|
86
68
|
strokeWidth: "1.5",
|
|
87
69
|
strokeLinecap: "round",
|
|
88
70
|
strokeLinejoin: "round"
|
|
89
|
-
},
|
|
71
|
+
}, React.createElement("line", {
|
|
90
72
|
x1: "18",
|
|
91
73
|
y1: "6",
|
|
92
74
|
x2: "6",
|
|
93
75
|
y2: "18"
|
|
94
|
-
}),
|
|
76
|
+
}), React.createElement("line", {
|
|
95
77
|
x1: "6",
|
|
96
78
|
y1: "6",
|
|
97
79
|
x2: "18",
|
|
98
80
|
y2: "18"
|
|
99
81
|
}));
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
React.useEffect(() => {
|
|
103
|
-
|
|
104
|
-
|
|
82
|
+
var Ft = () => {
|
|
83
|
+
let [n, e] = React.useState(document.hidden);
|
|
84
|
+
return React.useEffect(() => {
|
|
85
|
+
let t = () => {
|
|
86
|
+
e(document.hidden);
|
|
105
87
|
};
|
|
106
|
-
document.addEventListener("visibilitychange",
|
|
107
|
-
|
|
108
|
-
}, []);
|
|
109
|
-
return isDocumentHidden;
|
|
88
|
+
return document.addEventListener("visibilitychange", t), () => window.removeEventListener("visibilitychange", t);
|
|
89
|
+
}, []), n;
|
|
110
90
|
};
|
|
111
|
-
|
|
112
|
-
var Observer = class {
|
|
91
|
+
var bt = 1, yt = class {
|
|
113
92
|
constructor() {
|
|
114
|
-
this.subscribe = (
|
|
115
|
-
this.subscribers.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
};
|
|
121
|
-
this.publish = (data) => {
|
|
122
|
-
this.subscribers.forEach((subscriber) => subscriber(data));
|
|
123
|
-
};
|
|
124
|
-
this.addToast = (data) => {
|
|
125
|
-
this.publish(data);
|
|
126
|
-
this.toasts = [...this.toasts, data];
|
|
127
|
-
};
|
|
128
|
-
this.create = (data) => {
|
|
129
|
-
var _data_id;
|
|
130
|
-
const { message,...rest } = data;
|
|
131
|
-
const id = typeof (data == null ? void 0 : data.id) === "number" || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
|
|
132
|
-
const alreadyExists = this.toasts.find((toast$1) => {
|
|
133
|
-
return toast$1.id === id;
|
|
134
|
-
});
|
|
135
|
-
const dismissible = data.dismissible === void 0 ? true : data.dismissible;
|
|
136
|
-
if (this.dismissedToasts.has(id)) this.dismissedToasts.delete(id);
|
|
137
|
-
if (alreadyExists) this.toasts = this.toasts.map((toast$1) => {
|
|
138
|
-
if (toast$1.id === id) {
|
|
139
|
-
this.publish({
|
|
140
|
-
...toast$1,
|
|
141
|
-
...data,
|
|
142
|
-
id,
|
|
143
|
-
title: message
|
|
144
|
-
});
|
|
145
|
-
return {
|
|
146
|
-
...toast$1,
|
|
147
|
-
...data,
|
|
148
|
-
id,
|
|
149
|
-
dismissible,
|
|
150
|
-
title: message
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
return toast$1;
|
|
154
|
-
});
|
|
155
|
-
else this.addToast({
|
|
156
|
-
title: message,
|
|
157
|
-
...rest,
|
|
158
|
-
dismissible,
|
|
159
|
-
id
|
|
160
|
-
});
|
|
161
|
-
return id;
|
|
162
|
-
};
|
|
163
|
-
this.dismiss = (id) => {
|
|
164
|
-
if (id) {
|
|
165
|
-
this.dismissedToasts.add(id);
|
|
166
|
-
requestAnimationFrame(() => this.subscribers.forEach((subscriber) => subscriber({
|
|
167
|
-
id,
|
|
168
|
-
dismiss: true
|
|
169
|
-
})));
|
|
170
|
-
} else this.toasts.forEach((toast$1) => {
|
|
171
|
-
this.subscribers.forEach((subscriber) => subscriber({
|
|
172
|
-
id: toast$1.id,
|
|
173
|
-
dismiss: true
|
|
174
|
-
}));
|
|
175
|
-
});
|
|
176
|
-
return id;
|
|
177
|
-
};
|
|
178
|
-
this.message = (message, data) => {
|
|
179
|
-
return this.create({
|
|
180
|
-
...data,
|
|
181
|
-
message
|
|
182
|
-
});
|
|
183
|
-
};
|
|
184
|
-
this.error = (message, data) => {
|
|
185
|
-
return this.create({
|
|
186
|
-
...data,
|
|
187
|
-
message,
|
|
188
|
-
type: "error"
|
|
189
|
-
});
|
|
190
|
-
};
|
|
191
|
-
this.success = (message, data) => {
|
|
192
|
-
return this.create({
|
|
193
|
-
...data,
|
|
194
|
-
type: "success",
|
|
195
|
-
message
|
|
196
|
-
});
|
|
197
|
-
};
|
|
198
|
-
this.info = (message, data) => {
|
|
199
|
-
return this.create({
|
|
200
|
-
...data,
|
|
201
|
-
type: "info",
|
|
202
|
-
message
|
|
203
|
-
});
|
|
93
|
+
this.subscribe = (e) => (this.subscribers.push(e), () => {
|
|
94
|
+
let t = this.subscribers.indexOf(e);
|
|
95
|
+
this.subscribers.splice(t, 1);
|
|
96
|
+
});
|
|
97
|
+
this.publish = (e) => {
|
|
98
|
+
this.subscribers.forEach((t) => t(e));
|
|
204
99
|
};
|
|
205
|
-
this.
|
|
206
|
-
|
|
207
|
-
...data,
|
|
208
|
-
type: "warning",
|
|
209
|
-
message
|
|
210
|
-
});
|
|
100
|
+
this.addToast = (e) => {
|
|
101
|
+
this.publish(e), this.toasts = [...this.toasts, e];
|
|
211
102
|
};
|
|
212
|
-
this.
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
103
|
+
this.create = (e) => {
|
|
104
|
+
var S;
|
|
105
|
+
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;
|
|
106
|
+
return this.dismissedToasts.has(u) && this.dismissedToasts.delete(u), f ? this.toasts = this.toasts.map((g) => g.id === u ? (this.publish({
|
|
107
|
+
...g,
|
|
108
|
+
...e,
|
|
109
|
+
id: u,
|
|
110
|
+
title: t
|
|
111
|
+
}), {
|
|
112
|
+
...g,
|
|
113
|
+
...e,
|
|
114
|
+
id: u,
|
|
115
|
+
dismissible: w,
|
|
116
|
+
title: t
|
|
117
|
+
}) : g) : this.addToast({
|
|
118
|
+
title: t,
|
|
119
|
+
...a,
|
|
120
|
+
dismissible: w,
|
|
121
|
+
id: u
|
|
122
|
+
}), u;
|
|
218
123
|
};
|
|
219
|
-
this.
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
124
|
+
this.dismiss = (e) => (this.dismissedToasts.add(e), e || this.toasts.forEach((t) => {
|
|
125
|
+
this.subscribers.forEach((a) => a({
|
|
126
|
+
id: t.id,
|
|
127
|
+
dismiss: !0
|
|
128
|
+
}));
|
|
129
|
+
}), this.subscribers.forEach((t) => t({
|
|
130
|
+
id: e,
|
|
131
|
+
dismiss: !0
|
|
132
|
+
})), e);
|
|
133
|
+
this.message = (e, t) => this.create({
|
|
134
|
+
...t,
|
|
135
|
+
message: e
|
|
136
|
+
});
|
|
137
|
+
this.error = (e, t) => this.create({
|
|
138
|
+
...t,
|
|
139
|
+
message: e,
|
|
140
|
+
type: "error"
|
|
141
|
+
});
|
|
142
|
+
this.success = (e, t) => this.create({
|
|
143
|
+
...t,
|
|
144
|
+
type: "success",
|
|
145
|
+
message: e
|
|
146
|
+
});
|
|
147
|
+
this.info = (e, t) => this.create({
|
|
148
|
+
...t,
|
|
149
|
+
type: "info",
|
|
150
|
+
message: e
|
|
151
|
+
});
|
|
152
|
+
this.warning = (e, t) => this.create({
|
|
153
|
+
...t,
|
|
154
|
+
type: "warning",
|
|
155
|
+
message: e
|
|
156
|
+
});
|
|
157
|
+
this.loading = (e, t) => this.create({
|
|
158
|
+
...t,
|
|
159
|
+
type: "loading",
|
|
160
|
+
message: e
|
|
161
|
+
});
|
|
162
|
+
this.promise = (e, t) => {
|
|
163
|
+
if (!t) return;
|
|
164
|
+
let a;
|
|
165
|
+
t.loading !== void 0 && (a = this.create({
|
|
166
|
+
...t,
|
|
167
|
+
promise: e,
|
|
225
168
|
type: "loading",
|
|
226
|
-
message:
|
|
227
|
-
description: typeof
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
type: "default",
|
|
239
|
-
message: response
|
|
240
|
-
});
|
|
241
|
-
} else if (isHttpResponse(response) && !response.ok) {
|
|
242
|
-
shouldDismiss = false;
|
|
243
|
-
const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
|
|
244
|
-
const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
|
|
245
|
-
const toastSettings = typeof promiseData === "object" && !React.isValidElement(promiseData) ? promiseData : { message: promiseData };
|
|
246
|
-
this.create({
|
|
247
|
-
id,
|
|
248
|
-
type: "error",
|
|
249
|
-
description,
|
|
250
|
-
...toastSettings
|
|
251
|
-
});
|
|
252
|
-
} else if (response instanceof Error) {
|
|
253
|
-
shouldDismiss = false;
|
|
254
|
-
const promiseData = typeof data.error === "function" ? await data.error(response) : data.error;
|
|
255
|
-
const description = typeof data.description === "function" ? await data.description(response) : data.description;
|
|
256
|
-
const toastSettings = typeof promiseData === "object" && !React.isValidElement(promiseData) ? promiseData : { message: promiseData };
|
|
169
|
+
message: t.loading,
|
|
170
|
+
description: typeof t.description != "function" ? t.description : void 0
|
|
171
|
+
}));
|
|
172
|
+
let u = e instanceof Promise ? e : e(), f = a !== void 0, w, S = u.then(async (i) => {
|
|
173
|
+
if (w = ["resolve", i], React.isValidElement(i)) f = !1, this.create({
|
|
174
|
+
id: a,
|
|
175
|
+
type: "default",
|
|
176
|
+
message: i
|
|
177
|
+
});
|
|
178
|
+
else if (ie(i) && !i.ok) {
|
|
179
|
+
f = !1;
|
|
180
|
+
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;
|
|
257
181
|
this.create({
|
|
258
|
-
id,
|
|
182
|
+
id: a,
|
|
259
183
|
type: "error",
|
|
260
|
-
|
|
261
|
-
|
|
184
|
+
message: T,
|
|
185
|
+
description: F
|
|
262
186
|
});
|
|
263
|
-
} else if (
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
const description = typeof data.description === "function" ? await data.description(response) : data.description;
|
|
267
|
-
const toastSettings = typeof promiseData === "object" && !React.isValidElement(promiseData) ? promiseData : { message: promiseData };
|
|
187
|
+
} else if (t.success !== void 0) {
|
|
188
|
+
f = !1;
|
|
189
|
+
let T = typeof t.success == "function" ? await t.success(i) : t.success, F = typeof t.description == "function" ? await t.description(i) : t.description;
|
|
268
190
|
this.create({
|
|
269
|
-
id,
|
|
191
|
+
id: a,
|
|
270
192
|
type: "success",
|
|
271
|
-
|
|
272
|
-
|
|
193
|
+
message: T,
|
|
194
|
+
description: F
|
|
273
195
|
});
|
|
274
196
|
}
|
|
275
|
-
}).catch(async (
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
const promiseData = typeof data.error === "function" ? await data.error(error) : data.error;
|
|
280
|
-
const description = typeof data.description === "function" ? await data.description(error) : data.description;
|
|
281
|
-
const toastSettings = typeof promiseData === "object" && !React.isValidElement(promiseData) ? promiseData : { message: promiseData };
|
|
197
|
+
}).catch(async (i) => {
|
|
198
|
+
if (w = ["reject", i], t.error !== void 0) {
|
|
199
|
+
f = !1;
|
|
200
|
+
let D = typeof t.error == "function" ? await t.error(i) : t.error, T = typeof t.description == "function" ? await t.description(i) : t.description;
|
|
282
201
|
this.create({
|
|
283
|
-
id,
|
|
202
|
+
id: a,
|
|
284
203
|
type: "error",
|
|
285
|
-
|
|
286
|
-
|
|
204
|
+
message: D,
|
|
205
|
+
description: T
|
|
287
206
|
});
|
|
288
207
|
}
|
|
289
208
|
}).finally(() => {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
data.finally == null || data.finally.call(data);
|
|
295
|
-
});
|
|
296
|
-
const unwrap = () => new Promise((resolve, reject) => originalPromise.then(() => result[0] === "reject" ? reject(result[1]) : resolve(result[1])).catch(reject));
|
|
297
|
-
if (typeof id !== "string" && typeof id !== "number") return { unwrap };
|
|
298
|
-
else return Object.assign(id, { unwrap });
|
|
209
|
+
var i;
|
|
210
|
+
f && (this.dismiss(a), a = void 0), (i = t.finally) == null || i.call(t);
|
|
211
|
+
}), g = () => new Promise((i, D) => S.then(() => w[0] === "reject" ? D(w[1]) : i(w[1])).catch(D));
|
|
212
|
+
return typeof a != "string" && typeof a != "number" ? { unwrap: g } : Object.assign(a, { unwrap: g });
|
|
299
213
|
};
|
|
300
|
-
this.custom = (
|
|
301
|
-
|
|
302
|
-
this.create({
|
|
303
|
-
jsx:
|
|
304
|
-
id,
|
|
305
|
-
...
|
|
306
|
-
});
|
|
307
|
-
return id;
|
|
308
|
-
};
|
|
309
|
-
this.getActiveToasts = () => {
|
|
310
|
-
return this.toasts.filter((toast$1) => !this.dismissedToasts.has(toast$1.id));
|
|
214
|
+
this.custom = (e, t) => {
|
|
215
|
+
let a = (t == null ? void 0 : t.id) || bt++;
|
|
216
|
+
return this.create({
|
|
217
|
+
jsx: e(a),
|
|
218
|
+
id: a,
|
|
219
|
+
...t
|
|
220
|
+
}), a;
|
|
311
221
|
};
|
|
312
|
-
this.
|
|
313
|
-
this.toasts = [];
|
|
314
|
-
this.dismissedToasts = /* @__PURE__ */ new Set();
|
|
222
|
+
this.getActiveToasts = () => this.toasts.filter((e) => !this.dismissedToasts.has(e.id));
|
|
223
|
+
this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
|
|
315
224
|
}
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
const toast = Object.assign(basicToast, {
|
|
334
|
-
success: ToastState.success,
|
|
335
|
-
info: ToastState.info,
|
|
336
|
-
warning: ToastState.warning,
|
|
337
|
-
error: ToastState.error,
|
|
338
|
-
custom: ToastState.custom,
|
|
339
|
-
message: ToastState.message,
|
|
340
|
-
promise: ToastState.promise,
|
|
341
|
-
dismiss: ToastState.dismiss,
|
|
342
|
-
loading: ToastState.loading
|
|
225
|
+
}, v = new yt(), ne = (n, e) => {
|
|
226
|
+
let t = (e == null ? void 0 : e.id) || bt++;
|
|
227
|
+
return v.addToast({
|
|
228
|
+
title: n,
|
|
229
|
+
...e,
|
|
230
|
+
id: t
|
|
231
|
+
}), t;
|
|
232
|
+
}, 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, {
|
|
233
|
+
success: v.success,
|
|
234
|
+
info: v.info,
|
|
235
|
+
warning: v.warning,
|
|
236
|
+
error: v.error,
|
|
237
|
+
custom: v.custom,
|
|
238
|
+
message: v.message,
|
|
239
|
+
promise: v.promise,
|
|
240
|
+
dismiss: v.dismiss,
|
|
241
|
+
loading: v.loading
|
|
343
242
|
}, {
|
|
344
|
-
getHistory,
|
|
345
|
-
getToasts
|
|
243
|
+
getHistory: ce,
|
|
244
|
+
getToasts: de
|
|
346
245
|
});
|
|
347
|
-
__insertCSS("[data-sonner-toaster][dir=ltr],html[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%)}[data-sonner-toaster][dir=rtl],html[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%)}[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:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[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);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[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 rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [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)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [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;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [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);background:var(--normal-bg);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-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[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}[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}[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,0)) translateX(var(--swipe-amount-x,0));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{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{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{from{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-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--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-sonner-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-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-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, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--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-sonner-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-sonner-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]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[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]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[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]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[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]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[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:first-child{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)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{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%)}");
|
|
348
|
-
|
|
349
|
-
|
|
246
|
+
function wt(n, { insertAt: e } = {}) {
|
|
247
|
+
if (!n || typeof document == "undefined") return;
|
|
248
|
+
let t = document.head || document.getElementsByTagName("head")[0], a = document.createElement("style");
|
|
249
|
+
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));
|
|
350
250
|
}
|
|
351
|
-
const VISIBLE_TOASTS_AMOUNT = 3;
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
const TOAST_WIDTH = 356;
|
|
356
|
-
const GAP = 14;
|
|
357
|
-
const SWIPE_THRESHOLD = 45;
|
|
358
|
-
const TIME_BEFORE_UNMOUNT = 200;
|
|
359
|
-
function cn(...classes) {
|
|
360
|
-
return classes.filter(Boolean).join(" ");
|
|
251
|
+
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%)}
|
|
252
|
+
`);
|
|
253
|
+
function tt(n) {
|
|
254
|
+
return n.label !== void 0;
|
|
361
255
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
if (y) directions.push(y);
|
|
366
|
-
if (x) directions.push(x);
|
|
367
|
-
return directions;
|
|
256
|
+
var pe = 3, me = "32px", ge = "16px", Wt = 4e3, he = 356, be = 14, ye = 20, we = 200;
|
|
257
|
+
function M(...n) {
|
|
258
|
+
return n.filter(Boolean).join(" ");
|
|
368
259
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
var _toast_closeButton;
|
|
393
|
-
return (_toast_closeButton = toast$1.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
|
|
394
|
-
}, [toast$1.closeButton, closeButtonFromToaster]);
|
|
395
|
-
const duration = React.useMemo(() => toast$1.duration || durationFromToaster || TOAST_LIFETIME, [toast$1.duration, durationFromToaster]);
|
|
396
|
-
const closeTimerStartTimeRef = React.useRef(0);
|
|
397
|
-
const offset = React.useRef(0);
|
|
398
|
-
const lastCloseTimerStartTimeRef = React.useRef(0);
|
|
399
|
-
const pointerStartRef = React.useRef(null);
|
|
400
|
-
const [y, x] = position.split("-");
|
|
401
|
-
const toastsHeightBefore = React.useMemo(() => {
|
|
402
|
-
return heights.reduce((prev, curr, reducerIndex) => {
|
|
403
|
-
if (reducerIndex >= heightIndex) return prev;
|
|
404
|
-
return prev + curr.height;
|
|
405
|
-
}, 0);
|
|
406
|
-
}, [heights, heightIndex]);
|
|
407
|
-
const isDocumentHidden = useIsDocumentHidden();
|
|
408
|
-
const invert = toast$1.invert || ToasterInvert;
|
|
409
|
-
const disabled = toastType === "loading";
|
|
410
|
-
offset.current = React.useMemo(() => heightIndex * gap + toastsHeightBefore, [heightIndex, toastsHeightBefore]);
|
|
411
|
-
React.useEffect(() => {
|
|
412
|
-
remainingTime.current = duration;
|
|
413
|
-
}, [duration]);
|
|
414
|
-
React.useEffect(() => {
|
|
415
|
-
setMounted(true);
|
|
416
|
-
}, []);
|
|
417
|
-
React.useEffect(() => {
|
|
418
|
-
const toastNode = toastRef.current;
|
|
419
|
-
if (toastNode) {
|
|
420
|
-
const height = toastNode.getBoundingClientRect().height;
|
|
421
|
-
setInitialHeight(height);
|
|
422
|
-
setHeights((h) => [{
|
|
423
|
-
toastId: toast$1.id,
|
|
424
|
-
height,
|
|
425
|
-
position: toast$1.position
|
|
426
|
-
}, ...h]);
|
|
427
|
-
return () => setHeights((h) => h.filter((height$1) => height$1.toastId !== toast$1.id));
|
|
260
|
+
function xe(n) {
|
|
261
|
+
let [e, t] = n.split("-"), a = [];
|
|
262
|
+
return e && a.push(e), t && a.push(t), a;
|
|
263
|
+
}
|
|
264
|
+
var ve = (n) => {
|
|
265
|
+
var Dt, Pt, Nt, Bt, Ct, kt, It, Mt, Ht, At, Lt;
|
|
266
|
+
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: X, position: st, gap: pt, loadingIcon: rt, expandByDefault: B, classNames: s, icons: P, closeButtonAriaLabel: nt = "Close toast", pauseWhenPageIsHidden: it } = n, [Y, C] = React.useState(null), [lt, J] = React.useState(null), [W, H] = React.useState(!1), [A, mt] = React.useState(!1), [L, z] = React.useState(!1), [ct, d] = React.useState(!1), [h, y] = React.useState(!1), [R, j] = React.useState(0), [p, _] = React.useState(0), O = React.useRef(t.duration || X || Wt), G = React.useRef(null), k = React.useRef(null), Vt = g === 0, Ut = g + 1 <= w, N = t.type, V = t.dismissible !== !1, Kt = t.className || "", Xt = t.descriptionClassName || "", dt = React.useMemo(() => S.findIndex((r) => r.toastId === t.id) || 0, [S, t.id]), Jt = React.useMemo(() => {
|
|
267
|
+
var r;
|
|
268
|
+
return (r = t.closeButton) != null ? r : et;
|
|
269
|
+
}, [t.closeButton, et]), Tt = React.useMemo(() => t.duration || X || Wt, [t.duration, X]), gt = React.useRef(0), U = React.useRef(0), St = React.useRef(0), K = React.useRef(null), [Gt, Qt] = st.split("-"), Rt = React.useMemo(() => S.reduce((r, m, c) => c >= dt ? r : r + m.height, 0), [S, dt]), Et = Ft(), qt = t.invert || e, ht = N === "loading";
|
|
270
|
+
U.current = React.useMemo(() => dt * pt + Rt, [dt, Rt]), React.useEffect(() => {
|
|
271
|
+
O.current = Tt;
|
|
272
|
+
}, [Tt]), React.useEffect(() => {
|
|
273
|
+
H(!0);
|
|
274
|
+
}, []), React.useEffect(() => {
|
|
275
|
+
let r = k.current;
|
|
276
|
+
if (r) {
|
|
277
|
+
let m = r.getBoundingClientRect().height;
|
|
278
|
+
return _(m), f((c) => [{
|
|
279
|
+
toastId: t.id,
|
|
280
|
+
height: m,
|
|
281
|
+
position: t.position
|
|
282
|
+
}, ...c]), () => f((c) => c.filter((b) => b.toastId !== t.id));
|
|
428
283
|
}
|
|
429
|
-
}, [
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
position: toast$1.position
|
|
443
|
-
}, ...heights$1];
|
|
444
|
-
else return heights$1.map((height) => height.toastId === toast$1.id ? {
|
|
445
|
-
...height,
|
|
446
|
-
height: newHeight
|
|
447
|
-
} : height);
|
|
448
|
-
});
|
|
284
|
+
}, [f, t.id]), React.useLayoutEffect(() => {
|
|
285
|
+
if (!W) return;
|
|
286
|
+
let r = k.current, m = r.style.height;
|
|
287
|
+
r.style.height = "auto";
|
|
288
|
+
let c = r.getBoundingClientRect().height;
|
|
289
|
+
r.style.height = m, _(c), f((b) => b.find((x) => x.toastId === t.id) ? b.map((x) => x.toastId === t.id ? {
|
|
290
|
+
...x,
|
|
291
|
+
height: c
|
|
292
|
+
} : x) : [{
|
|
293
|
+
toastId: t.id,
|
|
294
|
+
height: c,
|
|
295
|
+
position: t.position
|
|
296
|
+
}, ...b]);
|
|
449
297
|
}, [
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
toast$1.jsx,
|
|
456
|
-
toast$1.action,
|
|
457
|
-
toast$1.cancel
|
|
298
|
+
W,
|
|
299
|
+
t.title,
|
|
300
|
+
t.description,
|
|
301
|
+
f,
|
|
302
|
+
t.id
|
|
458
303
|
]);
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
setTimeout(() => {
|
|
464
|
-
removeToast(toast$1);
|
|
465
|
-
}, TIME_BEFORE_UNMOUNT);
|
|
304
|
+
let $ = React.useCallback(() => {
|
|
305
|
+
mt(!0), j(U.current), f((r) => r.filter((m) => m.toastId !== t.id)), setTimeout(() => {
|
|
306
|
+
T(t);
|
|
307
|
+
}, we);
|
|
466
308
|
}, [
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
309
|
+
t,
|
|
310
|
+
T,
|
|
311
|
+
f,
|
|
312
|
+
U
|
|
471
313
|
]);
|
|
472
314
|
React.useEffect(() => {
|
|
473
|
-
if (
|
|
474
|
-
let
|
|
475
|
-
|
|
476
|
-
if (
|
|
477
|
-
|
|
478
|
-
|
|
315
|
+
if (t.promise && N === "loading" || t.duration === Infinity || t.type === "loading") return;
|
|
316
|
+
let r;
|
|
317
|
+
return D || u || it && Et ? (() => {
|
|
318
|
+
if (St.current < gt.current) {
|
|
319
|
+
let b = (/* @__PURE__ */ new Date()).getTime() - gt.current;
|
|
320
|
+
O.current = O.current - b;
|
|
479
321
|
}
|
|
480
|
-
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
timeoutId = setTimeout(() => {
|
|
486
|
-
toast$1.onAutoClose == null || toast$1.onAutoClose.call(toast$1, toast$1);
|
|
487
|
-
deleteToast();
|
|
488
|
-
}, remainingTime.current);
|
|
489
|
-
};
|
|
490
|
-
if (expanded || interacting || isDocumentHidden) pauseTimer();
|
|
491
|
-
else startTimer();
|
|
492
|
-
return () => clearTimeout(timeoutId);
|
|
322
|
+
St.current = (/* @__PURE__ */ new Date()).getTime();
|
|
323
|
+
})() : O.current !== Infinity && (gt.current = (/* @__PURE__ */ new Date()).getTime(), r = setTimeout(() => {
|
|
324
|
+
var b;
|
|
325
|
+
(b = t.onAutoClose) == null || b.call(t, t), $();
|
|
326
|
+
}, O.current)), () => clearTimeout(r);
|
|
493
327
|
}, [
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
React.useEffect(() => {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
}
|
|
516
|
-
return /* @__PURE__ */ React.createElement(Loader, {
|
|
517
|
-
className: cn(classNames == null ? void 0 : classNames.loader, toast$1 == null ? void 0 : (_toast_classNames$1 = toast$1.classNames) == null ? void 0 : _toast_classNames$1.loader),
|
|
518
|
-
visible: toastType === "loading"
|
|
328
|
+
D,
|
|
329
|
+
u,
|
|
330
|
+
t,
|
|
331
|
+
N,
|
|
332
|
+
it,
|
|
333
|
+
Et,
|
|
334
|
+
$
|
|
335
|
+
]), React.useEffect(() => {
|
|
336
|
+
t.delete && $();
|
|
337
|
+
}, [$, t.delete]);
|
|
338
|
+
function Zt() {
|
|
339
|
+
var r, m, c;
|
|
340
|
+
return P != null && P.loading ? React.createElement("div", {
|
|
341
|
+
className: M(s == null ? void 0 : s.loader, (r = t == null ? void 0 : t.classNames) == null ? void 0 : r.loader, "sonner-loader"),
|
|
342
|
+
"data-visible": N === "loading"
|
|
343
|
+
}, P.loading) : rt ? React.createElement("div", {
|
|
344
|
+
className: M(s == null ? void 0 : s.loader, (m = t == null ? void 0 : t.classNames) == null ? void 0 : m.loader, "sonner-loader"),
|
|
345
|
+
"data-visible": N === "loading"
|
|
346
|
+
}, rt) : React.createElement(Yt, {
|
|
347
|
+
className: M(s == null ? void 0 : s.loader, (c = t == null ? void 0 : t.classNames) == null ? void 0 : c.loader),
|
|
348
|
+
visible: N === "loading"
|
|
519
349
|
});
|
|
520
350
|
}
|
|
521
|
-
|
|
522
|
-
var _toast_richColors, _icons_close;
|
|
523
|
-
return /* @__PURE__ */ React.createElement("li", {
|
|
351
|
+
return React.createElement("li", {
|
|
524
352
|
tabIndex: 0,
|
|
525
|
-
ref:
|
|
526
|
-
className:
|
|
353
|
+
ref: k,
|
|
354
|
+
className: M(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]),
|
|
527
355
|
"data-sonner-toast": "",
|
|
528
|
-
"data-rich-colors": (
|
|
529
|
-
"data-styled": !
|
|
530
|
-
"data-mounted":
|
|
531
|
-
"data-promise":
|
|
532
|
-
"data-swiped":
|
|
533
|
-
"data-removed":
|
|
534
|
-
"data-visible":
|
|
535
|
-
"data-y-position":
|
|
536
|
-
"data-x-position":
|
|
537
|
-
"data-index":
|
|
538
|
-
"data-front":
|
|
539
|
-
"data-swiping":
|
|
540
|
-
"data-dismissible":
|
|
541
|
-
"data-type":
|
|
542
|
-
"data-invert":
|
|
543
|
-
"data-swipe-out":
|
|
544
|
-
"data-swipe-direction":
|
|
545
|
-
"data-expanded":
|
|
546
|
-
"data-testid": toast$1.testId,
|
|
356
|
+
"data-rich-colors": (Nt = t.richColors) != null ? Nt : F,
|
|
357
|
+
"data-styled": !(t.jsx || t.unstyled || a),
|
|
358
|
+
"data-mounted": W,
|
|
359
|
+
"data-promise": !!t.promise,
|
|
360
|
+
"data-swiped": h,
|
|
361
|
+
"data-removed": A,
|
|
362
|
+
"data-visible": Ut,
|
|
363
|
+
"data-y-position": Gt,
|
|
364
|
+
"data-x-position": Qt,
|
|
365
|
+
"data-index": g,
|
|
366
|
+
"data-front": Vt,
|
|
367
|
+
"data-swiping": L,
|
|
368
|
+
"data-dismissible": V,
|
|
369
|
+
"data-type": N,
|
|
370
|
+
"data-invert": qt,
|
|
371
|
+
"data-swipe-out": ct,
|
|
372
|
+
"data-swipe-direction": lt,
|
|
373
|
+
"data-expanded": !!(D || B && W),
|
|
547
374
|
style: {
|
|
548
|
-
"--index":
|
|
549
|
-
"--toasts-before":
|
|
550
|
-
"--z-index":
|
|
551
|
-
"--offset": `${
|
|
552
|
-
"--initial-height":
|
|
553
|
-
...
|
|
554
|
-
...
|
|
375
|
+
"--index": g,
|
|
376
|
+
"--toasts-before": g,
|
|
377
|
+
"--z-index": i.length - g,
|
|
378
|
+
"--offset": `${A ? R : U.current}px`,
|
|
379
|
+
"--initial-height": B ? "auto" : `${p}px`,
|
|
380
|
+
...ut,
|
|
381
|
+
...t.style
|
|
555
382
|
},
|
|
556
383
|
onDragEnd: () => {
|
|
557
|
-
|
|
558
|
-
setSwipeDirection(null);
|
|
559
|
-
pointerStartRef.current = null;
|
|
384
|
+
z(!1), C(null), K.current = null;
|
|
560
385
|
},
|
|
561
|
-
onPointerDown: (
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
event.target.setPointerCapture(event.pointerId);
|
|
567
|
-
if (event.target.tagName === "BUTTON") return;
|
|
568
|
-
setSwiping(true);
|
|
569
|
-
pointerStartRef.current = {
|
|
570
|
-
x: event.clientX,
|
|
571
|
-
y: event.clientY
|
|
572
|
-
};
|
|
386
|
+
onPointerDown: (r) => {
|
|
387
|
+
ht || !V || (G.current = /* @__PURE__ */ new Date(), j(U.current), r.target.setPointerCapture(r.pointerId), r.target.tagName !== "BUTTON" && (z(!0), K.current = {
|
|
388
|
+
x: r.clientX,
|
|
389
|
+
y: r.clientY
|
|
390
|
+
}));
|
|
573
391
|
},
|
|
574
392
|
onPointerUp: () => {
|
|
575
|
-
var
|
|
576
|
-
if (
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
const swipeAmount = swipeDirection === "x" ? swipeAmountX : swipeAmountY;
|
|
582
|
-
const velocity = Math.abs(swipeAmount) / timeTaken;
|
|
583
|
-
if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > .11) {
|
|
584
|
-
setOffsetBeforeRemove(offset.current);
|
|
585
|
-
toast$1.onDismiss == null || toast$1.onDismiss.call(toast$1, toast$1);
|
|
586
|
-
if (swipeDirection === "x") setSwipeOutDirection(swipeAmountX > 0 ? "right" : "left");
|
|
587
|
-
else setSwipeOutDirection(swipeAmountY > 0 ? "down" : "up");
|
|
588
|
-
deleteToast();
|
|
589
|
-
setSwipeOut(true);
|
|
393
|
+
var x, Q, q, Z;
|
|
394
|
+
if (ct || !V) return;
|
|
395
|
+
K.current = null;
|
|
396
|
+
let r = Number(((x = k.current) == null ? void 0 : x.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), m = Number(((Q = k.current) == null ? void 0 : Q.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), c = (/* @__PURE__ */ new Date()).getTime() - ((q = G.current) == null ? void 0 : q.getTime()), b = Y === "x" ? r : m, I = Math.abs(b) / c;
|
|
397
|
+
if (Math.abs(b) >= ye || I > .11) {
|
|
398
|
+
j(U.current), (Z = t.onDismiss) == null || Z.call(t, t), J(Y === "x" ? r > 0 ? "right" : "left" : m > 0 ? "down" : "up"), $(), d(!0), y(!1);
|
|
590
399
|
return;
|
|
591
|
-
} else {
|
|
592
|
-
var _toastRef_current2, _toastRef_current3;
|
|
593
|
-
(_toastRef_current2 = toastRef.current) == null || _toastRef_current2.style.setProperty("--swipe-amount-x", `0px`);
|
|
594
|
-
(_toastRef_current3 = toastRef.current) == null || _toastRef_current3.style.setProperty("--swipe-amount-y", `0px`);
|
|
595
400
|
}
|
|
596
|
-
|
|
597
|
-
setSwiping(false);
|
|
598
|
-
setSwipeDirection(null);
|
|
401
|
+
z(!1), C(null);
|
|
599
402
|
},
|
|
600
|
-
onPointerMove: (
|
|
601
|
-
var
|
|
602
|
-
if (!
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
var _props_swipeDirections;
|
|
607
|
-
const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position);
|
|
608
|
-
if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y");
|
|
609
|
-
let swipeAmount = {
|
|
403
|
+
onPointerMove: (r) => {
|
|
404
|
+
var Q, q, Z, zt;
|
|
405
|
+
if (!K.current || !V || ((Q = window.getSelection()) == null ? void 0 : Q.toString().length) > 0) return;
|
|
406
|
+
let c = r.clientY - K.current.y, b = r.clientX - K.current.x, I = (q = n.swipeDirections) != null ? q : xe(st);
|
|
407
|
+
!Y && (Math.abs(b) > 1 || Math.abs(c) > 1) && C(Math.abs(b) > Math.abs(c) ? "x" : "y");
|
|
408
|
+
let x = {
|
|
610
409
|
x: 0,
|
|
611
410
|
y: 0
|
|
612
411
|
};
|
|
613
|
-
|
|
614
|
-
return 1 / (1.5 + Math.abs(delta) / 20);
|
|
615
|
-
};
|
|
616
|
-
if (swipeDirection === "y") {
|
|
617
|
-
if (swipeDirections.includes("top") || swipeDirections.includes("bottom")) if (swipeDirections.includes("top") && yDelta < 0 || swipeDirections.includes("bottom") && yDelta > 0) swipeAmount.y = yDelta;
|
|
618
|
-
else {
|
|
619
|
-
const dampenedDelta = yDelta * getDampening(yDelta);
|
|
620
|
-
swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
|
|
621
|
-
}
|
|
622
|
-
} else if (swipeDirection === "x") {
|
|
623
|
-
if (swipeDirections.includes("left") || swipeDirections.includes("right")) if (swipeDirections.includes("left") && xDelta < 0 || swipeDirections.includes("right") && xDelta > 0) swipeAmount.x = xDelta;
|
|
624
|
-
else {
|
|
625
|
-
const dampenedDelta = xDelta * getDampening(xDelta);
|
|
626
|
-
swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) setIsSwiped(true);
|
|
630
|
-
(_toastRef_current = toastRef.current) == null || _toastRef_current.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
|
|
631
|
-
(_toastRef_current1 = toastRef.current) == null || _toastRef_current1.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
|
|
412
|
+
Y === "y" ? (I.includes("top") || I.includes("bottom")) && (I.includes("top") && c < 0 || I.includes("bottom") && c > 0) && (x.y = c) : Y === "x" && (I.includes("left") || I.includes("right")) && (I.includes("left") && b < 0 || I.includes("right") && b > 0) && (x.x = b), (Math.abs(x.x) > 0 || Math.abs(x.y) > 0) && y(!0), (Z = k.current) == null || Z.style.setProperty("--swipe-amount-x", `${x.x}px`), (zt = k.current) == null || zt.style.setProperty("--swipe-amount-y", `${x.y}px`);
|
|
632
413
|
}
|
|
633
|
-
},
|
|
634
|
-
"aria-label":
|
|
635
|
-
"data-disabled":
|
|
636
|
-
"data-close-button":
|
|
637
|
-
onClick:
|
|
638
|
-
|
|
639
|
-
|
|
414
|
+
}, Jt && !t.jsx ? React.createElement("button", {
|
|
415
|
+
"aria-label": nt,
|
|
416
|
+
"data-disabled": ht,
|
|
417
|
+
"data-close-button": !0,
|
|
418
|
+
onClick: ht || !V ? () => {} : () => {
|
|
419
|
+
var r;
|
|
420
|
+
$(), (r = t.onDismiss) == null || r.call(t, t);
|
|
640
421
|
},
|
|
641
|
-
className:
|
|
642
|
-
}, (
|
|
422
|
+
className: M(s == null ? void 0 : s.closeButton, (Bt = t == null ? void 0 : t.classNames) == null ? void 0 : Bt.closeButton)
|
|
423
|
+
}, (Ct = P == null ? void 0 : P.close) != null ? Ct : Ot) : null, t.jsx || isValidElement(t.title) ? t.jsx ? t.jsx : typeof t.title == "function" ? t.title() : t.title : React.createElement(React.Fragment, null, N || t.icon || t.promise ? React.createElement("div", {
|
|
643
424
|
"data-icon": "",
|
|
644
|
-
className:
|
|
645
|
-
},
|
|
425
|
+
className: M(s == null ? void 0 : s.icon, (kt = t == null ? void 0 : t.classNames) == null ? void 0 : kt.icon)
|
|
426
|
+
}, 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, React.createElement("div", {
|
|
646
427
|
"data-content": "",
|
|
647
|
-
className:
|
|
648
|
-
},
|
|
428
|
+
className: M(s == null ? void 0 : s.content, (It = t == null ? void 0 : t.classNames) == null ? void 0 : It.content)
|
|
429
|
+
}, React.createElement("div", {
|
|
649
430
|
"data-title": "",
|
|
650
|
-
className:
|
|
651
|
-
},
|
|
431
|
+
className: M(s == null ? void 0 : s.title, (Mt = t == null ? void 0 : t.classNames) == null ? void 0 : Mt.title)
|
|
432
|
+
}, typeof t.title == "function" ? t.title() : t.title), t.description ? React.createElement("div", {
|
|
652
433
|
"data-description": "",
|
|
653
|
-
className:
|
|
654
|
-
}, typeof
|
|
655
|
-
"data-button":
|
|
656
|
-
"data-cancel":
|
|
657
|
-
style:
|
|
658
|
-
onClick: (
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
toast$1.cancel.onClick == null || toast$1.cancel.onClick.call(toast$1.cancel, event);
|
|
662
|
-
deleteToast();
|
|
434
|
+
className: M(at, Xt, s == null ? void 0 : s.description, (Ht = t == null ? void 0 : t.classNames) == null ? void 0 : Ht.description)
|
|
435
|
+
}, typeof t.description == "function" ? t.description() : t.description) : null), isValidElement(t.cancel) ? t.cancel : t.cancel && tt(t.cancel) ? React.createElement("button", {
|
|
436
|
+
"data-button": !0,
|
|
437
|
+
"data-cancel": !0,
|
|
438
|
+
style: t.cancelButtonStyle || ft,
|
|
439
|
+
onClick: (r) => {
|
|
440
|
+
var m, c;
|
|
441
|
+
tt(t.cancel) && V && ((c = (m = t.cancel).onClick) == null || c.call(m, r), $());
|
|
663
442
|
},
|
|
664
|
-
className:
|
|
665
|
-
},
|
|
666
|
-
"data-button":
|
|
667
|
-
"data-action":
|
|
668
|
-
style:
|
|
669
|
-
onClick: (
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
if (event.defaultPrevented) return;
|
|
673
|
-
deleteToast();
|
|
443
|
+
className: M(s == null ? void 0 : s.cancelButton, (At = t == null ? void 0 : t.classNames) == null ? void 0 : At.cancelButton)
|
|
444
|
+
}, t.cancel.label) : null, isValidElement(t.action) ? t.action : t.action && tt(t.action) ? React.createElement("button", {
|
|
445
|
+
"data-button": !0,
|
|
446
|
+
"data-action": !0,
|
|
447
|
+
style: t.actionButtonStyle || l,
|
|
448
|
+
onClick: (r) => {
|
|
449
|
+
var m, c;
|
|
450
|
+
tt(t.action) && ((c = (m = t.action).onClick) == null || c.call(m, r), !r.defaultPrevented && $());
|
|
674
451
|
},
|
|
675
|
-
className:
|
|
676
|
-
},
|
|
452
|
+
className: M(s == null ? void 0 : s.actionButton, (Lt = t == null ? void 0 : t.classNames) == null ? void 0 : Lt.actionButton)
|
|
453
|
+
}, t.action.label) : null));
|
|
677
454
|
};
|
|
678
|
-
function
|
|
679
|
-
if (typeof window
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
if (dirAttribute === "auto" || !dirAttribute) return window.getComputedStyle(document.documentElement).direction;
|
|
683
|
-
return dirAttribute;
|
|
455
|
+
function _t() {
|
|
456
|
+
if (typeof window == "undefined" || typeof document == "undefined") return "ltr";
|
|
457
|
+
let n = document.documentElement.getAttribute("dir");
|
|
458
|
+
return n === "auto" || !n ? window.getComputedStyle(document.documentElement).direction : n;
|
|
684
459
|
}
|
|
685
|
-
function
|
|
686
|
-
|
|
687
|
-
[
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
|
|
691
|
-
function assignAll(offset$1) {
|
|
460
|
+
function Te(n, e) {
|
|
461
|
+
let t = {};
|
|
462
|
+
return [n, e].forEach((a, u) => {
|
|
463
|
+
let f = u === 1, w = f ? "--mobile-offset" : "--offset", S = f ? ge : me;
|
|
464
|
+
function g(i) {
|
|
692
465
|
[
|
|
693
466
|
"top",
|
|
694
467
|
"right",
|
|
695
468
|
"bottom",
|
|
696
469
|
"left"
|
|
697
|
-
].forEach((
|
|
698
|
-
|
|
470
|
+
].forEach((D) => {
|
|
471
|
+
t[`${w}-${D}`] = typeof i == "number" ? `${i}px` : i;
|
|
699
472
|
});
|
|
700
473
|
}
|
|
701
|
-
|
|
702
|
-
else if (typeof offset === "object") [
|
|
474
|
+
typeof a == "number" || typeof a == "string" ? g(a) : typeof a == "object" ? [
|
|
703
475
|
"top",
|
|
704
476
|
"right",
|
|
705
477
|
"bottom",
|
|
706
478
|
"left"
|
|
707
|
-
].forEach((
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
else assignAll(defaultValue);
|
|
712
|
-
});
|
|
713
|
-
return styles;
|
|
479
|
+
].forEach((i) => {
|
|
480
|
+
a[i] === void 0 ? t[`${w}-${i}`] = S : t[`${w}-${i}`] = typeof a[i] == "number" ? `${a[i]}px` : a[i];
|
|
481
|
+
}) : g(S);
|
|
482
|
+
}), t;
|
|
714
483
|
}
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
return toasts.filter((toast$1) => !toast$1.toasterId);
|
|
721
|
-
}, [toasts, id]);
|
|
722
|
-
const possiblePositions = React.useMemo(() => {
|
|
723
|
-
return Array.from(new Set([position].concat(filteredToasts.filter((toast$1) => toast$1.position).map((toast$1) => toast$1.position))));
|
|
724
|
-
}, [filteredToasts, position]);
|
|
725
|
-
const [heights, setHeights] = React.useState([]);
|
|
726
|
-
const [expanded, setExpanded] = React.useState(false);
|
|
727
|
-
const [interacting, setInteracting] = React.useState(false);
|
|
728
|
-
const [actualTheme, setActualTheme] = React.useState(theme !== "system" ? theme : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
|
|
729
|
-
const listRef = React.useRef(null);
|
|
730
|
-
const hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
|
|
731
|
-
const lastFocusedElementRef = React.useRef(null);
|
|
732
|
-
const isFocusWithinRef = React.useRef(false);
|
|
733
|
-
const removeToast = React.useCallback((toastToRemove) => {
|
|
734
|
-
setToasts((toasts$1) => {
|
|
735
|
-
var _toasts_find;
|
|
736
|
-
if (!((_toasts_find = toasts$1.find((toast$1) => toast$1.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) ToastState.dismiss(toastToRemove.id);
|
|
737
|
-
return toasts$1.filter(({ id: id$1 }) => id$1 !== toastToRemove.id);
|
|
484
|
+
var $e = forwardRef(function(e, t) {
|
|
485
|
+
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: X, icons: st, containerAriaLabel: pt = "Notifications", pauseWhenPageIsHidden: rt } = e, [B, s] = React.useState([]), P = React.useMemo(() => Array.from(new Set([u].concat(B.filter((d) => d.position).map((d) => d.position)))), [B, u]), [nt, it] = React.useState([]), [Y, C] = React.useState(!1), [lt, J] = React.useState(!1), [W, H] = React.useState(T !== "system" ? T : typeof window != "undefined" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), A = React.useRef(null), mt = f.join("+").replace(/Key/g, "").replace(/Digit/g, ""), L = React.useRef(null), z = React.useRef(!1), ct = React.useCallback((d) => {
|
|
486
|
+
s((h) => {
|
|
487
|
+
var y;
|
|
488
|
+
return (y = h.find((R) => R.id === d.id)) != null && y.delete || v.dismiss(d.id), h.filter(({ id: R }) => R !== d.id);
|
|
738
489
|
});
|
|
739
490
|
}, []);
|
|
740
|
-
React.useEffect(() => {
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
...
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
},
|
|
761
|
-
...toasts$1.slice(indexOfExistingToast + 1)
|
|
762
|
-
];
|
|
763
|
-
return [toast$1, ...toasts$1];
|
|
764
|
-
});
|
|
491
|
+
return React.useEffect(() => v.subscribe((d) => {
|
|
492
|
+
if (d.dismiss) {
|
|
493
|
+
s((h) => h.map((y) => y.id === d.id ? {
|
|
494
|
+
...y,
|
|
495
|
+
delete: !0
|
|
496
|
+
} : y));
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
setTimeout(() => {
|
|
500
|
+
vt.flushSync(() => {
|
|
501
|
+
s((h) => {
|
|
502
|
+
let y = h.findIndex((R) => R.id === d.id);
|
|
503
|
+
return y !== -1 ? [
|
|
504
|
+
...h.slice(0, y),
|
|
505
|
+
{
|
|
506
|
+
...h[y],
|
|
507
|
+
...d
|
|
508
|
+
},
|
|
509
|
+
...h.slice(y + 1)
|
|
510
|
+
] : [d, ...h];
|
|
765
511
|
});
|
|
766
512
|
});
|
|
767
513
|
});
|
|
768
|
-
}, [
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
setActualTheme(theme);
|
|
514
|
+
}), []), React.useEffect(() => {
|
|
515
|
+
if (T !== "system") {
|
|
516
|
+
H(T);
|
|
772
517
|
return;
|
|
773
518
|
}
|
|
774
|
-
if (
|
|
775
|
-
|
|
776
|
-
if (typeof window === "undefined") return;
|
|
777
|
-
const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
519
|
+
if (T === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? H("dark") : H("light")), typeof window == "undefined") return;
|
|
520
|
+
let d = window.matchMedia("(prefers-color-scheme: dark)");
|
|
778
521
|
try {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
else setActualTheme("light");
|
|
522
|
+
d.addEventListener("change", ({ matches: h }) => {
|
|
523
|
+
H(h ? "dark" : "light");
|
|
782
524
|
});
|
|
783
|
-
} catch (
|
|
784
|
-
|
|
525
|
+
} catch (h) {
|
|
526
|
+
d.addListener(({ matches: y }) => {
|
|
785
527
|
try {
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
console.error(e);
|
|
528
|
+
H(y ? "dark" : "light");
|
|
529
|
+
} catch (R) {
|
|
530
|
+
console.error(R);
|
|
790
531
|
}
|
|
791
532
|
});
|
|
792
533
|
}
|
|
793
|
-
}, [
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
var _listRef_current;
|
|
800
|
-
if (hotkey.every((key) => event[key] || event.code === key)) {
|
|
801
|
-
var _listRef_current1;
|
|
802
|
-
setExpanded(true);
|
|
803
|
-
(_listRef_current1 = listRef.current) == null || _listRef_current1.focus();
|
|
804
|
-
}
|
|
805
|
-
if (event.code === "Escape" && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) setExpanded(false);
|
|
534
|
+
}, [T]), React.useEffect(() => {
|
|
535
|
+
B.length <= 1 && C(!1);
|
|
536
|
+
}, [B]), React.useEffect(() => {
|
|
537
|
+
let d = (h) => {
|
|
538
|
+
var R, j;
|
|
539
|
+
f.every((p) => h[p] || h.code === p) && (C(!0), (R = A.current) == null || R.focus()), h.code === "Escape" && (document.activeElement === A.current || (j = A.current) != null && j.contains(document.activeElement)) && C(!1);
|
|
806
540
|
};
|
|
807
|
-
document.addEventListener("keydown",
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
if (listRef.current) return () => {
|
|
812
|
-
if (lastFocusedElementRef.current) {
|
|
813
|
-
lastFocusedElementRef.current.focus({ preventScroll: true });
|
|
814
|
-
lastFocusedElementRef.current = null;
|
|
815
|
-
isFocusWithinRef.current = false;
|
|
816
|
-
}
|
|
541
|
+
return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
|
|
542
|
+
}, [f]), React.useEffect(() => {
|
|
543
|
+
if (A.current) return () => {
|
|
544
|
+
L.current && (L.current.focus({ preventScroll: !0 }), L.current = null, z.current = !1);
|
|
817
545
|
};
|
|
818
|
-
}, [
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
"aria-label": `${containerAriaLabel} ${hotkeyLabel}`,
|
|
546
|
+
}, [A.current]), React.createElement("section", {
|
|
547
|
+
ref: t,
|
|
548
|
+
"aria-label": `${pt} ${mt}`,
|
|
822
549
|
tabIndex: -1,
|
|
823
550
|
"aria-live": "polite",
|
|
824
551
|
"aria-relevant": "additions text",
|
|
825
552
|
"aria-atomic": "false",
|
|
826
|
-
suppressHydrationWarning:
|
|
827
|
-
},
|
|
828
|
-
var
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
dir: dir === "auto" ? getDocumentDirection() : dir,
|
|
553
|
+
suppressHydrationWarning: !0
|
|
554
|
+
}, P.map((d, h) => {
|
|
555
|
+
var j;
|
|
556
|
+
let [y, R] = d.split("-");
|
|
557
|
+
return B.length ? React.createElement("ol", {
|
|
558
|
+
key: d,
|
|
559
|
+
dir: ot === "auto" ? _t() : ot,
|
|
834
560
|
tabIndex: -1,
|
|
835
|
-
ref:
|
|
836
|
-
className,
|
|
837
|
-
"data-sonner-toaster":
|
|
838
|
-
"data-
|
|
561
|
+
ref: A,
|
|
562
|
+
className: g,
|
|
563
|
+
"data-sonner-toaster": !0,
|
|
564
|
+
"data-theme": W,
|
|
839
565
|
"data-y-position": y,
|
|
840
|
-
"data-
|
|
566
|
+
"data-lifted": Y && B.length > 1 && !w,
|
|
567
|
+
"data-x-position": R,
|
|
841
568
|
style: {
|
|
842
|
-
"--front-toast-height": `${((
|
|
843
|
-
"--width": `${
|
|
844
|
-
"--gap": `${
|
|
845
|
-
...
|
|
846
|
-
...
|
|
569
|
+
"--front-toast-height": `${((j = nt[0]) == null ? void 0 : j.height) || 0}px`,
|
|
570
|
+
"--width": `${he}px`,
|
|
571
|
+
"--gap": `${at}px`,
|
|
572
|
+
...ut,
|
|
573
|
+
...Te(i, D)
|
|
847
574
|
},
|
|
848
|
-
onBlur: (
|
|
849
|
-
|
|
850
|
-
isFocusWithinRef.current = false;
|
|
851
|
-
if (lastFocusedElementRef.current) {
|
|
852
|
-
lastFocusedElementRef.current.focus({ preventScroll: true });
|
|
853
|
-
lastFocusedElementRef.current = null;
|
|
854
|
-
}
|
|
855
|
-
}
|
|
575
|
+
onBlur: (p) => {
|
|
576
|
+
z.current && !p.currentTarget.contains(p.relatedTarget) && (z.current = !1, L.current && (L.current.focus({ preventScroll: !0 }), L.current = null));
|
|
856
577
|
},
|
|
857
|
-
onFocus: (
|
|
858
|
-
|
|
859
|
-
if (!isFocusWithinRef.current) {
|
|
860
|
-
isFocusWithinRef.current = true;
|
|
861
|
-
lastFocusedElementRef.current = event.relatedTarget;
|
|
862
|
-
}
|
|
578
|
+
onFocus: (p) => {
|
|
579
|
+
p.target instanceof HTMLElement && p.target.dataset.dismissible === "false" || z.current || (z.current = !0, L.current = p.relatedTarget);
|
|
863
580
|
},
|
|
864
|
-
onMouseEnter: () =>
|
|
865
|
-
onMouseMove: () =>
|
|
581
|
+
onMouseEnter: () => C(!0),
|
|
582
|
+
onMouseMove: () => C(!0),
|
|
866
583
|
onMouseLeave: () => {
|
|
867
|
-
|
|
584
|
+
lt || C(!1);
|
|
868
585
|
},
|
|
869
|
-
onDragEnd: () =>
|
|
870
|
-
onPointerDown: (
|
|
871
|
-
|
|
872
|
-
setInteracting(true);
|
|
586
|
+
onDragEnd: () => C(!1),
|
|
587
|
+
onPointerDown: (p) => {
|
|
588
|
+
p.target instanceof HTMLElement && p.target.dataset.dismissible === "false" || J(!0);
|
|
873
589
|
},
|
|
874
|
-
onPointerUp: () =>
|
|
875
|
-
},
|
|
876
|
-
var
|
|
877
|
-
return
|
|
878
|
-
key:
|
|
879
|
-
icons,
|
|
880
|
-
index:
|
|
881
|
-
toast:
|
|
882
|
-
defaultRichColors:
|
|
883
|
-
duration: (
|
|
884
|
-
className:
|
|
885
|
-
descriptionClassName:
|
|
886
|
-
invert,
|
|
887
|
-
visibleToasts,
|
|
888
|
-
closeButton: (
|
|
889
|
-
interacting,
|
|
890
|
-
position:
|
|
891
|
-
style:
|
|
892
|
-
unstyled:
|
|
893
|
-
classNames:
|
|
894
|
-
cancelButtonStyle:
|
|
895
|
-
actionButtonStyle:
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
expanded,
|
|
904
|
-
|
|
590
|
+
onPointerUp: () => J(!1)
|
|
591
|
+
}, B.filter((p) => !p.position && h === 0 || p.position === d).map((p, _) => {
|
|
592
|
+
var O, G;
|
|
593
|
+
return React.createElement(ve, {
|
|
594
|
+
key: p.id,
|
|
595
|
+
icons: st,
|
|
596
|
+
index: _,
|
|
597
|
+
toast: p,
|
|
598
|
+
defaultRichColors: F,
|
|
599
|
+
duration: (O = l == null ? void 0 : l.duration) != null ? O : et,
|
|
600
|
+
className: l == null ? void 0 : l.className,
|
|
601
|
+
descriptionClassName: l == null ? void 0 : l.descriptionClassName,
|
|
602
|
+
invert: a,
|
|
603
|
+
visibleToasts: ft,
|
|
604
|
+
closeButton: (G = l == null ? void 0 : l.closeButton) != null ? G : S,
|
|
605
|
+
interacting: lt,
|
|
606
|
+
position: d,
|
|
607
|
+
style: l == null ? void 0 : l.style,
|
|
608
|
+
unstyled: l == null ? void 0 : l.unstyled,
|
|
609
|
+
classNames: l == null ? void 0 : l.classNames,
|
|
610
|
+
cancelButtonStyle: l == null ? void 0 : l.cancelButtonStyle,
|
|
611
|
+
actionButtonStyle: l == null ? void 0 : l.actionButtonStyle,
|
|
612
|
+
removeToast: ct,
|
|
613
|
+
toasts: B.filter((k) => k.position == p.position),
|
|
614
|
+
heights: nt.filter((k) => k.position == p.position),
|
|
615
|
+
setHeights: it,
|
|
616
|
+
expandByDefault: w,
|
|
617
|
+
gap: at,
|
|
618
|
+
loadingIcon: X,
|
|
619
|
+
expanded: Y,
|
|
620
|
+
pauseWhenPageIsHidden: rt,
|
|
621
|
+
swipeDirections: e.swipeDirections
|
|
905
622
|
});
|
|
906
|
-
}));
|
|
623
|
+
})) : null;
|
|
907
624
|
}));
|
|
908
625
|
});
|
|
909
626
|
|
|
910
627
|
//#endregion
|
|
911
|
-
export {
|
|
912
|
-
//# sourceMappingURL=index.js.map
|
|
628
|
+
export { $e };
|