vue-toastflow 1.1.9 → 1.2.0-beta.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.
@@ -1,1236 +1,1062 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(':root{--tf-toast-font-family: inherit, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--tf-toast-border-radius: 12px;--tf-toast-border-width: 1px;--tf-toast-padding: 16px;--tf-toast-bg: var(--tf-toast-normal-bg-default);--tf-toast-color: var(--tf-toast-normal-text-default);--tf-toast-border-color: var(--tf-toast-normal-border-default);--tf-toast-gap: 10px;--tf-toast-buttons-gap: calc(var(--tf-toast-gap) / 2);--tf-toast-buttons-content-gap: calc(var(--tf-toast-gap) / 2);--tf-toast-stack-padding-top: 8px;--tf-toast-stack-padding-right: 8px;--tf-toast-stack-padding-bottom: 18px;--tf-toast-stack-padding-left: 0;--tf-toast-title-font-size: 14px;--tf-toast-title-font-weight: 600;--tf-toast-title-line-height: 1.25;--tf-toast-title-color: var(--tf-toast-color);--tf-toast-description-font-size: 13px;--tf-toast-description-line-height: 1.4;--tf-toast-description-color: var(--tf-toast-color);--tf-toast-float-x: .4;--tf-toast-float-y: -.4;--tf-toast-created-at-font-size: 11px;--tf-toast-created-at-offset: 0;--tf-toast-created-at-padding-x: 8px;--tf-toast-created-at-border-radius: 999px;--tf-toast-created-at-bg: var(--tf-toast-close-bg);--tf-toast-created-at-border-color: var(--tf-toast-close-border-color);--tf-toast-created-at-color: var(--tf-toast-close-color);--tf-toast-close-size: 18px;--tf-toast-close-icon-size: 12px;--tf-toast-close-border-width: var(--tf-toast-border-width);--tf-toast-close-border-radius: var(--tf-toast-border-radius);--tf-toast-close-border-color: var(--tf-toast-border-color);--tf-toast-close-color: var(--tf-toast-color);--tf-toast-close-bg: var(--tf-toast-bg);--tf-toast-close-ring-color: var(--tf-toast-close-border-color);--tf-toast-close-font-size: 11px;--tf-toast-button-font-size: 12px;--tf-toast-button-line-height: 1;--tf-toast-button-padding-y: 7px;--tf-toast-button-padding-x: 9px;--tf-toast-button-border-radius: 10px;--tf-toast-button-border-width: var(--tf-toast-border-width);--tf-toast-button-bg: var(--tf-toast-bg);--tf-toast-button-color: var(--tf-toast-color);--tf-toast-button-border-color: var(--tf-toast-border-color);--tf-toast-icon-size: 24px;--tf-toast-icon-loading: var(--tf-toast-loading-text-default);--tf-toast-icon-default: var(--tf-toast-normal-text-default);--tf-toast-icon-success: var(--tf-toast-success-text-default);--tf-toast-icon-error: var(--tf-toast-error-text-default);--tf-toast-icon-warning: var(--tf-toast-warning-text-default);--tf-toast-icon-info: var(--tf-toast-info-text-default);--tf-toast-icon-custom: var(--tf-toast-normal-text-default);--tf-toast-progress-height: 4px;--tf-toast-progress-bg: color-mix( in srgb, var(--tf-toast-color) 20%, transparent );--tf-toast-progress-border-radius: var(--tf-toast-border-radius);--tf-toast-progress-bar-bg: var(--tf-toast-color);--tf-toast-progress-duration: 5s;--tf-toast-normal-bg-default: #fff;--tf-toast-normal-border-default: #e6e8eb;--tf-toast-normal-text-default: #11181c;--tf-toast-normal-progress-bar-bg-default: var( --tf-toast-normal-text-default );--tf-toast-normal-progress-bg-default: color-mix( in srgb, var(--tf-toast-normal-text-default) 20%, transparent );--tf-toast-normal-color-default: var(--tf-toast-normal-text-default);--tf-toast-normal-title-color-default: var(--tf-toast-normal-text-default);--tf-toast-normal-description-color-default: var( --tf-toast-normal-text-default );--tf-toast-loading-bg-default: hsl(48, 100%, 96%);--tf-toast-loading-border-default: hsl(46, 100%, 88%);--tf-toast-loading-text-default: hsl(40, 100%, 32%);--tf-toast-loading-progress-bar-bg-default: var( --tf-toast-loading-text-default );--tf-toast-loading-progress-bg-default: color-mix( in srgb, var(--tf-toast-loading-text-default) 20%, transparent );--tf-toast-loading-color-default: var(--tf-toast-loading-text-default);--tf-toast-loading-title-color-default: var(--tf-toast-loading-text-default);--tf-toast-loading-description-color-default: var( --tf-toast-loading-text-default );--tf-toast-success-bg-default: hsl(143, 85%, 96%);--tf-toast-success-border-default: hsl(145, 92%, 87%);--tf-toast-success-text-default: hsl(140, 100%, 27%);--tf-toast-success-progress-bar-bg-default: var( --tf-toast-success-text-default );--tf-toast-success-progress-bg-default: color-mix( in srgb, var(--tf-toast-success-text-default) 20%, transparent );--tf-toast-success-color-default: var(--tf-toast-success-text-default);--tf-toast-success-title-color-default: var(--tf-toast-success-text-default);--tf-toast-success-description-color-default: var( --tf-toast-success-text-default );--tf-toast-info-bg-default: hsl(208, 100%, 97%);--tf-toast-info-border-default: hsl(221, 91%, 93%);--tf-toast-info-text-default: hsl(210, 92%, 45%);--tf-toast-info-progress-bar-bg-default: var(--tf-toast-info-text-default);--tf-toast-info-progress-bg-default: color-mix( in srgb, var(--tf-toast-info-text-default) 20%, transparent );--tf-toast-info-color-default: var(--tf-toast-info-text-default);--tf-toast-info-title-color-default: var(--tf-toast-info-text-default);--tf-toast-info-description-color-default: var(--tf-toast-info-text-default);--tf-toast-warning-bg-default: hsl(49, 100%, 97%);--tf-toast-warning-border-default: hsl(49, 91%, 84%);--tf-toast-warning-text-default: hsl(31, 92%, 45%);--tf-toast-warning-progress-bar-bg-default: var( --tf-toast-warning-text-default );--tf-toast-warning-progress-bg-default: color-mix( in srgb, var(--tf-toast-warning-text-default) 20%, transparent );--tf-toast-warning-color-default: var(--tf-toast-warning-text-default);--tf-toast-warning-title-color-default: var(--tf-toast-warning-text-default);--tf-toast-warning-description-color-default: var( --tf-toast-warning-text-default );--tf-toast-error-bg-default: hsl(359, 100%, 97%);--tf-toast-error-border-default: hsl(359, 100%, 94%);--tf-toast-error-text-default: hsl(360, 100%, 45%);--tf-toast-error-progress-bar-bg-default: var(--tf-toast-error-text-default);--tf-toast-error-progress-bg-default: color-mix( in srgb, var(--tf-toast-error-text-default) 20%, transparent );--tf-toast-error-color-default: var(--tf-toast-error-text-default);--tf-toast-error-title-color-default: var(--tf-toast-error-text-default);--tf-toast-error-description-color-default: var( --tf-toast-error-text-default );--tf-toast-motion-offset: 10px;--tf-toast-animation-in-duration: .26s;--tf-toast-animation-out-duration: .22s}.tf-toast--paused .tf-toast-progress-bar{animation-play-state:paused}.tf-toast-item[data-position^=top-]{--tf-toast-motion-offset: -10px}.tf-toast-item[data-position^=bottom-]{--tf-toast-motion-offset: 10px}.tf-toast-motion{width:100%;transform-origin:center}.Toastflow__animation-move{transition:transform var(--tf-toast-animation-in-duration) cubic-bezier(.5,1,.25,1);will-change:transform}.Toastflow__animation-enter-from>.tf-toast-motion,.Toastflow__animation-appear-from>.tf-toast-motion{opacity:0;transform:translate3d(0,var(--tf-toast-motion-offset),0) scale(.96)}.Toastflow__animation-enter-active>.tf-toast-motion,.Toastflow__animation-appear-active>.tf-toast-motion{transition:opacity var(--tf-toast-animation-in-duration) cubic-bezier(.5,1,.25,1),transform var(--tf-toast-animation-in-duration) cubic-bezier(.5,1,.25,1)}.Toastflow__animation-enter-to>.tf-toast-motion,.Toastflow__animation-appear-to>.tf-toast-motion{opacity:1;transform:translateZ(0) scale(1)}.Toastflow__animation-leave-from>.tf-toast-motion{opacity:1;transform:translateZ(0) scale(1)}.Toastflow__animation-leave-active>.tf-toast-motion{transition:opacity var(--tf-toast-animation-out-duration) ease,transform var(--tf-toast-animation-out-duration) ease}.Toastflow__animation-leave-to>.tf-toast-motion{opacity:0;transform:translate3d(0,var(--tf-toast-motion-offset),0) scale(.96)}.Toastflow__animation-clearAll .tf-toast-motion{animation:Toastflow__clearAll-kf var(--tf-toast-animation-in-duration) cubic-bezier(.22,1,.36,1) both}.Toastflow__animation-bump{animation:Toastflow__bump-kf var(--tf-toast-animation-in-duration) ease-out}.Toastflow__animation-update{animation:Toastflow__bump-kf var(--tf-toast-animation-in-duration) cubic-bezier(.33,1,.68,1)}@keyframes Toastflow__clearAll-kf{0%{opacity:1}to{opacity:0}}@keyframes Toastflow__bump-kf{0%{transform:scale(1)}40%{transform:scale(1.01)}to{transform:scale(1)}}@media(prefers-reduced-motion:reduce){.Toastflow__animation-move,.Toastflow__animation-enter-active .tf-toast-motion,.Toastflow__animation-leave-active .tf-toast-motion{transition:none}.Toastflow__animation-clearAll .tf-toast-motion{animation:none}}.tf-toast-progress[data-v-23c7e7fe]{height:var(--tf-toast-progress-height);width:100%;border-radius:0 0 var(--tf-toast-progress-border-radius) var(--tf-toast-progress-border-radius);background:var(--tf-toast-progress-bg)}.tf-toast-progress-bar[data-v-23c7e7fe]{height:100%;width:100%;background:var(--tf-toast-progress-bar-bg);transform-origin:left;animation-name:tf-toast-progress-rtl-23c7e7fe;animation-duration:var(--tf-toast-progress-duration, 5s);animation-timing-function:linear;animation-fill-mode:forwards;will-change:transform}.tf-toast-progress[data-align=left-to-right] .tf-toast-progress-bar[data-v-23c7e7fe]{transform-origin:right;animation-name:tf-toast-progress-ltr-23c7e7fe}@keyframes tf-toast-progress-rtl-23c7e7fe{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@keyframes tf-toast-progress-ltr-23c7e7fe{0%{transform:scaleX(0)}to{transform:scaleX(1)}}.tf-toast-wrapper[data-v-012b51f7]{pointer-events:auto;width:100%}.tf-toast[data-v-012b51f7]{cursor:pointer;position:relative;width:100%;--tf-toast-button-color: var(--tf-toast-color);--tf-toast-button-border-color: var(--tf-toast-border-color);--tf-toast-button-border-width: var(--tf-toast-border-width);--tf-toast-button-bg: var(--tf-toast-bg);--tf-toast-close-color: var(--tf-toast-color);--tf-toast-close-border-color: var(--tf-toast-border-color);--tf-toast-close-bg: var(--tf-toast-bg);--tf-toast-close-ring-color: var(--tf-toast-close-border-color);--tf-toast-created-at-color: var(--tf-toast-description-color);--tf-toast-created-at-border-color: var(--tf-toast-border-color);--tf-toast-created-at-bg: var(--tf-toast-bg)}.tf-toast--swipe-enabled[data-v-012b51f7]{touch-action:pan-y;-webkit-user-select:none;user-select:none;cursor:grab}.tf-toast--swipe-enabled[data-v-012b51f7]:active{cursor:grabbing}.tf-toast[data-align=right] .tf-toast-main-content[data-v-012b51f7]{flex-direction:row-reverse}.tf-toast[data-align=right] .tf-toast-text[data-v-012b51f7]{text-align:right}.tf-toast-accent--default[data-v-012b51f7]{--tf-toast-color: var(--tf-toast-normal-color-default);--tf-toast-bg: var(--tf-toast-normal-bg-default);--tf-toast-border-color: var(--tf-toast-normal-border-default);--tf-toast-title-color: var(--tf-toast-normal-title-color-default);--tf-toast-description-color: var( --tf-toast-normal-description-color-default );--tf-toast-progress-bg: var(--tf-toast-normal-progress-bg-default);--tf-toast-progress-bar-bg: var(--tf-toast-normal-progress-bar-bg-default)}.tf-toast-accent--loading[data-v-012b51f7]{--tf-toast-color: var(--tf-toast-loading-color-default);--tf-toast-bg: var(--tf-toast-loading-bg-default);--tf-toast-border-color: var(--tf-toast-loading-border-default);--tf-toast-title-color: var(--tf-toast-loading-title-color-default);--tf-toast-description-color: var( --tf-toast-loading-description-color-default );--tf-toast-progress-bg: var(--tf-toast-loading-progress-bg-default);--tf-toast-progress-bar-bg: var(--tf-toast-loading-progress-bar-bg-default)}.tf-toast-accent--success[data-v-012b51f7]{--tf-toast-color: var(--tf-toast-success-color-default);--tf-toast-bg: var(--tf-toast-success-bg-default);--tf-toast-border-color: var(--tf-toast-success-border-default);--tf-toast-title-color: var(--tf-toast-success-title-color-default);--tf-toast-description-color: var( --tf-toast-success-description-color-default );--tf-toast-progress-bg: var(--tf-toast-success-progress-bg-default);--tf-toast-progress-bar-bg: var(--tf-toast-success-progress-bar-bg-default)}.tf-toast-accent--error[data-v-012b51f7]{--tf-toast-color: var(--tf-toast-error-color-default);--tf-toast-bg: var(--tf-toast-error-bg-default);--tf-toast-border-color: var(--tf-toast-error-border-default);--tf-toast-title-color: var(--tf-toast-error-title-color-default);--tf-toast-description-color: var(--tf-toast-error-description-color-default);--tf-toast-progress-bg: var(--tf-toast-error-progress-bg-default);--tf-toast-progress-bar-bg: var(--tf-toast-error-progress-bar-bg-default)}.tf-toast-accent--warning[data-v-012b51f7]{--tf-toast-color: var(--tf-toast-warning-color-default);--tf-toast-bg: var(--tf-toast-warning-bg-default);--tf-toast-border-color: var(--tf-toast-warning-border-default);--tf-toast-title-color: var(--tf-toast-warning-title-color-default);--tf-toast-description-color: var( --tf-toast-warning-description-color-default );--tf-toast-progress-bg: var(--tf-toast-warning-progress-bg-default);--tf-toast-progress-bar-bg: var(--tf-toast-warning-progress-bar-bg-default)}.tf-toast-accent--info[data-v-012b51f7]{--tf-toast-color: var(--tf-toast-info-color-default);--tf-toast-bg: var(--tf-toast-info-bg-default);--tf-toast-border-color: var(--tf-toast-info-border-default);--tf-toast-title-color: var(--tf-toast-info-title-color-default);--tf-toast-description-color: var(--tf-toast-info-description-color-default);--tf-toast-progress-bg: var(--tf-toast-info-progress-bg-default);--tf-toast-progress-bar-bg: var(--tf-toast-info-progress-bar-bg-default)}.tf-toast-accent--custom[data-v-012b51f7]{--tf-toast-color: var( --tf-toast-custom-color-default, var(--tf-toast-normal-color-default) );--tf-toast-bg: var( --tf-toast-custom-bg-default, var(--tf-toast-normal-bg-default) );--tf-toast-border-color: var( --tf-toast-custom-border-default, var(--tf-toast-normal-border-default) );--tf-toast-title-color: var( --tf-toast-custom-title-color-default, var(--tf-toast-normal-title-color-default) );--tf-toast-description-color: var( --tf-toast-custom-description-color-default, var(--tf-toast-normal-description-color-default) );--tf-toast-progress-bg: var( --tf-toast-custom-progress-bg-default, var(--tf-toast-normal-progress-bg-default) );--tf-toast-progress-bar-bg: var( --tf-toast-custom-progress-bar-bg-default, var(--tf-toast-normal-progress-bar-bg-default) )}.tf-toast-surface[data-v-012b51f7]{position:relative;display:block;min-width:0;padding:var(--tf-toast-padding);border-radius:var(--tf-toast-border-radius);background-color:var(--tf-toast-bg);color:var(--tf-toast-color);border:var(--tf-toast-border-width) solid var(--tf-toast-border-color);font-family:var(--tf-toast-font-family),sans-serif;overflow:hidden}.tf-toast-main[data-v-012b51f7]{display:flex;align-items:stretch;gap:var(--tf-toast-buttons-content-gap);width:100%}.tf-toast-main--full>.tf-toast-main-content[data-v-012b51f7]{width:100%;min-width:0;flex:1 1 100%}.tf-toast-main--content-end>.tf-toast-main-content[data-v-012b51f7]{margin-left:auto;max-width:100%;flex:0 1 auto}.tf-toast-main--content-end>.tf-toast-main-content>.tf-toast-body[data-v-012b51f7]{flex:0 1 auto;min-width:0}.tf-toast-main-content[data-v-012b51f7]{display:flex;align-items:center;gap:var(--tf-toast-gap);min-width:0;flex:1 1 auto}.tf-toast-meta[data-v-012b51f7]{display:flex;flex-direction:column;gap:calc(var(--tf-toast-gap) / 2);min-width:0;flex-shrink:0}.tf-toast-meta--left[data-v-012b51f7]{align-items:flex-start}.tf-toast-meta--right[data-v-012b51f7]{align-items:flex-end}.tf-toast-meta-row[data-v-012b51f7]{display:flex;min-width:0}.tf-toast-meta-row--top[data-v-012b51f7]{margin-bottom:var(--tf-toast-buttons-content-gap)}.tf-toast-meta-row--bottom[data-v-012b51f7]{margin-top:var(--tf-toast-buttons-content-gap)}.tf-toast-meta-row[data-v-012b51f7] .tf-toast-actions--start{margin-right:auto}.tf-toast-meta-row[data-v-012b51f7] .tf-toast-actions--end{margin-left:auto}[data-v-012b51f7] .tf-toast-actions{display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--tf-toast-buttons-gap)}[data-v-012b51f7] .tf-toast-buttons--center{margin-top:auto;margin-bottom:auto}[data-v-012b51f7] .tf-toast-buttons--bottom{margin-top:auto}[data-v-012b51f7] .tf-toast-actions--start{justify-content:flex-start}[data-v-012b51f7] .tf-toast-actions--end{justify-content:flex-end}[data-v-012b51f7] .tf-toast-button{appearance:none;border:var(--tf-toast-button-border-width) solid var(--tf-toast-button-border-color);background:var(--tf-toast-button-bg);color:var(--tf-toast-button-color);border-radius:var(--tf-toast-button-border-radius);font-size:var(--tf-toast-button-font-size);line-height:var(--tf-toast-button-line-height);padding:var(--tf-toast-button-padding-y) var(--tf-toast-button-padding-x);cursor:pointer;-webkit-user-select:none;user-select:none;font-family:inherit}.tf-toast-icon-spin[data-v-012b51f7]{display:inline-block;animation:tf-toast-spin-012b51f7 .8s linear infinite;transform-origin:center}@keyframes tf-toast-spin-012b51f7{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.tf-toast-icon-svg[data-v-012b51f7]{width:var(--tf-toast-icon-size);height:var(--tf-toast-icon-size)}.tf-toast-icon--loading .tf-toast-icon-svg[data-v-012b51f7]{color:var(--tf-toast-icon-color-override, var(--tf-toast-icon-loading))}.tf-toast-icon--default .tf-toast-icon-svg[data-v-012b51f7]{color:var(--tf-toast-icon-color-override, var(--tf-toast-icon-default))}.tf-toast-icon--success .tf-toast-icon-svg[data-v-012b51f7]{color:var(--tf-toast-icon-color-override, var(--tf-toast-icon-success))}.tf-toast-icon--error .tf-toast-icon-svg[data-v-012b51f7]{color:var(--tf-toast-icon-color-override, var(--tf-toast-icon-error))}.tf-toast-icon--warning .tf-toast-icon-svg[data-v-012b51f7]{color:var(--tf-toast-icon-color-override, var(--tf-toast-icon-warning))}.tf-toast-icon--info .tf-toast-icon-svg[data-v-012b51f7]{color:var(--tf-toast-icon-color-override, var(--tf-toast-icon-info))}.tf-toast-icon--custom .tf-toast-icon-svg[data-v-012b51f7]{color:var( --tf-toast-icon-color-override, var(--tf-toast-icon-custom, var(--tf-toast-icon-default)) )}.tf-toast-body[data-v-012b51f7]{position:relative;z-index:1;min-width:0;flex:1 1 auto;display:flex;flex-direction:column}.tf-toast-body--has-created-at[data-v-012b51f7]{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:calc(var(--tf-toast-gap) / 2);grid-auto-flow:row}.tf-toast-body--has-created-at[data-v-012b51f7]>:not(.tf-toast-created-at){grid-column:1}.tf-toast-text[data-v-012b51f7]{min-width:0}.tf-toast-created-at[data-v-012b51f7]{color:var(--tf-toast-created-at-color);font-size:var(--tf-toast-created-at-font-size);font-style:italic;white-space:nowrap;align-self:end;justify-self:end;grid-column:2;grid-row:1}.tf-toast[data-align=right] .tf-toast-created-at[data-v-012b51f7]{text-align:right;width:100%;display:flex;justify-content:flex-end}.tf-toast[data-align=right] .tf-toast-body--has-created-at[data-v-012b51f7]{grid-template-columns:auto minmax(0,1fr)}.tf-toast[data-align=right] .tf-toast-body--has-created-at>.tf-toast-created-at[data-v-012b51f7]{grid-column:1;justify-self:start}.tf-toast[data-align=right] .tf-toast-body--has-created-at[data-v-012b51f7]>:not(.tf-toast-created-at){grid-column:2}.tf-toast-floating-bar[data-v-012b51f7]{position:absolute;top:0;right:0;transform:translate(calc(var(--tf-toast-close-size) * var(--tf-toast-float-x)),calc(var(--tf-toast-close-size) * var(--tf-toast-float-y)));display:inline-flex;align-items:center;gap:var(--tf-toast-created-at-offset);height:var(--tf-toast-close-size);pointer-events:auto;z-index:2}.tf-toast-created-at-float[data-v-012b51f7]{display:inline-flex;align-items:center;height:var(--tf-toast-close-size);padding:0 var(--tf-toast-created-at-padding-x);border-radius:var(--tf-toast-created-at-border-radius);border:var(--tf-toast-close-border-width) solid var(--tf-toast-created-at-border-color);background:var(--tf-toast-created-at-bg);color:var(--tf-toast-created-at-color);font-size:var(--tf-toast-created-at-font-size);font-style:italic;white-space:nowrap;pointer-events:none}.tf-toast-title[data-v-012b51f7]{margin:0;font-size:var(--tf-toast-title-font-size);font-weight:var(--tf-toast-title-font-weight);line-height:var(--tf-toast-title-line-height);color:var(--tf-toast-title-color);word-wrap:break-word}.tf-toast-description[data-v-012b51f7]{margin:0;font-size:var(--tf-toast-description-font-size);line-height:var(--tf-toast-description-line-height);color:var(--tf-toast-description-color);word-wrap:break-word}.tf-toast-close[data-v-012b51f7]{position:relative;height:var(--tf-toast-close-size);width:var(--tf-toast-close-size);border-radius:var(--tf-toast-close-border-radius);border:var(--tf-toast-close-border-width) solid var(--tf-toast-close-border-color);background:var(--tf-toast-close-bg);color:var(--tf-toast-close-color);font-size:var(--tf-toast-close-font-size);display:inline-flex;align-items:center;justify-content:center;padding:0;cursor:pointer;flex-shrink:0;pointer-events:auto;z-index:2}.tf-toast-close-icon[data-v-012b51f7]{width:var(--tf-toast-close-icon-size);height:var(--tf-toast-close-icon-size)}.tf-toast-close[data-v-012b51f7]:focus-visible{outline:2px solid var(--tf-toast-close-ring-color);outline-offset:2px}.tf-toast-progress-wrapper[data-v-012b51f7]{position:absolute;left:0;right:0;bottom:0;margin:0}.tf-toast-root[data-v-c03eb678]{pointer-events:none;position:fixed;inset:0}.tf-toast-stack[data-v-c03eb678]{position:absolute;height:100%;display:flex;align-items:flex-start}.tf-toast-stack-inner[data-v-c03eb678]{display:flex;flex-direction:column;position:relative;width:100%;box-sizing:border-box}.tf-toast-stack-inner--scroll[data-v-c03eb678]{max-height:100%;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding-top:var(--tf-toast-stack-padding-top);padding-right:var(--tf-toast-stack-padding-right);padding-bottom:var(--tf-toast-stack-padding-bottom);padding-left:var(--tf-toast-stack-padding-left);scroll-padding:var(--tf-toast-stack-padding-top) var(--tf-toast-stack-padding-right) var(--tf-toast-stack-padding-bottom) var(--tf-toast-stack-padding-left)}.tf-toast-stack-inner--bottom[data-v-c03eb678]{min-height:100%;justify-content:flex-end}.tf-toast-stack--left[data-v-c03eb678]{justify-content:flex-start}.tf-toast-stack--center[data-v-c03eb678]{justify-content:center}.tf-toast-stack--right[data-v-c03eb678]{justify-content:flex-end}.tf-toast-item[data-v-c03eb678]{pointer-events:auto;width:100%;position:relative;z-index:1}')),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- import { createToastStore as Ne, isNumberFinite as Dt, defaultCreatedAtFormatter as ee, VALID_TOAST_TYPES as ze } from "toastflow-core";
1
+ (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`:root{--tf-toast-font-family:inherit, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--tf-toast-border-radius:12px;--tf-toast-border-width:1px;--tf-toast-padding:16px;--tf-toast-gap:10px;--tf-toast-buttons-gap:calc(var(--tf-toast-gap) / 2);--tf-toast-buttons-content-gap:calc(var(--tf-toast-gap) / 2);--tf-toast-stack-padding-top:8px;--tf-toast-stack-padding-right:8px;--tf-toast-stack-padding-bottom:18px;--tf-toast-stack-padding-left:0;--tf-toast-title-font-size:14px;--tf-toast-title-font-weight:600;--tf-toast-title-line-height:1.25;--tf-toast-description-font-size:13px;--tf-toast-description-line-height:1.4;--tf-toast-float-x:.4;--tf-toast-float-y:-.4;--tf-toast-created-at-font-size:11px;--tf-toast-created-at-offset:0;--tf-toast-created-at-padding-x:8px;--tf-toast-created-at-border-radius:999px;--tf-toast-close-size:18px;--tf-toast-close-icon-size:12px;--tf-toast-close-border-width:var(--tf-toast-border-width);--tf-toast-close-border-radius:var(--tf-toast-border-radius);--tf-toast-close-font-size:11px;--tf-toast-button-font-size:12px;--tf-toast-button-line-height:1;--tf-toast-button-padding-y:7px;--tf-toast-button-padding-x:9px;--tf-toast-button-border-radius:10px;--tf-toast-button-border-width:var(--tf-toast-border-width);--tf-toast-icon-size:24px;--tf-toast-icon-loading:var(--tf-toast-loading-text-default);--tf-toast-icon-default:var(--tf-toast-normal-text-default);--tf-toast-icon-success:var(--tf-toast-success-text-default);--tf-toast-icon-error:var(--tf-toast-error-text-default);--tf-toast-icon-warning:var(--tf-toast-warning-text-default);--tf-toast-icon-info:var(--tf-toast-info-text-default);--tf-toast-icon-custom:var(--tf-toast-normal-text-default);--tf-toast-progress-height:4px;--tf-toast-progress-border-radius:var(--tf-toast-border-radius);--tf-toast-progress-duration:5s;--tf-toast-normal-bg-default:#fff;--tf-toast-normal-border-default:#e6e8eb;--tf-toast-normal-text-default:#11181c;--tf-toast-normal-progress-bar-bg-default:var(--tf-toast-normal-text-default);--tf-toast-normal-progress-bg-default:color-mix(in srgb, var(--tf-toast-normal-text-default) 20%, transparent);--tf-toast-normal-color-default:var(--tf-toast-normal-text-default);--tf-toast-normal-title-color-default:var(--tf-toast-normal-text-default);--tf-toast-normal-description-color-default:var(--tf-toast-normal-text-default);--tf-toast-loading-bg-default:#fffbeb;--tf-toast-loading-border-default:#fff1c2;--tf-toast-loading-text-default:#a36d00;--tf-toast-loading-progress-bar-bg-default:var(--tf-toast-loading-text-default);--tf-toast-loading-progress-bg-default:color-mix(in srgb, var(--tf-toast-loading-text-default) 20%, transparent);--tf-toast-loading-color-default:var(--tf-toast-loading-text-default);--tf-toast-loading-title-color-default:var(--tf-toast-loading-text-default);--tf-toast-loading-description-color-default:var(--tf-toast-loading-text-default);--tf-toast-success-bg-default:#ecfdf3;--tf-toast-success-border-default:#bffcd9;--tf-toast-success-text-default:#008a2e;--tf-toast-success-progress-bar-bg-default:var(--tf-toast-success-text-default);--tf-toast-success-progress-bg-default:color-mix(in srgb, var(--tf-toast-success-text-default) 20%, transparent);--tf-toast-success-color-default:var(--tf-toast-success-text-default);--tf-toast-success-title-color-default:var(--tf-toast-success-text-default);--tf-toast-success-description-color-default:var(--tf-toast-success-text-default);--tf-toast-info-bg-default:#f0f8ff;--tf-toast-info-border-default:#dde7fd;--tf-toast-info-text-default:#0973dc;--tf-toast-info-progress-bar-bg-default:var(--tf-toast-info-text-default);--tf-toast-info-progress-bg-default:color-mix(in srgb, var(--tf-toast-info-text-default) 20%, transparent);--tf-toast-info-color-default:var(--tf-toast-info-text-default);--tf-toast-info-title-color-default:var(--tf-toast-info-text-default);--tf-toast-info-description-color-default:var(--tf-toast-info-text-default);--tf-toast-warning-bg-default:#fffcf0;--tf-toast-warning-border-default:#fbeeb1;--tf-toast-warning-text-default:#dc7609;--tf-toast-warning-progress-bar-bg-default:var(--tf-toast-warning-text-default);--tf-toast-warning-progress-bg-default:color-mix(in srgb, var(--tf-toast-warning-text-default) 20%, transparent);--tf-toast-warning-color-default:var(--tf-toast-warning-text-default);--tf-toast-warning-title-color-default:var(--tf-toast-warning-text-default);--tf-toast-warning-description-color-default:var(--tf-toast-warning-text-default);--tf-toast-error-bg-default:#fff0f0;--tf-toast-error-border-default:#ffe0e1;--tf-toast-error-text-default:#e60000;--tf-toast-error-progress-bar-bg-default:var(--tf-toast-error-text-default);--tf-toast-error-progress-bg-default:color-mix(in srgb, var(--tf-toast-error-text-default) 20%, transparent);--tf-toast-error-color-default:var(--tf-toast-error-text-default);--tf-toast-error-title-color-default:var(--tf-toast-error-text-default);--tf-toast-error-description-color-default:var(--tf-toast-error-text-default);--tf-toast-motion-offset:10px;--tf-toast-animation-in-duration:.26s;--tf-toast-animation-out-duration:.22s}.tf-toast--paused .tf-toast-progress-bar{animation-play-state:paused}.tf-toast-item[data-position^=top-]{--tf-toast-motion-offset:-10px}.tf-toast-item[data-position^=bottom-]{--tf-toast-motion-offset:10px}.tf-toast-motion{transform-origin:50%;width:100%}.Toastflow__animation-move{transition:transform var(--tf-toast-animation-in-duration) cubic-bezier(.5, 1, .25, 1);will-change:transform}.Toastflow__animation-enter-from>.tf-toast-motion,.Toastflow__animation-appear-from>.tf-toast-motion{opacity:0;transform:translate3d(0, var(--tf-toast-motion-offset), 0) scale(.96)}.Toastflow__animation-enter-active>.tf-toast-motion,.Toastflow__animation-appear-active>.tf-toast-motion{transition:opacity var(--tf-toast-animation-in-duration) cubic-bezier(.5, 1, .25, 1), transform var(--tf-toast-animation-in-duration) cubic-bezier(.5, 1, .25, 1)}.Toastflow__animation-enter-to>.tf-toast-motion,.Toastflow__animation-appear-to>.tf-toast-motion,.Toastflow__animation-leave-from>.tf-toast-motion{opacity:1;transform:translate(0,0)scale(1)}.Toastflow__animation-leave-active>.tf-toast-motion{transition:opacity var(--tf-toast-animation-out-duration) ease, transform var(--tf-toast-animation-out-duration) ease}.Toastflow__animation-leave-to>.tf-toast-motion{opacity:0;transform:translate3d(0, var(--tf-toast-motion-offset), 0) scale(.96)}.Toastflow__animation-clearAll .tf-toast-motion{animation:Toastflow__clearAll-kf var(--tf-toast-animation-in-duration) cubic-bezier(.22, 1, .36, 1) both}.Toastflow__animation-bump{animation:Toastflow__bump-kf var(--tf-toast-animation-in-duration) ease-out}.Toastflow__animation-update{animation:Toastflow__bump-kf var(--tf-toast-animation-in-duration) cubic-bezier(.33, 1, .68, 1)}@keyframes Toastflow__clearAll-kf{0%{opacity:1}to{opacity:0}}@keyframes Toastflow__bump-kf{0%{transform:scale(1)}40%{transform:scale(1.01)}to{transform:scale(1)}}@media (prefers-reduced-motion:reduce){.Toastflow__animation-move,.Toastflow__animation-enter-active .tf-toast-motion,.Toastflow__animation-leave-active .tf-toast-motion{transition:none}.Toastflow__animation-clearAll .tf-toast-motion{animation:none}}.tf-toast-progress[data-v-ab9c4177]{height:var(--tf-toast-progress-height);border-radius:0 0 var(--tf-toast-progress-border-radius) var(--tf-toast-progress-border-radius);background:var(--_tf-resolved-progress-bg);width:100%}.tf-toast-progress-bar[data-v-ab9c4177]{background:var(--_tf-resolved-progress-bar-bg);transform-origin:0;width:100%;height:100%;animation-name:tf-toast-progress-rtl-ab9c4177;animation-duration:var(--tf-toast-progress-duration,5s);will-change:transform;animation-timing-function:linear;animation-fill-mode:forwards}.tf-toast-progress[data-align=left-to-right] .tf-toast-progress-bar[data-v-ab9c4177]{transform-origin:100%;animation-name:tf-toast-progress-ltr-ab9c4177}@keyframes tf-toast-progress-rtl-ab9c4177{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@keyframes tf-toast-progress-ltr-ab9c4177{0%{transform:scaleX(0)}to{transform:scaleX(1)}}.tf-toast-wrapper[data-v-b9d1f13b]{pointer-events:auto;width:100%}.tf-toast[data-v-b9d1f13b]{cursor:pointer;--_tf-resolved-bg:var(--tf-toast-bg,var(--_tf-bg,var(--tf-toast-normal-bg-default)));--_tf-resolved-color:var(--tf-toast-color,var(--tf-toast-accent-color,var(--_tf-color,var(--tf-toast-normal-text-default))));--_tf-resolved-border:var(--tf-toast-border-color,var(--_tf-border-color,var(--tf-toast-normal-border-default)));--_tf-resolved-title-color:var(--tf-toast-title-color,var(--tf-toast-accent-color,var(--_tf-title-color,var(--_tf-resolved-color))));--_tf-resolved-desc-color:var(--tf-toast-description-color,var(--tf-toast-accent-color,var(--_tf-desc-color,var(--_tf-resolved-color))));--_tf-resolved-progress-bg:var(--tf-toast-progress-bg,var(--_tf-progress-bg,color-mix(in srgb, var(--_tf-resolved-color) 20%, transparent)));--_tf-resolved-progress-bar-bg:var(--tf-toast-progress-bar-bg,var(--tf-toast-accent-color,var(--_tf-progress-bar-bg,var(--_tf-resolved-color))));--tf-toast-button-color:var(--_tf-resolved-color);--tf-toast-button-border-color:var(--_tf-resolved-border);--tf-toast-button-border-width:var(--tf-toast-border-width);--tf-toast-button-bg:var(--_tf-resolved-bg);--tf-toast-close-color:var(--_tf-resolved-color);--tf-toast-close-border-color:var(--_tf-resolved-border);--tf-toast-close-bg:var(--_tf-resolved-bg);--tf-toast-close-ring-color:var(--tf-toast-close-border-color);--tf-toast-created-at-color:var(--_tf-resolved-desc-color);--tf-toast-created-at-border-color:var(--_tf-resolved-border);--tf-toast-created-at-bg:var(--_tf-resolved-bg);width:100%;position:relative}.tf-toast--swipe-enabled[data-v-b9d1f13b]{touch-action:pan-y;-webkit-user-select:none;user-select:none;cursor:grab}.tf-toast--swipe-enabled[data-v-b9d1f13b]:active{cursor:grabbing}.tf-toast[data-align=right] .tf-toast-main-content[data-v-b9d1f13b]{flex-direction:row-reverse}.tf-toast[data-align=right] .tf-toast-text[data-v-b9d1f13b]{text-align:right}.tf-toast-accent--default[data-v-b9d1f13b]{--_tf-bg:var(--tf-toast-normal-bg-default);--_tf-color:var(--tf-toast-normal-color-default);--_tf-border-color:var(--tf-toast-normal-border-default);--_tf-title-color:var(--tf-toast-normal-title-color-default);--_tf-desc-color:var(--tf-toast-normal-description-color-default);--_tf-progress-bg:var(--tf-toast-normal-progress-bg-default);--_tf-progress-bar-bg:var(--tf-toast-normal-progress-bar-bg-default)}.tf-toast-accent--loading[data-v-b9d1f13b]{--_tf-bg:var(--tf-toast-loading-bg-default);--_tf-color:var(--tf-toast-loading-color-default);--_tf-border-color:var(--tf-toast-loading-border-default);--_tf-title-color:var(--tf-toast-loading-title-color-default);--_tf-desc-color:var(--tf-toast-loading-description-color-default);--_tf-progress-bg:var(--tf-toast-loading-progress-bg-default);--_tf-progress-bar-bg:var(--tf-toast-loading-progress-bar-bg-default)}.tf-toast-accent--success[data-v-b9d1f13b]{--_tf-bg:var(--tf-toast-success-bg-default);--_tf-color:var(--tf-toast-success-color-default);--_tf-border-color:var(--tf-toast-success-border-default);--_tf-title-color:var(--tf-toast-success-title-color-default);--_tf-desc-color:var(--tf-toast-success-description-color-default);--_tf-progress-bg:var(--tf-toast-success-progress-bg-default);--_tf-progress-bar-bg:var(--tf-toast-success-progress-bar-bg-default)}.tf-toast-accent--error[data-v-b9d1f13b]{--_tf-bg:var(--tf-toast-error-bg-default);--_tf-color:var(--tf-toast-error-color-default);--_tf-border-color:var(--tf-toast-error-border-default);--_tf-title-color:var(--tf-toast-error-title-color-default);--_tf-desc-color:var(--tf-toast-error-description-color-default);--_tf-progress-bg:var(--tf-toast-error-progress-bg-default);--_tf-progress-bar-bg:var(--tf-toast-error-progress-bar-bg-default)}.tf-toast-accent--warning[data-v-b9d1f13b]{--_tf-bg:var(--tf-toast-warning-bg-default);--_tf-color:var(--tf-toast-warning-color-default);--_tf-border-color:var(--tf-toast-warning-border-default);--_tf-title-color:var(--tf-toast-warning-title-color-default);--_tf-desc-color:var(--tf-toast-warning-description-color-default);--_tf-progress-bg:var(--tf-toast-warning-progress-bg-default);--_tf-progress-bar-bg:var(--tf-toast-warning-progress-bar-bg-default)}.tf-toast-accent--info[data-v-b9d1f13b]{--_tf-bg:var(--tf-toast-info-bg-default);--_tf-color:var(--tf-toast-info-color-default);--_tf-border-color:var(--tf-toast-info-border-default);--_tf-title-color:var(--tf-toast-info-title-color-default);--_tf-desc-color:var(--tf-toast-info-description-color-default);--_tf-progress-bg:var(--tf-toast-info-progress-bg-default);--_tf-progress-bar-bg:var(--tf-toast-info-progress-bar-bg-default)}.tf-toast-accent--custom[data-v-b9d1f13b]{--_tf-bg:var(--tf-toast-custom-bg-default,var(--tf-toast-normal-bg-default));--_tf-color:var(--tf-toast-custom-color-default,var(--tf-toast-normal-color-default));--_tf-border-color:var(--tf-toast-custom-border-default,var(--tf-toast-normal-border-default));--_tf-title-color:var(--tf-toast-custom-title-color-default,var(--tf-toast-normal-title-color-default));--_tf-desc-color:var(--tf-toast-custom-description-color-default,var(--tf-toast-normal-description-color-default));--_tf-progress-bg:var(--tf-toast-custom-progress-bg-default,var(--tf-toast-normal-progress-bg-default));--_tf-progress-bar-bg:var(--tf-toast-custom-progress-bar-bg-default,var(--tf-toast-normal-progress-bar-bg-default))}.tf-toast-surface[data-v-b9d1f13b]{min-width:0;padding:var(--tf-toast-padding);border-radius:var(--tf-toast-border-radius);background-color:var(--_tf-resolved-bg);color:var(--_tf-resolved-color);border:var(--tf-toast-border-width) solid var(--_tf-resolved-border);font-family:var(--tf-toast-font-family), sans-serif;display:block;position:relative;overflow:hidden}.tf-toast-main[data-v-b9d1f13b]{align-items:stretch;gap:var(--tf-toast-buttons-content-gap);width:100%;display:flex}.tf-toast-main--full>.tf-toast-main-content[data-v-b9d1f13b]{flex:100%;width:100%;min-width:0}.tf-toast-main--content-end>.tf-toast-main-content[data-v-b9d1f13b]{flex:0 auto;max-width:100%;margin-left:auto}.tf-toast-main--content-end>.tf-toast-main-content>.tf-toast-body[data-v-b9d1f13b]{flex:0 auto;min-width:0}.tf-toast-main-content[data-v-b9d1f13b]{align-items:center;gap:var(--tf-toast-gap);flex:auto;min-width:0;display:flex}.tf-toast-meta[data-v-b9d1f13b]{gap:calc(var(--tf-toast-gap) / 2);flex-direction:column;flex-shrink:0;min-width:0;display:flex}.tf-toast-meta--left[data-v-b9d1f13b]{align-items:flex-start}.tf-toast-meta--right[data-v-b9d1f13b]{align-items:flex-end}.tf-toast-meta-row[data-v-b9d1f13b]{min-width:0;display:flex}.tf-toast-meta-row--top[data-v-b9d1f13b]{margin-bottom:var(--tf-toast-buttons-content-gap)}.tf-toast-meta-row--bottom[data-v-b9d1f13b]{margin-top:var(--tf-toast-buttons-content-gap)}.tf-toast-meta-row[data-v-b9d1f13b] .tf-toast-actions--start{margin-right:auto}.tf-toast-meta-row[data-v-b9d1f13b] .tf-toast-actions--end{margin-left:auto}[data-v-b9d1f13b] .tf-toast-actions{gap:var(--tf-toast-buttons-gap);flex-flow:wrap;display:flex}[data-v-b9d1f13b] .tf-toast-buttons--center{margin-top:auto;margin-bottom:auto}[data-v-b9d1f13b] .tf-toast-buttons--bottom{margin-top:auto}[data-v-b9d1f13b] .tf-toast-actions--start{justify-content:flex-start}[data-v-b9d1f13b] .tf-toast-actions--end{justify-content:flex-end}[data-v-b9d1f13b] .tf-toast-button{appearance:none;border:var(--tf-toast-button-border-width) solid var(--tf-toast-button-border-color);background:var(--tf-toast-button-bg);color:var(--tf-toast-button-color);border-radius:var(--tf-toast-button-border-radius);font-size:var(--tf-toast-button-font-size);line-height:var(--tf-toast-button-line-height);padding:var(--tf-toast-button-padding-y) var(--tf-toast-button-padding-x);cursor:pointer;-webkit-user-select:none;user-select:none;font-family:inherit}.tf-toast-icon-spin[data-v-b9d1f13b]{transform-origin:50%;animation:.8s linear infinite tf-toast-spin-b9d1f13b;display:inline-block}@keyframes tf-toast-spin-b9d1f13b{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.tf-toast-icon-svg[data-v-b9d1f13b]{width:var(--tf-toast-icon-size);height:var(--tf-toast-icon-size)}.tf-toast-icon--loading .tf-toast-icon-svg[data-v-b9d1f13b]{color:var(--tf-toast-icon-color,var(--tf-toast-icon-loading))}.tf-toast-icon--default .tf-toast-icon-svg[data-v-b9d1f13b]{color:var(--tf-toast-icon-color,var(--tf-toast-icon-default))}.tf-toast-icon--success .tf-toast-icon-svg[data-v-b9d1f13b]{color:var(--tf-toast-icon-color,var(--tf-toast-icon-success))}.tf-toast-icon--error .tf-toast-icon-svg[data-v-b9d1f13b]{color:var(--tf-toast-icon-color,var(--tf-toast-icon-error))}.tf-toast-icon--warning .tf-toast-icon-svg[data-v-b9d1f13b]{color:var(--tf-toast-icon-color,var(--tf-toast-icon-warning))}.tf-toast-icon--info .tf-toast-icon-svg[data-v-b9d1f13b]{color:var(--tf-toast-icon-color,var(--tf-toast-icon-info))}.tf-toast-icon--custom .tf-toast-icon-svg[data-v-b9d1f13b]{color:var(--tf-toast-icon-color,var(--tf-toast-icon-custom,var(--tf-toast-icon-default)))}.tf-toast-body[data-v-b9d1f13b]{z-index:1;flex-direction:column;flex:auto;min-width:0;display:flex;position:relative}.tf-toast-body--has-created-at[data-v-b9d1f13b]{column-gap:calc(var(--tf-toast-gap) / 2);grid-template-columns:minmax(0,1fr) auto;grid-auto-flow:row;display:grid}.tf-toast-body--has-created-at[data-v-b9d1f13b]>:not(.tf-toast-created-at){grid-column:1}.tf-toast-text[data-v-b9d1f13b]{min-width:0}.tf-toast-created-at[data-v-b9d1f13b]{color:var(--tf-toast-created-at-color);font-size:var(--tf-toast-created-at-font-size);white-space:nowrap;grid-area:1/2;place-self:end;font-style:italic}.tf-toast[data-align=right] .tf-toast-created-at[data-v-b9d1f13b]{text-align:right;justify-content:flex-end;width:100%;display:flex}.tf-toast[data-align=right] .tf-toast-body--has-created-at[data-v-b9d1f13b]{grid-template-columns:auto minmax(0,1fr)}.tf-toast[data-align=right] .tf-toast-body--has-created-at>.tf-toast-created-at[data-v-b9d1f13b]{grid-column:1;justify-self:start}.tf-toast[data-align=right] .tf-toast-body--has-created-at[data-v-b9d1f13b]>:not(.tf-toast-created-at){grid-column:2}.tf-toast-floating-bar[data-v-b9d1f13b]{transform:translate(calc(var(--tf-toast-close-size) * var(--tf-toast-float-x)), calc(var(--tf-toast-close-size) * var(--tf-toast-float-y)));align-items:center;gap:var(--tf-toast-created-at-offset);height:var(--tf-toast-close-size);pointer-events:auto;z-index:2;display:inline-flex;position:absolute;top:0;right:0}.tf-toast-created-at-float[data-v-b9d1f13b]{height:var(--tf-toast-close-size);padding:0 var(--tf-toast-created-at-padding-x);border-radius:var(--tf-toast-created-at-border-radius);border:var(--tf-toast-close-border-width) solid var(--tf-toast-created-at-border-color);background:var(--tf-toast-created-at-bg);color:var(--tf-toast-created-at-color);font-size:var(--tf-toast-created-at-font-size);white-space:nowrap;pointer-events:none;align-items:center;font-style:italic;display:inline-flex}.tf-toast-title[data-v-b9d1f13b]{font-size:var(--tf-toast-title-font-size);font-weight:var(--tf-toast-title-font-weight);line-height:var(--tf-toast-title-line-height);color:var(--_tf-resolved-title-color);word-wrap:break-word;margin:0}.tf-toast-description[data-v-b9d1f13b]{font-size:var(--tf-toast-description-font-size);line-height:var(--tf-toast-description-line-height);color:var(--_tf-resolved-desc-color);word-wrap:break-word;margin:0}.tf-toast-close[data-v-b9d1f13b]{height:var(--tf-toast-close-size);width:var(--tf-toast-close-size);border-radius:var(--tf-toast-close-border-radius);border:var(--tf-toast-close-border-width) solid var(--tf-toast-close-border-color);background:var(--tf-toast-close-bg);color:var(--tf-toast-close-color);font-size:var(--tf-toast-close-font-size);cursor:pointer;pointer-events:auto;z-index:2;flex-shrink:0;justify-content:center;align-items:center;padding:0;display:inline-flex;position:relative}.tf-toast-close-icon[data-v-b9d1f13b]{width:var(--tf-toast-close-icon-size);height:var(--tf-toast-close-icon-size)}.tf-toast-close[data-v-b9d1f13b]:focus-visible{outline:2px solid var(--tf-toast-close-ring-color);outline-offset:2px}.tf-toast-progress-wrapper[data-v-b9d1f13b]{margin:0;position:absolute;bottom:0;left:0;right:0}.tf-toast-root[data-v-c03eb678]{pointer-events:none;position:fixed;inset:0}.tf-toast-stack[data-v-c03eb678]{align-items:flex-start;height:100%;display:flex;position:absolute}.tf-toast-stack-inner[data-v-c03eb678]{box-sizing:border-box;flex-direction:column;width:100%;display:flex;position:relative}.tf-toast-stack-inner--scroll[data-v-c03eb678]{overscroll-behavior:contain;max-height:100%;padding-top:var(--tf-toast-stack-padding-top);padding-right:var(--tf-toast-stack-padding-right);padding-bottom:var(--tf-toast-stack-padding-bottom);padding-left:var(--tf-toast-stack-padding-left);scroll-padding:var(--tf-toast-stack-padding-top) var(--tf-toast-stack-padding-right) var(--tf-toast-stack-padding-bottom) var(--tf-toast-stack-padding-left);overflow:hidden auto}.tf-toast-stack-inner--bottom[data-v-c03eb678]{justify-content:flex-end;min-height:100%}.tf-toast-stack--left[data-v-c03eb678]{justify-content:flex-start}.tf-toast-stack--center[data-v-c03eb678]{justify-content:center}.tf-toast-stack--right[data-v-c03eb678]{justify-content:flex-end}.tf-toast-item[data-v-c03eb678]{pointer-events:auto;z-index:1;width:100%;position:relative}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
2
+ import { VALID_TOAST_TYPES as e, createToastStore as t, defaultCreatedAtFormatter as n, isNumberFinite as r } from "toastflow-core";
3
+ import { Fragment as i, TransitionGroup as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineComponent as f, inject as p, normalizeClass as m, normalizeStyle as h, onBeforeUpdate as g, onMounted as _, onUnmounted as ee, openBlock as v, ref as y, renderList as b, renderSlot as x, resolveDynamicComponent as S, toDisplayString as C, toRefs as w, unref as T, watch as E, withCtx as D, withModifiers as O } from "vue";
3
4
  export * from "toastflow-core";
4
- import { defineComponent as Ct, openBlock as d, createElementBlock as m, createElementVNode as P, normalizeClass as D, Fragment as Ht, renderList as Ot, withModifiers as it, toDisplayString as lt, createCommentVNode as I, toRefs as Fe, inject as re, computed as u, ref as C, watch as j, onUnmounted as ie, normalizeStyle as z, unref as o, createVNode as J, renderSlot as Z, createBlock as Kt, resolveDynamicComponent as Ve, onMounted as Ze, onBeforeUpdate as je, TransitionGroup as Xe, withCtx as Ye } from "vue";
5
- const Rt = /* @__PURE__ */ Symbol.for(
6
- "vue-toastflow.toast-store"
7
- ), le = "__vue_toastflow_store__";
8
- let ut = null;
9
- function Qe(a) {
10
- ut = a;
11
- try {
12
- globalThis[le] = a;
13
- } catch {
14
- }
5
+ //#region src/symbols.ts
6
+ var k = Symbol.for("vue-toastflow.toast-store"), A = "__vue_toastflow_store__", j = null;
7
+ function M(e) {
8
+ j = e;
9
+ try {
10
+ globalThis[A] = e;
11
+ } catch {}
15
12
  }
16
- function T() {
17
- if (ut || (ut = globalThis[le] ?? null), !ut)
18
- throw new Error(
19
- "[vue-toastflow] Toast store not initialized. Did you install the plugin?"
20
- );
21
- return ut;
13
+ function N() {
14
+ if (j ||= globalThis[A] ?? null, !j) throw Error("[vue-toastflow] Toast store not initialized. Did you install the plugin?");
15
+ return j;
22
16
  }
23
- function V(a) {
24
- function c(B, b) {
25
- if (typeof B == "string" || b !== void 0) {
26
- const _ = a === void 0 ? b : { ...b ?? {}, type: a };
27
- return T().show(B, _);
28
- }
29
- return a === void 0 ? T().show(B) : T().show({
30
- ...B,
31
- type: a
32
- });
33
- }
34
- return c;
17
+ function P(e) {
18
+ function t(t, n) {
19
+ if (typeof t == "string" || n !== void 0) {
20
+ let r = e === void 0 ? n : {
21
+ ...n ?? {},
22
+ type: e
23
+ };
24
+ return N().show(t, r);
25
+ }
26
+ return e === void 0 ? N().show(t) : N().show({
27
+ ...t,
28
+ type: e
29
+ });
30
+ }
31
+ return t;
35
32
  }
36
- const so = {
37
- getState() {
38
- return T().getState();
39
- },
40
- subscribe(a) {
41
- return T().subscribe(a);
42
- },
43
- subscribeEvents(a) {
44
- return T().subscribeEvents(a);
45
- },
46
- show: V(),
47
- loading(a, c) {
48
- return T().loading(a, c);
49
- },
50
- update(a, c) {
51
- return T().update(a, c);
52
- },
53
- dismiss(a) {
54
- return T().dismiss(a);
55
- },
56
- dismissAll() {
57
- return T().dismissAll();
58
- },
59
- pause(a) {
60
- return T().pause(a);
61
- },
62
- resume(a) {
63
- return T().resume(a);
64
- },
65
- pauseQueue() {
66
- return T().pauseQueue();
67
- },
68
- resumeQueue() {
69
- return T().resumeQueue();
70
- },
71
- getConfig() {
72
- return T().getConfig();
73
- },
74
- default: V("default"),
75
- success: V("success"),
76
- error: V("error"),
77
- info: V("info"),
78
- warning: V("warning"),
79
- custom: V("custom")
33
+ var F = {
34
+ getState() {
35
+ return N().getState();
36
+ },
37
+ subscribe(e) {
38
+ return N().subscribe(e);
39
+ },
40
+ subscribeEvents(e) {
41
+ return N().subscribeEvents(e);
42
+ },
43
+ show: P(),
44
+ loading(e, t) {
45
+ return N().loading(e, t);
46
+ },
47
+ update(e, t) {
48
+ return N().update(e, t);
49
+ },
50
+ dismiss(e) {
51
+ return N().dismiss(e);
52
+ },
53
+ dismissAll() {
54
+ return N().dismissAll();
55
+ },
56
+ pause(e) {
57
+ return N().pause(e);
58
+ },
59
+ resume(e) {
60
+ return N().resume(e);
61
+ },
62
+ pauseQueue() {
63
+ return N().pauseQueue();
64
+ },
65
+ resumeQueue() {
66
+ return N().resumeQueue();
67
+ },
68
+ getConfig() {
69
+ return N().getConfig();
70
+ },
71
+ default: P("default"),
72
+ success: P("success"),
73
+ error: P("error"),
74
+ info: P("info"),
75
+ warning: P("warning"),
76
+ custom: P("custom")
80
77
  };
81
- function ao(a = {}) {
82
- const c = Ne(a);
83
- return Qe(c), {
84
- install(B) {
85
- B.provide(Rt, c);
86
- }
87
- };
78
+ //#endregion
79
+ //#region src/plugin.ts
80
+ function I(e = {}) {
81
+ let n = t(e);
82
+ return M(n), { install(e) {
83
+ e.provide(k, n);
84
+ } };
88
85
  }
89
- const Ge = ["data-align"], qe = /* @__PURE__ */ Ct({
90
- __name: "ToastProgress",
91
- props: {
92
- type: {},
93
- progressAlignment: { default: "right-to-left" }
94
- },
95
- setup(a) {
96
- const c = a;
97
- return (B, b) => (d(), m("div", {
98
- class: "tf-toast-progress",
99
- "data-align": c.progressAlignment
100
- }, [
101
- P("div", {
102
- class: D(["tf-toast-progress-bar", `tf-toast-progress-bar--${c.type}`])
103
- }, null, 2)
104
- ], 8, Ge));
105
- }
106
- }), E = (a, c) => {
107
- const B = a.__vccOpts || a;
108
- for (const [b, _] of c)
109
- B[b] = _;
110
- return B;
111
- }, Je = /* @__PURE__ */ E(qe, [["__scopeId", "data-v-23c7e7fe"]]), tn = ["aria-label", "onClick"], en = { key: 0 }, nn = ["innerHTML"], wt = /* @__PURE__ */ Ct({
112
- __name: "ToastButtonsGroup",
113
- props: {
114
- buttons: {},
115
- classes: {},
116
- onButtonClick: { type: Function }
117
- },
118
- setup(a) {
119
- const c = a;
120
- function B(b, _) {
121
- c.onButtonClick(b, _);
122
- }
123
- return (b, _) => (d(), m("div", {
124
- class: D(a.classes)
125
- }, [
126
- (d(!0), m(Ht, null, Ot(a.buttons, (x, K) => (d(), m("button", {
127
- key: x.id ?? K,
128
- type: "button",
129
- class: D(["tf-toast-button", x.className]),
130
- "aria-label": x.ariaLabel || void 0,
131
- onClick: it((R) => B(x, R), ["stop"]),
132
- onPointerdown: _[0] || (_[0] = it(() => {
133
- }, ["stop"])),
134
- onPointerup: _[1] || (_[1] = it(() => {
135
- }, ["stop"])),
136
- onPointercancel: _[2] || (_[2] = it(() => {
137
- }, ["stop"]))
138
- }, [
139
- x.label ? (d(), m("span", en, lt(x.label), 1)) : x.html ? (d(), m("span", {
140
- key: 1,
141
- innerHTML: x.html
142
- }, null, 8, nn)) : I("", !0)
143
- ], 42, tn))), 128))
144
- ], 2));
145
- }
146
- }), on = {}, sn = {
147
- xmlns: "http://www.w3.org/2000/svg",
148
- viewBox: "0 0 24 24",
149
- fill: "currentColor"
86
+ //#endregion
87
+ //#region src/components/ToastProgress.vue?vue&type=script&setup=true&lang.ts
88
+ var L = ["data-align"], R = /* @__PURE__ */ f({
89
+ __name: "ToastProgress",
90
+ props: {
91
+ type: {},
92
+ progressAlignment: { default: "right-to-left" }
93
+ },
94
+ setup(e) {
95
+ let t = e;
96
+ return (e, n) => (v(), l("div", {
97
+ class: "tf-toast-progress",
98
+ "data-align": t.progressAlignment
99
+ }, [u("div", { class: m(["tf-toast-progress-bar", `tf-toast-progress-bar--${t.type}`]) }, null, 2)], 8, L));
100
+ }
101
+ }), z = (e, t) => {
102
+ let n = e.__vccOpts || e;
103
+ for (let [e, r] of t) n[e] = r;
104
+ return n;
105
+ }, B = /* @__PURE__ */ z(R, [["__scopeId", "data-v-ab9c4177"]]), V = ["aria-label", "onClick"], H = { key: 0 }, U = ["innerHTML"], W = /* @__PURE__ */ f({
106
+ __name: "ToastButtonsGroup",
107
+ props: {
108
+ buttons: {},
109
+ classes: {},
110
+ onButtonClick: { type: Function }
111
+ },
112
+ setup(e) {
113
+ let t = e;
114
+ function n(e, n) {
115
+ t.onButtonClick(e, n);
116
+ }
117
+ return (t, r) => (v(), l("div", { class: m(e.classes) }, [(v(!0), l(i, null, b(e.buttons, (e, t) => (v(), l("button", {
118
+ key: e.id ?? t,
119
+ type: "button",
120
+ class: m(["tf-toast-button", e.className]),
121
+ "aria-label": e.ariaLabel || void 0,
122
+ onClick: O((t) => n(e, t), ["stop"]),
123
+ onPointerdown: r[0] ||= O(() => {}, ["stop"]),
124
+ onPointerup: r[1] ||= O(() => {}, ["stop"]),
125
+ onPointercancel: r[2] ||= O(() => {}, ["stop"])
126
+ }, [e.label ? (v(), l("span", H, C(e.label), 1)) : e.html ? (v(), l("span", {
127
+ key: 1,
128
+ innerHTML: e.html
129
+ }, null, 8, U)) : c("", !0)], 42, V))), 128))], 2));
130
+ }
131
+ }), G = {}, K = {
132
+ xmlns: "http://www.w3.org/2000/svg",
133
+ viewBox: "0 0 24 24",
134
+ fill: "currentColor"
150
135
  };
151
- function an(a, c) {
152
- return d(), m("svg", sn, [...c[0] || (c[0] = [
153
- P("path", {
154
- "fill-rule": "evenodd",
155
- d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",
156
- "clip-rule": "evenodd"
157
- }, null, -1)
158
- ])]);
136
+ function q(e, t) {
137
+ return v(), l("svg", K, [...t[0] ||= [u("path", {
138
+ "fill-rule": "evenodd",
139
+ d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",
140
+ "clip-rule": "evenodd"
141
+ }, null, -1)]]);
159
142
  }
160
- const rn = /* @__PURE__ */ E(on, [["render", an]]), ln = {}, un = {
161
- xmlns: "http://www.w3.org/2000/svg",
162
- viewBox: "0 0 24 24",
163
- fill: "currentColor"
143
+ var J = /* @__PURE__ */ z(G, [["render", q]]), te = {}, ne = {
144
+ xmlns: "http://www.w3.org/2000/svg",
145
+ viewBox: "0 0 24 24",
146
+ fill: "currentColor"
164
147
  };
165
- function cn(a, c) {
166
- return d(), m("svg", un, [...c[0] || (c[0] = [
167
- P("path", {
168
- "fill-rule": "evenodd",
169
- d: "M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",
170
- "clip-rule": "evenodd"
171
- }, null, -1)
172
- ])]);
148
+ function re(e, t) {
149
+ return v(), l("svg", ne, [...t[0] ||= [u("path", {
150
+ "fill-rule": "evenodd",
151
+ d: "M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",
152
+ "clip-rule": "evenodd"
153
+ }, null, -1)]]);
173
154
  }
174
- const fn = /* @__PURE__ */ E(ln, [["render", cn]]), dn = {}, pn = {
175
- xmlns: "http://www.w3.org/2000/svg",
176
- viewBox: "0 0 24 24",
177
- fill: "currentColor"
155
+ var ie = /* @__PURE__ */ z(te, [["render", re]]), ae = {}, oe = {
156
+ xmlns: "http://www.w3.org/2000/svg",
157
+ viewBox: "0 0 24 24",
158
+ fill: "currentColor"
178
159
  };
179
- function vn(a, c) {
180
- return d(), m("svg", pn, [...c[0] || (c[0] = [
181
- P("path", {
182
- "fill-rule": "evenodd",
183
- d: "M5.25 9a6.75 6.75 0 0 1 13.5 0v.75c0 2.123.8 4.057 2.118 5.52a.75.75 0 0 1-.297 1.206c-1.544.57-3.16.99-4.831 1.243a3.75 3.75 0 1 1-7.48 0 24.585 24.585 0 0 1-4.831-1.244.75.75 0 0 1-.298-1.205A8.217 8.217 0 0 0 5.25 9.75V9Zm4.502 8.9a2.25 2.25 0 1 0 4.496 0 25.057 25.057 0 0 1-4.496 0Z",
184
- "clip-rule": "evenodd"
185
- }, null, -1)
186
- ])]);
160
+ function se(e, t) {
161
+ return v(), l("svg", oe, [...t[0] ||= [u("path", {
162
+ "fill-rule": "evenodd",
163
+ d: "M5.25 9a6.75 6.75 0 0 1 13.5 0v.75c0 2.123.8 4.057 2.118 5.52a.75.75 0 0 1-.297 1.206c-1.544.57-3.16.99-4.831 1.243a3.75 3.75 0 1 1-7.48 0 24.585 24.585 0 0 1-4.831-1.244.75.75 0 0 1-.298-1.205A8.217 8.217 0 0 0 5.25 9.75V9Zm4.502 8.9a2.25 2.25 0 1 0 4.496 0 25.057 25.057 0 0 1-4.496 0Z",
164
+ "clip-rule": "evenodd"
165
+ }, null, -1)]]);
187
166
  }
188
- const mn = /* @__PURE__ */ E(dn, [["render", vn]]), hn = {}, gn = {
189
- xmlns: "http://www.w3.org/2000/svg",
190
- viewBox: "0 0 24 24",
191
- fill: "currentColor"
167
+ var ce = /* @__PURE__ */ z(ae, [["render", se]]), le = {}, ue = {
168
+ xmlns: "http://www.w3.org/2000/svg",
169
+ viewBox: "0 0 24 24",
170
+ fill: "currentColor"
192
171
  };
193
- function bn(a, c) {
194
- return d(), m("svg", gn, [...c[0] || (c[0] = [
195
- P("path", {
196
- "fill-rule": "evenodd",
197
- d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",
198
- "clip-rule": "evenodd"
199
- }, null, -1)
200
- ])]);
172
+ function de(e, t) {
173
+ return v(), l("svg", ue, [...t[0] ||= [u("path", {
174
+ "fill-rule": "evenodd",
175
+ d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",
176
+ "clip-rule": "evenodd"
177
+ }, null, -1)]]);
201
178
  }
202
- const yn = /* @__PURE__ */ E(hn, [["render", bn]]), wn = {}, Cn = {
203
- xmlns: "http://www.w3.org/2000/svg",
204
- viewBox: "0 0 24 24",
205
- fill: "currentColor"
179
+ var fe = /* @__PURE__ */ z(le, [["render", de]]), pe = {}, me = {
180
+ xmlns: "http://www.w3.org/2000/svg",
181
+ viewBox: "0 0 24 24",
182
+ fill: "currentColor"
206
183
  };
207
- function _n(a, c) {
208
- return d(), m("svg", Cn, [...c[0] || (c[0] = [
209
- P("path", {
210
- "fill-rule": "evenodd",
211
- d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm11.378-3.917c-.89-.777-2.366-.777-3.255 0a.75.75 0 0 1-.988-1.129c1.454-1.272 3.776-1.272 5.23 0 1.513 1.324 1.513 3.518 0 4.842a3.75 3.75 0 0 1-.837.552c-.676.328-1.028.774-1.028 1.152v.75a.75.75 0 0 1-1.5 0v-.75c0-1.279 1.06-2.107 1.875-2.502.182-.088.351-.199.503-.331.83-.727.83-1.857 0-2.584ZM12 18a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",
212
- "clip-rule": "evenodd"
213
- }, null, -1)
214
- ])]);
184
+ function he(e, t) {
185
+ return v(), l("svg", me, [...t[0] ||= [u("path", {
186
+ "fill-rule": "evenodd",
187
+ d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm11.378-3.917c-.89-.777-2.366-.777-3.255 0a.75.75 0 0 1-.988-1.129c1.454-1.272 3.776-1.272 5.23 0 1.513 1.324 1.513 3.518 0 4.842a3.75 3.75 0 0 1-.837.552c-.676.328-1.028.774-1.028 1.152v.75a.75.75 0 0 1-1.5 0v-.75c0-1.279 1.06-2.107 1.875-2.502.182-.088.351-.199.503-.331.83-.727.83-1.857 0-2.584ZM12 18a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",
188
+ "clip-rule": "evenodd"
189
+ }, null, -1)]]);
215
190
  }
216
- const ne = /* @__PURE__ */ E(wn, [["render", _n]]), An = {}, kn = {
217
- xmlns: "http://www.w3.org/2000/svg",
218
- viewBox: "0 0 24 24",
219
- fill: "currentColor"
191
+ var ge = /* @__PURE__ */ z(pe, [["render", he]]), _e = {}, ve = {
192
+ xmlns: "http://www.w3.org/2000/svg",
193
+ viewBox: "0 0 24 24",
194
+ fill: "currentColor"
220
195
  };
221
- function Sn(a, c) {
222
- return d(), m("svg", kn, [...c[0] || (c[0] = [
223
- P("path", {
224
- "fill-rule": "evenodd",
225
- d: "M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z",
226
- "clip-rule": "evenodd"
227
- }, null, -1)
228
- ])]);
196
+ function ye(e, t) {
197
+ return v(), l("svg", ve, [...t[0] ||= [u("path", {
198
+ "fill-rule": "evenodd",
199
+ d: "M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z",
200
+ "clip-rule": "evenodd"
201
+ }, null, -1)]]);
229
202
  }
230
- const Pn = /* @__PURE__ */ E(An, [["render", Sn]]), Tn = {}, Mn = {
231
- xmlns: "http://www.w3.org/2000/svg",
232
- viewBox: "0 0 24 24",
233
- fill: "currentColor"
203
+ var be = /* @__PURE__ */ z(_e, [["render", ye]]), xe = {}, Se = {
204
+ xmlns: "http://www.w3.org/2000/svg",
205
+ viewBox: "0 0 24 24",
206
+ fill: "currentColor"
234
207
  };
235
- function Ln(a, c) {
236
- return d(), m("svg", Mn, [...c[0] || (c[0] = [
237
- P("path", {
238
- "fill-rule": "evenodd",
239
- d: "M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",
240
- "clip-rule": "evenodd"
241
- }, null, -1)
242
- ])]);
208
+ function Ce(e, t) {
209
+ return v(), l("svg", Se, [...t[0] ||= [u("path", {
210
+ "fill-rule": "evenodd",
211
+ d: "M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",
212
+ "clip-rule": "evenodd"
213
+ }, null, -1)]]);
243
214
  }
244
- const Bn = /* @__PURE__ */ E(Tn, [["render", Ln]]), xn = ["role", "aria-live"], $n = ["aria-label", "data-align"], In = { class: "tf-toast-surface" }, Wn = {
245
- key: 0,
246
- class: "tf-toast-meta-row tf-toast-meta-row--top"
247
- }, Dn = {
248
- key: 0,
249
- class: "tf-toast-meta tf-toast-meta--left"
250
- }, En = { class: "tf-toast-main-content" }, Hn = { class: "tf-toast-text" }, On = ["aria-label"], Kn = ["aria-label", "innerHTML"], Rn = ["aria-label"], Un = ["aria-label", "innerHTML"], Nn = {
251
- key: 0,
252
- class: "tf-toast-created-at"
253
- }, zn = ["aria-label"], Fn = {
254
- key: 1,
255
- class: "tf-toast-meta tf-toast-meta--right"
256
- }, Vn = {
257
- key: 1,
258
- class: "tf-toast-meta-row tf-toast-meta-row--bottom"
259
- }, Zn = {
260
- key: 0,
261
- class: "tf-toast-floating-bar"
262
- }, jn = {
263
- key: 0,
264
- class: "tf-toast-created-at-float"
265
- }, Xn = ["aria-label"], Et = 8, Yn = 0.35, Qn = 96, oe = 160, Gn = 140, qn = /* @__PURE__ */ Ct({
266
- __name: "Toast",
267
- props: {
268
- toast: {},
269
- progressResetKey: {},
270
- duplicateKey: {},
271
- updateKey: {},
272
- bumpAnimationClass: {},
273
- clearAllAnimationClass: {},
274
- updateAnimationClass: {}
275
- },
276
- emits: ["dismiss"],
277
- setup(a, { emit: c }) {
278
- const B = a, {
279
- toast: b,
280
- progressResetKey: _,
281
- duplicateKey: x,
282
- updateKey: K,
283
- bumpAnimationClass: R,
284
- clearAllAnimationClass: X,
285
- updateAnimationClass: tt
286
- } = Fe(B), Y = c, et = re(Rt, null) ?? T();
287
- function ct(t) {
288
- return typeof t == "string" && ze.has(t) ? t : "default";
289
- }
290
- const l = u(function() {
291
- const t = Dt(b.value.createdAt) ? b.value.createdAt : Date.now();
292
- return {
293
- ...et.getConfig(),
294
- ...b.value,
295
- createdAt: t,
296
- id: b.value.id ?? `toast-${t}`,
297
- type: ct(b.value.type),
298
- title: b.value.title ?? "",
299
- description: b.value.description ?? "",
300
- progressBar: b.value.progressBar ?? !1,
301
- duration: b.value.duration ?? 1 / 0
302
- };
303
- }), M = {
304
- success: {
305
- accent: "tf-toast-accent--success",
306
- icon: "tf-toast-icon--success",
307
- close: "tf-toast-close--success",
308
- component: rn
309
- },
310
- error: {
311
- accent: "tf-toast-accent--error",
312
- icon: "tf-toast-icon--error",
313
- close: "tf-toast-close--error",
314
- component: fn
315
- },
316
- warning: {
317
- accent: "tf-toast-accent--warning",
318
- icon: "tf-toast-icon--warning",
319
- close: "tf-toast-close--warning",
320
- component: mn
321
- },
322
- info: {
323
- accent: "tf-toast-accent--info",
324
- icon: "tf-toast-icon--info",
325
- close: "tf-toast-close--info",
326
- component: yn
327
- },
328
- default: {
329
- accent: "tf-toast-accent--default",
330
- icon: "tf-toast-icon--default",
331
- close: "tf-toast-close--default",
332
- component: ne
333
- },
334
- loading: {
335
- accent: "tf-toast-accent--loading",
336
- icon: "tf-toast-icon--loading",
337
- close: "tf-toast-close--loading",
338
- component: Pn
339
- },
340
- custom: {
341
- accent: "tf-toast-accent--custom",
342
- icon: "tf-toast-icon--custom",
343
- close: "tf-toast-close--custom",
344
- component: ne
345
- }
346
- }, Q = /* @__PURE__ */ new Set(["error", "warning"]), {
347
- accentClass: At,
348
- iconWrapperClass: G,
349
- closeWrapperClass: kt,
350
- defaultIconComponent: St
351
- } = Se(l), {
352
- role: Pt,
353
- ariaLive: Tt,
354
- hasCreatedAt: nt,
355
- createdAtText: F,
356
- createdAtAriaLabel: ft,
357
- titleAriaLabel: ot,
358
- descriptionAriaLabel: dt,
359
- toastAriaLabel: Mt
360
- } = Pe(l), { duration: U, progressStyle: e, showProgressBar: n, progressKeyLocal: s } = Te(l, _, x), { isBumped: f, isUpdated: k } = Me(x, K), {
361
- isHovered: Lt,
362
- handleMouseEnter: st,
363
- handleMouseLeave: pt,
364
- handlePointerDown: Bt,
365
- handlePointerUp: vt
366
- } = Le(l, et, U), {
367
- isSwipeEnabled: xt,
368
- swipeStyle: ue,
369
- handlePointerDown: ce,
370
- handlePointerMove: fe,
371
- handlePointerUp: de,
372
- handlePointerCancel: pe,
373
- consumeSuppressedClick: ve
374
- } = Be(l, Y), { handleClick: Ut, handleCloseClick: Nt } = xe(
375
- l,
376
- Y,
377
- ve
378
- ), {
379
- hasButtons: q,
380
- buttons: mt,
381
- buttonsPlacement: ht,
382
- buttonsClasses: gt,
383
- buttonsVarsStyle: me,
384
- handleButtonClick: bt
385
- } = $e(l), he = {
386
- iconColor: "--tf-toast-icon-color-override",
387
- bg: "--tf-toast-bg",
388
- color: "--tf-toast-color",
389
- borderColor: "--tf-toast-border-color",
390
- borderRadius: "--tf-toast-border-radius",
391
- borderWidth: "--tf-toast-border-width",
392
- padding: "--tf-toast-padding",
393
- fontFamily: "--tf-toast-font-family",
394
- gap: "--tf-toast-gap",
395
- titleColor: "--tf-toast-title-color",
396
- titleFontSize: "--tf-toast-title-font-size",
397
- titleFontWeight: "--tf-toast-title-font-weight",
398
- titleLineHeight: "--tf-toast-title-line-height",
399
- descriptionColor: "--tf-toast-description-color",
400
- descriptionFontSize: "--tf-toast-description-font-size",
401
- descriptionLineHeight: "--tf-toast-description-line-height",
402
- iconSize: "--tf-toast-icon-size",
403
- progressBarBg: "--tf-toast-progress-bar-bg",
404
- progressBg: "--tf-toast-progress-bg",
405
- progressHeight: "--tf-toast-progress-height",
406
- closeBg: "--tf-toast-close-bg",
407
- closeColor: "--tf-toast-close-color",
408
- closeBorderColor: "--tf-toast-close-border-color",
409
- closeSize: "--tf-toast-close-size",
410
- closeIconSize: "--tf-toast-close-icon-size",
411
- buttonBg: "--tf-toast-button-bg",
412
- buttonColor: "--tf-toast-button-color",
413
- buttonBorderColor: "--tf-toast-button-border-color",
414
- createdAtColor: "--tf-toast-created-at-color",
415
- createdAtBg: "--tf-toast-created-at-bg",
416
- createdAtBorderColor: "--tf-toast-created-at-border-color"
417
- }, ge = u(function() {
418
- const t = {}, p = me.value;
419
- for (const i of Object.keys(p)) {
420
- const v = p[i];
421
- v != null && (t[i] = v);
422
- }
423
- const r = l.value.css;
424
- if (!r)
425
- return t;
426
- if (r.accentColor) {
427
- const i = r.accentColor;
428
- t["--tf-toast-color"] = i, t["--tf-toast-title-color"] = i, t["--tf-toast-description-color"] = i, t["--tf-toast-progress-bar-bg"] = i;
429
- }
430
- r.color && (r.titleColor || (t["--tf-toast-title-color"] = r.color), r.descriptionColor || (t["--tf-toast-description-color"] = r.color));
431
- for (const [i, v] of Object.entries(he)) {
432
- const y = r[i];
433
- y != null && (t[v] = y);
434
- }
435
- return t;
436
- }), be = u(function() {
437
- return l.value.showIcon !== !1;
438
- });
439
- function ye(t) {
440
- Bt(t), ce(t);
441
- }
442
- function we(t) {
443
- fe(t);
444
- }
445
- function Ce(t) {
446
- de(t), vt(t);
447
- }
448
- function _e(t) {
449
- pe(t), vt(t);
450
- }
451
- const zt = u(function() {
452
- return q.value && ht.value === "left";
453
- }), Ae = u(function() {
454
- return q.value && ht.value === "right";
455
- }), Ft = u(function() {
456
- return q.value && ht.value === "top";
457
- }), Vt = u(function() {
458
- return q.value && ht.value === "bottom";
459
- }), ke = u(function() {
460
- return Ft.value || Vt.value;
461
- }), Zt = u(function() {
462
- return nt.value && !q.value;
463
- }), jt = u(function() {
464
- return nt.value && q.value;
465
- });
466
- function Se(t) {
467
- const p = u(function() {
468
- return t.value.theme ? t.value.theme.startsWith("tf-toast-accent--") ? t.value.theme : `tf-toast-accent--${t.value.theme}` : M[t.value.type].accent;
469
- }), r = u(function() {
470
- return M[t.value.type].icon;
471
- }), i = u(function() {
472
- return M[t.value.type].close;
473
- }), v = u(function() {
474
- return M[t.value.type].component;
475
- });
476
- return {
477
- accentClass: p,
478
- iconWrapperClass: r,
479
- closeWrapperClass: i,
480
- defaultIconComponent: v
481
- };
482
- }
483
- function Pe(t) {
484
- const p = u(function() {
485
- return Q.has(t.value.type) ? "alert" : "status";
486
- }), r = u(function() {
487
- return Q.has(t.value.type) ? "assertive" : "polite";
488
- }), i = u(function() {
489
- return !!(t.value.showCreatedAt && Dt(t.value.createdAt));
490
- }), v = u(function() {
491
- if (!i.value)
492
- return "";
493
- const A = t.value.createdAtFormatter;
494
- if (typeof A != "function")
495
- return ee(t.value.createdAt);
496
- try {
497
- return A(t.value.createdAt);
498
- } catch (W) {
499
- console.error(
500
- "[vue-toastflow] Something failed in createdAtFormatter",
501
- W
502
- );
503
- }
504
- return ee(t.value.createdAt);
505
- }), y = u(function() {
506
- return v.value ? `Sent at ${v.value}` : "";
507
- }), w = u(function() {
508
- return Qt(t.value.title);
509
- }), S = u(function() {
510
- return Qt(t.value.description);
511
- }), N = u(function() {
512
- const A = [];
513
- return w.value && A.push(w.value), S.value && A.push(S.value), i.value && y.value && A.push(y.value), A.length || A.push(`${t.value.type} notification`), A.join(". ");
514
- });
515
- return {
516
- role: p,
517
- ariaLive: r,
518
- hasCreatedAt: i,
519
- createdAtText: v,
520
- createdAtAriaLabel: y,
521
- titleAriaLabel: w,
522
- descriptionAriaLabel: S,
523
- toastAriaLabel: N
524
- };
525
- }
526
- function Te(t, p, r) {
527
- const i = u(function() {
528
- if (Dt(t.value.duration))
529
- return t.value.duration;
530
- }), v = u(function() {
531
- return i.value ? {
532
- "--tf-toast-progress-duration": `${i.value}ms`
533
- } : {};
534
- }), y = u(function() {
535
- return t.value.progressBar && !!i.value;
536
- }), w = C(0);
537
- return j(
538
- () => p?.value,
539
- function(S) {
540
- S != null && (w.value += 1);
541
- }
542
- ), j(
543
- () => r?.value,
544
- function(S) {
545
- S != null && (w.value += 1);
546
- }
547
- ), {
548
- duration: i,
549
- progressStyle: v,
550
- showProgressBar: y,
551
- progressKeyLocal: w
552
- };
553
- }
554
- function Me(t, p) {
555
- const r = C(!1), i = C(!1);
556
- function v() {
557
- r.value = !1, requestAnimationFrame(function() {
558
- r.value = !0;
559
- });
560
- }
561
- function y() {
562
- i.value = !1, requestAnimationFrame(function() {
563
- i.value = !0;
564
- });
565
- }
566
- return j(
567
- () => t?.value,
568
- function(w) {
569
- w != null && v();
570
- }
571
- ), j(
572
- () => p?.value,
573
- function(w) {
574
- w != null && y();
575
- }
576
- ), {
577
- isBumped: r,
578
- isUpdated: i
579
- };
580
- }
581
- function Le(t, p, r) {
582
- const i = C(!1);
583
- let v = "";
584
- function y() {
585
- v === "touch" || v === "pen" || A() && H();
586
- }
587
- function w() {
588
- if (v === "touch" || v === "pen") {
589
- v = "";
590
- return;
591
- }
592
- A() && O();
593
- }
594
- function S(L) {
595
- v = L.pointerType, A(L, !0) && H();
596
- }
597
- function N(L) {
598
- A(L, !0) && O();
599
- }
600
- function A(L, g = !1) {
601
- return !r.value || !t.value.pauseOnHover ? !1 : !(g && L && !W(L));
602
- }
603
- function W(L) {
604
- return L.pointerType === "touch" || L.pointerType === "pen";
605
- }
606
- function H() {
607
- i.value = !0, p.pause(t.value.id);
608
- }
609
- function O() {
610
- i.value = !1, p.resume(t.value.id);
611
- }
612
- return {
613
- isHovered: i,
614
- handleMouseEnter: y,
615
- handleMouseLeave: w,
616
- handlePointerDown: S,
617
- handlePointerUp: N
618
- };
619
- }
620
- function Be(t, p) {
621
- const r = u(function() {
622
- return !!t.value.swipeToDismiss;
623
- }), i = C(0), v = C(1), y = C(!1), w = C(!1), S = C(null), N = C(0), A = C(0), W = C(0), H = C(!1), O = C(!1), L = C(!1);
624
- let g = null;
625
- const $t = u(function() {
626
- return !r.value && i.value === 0 && v.value === 1 ? {} : {
627
- transform: `translate3d(${i.value}px, 0, 0)`,
628
- opacity: v.value,
629
- transition: y.value ? "none" : `transform ${oe}ms ease, opacity ${oe}ms ease`
630
- };
631
- });
632
- function at() {
633
- g && (clearTimeout(g), g = null);
634
- }
635
- function yt() {
636
- S.value = null, H.value = !1, O.value = !1, L.value = !1, W.value = 0;
637
- }
638
- function rt() {
639
- y.value = !1, !(i.value === 0 && v.value === 1) && (i.value = 0, v.value = 1);
640
- }
641
- function It(h) {
642
- return S.value !== null && S.value === h.pointerId;
643
- }
644
- function Gt(h) {
645
- const $ = h.currentTarget;
646
- if ($?.releasePointerCapture)
647
- try {
648
- $.releasePointerCapture(h.pointerId);
649
- } catch {
650
- }
651
- }
652
- function We(h) {
653
- return !r.value || h.button !== void 0 && h.button !== 0 ? !1 : !Ie(h.target);
654
- }
655
- function De(h) {
656
- if (!We(h))
657
- return;
658
- at(), w.value = !1, y.value = !1, S.value = h.pointerId, N.value = h.clientX, A.value = h.clientY;
659
- const $ = h.currentTarget;
660
- if (W.value = $?.getBoundingClientRect().width ?? 0, $?.setPointerCapture)
661
- try {
662
- $.setPointerCapture(h.pointerId);
663
- } catch {
664
- }
665
- }
666
- function Ee(h) {
667
- if (!It(h) || O.value)
668
- return;
669
- const $ = h.clientX - N.value, Wt = h.clientY - A.value, qt = Math.abs($), Jt = Math.abs(Wt);
670
- if (!H.value) {
671
- if (qt < Et && Jt < Et)
672
- return;
673
- if ($ <= 0 || Jt > qt) {
674
- O.value = !0, rt();
675
- return;
676
- }
677
- H.value = !0;
678
- }
679
- h.preventDefault(), y.value = !0, L.value = !0;
680
- const te = Math.max(0, $), Re = W.value > 0 ? W.value : 1, Ue = Math.min(te / Re, 1);
681
- i.value = te, v.value = Math.max(1 - Ue * 0.85, 0.15);
682
- }
683
- function He(h) {
684
- if (!It(h))
685
- return;
686
- if (Gt(h), !H.value || O.value || !L.value) {
687
- rt(), yt();
688
- return;
689
- }
690
- const $ = W.value > 0 ? W.value : 1, Wt = Math.max(
691
- $ * Yn,
692
- Qn
693
- );
694
- i.value >= Wt ? (y.value = !1, w.value = !0, i.value = $ + 24, v.value = 0, g = setTimeout(function() {
695
- p("dismiss", t.value.id), g = null;
696
- }, Gn)) : (i.value > Et && (w.value = !0), rt()), yt();
697
- }
698
- function Oe(h) {
699
- It(h) && (Gt(h), rt(), yt());
700
- }
701
- function Ke() {
702
- return w.value ? (w.value = !1, !0) : !1;
703
- }
704
- return j(r, function(h) {
705
- h || (at(), rt(), yt());
706
- }), ie(function() {
707
- at();
708
- }), {
709
- isSwipeEnabled: r,
710
- swipeStyle: $t,
711
- handlePointerDown: De,
712
- handlePointerMove: Ee,
713
- handlePointerUp: He,
714
- handlePointerCancel: Oe,
715
- consumeSuppressedClick: Ke
716
- };
717
- }
718
- function xe(t, p, r) {
719
- function i(y) {
720
- if (r && r())
721
- return;
722
- const w = Xt(t.value);
723
- t.value.onClick && t.value.onClick(w, y), t.value.closeOnClick && v();
724
- }
725
- function v() {
726
- p("dismiss", t.value.id);
727
- }
728
- return {
729
- handleClick: i,
730
- handleCloseClick: v
731
- };
732
- }
733
- function $e(t) {
734
- const p = u(function() {
735
- return t.value.buttons?.buttons ?? [];
736
- }), r = u(function() {
737
- return t.value.buttons?.layout ?? "row";
738
- }), i = u(function() {
739
- const g = t.value.buttons?.alignment ?? "bottom-right";
740
- return t.value.alignment !== "right" ? g : g.endsWith("-left") ? g.replace(/-left$/, "-right") : g.endsWith("-right") ? g.replace(/-right$/, "-left") : g;
741
- }), v = u(function() {
742
- return p.value.length > 0;
743
- }), y = u(function() {
744
- return i.value.endsWith("-left") ? "left" : "right";
745
- }), w = u(function() {
746
- const g = i.value;
747
- return g.startsWith("top-") ? "top" : g.startsWith("bottom-") ? "bottom" : "center";
748
- }), S = u(function() {
749
- if (r.value === "row")
750
- return y.value;
751
- const g = w.value;
752
- return g === "top" ? "top" : g === "bottom" ? "bottom" : y.value;
753
- }), N = u(function() {
754
- return S.value === "left" || S.value === "right";
755
- }), A = u(function() {
756
- return y.value === "left" ? "tf-toast-actions--start" : "tf-toast-actions--end";
757
- }), W = u(function() {
758
- return {
759
- "--tf-toast-buttons-gap": t.value.buttons?.gap,
760
- "--tf-toast-buttons-content-gap": t.value.buttons?.contentGap
761
- };
762
- }), H = u(function() {
763
- if (!N.value)
764
- return;
765
- const g = w.value;
766
- if (g === "bottom")
767
- return "tf-toast-buttons--bottom";
768
- if (g === "center")
769
- return "tf-toast-buttons--center";
770
- }), O = u(function() {
771
- return [
772
- "tf-toast-actions",
773
- A.value,
774
- H.value
775
- ];
776
- });
777
- function L(g, $t) {
778
- const at = Xt(t.value);
779
- g.onClick && g.onClick(at, $t);
780
- }
781
- return {
782
- hasButtons: v,
783
- buttons: p,
784
- buttonsPlacement: S,
785
- buttonsClasses: O,
786
- buttonsVarsStyle: W,
787
- handleButtonClick: L
788
- };
789
- }
790
- function Ie(t) {
791
- return t instanceof Element ? !!t.closest(
792
- "button, a, input, textarea, select, option, [role='button'], [contenteditable='true']"
793
- ) : !1;
794
- }
795
- function Xt(t) {
796
- return {
797
- id: t.id,
798
- position: t.position,
799
- type: t.type,
800
- title: t.title,
801
- description: t.description,
802
- createdAt: t.createdAt
803
- };
804
- }
805
- function Yt(t) {
806
- return t.replace(/\s+/g, " ").trim();
807
- }
808
- function Qt(t) {
809
- if (!t)
810
- return "";
811
- const p = Yt(t.replace(/<[^>]*>/g, " "));
812
- if (typeof window > "u" || !window.document)
813
- return p;
814
- try {
815
- const r = window.document.createElement("div");
816
- return r.innerHTML = t, Yt(r.textContent ?? "");
817
- } catch {
818
- return p;
819
- }
820
- }
821
- return (t, p) => (d(), m("div", {
822
- role: o(Pt),
823
- "aria-live": o(Tt),
824
- class: "tf-toast-wrapper",
825
- style: z(o(ue))
826
- }, [
827
- P("div", {
828
- class: D(["tf-toast", [
829
- o(At),
830
- o(f) && l.value.phase !== "leaving" && l.value.phase !== "clear-all" && o(R),
831
- o(k) && l.value.phase !== "leaving" && l.value.phase !== "clear-all" && o(tt),
832
- l.value.phase === "clear-all" && o(X),
833
- o(Lt) && "tf-toast--paused",
834
- o(xt) && "tf-toast--swipe-enabled"
835
- ]]),
836
- "aria-label": o(Mt) || void 0,
837
- "data-align": l.value.alignment,
838
- style: z(ge.value),
839
- onClick: p[1] || (p[1] = //@ts-ignore
840
- (...r) => o(Ut) && o(Ut)(...r)),
841
- onMouseenter: p[2] || (p[2] = //@ts-ignore
842
- (...r) => o(st) && o(st)(...r)),
843
- onMouseleave: p[3] || (p[3] = //@ts-ignore
844
- (...r) => o(pt) && o(pt)(...r)),
845
- onPointerdown: ye,
846
- onPointermove: we,
847
- onPointerup: Ce,
848
- onPointercancel: _e
849
- }, [
850
- P("div", In, [
851
- Ft.value ? (d(), m("div", Wn, [
852
- J(wt, {
853
- buttons: o(mt),
854
- classes: o(gt),
855
- "on-button-click": o(bt)
856
- }, null, 8, ["buttons", "classes", "on-button-click"])
857
- ])) : I("", !0),
858
- P("div", {
859
- class: D(["tf-toast-main", [
860
- ke.value && "tf-toast-main--full",
861
- zt.value && "tf-toast-main--content-end"
862
- ]])
863
- }, [
864
- zt.value ? (d(), m("div", Dn, [
865
- J(wt, {
866
- buttons: o(mt),
867
- classes: o(gt),
868
- "on-button-click": o(bt)
869
- }, null, 8, ["buttons", "classes", "on-button-click"])
870
- ])) : I("", !0),
871
- P("div", En, [
872
- be.value ? (d(), m("div", {
873
- key: 0,
874
- class: D(["tf-toast-icon", o(G)]),
875
- "aria-hidden": "true"
876
- }, [
877
- Z(t.$slots, "icon", { toast: l.value }, () => [
878
- (d(), Kt(Ve(o(St)), {
879
- class: D(["tf-toast-icon-svg", [l.value.type === "loading" && "tf-toast-icon-spin"]]),
880
- "aria-hidden": "true"
881
- }, null, 8, ["class"]))
882
- ], !0)
883
- ], 2)) : I("", !0),
884
- P("div", {
885
- class: D(["tf-toast-body", [Zt.value && "tf-toast-body--has-created-at"]])
886
- }, [
887
- P("div", Hn, [
888
- l.value.title && !l.value.supportHtml ? (d(), m("p", {
889
- key: 0,
890
- "aria-label": o(ot) || void 0,
891
- class: "tf-toast-title"
892
- }, lt(l.value.title), 9, On)) : l.value.title && l.value.supportHtml ? (d(), m("p", {
893
- key: 1,
894
- class: "tf-toast-title",
895
- "aria-label": o(ot) || void 0,
896
- innerHTML: l.value.title
897
- }, null, 8, Kn)) : I("", !0),
898
- l.value.description && !l.value.supportHtml ? (d(), m("p", {
899
- key: 2,
900
- "aria-label": o(dt) || void 0,
901
- class: "tf-toast-description"
902
- }, lt(l.value.description), 9, Rn)) : l.value.description && l.value.supportHtml ? (d(), m("p", {
903
- key: 3,
904
- class: "tf-toast-description",
905
- "aria-label": o(dt) || void 0,
906
- innerHTML: l.value.description
907
- }, null, 8, Un)) : I("", !0)
908
- ]),
909
- Z(t.$slots, "default", { toast: l.value }, void 0, !0),
910
- Zt.value ? (d(), m("div", Nn, [
911
- Z(t.$slots, "created-at", {
912
- toast: l.value,
913
- formatted: o(F)
914
- }, () => [
915
- P("span", {
916
- "aria-label": o(ft) || void 0
917
- }, lt(o(F)), 9, zn)
918
- ], !0)
919
- ])) : I("", !0)
920
- ], 2)
921
- ]),
922
- Ae.value ? (d(), m("div", Fn, [
923
- J(wt, {
924
- buttons: o(mt),
925
- classes: o(gt),
926
- "on-button-click": o(bt)
927
- }, null, 8, ["buttons", "classes", "on-button-click"])
928
- ])) : I("", !0)
929
- ], 2),
930
- Vt.value ? (d(), m("div", Vn, [
931
- J(wt, {
932
- buttons: o(mt),
933
- classes: o(gt),
934
- "on-button-click": o(bt)
935
- }, null, 8, ["buttons", "classes", "on-button-click"])
936
- ])) : I("", !0),
937
- o(n) ? (d(), m("div", {
938
- key: 2,
939
- class: "tf-toast-progress-wrapper",
940
- style: z(o(e))
941
- }, [
942
- Z(t.$slots, "progress", { toast: l.value }, () => [
943
- (d(), Kt(Je, {
944
- key: o(s),
945
- type: l.value.type,
946
- "progress-alignment": l.value.progressAlignment
947
- }, null, 8, ["type", "progress-alignment"]))
948
- ], !0)
949
- ], 4)) : I("", !0)
950
- ]),
951
- jt.value || l.value.closeButton ? (d(), m("div", Zn, [
952
- jt.value ? (d(), m("div", jn, [
953
- Z(t.$slots, "created-at", {
954
- toast: l.value,
955
- formatted: o(F)
956
- }, () => [
957
- P("span", {
958
- "aria-label": o(ft) || void 0
959
- }, lt(o(F)), 9, Xn)
960
- ], !0)
961
- ])) : I("", !0),
962
- l.value.closeButton ? (d(), m("button", {
963
- key: 1,
964
- type: "button",
965
- class: D(["tf-toast-close", o(kt)]),
966
- "aria-label": "Close notification",
967
- onClick: p[0] || (p[0] = it(
968
- //@ts-ignore
969
- (...r) => o(Nt) && o(Nt)(...r),
970
- ["stop"]
971
- ))
972
- }, [
973
- Z(t.$slots, "close-icon", { toast: l.value }, () => [
974
- J(Bn, {
975
- class: "tf-toast-close-icon",
976
- "aria-hidden": "true"
977
- })
978
- ], !0)
979
- ], 2)) : I("", !0)
980
- ])) : I("", !0)
981
- ], 46, $n)
982
- ], 12, xn));
983
- }
984
- }), Jn = /* @__PURE__ */ E(qn, [["__scopeId", "data-v-012b51f7"]]), to = ["data-position"], se = 260, ae = 220, eo = /* @__PURE__ */ Ct({
985
- __name: "ToastContainer",
986
- setup(a) {
987
- const c = [
988
- "top-left",
989
- "top-center",
990
- "top-right",
991
- "bottom-left",
992
- "bottom-center",
993
- "bottom-right"
994
- ], b = re(Rt, null) ?? T(), _ = C([]), x = C({
995
- enter: se,
996
- leave: ae
997
- }), K = C({}), R = C({}), X = C({});
998
- let tt = null, Y = null;
999
- Ze(function() {
1000
- tt = b.subscribe(function(e) {
1001
- _.value = e.toasts;
1002
- }), Y = b.subscribeEvents(function(e) {
1003
- e.kind === "timer-reset" && (K.value[e.id] = Math.random()), e.kind === "duplicate" && (R.value[e.id] = Math.random()), e.kind === "update" && (X.value[e.id] = Math.random());
1004
- }), ft();
1005
- }), ie(function() {
1006
- tt && tt(), Y && Y();
1007
- });
1008
- function _t(e) {
1009
- return K.value[e] ?? 0;
1010
- }
1011
- function et(e) {
1012
- return R.value[e] ?? 0;
1013
- }
1014
- function ct(e) {
1015
- return X.value[e] ?? 0;
1016
- }
1017
- const l = u(function() {
1018
- const e = {
1019
- "top-left": [],
1020
- "top-center": [],
1021
- "top-right": [],
1022
- "bottom-left": [],
1023
- "bottom-center": [],
1024
- "bottom-right": []
1025
- };
1026
- for (const n of _.value)
1027
- e[n.position].push(n);
1028
- return e;
1029
- }), M = b.getConfig(), Q = C({
1030
- "top-left": { ...M, position: "top-left" },
1031
- "top-center": { ...M, position: "top-center" },
1032
- "top-right": { ...M, position: "top-right" },
1033
- "bottom-left": { ...M, position: "bottom-left" },
1034
- "bottom-center": { ...M, position: "bottom-center" },
1035
- "bottom-right": { ...M, position: "bottom-right" }
1036
- }), At = u(function() {
1037
- return _.value.length ? Math.max(..._.value.map((e) => e.zIndex)) : M.zIndex;
1038
- });
1039
- function G(e) {
1040
- return Q.value[e] ?? { ...M, position: e };
1041
- }
1042
- function kt(e) {
1043
- const { offset: n, width: s } = G(e), f = `calc(100vw - (${n}) - (${n}))`, k = { width: s, maxWidth: f };
1044
- return e.startsWith("top-") && (k.top = n), e.startsWith("bottom-") && (k.bottom = n), e.endsWith("left") ? k.left = n : e.endsWith("right") ? k.right = n : e.endsWith("center") && (k.left = "50%", k.transform = "translateX(-50%)"), k;
1045
- }
1046
- function St(e) {
1047
- return e.endsWith("left") ? "tf-toast-stack--left" : e.endsWith("center") ? "tf-toast-stack--center" : "tf-toast-stack--right";
1048
- }
1049
- function Pt(e) {
1050
- return e.startsWith("bottom-") ? "tf-toast-stack-inner--bottom" : null;
1051
- }
1052
- function Tt(e) {
1053
- return G(e).overflowScroll && e.startsWith("top-");
1054
- }
1055
- function nt(e) {
1056
- b.dismiss(e);
1057
- }
1058
- function F(e, n) {
1059
- const s = e.trim().toLowerCase();
1060
- if (!s)
1061
- return n;
1062
- if (s.endsWith("ms")) {
1063
- const k = Number(s.slice(0, -2));
1064
- return Number.isFinite(k) ? k : n;
1065
- }
1066
- if (s.endsWith("s")) {
1067
- const k = Number(s.slice(0, -1));
1068
- return Number.isFinite(k) ? k * 1e3 : n;
1069
- }
1070
- const f = Number(s);
1071
- return Number.isFinite(f) ? f : n;
1072
- }
1073
- function ft() {
1074
- if (typeof window > "u")
1075
- return;
1076
- const e = getComputedStyle(document.documentElement);
1077
- x.value = {
1078
- enter: F(
1079
- e.getPropertyValue("--tf-toast-animation-in-duration"),
1080
- se
1081
- ),
1082
- leave: F(
1083
- e.getPropertyValue("--tf-toast-animation-out-duration"),
1084
- ae
1085
- )
1086
- };
1087
- }
1088
- const ot = /* @__PURE__ */ new WeakMap();
1089
- je(function() {
1090
- const e = document.querySelectorAll(".tf-toast-item");
1091
- for (let n = 0; n < e.length; n++) {
1092
- const s = e[n], f = s.parentElement;
1093
- f && ot.set(s, {
1094
- top: s.offsetTop,
1095
- height: s.offsetHeight,
1096
- parentHeight: f.clientHeight,
1097
- parentWidth: f.clientWidth
1098
- });
1099
- }
1100
- });
1101
- function dt(e) {
1102
- const n = e, s = n.parentElement;
1103
- if (!s || s.children.length <= 1)
1104
- return;
1105
- const f = ot.get(n), Lt = (n.dataset.position ?? "").startsWith("bottom-") || s.classList.contains("tf-toast-stack-inner--bottom"), st = f?.top ?? n.offsetTop, pt = f?.height ?? n.offsetHeight, Bt = f?.parentHeight ?? s.clientHeight, vt = f?.parentWidth ?? s.clientWidth;
1106
- if (n.style.position = "absolute", n.style.zIndex = "0", n.style.width = `${vt}px`, n.style.left = "0", n.style.right = "0", Lt) {
1107
- const xt = Bt - (st + pt);
1108
- n.style.bottom = `${xt}px`, n.style.top = "auto";
1109
- } else
1110
- n.style.top = `${st}px`, n.style.bottom = "auto";
1111
- }
1112
- function Mt(e) {
1113
- const n = e;
1114
- n.style.position = "", n.style.zIndex = "", n.style.width = "", n.style.left = "", n.style.right = "", n.style.top = "", n.style.bottom = "";
1115
- }
1116
- j(
1117
- _,
1118
- function(e) {
1119
- const n = new Set(
1120
- e.map(function(s) {
1121
- return s.id;
1122
- })
1123
- );
1124
- for (const s of Object.keys(K.value))
1125
- n.has(s) || delete K.value[s];
1126
- for (const s of Object.keys(R.value))
1127
- n.has(s) || delete R.value[s];
1128
- for (const s of Object.keys(X.value))
1129
- n.has(s) || delete X.value[s];
1130
- },
1131
- { deep: !1 }
1132
- );
1133
- function U(e) {
1134
- return {
1135
- ...M.animation,
1136
- ...e.animation
1137
- };
1138
- }
1139
- return j(
1140
- l,
1141
- function(e) {
1142
- const n = { ...Q.value };
1143
- Object.keys(e).forEach(function(s) {
1144
- const f = e[s][0];
1145
- f && (n[s] = {
1146
- ...M,
1147
- ...f,
1148
- position: s,
1149
- animation: {
1150
- ...M.animation,
1151
- ...f.animation
1152
- }
1153
- });
1154
- }), Q.value = n;
1155
- },
1156
- { deep: !1 }
1157
- ), (e, n) => (d(), m("div", {
1158
- class: "tf-toast-root",
1159
- style: z({ zIndex: At.value })
1160
- }, [
1161
- (d(), m(Ht, null, Ot(c, (s) => P("div", {
1162
- key: s,
1163
- class: D(["tf-toast-stack", St(s)]),
1164
- style: z(kt(s))
1165
- }, [
1166
- J(Xe, {
1167
- appear: "",
1168
- duration: x.value,
1169
- name: G(s).animation.name,
1170
- onBeforeLeave: dt,
1171
- onAfterLeave: Mt,
1172
- tag: "div",
1173
- class: D([
1174
- "tf-toast-stack-inner",
1175
- Pt(s),
1176
- Tt(s) && "tf-toast-stack-inner--scroll"
1177
- ]),
1178
- style: z({ gap: G(s).gap })
1179
- }, {
1180
- default: Ye(() => [
1181
- (d(!0), m(Ht, null, Ot(l.value[s], (f, k) => (d(), m("div", {
1182
- key: f.id,
1183
- class: "tf-toast-item",
1184
- style: z({ width: f.width, maxWidth: "100%" }),
1185
- "data-position": f.position
1186
- }, [
1187
- P("div", {
1188
- class: "tf-toast-motion",
1189
- style: z({ "--tf-toast-index": k })
1190
- }, [
1191
- e.$slots.default ? Z(e.$slots, "default", {
1192
- key: 0,
1193
- toast: f,
1194
- progressResetKey: _t(f.id),
1195
- duplicateKey: et(f.id),
1196
- updateKey: ct(f.id),
1197
- bumpAnimationClass: U(f).bump,
1198
- clearAllAnimationClass: U(f).clearAll,
1199
- updateAnimationClass: U(f).update,
1200
- dismiss: nt
1201
- }, void 0, !0) : (d(), Kt(Jn, {
1202
- key: 1,
1203
- toast: f,
1204
- progressResetKey: _t(f.id),
1205
- duplicateKey: et(f.id),
1206
- updateKey: ct(f.id),
1207
- bumpAnimationClass: U(f).bump,
1208
- clearAllAnimationClass: U(f).clearAll,
1209
- updateAnimationClass: U(f).update,
1210
- onDismiss: nt
1211
- }, null, 8, ["toast", "progressResetKey", "duplicateKey", "updateKey", "bumpAnimationClass", "clearAllAnimationClass", "updateAnimationClass"]))
1212
- ], 4)
1213
- ], 12, to))), 128))
1214
- ]),
1215
- _: 2
1216
- }, 1032, ["duration", "name", "class", "style"])
1217
- ], 6)), 64))
1218
- ], 4));
1219
- }
1220
- }), ro = /* @__PURE__ */ E(eo, [["__scopeId", "data-v-c03eb678"]]);
1221
- export {
1222
- Pn as ArrowPath,
1223
- mn as Bell,
1224
- rn as CheckCircle,
1225
- yn as InfoCircle,
1226
- ne as QuestionMarkCircle,
1227
- Jn as Toast,
1228
- ro as ToastContainer,
1229
- Je as ToastProgress,
1230
- fn as XCircle,
1231
- Bn as XMark,
1232
- ao as createToastflow,
1233
- T as getToastStore,
1234
- Qe as setToastStore,
1235
- so as toast
1236
- };
215
+ var we = /* @__PURE__ */ z(xe, [["render", Ce]]), Te = ["role", "aria-live"], Ee = ["aria-label", "data-align"], De = { class: "tf-toast-surface" }, Oe = {
216
+ key: 0,
217
+ class: "tf-toast-meta-row tf-toast-meta-row--top"
218
+ }, ke = {
219
+ key: 0,
220
+ class: "tf-toast-meta tf-toast-meta--left"
221
+ }, Ae = { class: "tf-toast-main-content" }, je = { class: "tf-toast-text" }, Me = ["aria-label"], Ne = ["aria-label", "innerHTML"], Pe = ["aria-label"], Fe = ["aria-label", "innerHTML"], Ie = {
222
+ key: 0,
223
+ class: "tf-toast-created-at"
224
+ }, Le = ["aria-label"], Re = {
225
+ key: 1,
226
+ class: "tf-toast-meta tf-toast-meta--right"
227
+ }, ze = {
228
+ key: 1,
229
+ class: "tf-toast-meta-row tf-toast-meta-row--bottom"
230
+ }, Be = {
231
+ key: 0,
232
+ class: "tf-toast-floating-bar"
233
+ }, Ve = {
234
+ key: 0,
235
+ class: "tf-toast-created-at-float"
236
+ }, He = ["aria-label"], Ue = 8, We = .35, Ge = 96, Ke = 160, qe = 140, Je = /* @__PURE__ */ z(/* @__PURE__ */ f({
237
+ __name: "Toast",
238
+ props: {
239
+ toast: {},
240
+ progressResetKey: {},
241
+ duplicateKey: {},
242
+ updateKey: {},
243
+ bumpAnimationClass: {},
244
+ clearAllAnimationClass: {},
245
+ updateAnimationClass: {}
246
+ },
247
+ emits: ["dismiss"],
248
+ setup(t, { emit: i }) {
249
+ let { toast: a, progressResetKey: f, duplicateKey: g, updateKey: _, bumpAnimationClass: b, clearAllAnimationClass: D, updateAnimationClass: A } = w(t), j = i, M = p(k, null) ?? N();
250
+ function P(t) {
251
+ return typeof t == "string" && e.has(t) ? t : "default";
252
+ }
253
+ let F = o(function() {
254
+ let e = r(a.value.createdAt) ? a.value.createdAt : Date.now();
255
+ return {
256
+ ...M.getConfig(),
257
+ ...a.value,
258
+ createdAt: e,
259
+ id: a.value.id ?? `toast-${e}`,
260
+ type: P(a.value.type),
261
+ title: a.value.title ?? "",
262
+ description: a.value.description ?? "",
263
+ progressBar: a.value.progressBar ?? !1,
264
+ duration: a.value.duration ?? Infinity
265
+ };
266
+ }), I = {
267
+ success: {
268
+ accent: "tf-toast-accent--success",
269
+ icon: "tf-toast-icon--success",
270
+ close: "tf-toast-close--success",
271
+ component: J
272
+ },
273
+ error: {
274
+ accent: "tf-toast-accent--error",
275
+ icon: "tf-toast-icon--error",
276
+ close: "tf-toast-close--error",
277
+ component: ie
278
+ },
279
+ warning: {
280
+ accent: "tf-toast-accent--warning",
281
+ icon: "tf-toast-icon--warning",
282
+ close: "tf-toast-close--warning",
283
+ component: ce
284
+ },
285
+ info: {
286
+ accent: "tf-toast-accent--info",
287
+ icon: "tf-toast-icon--info",
288
+ close: "tf-toast-close--info",
289
+ component: fe
290
+ },
291
+ default: {
292
+ accent: "tf-toast-accent--default",
293
+ icon: "tf-toast-icon--default",
294
+ close: "tf-toast-close--default",
295
+ component: ge
296
+ },
297
+ loading: {
298
+ accent: "tf-toast-accent--loading",
299
+ icon: "tf-toast-icon--loading",
300
+ close: "tf-toast-close--loading",
301
+ component: be
302
+ },
303
+ custom: {
304
+ accent: "tf-toast-accent--custom",
305
+ icon: "tf-toast-icon--custom",
306
+ close: "tf-toast-close--custom",
307
+ component: ge
308
+ }
309
+ }, L = new Set(["error", "warning"]), { accentClass: R, iconWrapperClass: z, closeWrapperClass: V, defaultIconComponent: H } = ht(F), { role: U, ariaLive: G, hasCreatedAt: K, createdAtText: q, createdAtAriaLabel: te, titleAriaLabel: ne, descriptionAriaLabel: re, toastAriaLabel: ae } = gt(F), { duration: oe, progressStyle: se, showProgressBar: le, progressKeyLocal: ue } = _t(F, f, g), { isBumped: de, isUpdated: pe } = vt(g, _), { isHovered: me, handleMouseEnter: he, handleMouseLeave: _e, handlePointerDown: ve, handlePointerUp: ye } = yt(F, M, oe), { isSwipeEnabled: xe, swipeStyle: Se, handlePointerDown: Ce, handlePointerMove: Je, handlePointerUp: Ye, handlePointerCancel: Xe, consumeSuppressedClick: Ze } = bt(F, j), { handleClick: Qe, handleCloseClick: $e } = xt(F, j, Ze), { hasButtons: Y, buttons: X, buttonsPlacement: Z, buttonsClasses: Q, buttonsVarsStyle: et, handleButtonClick: $ } = St(F), tt = {
310
+ iconColor: "--tf-toast-icon-color",
311
+ bg: "--tf-toast-bg",
312
+ color: "--tf-toast-color",
313
+ borderColor: "--tf-toast-border-color",
314
+ borderRadius: "--tf-toast-border-radius",
315
+ borderWidth: "--tf-toast-border-width",
316
+ padding: "--tf-toast-padding",
317
+ fontFamily: "--tf-toast-font-family",
318
+ gap: "--tf-toast-gap",
319
+ titleColor: "--tf-toast-title-color",
320
+ titleFontSize: "--tf-toast-title-font-size",
321
+ titleFontWeight: "--tf-toast-title-font-weight",
322
+ titleLineHeight: "--tf-toast-title-line-height",
323
+ descriptionColor: "--tf-toast-description-color",
324
+ descriptionFontSize: "--tf-toast-description-font-size",
325
+ descriptionLineHeight: "--tf-toast-description-line-height",
326
+ iconSize: "--tf-toast-icon-size",
327
+ progressBarBg: "--tf-toast-progress-bar-bg",
328
+ progressBg: "--tf-toast-progress-bg",
329
+ progressHeight: "--tf-toast-progress-height",
330
+ closeBg: "--tf-toast-close-bg",
331
+ closeColor: "--tf-toast-close-color",
332
+ closeBorderColor: "--tf-toast-close-border-color",
333
+ closeSize: "--tf-toast-close-size",
334
+ closeIconSize: "--tf-toast-close-icon-size",
335
+ buttonBg: "--tf-toast-button-bg",
336
+ buttonColor: "--tf-toast-button-color",
337
+ buttonBorderColor: "--tf-toast-button-border-color",
338
+ createdAtColor: "--tf-toast-created-at-color",
339
+ createdAtBg: "--tf-toast-created-at-bg",
340
+ createdAtBorderColor: "--tf-toast-created-at-border-color"
341
+ }, nt = o(function() {
342
+ let e = {}, t = et.value;
343
+ for (let n of Object.keys(t)) {
344
+ let r = t[n];
345
+ r != null && (e[n] = r);
346
+ }
347
+ let n = F.value.css;
348
+ if (!n) return e;
349
+ if (n.accentColor) {
350
+ let t = n.accentColor;
351
+ e["--tf-toast-accent-color"] = t, e["--tf-toast-color"] = t, e["--tf-toast-title-color"] = t, e["--tf-toast-description-color"] = t, e["--tf-toast-progress-bar-bg"] = t;
352
+ }
353
+ n.color && (n.titleColor || (e["--tf-toast-title-color"] = n.color), n.descriptionColor || (e["--tf-toast-description-color"] = n.color));
354
+ for (let [t, r] of Object.entries(tt)) {
355
+ let i = n[t];
356
+ i != null && (e[r] = i);
357
+ }
358
+ return e;
359
+ }), rt = o(function() {
360
+ return F.value.showIcon !== !1;
361
+ });
362
+ function it(e) {
363
+ ve(e), Ce(e);
364
+ }
365
+ function at(e) {
366
+ Je(e);
367
+ }
368
+ function ot(e) {
369
+ Ye(e), ye(e);
370
+ }
371
+ function st(e) {
372
+ Xe(e), ye(e);
373
+ }
374
+ let ct = o(function() {
375
+ return Y.value && Z.value === "left";
376
+ }), lt = o(function() {
377
+ return Y.value && Z.value === "right";
378
+ }), ut = o(function() {
379
+ return Y.value && Z.value === "top";
380
+ }), dt = o(function() {
381
+ return Y.value && Z.value === "bottom";
382
+ }), ft = o(function() {
383
+ return ut.value || dt.value;
384
+ }), pt = o(function() {
385
+ return K.value && !Y.value;
386
+ }), mt = o(function() {
387
+ return K.value && Y.value;
388
+ });
389
+ function ht(e) {
390
+ return {
391
+ accentClass: o(function() {
392
+ return e.value.theme ? e.value.theme.startsWith("tf-toast-accent--") ? e.value.theme : `tf-toast-accent--${e.value.theme}` : I[e.value.type].accent;
393
+ }),
394
+ iconWrapperClass: o(function() {
395
+ return I[e.value.type].icon;
396
+ }),
397
+ closeWrapperClass: o(function() {
398
+ return I[e.value.type].close;
399
+ }),
400
+ defaultIconComponent: o(function() {
401
+ return I[e.value.type].component;
402
+ })
403
+ };
404
+ }
405
+ function gt(e) {
406
+ let t = o(function() {
407
+ return L.has(e.value.type) ? "alert" : "status";
408
+ }), i = o(function() {
409
+ return L.has(e.value.type) ? "assertive" : "polite";
410
+ }), a = o(function() {
411
+ return !!(e.value.showCreatedAt && r(e.value.createdAt));
412
+ }), s = o(function() {
413
+ if (!a.value) return "";
414
+ let t = e.value.createdAtFormatter;
415
+ if (typeof t != "function") return n(e.value.createdAt);
416
+ try {
417
+ return t(e.value.createdAt);
418
+ } catch (e) {
419
+ console.error("[vue-toastflow] Something failed in createdAtFormatter", e);
420
+ }
421
+ return n(e.value.createdAt);
422
+ }), c = o(function() {
423
+ return s.value ? `Sent at ${s.value}` : "";
424
+ }), l = o(function() {
425
+ return Et(e.value.title);
426
+ }), u = o(function() {
427
+ return Et(e.value.description);
428
+ });
429
+ return {
430
+ role: t,
431
+ ariaLive: i,
432
+ hasCreatedAt: a,
433
+ createdAtText: s,
434
+ createdAtAriaLabel: c,
435
+ titleAriaLabel: l,
436
+ descriptionAriaLabel: u,
437
+ toastAriaLabel: o(function() {
438
+ let t = [];
439
+ return l.value && t.push(l.value), u.value && t.push(u.value), a.value && c.value && t.push(c.value), t.length || t.push(`${e.value.type} notification`), t.join(". ");
440
+ })
441
+ };
442
+ }
443
+ function _t(e, t, n) {
444
+ let i = o(function() {
445
+ if (r(e.value.duration)) return e.value.duration;
446
+ }), a = o(function() {
447
+ return i.value ? { "--tf-toast-progress-duration": `${i.value}ms` } : {};
448
+ }), s = o(function() {
449
+ return e.value.progressBar && !!i.value;
450
+ }), c = y(0);
451
+ return E(() => t?.value, function(e) {
452
+ e != null && (c.value += 1);
453
+ }), E(() => n?.value, function(e) {
454
+ e != null && (c.value += 1);
455
+ }), {
456
+ duration: i,
457
+ progressStyle: a,
458
+ showProgressBar: s,
459
+ progressKeyLocal: c
460
+ };
461
+ }
462
+ function vt(e, t) {
463
+ let n = y(!1), r = y(!1);
464
+ function i() {
465
+ n.value = !1, requestAnimationFrame(function() {
466
+ n.value = !0;
467
+ });
468
+ }
469
+ function a() {
470
+ r.value = !1, requestAnimationFrame(function() {
471
+ r.value = !0;
472
+ });
473
+ }
474
+ return E(() => e?.value, function(e) {
475
+ e != null && i();
476
+ }), E(() => t?.value, function(e) {
477
+ e != null && a();
478
+ }), {
479
+ isBumped: n,
480
+ isUpdated: r
481
+ };
482
+ }
483
+ function yt(e, t, n) {
484
+ let r = y(!1), i = "";
485
+ function a() {
486
+ i === "touch" || i === "pen" || l() && d();
487
+ }
488
+ function o() {
489
+ if (i === "touch" || i === "pen") {
490
+ i = "";
491
+ return;
492
+ }
493
+ l() && f();
494
+ }
495
+ function s(e) {
496
+ i = e.pointerType, l(e, !0) && d();
497
+ }
498
+ function c(e) {
499
+ l(e, !0) && f();
500
+ }
501
+ function l(t, r = !1) {
502
+ return !n.value || !e.value.pauseOnHover ? !1 : !(r && t && !u(t));
503
+ }
504
+ function u(e) {
505
+ return e.pointerType === "touch" || e.pointerType === "pen";
506
+ }
507
+ function d() {
508
+ r.value = !0, t.pause(e.value.id);
509
+ }
510
+ function f() {
511
+ r.value = !1, t.resume(e.value.id);
512
+ }
513
+ return {
514
+ isHovered: r,
515
+ handleMouseEnter: a,
516
+ handleMouseLeave: o,
517
+ handlePointerDown: s,
518
+ handlePointerUp: c
519
+ };
520
+ }
521
+ function bt(e, t) {
522
+ let n = o(function() {
523
+ return !!e.value.swipeToDismiss;
524
+ }), r = y(0), i = y(1), a = y(!1), s = y(!1), c = y(null), l = y(0), u = y(0), d = y(0), f = y(!1), p = y(!1), m = y(!1), h = null, g = o(function() {
525
+ return !n.value && r.value === 0 && i.value === 1 ? {} : {
526
+ transform: `translate3d(${r.value}px, 0, 0)`,
527
+ opacity: i.value,
528
+ transition: a.value ? "none" : `transform ${Ke}ms ease, opacity ${Ke}ms ease`
529
+ };
530
+ });
531
+ function _() {
532
+ h &&= (clearTimeout(h), null);
533
+ }
534
+ function v() {
535
+ c.value = null, f.value = !1, p.value = !1, m.value = !1, d.value = 0;
536
+ }
537
+ function b() {
538
+ a.value = !1, !(r.value === 0 && i.value === 1) && (r.value = 0, i.value = 1);
539
+ }
540
+ function x(e) {
541
+ return c.value !== null && c.value === e.pointerId;
542
+ }
543
+ function S(e) {
544
+ let t = e.currentTarget;
545
+ if (t?.releasePointerCapture) try {
546
+ t.releasePointerCapture(e.pointerId);
547
+ } catch {}
548
+ }
549
+ function C(e) {
550
+ return !n.value || e.button !== void 0 && e.button !== 0 ? !1 : !Ct(e.target);
551
+ }
552
+ function w(e) {
553
+ if (!C(e)) return;
554
+ _(), s.value = !1, a.value = !1, c.value = e.pointerId, l.value = e.clientX, u.value = e.clientY;
555
+ let t = e.currentTarget;
556
+ if (d.value = t?.getBoundingClientRect().width ?? 0, t?.setPointerCapture) try {
557
+ t.setPointerCapture(e.pointerId);
558
+ } catch {}
559
+ }
560
+ function T(e) {
561
+ if (!x(e) || p.value) return;
562
+ let t = e.clientX - l.value, n = e.clientY - u.value, o = Math.abs(t), s = Math.abs(n);
563
+ if (!f.value) {
564
+ if (o < Ue && s < Ue) return;
565
+ if (t <= 0 || s > o) {
566
+ p.value = !0, b();
567
+ return;
568
+ }
569
+ f.value = !0;
570
+ }
571
+ e.preventDefault(), a.value = !0, m.value = !0;
572
+ let c = Math.max(0, t), h = d.value > 0 ? d.value : 1, g = Math.min(c / h, 1);
573
+ r.value = c, i.value = Math.max(1 - g * .85, .15);
574
+ }
575
+ function D(n) {
576
+ if (!x(n)) return;
577
+ if (S(n), !f.value || p.value || !m.value) {
578
+ b(), v();
579
+ return;
580
+ }
581
+ let o = d.value > 0 ? d.value : 1, c = Math.max(o * We, Ge);
582
+ r.value >= c ? (a.value = !1, s.value = !0, r.value = o + 24, i.value = 0, h = setTimeout(function() {
583
+ t("dismiss", e.value.id), h = null;
584
+ }, qe)) : (r.value > Ue && (s.value = !0), b()), v();
585
+ }
586
+ function O(e) {
587
+ x(e) && (S(e), b(), v());
588
+ }
589
+ function k() {
590
+ return s.value ? (s.value = !1, !0) : !1;
591
+ }
592
+ return E(n, function(e) {
593
+ e || (_(), b(), v());
594
+ }), ee(function() {
595
+ _();
596
+ }), {
597
+ isSwipeEnabled: n,
598
+ swipeStyle: g,
599
+ handlePointerDown: w,
600
+ handlePointerMove: T,
601
+ handlePointerUp: D,
602
+ handlePointerCancel: O,
603
+ consumeSuppressedClick: k
604
+ };
605
+ }
606
+ function xt(e, t, n) {
607
+ function r(t) {
608
+ if (n && n()) return;
609
+ let r = wt(e.value);
610
+ e.value.onClick && e.value.onClick(r, t), e.value.closeOnClick && i();
611
+ }
612
+ function i() {
613
+ t("dismiss", e.value.id);
614
+ }
615
+ return {
616
+ handleClick: r,
617
+ handleCloseClick: i
618
+ };
619
+ }
620
+ function St(e) {
621
+ let t = o(function() {
622
+ return e.value.buttons?.buttons ?? [];
623
+ }), n = o(function() {
624
+ return e.value.buttons?.layout ?? "row";
625
+ }), r = o(function() {
626
+ let t = e.value.buttons?.alignment ?? "bottom-right";
627
+ return e.value.alignment === "right" ? t.endsWith("-left") ? t.replace(/-left$/, "-right") : t.endsWith("-right") ? t.replace(/-right$/, "-left") : t : t;
628
+ }), i = o(function() {
629
+ return t.value.length > 0;
630
+ }), a = o(function() {
631
+ return r.value.endsWith("-left") ? "left" : "right";
632
+ }), s = o(function() {
633
+ let e = r.value;
634
+ return e.startsWith("top-") ? "top" : e.startsWith("bottom-") ? "bottom" : "center";
635
+ }), c = o(function() {
636
+ if (n.value === "row") return a.value;
637
+ let e = s.value;
638
+ return e === "top" ? "top" : e === "bottom" ? "bottom" : a.value;
639
+ }), l = o(function() {
640
+ return c.value === "left" || c.value === "right";
641
+ }), u = o(function() {
642
+ return a.value === "left" ? "tf-toast-actions--start" : "tf-toast-actions--end";
643
+ }), d = o(function() {
644
+ return {
645
+ "--tf-toast-buttons-gap": e.value.buttons?.gap,
646
+ "--tf-toast-buttons-content-gap": e.value.buttons?.contentGap
647
+ };
648
+ }), f = o(function() {
649
+ if (!l.value) return;
650
+ let e = s.value;
651
+ if (e === "bottom") return "tf-toast-buttons--bottom";
652
+ if (e === "center") return "tf-toast-buttons--center";
653
+ }), p = o(function() {
654
+ return [
655
+ "tf-toast-actions",
656
+ u.value,
657
+ f.value
658
+ ];
659
+ });
660
+ function m(t, n) {
661
+ let r = wt(e.value);
662
+ t.onClick && t.onClick(r, n);
663
+ }
664
+ return {
665
+ hasButtons: i,
666
+ buttons: t,
667
+ buttonsPlacement: c,
668
+ buttonsClasses: p,
669
+ buttonsVarsStyle: d,
670
+ handleButtonClick: m
671
+ };
672
+ }
673
+ function Ct(e) {
674
+ return e instanceof Element ? !!e.closest("button, a, input, textarea, select, option, [role='button'], [contenteditable='true']") : !1;
675
+ }
676
+ function wt(e) {
677
+ return {
678
+ id: e.id,
679
+ position: e.position,
680
+ type: e.type,
681
+ title: e.title,
682
+ description: e.description,
683
+ createdAt: e.createdAt
684
+ };
685
+ }
686
+ function Tt(e) {
687
+ return e.replace(/\s+/g, " ").trim();
688
+ }
689
+ function Et(e) {
690
+ if (!e) return "";
691
+ let t = Tt(e.replace(/<[^>]*>/g, " "));
692
+ if (typeof window > "u" || !window.document) return t;
693
+ try {
694
+ let t = window.document.createElement("div");
695
+ return t.innerHTML = e, Tt(t.textContent ?? "");
696
+ } catch {
697
+ return t;
698
+ }
699
+ }
700
+ return (e, t) => (v(), l("div", {
701
+ role: T(U),
702
+ "aria-live": T(G),
703
+ class: "tf-toast-wrapper",
704
+ style: h(T(Se))
705
+ }, [u("div", {
706
+ class: m(["tf-toast", [
707
+ T(R),
708
+ T(de) && F.value.phase !== "leaving" && F.value.phase !== "clear-all" && T(b),
709
+ T(pe) && F.value.phase !== "leaving" && F.value.phase !== "clear-all" && T(A),
710
+ F.value.phase === "clear-all" && T(D),
711
+ T(me) && "tf-toast--paused",
712
+ T(xe) && "tf-toast--swipe-enabled"
713
+ ]]),
714
+ "aria-label": T(ae) || void 0,
715
+ "data-align": F.value.alignment,
716
+ style: h(nt.value),
717
+ onClick: t[1] ||= (...e) => T(Qe) && T(Qe)(...e),
718
+ onMouseenter: t[2] ||= (...e) => T(he) && T(he)(...e),
719
+ onMouseleave: t[3] ||= (...e) => T(_e) && T(_e)(...e),
720
+ onPointerdown: it,
721
+ onPointermove: at,
722
+ onPointerup: ot,
723
+ onPointercancel: st
724
+ }, [u("div", De, [
725
+ ut.value ? (v(), l("div", Oe, [d(W, {
726
+ buttons: T(X),
727
+ classes: T(Q),
728
+ "on-button-click": T($)
729
+ }, null, 8, [
730
+ "buttons",
731
+ "classes",
732
+ "on-button-click"
733
+ ])])) : c("", !0),
734
+ u("div", { class: m(["tf-toast-main", [ft.value && "tf-toast-main--full", ct.value && "tf-toast-main--content-end"]]) }, [
735
+ ct.value ? (v(), l("div", ke, [d(W, {
736
+ buttons: T(X),
737
+ classes: T(Q),
738
+ "on-button-click": T($)
739
+ }, null, 8, [
740
+ "buttons",
741
+ "classes",
742
+ "on-button-click"
743
+ ])])) : c("", !0),
744
+ u("div", Ae, [rt.value ? (v(), l("div", {
745
+ key: 0,
746
+ class: m(["tf-toast-icon", T(z)]),
747
+ "aria-hidden": "true"
748
+ }, [x(e.$slots, "icon", { toast: F.value }, () => [(v(), s(S(T(H)), {
749
+ class: m(["tf-toast-icon-svg", [F.value.type === "loading" && "tf-toast-icon-spin"]]),
750
+ "aria-hidden": "true"
751
+ }, null, 8, ["class"]))], !0)], 2)) : c("", !0), u("div", { class: m(["tf-toast-body", [pt.value && "tf-toast-body--has-created-at"]]) }, [
752
+ u("div", je, [F.value.title && !F.value.supportHtml ? (v(), l("p", {
753
+ key: 0,
754
+ "aria-label": T(ne) || void 0,
755
+ class: "tf-toast-title"
756
+ }, C(F.value.title), 9, Me)) : F.value.title && F.value.supportHtml ? (v(), l("p", {
757
+ key: 1,
758
+ class: "tf-toast-title",
759
+ "aria-label": T(ne) || void 0,
760
+ innerHTML: F.value.title
761
+ }, null, 8, Ne)) : c("", !0), F.value.description && !F.value.supportHtml ? (v(), l("p", {
762
+ key: 2,
763
+ "aria-label": T(re) || void 0,
764
+ class: "tf-toast-description"
765
+ }, C(F.value.description), 9, Pe)) : F.value.description && F.value.supportHtml ? (v(), l("p", {
766
+ key: 3,
767
+ class: "tf-toast-description",
768
+ "aria-label": T(re) || void 0,
769
+ innerHTML: F.value.description
770
+ }, null, 8, Fe)) : c("", !0)]),
771
+ x(e.$slots, "default", { toast: F.value }, void 0, !0),
772
+ pt.value ? (v(), l("div", Ie, [x(e.$slots, "created-at", {
773
+ toast: F.value,
774
+ formatted: T(q)
775
+ }, () => [u("span", { "aria-label": T(te) || void 0 }, C(T(q)), 9, Le)], !0)])) : c("", !0)
776
+ ], 2)]),
777
+ lt.value ? (v(), l("div", Re, [d(W, {
778
+ buttons: T(X),
779
+ classes: T(Q),
780
+ "on-button-click": T($)
781
+ }, null, 8, [
782
+ "buttons",
783
+ "classes",
784
+ "on-button-click"
785
+ ])])) : c("", !0)
786
+ ], 2),
787
+ dt.value ? (v(), l("div", ze, [d(W, {
788
+ buttons: T(X),
789
+ classes: T(Q),
790
+ "on-button-click": T($)
791
+ }, null, 8, [
792
+ "buttons",
793
+ "classes",
794
+ "on-button-click"
795
+ ])])) : c("", !0),
796
+ T(le) ? (v(), l("div", {
797
+ key: 2,
798
+ class: "tf-toast-progress-wrapper",
799
+ style: h(T(se))
800
+ }, [x(e.$slots, "progress", { toast: F.value }, () => [(v(), s(B, {
801
+ key: T(ue),
802
+ type: F.value.type,
803
+ "progress-alignment": F.value.progressAlignment
804
+ }, null, 8, ["type", "progress-alignment"]))], !0)], 4)) : c("", !0)
805
+ ]), mt.value || F.value.closeButton ? (v(), l("div", Be, [mt.value ? (v(), l("div", Ve, [x(e.$slots, "created-at", {
806
+ toast: F.value,
807
+ formatted: T(q)
808
+ }, () => [u("span", { "aria-label": T(te) || void 0 }, C(T(q)), 9, He)], !0)])) : c("", !0), F.value.closeButton ? (v(), l("button", {
809
+ key: 1,
810
+ type: "button",
811
+ class: m(["tf-toast-close", T(V)]),
812
+ "aria-label": "Close notification",
813
+ onClick: t[0] ||= O((...e) => T($e) && T($e)(...e), ["stop"])
814
+ }, [x(e.$slots, "close-icon", { toast: F.value }, () => [d(we, {
815
+ class: "tf-toast-close-icon",
816
+ "aria-hidden": "true"
817
+ })], !0)], 2)) : c("", !0)])) : c("", !0)], 46, Ee)], 12, Te));
818
+ }
819
+ }), [["__scopeId", "data-v-b9d1f13b"]]), Ye = ["data-position"], Xe = 260, Ze = 220, Qe = /* @__PURE__ */ z(/* @__PURE__ */ f({
820
+ __name: "ToastContainer",
821
+ setup(e) {
822
+ let t = [
823
+ "top-left",
824
+ "top-center",
825
+ "top-right",
826
+ "bottom-left",
827
+ "bottom-center",
828
+ "bottom-right"
829
+ ], n = p(k, null) ?? N(), r = y([]), c = y({
830
+ enter: Xe,
831
+ leave: Ze
832
+ }), f = y({}), S = y({}), C = y({}), w = null, T = null;
833
+ _(function() {
834
+ w = n.subscribe(function(e) {
835
+ r.value = e.toasts;
836
+ }), T = n.subscribeEvents(function(e) {
837
+ e.kind === "timer-reset" && (f.value[e.id] = Math.random()), e.kind === "duplicate" && (S.value[e.id] = Math.random()), e.kind === "update" && (C.value[e.id] = Math.random());
838
+ }), W();
839
+ }), ee(function() {
840
+ w && w(), T && T();
841
+ });
842
+ function O(e) {
843
+ return f.value[e] ?? 0;
844
+ }
845
+ function A(e) {
846
+ return S.value[e] ?? 0;
847
+ }
848
+ function j(e) {
849
+ return C.value[e] ?? 0;
850
+ }
851
+ let M = o(function() {
852
+ let e = {
853
+ "top-left": [],
854
+ "top-center": [],
855
+ "top-right": [],
856
+ "bottom-left": [],
857
+ "bottom-center": [],
858
+ "bottom-right": []
859
+ };
860
+ for (let t of r.value) e[t.position].push(t);
861
+ return e;
862
+ }), P = n.getConfig(), F = y({
863
+ "top-left": {
864
+ ...P,
865
+ position: "top-left"
866
+ },
867
+ "top-center": {
868
+ ...P,
869
+ position: "top-center"
870
+ },
871
+ "top-right": {
872
+ ...P,
873
+ position: "top-right"
874
+ },
875
+ "bottom-left": {
876
+ ...P,
877
+ position: "bottom-left"
878
+ },
879
+ "bottom-center": {
880
+ ...P,
881
+ position: "bottom-center"
882
+ },
883
+ "bottom-right": {
884
+ ...P,
885
+ position: "bottom-right"
886
+ }
887
+ }), I = o(function() {
888
+ return r.value.length ? Math.max(...r.value.map((e) => e.zIndex)) : P.zIndex;
889
+ });
890
+ function L(e) {
891
+ return F.value[e] ?? {
892
+ ...P,
893
+ position: e
894
+ };
895
+ }
896
+ function R(e) {
897
+ let { offset: t, width: n } = L(e), r = {
898
+ width: n,
899
+ maxWidth: `calc(100vw - (${t}) - (${t}))`
900
+ };
901
+ return e.startsWith("top-") && (r.top = t), e.startsWith("bottom-") && (r.bottom = t), e.endsWith("left") ? r.left = t : e.endsWith("right") ? r.right = t : e.endsWith("center") && (r.left = "50%", r.transform = "translateX(-50%)"), r;
902
+ }
903
+ function z(e) {
904
+ return e.endsWith("left") ? "tf-toast-stack--left" : e.endsWith("center") ? "tf-toast-stack--center" : "tf-toast-stack--right";
905
+ }
906
+ function B(e) {
907
+ return e.startsWith("bottom-") ? "tf-toast-stack-inner--bottom" : null;
908
+ }
909
+ function V(e) {
910
+ return L(e).overflowScroll && e.startsWith("top-");
911
+ }
912
+ function H(e) {
913
+ n.dismiss(e);
914
+ }
915
+ function U(e, t) {
916
+ let n = e.trim().toLowerCase();
917
+ if (!n) return t;
918
+ if (n.endsWith("ms")) {
919
+ let e = Number(n.slice(0, -2));
920
+ return Number.isFinite(e) ? e : t;
921
+ }
922
+ if (n.endsWith("s")) {
923
+ let e = Number(n.slice(0, -1));
924
+ return Number.isFinite(e) ? e * 1e3 : t;
925
+ }
926
+ let r = Number(n);
927
+ return Number.isFinite(r) ? r : t;
928
+ }
929
+ function W() {
930
+ if (typeof window > "u") return;
931
+ let e = getComputedStyle(document.documentElement);
932
+ c.value = {
933
+ enter: U(e.getPropertyValue("--tf-toast-animation-in-duration"), Xe),
934
+ leave: U(e.getPropertyValue("--tf-toast-animation-out-duration"), Ze)
935
+ };
936
+ }
937
+ let G = /* @__PURE__ */ new WeakMap();
938
+ g(function() {
939
+ let e = document.querySelectorAll(".tf-toast-item");
940
+ for (let t = 0; t < e.length; t++) {
941
+ let n = e[t], r = n.parentElement;
942
+ r && G.set(n, {
943
+ top: n.offsetTop,
944
+ height: n.offsetHeight,
945
+ parentHeight: r.clientHeight,
946
+ parentWidth: r.clientWidth
947
+ });
948
+ }
949
+ });
950
+ function K(e) {
951
+ let t = e, n = t.parentElement;
952
+ if (!n || n.children.length <= 1) return;
953
+ let r = G.get(t), i = (t.dataset.position ?? "").startsWith("bottom-") || n.classList.contains("tf-toast-stack-inner--bottom"), a = r?.top ?? t.offsetTop, o = r?.height ?? t.offsetHeight, s = r?.parentHeight ?? n.clientHeight, c = r?.parentWidth ?? n.clientWidth;
954
+ if (t.style.position = "absolute", t.style.zIndex = "0", t.style.width = `${c}px`, t.style.left = "0", t.style.right = "0", i) {
955
+ let e = s - (a + o);
956
+ t.style.bottom = `${e}px`, t.style.top = "auto";
957
+ } else t.style.top = `${a}px`, t.style.bottom = "auto";
958
+ }
959
+ function q(e) {
960
+ let t = e;
961
+ t.style.position = "", t.style.zIndex = "", t.style.width = "", t.style.left = "", t.style.right = "", t.style.top = "", t.style.bottom = "";
962
+ }
963
+ E(r, function(e) {
964
+ let t = new Set(e.map(function(e) {
965
+ return e.id;
966
+ }));
967
+ for (let e of Object.keys(f.value)) t.has(e) || delete f.value[e];
968
+ for (let e of Object.keys(S.value)) t.has(e) || delete S.value[e];
969
+ for (let e of Object.keys(C.value)) t.has(e) || delete C.value[e];
970
+ }, { deep: !1 });
971
+ function J(e) {
972
+ return {
973
+ ...P.animation,
974
+ ...e.animation
975
+ };
976
+ }
977
+ return E(M, function(e) {
978
+ let t = { ...F.value };
979
+ Object.keys(e).forEach(function(n) {
980
+ let r = e[n][0];
981
+ r && (t[n] = {
982
+ ...P,
983
+ ...r,
984
+ position: n,
985
+ animation: {
986
+ ...P.animation,
987
+ ...r.animation
988
+ }
989
+ });
990
+ }), F.value = t;
991
+ }, { deep: !1 }), (e, n) => (v(), l("div", {
992
+ class: "tf-toast-root",
993
+ style: h({ zIndex: I.value })
994
+ }, [(v(), l(i, null, b(t, (t) => u("div", {
995
+ key: t,
996
+ class: m(["tf-toast-stack", z(t)]),
997
+ style: h(R(t))
998
+ }, [d(a, {
999
+ appear: "",
1000
+ duration: c.value,
1001
+ name: L(t).animation.name,
1002
+ onBeforeLeave: K,
1003
+ onAfterLeave: q,
1004
+ tag: "div",
1005
+ class: m([
1006
+ "tf-toast-stack-inner",
1007
+ B(t),
1008
+ V(t) && "tf-toast-stack-inner--scroll"
1009
+ ]),
1010
+ style: h({ gap: L(t).gap })
1011
+ }, {
1012
+ default: D(() => [(v(!0), l(i, null, b(M.value[t], (t, n) => (v(), l("div", {
1013
+ key: t.id,
1014
+ class: "tf-toast-item",
1015
+ style: h({
1016
+ width: t.width,
1017
+ maxWidth: "100%"
1018
+ }),
1019
+ "data-position": t.position
1020
+ }, [u("div", {
1021
+ class: "tf-toast-motion",
1022
+ style: h({ "--tf-toast-index": n })
1023
+ }, [e.$slots.default ? x(e.$slots, "default", {
1024
+ key: 0,
1025
+ toast: t,
1026
+ progressResetKey: O(t.id),
1027
+ duplicateKey: A(t.id),
1028
+ updateKey: j(t.id),
1029
+ bumpAnimationClass: J(t).bump,
1030
+ clearAllAnimationClass: J(t).clearAll,
1031
+ updateAnimationClass: J(t).update,
1032
+ dismiss: H
1033
+ }, void 0, !0) : (v(), s(Je, {
1034
+ key: 1,
1035
+ toast: t,
1036
+ progressResetKey: O(t.id),
1037
+ duplicateKey: A(t.id),
1038
+ updateKey: j(t.id),
1039
+ bumpAnimationClass: J(t).bump,
1040
+ clearAllAnimationClass: J(t).clearAll,
1041
+ updateAnimationClass: J(t).update,
1042
+ onDismiss: H
1043
+ }, null, 8, [
1044
+ "toast",
1045
+ "progressResetKey",
1046
+ "duplicateKey",
1047
+ "updateKey",
1048
+ "bumpAnimationClass",
1049
+ "clearAllAnimationClass",
1050
+ "updateAnimationClass"
1051
+ ]))], 4)], 12, Ye))), 128))]),
1052
+ _: 2
1053
+ }, 1032, [
1054
+ "duration",
1055
+ "name",
1056
+ "class",
1057
+ "style"
1058
+ ])], 6)), 64))], 4));
1059
+ }
1060
+ }), [["__scopeId", "data-v-c03eb678"]]);
1061
+ //#endregion
1062
+ export { be as ArrowPath, ce as Bell, J as CheckCircle, fe as InfoCircle, ge as QuestionMarkCircle, Je as Toast, Qe as ToastContainer, B as ToastProgress, ie as XCircle, we as XMark, I as createToastflow, N as getToastStore, M as setToastStore, F as toast };