@feedmepos/mf-brand-app-builder 0.5.22-dev.1 → 0.5.24-dev.0
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/{App-D5eO5srB.js → App-CoIlf_Tr.js} +5 -5
- package/dist/{AssetsSettings-D_E8q7eK.js → AssetsSettings-DhprCc4v.js} +6 -6
- package/dist/{BaDivider-DWZv3fqi.js → BaDivider-Cp9gfB4r.js} +2 -2
- package/dist/{BrandkitView-BlJhBYi6.js → BrandkitView-BHBErfbu.js} +3382 -2867
- package/dist/{BuilderView-Dfl1VhES.js → BuilderView-DY_Clqms.js} +427 -444
- package/dist/{ButtonGroup-D_HkX122.js → ButtonGroup-2ilMTPHH.js} +2 -2
- package/dist/{CircularProgress-h90pbjU3.js → CircularProgress-DdblYCtV.js} +4 -4
- package/dist/ColorPicker-RKWzhLBO.js +543 -0
- package/dist/{ColorPicker-I6CkNIxt.js → ColorPicker-dVFIiu94.js} +14 -14
- package/dist/{Icon.vue_vue_type_style_index_0_lang-CVCHCcWR.js → Icon.vue_vue_type_style_index_0_lang-BcRjQndc.js} +2 -2
- package/dist/{ImageUpload-FyvXrDKK.js → ImageUpload-B8OINKSx.js} +9 -9
- package/dist/{LinkButton-C9OU3Rcs.js → LinkButton-De-YNclu.js} +4 -4
- package/dist/{ListRepeater-BnVoFhhm.js → ListRepeater-rkz-trRq.js} +2 -2
- package/dist/{ManagementSettings-CtvF5d9C.js → ManagementSettings-Cz4HkNm1.js} +4 -4
- package/dist/ProjectView-ByxaVBFb.js +428 -0
- package/dist/{Select-BRYuMWoQ.js → Select-DQx6OfZx.js} +9 -9
- package/dist/{SettingsView-DHA7hXUx.js → SettingsView-uft0uKio.js} +2 -2
- package/dist/{StepperField-BeeZ_sl9.js → StepperField-nyaUK9ht.js} +2 -2
- package/dist/{Switch-8mmNQUDo.js → Switch-uc_zN-mb.js} +2 -2
- package/dist/{TextAlign-BOC8ekaH.js → TextAlign-BSp1Xi7F.js} +2 -2
- package/dist/{TextDecorators-BJC4umDR.js → TextDecorators-1C54q7us.js} +4 -4
- package/dist/{TextField-BiVH5rLX.js → TextField-DfBJB6vQ.js} +2 -2
- package/dist/{TextStyleList-CuPE80Py.js → TextStyleList-Bef3irUx.js} +3 -3
- package/dist/{app-CJ2VgCHp.js → app-pY4HD-TA.js} +6693 -3895
- package/dist/app.js +1 -1
- package/dist/brand-core/src/brandkit.d.ts +5 -0
- package/dist/brand-core/src/entity.d.ts +32 -15
- package/dist/client/components/src/components/BranchList.vue.d.ts +1 -1
- package/dist/client/components/src/components/ButtonList.vue.d.ts +1 -1
- package/dist/client/components/src/components/CountrySwitcher.vue.d.ts +1 -1
- package/dist/client/components/src/components/Homepage.vue.d.ts +3 -3
- package/dist/client/components/src/components/ImageCarousel.vue.d.ts +1 -1
- package/dist/client/components/src/components/ImageDisplay.vue.d.ts +1 -1
- package/dist/client/components/src/components/Member/TransactionList.vue.d.ts +1 -1
- package/dist/client/components/src/components/MemberCard.vue.d.ts +1 -1
- package/dist/client/components/src/components/NavigationBar.vue.d.ts +4 -4
- package/dist/client/components/src/components/OrderHistoryCard.vue.d.ts +4 -3
- package/dist/client/components/src/components/OrderMethod.vue.d.ts +1 -1
- package/dist/client/components/src/components/TextDisplay.vue.d.ts +1 -1
- package/dist/client/components/src/components/atoms/Button.vue.d.ts +4 -4
- package/dist/client/components/src/components/atoms/CircularProgress.vue.d.ts +2 -2
- package/dist/client/components/src/components/atoms/Container.vue.d.ts +3 -3
- package/dist/client/components/src/components/atoms/Divider.vue.d.ts +1 -1
- package/dist/client/components/src/components/atoms/Icon.vue.d.ts +1 -1
- package/dist/client/components/src/components/atoms/LinkSlot.vue.d.ts +4 -4
- package/dist/client/components/src/views/OrderDetails.vue.d.ts +1 -1
- package/dist/client/components/src/views/_Credit.vue.d.ts +1 -1
- package/dist/client/components/src/views/_MemberProfile.vue.d.ts +4 -4
- package/dist/client/components/src/views/_Point.vue.d.ts +1 -1
- package/dist/client/components/src/views/_Referral.vue.d.ts +4 -4
- package/dist/client/components/src/views/_ReferralTutorial.vue.d.ts +4 -4
- package/dist/client/merchant/src/api/business/index.d.ts +41 -1
- package/dist/client/merchant/src/app.d.ts +2794 -0
- package/dist/client/merchant/src/components/atoms/BaButtonGroup.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/atoms/BaDivider.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/brandkit/ColorOverrideDialog.vue.d.ts +26 -0
- package/dist/client/merchant/src/components/brandkit/ColorSelection.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/editor/Editor.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/editor/EditorFloatingToobar.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/editor/toolbar/EditorToolbar.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/element-sidebar/ElementSidebar.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/inputs/ColorPicker.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/inputs/ImageUpload.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/inputs/TextAlign.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/inputs/TextDecorators.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/inputs/TextStyleList.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/inspector/Inspector.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/inspector/atoms/ConfigSection.vue.d.ts +3 -3
- package/dist/client/merchant/src/components/inspector/atoms/ConfigTab.vue.d.ts +3 -3
- package/dist/client/merchant/src/components/inspector/atoms/ConfigTabItem.vue.d.ts +3 -3
- package/dist/client/merchant/src/components/inspector/atoms/ConfigTabTitle.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/navigation-sidebar/NavigationSidebar.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/order-template/LayoutTemplateSection.vue.d.ts +3 -3
- package/dist/client/merchant/src/components/order-template/OrderTemplateEditorButton.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/order-template/OrderTemplateEditorForm.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/order-template/TemplateVersionHistory.vue.d.ts +18 -0
- package/dist/client/merchant/src/components/settings/AssetsSettings.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/settings/ManagementSettings.vue.d.ts +1 -1
- package/dist/client/merchant/src/components/template/TemplatePreview.vue.d.ts +1 -1
- package/dist/client/merchant/src/stores/business/index.d.ts +469 -1
- package/dist/client/merchant/src/views/BrandkitView.vue.d.ts +1 -1
- package/dist/client/merchant/src/views/BuilderView.vue.d.ts +1 -1
- package/dist/client/merchant/src/views/ProjectView.vue.d.ts +1 -1
- package/dist/client/merchant/src/views/SettingsView.vue.d.ts +1 -1
- package/dist/dayjs.min-DnbY0e60.js +282 -0
- package/dist/{image-BtHlnsmY.js → image-D_Djf1PS.js} +1 -1
- package/dist/{index-ChMgx2Hq.js → index-Bk6TOZrx.js} +2 -2
- package/dist/{index-5BRydZO9.js → index-C1rSMuKA.js} +1 -1
- package/dist/index-C4vwWvn_.js +112 -0
- package/dist/index-D0LOMBBD.js +1822 -0
- package/dist/{main-8cObQmGm.js → main-CKhW2ogv.js} +3536 -3547
- package/dist/package.json +5 -4
- package/dist/style.css +1 -1
- package/dist/{v4-ANoOI1Qw.js → v4-CKwdnpQf.js} +8 -8
- package/dist/{vue-sonner-PX6Req0V.js → vue-sonner-CBFYmm8_.js} +129 -125
- package/package.json +5 -4
- package/dist/ColorPicker-CHzKbuCD.js +0 -543
- package/dist/ProjectView-Bq0vBJ3V.js +0 -705
- package/dist/index-BEAkOquM.js +0 -90
- package/dist/index-BXwbQwb-.js +0 -1736
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { defineComponent as yt, useAttrs as Jt, ref as p, computed as g, watchEffect as K, nextTick as Qt, watch as Ft, openBlock as d,
|
|
1
|
+
import { defineComponent as yt, useAttrs as Jt, ref as p, computed as g, createElementBlock as v, watchEffect as K, nextTick as Qt, watch as Ft, openBlock as d, unref as j, Fragment as N, renderList as gt, mergeProps as ut, createBlock as F, normalizeStyle as pt, normalizeClass as D, withCtx as V, renderSlot as E, createVNode as U, onMounted as _t, onBeforeUnmount as Xt, createCommentVNode as W, resolveDynamicComponent as Z, createElementVNode as L, normalizeProps as Rt, createTextVNode as Vt, toDisplayString as dt } from "vue";
|
|
2
2
|
var Zt = Object.defineProperty, te = (s, a, t) => a in s ? Zt(s, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[a] = t, k = (s, a, t) => te(s, typeof a != "symbol" ? a + "" : a, t);
|
|
3
3
|
function ee(s) {
|
|
4
4
|
if (typeof document > "u") return;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
function a() {
|
|
6
|
+
let t = document.head || document.getElementsByTagName("head")[0];
|
|
7
|
+
if (!t) return;
|
|
8
|
+
let n = document.createElement("style");
|
|
9
|
+
n.type = "text/css", t.appendChild(n), n.styleSheet ? n.styleSheet.cssText = s : n.appendChild(document.createTextNode(s));
|
|
10
|
+
}
|
|
11
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", a) : a();
|
|
7
12
|
}
|
|
8
13
|
ee(":where([data-sonner-toaster][dir=ltr]),:where(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%)}:where([data-sonner-toaster][dir=rtl]),:where(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%)}: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:0;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted=true]){transform:translateY(-10px)}@media (hover:none) and (pointer:coarse){:where([data-sonner-toaster][data-lifted=true]){transform:none}}:where([data-sonner-toaster][data-x-position=right]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position=left]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position=center]){left:50%;transform:translateX(-50%)}:where([data-sonner-toaster][data-y-position=top]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position=bottom]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;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 rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}: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:0;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 rgba(0,0,0,.4)}: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)}[data-sonner-toast] [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 rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}:where([data-sonner-toast]) :where([data-disabled=true]){cursor:not-allowed}[data-sonner-toast]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping=true])::before{content:'';position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position=top][data-swiping=true])::before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position=bottom][data-swiping=true])::before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping=false][data-removed=true])::before{content:'';position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast])::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted=true]){--y:translateY(0);opacity:1}:where([data-sonner-toast][data-expanded=false][data-front=false]){--scale:var(--toasts-before) * 0.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,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:swipe-out .2s ease-out forwards}@keyframes swipe-out{from{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;--mobile-offset:16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 91%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 91%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 91%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 100%, 12%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 12%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success]{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%)}");
|
|
9
14
|
let mt = 0;
|
|
@@ -18,23 +23,23 @@ class ae {
|
|
|
18
23
|
this.publish(a), this.toasts = [...this.toasts, a];
|
|
19
24
|
}), k(this, "create", (a) => {
|
|
20
25
|
var t;
|
|
21
|
-
const { message:
|
|
22
|
-
return T ? this.toasts = this.toasts.map((h) => h.id === y ? (this.publish({ ...h, ...a, id: y, title:
|
|
26
|
+
const { message: n, ...l } = a, y = typeof a.id == "number" || a.id && ((t = a.id) == null ? void 0 : t.length) > 0 ? a.id : mt++, T = this.toasts.find((h) => h.id === y), z = a.dismissible === void 0 ? !0 : a.dismissible;
|
|
27
|
+
return T ? this.toasts = this.toasts.map((h) => h.id === y ? (this.publish({ ...h, ...a, id: y, title: n }), {
|
|
23
28
|
...h,
|
|
24
29
|
...a,
|
|
25
30
|
id: y,
|
|
26
31
|
dismissible: z,
|
|
27
|
-
title:
|
|
28
|
-
}) : h) : this.addToast({ title:
|
|
32
|
+
title: n
|
|
33
|
+
}) : h) : this.addToast({ title: n, ...l, dismissible: z, id: y }), y;
|
|
29
34
|
}), k(this, "dismiss", (a) => (a || this.toasts.forEach((t) => {
|
|
30
35
|
this.subscribers.forEach(
|
|
31
|
-
(
|
|
36
|
+
(n) => n({ id: t.id, dismiss: !0 })
|
|
32
37
|
);
|
|
33
38
|
}), this.subscribers.forEach((t) => t({ id: a, dismiss: !0 })), a)), k(this, "message", (a, t) => this.create({ ...t, message: a, type: "default" })), k(this, "error", (a, t) => this.create({ ...t, type: "error", message: a })), k(this, "success", (a, t) => this.create({ ...t, type: "success", message: a })), k(this, "info", (a, t) => this.create({ ...t, type: "info", message: a })), k(this, "warning", (a, t) => this.create({ ...t, type: "warning", message: a })), k(this, "loading", (a, t) => this.create({ ...t, type: "loading", message: a })), k(this, "promise", (a, t) => {
|
|
34
39
|
if (!t)
|
|
35
40
|
return;
|
|
36
|
-
let
|
|
37
|
-
t.loading !== void 0 && (
|
|
41
|
+
let n;
|
|
42
|
+
t.loading !== void 0 && (n = this.create({
|
|
38
43
|
...t,
|
|
39
44
|
promise: a,
|
|
40
45
|
type: "loading",
|
|
@@ -42,7 +47,7 @@ class ae {
|
|
|
42
47
|
description: typeof t.description != "function" ? t.description : void 0
|
|
43
48
|
}));
|
|
44
49
|
const l = a instanceof Promise ? a : a();
|
|
45
|
-
let y =
|
|
50
|
+
let y = n !== void 0, T;
|
|
46
51
|
const z = l.then(async (c) => {
|
|
47
52
|
if (T = ["resolve", c], se(c) && !c.ok) {
|
|
48
53
|
y = !1;
|
|
@@ -52,11 +57,11 @@ class ae {
|
|
|
52
57
|
// @ts-expect-error
|
|
53
58
|
await t.description(`HTTP error! status: ${c.status}`)
|
|
54
59
|
) : t.description;
|
|
55
|
-
this.create({ id:
|
|
60
|
+
this.create({ id: n, type: "error", message: f, description: b });
|
|
56
61
|
} else if (t.success !== void 0) {
|
|
57
62
|
y = !1;
|
|
58
63
|
const f = typeof t.success == "function" ? await t.success(c) : t.success, b = typeof t.description == "function" ? await t.description(c) : t.description;
|
|
59
|
-
this.create({ id:
|
|
64
|
+
this.create({ id: n, type: "success", message: f, description: b });
|
|
60
65
|
}
|
|
61
66
|
}).catch(async (c) => {
|
|
62
67
|
if (T = ["reject", c], t.error !== void 0) {
|
|
@@ -64,20 +69,20 @@ class ae {
|
|
|
64
69
|
const f = typeof t.error == "function" ? await t.error(c) : t.error, b = typeof t.description == "function" ? await t.description(
|
|
65
70
|
c
|
|
66
71
|
) : t.description;
|
|
67
|
-
this.create({ id:
|
|
72
|
+
this.create({ id: n, type: "error", message: f, description: b });
|
|
68
73
|
}
|
|
69
74
|
}).finally(() => {
|
|
70
75
|
var c;
|
|
71
|
-
y && (this.dismiss(
|
|
76
|
+
y && (this.dismiss(n), n = void 0), (c = t.finally) == null || c.call(t);
|
|
72
77
|
}), h = () => new Promise(
|
|
73
78
|
(c, f) => z.then(
|
|
74
79
|
() => T[0] === "reject" ? f(T[1]) : c(T[1])
|
|
75
80
|
).catch(f)
|
|
76
81
|
);
|
|
77
|
-
return typeof
|
|
82
|
+
return typeof n != "string" && typeof n != "number" ? { unwrap: h } : Object.assign(n, { unwrap: h });
|
|
78
83
|
}), k(this, "custom", (a, t) => {
|
|
79
|
-
const
|
|
80
|
-
return this.publish({ component: a, id:
|
|
84
|
+
const n = (t == null ? void 0 : t.id) || mt++;
|
|
85
|
+
return this.publish({ component: a, id: n, ...t }), n;
|
|
81
86
|
}), this.subscribers = [], this.toasts = [];
|
|
82
87
|
}
|
|
83
88
|
}
|
|
@@ -91,7 +96,7 @@ function oe(s, a) {
|
|
|
91
96
|
...a
|
|
92
97
|
}), t;
|
|
93
98
|
}
|
|
94
|
-
const se = (s) => s && typeof s == "object" && "ok" in s && typeof s.ok == "boolean" && "status" in s && typeof s.status == "number", ne = oe, re = () => $.toasts,
|
|
99
|
+
const se = (s) => s && typeof s == "object" && "ok" in s && typeof s.ok == "boolean" && "status" in s && typeof s.status == "number", ne = oe, re = () => $.toasts, Ue = Object.assign(
|
|
95
100
|
ne,
|
|
96
101
|
{
|
|
97
102
|
success: $.success,
|
|
@@ -122,7 +127,7 @@ function ie() {
|
|
|
122
127
|
isDocumentHidden: s
|
|
123
128
|
};
|
|
124
129
|
}
|
|
125
|
-
const le = ["aria-live", "data-rich-colors", "data-styled", "data-mounted", "data-promise", "data-removed", "data-visible", "data-y-position", "data-x-position", "data-index", "data-front", "data-swiping", "data-dismissible", "data-type", "data-invert", "data-swipe-out", "data-expanded"], de = ["aria-label", "data-disabled"],
|
|
130
|
+
const le = ["aria-live", "data-rich-colors", "data-styled", "data-mounted", "data-promise", "data-removed", "data-visible", "data-y-position", "data-x-position", "data-index", "data-front", "data-swiping", "data-dismissible", "data-type", "data-invert", "data-swipe-out", "data-expanded"], de = ["aria-label", "data-disabled"], Ut = 4e3, ce = 20, ue = 200, pe = /* @__PURE__ */ yt({
|
|
126
131
|
__name: "Toast",
|
|
127
132
|
props: {
|
|
128
133
|
toast: {},
|
|
@@ -154,17 +159,17 @@ const le = ["aria-live", "data-rich-colors", "data-styled", "data-mounted", "dat
|
|
|
154
159
|
},
|
|
155
160
|
emits: ["update:heights", "removeToast"],
|
|
156
161
|
setup(s, { emit: a }) {
|
|
157
|
-
const t = s,
|
|
158
|
-
t.toast.duration || t.duration ||
|
|
159
|
-
), I = p(null), B = p(null), vt = g(() => t.index === 0), ht = g(() => t.index + 1 <= t.visibleToasts), S = g(() => t.toast.type),
|
|
162
|
+
const t = s, n = a, l = p(!1), y = p(!1), T = p(!1), z = p(!1), h = p(!1), c = p(0), f = p(0), b = p(
|
|
163
|
+
t.toast.duration || t.duration || Ut
|
|
164
|
+
), I = p(null), B = p(null), vt = g(() => t.index === 0), ht = g(() => t.index + 1 <= t.visibleToasts), S = g(() => t.toast.type), O = g(() => t.toast.dismissible !== !1), ft = g(() => t.toast.class || ""), o = g(() => t.descriptionClass || ""), r = t.toast.style || {}, i = g(
|
|
160
165
|
() => t.heights.findIndex((e) => e.toastId === t.toast.id) || 0
|
|
161
166
|
), w = g(() => t.toast.closeButton ?? t.closeButton);
|
|
162
167
|
g(
|
|
163
|
-
() => t.toast.duration || t.duration ||
|
|
168
|
+
() => t.toast.duration || t.duration || Ut
|
|
164
169
|
);
|
|
165
170
|
const P = p(0), Y = p(0), A = p(null), q = g(() => t.position.split("-")), G = g(() => q.value[0]), et = g(() => q.value[1]), at = g(() => typeof t.toast.title != "string"), ot = g(
|
|
166
171
|
() => typeof t.toast.description != "string"
|
|
167
|
-
), st = g(() => t.heights.reduce((e, u, x) => x >=
|
|
172
|
+
), st = g(() => t.heights.reduce((e, u, x) => x >= i.value ? e : e + u.height, 0)), nt = ie(), rt = g(() => t.toast.invert || t.invert), _ = g(() => S.value === "loading"), H = g(() => i.value * t.gap + st.value || 0);
|
|
168
173
|
_t(() => {
|
|
169
174
|
if (!l.value) return;
|
|
170
175
|
const e = B.value, u = e == null ? void 0 : e.style.height;
|
|
@@ -183,42 +188,42 @@ const le = ["aria-live", "data-rich-colors", "data-styled", "data-mounted", "dat
|
|
|
183
188
|
position: t.toast.position
|
|
184
189
|
},
|
|
185
190
|
...t.heights
|
|
186
|
-
],
|
|
191
|
+
], n("update:heights", C);
|
|
187
192
|
});
|
|
188
|
-
function
|
|
193
|
+
function R() {
|
|
189
194
|
y.value = !0, c.value = H.value;
|
|
190
195
|
const e = t.heights.filter(
|
|
191
196
|
(u) => u.toastId !== t.toast.id
|
|
192
197
|
);
|
|
193
|
-
|
|
194
|
-
|
|
198
|
+
n("update:heights", e), setTimeout(() => {
|
|
199
|
+
n("removeToast", t.toast);
|
|
195
200
|
}, ue);
|
|
196
201
|
}
|
|
197
202
|
function bt() {
|
|
198
203
|
var e, u;
|
|
199
|
-
if (
|
|
204
|
+
if (_.value || !O.value)
|
|
200
205
|
return {};
|
|
201
|
-
|
|
206
|
+
R(), (u = (e = t.toast).onDismiss) == null || u.call(e, t.toast);
|
|
202
207
|
}
|
|
203
208
|
function Kt(e) {
|
|
204
|
-
|
|
209
|
+
_.value || !O.value || (I.value = /* @__PURE__ */ new Date(), c.value = H.value, e.target.setPointerCapture(e.pointerId), e.target.tagName !== "BUTTON" && (T.value = !0, A.value = { x: e.clientX, y: e.clientY }));
|
|
205
210
|
}
|
|
206
211
|
function qt() {
|
|
207
212
|
var e, u, x, C, m;
|
|
208
|
-
if (z.value || !
|
|
213
|
+
if (z.value || !O) return;
|
|
209
214
|
A.value = null;
|
|
210
215
|
const M = Number(
|
|
211
216
|
((e = B.value) == null ? void 0 : e.style.getPropertyValue("--swipe-amount").replace("px", "")) || 0
|
|
212
217
|
), it = (/* @__PURE__ */ new Date()).getTime() - ((u = I.value) == null ? void 0 : u.getTime()), lt = Math.abs(M) / it;
|
|
213
218
|
if (Math.abs(M) >= ce || lt > 0.11) {
|
|
214
|
-
c.value = H.value, (C = (x = t.toast).onDismiss) == null || C.call(x, t.toast),
|
|
219
|
+
c.value = H.value, (C = (x = t.toast).onDismiss) == null || C.call(x, t.toast), R(), z.value = !0, h.value = !1;
|
|
215
220
|
return;
|
|
216
221
|
}
|
|
217
222
|
(m = B.value) == null || m.style.setProperty("--swipe-amount", "0px"), T.value = !1;
|
|
218
223
|
}
|
|
219
224
|
function Gt(e) {
|
|
220
225
|
var u, x;
|
|
221
|
-
if (!A.value || !
|
|
226
|
+
if (!A.value || !O.value) return;
|
|
222
227
|
const C = e.clientY - A.value.y, m = ((u = window.getSelection()) == null ? void 0 : u.toString().length) > 0, M = G.value === "top" ? Math.min(0, C) : Math.max(0, C);
|
|
223
228
|
Math.abs(M) > 0 && (h.value = !0), !m && ((x = B.value) == null || x.style.setProperty("--swipe-amount", `${M}px`));
|
|
224
229
|
}
|
|
@@ -235,7 +240,7 @@ const le = ["aria-live", "data-rich-colors", "data-styled", "data-mounted", "dat
|
|
|
235
240
|
}, C = () => {
|
|
236
241
|
b.value !== 1 / 0 && (P.value = (/* @__PURE__ */ new Date()).getTime(), u = setTimeout(() => {
|
|
237
242
|
var m, M;
|
|
238
|
-
(M = (m = t.toast).onAutoClose) == null || M.call(m, t.toast),
|
|
243
|
+
(M = (m = t.toast).onAutoClose) == null || M.call(m, t.toast), R();
|
|
239
244
|
}, b.value));
|
|
240
245
|
};
|
|
241
246
|
t.expanded || t.interacting || t.pauseWhenPageIsHidden && nt ? x() : C(), e(() => {
|
|
@@ -244,7 +249,7 @@ const le = ["aria-live", "data-rich-colors", "data-styled", "data-mounted", "dat
|
|
|
244
249
|
}), Ft(
|
|
245
250
|
() => t.toast.delete,
|
|
246
251
|
() => {
|
|
247
|
-
t.toast.delete &&
|
|
252
|
+
t.toast.delete && R();
|
|
248
253
|
},
|
|
249
254
|
{
|
|
250
255
|
deep: !0
|
|
@@ -257,17 +262,17 @@ const le = ["aria-live", "data-rich-colors", "data-styled", "data-mounted", "dat
|
|
|
257
262
|
{ toastId: t.toast.id, height: e, position: t.toast.position },
|
|
258
263
|
...t.heights
|
|
259
264
|
];
|
|
260
|
-
|
|
265
|
+
n("update:heights", u);
|
|
261
266
|
}
|
|
262
267
|
}), Xt(() => {
|
|
263
268
|
if (B.value) {
|
|
264
269
|
const e = t.heights.filter(
|
|
265
270
|
(u) => u.toastId !== t.toast.id
|
|
266
271
|
);
|
|
267
|
-
|
|
272
|
+
n("update:heights", e);
|
|
268
273
|
}
|
|
269
274
|
}), (e, u) => {
|
|
270
|
-
var x, C, m, M, it, lt, wt, xt, kt, Bt, Ct, Tt, St, Pt, $t, zt, Et, Mt, It, Yt, Ht, At, Dt,
|
|
275
|
+
var x, C, m, M, it, lt, wt, xt, kt, Bt, Ct, Tt, St, Pt, $t, zt, Et, Mt, It, Yt, Ht, At, Dt, Lt, Ot, jt, Nt;
|
|
271
276
|
return d(), v("li", {
|
|
272
277
|
ref_key: "toastRef",
|
|
273
278
|
ref: B,
|
|
@@ -299,7 +304,7 @@ const le = ["aria-live", "data-rich-colors", "data-styled", "data-mounted", "dat
|
|
|
299
304
|
"data-index": e.index,
|
|
300
305
|
"data-front": vt.value,
|
|
301
306
|
"data-swiping": T.value,
|
|
302
|
-
"data-dismissible":
|
|
307
|
+
"data-dismissible": O.value,
|
|
303
308
|
"data-type": S.value,
|
|
304
309
|
"data-invert": rt.value,
|
|
305
310
|
"data-swipe-out": z.value,
|
|
@@ -311,7 +316,7 @@ const le = ["aria-live", "data-rich-colors", "data-styled", "data-mounted", "dat
|
|
|
311
316
|
"--offset": `${y.value ? c.value : H.value}px`,
|
|
312
317
|
"--initial-height": e.expandByDefault ? "auto" : `${f.value}px`,
|
|
313
318
|
...e.style,
|
|
314
|
-
...j(
|
|
319
|
+
...j(r)
|
|
315
320
|
}),
|
|
316
321
|
onPointerdown: Kt,
|
|
317
322
|
onPointerup: qt,
|
|
@@ -320,33 +325,32 @@ const le = ["aria-live", "data-rich-colors", "data-styled", "data-mounted", "dat
|
|
|
320
325
|
w.value && !e.toast.component ? (d(), v("button", {
|
|
321
326
|
key: 0,
|
|
322
327
|
"aria-label": e.closeButtonAriaLabel || "Close toast",
|
|
323
|
-
"data-disabled":
|
|
328
|
+
"data-disabled": _.value,
|
|
324
329
|
"data-close-button": "true",
|
|
325
330
|
class: D(e.cn((wt = e.classes) == null ? void 0 : wt.closeButton, (kt = (xt = e.toast) == null ? void 0 : xt.classes) == null ? void 0 : kt.closeButton)),
|
|
326
331
|
onClick: bt
|
|
327
332
|
}, [
|
|
328
333
|
(Bt = e.icons) != null && Bt.close ? (d(), F(Z((Ct = e.icons) == null ? void 0 : Ct.close), { key: 0 })) : E(e.$slots, "close-icon", { key: 1 })
|
|
329
|
-
], 10, de)) :
|
|
330
|
-
e.toast.component ? (d(), F(Z(e.toast.component), ut({ key: 1 }, e.toast.componentProps, { onCloseToast: bt }), null, 16)) : (d(), v(
|
|
334
|
+
], 10, de)) : W("", !0),
|
|
335
|
+
e.toast.component ? (d(), F(Z(e.toast.component), ut({ key: 1 }, e.toast.componentProps, { onCloseToast: bt }), null, 16)) : (d(), v(N, { key: 2 }, [
|
|
331
336
|
S.value !== "default" || e.toast.icon || e.toast.promise ? (d(), v("div", {
|
|
332
337
|
key: 0,
|
|
333
338
|
"data-icon": "",
|
|
334
339
|
class: D(e.cn((Tt = e.classes) == null ? void 0 : Tt.icon, (Pt = (St = e.toast) == null ? void 0 : St.classes) == null ? void 0 : Pt.icon))
|
|
335
340
|
}, [
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
S.value === "success" ? E(e.$slots, "success-icon", { key: 0 }) : S.value === "error" ? E(e.$slots, "error-icon", { key: 1 }) : S.value === "warning" ? E(e.$slots, "warning-icon", { key: 2 }) : S.value === "info" ? E(e.$slots, "info-icon", { key: 3 }) : N("", !0)
|
|
341
|
+
e.toast.icon ? (d(), F(Z(e.toast.icon), { key: 0 })) : (d(), v(N, { key: 1 }, [
|
|
342
|
+
S.value === "loading" ? E(e.$slots, "loading-icon", { key: 0 }) : S.value === "success" ? E(e.$slots, "success-icon", { key: 1 }) : S.value === "error" ? E(e.$slots, "error-icon", { key: 2 }) : S.value === "warning" ? E(e.$slots, "warning-icon", { key: 3 }) : S.value === "info" ? E(e.$slots, "info-icon", { key: 4 }) : W("", !0)
|
|
339
343
|
], 64))
|
|
340
|
-
], 2)) :
|
|
341
|
-
|
|
344
|
+
], 2)) : W("", !0),
|
|
345
|
+
L("div", {
|
|
342
346
|
"data-content": "",
|
|
343
347
|
class: D(e.cn(($t = e.classes) == null ? void 0 : $t.content, (Et = (zt = e.toast) == null ? void 0 : zt.classes) == null ? void 0 : Et.content))
|
|
344
348
|
}, [
|
|
345
|
-
|
|
349
|
+
L("div", {
|
|
346
350
|
"data-title": "",
|
|
347
351
|
class: D(e.cn((Mt = e.classes) == null ? void 0 : Mt.title, (It = e.toast.classes) == null ? void 0 : It.title))
|
|
348
352
|
}, [
|
|
349
|
-
at.value ? (d(), F(Z(e.toast.title), Rt(ut({ key: 0 }, e.toast.componentProps)), null, 16)) : (d(), v(
|
|
353
|
+
at.value ? (d(), F(Z(e.toast.title), Rt(ut({ key: 0 }, e.toast.componentProps)), null, 16)) : (d(), v(N, { key: 1 }, [
|
|
350
354
|
Vt(dt(e.toast.title), 1)
|
|
351
355
|
], 64))
|
|
352
356
|
], 2),
|
|
@@ -362,10 +366,10 @@ const le = ["aria-live", "data-rich-colors", "data-styled", "data-mounted", "dat
|
|
|
362
366
|
)
|
|
363
367
|
)
|
|
364
368
|
}, [
|
|
365
|
-
ot.value ? (d(), F(Z(e.toast.description), Rt(ut({ key: 0 }, e.toast.componentProps)), null, 16)) : (d(), v(
|
|
369
|
+
ot.value ? (d(), F(Z(e.toast.description), Rt(ut({ key: 0 }, e.toast.componentProps)), null, 16)) : (d(), v(N, { key: 1 }, [
|
|
366
370
|
Vt(dt(e.toast.description), 1)
|
|
367
371
|
], 64))
|
|
368
|
-
], 2)) :
|
|
372
|
+
], 2)) : W("", !0)
|
|
369
373
|
], 2),
|
|
370
374
|
e.toast.cancel ? (d(), v("button", {
|
|
371
375
|
key: 1,
|
|
@@ -375,28 +379,28 @@ const le = ["aria-live", "data-rich-colors", "data-styled", "data-mounted", "dat
|
|
|
375
379
|
"data-cancel": "",
|
|
376
380
|
onClick: u[0] || (u[0] = (J) => {
|
|
377
381
|
var Q, X;
|
|
378
|
-
j(ct)(e.toast.cancel) &&
|
|
382
|
+
j(ct)(e.toast.cancel) && O.value && ((X = (Q = e.toast.cancel).onClick) == null || X.call(Q, J), R());
|
|
379
383
|
})
|
|
380
|
-
}, dt(j(ct)(e.toast.cancel) ? (
|
|
384
|
+
}, dt(j(ct)(e.toast.cancel) ? (Lt = e.toast.cancel) == null ? void 0 : Lt.label : e.toast.cancel), 7)) : W("", !0),
|
|
381
385
|
e.toast.action ? (d(), v("button", {
|
|
382
386
|
key: 2,
|
|
383
387
|
style: pt(e.toast.actionButtonStyle || e.actionButtonStyle),
|
|
384
|
-
class: D(e.cn((
|
|
388
|
+
class: D(e.cn((Ot = e.classes) == null ? void 0 : Ot.actionButton, (jt = e.toast.classes) == null ? void 0 : jt.actionButton)),
|
|
385
389
|
"data-button": "",
|
|
386
390
|
"data-action": "",
|
|
387
391
|
onClick: u[1] || (u[1] = (J) => {
|
|
388
392
|
var Q, X;
|
|
389
|
-
j(ct)(e.toast.action) && (J.defaultPrevented || ((X = (Q = e.toast.action).onClick) == null || X.call(Q, J), !J.defaultPrevented &&
|
|
393
|
+
j(ct)(e.toast.action) && (J.defaultPrevented || ((X = (Q = e.toast.action).onClick) == null || X.call(Q, J), !J.defaultPrevented && R()));
|
|
390
394
|
})
|
|
391
|
-
}, dt(j(ct)(e.toast.action) ? (Nt = e.toast.action) == null ? void 0 : Nt.label : e.toast.action), 7)) :
|
|
395
|
+
}, dt(j(ct)(e.toast.action) ? (Nt = e.toast.action) == null ? void 0 : Nt.label : e.toast.action), 7)) : W("", !0)
|
|
392
396
|
], 64))
|
|
393
397
|
], 46, le);
|
|
394
398
|
};
|
|
395
399
|
}
|
|
396
400
|
}), tt = (s, a) => {
|
|
397
401
|
const t = s.__vccOpts || s;
|
|
398
|
-
for (const [
|
|
399
|
-
t[
|
|
402
|
+
for (const [n, l] of a)
|
|
403
|
+
t[n] = l;
|
|
400
404
|
return t;
|
|
401
405
|
}, ve = {}, he = {
|
|
402
406
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -411,13 +415,13 @@ const le = ["aria-live", "data-rich-colors", "data-styled", "data-mounted", "dat
|
|
|
411
415
|
};
|
|
412
416
|
function fe(s, a) {
|
|
413
417
|
return d(), v("svg", he, a[0] || (a[0] = [
|
|
414
|
-
|
|
418
|
+
L("line", {
|
|
415
419
|
x1: "18",
|
|
416
420
|
y1: "6",
|
|
417
421
|
x2: "6",
|
|
418
422
|
y2: "18"
|
|
419
423
|
}, null, -1),
|
|
420
|
-
|
|
424
|
+
L("line", {
|
|
421
425
|
x1: "6",
|
|
422
426
|
y1: "6",
|
|
423
427
|
x2: "18",
|
|
@@ -432,12 +436,12 @@ const ge = /* @__PURE__ */ tt(ve, [["render", fe]]), me = ["data-visible"], ye =
|
|
|
432
436
|
},
|
|
433
437
|
setup(s) {
|
|
434
438
|
const a = Array(12).fill(0);
|
|
435
|
-
return (t,
|
|
439
|
+
return (t, n) => (d(), v("div", {
|
|
436
440
|
class: "sonner-loading-wrapper",
|
|
437
441
|
"data-visible": t.visible
|
|
438
442
|
}, [
|
|
439
|
-
|
|
440
|
-
(d(!0), v(
|
|
443
|
+
L("div", ye, [
|
|
444
|
+
(d(!0), v(N, null, gt(j(a), (l) => (d(), v("div", {
|
|
441
445
|
key: `spinner-bar-${l}`,
|
|
442
446
|
class: "sonner-loading-bar"
|
|
443
447
|
}))), 128))
|
|
@@ -453,7 +457,7 @@ const ge = /* @__PURE__ */ tt(ve, [["render", fe]]), me = ["data-visible"], ye =
|
|
|
453
457
|
};
|
|
454
458
|
function ke(s, a) {
|
|
455
459
|
return d(), v("svg", xe, a[0] || (a[0] = [
|
|
456
|
-
|
|
460
|
+
L("path", {
|
|
457
461
|
"fill-rule": "evenodd",
|
|
458
462
|
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",
|
|
459
463
|
"clip-rule": "evenodd"
|
|
@@ -469,7 +473,7 @@ const Be = /* @__PURE__ */ tt(we, [["render", ke]]), Ce = {}, Te = {
|
|
|
469
473
|
};
|
|
470
474
|
function Se(s, a) {
|
|
471
475
|
return d(), v("svg", Te, a[0] || (a[0] = [
|
|
472
|
-
|
|
476
|
+
L("path", {
|
|
473
477
|
"fill-rule": "evenodd",
|
|
474
478
|
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",
|
|
475
479
|
"clip-rule": "evenodd"
|
|
@@ -485,7 +489,7 @@ const Pe = /* @__PURE__ */ tt(Ce, [["render", Se]]), $e = {}, ze = {
|
|
|
485
489
|
};
|
|
486
490
|
function Ee(s, a) {
|
|
487
491
|
return d(), v("svg", ze, a[0] || (a[0] = [
|
|
488
|
-
|
|
492
|
+
L("path", {
|
|
489
493
|
"fill-rule": "evenodd",
|
|
490
494
|
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",
|
|
491
495
|
"clip-rule": "evenodd"
|
|
@@ -501,18 +505,18 @@ const Me = /* @__PURE__ */ tt($e, [["render", Ee]]), Ie = {}, Ye = {
|
|
|
501
505
|
};
|
|
502
506
|
function He(s, a) {
|
|
503
507
|
return d(), v("svg", Ye, a[0] || (a[0] = [
|
|
504
|
-
|
|
508
|
+
L("path", {
|
|
505
509
|
"fill-rule": "evenodd",
|
|
506
510
|
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",
|
|
507
511
|
"clip-rule": "evenodd"
|
|
508
512
|
}, null, -1)
|
|
509
513
|
]));
|
|
510
514
|
}
|
|
511
|
-
const Ae = /* @__PURE__ */ tt(Ie, [["render", He]]), De = ["aria-label"],
|
|
515
|
+
const Ae = /* @__PURE__ */ tt(Ie, [["render", He]]), De = ["aria-label"], Le = ["dir", "data-theme", "data-rich-colors", "data-y-position", "data-x-position", "data-lifted"], Oe = 3, Wt = "32px", je = 356, Ne = 14, _e = typeof window < "u" && typeof document < "u";
|
|
512
516
|
function Re(...s) {
|
|
513
517
|
return s.filter(Boolean).join(" ");
|
|
514
518
|
}
|
|
515
|
-
const
|
|
519
|
+
const We = /* @__PURE__ */ yt({
|
|
516
520
|
name: "Toaster",
|
|
517
521
|
inheritAttrs: !1,
|
|
518
522
|
__name: "Toaster",
|
|
@@ -525,12 +529,12 @@ const Ue = /* @__PURE__ */ yt({
|
|
|
525
529
|
expand: { type: Boolean, default: !1 },
|
|
526
530
|
duration: {},
|
|
527
531
|
gap: { default: Ne },
|
|
528
|
-
visibleToasts: { default:
|
|
532
|
+
visibleToasts: { default: Oe },
|
|
529
533
|
closeButton: { type: Boolean, default: !1 },
|
|
530
534
|
toastOptions: { default: () => ({}) },
|
|
531
535
|
class: { default: "" },
|
|
532
536
|
style: { default: () => ({}) },
|
|
533
|
-
offset: { default:
|
|
537
|
+
offset: { default: Wt },
|
|
534
538
|
dir: { default: "auto" },
|
|
535
539
|
icons: {},
|
|
536
540
|
containerAriaLabel: { default: "Notifications" },
|
|
@@ -544,48 +548,48 @@ const Ue = /* @__PURE__ */ yt({
|
|
|
544
548
|
const o = document.documentElement.getAttribute("dir");
|
|
545
549
|
return o === "auto" || !o ? window.getComputedStyle(document.documentElement).direction : o;
|
|
546
550
|
}
|
|
547
|
-
const
|
|
548
|
-
(
|
|
551
|
+
const n = Jt(), l = p([]), y = g(() => (o, r) => l.value.filter(
|
|
552
|
+
(i) => !i.position && r === 0 || i.position === o
|
|
549
553
|
)), T = g(() => {
|
|
550
|
-
const o = l.value.filter((
|
|
554
|
+
const o = l.value.filter((r) => r.position).map((r) => r.position);
|
|
551
555
|
return o.length > 0 ? Array.from(new Set([a.position].concat(o))) : [a.position];
|
|
552
556
|
}), z = p([]), h = p(!1), c = p(!1), f = p(
|
|
553
557
|
a.theme !== "system" ? a.theme : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"
|
|
554
558
|
), b = p(null), I = p(null), B = p(!1), vt = a.hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
|
|
555
559
|
function ht(o) {
|
|
556
|
-
var
|
|
557
|
-
(
|
|
560
|
+
var r;
|
|
561
|
+
(r = l.value.find((i) => i.id === o.id)) != null && r.delete || $.dismiss(o.id), l.value = l.value.filter(({ id: i }) => i !== o.id);
|
|
558
562
|
}
|
|
559
563
|
function S(o) {
|
|
560
|
-
var
|
|
561
|
-
B.value && !((
|
|
564
|
+
var r, i;
|
|
565
|
+
B.value && !((i = (r = o.currentTarget) == null ? void 0 : r.contains) != null && i.call(r, o.relatedTarget)) && (B.value = !1, I.value && (I.value.focus({ preventScroll: !0 }), I.value = null));
|
|
562
566
|
}
|
|
563
|
-
function
|
|
567
|
+
function O(o) {
|
|
564
568
|
o.target instanceof HTMLElement && o.target.dataset.dismissible === "false" || B.value || (B.value = !0, I.value = o.relatedTarget);
|
|
565
569
|
}
|
|
566
570
|
function ft(o) {
|
|
567
571
|
o.target && o.target instanceof HTMLElement && o.target.dataset.dismissible === "false" || (c.value = !0);
|
|
568
572
|
}
|
|
569
573
|
return K((o) => {
|
|
570
|
-
const
|
|
571
|
-
if (
|
|
574
|
+
const r = $.subscribe((i) => {
|
|
575
|
+
if (i.dismiss) {
|
|
572
576
|
l.value = l.value.map(
|
|
573
|
-
(w) => w.id ===
|
|
577
|
+
(w) => w.id === i.id ? { ...w, delete: !0 } : w
|
|
574
578
|
);
|
|
575
579
|
return;
|
|
576
580
|
}
|
|
577
581
|
Qt(() => {
|
|
578
582
|
const w = l.value.findIndex(
|
|
579
|
-
(P) => P.id ===
|
|
583
|
+
(P) => P.id === i.id
|
|
580
584
|
);
|
|
581
585
|
w !== -1 ? l.value = [
|
|
582
586
|
...l.value.slice(0, w),
|
|
583
|
-
{ ...l.value[w], ...
|
|
587
|
+
{ ...l.value[w], ...i },
|
|
584
588
|
...l.value.slice(w + 1)
|
|
585
|
-
] : l.value = [
|
|
589
|
+
] : l.value = [i, ...l.value];
|
|
586
590
|
});
|
|
587
591
|
});
|
|
588
|
-
o(
|
|
592
|
+
o(r);
|
|
589
593
|
}), Ft(
|
|
590
594
|
() => a.theme,
|
|
591
595
|
(o) => {
|
|
@@ -594,15 +598,15 @@ const Ue = /* @__PURE__ */ yt({
|
|
|
594
598
|
return;
|
|
595
599
|
}
|
|
596
600
|
if (o === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? f.value = "dark" : f.value = "light"), typeof window > "u") return;
|
|
597
|
-
const
|
|
601
|
+
const r = window.matchMedia("(prefers-color-scheme: dark)");
|
|
598
602
|
try {
|
|
599
|
-
|
|
600
|
-
|
|
603
|
+
r.addEventListener("change", ({ matches: i }) => {
|
|
604
|
+
i ? f.value = "dark" : f.value = "light";
|
|
601
605
|
});
|
|
602
606
|
} catch {
|
|
603
|
-
|
|
607
|
+
r.addListener(({ matches: i }) => {
|
|
604
608
|
try {
|
|
605
|
-
|
|
609
|
+
i ? f.value = "dark" : f.value = "light";
|
|
606
610
|
} catch (w) {
|
|
607
611
|
console.error(w);
|
|
608
612
|
}
|
|
@@ -614,28 +618,28 @@ const Ue = /* @__PURE__ */ yt({
|
|
|
614
618
|
}), K(() => {
|
|
615
619
|
l.value.length <= 1 && (h.value = !1);
|
|
616
620
|
}), K((o) => {
|
|
617
|
-
function
|
|
621
|
+
function r(i) {
|
|
618
622
|
const w = a.hotkey.every(
|
|
619
|
-
(A) =>
|
|
623
|
+
(A) => i[A] || i.code === A
|
|
620
624
|
), P = Array.isArray(b.value) ? b.value[0] : b.value;
|
|
621
625
|
w && (h.value = !0, P == null || P.focus());
|
|
622
626
|
const Y = document.activeElement === b.value || (P == null ? void 0 : P.contains(document.activeElement));
|
|
623
|
-
|
|
627
|
+
i.code === "Escape" && Y && (h.value = !1);
|
|
624
628
|
}
|
|
625
|
-
_e && (document.addEventListener("keydown",
|
|
626
|
-
document.removeEventListener("keydown",
|
|
629
|
+
_e && (document.addEventListener("keydown", r), o(() => {
|
|
630
|
+
document.removeEventListener("keydown", r);
|
|
627
631
|
}));
|
|
628
|
-
}), (o,
|
|
632
|
+
}), (o, r) => (d(), v("section", {
|
|
629
633
|
"aria-label": `${o.containerAriaLabel} ${j(vt)}`,
|
|
630
634
|
tabIndex: -1,
|
|
631
635
|
"aria-live": "polite",
|
|
632
636
|
"aria-relevant": "additions text",
|
|
633
637
|
"aria-atomic": "false"
|
|
634
638
|
}, [
|
|
635
|
-
(d(!0), v(
|
|
639
|
+
(d(!0), v(N, null, gt(T.value, (i, w) => {
|
|
636
640
|
var P;
|
|
637
641
|
return d(), v("ol", ut({
|
|
638
|
-
key:
|
|
642
|
+
key: i,
|
|
639
643
|
ref_for: !0,
|
|
640
644
|
ref_key: "listRef",
|
|
641
645
|
ref: b,
|
|
@@ -645,30 +649,30 @@ const Ue = /* @__PURE__ */ yt({
|
|
|
645
649
|
tabIndex: -1,
|
|
646
650
|
"data-theme": o.theme,
|
|
647
651
|
"data-rich-colors": o.richColors,
|
|
648
|
-
"data-y-position":
|
|
649
|
-
"data-x-position":
|
|
652
|
+
"data-y-position": i.split("-")[0],
|
|
653
|
+
"data-x-position": i.split("-")[1],
|
|
650
654
|
"data-lifted": h.value && l.value.length > 1 && !o.expand,
|
|
651
655
|
style: {
|
|
652
656
|
"--front-toast-height": `${(P = z.value[0]) == null ? void 0 : P.height}px`,
|
|
653
|
-
"--offset": typeof o.offset == "number" ? `${o.offset}px` : o.offset ||
|
|
657
|
+
"--offset": typeof o.offset == "number" ? `${o.offset}px` : o.offset || Wt,
|
|
654
658
|
"--width": `${je}px`,
|
|
655
659
|
"--gap": `${o.gap}px`,
|
|
656
660
|
...o.style,
|
|
657
|
-
...j(
|
|
661
|
+
...j(n).style
|
|
658
662
|
}
|
|
659
663
|
}, o.$attrs, {
|
|
660
664
|
onBlur: S,
|
|
661
|
-
onFocus:
|
|
662
|
-
onMouseenter:
|
|
663
|
-
onMousemove:
|
|
664
|
-
onMouseleave:
|
|
665
|
+
onFocus: O,
|
|
666
|
+
onMouseenter: r[1] || (r[1] = () => h.value = !0),
|
|
667
|
+
onMousemove: r[2] || (r[2] = () => h.value = !0),
|
|
668
|
+
onMouseleave: r[3] || (r[3] = () => {
|
|
665
669
|
c.value || (h.value = !1);
|
|
666
670
|
}),
|
|
667
671
|
onPointerdown: ft,
|
|
668
|
-
onPointerup:
|
|
672
|
+
onPointerup: r[4] || (r[4] = () => c.value = !1)
|
|
669
673
|
}), [
|
|
670
|
-
(d(!0), v(
|
|
671
|
-
var q, G, et, at, ot, st, nt, rt,
|
|
674
|
+
(d(!0), v(N, null, gt(y.value(i, w), (Y, A) => {
|
|
675
|
+
var q, G, et, at, ot, st, nt, rt, _;
|
|
672
676
|
return d(), F(pe, {
|
|
673
677
|
key: Y.id,
|
|
674
678
|
heights: z.value.filter((H) => H.position === Y.position),
|
|
@@ -683,51 +687,51 @@ const Ue = /* @__PURE__ */ yt({
|
|
|
683
687
|
visibleToasts: o.visibleToasts,
|
|
684
688
|
closeButton: ((at = o.toastOptions) == null ? void 0 : at.closeButton) ?? o.closeButton,
|
|
685
689
|
interacting: c.value,
|
|
686
|
-
position:
|
|
690
|
+
position: i,
|
|
687
691
|
style: pt((ot = o.toastOptions) == null ? void 0 : ot.style),
|
|
688
692
|
unstyled: (st = o.toastOptions) == null ? void 0 : st.unstyled,
|
|
689
693
|
classes: (nt = o.toastOptions) == null ? void 0 : nt.classes,
|
|
690
694
|
cancelButtonStyle: (rt = o.toastOptions) == null ? void 0 : rt.cancelButtonStyle,
|
|
691
|
-
actionButtonStyle: (
|
|
695
|
+
actionButtonStyle: (_ = o.toastOptions) == null ? void 0 : _.actionButtonStyle,
|
|
692
696
|
toasts: l.value.filter((H) => H.position === Y.position),
|
|
693
697
|
expandByDefault: o.expand,
|
|
694
698
|
gap: o.gap,
|
|
695
699
|
expanded: h.value,
|
|
696
700
|
pauseWhenPageIsHidden: o.pauseWhenPageIsHidden,
|
|
697
701
|
cn: o.cn,
|
|
698
|
-
"onUpdate:heights":
|
|
702
|
+
"onUpdate:heights": r[0] || (r[0] = (H) => {
|
|
699
703
|
z.value = H;
|
|
700
704
|
}),
|
|
701
705
|
onRemoveToast: ht
|
|
702
706
|
}, {
|
|
703
|
-
"close-icon":
|
|
707
|
+
"close-icon": V(() => [
|
|
704
708
|
E(o.$slots, "close-icon", {}, () => [
|
|
705
709
|
U(ge)
|
|
706
710
|
])
|
|
707
711
|
]),
|
|
708
|
-
"loading-icon":
|
|
712
|
+
"loading-icon": V(() => [
|
|
709
713
|
E(o.$slots, "loading-icon", {}, () => [
|
|
710
714
|
U(be, {
|
|
711
715
|
visible: Y.type === "loading"
|
|
712
716
|
}, null, 8, ["visible"])
|
|
713
717
|
])
|
|
714
718
|
]),
|
|
715
|
-
"success-icon":
|
|
719
|
+
"success-icon": V(() => [
|
|
716
720
|
E(o.$slots, "success-icon", {}, () => [
|
|
717
721
|
U(Be)
|
|
718
722
|
])
|
|
719
723
|
]),
|
|
720
|
-
"error-icon":
|
|
724
|
+
"error-icon": V(() => [
|
|
721
725
|
E(o.$slots, "error-icon", {}, () => [
|
|
722
726
|
U(Ae)
|
|
723
727
|
])
|
|
724
728
|
]),
|
|
725
|
-
"warning-icon":
|
|
729
|
+
"warning-icon": V(() => [
|
|
726
730
|
E(o.$slots, "warning-icon", {}, () => [
|
|
727
731
|
U(Me)
|
|
728
732
|
])
|
|
729
733
|
]),
|
|
730
|
-
"info-icon":
|
|
734
|
+
"info-icon": V(() => [
|
|
731
735
|
E(o.$slots, "info-icon", {}, () => [
|
|
732
736
|
U(Pe)
|
|
733
737
|
])
|
|
@@ -735,12 +739,12 @@ const Ue = /* @__PURE__ */ yt({
|
|
|
735
739
|
_: 2
|
|
736
740
|
}, 1032, ["heights", "icons", "index", "toast", "defaultRichColors", "duration", "class", "descriptionClass", "invert", "visibleToasts", "closeButton", "interacting", "position", "style", "unstyled", "classes", "cancelButtonStyle", "actionButtonStyle", "toasts", "expandByDefault", "gap", "expanded", "pauseWhenPageIsHidden", "cn"]);
|
|
737
741
|
}), 128))
|
|
738
|
-
], 16,
|
|
742
|
+
], 16, Le);
|
|
739
743
|
}), 128))
|
|
740
744
|
], 8, De));
|
|
741
745
|
}
|
|
742
746
|
});
|
|
743
747
|
export {
|
|
744
|
-
|
|
745
|
-
|
|
748
|
+
Ue as K,
|
|
749
|
+
We as V
|
|
746
750
|
};
|