laif-ds 0.2.21 → 0.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +5 -5
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/ui/app-select.js +92 -109
- package/dist/components/ui/gantt/constants/DimensionsSettings.js +6 -6
- package/dist/components/ui/gantt/constants/DragStepOptions.js +9 -9
- package/dist/components/ui/message-input.js +23 -23
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/textarea.js +18 -15
- package/dist/index.d.ts +6 -7
- package/dist/lib/audio-utils.js +2 -2
- package/dist/node_modules/@date-fns/tz/date/index.js +2 -7
- package/dist/node_modules/@date-fns/tz/date/mini.js +32 -27
- package/dist/node_modules/@date-fns/tz/tzName/index.js +12 -0
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js +11 -12
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +137 -139
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +238 -235
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +88 -83
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +70 -69
- package/dist/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +13 -13
- package/dist/node_modules/@lexical/code/LexicalCode.prod.js +3 -3
- package/dist/node_modules/@lexical/dragon/LexicalDragon.prod.js +2 -2
- package/dist/node_modules/@lexical/history/LexicalHistory.prod.js +9 -9
- package/dist/node_modules/@lexical/html/LexicalHtml.prod.js +6 -6
- package/dist/node_modules/@lexical/list/LexicalList.prod.js +48 -48
- package/dist/node_modules/@lexical/markdown/LexicalMarkdown.prod.js +29 -29
- package/dist/node_modules/@lexical/react/LexicalCheckListPlugin.prod.js +1 -1
- package/dist/node_modules/@lexical/react/LexicalClearEditorPlugin.prod.js +2 -2
- package/dist/node_modules/@lexical/react/LexicalComposer.prod.js +10 -10
- package/dist/node_modules/@lexical/react/LexicalComposerContext.prod.js +2 -2
- package/dist/node_modules/@lexical/react/LexicalContentEditable.prod.js +17 -17
- package/dist/node_modules/@lexical/react/LexicalErrorBoundary.prod.js +4 -4
- package/dist/node_modules/@lexical/react/LexicalHistoryPlugin.prod.js +4 -4
- package/dist/node_modules/@lexical/react/LexicalListPlugin.prod.js +5 -5
- package/dist/node_modules/@lexical/react/LexicalOnChangePlugin.prod.js +4 -4
- package/dist/node_modules/@lexical/react/LexicalRichTextPlugin.prod.js +20 -20
- package/dist/node_modules/@lexical/react/useLexicalEditable.prod.js +7 -7
- package/dist/node_modules/@lexical/rich-text/LexicalRichText.prod.js +43 -43
- package/dist/node_modules/@lexical/table/LexicalTable.prod.js +16 -16
- package/dist/node_modules/@lexical/utils/LexicalUtils.prod.js +3 -3
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +43 -42
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-scroll-area/dist/index.js +2 -2
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +2 -2
- package/dist/node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.js +183 -175
- package/dist/node_modules/@shikijs/core/dist/index.js +195 -175
- package/dist/node_modules/@shikijs/langs/dist/asciidoc.js +2 -2
- package/dist/node_modules/@shikijs/langs/dist/cobol.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/erlang.js +5 -3
- package/dist/node_modules/@shikijs/langs/dist/fsharp.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/gdscript.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/go.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/haxe.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/julia.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/latex.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/lean.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/markdown.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/marko.js +5 -5
- package/dist/node_modules/@shikijs/langs/dist/mermaid.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/nextflow.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/purescript.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/r.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/sql.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/swift.js +2 -2
- package/dist/node_modules/@shikijs/langs/dist/templ.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/tex.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/vue-vine.js +21 -0
- package/dist/node_modules/@shikijs/langs/dist/vue.js +1 -1
- package/dist/node_modules/@shikijs/langs/dist/zig.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/andromeeda.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/catppuccin-frappe.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/catppuccin-latte.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/catppuccin-macchiato.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/catppuccin-mocha.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-dark-hard.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-dark-medium.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-dark-soft.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-light-hard.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-light-medium.js +1 -1
- package/dist/node_modules/@shikijs/themes/dist/gruvbox-light-soft.js +1 -1
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +215 -208
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +1 -1
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +1 -1
- package/dist/node_modules/classnames/index.js +2 -2
- package/dist/node_modules/d3-interpolate/src/rgb.js +2 -2
- package/dist/node_modules/dayjs/dayjs.min.js +14 -14
- package/dist/node_modules/dayjs/locale/it.js +4 -4
- package/dist/node_modules/dayjs/plugin/isoWeek.js +4 -4
- package/dist/node_modules/dayjs/plugin/localizedFormat.js +10 -10
- package/dist/node_modules/decimal.js-light/decimal.js +2 -2
- package/dist/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.js +2 -2
- package/dist/node_modules/es-toolkit/dist/array/flatten.js +2 -2
- package/dist/node_modules/es-toolkit/dist/array/uniqBy.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/compareValues.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/getSymbols.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/getTag.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isIndex.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/isKey.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/tags.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/_internal/toKey.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/array/orderBy.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/array/sortBy.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/array/uniqBy.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/function/debounce.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/function/throttle.js +14 -15
- package/dist/node_modules/es-toolkit/dist/compat/math/range.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeep.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.js +11 -11
- package/dist/node_modules/es-toolkit/dist/compat/object/get.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/object/has.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/object/property.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArguments.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatch.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isMatchWith.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isObject.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/isSymbol.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/matches.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/util/eq.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/util/iteratee.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/util/toFinite.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/util/toNumber.js +2 -2
- package/dist/node_modules/es-toolkit/dist/compat/util/toPath.js +2 -2
- package/dist/node_modules/es-toolkit/dist/function/debounce.js +15 -15
- package/dist/node_modules/es-toolkit/dist/function/identity.js +2 -2
- package/dist/node_modules/es-toolkit/dist/function/noop.js +2 -10
- package/dist/node_modules/es-toolkit/dist/object/cloneDeep.js +2 -2
- package/dist/node_modules/es-toolkit/dist/object/cloneDeepWith.js +3 -3
- package/dist/node_modules/es-toolkit/dist/predicate/isLength.js +2 -2
- package/dist/node_modules/es-toolkit/dist/predicate/isPrimitive.js +2 -2
- package/dist/node_modules/es-toolkit/dist/predicate/isTypedArray.js +2 -2
- package/dist/node_modules/eventemitter3/index2.js +3 -3
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/immer/dist/immer.js +213 -216
- package/dist/node_modules/lexical/Lexical.prod.js +212 -212
- package/dist/node_modules/lodash/_baseCreate.js +2 -2
- package/dist/node_modules/lodash/_cloneBuffer.js +2 -2
- package/dist/node_modules/lodash/_defineProperty.js +2 -2
- package/dist/node_modules/lodash/_isMasked.js +2 -2
- package/dist/node_modules/lodash/_nodeUtil.js +4 -4
- package/dist/node_modules/lodash/isArguments.js +2 -2
- package/dist/node_modules/lodash/isBuffer.js +2 -2
- package/dist/node_modules/lodash/lodash.js +16 -16
- package/dist/node_modules/prismjs/components/prism-cpp.js +2 -2
- package/dist/node_modules/prismjs/components/prism-java.js +2 -2
- package/dist/node_modules/prismjs/components/prism-rust.js +2 -2
- package/dist/node_modules/prismjs/components/prism-typescript.js +2 -2
- package/dist/node_modules/prismjs/prism.js +8 -8
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +183 -164
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +14 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +10 -7
- package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +6 -6
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +30 -30
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +5 -5
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +9 -9
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +11 -11
- package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +1 -1
- package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +12 -12
- package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +19 -19
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +9 -9
- package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +10 -10
- package/dist/node_modules/react-hook-form/dist/index.esm.js +150 -117
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +48 -48
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +9 -9
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +43 -39
- package/dist/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.js +95 -94
- package/dist/node_modules/react-window/dist/index.esm.js +2 -2
- package/dist/node_modules/recharts/es6/animation/AnimationManager.js +14 -14
- package/dist/node_modules/recharts/es6/animation/JavascriptAnimate.js +49 -0
- package/dist/node_modules/recharts/es6/animation/createDefaultAnimationManager.js +9 -0
- package/dist/node_modules/recharts/es6/animation/useAnimationManager.js +12 -0
- package/dist/node_modules/recharts/es6/component/Cursor.js +5 -5
- package/dist/node_modules/recharts/es6/component/DefaultLegendContent.js +55 -58
- package/dist/node_modules/recharts/es6/component/Legend.js +32 -27
- package/dist/node_modules/recharts/es6/component/ResponsiveContainer.js +44 -40
- package/dist/node_modules/recharts/es6/context/chartLayoutContext.js +15 -23
- package/dist/node_modules/recharts/es6/context/useTooltipAxis.js +8 -7
- package/dist/node_modules/recharts/es6/shape/Curve.js +10 -10
- package/dist/node_modules/recharts/es6/shape/Rectangle.js +136 -99
- package/dist/node_modules/recharts/es6/shape/Symbols.js +55 -53
- package/dist/node_modules/recharts/es6/state/legendSlice.js +5 -4
- package/dist/node_modules/recharts/es6/state/selectors/axisSelectors.js +352 -307
- package/dist/node_modules/recharts/es6/state/selectors/brushSelectors.js +9 -9
- package/dist/node_modules/recharts/es6/state/selectors/combiners/combineDisplayedStackedData.js +26 -0
- package/dist/node_modules/recharts/es6/state/selectors/combiners/combineTooltipPayload.js +117 -0
- package/dist/node_modules/recharts/es6/state/selectors/dataSelectors.js +4 -4
- package/dist/node_modules/recharts/es6/state/selectors/legendSelectors.js +10 -4
- package/dist/node_modules/recharts/es6/state/selectors/polarAxisSelectors.js +33 -32
- package/dist/node_modules/recharts/es6/state/selectors/selectChartOffsetInternal.js +108 -0
- package/dist/node_modules/recharts/es6/state/selectors/selectTooltipAxis.js +13 -0
- package/dist/node_modules/recharts/es6/state/selectors/selectTooltipAxisId.js +5 -0
- package/dist/node_modules/recharts/es6/state/selectors/selectTooltipAxisType.js +9 -0
- package/dist/node_modules/recharts/es6/state/selectors/selectors.js +40 -143
- package/dist/node_modules/recharts/es6/state/selectors/tooltipSelectors.js +68 -63
- package/dist/node_modules/recharts/es6/state/types/StackedGraphicalItem.js +7 -0
- package/dist/node_modules/recharts/es6/util/ChartUtils.js +58 -57
- package/dist/node_modules/recharts/es6/util/DataUtils.js +34 -26
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +20 -15
- package/dist/node_modules/recharts/es6/util/excludeEventProps.js +11 -0
- package/dist/node_modules/recharts/es6/util/getSliced.js +7 -0
- package/dist/node_modules/recharts/es6/util/scale/getNiceTickValues.js +44 -44
- package/dist/node_modules/recharts/es6/util/stacks/getStackSeriesIdentifier.js +7 -0
- package/dist/node_modules/recharts/es6/util/svgPropertiesNoEvents.js +328 -0
- package/dist/node_modules/recharts/es6/util/types.js +22 -332
- package/dist/node_modules/recharts/es6/util/useAnimationId.js +10 -0
- package/dist/node_modules/recharts/es6/util/useElementOffset.js +20 -16
- package/dist/node_modules/remeda/dist/hasAtLeast-F1Oj_xBB.js +9 -0
- package/dist/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js +8 -0
- package/dist/node_modules/remeda/dist/omit-HZOiLuMO.js +19 -0
- package/dist/node_modules/remeda/dist/purry-DH9cw9sy.js +11 -0
- package/dist/node_modules/shiki/dist/langs.js +225 -220
- package/dist/node_modules/shiki/dist/themes.js +60 -60
- package/dist/node_modules/sonner/dist/index.js +309 -305
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +169 -168
- package/dist/node_modules/unified/lib/callable-instance.js +2 -2
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/node_modules/unist-util-is/lib/index.js +2 -2
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +2 -2
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +2 -2
- package/dist/node_modules/vfile-message/lib/index.js +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
- package/dist/_virtual/isEqual.js +0 -8
- package/dist/_virtual/isEqual2.js +0 -5
- package/dist/_virtual/isEqualWith.js +0 -5
- package/dist/_virtual/isPlainObject.js +0 -5
- package/dist/_virtual/noop.js +0 -5
- package/dist/node_modules/es-toolkit/compat/isEqual.js +0 -9
- package/dist/node_modules/es-toolkit/dist/predicate/isEqual.js +0 -18
- package/dist/node_modules/es-toolkit/dist/predicate/isEqualWith.js +0 -139
- package/dist/node_modules/es-toolkit/dist/predicate/isPlainObject.js +0 -18
- package/dist/node_modules/recharts/es6/animation/Animate.js +0 -270
- package/dist/node_modules/recharts/es6/state/selectors/selectChartOffset.js +0 -98
- package/dist/node_modules/remeda/dist/chunk-AIG3BDKO.js +0 -9
- package/dist/node_modules/remeda/dist/chunk-D6FCK2GA.js +0 -8
- package/dist/node_modules/remeda/dist/chunk-KI5X74E2.js +0 -19
- package/dist/node_modules/remeda/dist/chunk-WIMGWYZL.js +0 -11
|
@@ -99,7 +99,7 @@ const Wt = (r) => {
|
|
|
99
99
|
return document.addEventListener("visibilitychange", e), () => window.removeEventListener("visibilitychange", e);
|
|
100
100
|
}, []), r;
|
|
101
101
|
};
|
|
102
|
-
let
|
|
102
|
+
let xt = 1;
|
|
103
103
|
class ae {
|
|
104
104
|
constructor() {
|
|
105
105
|
this.subscribe = (o) => (this.subscribers.push(o), () => {
|
|
@@ -114,24 +114,24 @@ class ae {
|
|
|
114
114
|
];
|
|
115
115
|
}, this.create = (o) => {
|
|
116
116
|
var e;
|
|
117
|
-
const { message: s, ...
|
|
118
|
-
return this.dismissedToasts.has(
|
|
119
|
-
...
|
|
117
|
+
const { message: s, ...C } = o, u = typeof o?.id == "number" || ((e = o.id) == null ? void 0 : e.length) > 0 ? o.id : xt++, g = this.toasts.find((b) => b.id === u), _ = o.dismissible === void 0 ? !0 : o.dismissible;
|
|
118
|
+
return this.dismissedToasts.has(u) && this.dismissedToasts.delete(u), g ? this.toasts = this.toasts.map((b) => b.id === u ? (this.publish({
|
|
119
|
+
...b,
|
|
120
120
|
...o,
|
|
121
|
-
id:
|
|
121
|
+
id: u,
|
|
122
122
|
title: s
|
|
123
123
|
}), {
|
|
124
|
-
...
|
|
124
|
+
...b,
|
|
125
125
|
...o,
|
|
126
|
-
id:
|
|
127
|
-
dismissible:
|
|
126
|
+
id: u,
|
|
127
|
+
dismissible: _,
|
|
128
128
|
title: s
|
|
129
|
-
}) :
|
|
129
|
+
}) : b) : this.addToast({
|
|
130
130
|
title: s,
|
|
131
|
-
...
|
|
132
|
-
dismissible:
|
|
133
|
-
id:
|
|
134
|
-
}),
|
|
131
|
+
...C,
|
|
132
|
+
dismissible: _,
|
|
133
|
+
id: u
|
|
134
|
+
}), u;
|
|
135
135
|
}, this.dismiss = (o) => (o ? (this.dismissedToasts.add(o), requestAnimationFrame(() => this.subscribers.forEach((e) => e({
|
|
136
136
|
id: o,
|
|
137
137
|
dismiss: !0
|
|
@@ -174,78 +174,78 @@ class ae {
|
|
|
174
174
|
message: e.loading,
|
|
175
175
|
description: typeof e.description != "function" ? e.description : void 0
|
|
176
176
|
}));
|
|
177
|
-
const
|
|
178
|
-
let
|
|
179
|
-
const
|
|
180
|
-
if (
|
|
177
|
+
const C = Promise.resolve(o instanceof Function ? o() : o);
|
|
178
|
+
let u = s !== void 0, g;
|
|
179
|
+
const _ = C.then(async (i) => {
|
|
180
|
+
if (g = [
|
|
181
181
|
"resolve",
|
|
182
182
|
i
|
|
183
183
|
], a.isValidElement(i))
|
|
184
|
-
|
|
184
|
+
u = !1, this.create({
|
|
185
185
|
id: s,
|
|
186
186
|
type: "default",
|
|
187
187
|
message: i
|
|
188
188
|
});
|
|
189
189
|
else if (se(i) && !i.ok) {
|
|
190
|
-
|
|
191
|
-
const t = typeof e.error == "function" ? await e.error(`HTTP error! status: ${i.status}`) : e.error,
|
|
190
|
+
u = !1;
|
|
191
|
+
const t = typeof e.error == "function" ? await e.error(`HTTP error! status: ${i.status}`) : e.error, x = typeof e.description == "function" ? await e.description(`HTTP error! status: ${i.status}`) : e.description, E = typeof t == "object" && !a.isValidElement(t) ? t : {
|
|
192
192
|
message: t
|
|
193
193
|
};
|
|
194
194
|
this.create({
|
|
195
195
|
id: s,
|
|
196
196
|
type: "error",
|
|
197
|
-
description:
|
|
198
|
-
...
|
|
197
|
+
description: x,
|
|
198
|
+
...E
|
|
199
199
|
});
|
|
200
200
|
} else if (i instanceof Error) {
|
|
201
|
-
|
|
202
|
-
const t = typeof e.error == "function" ? await e.error(i) : e.error,
|
|
201
|
+
u = !1;
|
|
202
|
+
const t = typeof e.error == "function" ? await e.error(i) : e.error, x = typeof e.description == "function" ? await e.description(i) : e.description, E = typeof t == "object" && !a.isValidElement(t) ? t : {
|
|
203
203
|
message: t
|
|
204
204
|
};
|
|
205
205
|
this.create({
|
|
206
206
|
id: s,
|
|
207
207
|
type: "error",
|
|
208
|
-
description:
|
|
209
|
-
...
|
|
208
|
+
description: x,
|
|
209
|
+
...E
|
|
210
210
|
});
|
|
211
211
|
} else if (e.success !== void 0) {
|
|
212
|
-
|
|
213
|
-
const t = typeof e.success == "function" ? await e.success(i) : e.success,
|
|
212
|
+
u = !1;
|
|
213
|
+
const t = typeof e.success == "function" ? await e.success(i) : e.success, x = typeof e.description == "function" ? await e.description(i) : e.description, E = typeof t == "object" && !a.isValidElement(t) ? t : {
|
|
214
214
|
message: t
|
|
215
215
|
};
|
|
216
216
|
this.create({
|
|
217
217
|
id: s,
|
|
218
218
|
type: "success",
|
|
219
|
-
description:
|
|
220
|
-
...
|
|
219
|
+
description: x,
|
|
220
|
+
...E
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
223
|
}).catch(async (i) => {
|
|
224
|
-
if (
|
|
224
|
+
if (g = [
|
|
225
225
|
"reject",
|
|
226
226
|
i
|
|
227
227
|
], e.error !== void 0) {
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
message:
|
|
228
|
+
u = !1;
|
|
229
|
+
const T = typeof e.error == "function" ? await e.error(i) : e.error, t = typeof e.description == "function" ? await e.description(i) : e.description, O = typeof T == "object" && !a.isValidElement(T) ? T : {
|
|
230
|
+
message: T
|
|
231
231
|
};
|
|
232
232
|
this.create({
|
|
233
233
|
id: s,
|
|
234
234
|
type: "error",
|
|
235
235
|
description: t,
|
|
236
|
-
...
|
|
236
|
+
...O
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
}).finally(() => {
|
|
240
|
-
|
|
241
|
-
}),
|
|
240
|
+
u && (this.dismiss(s), s = void 0), e.finally == null || e.finally.call(e);
|
|
241
|
+
}), b = () => new Promise((i, T) => _.then(() => g[0] === "reject" ? T(g[1]) : i(g[1])).catch(T));
|
|
242
242
|
return typeof s != "string" && typeof s != "number" ? {
|
|
243
|
-
unwrap:
|
|
243
|
+
unwrap: b
|
|
244
244
|
} : Object.assign(s, {
|
|
245
|
-
unwrap:
|
|
245
|
+
unwrap: b
|
|
246
246
|
});
|
|
247
247
|
}, this.custom = (o, e) => {
|
|
248
|
-
const s = e?.id ||
|
|
248
|
+
const s = e?.id || xt++;
|
|
249
249
|
return this.create({
|
|
250
250
|
jsx: o(s),
|
|
251
251
|
id: s,
|
|
@@ -254,33 +254,33 @@ class ae {
|
|
|
254
254
|
}, this.getActiveToasts = () => this.toasts.filter((o) => !this.dismissedToasts.has(o.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
const
|
|
258
|
-
const e = o?.id ||
|
|
259
|
-
return
|
|
257
|
+
const S = new ae(), oe = (r, o) => {
|
|
258
|
+
const e = o?.id || xt++;
|
|
259
|
+
return S.addToast({
|
|
260
260
|
title: r,
|
|
261
261
|
...o,
|
|
262
262
|
id: e
|
|
263
263
|
}), e;
|
|
264
|
-
}, se = (r) => r && typeof r == "object" && "ok" in r && typeof r.ok == "boolean" && "status" in r && typeof r.status == "number", ne = oe, re = () =>
|
|
265
|
-
success:
|
|
266
|
-
info:
|
|
267
|
-
warning:
|
|
268
|
-
error:
|
|
269
|
-
custom:
|
|
270
|
-
message:
|
|
271
|
-
promise:
|
|
272
|
-
dismiss:
|
|
273
|
-
loading:
|
|
264
|
+
}, se = (r) => r && typeof r == "object" && "ok" in r && typeof r.ok == "boolean" && "status" in r && typeof r.status == "number", ne = oe, re = () => S.toasts, ie = () => S.getActiveToasts(), xe = Object.assign(ne, {
|
|
265
|
+
success: S.success,
|
|
266
|
+
info: S.info,
|
|
267
|
+
warning: S.warning,
|
|
268
|
+
error: S.error,
|
|
269
|
+
custom: S.custom,
|
|
270
|
+
message: S.message,
|
|
271
|
+
promise: S.promise,
|
|
272
|
+
dismiss: S.dismiss,
|
|
273
|
+
loading: S.loading
|
|
274
274
|
}, {
|
|
275
275
|
getHistory: re,
|
|
276
276
|
getToasts: ie
|
|
277
277
|
});
|
|
278
278
|
Xt("[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%)}");
|
|
279
|
-
function
|
|
279
|
+
function mt(r) {
|
|
280
280
|
return r.label !== void 0;
|
|
281
281
|
}
|
|
282
|
-
const le = 3, de = "24px", ce = "16px",
|
|
283
|
-
function
|
|
282
|
+
const le = 3, de = "24px", ce = "16px", Mt = 4e3, ue = 356, fe = 14, me = 45, pe = 200;
|
|
283
|
+
function H(...r) {
|
|
284
284
|
return r.filter(Boolean).join(" ");
|
|
285
285
|
}
|
|
286
286
|
function ge(r) {
|
|
@@ -288,251 +288,252 @@ function ge(r) {
|
|
|
288
288
|
return o && s.push(o), e && s.push(e), s;
|
|
289
289
|
}
|
|
290
290
|
const he = (r) => {
|
|
291
|
-
var o, e, s,
|
|
292
|
-
const { invert:
|
|
293
|
-
|
|
291
|
+
var o, e, s, C, u, g, _, b, i;
|
|
292
|
+
const { invert: T, toast: t, unstyled: x, interacting: O, setHeights: E, visibleToasts: pt, heights: U, index: d, toasts: ot, expanded: X, removeToast: st, defaultRichColors: gt, closeButton: z, style: Z, cancelButtonStyle: Y, actionButtonStyle: ht, className: nt = "", descriptionClassName: bt = "", duration: tt, position: A, gap: rt, expandByDefault: et, classNames: c, icons: v, closeButtonAriaLabel: j = "Close toast" } = r, [$, B] = a.useState(null), [F, it] = a.useState(null), [l, p] = a.useState(!1), [m, D] = a.useState(!1), [W, f] = a.useState(!1), [K, lt] = a.useState(!1), [dt, q] = a.useState(!1), [Ct, vt] = a.useState(0), [At, Et] = a.useState(0), at = a.useRef(t.duration || tt || Mt), Tt = a.useRef(null), P = a.useRef(null), Ht = d === 0, Ot = d + 1 <= pt, N = t.type, G = t.dismissible !== !1, zt = t.className || "", Pt = t.descriptionClassName || "", ct = a.useMemo(() => U.findIndex((n) => n.toastId === t.id) || 0, [
|
|
293
|
+
U,
|
|
294
294
|
t.id
|
|
295
295
|
]), jt = a.useMemo(() => {
|
|
296
296
|
var n;
|
|
297
|
-
return (n = t.closeButton) != null ? n :
|
|
297
|
+
return (n = t.closeButton) != null ? n : z;
|
|
298
298
|
}, [
|
|
299
299
|
t.closeButton,
|
|
300
|
-
|
|
301
|
-
]),
|
|
300
|
+
z
|
|
301
|
+
]), St = a.useMemo(() => t.duration || tt || Mt, [
|
|
302
302
|
t.duration,
|
|
303
|
-
|
|
304
|
-
]),
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
]),
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
303
|
+
tt
|
|
304
|
+
]), yt = a.useRef(0), Q = a.useRef(0), Nt = a.useRef(0), J = a.useRef(null), [Lt, Yt] = A.split("-"), kt = a.useMemo(() => U.reduce((n, h, w) => w >= ct ? n : n + h.height, 0), [
|
|
305
|
+
U,
|
|
306
|
+
ct
|
|
307
|
+
]), _t = ee(), $t = t.invert || T, wt = N === "loading";
|
|
308
|
+
Q.current = a.useMemo(() => ct * rt + kt, [
|
|
309
|
+
ct,
|
|
310
|
+
kt
|
|
311
311
|
]), a.useEffect(() => {
|
|
312
|
-
|
|
312
|
+
at.current = St;
|
|
313
313
|
}, [
|
|
314
|
-
|
|
314
|
+
St
|
|
315
315
|
]), a.useEffect(() => {
|
|
316
|
-
|
|
316
|
+
p(!0);
|
|
317
317
|
}, []), a.useEffect(() => {
|
|
318
|
-
const n =
|
|
318
|
+
const n = P.current;
|
|
319
319
|
if (n) {
|
|
320
|
-
const
|
|
321
|
-
return
|
|
320
|
+
const h = n.getBoundingClientRect().height;
|
|
321
|
+
return Et(h), E((w) => [
|
|
322
322
|
{
|
|
323
323
|
toastId: t.id,
|
|
324
|
-
height:
|
|
324
|
+
height: h,
|
|
325
325
|
position: t.position
|
|
326
326
|
},
|
|
327
|
-
...
|
|
328
|
-
]), () =>
|
|
327
|
+
...w
|
|
328
|
+
]), () => E((w) => w.filter((k) => k.toastId !== t.id));
|
|
329
329
|
}
|
|
330
330
|
}, [
|
|
331
|
-
|
|
331
|
+
E,
|
|
332
332
|
t.id
|
|
333
333
|
]), a.useLayoutEffect(() => {
|
|
334
|
-
if (!
|
|
335
|
-
const n =
|
|
334
|
+
if (!l) return;
|
|
335
|
+
const n = P.current, h = n.style.height;
|
|
336
336
|
n.style.height = "auto";
|
|
337
|
-
const
|
|
338
|
-
n.style.height =
|
|
339
|
-
...
|
|
340
|
-
height:
|
|
341
|
-
} :
|
|
337
|
+
const w = n.getBoundingClientRect().height;
|
|
338
|
+
n.style.height = h, Et(w), E((k) => k.find((y) => y.toastId === t.id) ? k.map((y) => y.toastId === t.id ? {
|
|
339
|
+
...y,
|
|
340
|
+
height: w
|
|
341
|
+
} : y) : [
|
|
342
342
|
{
|
|
343
343
|
toastId: t.id,
|
|
344
|
-
height:
|
|
344
|
+
height: w,
|
|
345
345
|
position: t.position
|
|
346
346
|
},
|
|
347
|
-
...
|
|
347
|
+
...k
|
|
348
348
|
]);
|
|
349
349
|
}, [
|
|
350
|
-
|
|
350
|
+
l,
|
|
351
351
|
t.title,
|
|
352
352
|
t.description,
|
|
353
|
-
|
|
353
|
+
E,
|
|
354
354
|
t.id,
|
|
355
355
|
t.jsx,
|
|
356
356
|
t.action,
|
|
357
357
|
t.cancel
|
|
358
358
|
]);
|
|
359
|
-
const
|
|
360
|
-
|
|
361
|
-
|
|
359
|
+
const L = a.useCallback(() => {
|
|
360
|
+
D(!0), vt(Q.current), E((n) => n.filter((h) => h.toastId !== t.id)), setTimeout(() => {
|
|
361
|
+
st(t);
|
|
362
362
|
}, pe);
|
|
363
363
|
}, [
|
|
364
364
|
t,
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
365
|
+
st,
|
|
366
|
+
E,
|
|
367
|
+
Q
|
|
368
368
|
]);
|
|
369
369
|
a.useEffect(() => {
|
|
370
|
-
if (t.promise &&
|
|
370
|
+
if (t.promise && N === "loading" || t.duration === 1 / 0 || t.type === "loading") return;
|
|
371
371
|
let n;
|
|
372
|
-
return
|
|
373
|
-
if (
|
|
374
|
-
const
|
|
375
|
-
|
|
372
|
+
return X || O || _t ? (() => {
|
|
373
|
+
if (Nt.current < yt.current) {
|
|
374
|
+
const k = (/* @__PURE__ */ new Date()).getTime() - yt.current;
|
|
375
|
+
at.current = at.current - k;
|
|
376
376
|
}
|
|
377
|
-
|
|
377
|
+
Nt.current = (/* @__PURE__ */ new Date()).getTime();
|
|
378
378
|
})() : (() => {
|
|
379
|
-
|
|
380
|
-
t.onAutoClose == null || t.onAutoClose.call(t, t),
|
|
381
|
-
},
|
|
379
|
+
at.current !== 1 / 0 && (yt.current = (/* @__PURE__ */ new Date()).getTime(), n = setTimeout(() => {
|
|
380
|
+
t.onAutoClose == null || t.onAutoClose.call(t, t), L();
|
|
381
|
+
}, at.current));
|
|
382
382
|
})(), () => clearTimeout(n);
|
|
383
383
|
}, [
|
|
384
|
-
|
|
385
|
-
|
|
384
|
+
X,
|
|
385
|
+
O,
|
|
386
386
|
t,
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
387
|
+
N,
|
|
388
|
+
_t,
|
|
389
|
+
L
|
|
390
390
|
]), a.useEffect(() => {
|
|
391
|
-
t.delete && (
|
|
391
|
+
t.delete && (L(), t.onDismiss == null || t.onDismiss.call(t, t));
|
|
392
392
|
}, [
|
|
393
|
-
|
|
393
|
+
L,
|
|
394
394
|
t.delete
|
|
395
395
|
]);
|
|
396
396
|
function Ft() {
|
|
397
397
|
var n;
|
|
398
|
-
if (
|
|
399
|
-
var
|
|
398
|
+
if (v?.loading) {
|
|
399
|
+
var h;
|
|
400
400
|
return /* @__PURE__ */ a.createElement("div", {
|
|
401
|
-
className:
|
|
402
|
-
"data-visible":
|
|
403
|
-
},
|
|
401
|
+
className: H(c?.loader, t == null || (h = t.classNames) == null ? void 0 : h.loader, "sonner-loader"),
|
|
402
|
+
"data-visible": N === "loading"
|
|
403
|
+
}, v.loading);
|
|
404
404
|
}
|
|
405
405
|
return /* @__PURE__ */ a.createElement(qt, {
|
|
406
|
-
className:
|
|
407
|
-
visible:
|
|
406
|
+
className: H(c?.loader, t == null || (n = t.classNames) == null ? void 0 : n.loader),
|
|
407
|
+
visible: N === "loading"
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
|
-
const Vt = t.icon ||
|
|
411
|
-
var
|
|
410
|
+
const Vt = t.icon || v?.[N] || Wt(N);
|
|
411
|
+
var Dt, Rt;
|
|
412
412
|
return /* @__PURE__ */ a.createElement("li", {
|
|
413
413
|
tabIndex: 0,
|
|
414
|
-
ref:
|
|
415
|
-
className:
|
|
414
|
+
ref: P,
|
|
415
|
+
className: H(nt, zt, c?.toast, t == null || (o = t.classNames) == null ? void 0 : o.toast, c?.default, c?.[N], t == null || (e = t.classNames) == null ? void 0 : e[N]),
|
|
416
416
|
"data-sonner-toast": "",
|
|
417
|
-
"data-rich-colors": (
|
|
418
|
-
"data-styled": !(t.jsx || t.unstyled ||
|
|
419
|
-
"data-mounted":
|
|
417
|
+
"data-rich-colors": (Dt = t.richColors) != null ? Dt : gt,
|
|
418
|
+
"data-styled": !(t.jsx || t.unstyled || x),
|
|
419
|
+
"data-mounted": l,
|
|
420
420
|
"data-promise": !!t.promise,
|
|
421
|
-
"data-swiped":
|
|
422
|
-
"data-removed":
|
|
421
|
+
"data-swiped": dt,
|
|
422
|
+
"data-removed": m,
|
|
423
423
|
"data-visible": Ot,
|
|
424
424
|
"data-y-position": Lt,
|
|
425
425
|
"data-x-position": Yt,
|
|
426
|
-
"data-index":
|
|
426
|
+
"data-index": d,
|
|
427
427
|
"data-front": Ht,
|
|
428
|
-
"data-swiping":
|
|
429
|
-
"data-dismissible":
|
|
430
|
-
"data-type":
|
|
428
|
+
"data-swiping": W,
|
|
429
|
+
"data-dismissible": G,
|
|
430
|
+
"data-type": N,
|
|
431
431
|
"data-invert": $t,
|
|
432
|
-
"data-swipe-out":
|
|
433
|
-
"data-swipe-direction":
|
|
434
|
-
"data-expanded": !!(
|
|
432
|
+
"data-swipe-out": K,
|
|
433
|
+
"data-swipe-direction": F,
|
|
434
|
+
"data-expanded": !!(X || et && l),
|
|
435
|
+
"data-testid": t.testId,
|
|
435
436
|
style: {
|
|
436
|
-
"--index":
|
|
437
|
-
"--toasts-before":
|
|
438
|
-
"--z-index":
|
|
439
|
-
"--offset": `${
|
|
440
|
-
"--initial-height":
|
|
441
|
-
...
|
|
437
|
+
"--index": d,
|
|
438
|
+
"--toasts-before": d,
|
|
439
|
+
"--z-index": ot.length - d,
|
|
440
|
+
"--offset": `${m ? Ct : Q.current}px`,
|
|
441
|
+
"--initial-height": et ? "auto" : `${At}px`,
|
|
442
|
+
...Z,
|
|
442
443
|
...t.style
|
|
443
444
|
},
|
|
444
445
|
onDragEnd: () => {
|
|
445
|
-
|
|
446
|
+
f(!1), B(null), J.current = null;
|
|
446
447
|
},
|
|
447
448
|
onPointerDown: (n) => {
|
|
448
|
-
|
|
449
|
+
n.button !== 2 && (wt || !G || (Tt.current = /* @__PURE__ */ new Date(), vt(Q.current), n.target.setPointerCapture(n.pointerId), n.target.tagName !== "BUTTON" && (f(!0), J.current = {
|
|
449
450
|
x: n.clientX,
|
|
450
451
|
y: n.clientY
|
|
451
|
-
}));
|
|
452
|
+
})));
|
|
452
453
|
},
|
|
453
454
|
onPointerUp: () => {
|
|
454
|
-
var n,
|
|
455
|
-
if (
|
|
456
|
-
|
|
457
|
-
const
|
|
458
|
-
if (Math.abs(
|
|
459
|
-
|
|
455
|
+
var n, h, w;
|
|
456
|
+
if (K || !G) return;
|
|
457
|
+
J.current = null;
|
|
458
|
+
const k = Number(((n = P.current) == null ? void 0 : n.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), ut = Number(((h = P.current) == null ? void 0 : h.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), y = (/* @__PURE__ */ new Date()).getTime() - ((w = Tt.current) == null ? void 0 : w.getTime()), R = $ === "x" ? k : ut, ft = Math.abs(R) / y;
|
|
459
|
+
if (Math.abs(R) >= me || ft > 0.11) {
|
|
460
|
+
vt(Q.current), t.onDismiss == null || t.onDismiss.call(t, t), it($ === "x" ? k > 0 ? "right" : "left" : ut > 0 ? "down" : "up"), L(), lt(!0);
|
|
460
461
|
return;
|
|
461
462
|
} else {
|
|
462
463
|
var M, I;
|
|
463
|
-
(M =
|
|
464
|
+
(M = P.current) == null || M.style.setProperty("--swipe-amount-x", "0px"), (I = P.current) == null || I.style.setProperty("--swipe-amount-y", "0px");
|
|
464
465
|
}
|
|
465
|
-
|
|
466
|
+
q(!1), f(!1), B(null);
|
|
466
467
|
},
|
|
467
468
|
onPointerMove: (n) => {
|
|
468
|
-
var
|
|
469
|
-
if (!
|
|
470
|
-
const
|
|
471
|
-
var
|
|
472
|
-
const M = (
|
|
473
|
-
|
|
469
|
+
var h, w, k;
|
|
470
|
+
if (!J.current || !G || ((h = window.getSelection()) == null ? void 0 : h.toString().length) > 0) return;
|
|
471
|
+
const y = n.clientY - J.current.y, R = n.clientX - J.current.x;
|
|
472
|
+
var ft;
|
|
473
|
+
const M = (ft = r.swipeDirections) != null ? ft : ge(A);
|
|
474
|
+
!$ && (Math.abs(R) > 1 || Math.abs(y) > 1) && B(Math.abs(R) > Math.abs(y) ? "x" : "y");
|
|
474
475
|
let I = {
|
|
475
476
|
x: 0,
|
|
476
477
|
y: 0
|
|
477
478
|
};
|
|
478
|
-
const
|
|
479
|
-
if (
|
|
479
|
+
const Bt = (V) => 1 / (1.5 + Math.abs(V) / 20);
|
|
480
|
+
if ($ === "y") {
|
|
480
481
|
if (M.includes("top") || M.includes("bottom"))
|
|
481
|
-
if (M.includes("top") &&
|
|
482
|
-
I.y =
|
|
482
|
+
if (M.includes("top") && y < 0 || M.includes("bottom") && y > 0)
|
|
483
|
+
I.y = y;
|
|
483
484
|
else {
|
|
484
|
-
const V =
|
|
485
|
-
I.y = Math.abs(V) < Math.abs(
|
|
485
|
+
const V = y * Bt(y);
|
|
486
|
+
I.y = Math.abs(V) < Math.abs(y) ? V : y;
|
|
486
487
|
}
|
|
487
|
-
} else if (
|
|
488
|
-
if (M.includes("left") &&
|
|
489
|
-
I.x =
|
|
488
|
+
} else if ($ === "x" && (M.includes("left") || M.includes("right")))
|
|
489
|
+
if (M.includes("left") && R < 0 || M.includes("right") && R > 0)
|
|
490
|
+
I.x = R;
|
|
490
491
|
else {
|
|
491
|
-
const V =
|
|
492
|
-
I.x = Math.abs(V) < Math.abs(
|
|
492
|
+
const V = R * Bt(R);
|
|
493
|
+
I.x = Math.abs(V) < Math.abs(R) ? V : R;
|
|
493
494
|
}
|
|
494
|
-
(Math.abs(I.x) > 0 || Math.abs(I.y) > 0) &&
|
|
495
|
+
(Math.abs(I.x) > 0 || Math.abs(I.y) > 0) && q(!0), (w = P.current) == null || w.style.setProperty("--swipe-amount-x", `${I.x}px`), (k = P.current) == null || k.style.setProperty("--swipe-amount-y", `${I.y}px`);
|
|
495
496
|
}
|
|
496
|
-
}, jt && !t.jsx &&
|
|
497
|
-
"aria-label":
|
|
498
|
-
"data-disabled":
|
|
497
|
+
}, jt && !t.jsx && N !== "loading" ? /* @__PURE__ */ a.createElement("button", {
|
|
498
|
+
"aria-label": j,
|
|
499
|
+
"data-disabled": wt,
|
|
499
500
|
"data-close-button": !0,
|
|
500
|
-
onClick:
|
|
501
|
+
onClick: wt || !G ? () => {
|
|
501
502
|
} : () => {
|
|
502
|
-
|
|
503
|
+
L(), t.onDismiss == null || t.onDismiss.call(t, t);
|
|
503
504
|
},
|
|
504
|
-
className:
|
|
505
|
-
}, (
|
|
505
|
+
className: H(c?.closeButton, t == null || (s = t.classNames) == null ? void 0 : s.closeButton)
|
|
506
|
+
}, (Rt = v?.close) != null ? Rt : te) : null, (N || t.icon || t.promise) && t.icon !== null && (v?.[N] !== null || t.icon) ? /* @__PURE__ */ a.createElement("div", {
|
|
506
507
|
"data-icon": "",
|
|
507
|
-
className:
|
|
508
|
+
className: H(c?.icon, t == null || (C = t.classNames) == null ? void 0 : C.icon)
|
|
508
509
|
}, t.promise || t.type === "loading" && !t.icon ? t.icon || Ft() : null, t.type !== "loading" ? Vt : null) : null, /* @__PURE__ */ a.createElement("div", {
|
|
509
510
|
"data-content": "",
|
|
510
|
-
className:
|
|
511
|
+
className: H(c?.content, t == null || (u = t.classNames) == null ? void 0 : u.content)
|
|
511
512
|
}, /* @__PURE__ */ a.createElement("div", {
|
|
512
513
|
"data-title": "",
|
|
513
|
-
className:
|
|
514
|
+
className: H(c?.title, t == null || (g = t.classNames) == null ? void 0 : g.title)
|
|
514
515
|
}, t.jsx ? t.jsx : typeof t.title == "function" ? t.title() : t.title), t.description ? /* @__PURE__ */ a.createElement("div", {
|
|
515
516
|
"data-description": "",
|
|
516
|
-
className:
|
|
517
|
-
}, typeof t.description == "function" ? t.description() : t.description) : null), /* @__PURE__ */ a.isValidElement(t.cancel) ? t.cancel : t.cancel &&
|
|
517
|
+
className: H(bt, Pt, c?.description, t == null || (_ = t.classNames) == null ? void 0 : _.description)
|
|
518
|
+
}, typeof t.description == "function" ? t.description() : t.description) : null), /* @__PURE__ */ a.isValidElement(t.cancel) ? t.cancel : t.cancel && mt(t.cancel) ? /* @__PURE__ */ a.createElement("button", {
|
|
518
519
|
"data-button": !0,
|
|
519
520
|
"data-cancel": !0,
|
|
520
|
-
style: t.cancelButtonStyle ||
|
|
521
|
+
style: t.cancelButtonStyle || Y,
|
|
521
522
|
onClick: (n) => {
|
|
522
|
-
|
|
523
|
+
mt(t.cancel) && G && (t.cancel.onClick == null || t.cancel.onClick.call(t.cancel, n), L());
|
|
523
524
|
},
|
|
524
|
-
className:
|
|
525
|
-
}, t.cancel.label) : null, /* @__PURE__ */ a.isValidElement(t.action) ? t.action : t.action &&
|
|
525
|
+
className: H(c?.cancelButton, t == null || (b = t.classNames) == null ? void 0 : b.cancelButton)
|
|
526
|
+
}, t.cancel.label) : null, /* @__PURE__ */ a.isValidElement(t.action) ? t.action : t.action && mt(t.action) ? /* @__PURE__ */ a.createElement("button", {
|
|
526
527
|
"data-button": !0,
|
|
527
528
|
"data-action": !0,
|
|
528
|
-
style: t.actionButtonStyle ||
|
|
529
|
+
style: t.actionButtonStyle || ht,
|
|
529
530
|
onClick: (n) => {
|
|
530
|
-
|
|
531
|
+
mt(t.action) && (t.action.onClick == null || t.action.onClick.call(t.action, n), !n.defaultPrevented && L());
|
|
531
532
|
},
|
|
532
|
-
className:
|
|
533
|
+
className: H(c?.actionButton, t == null || (i = t.classNames) == null ? void 0 : i.actionButton)
|
|
533
534
|
}, t.action.label) : null);
|
|
534
535
|
};
|
|
535
|
-
function
|
|
536
|
+
function It() {
|
|
536
537
|
if (typeof window > "u" || typeof document > "u") return "ltr";
|
|
537
538
|
const r = document.documentElement.getAttribute("dir");
|
|
538
539
|
return r === "auto" || !r ? window.getComputedStyle(document.documentElement).direction : r;
|
|
@@ -542,196 +543,199 @@ function be(r, o) {
|
|
|
542
543
|
return [
|
|
543
544
|
r,
|
|
544
545
|
o
|
|
545
|
-
].forEach((s,
|
|
546
|
-
const
|
|
547
|
-
function
|
|
546
|
+
].forEach((s, C) => {
|
|
547
|
+
const u = C === 1, g = u ? "--mobile-offset" : "--offset", _ = u ? ce : de;
|
|
548
|
+
function b(i) {
|
|
548
549
|
[
|
|
549
550
|
"top",
|
|
550
551
|
"right",
|
|
551
552
|
"bottom",
|
|
552
553
|
"left"
|
|
553
|
-
].forEach((
|
|
554
|
-
e[`${
|
|
554
|
+
].forEach((T) => {
|
|
555
|
+
e[`${g}-${T}`] = typeof i == "number" ? `${i}px` : i;
|
|
555
556
|
});
|
|
556
557
|
}
|
|
557
|
-
typeof s == "number" || typeof s == "string" ?
|
|
558
|
+
typeof s == "number" || typeof s == "string" ? b(s) : typeof s == "object" ? [
|
|
558
559
|
"top",
|
|
559
560
|
"right",
|
|
560
561
|
"bottom",
|
|
561
562
|
"left"
|
|
562
563
|
].forEach((i) => {
|
|
563
|
-
s[i] === void 0 ? e[`${
|
|
564
|
-
}) :
|
|
564
|
+
s[i] === void 0 ? e[`${g}-${i}`] = _ : e[`${g}-${i}`] = typeof s[i] == "number" ? `${s[i]}px` : s[i];
|
|
565
|
+
}) : b(_);
|
|
565
566
|
}), e;
|
|
566
567
|
}
|
|
567
568
|
const Ee = /* @__PURE__ */ a.forwardRef(function(o, e) {
|
|
568
|
-
const {
|
|
569
|
+
const { id: s, invert: C, position: u = "bottom-right", hotkey: g = [
|
|
569
570
|
"altKey",
|
|
570
571
|
"KeyT"
|
|
571
|
-
], expand:
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
]
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
572
|
+
], expand: _, closeButton: b, className: i, offset: T, mobileOffset: t, theme: x = "light", richColors: O, duration: E, style: pt, visibleToasts: U = le, toastOptions: d, dir: ot = It(), gap: X = fe, icons: st, containerAriaLabel: gt = "Notifications" } = o, [z, Z] = a.useState([]), Y = a.useMemo(() => s ? z.filter((l) => l.toasterId === s) : z.filter((l) => !l.toasterId), [
|
|
573
|
+
z,
|
|
574
|
+
s
|
|
575
|
+
]), ht = a.useMemo(() => Array.from(new Set([
|
|
576
|
+
u
|
|
577
|
+
].concat(Y.filter((l) => l.position).map((l) => l.position)))), [
|
|
578
|
+
Y,
|
|
579
|
+
u
|
|
580
|
+
]), [nt, bt] = a.useState([]), [tt, A] = a.useState(!1), [rt, et] = a.useState(!1), [c, v] = a.useState(x !== "system" ? x : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), j = a.useRef(null), $ = g.join("+").replace(/Key/g, "").replace(/Digit/g, ""), B = a.useRef(null), F = a.useRef(!1), it = a.useCallback((l) => {
|
|
581
|
+
Z((p) => {
|
|
582
|
+
var m;
|
|
583
|
+
return (m = p.find((D) => D.id === l.id)) != null && m.delete || S.dismiss(l.id), p.filter(({ id: D }) => D !== l.id);
|
|
580
584
|
});
|
|
581
585
|
}, []);
|
|
582
|
-
return a.useEffect(() =>
|
|
583
|
-
if (
|
|
586
|
+
return a.useEffect(() => S.subscribe((l) => {
|
|
587
|
+
if (l.dismiss) {
|
|
584
588
|
requestAnimationFrame(() => {
|
|
585
|
-
|
|
586
|
-
...
|
|
589
|
+
Z((p) => p.map((m) => m.id === l.id ? {
|
|
590
|
+
...m,
|
|
587
591
|
delete: !0
|
|
588
|
-
} :
|
|
592
|
+
} : m));
|
|
589
593
|
});
|
|
590
594
|
return;
|
|
591
595
|
}
|
|
592
596
|
setTimeout(() => {
|
|
593
597
|
Ut.flushSync(() => {
|
|
594
|
-
|
|
595
|
-
const
|
|
596
|
-
return
|
|
597
|
-
...
|
|
598
|
+
Z((p) => {
|
|
599
|
+
const m = p.findIndex((D) => D.id === l.id);
|
|
600
|
+
return m !== -1 ? [
|
|
601
|
+
...p.slice(0, m),
|
|
598
602
|
{
|
|
599
|
-
...m
|
|
600
|
-
...
|
|
603
|
+
...p[m],
|
|
604
|
+
...l
|
|
601
605
|
},
|
|
602
|
-
...
|
|
606
|
+
...p.slice(m + 1)
|
|
603
607
|
] : [
|
|
604
|
-
|
|
605
|
-
...
|
|
608
|
+
l,
|
|
609
|
+
...p
|
|
606
610
|
];
|
|
607
611
|
});
|
|
608
612
|
});
|
|
609
613
|
});
|
|
610
614
|
}), [
|
|
611
|
-
|
|
615
|
+
z
|
|
612
616
|
]), a.useEffect(() => {
|
|
613
|
-
if (
|
|
614
|
-
|
|
617
|
+
if (x !== "system") {
|
|
618
|
+
v(x);
|
|
615
619
|
return;
|
|
616
620
|
}
|
|
617
|
-
if (
|
|
618
|
-
const
|
|
621
|
+
if (x === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? v("dark") : v("light")), typeof window > "u") return;
|
|
622
|
+
const l = window.matchMedia("(prefers-color-scheme: dark)");
|
|
619
623
|
try {
|
|
620
|
-
|
|
621
|
-
|
|
624
|
+
l.addEventListener("change", ({ matches: p }) => {
|
|
625
|
+
v(p ? "dark" : "light");
|
|
622
626
|
});
|
|
623
627
|
} catch {
|
|
624
|
-
|
|
628
|
+
l.addListener(({ matches: m }) => {
|
|
625
629
|
try {
|
|
626
|
-
|
|
627
|
-
} catch (
|
|
628
|
-
console.error(
|
|
630
|
+
v(m ? "dark" : "light");
|
|
631
|
+
} catch (D) {
|
|
632
|
+
console.error(D);
|
|
629
633
|
}
|
|
630
634
|
});
|
|
631
635
|
}
|
|
632
636
|
}, [
|
|
633
|
-
|
|
637
|
+
x
|
|
634
638
|
]), a.useEffect(() => {
|
|
635
|
-
|
|
639
|
+
z.length <= 1 && A(!1);
|
|
636
640
|
}, [
|
|
637
|
-
|
|
641
|
+
z
|
|
638
642
|
]), a.useEffect(() => {
|
|
639
|
-
const
|
|
640
|
-
var
|
|
641
|
-
if (
|
|
642
|
-
var
|
|
643
|
-
|
|
643
|
+
const l = (p) => {
|
|
644
|
+
var m;
|
|
645
|
+
if (g.every((f) => p[f] || p.code === f)) {
|
|
646
|
+
var W;
|
|
647
|
+
A(!0), (W = j.current) == null || W.focus();
|
|
644
648
|
}
|
|
645
|
-
|
|
649
|
+
p.code === "Escape" && (document.activeElement === j.current || (m = j.current) != null && m.contains(document.activeElement)) && A(!1);
|
|
646
650
|
};
|
|
647
|
-
return document.addEventListener("keydown",
|
|
651
|
+
return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
|
|
648
652
|
}, [
|
|
649
|
-
|
|
653
|
+
g
|
|
650
654
|
]), a.useEffect(() => {
|
|
651
|
-
if (
|
|
655
|
+
if (j.current)
|
|
652
656
|
return () => {
|
|
653
|
-
|
|
657
|
+
B.current && (B.current.focus({
|
|
654
658
|
preventScroll: !0
|
|
655
|
-
}),
|
|
659
|
+
}), B.current = null, F.current = !1);
|
|
656
660
|
};
|
|
657
661
|
}, [
|
|
658
|
-
|
|
662
|
+
j.current
|
|
659
663
|
]), // Remove item from normal navigation flow, only available via hotkey
|
|
660
664
|
/* @__PURE__ */ a.createElement("section", {
|
|
661
665
|
ref: e,
|
|
662
|
-
"aria-label": `${
|
|
666
|
+
"aria-label": `${gt} ${$}`,
|
|
663
667
|
tabIndex: -1,
|
|
664
668
|
"aria-live": "polite",
|
|
665
669
|
"aria-relevant": "additions text",
|
|
666
670
|
"aria-atomic": "false",
|
|
667
671
|
suppressHydrationWarning: !0
|
|
668
|
-
},
|
|
669
|
-
var
|
|
670
|
-
const [
|
|
671
|
-
return
|
|
672
|
-
key:
|
|
673
|
-
dir:
|
|
672
|
+
}, ht.map((l, p) => {
|
|
673
|
+
var m;
|
|
674
|
+
const [D, W] = l.split("-");
|
|
675
|
+
return Y.length ? /* @__PURE__ */ a.createElement("ol", {
|
|
676
|
+
key: l,
|
|
677
|
+
dir: ot === "auto" ? It() : ot,
|
|
674
678
|
tabIndex: -1,
|
|
675
|
-
ref:
|
|
676
|
-
className:
|
|
679
|
+
ref: j,
|
|
680
|
+
className: i,
|
|
677
681
|
"data-sonner-toaster": !0,
|
|
678
|
-
"data-sonner-theme":
|
|
679
|
-
"data-y-position":
|
|
680
|
-
"data-x-position":
|
|
682
|
+
"data-sonner-theme": c,
|
|
683
|
+
"data-y-position": D,
|
|
684
|
+
"data-x-position": W,
|
|
681
685
|
style: {
|
|
682
|
-
"--front-toast-height": `${((
|
|
686
|
+
"--front-toast-height": `${((m = nt[0]) == null ? void 0 : m.height) || 0}px`,
|
|
683
687
|
"--width": `${ue}px`,
|
|
684
|
-
"--gap": `${
|
|
685
|
-
...
|
|
686
|
-
...be(
|
|
688
|
+
"--gap": `${X}px`,
|
|
689
|
+
...pt,
|
|
690
|
+
...be(T, t)
|
|
687
691
|
},
|
|
688
|
-
onBlur: (
|
|
689
|
-
|
|
692
|
+
onBlur: (f) => {
|
|
693
|
+
F.current && !f.currentTarget.contains(f.relatedTarget) && (F.current = !1, B.current && (B.current.focus({
|
|
690
694
|
preventScroll: !0
|
|
691
|
-
}),
|
|
695
|
+
}), B.current = null));
|
|
692
696
|
},
|
|
693
|
-
onFocus: (
|
|
694
|
-
|
|
697
|
+
onFocus: (f) => {
|
|
698
|
+
f.target instanceof HTMLElement && f.target.dataset.dismissible === "false" || F.current || (F.current = !0, B.current = f.relatedTarget);
|
|
695
699
|
},
|
|
696
|
-
onMouseEnter: () =>
|
|
697
|
-
onMouseMove: () =>
|
|
700
|
+
onMouseEnter: () => A(!0),
|
|
701
|
+
onMouseMove: () => A(!0),
|
|
698
702
|
onMouseLeave: () => {
|
|
699
|
-
|
|
703
|
+
rt || A(!1);
|
|
700
704
|
},
|
|
701
|
-
onDragEnd: () =>
|
|
702
|
-
onPointerDown: (
|
|
703
|
-
|
|
705
|
+
onDragEnd: () => A(!1),
|
|
706
|
+
onPointerDown: (f) => {
|
|
707
|
+
f.target instanceof HTMLElement && f.target.dataset.dismissible === "false" || et(!0);
|
|
704
708
|
},
|
|
705
|
-
onPointerUp: () =>
|
|
706
|
-
},
|
|
707
|
-
var
|
|
709
|
+
onPointerUp: () => et(!1)
|
|
710
|
+
}, Y.filter((f) => !f.position && p === 0 || f.position === l).map((f, K) => {
|
|
711
|
+
var lt, dt;
|
|
708
712
|
return /* @__PURE__ */ a.createElement(he, {
|
|
709
|
-
key:
|
|
710
|
-
icons:
|
|
711
|
-
index:
|
|
712
|
-
toast:
|
|
713
|
-
defaultRichColors:
|
|
714
|
-
duration: (
|
|
715
|
-
className:
|
|
716
|
-
descriptionClassName:
|
|
717
|
-
invert:
|
|
718
|
-
visibleToasts:
|
|
719
|
-
closeButton: (
|
|
720
|
-
interacting:
|
|
721
|
-
position:
|
|
722
|
-
style:
|
|
723
|
-
unstyled:
|
|
724
|
-
classNames:
|
|
725
|
-
cancelButtonStyle:
|
|
726
|
-
actionButtonStyle:
|
|
727
|
-
closeButtonAriaLabel:
|
|
728
|
-
removeToast:
|
|
729
|
-
toasts:
|
|
730
|
-
heights:
|
|
731
|
-
setHeights:
|
|
732
|
-
expandByDefault:
|
|
733
|
-
gap:
|
|
734
|
-
expanded:
|
|
713
|
+
key: f.id,
|
|
714
|
+
icons: st,
|
|
715
|
+
index: K,
|
|
716
|
+
toast: f,
|
|
717
|
+
defaultRichColors: O,
|
|
718
|
+
duration: (lt = d?.duration) != null ? lt : E,
|
|
719
|
+
className: d?.className,
|
|
720
|
+
descriptionClassName: d?.descriptionClassName,
|
|
721
|
+
invert: C,
|
|
722
|
+
visibleToasts: U,
|
|
723
|
+
closeButton: (dt = d?.closeButton) != null ? dt : b,
|
|
724
|
+
interacting: rt,
|
|
725
|
+
position: l,
|
|
726
|
+
style: d?.style,
|
|
727
|
+
unstyled: d?.unstyled,
|
|
728
|
+
classNames: d?.classNames,
|
|
729
|
+
cancelButtonStyle: d?.cancelButtonStyle,
|
|
730
|
+
actionButtonStyle: d?.actionButtonStyle,
|
|
731
|
+
closeButtonAriaLabel: d?.closeButtonAriaLabel,
|
|
732
|
+
removeToast: it,
|
|
733
|
+
toasts: Y.filter((q) => q.position == f.position),
|
|
734
|
+
heights: nt.filter((q) => q.position == f.position),
|
|
735
|
+
setHeights: bt,
|
|
736
|
+
expandByDefault: _,
|
|
737
|
+
gap: X,
|
|
738
|
+
expanded: tt,
|
|
735
739
|
swipeDirections: o.swipeDirections
|
|
736
740
|
});
|
|
737
741
|
})) : null;
|