- 自定义动画:animations.register() 注册的动画动态注入 keyframes 真实生效(此前仅存 Map 实际 fallback slide) - max 超限:通过实例注册表真正 close() 最早的 toast(此前仅删内存记录,DOM 残留) - 钩子收敛:beforeClose/beforeUpdate 支持返回 false 拦截;接入 click/hover/dragStart/dragEnd/animationStart/animationEnd/progressStart/progressEnd/configChange/themeChange/localeChange/beforeInit/afterInit/beforeDestroy/afterDestroy;HOOK_NAMES 移除永不触发的声明 - destroy() 全量清理:hooks、实例注册表、全部 metona-toast-* 样式标签;动画注册表真正清空 - applyThemeVariables 重复注入修复;init() 支持插件对象并复活 _destroyed;AnimationConfig 类型放宽 - VERSION 统一到 constants.ts 唯一维护;删除失效 scripts;新增 .gitattributes 统一 LF - docs.html 补 v0.2.1 新 API 文档;CHANGELOG 更新;测试 309 用例全过
2 lines
101 KiB
JavaScript
2 lines
101 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).MeToast={})}(this,function(e){"use strict";const t=e=>{if("undefined"==typeof document)return String(null==e?"":e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");const t=document.createElement("div");return t.textContent=String(null==e?"":e),t.innerHTML},n={success:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="20 6 9 17 4 12"/>\n </svg>',error:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="10"/>\n <line x1="15" y1="9" x2="9" y2="15"/>\n <line x1="9" y1="9" x2="15" y2="15"/>\n </svg>',warning:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/>\n <line x1="12" y1="9" x2="12" y2="13"/>\n <line x1="12" y1="17" x2="12.01" y2="17"/>\n </svg>',info:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="10"/>\n <line x1="12" y1="16" x2="12" y2="12"/>\n <line x1="12" y1="8" x2="12.01" y2="8"/>\n </svg>',loading:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21 12a9 9 0 1 1-6.219-8.56" class="met-spin"/>\n </svg>',close:'<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"/>\n <line x1="6" y1="6" x2="18" y2="18"/>\n </svg>',check:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="20 6 9 17 4 12"/>\n </svg>',x:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"/>\n <line x1="6" y1="6" x2="18" y2="18"/>\n </svg>',alert:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/>\n <line x1="12" y1="9" x2="12" y2="13"/>\n <line x1="12" y1="17" x2="12.01" y2="17"/>\n </svg>',question:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="10"/>\n <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/>\n <line x1="12" y1="17" x2="12.01" y2="17"/>\n </svg>',star:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/>\n </svg>',heart:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"/>\n </svg>',bell:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"/>\n <path d="M13.73 21a2 2 0 0 1-3.46 0"/>\n </svg>',mail:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>\n <polyline points="22,6 12,13 2,6"/>\n </svg>',settings:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="3"/>\n <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/>\n </svg>',user:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/>\n <circle cx="12" cy="7" r="4"/>\n </svg>',home:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>\n <polyline points="9 22 9 12 15 12 15 22"/>\n </svg>',search:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="8"/>\n <line x1="21" y1="21" x2="16.65" y2="16.65"/>\n </svg>',plus:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <line x1="12" y1="5" x2="12" y2="19"/>\n <line x1="5" y1="12" x2="19" y2="12"/>\n </svg>',minus:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <line x1="5" y1="12" x2="19" y2="12"/>\n </svg>',edit:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/>\n <path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/>\n </svg>',trash:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="3 6 5 6 21 6"/>\n <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/>\n <line x1="10" y1="11" x2="10" y2="17"/>\n <line x1="14" y1="11" x2="14" y2="17"/>\n </svg>',download:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>\n <polyline points="7 10 12 15 17 10"/>\n <line x1="12" y1="15" x2="12" y2="3"/>\n </svg>',upload:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>\n <polyline points="17 8 12 3 7 8"/>\n <line x1="12" y1="3" x2="12" y2="15"/>\n </svg>',share:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="18" cy="5" r="3"/>\n <circle cx="6" cy="12" r="3"/>\n <circle cx="18" cy="19" r="3"/>\n <line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/>\n <line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/>\n </svg>',link:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/>\n <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>\n </svg>',external:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>\n <polyline points="15 3 21 3 21 9"/>\n <line x1="10" y1="14" x2="21" y2="3"/>\n </svg>',clock:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="10"/>\n <polyline points="12 6 12 12 16 14"/>\n </svg>',calendar:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>\n <line x1="16" y1="2" x2="16" y2="6"/>\n <line x1="8" y1="2" x2="8" y2="6"/>\n <line x1="3" y1="10" x2="21" y2="10"/>\n </svg>',map:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polygon points="1 6 1 22 8 18 16 22 23 18 23 2 16 6 8 2 1 6"/>\n <line x1="8" y1="2" x2="8" y2="18"/>\n <line x1="16" y1="6" x2="16" y2="22"/>\n </svg>',compass:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="10"/>\n <polygon points="16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"/>\n </svg>',globe:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="10"/>\n <line x1="2" y1="12" x2="22" y2="12"/>\n <path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>\n </svg>',wifi:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M5 12.55a11 11 0 0 1 14.08 0"/>\n <path d="M1.42 9a16 16 0 0 1 21.16 0"/>\n <path d="M8.53 16.11a6 6 0 0 1 6.95 0"/>\n <line x1="12" y1="20" x2="12.01" y2="20"/>\n </svg>',cloud:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"/>\n </svg>',sun:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="5"/>\n <line x1="12" y1="1" x2="12" y2="3"/>\n <line x1="12" y1="21" x2="12" y2="23"/>\n <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/>\n <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/>\n <line x1="1" y1="12" x2="3" y2="12"/>\n <line x1="21" y1="12" x2="23" y2="12"/>\n <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/>\n <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>\n </svg>',moon:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>\n </svg>',zap:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/>\n </svg>',activity:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/>\n </svg>',cpu:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <rect x="4" y="4" width="16" height="16" rx="2" ry="2"/>\n <rect x="9" y="9" width="6" height="6"/>\n <line x1="9" y1="1" x2="9" y2="4"/>\n <line x1="15" y1="1" x2="15" y2="4"/>\n <line x1="9" y1="20" x2="9" y2="23"/>\n <line x1="15" y1="20" x2="15" y2="23"/>\n <line x1="20" y1="9" x2="23" y2="9"/>\n <line x1="20" y1="14" x2="23" y2="14"/>\n <line x1="1" y1="9" x2="4" y2="9"/>\n <line x1="1" y1="14" x2="4" y2="14"/>\n </svg>',database:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <ellipse cx="12" cy="5" rx="9" ry="3"/>\n <path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/>\n <path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/>\n </svg>',server:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <rect x="2" y="2" width="20" height="8" rx="2" ry="2"/>\n <rect x="2" y="14" width="20" height="8" rx="2" ry="2"/>\n <line x1="6" y1="6" x2="6.01" y2="6"/>\n <line x1="6" y1="18" x2="6.01" y2="18"/>\n </svg>',terminal:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="4 17 10 11 4 5"/>\n <line x1="12" y1="19" x2="20" y2="19"/>\n </svg>',code:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="16 18 22 12 16 6"/>\n <polyline points="8 6 2 12 8 18"/>\n </svg>',git:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="18" cy="18" r="3"/>\n <circle cx="6" cy="6" r="3"/>\n <path d="M13 6h3a2 2 0 0 1 2 2v7"/>\n <line x1="6" y1="9" x2="6" y2="21"/>\n </svg>',package:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <line x1="16.5" y1="9.4" x2="7.5" y2="4.21"/>\n <path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/>\n <polyline points="3.27 6.96 12 12.01 20.73 6.96"/>\n <line x1="12" y1="22.08" x2="12" y2="12"/>\n </svg>',layers:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polygon points="12 2 2 7 12 12 22 7 12 2"/>\n <polyline points="2 17 12 22 22 17"/>\n <polyline points="2 12 12 17 22 12"/>\n </svg>',grid:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <rect x="3" y="3" width="7" height="7"/>\n <rect x="14" y="3" width="7" height="7"/>\n <rect x="14" y="14" width="7" height="7"/>\n <rect x="3" y="14" width="7" height="7"/>\n </svg>',list:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <line x1="8" y1="6" x2="21" y2="6"/>\n <line x1="8" y1="12" x2="21" y2="12"/>\n <line x1="8" y1="18" x2="21" y2="18"/>\n <line x1="3" y1="6" x2="3.01" y2="6"/>\n <line x1="3" y1="12" x2="3.01" y2="12"/>\n <line x1="3" y1="18" x2="3.01" y2="18"/>\n </svg>',filter:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"/>\n </svg>',sort:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <line x1="12" y1="5" x2="12" y2="19"/>\n <polyline points="19 12 12 19 5 12"/>\n </svg>',refresh:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="23 4 23 10 17 10"/>\n <polyline points="1 20 1 14 7 14"/>\n <path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/>\n </svg>',sync:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="23 4 23 10 17 10"/>\n <polyline points="1 20 1 14 7 14"/>\n <path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/>\n </svg>',power:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18.36 6.64a9 9 0 1 1-12.73 0"/>\n <line x1="12" y1="2" x2="12" y2="12"/>\n </svg>',battery:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <rect x="1" y="6" width="18" height="12" rx="2" ry="2"/>\n <line x1="23" y1="13" x2="23" y2="11"/>\n </svg>',bluetooth:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6.5 6.5 17.5 17.5 12 23 12 1 17.5 6.5 6.5 17.5"/>\n </svg>',volume:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07"/>\n </svg>',mic:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" y1="19" x2="12" y2="23"/>\n <line x1="8" y1="23" x2="16" y2="23"/>\n </svg>',camera:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/>\n <circle cx="12" cy="13" r="4"/>\n </svg>',image:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <rect x="3" y="3" width="18" height="18" rx="2" ry="2"/>\n <circle cx="8.5" cy="8.5" r="1.5"/>\n <polyline points="21 15 16 10 5 21"/>\n </svg>',video:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polygon points="23 7 16 12 23 17 23 7"/>\n <rect x="1" y="5" width="15" height="14" rx="2" ry="2"/>\n </svg>',music:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M9 18V5l12-2v13"/>\n <circle cx="6" cy="18" r="3"/>\n <circle cx="18" cy="16" r="3"/>\n </svg>',file:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"/>\n <polyline points="13 2 13 9 20 9"/>\n </svg>',folder:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/>\n </svg>',clipboard:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>\n <rect x="8" y="2" width="8" height="4" rx="1" ry="1"/>\n </svg>',save:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"/>\n <polyline points="17 21 17 13 7 13 7 21"/>\n <polyline points="7 3 7 8 15 8"/>\n </svg>',print:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 6 2 18 2 18 9"/>\n <path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/>\n <rect x="6" y="14" width="12" height="8"/>\n </svg>',eye:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>\n <circle cx="12" cy="12" r="3"/>\n </svg>',eyeOff:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/>\n <line x1="1" y1="1" x2="23" y2="23"/>\n </svg>',lock:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>\n <path d="M7 11V7a5 5 0 0 1 10 0v4"/>\n </svg>',unlock:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>\n <path d="M7 11V7a5 5 0 0 1 9.9-1"/>\n </svg>',shield:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>\n </svg>',key:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"/>\n </svg>',flag:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"/>\n <line x1="4" y1="22" x2="4" y2="15"/>\n </svg>',bookmark:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"/>\n </svg>',tag:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"/>\n <line x1="7" y1="7" x2="7.01" y2="7"/>\n </svg>',gift:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="20 12 20 22 4 22 4 12"/>\n <rect x="2" y="7" width="20" height="5"/>\n <line x1="12" y1="22" x2="12" y2="7"/>\n <path d="M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z"/>\n <path d="M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"/>\n </svg>',award:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="8" r="7"/>\n <polyline points="8.21 13.89 7 23 12 20 17 23 15.79 13.88"/>\n </svg>',target:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="10"/>\n <circle cx="12" cy="12" r="6"/>\n <circle cx="12" cy="12" r="2"/>\n </svg>',crosshair:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="10"/>\n <line x1="22" y1="12" x2="18" y2="12"/>\n <line x1="6" y1="12" x2="2" y2="12"/>\n <line x1="12" y1="6" x2="12" y2="2"/>\n <line x1="12" y1="22" x2="12" y2="18"/>\n </svg>',move:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="5 9 2 12 5 15"/>\n <polyline points="9 5 12 2 15 5"/>\n <polyline points="15 19 12 22 9 19"/>\n <polyline points="19 9 22 12 19 15"/>\n <line x1="2" y1="12" x2="22" y2="12"/>\n <line x1="12" y1="2" x2="12" y2="22"/>\n </svg>',maximize:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"/>\n </svg>',minimize:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"/>\n </svg>',copy:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>\n <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>\n </svg>',cut:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="6" cy="6" r="3"/>\n <circle cx="6" cy="18" r="3"/>\n <line x1="20" y1="4" x2="8.12" y2="15.88"/>\n <line x1="14.47" y1="14.48" x2="20" y2="20"/>\n <line x1="8.12" y1="8.12" x2="12" y2="12"/>\n </svg>',paste:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>\n <rect x="8" y="2" width="8" height="4" rx="1" ry="1"/>\n </svg>',rotateCw:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="23 4 23 10 17 10"/>\n <path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/>\n </svg>',rotateCcw:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="1 4 1 10 7 10"/>\n <path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/>\n </svg>',zoomIn:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="8"/>\n <line x1="21" y1="21" x2="16.65" y2="16.65"/>\n <line x1="11" y1="8" x2="11" y2="14"/>\n <line x1="8" y1="11" x2="14" y2="11"/>\n </svg>',zoomOut:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="11" cy="11" r="8"/>\n <line x1="21" y1="21" x2="16.65" y2="16.65"/>\n <line x1="8" y1="11" x2="14" y2="11"/>\n </svg>',crop:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M6.13 1L6 16a2 2 0 0 0 2 2h15"/>\n <path d="M1 6.13L16 6a2 2 0 0 1 2 2v15"/>\n </svg>',sliders:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <line x1="4" y1="21" x2="4" y2="14"/>\n <line x1="4" y1="10" x2="4" y2="3"/>\n <line x1="12" y1="21" x2="12" y2="12"/>\n <line x1="12" y1="8" x2="12" y2="3"/>\n <line x1="20" y1="21" x2="20" y2="16"/>\n <line x1="20" y1="12" x2="20" y2="3"/>\n <line x1="1" y1="14" x2="7" y2="14"/>\n <line x1="9" y1="8" x2="15" y2="8"/>\n <line x1="17" y1="16" x2="23" y2="16"/>\n </svg>',toggleLeft:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <rect x="1" y="5" width="22" height="14" rx="7" ry="7"/>\n <circle cx="8" cy="12" r="3"/>\n </svg>',toggleRight:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <rect x="1" y="5" width="22" height="14" rx="7" ry="7"/>\n <circle cx="16" cy="12" r="3"/>\n </svg>',checkCircle:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/>\n <polyline points="22 4 12 14.01 9 11.01"/>\n </svg>',xCircle:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="10"/>\n <line x1="15" y1="9" x2="9" y2="15"/>\n <line x1="9" y1="9" x2="15" y2="15"/>\n </svg>',alertCircle:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="10"/>\n <line x1="12" y1="8" x2="12" y2="12"/>\n <line x1="12" y1="16" x2="12.01" y2="16"/>\n </svg>',infoCircle:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="10"/>\n <line x1="12" y1="16" x2="12" y2="12"/>\n <line x1="12" y1="8" x2="12.01" y2="8"/>\n </svg>',helpCircle:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="10"/>\n <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/>\n <line x1="12" y1="17" x2="12.01" y2="17"/>\n </svg>',alertTriangle:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/>\n <line x1="12" y1="9" x2="12" y2="13"/>\n <line x1="12" y1="17" x2="12.01" y2="17"/>\n </svg>',checkSquare:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="9 11 12 14 22 4"/>\n <path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"/>\n </svg>',square:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <rect x="3" y="3" width="18" height="18" rx="2" ry="2"/>\n </svg>',circle:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <circle cx="12" cy="12" r="10"/>\n </svg>',triangle:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/>\n </svg>',hexagon:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/>\n </svg>',octagon:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"/>\n </svg>',pentagon:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <polygon points="12 2 22 8.5 19 20 5 20 2 8.5 12 2"/>\n </svg>',diamond:'<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <rect x="4.5" y="4.5" width="15" height="15" rx="1" transform="rotate(45 12 12)"/>\n </svg>'},o={"zh-CN":{close:"关闭",loading:"加载中...",success:"操作成功",error:"操作失败",warning:"警告",info:"信息",confirm:"确认",cancel:"取消",yes:"是",no:"否",ok:"确定",retry:"重试",undo:"撤销",redo:"重做",save:"保存",delete:"删除",edit:"编辑",add:"添加",remove:"移除",search:"搜索",filter:"筛选",sort:"排序",refresh:"刷新",sync:"同步",upload:"上传",download:"下载",share:"分享",copy:"复制",cut:"剪切",paste:"粘贴",print:"打印",export:"导出",import:"导入",settings:"设置",help:"帮助",about:"关于",version:"版本",language:"语言",theme:"主题",dark:"暗色",light:"亮色",auto:"自动",notifications:"通知",enable:"启用",disable:"禁用",on:"开启",off:"关闭",max:"最大",min:"最小",expand:"展开",collapse:"折叠",fullscreen:"全屏",exitFullscreen:"退出全屏",zoomIn:"放大",zoomOut:"缩小",reset:"重置",apply:"应用",submit:"提交",send:"发送",receive:"接收",connect:"连接",disconnect:"断开",start:"开始",stop:"停止",pause:"暂停",resume:"继续",next:"下一个",previous:"上一个",first:"第一个",last:"最后一个",back:"返回",forward:"前进",home:"首页",menu:"菜单",more:"更多",less:"更少",show:"显示",hide:"隐藏",visible:"可见",hidden:"隐藏",enabled:"已启用",disabled:"已禁用",active:"活跃",inactive:"非活跃",online:"在线",offline:"离线",connected:"已连接",disconnected:"已断开",loaded:"已加载",saving:"保存中",saved:"已保存",deleting:"删除中",deleted:"已删除",uploading:"上传中",uploaded:"已上传",downloading:"下载中",downloaded:"已下载",processing:"处理中",processed:"已处理",syncing:"同步中",synced:"已同步",sending:"发送中",sent:"已发送",receiving:"接收中",received:"已接收",connecting:"连接中",question:"问题",feedback:"反馈",report:"报告",bug:"错误",feature:"功能",improvement:"改进",suggestion:"建议",request:"请求",response:"响应",status:"状态",progress:"进度",complete:"完成",incomplete:"未完成",pending:"待处理",failed:"失败",cancelled:"已取消",timeout:"超时",expired:"已过期",invalid:"无效",valid:"有效",required:"必填",optional:"可选",allowed:"允许",denied:"拒绝",approved:"已批准",rejected:"已拒绝",accepted:"已接受",declined:"已拒绝",confirmed:"已确认",unconfirmed:"未确认",verified:"已验证",unverified:"未验证",authenticated:"已认证",unauthenticated:"未认证",authorized:"已授权",unauthorized:"未授权",public:"公开",private:"私有",protected:"受保护",internal:"内部",external:"外部",local:"本地",remote:"远程",global:"全局",system:"系统",user:"用户",admin:"管理员",moderator:"版主",guest:"访客",member:"成员",owner:"所有者",creator:"创建者",editor:"编辑者",viewer:"查看者",subscriber:"订阅者",follower:"关注者",following:"关注中",friend:"朋友",contact:"联系人",group:"群组",team:"团队",organization:"组织",company:"公司",department:"部门",project:"项目",task:"任务",issue:"问题",ticket:"工单",message:"消息",notification:"通知",alert:"警报",reminder:"提醒",event:"事件",activity:"活动",log:"日志",analytics:"分析",statistics:"统计",metrics:"指标",performance:"性能",security:"安全",privacy:"隐私",compliance:"合规",policy:"政策",terms:"条款",conditions:"条件",agreement:"协议",contract:"合同",license:"许可证",copyright:"版权",trademark:"商标",patent:"专利",tradeSecret:"商业秘密",confidential:"机密",sensitive:"敏感",critical:"关键",important:"重要",urgent:"紧急",high:"高",medium:"中",low:"低",none:"无",all:"全部",any:"任何",some:"一些",each:"每个",every:"每个",both:"两者",neither:"两者都不",either:"任一",other:"其他",another:"另一个",this:"这个",that:"那个",these:"这些",those:"那些",here:"这里",there:"那里",where:"哪里",when:"何时",why:"为什么",how:"如何",what:"什么",who:"谁",which:"哪个",whose:"谁的",whom:"谁"},"en-US":{close:"Close",loading:"Loading...",success:"Success",error:"Error",warning:"Warning",info:"Info",confirm:"Confirm",cancel:"Cancel",yes:"Yes",no:"No",ok:"OK",retry:"Retry",undo:"Undo",redo:"Redo",save:"Save",delete:"Delete",edit:"Edit",add:"Add",remove:"Remove",search:"Search",filter:"Filter",sort:"Sort",refresh:"Refresh",sync:"Sync",upload:"Upload",download:"Download",share:"Share",copy:"Copy",cut:"Cut",paste:"Paste",print:"Print",export:"Export",import:"Import",settings:"Settings",help:"Help",about:"About",version:"Version",language:"Language",theme:"Theme",dark:"Dark",light:"Light",auto:"Auto",notifications:"Notifications",enable:"Enable",disable:"Disable",on:"On",off:"Off",max:"Max",min:"Min",expand:"Expand",collapse:"Collapse",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",zoomIn:"Zoom In",zoomOut:"Zoom Out",reset:"Reset",apply:"Apply",submit:"Submit",send:"Send",receive:"Receive",connect:"Connect",disconnect:"Disconnect",start:"Start",stop:"Stop",pause:"Pause",resume:"Resume",next:"Next",previous:"Previous",first:"First",last:"Last",back:"Back",forward:"Forward",home:"Home",menu:"Menu",more:"More",less:"Less",show:"Show",hide:"Hide",visible:"Visible",hidden:"Hidden",enabled:"Enabled",disabled:"Disabled",active:"Active",inactive:"Inactive",online:"Online",offline:"Offline",connected:"Connected",disconnected:"Disconnected",loaded:"Loaded",saving:"Saving",saved:"Saved",deleting:"Deleting",deleted:"Deleted",uploading:"Uploading",uploaded:"Uploaded",downloading:"Downloading",downloaded:"Downloaded",processing:"Processing",processed:"Processed",syncing:"Syncing",synced:"Synced",sending:"Sending",sent:"Sent",receiving:"Receiving",received:"Received",connecting:"Connecting",question:"Question",feedback:"Feedback",report:"Report",bug:"Bug",feature:"Feature",improvement:"Improvement",suggestion:"Suggestion",request:"Request",response:"Response",status:"Status",progress:"Progress",complete:"Complete",incomplete:"Incomplete",pending:"Pending",failed:"Failed",cancelled:"Cancelled",timeout:"Timeout",expired:"Expired",invalid:"Invalid",valid:"Valid",required:"Required",optional:"Optional",allowed:"Allowed",denied:"Denied",approved:"Approved",rejected:"Rejected",accepted:"Accepted",declined:"Declined",confirmed:"Confirmed",unconfirmed:"Unconfirmed",verified:"Verified",unverified:"Unverified",authenticated:"Authenticated",unauthenticated:"Unauthenticated",authorized:"Authorized",unauthorized:"Unauthorized",public:"Public",private:"Private",protected:"Protected",internal:"Internal",external:"External",local:"Local",remote:"Remote",global:"Global",system:"System",user:"User",admin:"Admin",moderator:"Moderator",guest:"Guest",member:"Member",owner:"Owner",creator:"Creator",editor:"Editor",viewer:"Viewer",subscriber:"Subscriber",follower:"Follower",following:"Following",friend:"Friend",contact:"Contact",group:"Group",team:"Team",organization:"Organization",company:"Company",department:"Department",project:"Project",task:"Task",issue:"Issue",ticket:"Ticket",message:"Message",notification:"Notification",alert:"Alert",reminder:"Reminder",event:"Event",activity:"Activity",log:"Log",analytics:"Analytics",statistics:"Statistics",metrics:"Metrics",performance:"Performance",security:"Security",privacy:"Privacy",compliance:"Compliance",policy:"Policy",terms:"Terms",conditions:"Conditions",agreement:"Agreement",contract:"Contract",license:"License",copyright:"Copyright",trademark:"Trademark",patent:"Patent",tradeSecret:"Trade Secret",confidential:"Confidential",sensitive:"Sensitive",critical:"Critical",important:"Important",urgent:"Urgent",high:"High",medium:"Medium",low:"Low",none:"None",all:"All",any:"Any",some:"Some",each:"Each",every:"Every",both:"Both",neither:"Neither",either:"Either",other:"Other",another:"Another",this:"This",that:"That",these:"These",those:"Those",here:"Here",there:"There",where:"Where",when:"When",why:"Why",how:"How",what:"What",who:"Who",which:"Which",whose:"Whose",whom:"Whom"}},r="0.3.0",i=Object.freeze({position:"top-right",duration:4e3,max:6,gap:12,offset:24,pauseOnHover:!0,closeOnClick:!0,draggable:!0,showProgress:!0,progressDirection:"horizontal",icon:!0,closeButton:!0,theme:"auto",animation:"slide",zIndex:9999,width:360,className:"",style:{},onShow:null,onBeforeShow:null,onClose:null,onClick:null,onUpdate:null,resetTimerOnUpdate:!1,notifyWhenHidden:!1,onError:null,locale:"zh-CN",plugins:[]}),s={success:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},error:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},warning:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},info:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},loading:{fg:"#6366f1",bg:"rgba(99, 102, 241, 0.1)"},default:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},check:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},x:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},alert:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},question:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},star:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},heart:{fg:"#ec4899",bg:"rgba(236, 72, 153, 0.1)"},bell:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},mail:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},settings:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},user:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},home:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},search:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},plus:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},minus:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},edit:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},trash:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},download:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},upload:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},share:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},link:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},external:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},clock:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},calendar:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},map:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},compass:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},globe:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},wifi:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},cloud:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},sun:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},moon:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},zap:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},activity:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},cpu:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},database:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},server:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},terminal:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},code:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},git:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},package:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},layers:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},grid:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},list:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},filter:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},sort:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},refresh:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},sync:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},power:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},battery:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},bluetooth:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},volume:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},mic:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},camera:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},image:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},video:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},music:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},file:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},folder:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},clipboard:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},save:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},print:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},eye:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},eyeOff:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},lock:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},unlock:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},shield:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},key:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},flag:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},bookmark:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},tag:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},gift:{fg:"#ec4899",bg:"rgba(236, 72, 153, 0.1)"},award:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},target:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},crosshair:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},move:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},maximize:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},minimize:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},copy:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},cut:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},paste:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},rotateCw:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},rotateCcw:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},zoomIn:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},zoomOut:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},crop:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},sliders:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},toggleLeft:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},toggleRight:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},checkCircle:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},xCircle:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},alertCircle:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},infoCircle:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},helpCircle:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},alertTriangle:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},checkSquare:{fg:"#10b981",bg:"rgba(16, 185, 129, 0.1)"},square:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},circle:{fg:"#6b7280",bg:"rgba(107, 114, 128, 0.1)"},triangle:{fg:"#f59e0b",bg:"rgba(245, 158, 11, 0.1)"},hexagon:{fg:"#3b82f6",bg:"rgba(59, 130, 246, 0.1)"},octagon:{fg:"#ef4444",bg:"rgba(239, 68, 68, 0.1)"},pentagon:{fg:"#8b5cf6",bg:"rgba(139, 92, 246, 0.1)"},diamond:{fg:"#ec4899",bg:"rgba(236, 72, 153, 0.1)"}},a={slide:{enter:{transform:"translateX(80px)",opacity:"0"},leave:{transform:"translateX(120%)",opacity:"0"},duration:400,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},fade:{enter:{opacity:"0",filter:"blur(3px)"},leave:{opacity:"0",filter:"blur(3px)"},duration:500,easing:"ease"},scale:{enter:{transform:"scale(0.55)",opacity:"0"},leave:{transform:"scale(0.55)",opacity:"0"},duration:450,easing:"cubic-bezier(0.34, 1.56, 0.64, 1)"},bounce:{enter:{transform:"translateY(-80px)",opacity:"0"},leave:{transform:"translateY(20px)",opacity:"0"},duration:650,easing:"ease"},flip:{enter:{transform:"perspective(500px) rotateX(-90deg)",opacity:"0"},leave:{transform:"perspective(500px) rotateX(90deg)",opacity:"0"},duration:500,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},rotate:{enter:{transform:"rotate(-25deg) scale(0.6)",opacity:"0"},leave:{transform:"rotate(25deg) scale(0.6)",opacity:"0"},duration:500,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},zoom:{enter:{transform:"scale(0.1)",opacity:"0"},leave:{transform:"scale(0.1)",opacity:"0"},duration:500,easing:"cubic-bezier(0.34, 1.56, 0.64, 1)"},slideUp:{enter:{transform:"translateY(60px)",opacity:"0"},leave:{transform:"translateY(-120%)",opacity:"0"},duration:400,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},slideDown:{enter:{transform:"translateY(-60px)",opacity:"0"},leave:{transform:"translateY(120%)",opacity:"0"},duration:400,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},slideLeft:{enter:{transform:"translateX(-90px)",opacity:"0"},leave:{transform:"translateX(120%)",opacity:"0"},duration:400,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},slideRight:{enter:{transform:"translateX(90px)",opacity:"0"},leave:{transform:"translateX(-120%)",opacity:"0"},duration:400,easing:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"}},l={light:{bg:"rgba(255, 255, 255, 0.96)",text:"#1f2937",border:"rgba(0, 0, 0, 0.06)",shadow:"0 10px 36px -10px rgba(0, 0, 0, 0.18), 0 4px 14px -4px rgba(0, 0, 0, 0.08)",hoverShadow:"0 14px 48px -10px rgba(0, 0, 0, 0.22), 0 6px 18px -4px rgba(0, 0, 0, 0.10)",progressBg:"rgba(0, 0, 0, 0.06)",closeHoverBg:"rgba(0, 0, 0, 0.06)"},dark:{bg:"rgba(28, 32, 40, 0.94)",text:"#e6e8eb",border:"rgba(255, 255, 255, 0.08)",shadow:"0 10px 36px -10px rgba(0, 0, 0, 0.6), 0 4px 14px -4px rgba(0, 0, 0, 0.4)",hoverShadow:"0 14px 48px -8px rgba(0, 0, 0, 0.6), 0 6px 18px -4px rgba(0, 0, 0, 0.4)",progressBg:"rgba(255, 255, 255, 0.08)",closeHoverBg:"rgba(255, 255, 255, 0.08)"},auto:{bg:"rgba(255, 255, 255, 0.96)",text:"#1f2937",border:"rgba(0, 0, 0, 0.06)",shadow:"0 10px 36px -10px rgba(0, 0, 0, 0.18), 0 4px 14px -4px rgba(0, 0, 0, 0.08)",hoverShadow:"0 14px 48px -10px rgba(0, 0, 0, 0.22), 0 6px 18px -4px rgba(0, 0, 0, 0.10)",progressBg:"rgba(0, 0, 0, 0.06)",closeHoverBg:"rgba(0, 0, 0, 0.06)"},warm:{bg:"rgba(255, 251, 235, 0.96)",text:"#78350f",border:"rgba(245, 158, 11, 0.2)",shadow:"0 10px 36px -10px rgba(245, 158, 11, 0.18), 0 4px 14px -4px rgba(245, 158, 11, 0.08)",hoverShadow:"0 14px 48px -10px rgba(245, 158, 11, 0.22), 0 6px 18px -4px rgba(245, 158, 11, 0.10)",progressBg:"rgba(245, 158, 11, 0.1)",closeHoverBg:"rgba(245, 158, 11, 0.1)"}};let c=null,d="auto";const h=new Set;let g=null,p=null;const u=()=>"undefined"==typeof window?"light":"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",m=e=>"auto"===e?u():e,f=e=>{const t=m(e);return l[t]||l.light},y=e=>{d=e;const t=m(e);if("undefined"!=typeof document){document.documentElement.setAttribute("data-met-theme",t),document.documentElement.classList.remove("met-theme-light","met-theme-dark","met-theme-auto"),document.documentElement.classList.add(`met-theme-${t}`);const n=f(e);b(n)}B(e,t)},b=e=>{if("undefined"==typeof document)return;const t=document.documentElement;t.style.setProperty("--met-bg",e.bg),t.style.setProperty("--met-text",e.text),t.style.setProperty("--met-border",e.border),t.style.setProperty("--met-shadow",e.shadow),t.style.setProperty("--met-hover-shadow",e.hoverShadow),t.style.setProperty("--met-progress-bg",e.progressBg),t.style.setProperty("--met-close-hover-bg",e.closeHoverBg),t.style.setProperty("--met-success","#10b981"),t.style.setProperty("--met-error","#ef4444"),t.style.setProperty("--met-warning","#f59e0b"),t.style.setProperty("--met-info","#3b82f6"),t.style.setProperty("--met-loading","#6366f1")},x=()=>m(d),v=e=>{y(e),w(e)},w=e=>{if("undefined"!=typeof localStorage)try{localStorage.setItem("metona-toast-theme",e)}catch(e){}},k=()=>{if("undefined"!=typeof localStorage)try{return localStorage.getItem("metona-toast-theme")||"auto"}catch(e){}return"auto"},C=()=>{"undefined"!=typeof window&&window.matchMedia&&(g&&p&&g.removeEventListener("change",p),g=window.matchMedia("(prefers-color-scheme: dark)"),p=()=>{"auto"===d&&y("auto")},g.addEventListener("change",p))},B=(e,t)=>{h.forEach(n=>{try{n(e,t)}catch(e){}})},j=e=>{const t=f(e);return`\n .met-theme-${m(e)} {\n --met-bg: ${t.bg};\n --met-text: ${t.text};\n --met-border: ${t.border};\n --met-shadow: ${t.shadow};\n --met-hover-shadow: ${t.hoverShadow};\n --met-progress-bg: ${t.progressBg};\n --met-close-hover-bg: ${t.closeHoverBg};\n }\n `},_={getSystemTheme:u,resolveTheme:m,getThemeConfig:f,applyTheme:y,getCurrentTheme:()=>d,getResolvedTheme:x,switchTheme:v,toggleTheme:()=>{const e=x();v("dark"===e?"light":"dark")},resetToAuto:()=>{v("auto")},initTheme:()=>{const e=k();y(e),C()},watchSystemTheme:C,unwatchSystemTheme:()=>{g&&p&&(g.removeEventListener("change",p),g=null,p=null)},addThemeListener:e=>(h.add(e),()=>{h.delete(e)}),removeThemeListener:e=>{h.delete(e)},clearThemeListeners:()=>{h.clear()},registerTheme:(e,t)=>{l[e]={bg:t.bg||l.light.bg,text:t.text||l.light.text,border:t.border||l.light.border,shadow:t.shadow||l.light.shadow,hoverShadow:t.hoverShadow||l.light.hoverShadow,progressBg:t.progressBg||l.light.progressBg,closeHoverBg:t.closeHoverBg||l.light.closeHoverBg}},unregisterTheme:e=>{"light"!==e&&"dark"!==e&&"auto"!==e&&delete l[e]},getAllThemes:()=>({...l}),getThemeNames:()=>Object.keys(l),hasTheme:e=>e in l,getThemePreview:e=>{const t=f(e),n=m(e);return{name:e,resolved:n,colors:{background:t.bg,text:t.text,border:t.border},isDark:"dark"===n,isLight:"light"===n,isAuto:"auto"===e}},generateThemeCSS:j,applyThemeCSS:e=>{if("undefined"==typeof document)return;const t=j(e),n="metona-toast-theme-css",o=document.getElementById(n);o&&o.remove();const r=document.createElement("style");r.id=n,r.textContent=t,document.head.appendChild(r)},removeThemeCSS:()=>{if("undefined"==typeof document)return;const e=document.getElementById("metona-toast-theme-css");e&&e.remove()},saveTheme:w,loadTheme:k};let T="zh-CN";const S=new Set;let M="zh-CN";const L=()=>T,E=e=>{o[e]||(e=M),T=e,U(e),F(e)},z=(e,t={})=>{const n=A(T,e);if(void 0!==n)return $(n,t);if(T!==M){const n=A(M,e);if(void 0!==n)return $(n,t)}return e},A=(e,t)=>{const n=o[e];if(!n)return;const r=t.split(".");let i=n;for(const e of r){if(!i||"object"!=typeof i||!(e in i))return;i=i[e]}return"string"==typeof i?i:void 0},$=(e,t)=>e.replace(/\{(\w+)\}/g,(e,n)=>void 0!==t[n]?String(t[n]):e),I=e=>void 0!==A(T,e)||void 0!==A(M,e),P=(e,t)=>{for(const n in t)t[n]instanceof Object&&n in e&&e[n]instanceof Object?P(e[n],t[n]):e[n]=t[n];return e},N=()=>Object.keys(o),H=e=>e in o,D=e=>({"zh-CN":"简体中文","zh-TW":"繁體中文","en-US":"English (US)","en-GB":"English (UK)",ja:"日本語",ko:"한국어",fr:"Français",de:"Deutsch",es:"Español",pt:"Português",ru:"Русский",ar:"العربية",hi:"हिन्दी",th:"ไทย",vi:"Tiếng Việt",id:"Bahasa Indonesia",ms:"Bahasa Melayu",tr:"Türkçe",it:"Italiano",nl:"Nederlands",pl:"Polski",uk:"Українська",cs:"Čeština",sv:"Svenska",da:"Dansk",fi:"Suomi",nb:"Norsk",el:"Ελληνικά",he:"עברית",hu:"Magyar",ro:"Română",bg:"Български",hr:"Hrvatski",sk:"Slovenčina",sl:"Slovenščina",et:"Eesti",lv:"Latviešu",lt:"Lietuvių",ca:"Català",gl:"Galego",eu:"Euskara",cy:"Cymraeg",ga:"Gaeilge",mt:"Malti",is:"Íslenska",mk:"Македонски",sq:"Shqip",sr:"Српски",bs:"Bosanski",me:"Crnogorski",ka:"ქართული",hy:"Հայերեն",az:"Azərbaycan",uz:"O'zbek",kk:"Қазақ",ky:"Кыргыз",tg:"Тоҷикӣ",tk:"Türkmen",mn:"Монгол",ne:"नेपाली",si:"සිංහල",my:"မြန်မာ",km:"ខ្មែរ",lo:"ລາວ",am:"አማርኛ",sw:"Kiswahili",yo:"Yorùbá",ig:"Igbo",ha:"Hausa",zu:"isiZulu",af:"Afrikaans",xh:"isiXhosa",st:"Sesotho",tn:"Setswana",ts:"Xitsonga",ss:"siSwati",ve:"Tshivenda",nr:"isiNdebele"}[e]||e),O=e=>["ar","he","fa","ur","yi","ps","sd","ug"].includes(e)?"rtl":"ltr",q=e=>({code:e,name:D(e),direction:O(e),isSupported:H(e),isCurrent:e===T,isFallback:e===M}),F=e=>{if("undefined"!=typeof localStorage)try{localStorage.setItem("metona-toast-locale",e)}catch(e){}},V=()=>{if("undefined"!=typeof localStorage)try{return localStorage.getItem("metona-toast-locale")||R()}catch(e){}return R()},R=()=>{if("undefined"!=typeof navigator){const e=navigator.language||navigator.userLanguage;if(e&&H(e))return e;const t=e?.split("-")[0];if(t&&H(t))return t}return M},U=e=>{S.forEach(t=>{try{t(e)}catch(e){}})},X=(e,t={})=>{try{const n=e instanceof Date?e:new Date(e);return new Intl.DateTimeFormat(T,t).format(n)}catch(t){return String(e)}},Y=(e,t={})=>{try{return new Intl.PluralRules(T,t).select(e)}catch(t){return 1===e?"one":"other"}},W={t:z,plural:(e,t,n={})=>{const o=`${e}.${Y(t)}`;return I(o)?z(o,{...n,count:t}):I(e)?z(e,{...n,count:t}):e},getCurrentLocale:L,setCurrentLocale:E,switchLocale:e=>{E(e)},getFallbackLocale:()=>M,setFallbackLocale:e=>{o[e]&&(M=e)},hasTranslation:I,getTranslations:e=>o[e]||{},addTranslations:(e,t)=>{o[e]||(o[e]={}),P(o[e],t)},removeTranslation:(e,t)=>{const n=o[e];if(!n)return;const r=t.split(".");let i=n;for(let e=0;e<r.length-1;e++){if(!i[r[e]]||"object"!=typeof i[r[e]])return;i=i[r[e]]}delete i[r[r.length-1]]},clearTranslations:e=>{o[e]&&(o[e]={})},getSupportedLocales:N,isLocaleSupported:H,getLocaleName:D,getLocaleDirection:O,getLocaleInfo:q,getAllLocaleInfo:()=>N().map(q),formatNumber:(e,t={})=>{try{return new Intl.NumberFormat(T,t).format(e)}catch(t){return e.toString()}},formatCurrency:(e,t="USD",n={})=>{try{return new Intl.NumberFormat(T,{style:"currency",currency:t,...n}).format(e)}catch(t){return e.toString()}},formatPercent:(e,t={})=>{try{return new Intl.NumberFormat(T,{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2,...t}).format(e/100)}catch(t){return`${e}%`}},formatDate:X,formatTime:(e,t={})=>X(e,{hour:"numeric",minute:"numeric",second:"numeric",...t}),formatRelativeTime:(e,t={})=>{try{const n=e instanceof Date?e:new Date(e),o=new Date,r=n.getTime()-o.getTime(),i=new Intl.RelativeTimeFormat(T,{numeric:"auto",...t}),s=[{unit:"year",ms:31536e6},{unit:"month",ms:2592e6},{unit:"week",ms:6048e5},{unit:"day",ms:864e5},{unit:"hour",ms:36e5},{unit:"minute",ms:6e4},{unit:"second",ms:1e3}];for(const{unit:e,ms:t}of s)if(Math.abs(r)>=t||"second"===e){const n=Math.round(r/t);return i.format(n,e)}return String(e)}catch(t){return String(e)}},formatList:(e,t={})=>{const n=Intl;if("function"==typeof n.ListFormat)try{return new n.ListFormat(T,{style:"long",type:"conjunction"}).format(e)}catch(e){}return e.join(", ")},formatPlural:Y,addLocaleListener:e=>(S.add(e),()=>{S.delete(e)}),removeLocaleListener:e=>{S.delete(e)},clearLocaleListeners:()=>{S.clear()},initI18n:()=>{const e=V();E(e)},saveLocale:F,loadLocale:V,getDefaultLocale:R};o["zh-CN"],o["en-US"];const G=new Map,K=new Set(["slide","fade","scale","bounce","flip","rotate","zoom","slideUp","slideDown","slideLeft","slideRight"]);let Z=null;const J=new Set;Object.entries(a).forEach(([e,t])=>{G.set(e,{name:e,enter:t.enter,leave:t.leave,duration:t.duration,easing:t.easing})});const Q={register(e,t){G.set(e,{name:e,enter:t.enter||{},leave:t.leave||{},duration:t.duration||300,easing:t.easing||"cubic-bezier(0.4, 0, 0.2, 1)"})},unregister(e){G.delete(e)},get:e=>G.get(e)||null,getAnimationNames:()=>Array.from(G.keys()),getActiveCount:()=>G.size,cancelAll(){},reset(){G.clear(),Object.entries(a).forEach(([e,t])=>{G.set(e,{name:e,enter:t.enter,leave:t.leave,duration:t.duration,easing:t.easing})})},destroy(){G.clear(),J.clear(),Z=null}};class ee{static setCallbacks(e){void 0!==e.onError&&(ee._onError=e.onError),void 0!==e.removeToast&&(ee._removeToast=e.removeToast)}static on(e,t){return this._hooks.has(e)||this._hooks.set(e,[]),this._hooks.get(e).push(t),()=>this.off(e,t)}static off(e,t){const n=this._hooks.get(e);n&&this._hooks.set(e,n.filter(e=>e!==t))}static trigger(e,t=null){const n=this._hooks.get(e);if(!n||0===n.length)return!0;let o=!0;return n.forEach(n=>{try{!1===n(t)&&(o=!1)}catch(n){if(ee._onError)try{ee._onError({hook:e,error:n,toast:t})}catch(e){}}}),o}constructor(e){this.el=null,this.barEl=null,this.rafId=null,this.startedAt=0,this.paused=!1,this.closing=!1,this.group=null,this._cleanups=[],this.id=e.id||"met-"+Date.now().toString(36)+"-"+Math.random().toString(36).slice(2,8),this.type=e.type||"default",this.title=e.title||"",this.message=e.message??e.content??"",this.html=e.html||"",this.iconHTML=e.iconHTML||"",this.config={...i,...e},e.style&&"object"==typeof e.style&&(this.config.style={...e.style}),this.remaining=this.config.duration||0,this.group=e.group||null}_palette(){const e=(e=>m(e))(this.config.theme||"auto"),t=s[this.type]||s.default,n=l[e]||l.light;return{theme:e,c:t,t:{bg:n.bg,border:n.border,shadow:n.shadow}}}create(){if("undefined"==typeof window||"undefined"==typeof document)return this;if(!ee.trigger("beforeShow",this))return this;if("function"==typeof this.config.onBeforeShow)try{if(!1===this.config.onBeforeShow(this))return this}catch(e){}(()=>{if("undefined"==typeof document)return;if(c&&document.getElementById("metona-toast-styles"))return;c=document.createElement("style"),c.id="metona-toast-styles",c.textContent='\n .met-container {\n pointer-events: none;\n display: flex;\n flex-direction: column;\n gap: 12px;\n box-sizing: border-box;\n padding: 24px;\n max-width: 100vw;\n position: fixed;\n z-index: 9999;\n }\n\n .met-container.top-left { top: 0; left: 0; align-items: flex-start; }\n .met-container.top-center { top: 0; left: 0; right: 0; align-items: center; }\n .met-container.top-right { top: 0; right: 0; align-items: flex-end; }\n .met-container.bottom-left { bottom: 0; left: 0; align-items: flex-start; }\n .met-container.bottom-center{ bottom: 0; left: 0; right: 0; align-items: center; }\n .met-container.bottom-right { bottom: 0; right: 0; align-items: flex-end; }\n\n .met-toast {\n position: relative;\n display: flex;\n align-items: flex-start;\n gap: 12px;\n padding: 14px 16px;\n border-radius: 12px;\n box-sizing: border-box;\n backdrop-filter: blur(14px) saturate(180%);\n -webkit-backdrop-filter: blur(14px) saturate(180%);\n font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;\n user-select: none;\n -webkit-user-select: none;\n transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),\n box-shadow 0.25s ease,\n opacity 0.25s ease;\n will-change: transform, opacity;\n flex-shrink: 0;\n pointer-events: auto;\n min-width: 240px;\n max-width: calc(100vw - 48px);\n width: 360px;\n border: 1px solid var(--met-border, rgba(0,0,0,0.06));\n background: var(--met-bg, rgba(255,255,255,0.96));\n color: var(--met-text, #1f2937);\n box-shadow: var(--met-shadow, 0 10px 36px -10px rgba(0,0,0,0.18), 0 4px 14px -4px rgba(0,0,0,0.08));\n transform: translateZ(0);\n -webkit-transform: translateZ(0);\n backface-visibility: hidden;\n -webkit-backface-visibility: hidden;\n perspective: 1000;\n }\n\n .met-toast:hover {\n box-shadow: var(--met-hover-shadow, 0 14px 48px -10px rgba(0,0,0,0.22), 0 6px 18px -4px rgba(0,0,0,0.10)) !important;\n }\n\n .met-toast.met-clickable {\n cursor: pointer;\n }\n\n .met-icon {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n margin-top: 1px;\n }\n\n .met-content {\n flex: 1;\n min-width: 0;\n word-wrap: break-word;\n overflow-wrap: break-word;\n }\n\n .met-title {\n font-weight: 600;\n font-size: 14px;\n letter-spacing: 0.1px;\n }\n\n .met-message {\n font-size: 13px;\n opacity: 0.85;\n margin-top: 2px;\n }\n\n .met-close {\n flex-shrink: 0;\n background: transparent;\n border: 0;\n padding: 4px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n transition: background 0.2s, color 0.2s;\n line-height: 0;\n color: inherit;\n opacity: 0.5;\n }\n\n .met-close:hover {\n opacity: 1;\n background: var(--met-close-hover-bg, rgba(0,0,0,0.06));\n }\n\n .met-progress {\n position: absolute;\n left: 0; right: 0; bottom: 0;\n height: 3px;\n overflow: hidden;\n background: var(--met-progress-bg, rgba(0,0,0,0.06));\n border-radius: 0 0 12px 12px;\n }\n\n .met-progress-v {\n position: absolute;\n left: 0; top: 0; bottom: 0;\n width: 3px;\n overflow: hidden;\n background: var(--met-progress-bg, rgba(0,0,0,0.06));\n border-radius: 12px 0 0 12px;\n }\n\n .met-bar {\n position: absolute;\n left: 0; top: 0;\n height: 100%; width: 100%;\n transform-origin: left;\n transform: scaleX(1);\n }\n\n .met-bar-v {\n position: absolute;\n left: 0; bottom: 0;\n width: 100%; height: 100%;\n transform-origin: bottom;\n transform: scaleY(1);\n }\n\n .met-side {\n position: absolute;\n left: 0; top: 0; bottom: 0;\n width: 4px;\n border-radius: 12px 0 0 12px;\n }\n\n .met-spin {\n animation: met-rot 1s linear infinite;\n transform-origin: 50% 50%;\n }\n\n .met-toast.met-leaving {\n pointer-events: none;\n z-index: 1;\n }\n\n @keyframes met-rot {\n to { transform: rotate(360deg); }\n }\n\n .met-anim-slide.met-toast,\n .met-anim-fade.met-toast,\n .met-anim-scale.met-toast,\n .met-anim-bounce.met-toast,\n .met-anim-flip.met-toast,\n .met-anim-rotate.met-toast,\n .met-anim-zoom.met-toast,\n .met-anim-slideUp.met-toast,\n .met-anim-slideDown.met-toast,\n .met-anim-slideLeft.met-toast,\n .met-anim-slideRight.met-toast {\n opacity: 0;\n }\n\n @keyframes met-slide-in {\n 0% { transform: translateX(80px); opacity: 0; }\n 65% { transform: translateX(-6px); opacity: 1; }\n 100% { transform: translateX(0); opacity: 1; }\n }\n @keyframes met-fade-in {\n 0% { opacity: 0; filter: blur(3px); }\n 100% { opacity: 1; filter: blur(0); }\n }\n @keyframes met-scale-in {\n 0% { transform: scale(0.55); opacity: 0; }\n 65% { transform: scale(1.07); opacity: 1; }\n 100% { transform: scale(1); opacity: 1; }\n }\n @keyframes met-bounce-in {\n 0% { transform: translateY(-80px); opacity: 0; animation-timing-function: ease-in; }\n 45% { transform: translateY(14px); opacity: 1; animation-timing-function: ease-out; }\n 65% { transform: translateY(-12px); animation-timing-function: ease-in; }\n 82% { transform: translateY(4px); animation-timing-function: ease-out; }\n 100% { transform: translateY(0); opacity: 1; }\n }\n @keyframes met-flip-in {\n 0% { transform: perspective(500px) rotateX(-90deg); opacity: 0; }\n 60% { transform: perspective(500px) rotateX(8deg); opacity: 1; }\n 85% { transform: perspective(500px) rotateX(-2deg); }\n 100% { transform: perspective(500px) rotateX(0); opacity: 1; }\n }\n @keyframes met-rotate-in {\n 0% { transform: rotate(-25deg) scale(0.6); opacity: 0; }\n 60% { transform: rotate(4deg) scale(1.05); opacity: 1; }\n 85% { transform: rotate(-1deg) scale(0.98); }\n 100% { transform: rotate(0) scale(1); opacity: 1; }\n }\n @keyframes met-zoom-in {\n 0% { transform: scale(0.1); opacity: 0; }\n 50% { transform: scale(1.12); opacity: 1; }\n 75% { transform: scale(0.94); }\n 100% { transform: scale(1); opacity: 1; }\n }\n @keyframes met-slideUp-in {\n 0% { transform: translateY(60px); opacity: 0; }\n 70% { transform: translateY(-6px); opacity: 1; }\n 100% { transform: translateY(0); opacity: 1; }\n }\n @keyframes met-slideDown-in {\n 0% { transform: translateY(-60px); opacity: 0; }\n 70% { transform: translateY(6px); opacity: 1; }\n 100% { transform: translateY(0); opacity: 1; }\n }\n @keyframes met-slideLeft-in {\n 0% { transform: translateX(-90px); opacity: 0; }\n 65% { transform: translateX(6px); opacity: 1; }\n 100% { transform: translateX(0); opacity: 1; }\n }\n @keyframes met-slideRight-in {\n 0% { transform: translateX(90px); opacity: 0; }\n 65% { transform: translateX(-6px); opacity: 1; }\n 100% { transform: translateX(0); opacity: 1; }\n }\n\n .met-anim-slide.met-toast.met-show { animation: met-slide-in 0.40s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }\n .met-anim-fade.met-toast.met-show { animation: met-fade-in 0.50s ease forwards; }\n .met-anim-scale.met-toast.met-show { animation: met-scale-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }\n .met-anim-bounce.met-toast.met-show { animation: met-bounce-in 0.65s ease forwards; }\n .met-anim-flip.met-toast.met-show { animation: met-flip-in 0.50s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }\n .met-anim-rotate.met-toast.met-show { animation: met-rotate-in 0.50s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }\n .met-anim-zoom.met-toast.met-show { animation: met-zoom-in 0.50s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }\n .met-anim-slideUp.met-toast.met-show { animation: met-slideUp-in 0.40s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }\n .met-anim-slideDown.met-toast.met-show { animation: met-slideDown-in 0.40s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }\n .met-anim-slideLeft.met-toast.met-show { animation: met-slideLeft-in 0.40s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }\n .met-anim-slideRight.met-toast.met-show { animation: met-slideRight-in 0.40s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }\n\n @media (max-width: 480px) {\n .met-container { padding: 12px !important; }\n .met-toast { width: 100% !important; min-width: 0 !important; }\n }\n\n @media (max-width: 768px) {\n .met-toast { font-size: 13px; }\n .met-title { font-size: 13px; }\n .met-message { font-size: 12px; }\n }\n\n @media (min-width: 1200px) {\n .met-toast { width: 400px; }\n }\n\n @media (min-width: 1920px) {\n .met-toast { width: 440px; }\n }\n\n @media (max-width: 320px) {\n .met-toast { width: 100%; min-width: 0; padding: 12px 14px; }\n .met-container { padding: 8px; }\n }\n\n @media (orientation: landscape) and (max-height: 500px) {\n .met-container { padding: 12px 24px; }\n .met-toast { min-height: 44px; padding: 10px 14px; }\n }\n\n @media (orientation: portrait) and (max-width: 500px) {\n .met-container { padding: 12px; }\n .met-toast { width: 100%; min-width: 0; }\n }\n\n @media (prefers-reduced-motion: reduce) {\n .met-toast { transition: opacity 0.15s !important; }\n .met-toast.met-show { animation: none !important; opacity: 1 !important; }\n .met-spin { animation-duration: 2.5s !important; }\n }\n\n @media (forced-colors: active) {\n .met-toast { border: 2px solid ButtonText; }\n .met-close { border: 1px solid ButtonText; }\n }\n\n @media (prefers-contrast: high) {\n .met-toast { border-width: 3px; border-style: solid; }\n .met-close { border: 2px solid currentColor; border-radius: 4px; }\n }\n\n .met-toast:focus-visible {\n outline: 2px solid #3b82f6;\n outline-offset: 2px;\n }\n .met-close:focus-visible {\n outline: 2px solid #3b82f6;\n outline-offset: 2px;\n }\n\n @media (hover: none) and (pointer: coarse) {\n .met-toast:hover { box-shadow: inherit; }\n .met-toast { min-height: 48px; }\n .met-close { min-width: 48px; min-height: 48px; }\n }\n\n @media print {\n .met-container { display: none !important; }\n .met-toast { display: none !important; }\n }\n\n :fullscreen .met-container,\n :picture-in-picture .met-container {\n z-index: 2147483647;\n }\n\n @supports (padding: max(0px)) {\n .met-container {\n padding: max(24px, env(safe-area-inset-top))\n max(24px, env(safe-area-inset-right))\n max(24px, env(safe-area-inset-bottom))\n max(24px, env(safe-area-inset-left));\n }\n }\n\n .met-toast:active {\n transform: scale(0.98);\n }\n\n .met-toast.met-success { border-left: 4px solid #10b981; }\n .met-toast.met-error { border-left: 4px solid #ef4444; }\n .met-toast.met-warning { border-left: 4px solid #f59e0b; }\n .met-toast.met-info { border-left: 4px solid #3b82f6; }\n .met-toast.met-loading { border-left: 4px solid #6366f1; }\n\n .met-bar, .met-bar-v {\n transition: transform 0.1s linear;\n }\n\n .met-container::-webkit-scrollbar { width: 6px; height: 6px; }\n .met-container::-webkit-scrollbar-track { background: transparent; }\n .met-container::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }\n .met-container::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.3); }\n\n .met-toast.met-theme-dark {\n background: rgba(28, 32, 40, 0.94);\n color: #e6e8eb;\n border-color: rgba(255, 255, 255, 0.08);\n box-shadow: 0 10px 36px -10px rgba(0, 0, 0, 0.6), 0 4px 14px -4px rgba(0, 0, 0, 0.4);\n }\n .met-toast.met-theme-dark:hover {\n box-shadow: 0 14px 48px -8px rgba(0, 0, 0, 0.6), 0 6px 18px -4px rgba(0, 0, 0, 0.4) !important;\n }\n .met-toast.met-theme-dark .met-close:hover {\n background: rgba(255, 255, 255, 0.08);\n }\n .met-toast.met-theme-dark .met-progress,\n .met-toast.met-theme-dark .met-progress-v {\n background: rgba(255, 255, 255, 0.08);\n }\n\n .met-toast.met-theme-light {\n background: rgba(255, 255, 255, 0.96);\n color: #1f2937;\n border-color: rgba(0, 0, 0, 0.06);\n box-shadow: 0 10px 36px -10px rgba(0, 0, 0, 0.18), 0 4px 14px -4px rgba(0, 0, 0, 0.08);\n }\n .met-toast.met-theme-light:hover {\n box-shadow: 0 14px 48px -10px rgba(0, 0, 0, 0.22), 0 6px 18px -4px rgba(0, 0, 0, 0.10) !important;\n }\n .met-toast.met-theme-light .met-close:hover {\n background: rgba(0, 0, 0, 0.06);\n }\n .met-toast.met-theme-light .met-progress,\n .met-toast.met-theme-light .met-progress-v {\n background: rgba(0, 0, 0, 0.06);\n }\n\n .met-toast[data-theme] {\n --met-bg: var(--met-theme-bg);\n --met-text: var(--met-theme-text);\n --met-border: var(--met-theme-border);\n --met-shadow: var(--met-theme-shadow);\n }\n\n @media (prefers-color-scheme: dark) {\n .met-theme-auto .met-toast {\n background: rgba(28, 32, 40, 0.94);\n color: #e6e8eb;\n border-color: rgba(255, 255, 255, 0.08);\n box-shadow: 0 10px 36px -10px rgba(0, 0, 0, 0.6), 0 4px 14px -4px rgba(0, 0, 0, 0.4);\n }\n .met-theme-auto .met-toast:hover {\n box-shadow: 0 14px 48px -8px rgba(0, 0, 0, 0.6), 0 6px 18px -4px rgba(0, 0, 0, 0.4) !important;\n }\n .met-theme-auto .met-close:hover { background: rgba(255, 255, 255, 0.08); }\n .met-theme-auto .met-progress,\n .met-theme-auto .met-progress-v { background: rgba(255, 255, 255, 0.08); }\n }\n\n @media (prefers-color-scheme: light) {\n .met-theme-auto .met-toast {\n background: rgba(255, 255, 255, 0.96);\n color: #1f2937;\n border-color: rgba(0, 0, 0, 0.06);\n box-shadow: 0 10px 36px -10px rgba(0, 0, 0, 0.18), 0 4px 14px -4px rgba(0, 0, 0, 0.08);\n }\n .met-theme-auto .met-toast:hover {\n box-shadow: 0 14px 48px -10px rgba(0, 0, 0, 0.22), 0 6px 18px -4px rgba(0, 0, 0, 0.10) !important;\n }\n .met-theme-auto .met-close:hover { background: rgba(0, 0, 0, 0.06); }\n .met-theme-auto .met-progress,\n .met-theme-auto .met-progress-v { background: rgba(0, 0, 0, 0.06); }\n }\n '.replace(/\s+/g," "),document.head.appendChild(c)})(),(e=>{if("undefined"==typeof document)return;if(K.has(e))return;const t=G.get(e);t&&!J.has(e)&&(Z||(Z=document.getElementById("metona-toast-anim-styles"),Z||(Z=document.createElement("style"),Z.id="metona-toast-anim-styles",document.head.appendChild(Z))),Z.textContent+=((e,t)=>{var n;return`\n @keyframes met-${e}-in {\n from { ${n=t.enter,Object.entries(n).map(([e,t])=>`${e}:${t}`).join(";")}; }\n }\n .met-anim-${e}.met-toast { opacity: 0; }\n .met-anim-${e}.met-toast.met-show {\n animation: met-${e}-in ${t.duration}ms ${t.easing} forwards;\n }\n `})(e,t),J.add(e))})(this.config.animation||"slide");const e=this._getContainer(),{theme:t,c:n,t:o}=this._palette();this._limitToasts(e);const r=document.createElement("div");if(r.className=this._buildClassName(t),r.setAttribute("role","error"===this.type||"warning"===this.type?"alert":"status"),r.setAttribute("aria-live","error"===this.type?"assertive":"polite"),r.dataset.id=this.id,this._applyStyles(r,t,o),this._buildContent(r,n),this.el=r,(this.config.position||"top-right").startsWith("top")?e.insertBefore(r,e.firstChild):e.appendChild(r),ee._registry.set(this.id,this),this._bindEvents(r),this._startTimer(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{r.classList.add("met-show")})}),"function"==typeof this.config.onShow)try{this.config.onShow(this)}catch(e){}return ee.trigger("afterShow",this),this}_getContainer(){const e=this.config.position||"top-right",t=this.config.zIndex||9999,n="rtl"===O(L())?e.replace("left","__TMP__").replace("right","left").replace("__TMP__","right"):e,o=te.get(document.body);if(o&&o.has(n))return o.get(n);te.has(document.body)||te.set(document.body,new Map);const r=document.createElement("div");return r.className=`met-container ${n}`,r.setAttribute("aria-label","Notifications"),r.setAttribute("role","region"),r.style.cssText=`\n display:flex;\n flex-direction:column;\n gap:${this.config.gap||12}px;\n box-sizing:border-box;\n padding:${this.config.offset||24}px;\n max-width:100vw;\n position:fixed;\n z-index:${t};\n pointer-events:none;\n ${{"top-left":"top:0;left:0;align-items:flex-start","top-center":"top:0;left:0;right:0;align-items:center","top-right":"top:0;right:0;align-items:flex-end","bottom-left":"bottom:0;left:0;align-items:flex-start","bottom-center":"bottom:0;left:0;right:0;align-items:center","bottom-right":"bottom:0;right:0;align-items:flex-end"}[n]||"top:0;right:0;align-items:flex-end"}\n `,document.body.appendChild(r),te.get(document.body).set(n,r),r}_limitToasts(e){const t=this.config.max||6,n=Array.from(e.querySelectorAll(".met-toast"));for(;n.length>=t;){const e=n.shift(),t=e?.dataset.id;if(!t)continue;const o=ee._registry.get(t);o?o.close(!0):ee._removeToast&&ee._removeToast(t)}}_buildClassName(e){const t=(n=this.config.animation||"",G.has(n)?this.config.animation:"slide");var n;return["met-toast",`met-${this.type}`,`met-theme-${e}`,`met-anim-${t}`,this.config.closeOnClick||this.config.draggable?"met-clickable":"",this.config.className||""].filter(Boolean).join(" ")}_applyStyles(e,t,n){const o="number"==typeof this.config.width?`${this.config.width}px`:"string"==typeof this.config.width?this.config.width:"360px",r=(t,n)=>e.style.setProperty(t,n,"important");r("position","relative"),r("flex-shrink","0"),r("min-width","240px"),r("max-width","calc(100vw - 48px)"),r("width",o),this.config.style&&Object.keys(this.config.style).length>0&&Object.entries(this.config.style).forEach(([t,n])=>{e.style[t]=n})}_buildContent(e,o){if("function"==typeof this.config.render)return e.innerHTML=this.config.render(this),void(this.barEl=e.querySelector(".met-bar, .met-bar-v"));const r=!1!==this.config.icon&&(this.iconHTML||n[this.type]),i=!1!==this.config.closeButton,s=!1!==this.config.showProgress&&(this.config.duration||0)>0,a=!r&&"default"!==this.type,l=this.title?`<div class="met-title">${t(this.title)}</div>`:"",c=this.html?`<div class="met-message">${this.html}</div>`:this.message?`<div class="met-message">${t(this.message)}</div>`:"",d=r?`<div class="met-icon" style="color:${o.fg}">${this.iconHTML||n[this.type]}</div>`:"",h=i?`<button class="met-close" type="button" aria-label="${z("close")}">\n <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <line x1="18" y1="6" x2="6" y2="18"/>\n <line x1="6" y1="6" x2="18" y2="18"/>\n </svg>\n </button>`:"",g=s?"vertical"===this.config.progressDirection?`<div class="met-progress-v"><div class="met-bar-v" style="background:${o.fg}"></div></div>`:`<div class="met-progress"><div class="met-bar" style="background:${o.fg}"></div></div>`:"",p=a?`<div class="met-side" style="background:${o.fg}"></div>`:"";e.innerHTML=`\n ${d}\n ${p}\n <div class="met-content">\n ${l}\n ${c}\n </div>\n ${h}\n ${g}\n `,this.barEl=e.querySelector(".met-bar, .met-bar-v")}_bindEvents(e){const t=e=>{const t=e.target;if(t.closest(".met-close"))return e.stopPropagation(),void this.close();if(ee.trigger("click",this),!this.config.closeOnClick||t.closest(".met-close"));else{if("function"==typeof this.config.onClick)try{this.config.onClick(this)}catch(e){}this.close()}};if(e.addEventListener("click",t),this._cleanups.push(()=>e.removeEventListener("click",t)),this.config.pauseOnHover&&(this.config.duration||0)>0){const t=()=>{ee.trigger("hover",this),this._pause()},n=()=>{ee.trigger("hover",this),this._resume()};e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),this._cleanups.push(()=>{e.removeEventListener("mouseenter",t),e.removeEventListener("mouseleave",n)})}const n=()=>ee.trigger("animationStart",this),o=()=>ee.trigger("animationEnd",this);e.addEventListener("animationstart",n),e.addEventListener("animationend",o),this._cleanups.push(()=>{e.removeEventListener("animationstart",n),e.removeEventListener("animationend",o)}),this.config.draggable&&this._bindDrag(e)}_bindDrag(e){let t=0,n=0,o=0,r=0,i=!1;const s=o=>{o.target.closest(".met-close")||(i=!0,t=o.clientX,n=o.clientY,e.setPointerCapture(o.pointerId),e.style.transition="none",this._pause(),ee.trigger("dragStart",this))},a=s=>{i&&(o=s.clientX-t,r=s.clientY-n,e.style.transform=`translate(${o}px, ${r}px) rotate(${.1*o}deg)`,e.style.opacity=String(Math.max(0,1-Math.abs(o)/200)))},l=t=>{i&&(i=!1,e.releasePointerCapture(t.pointerId),e.style.transition="",Math.abs(o)>120?(e.style.transform=`translate(${2*o}px, ${r}px) rotate(${.2*o}deg)`,e.style.opacity="0",setTimeout(()=>this.close(!0),250)):(e.style.transform="",e.style.opacity="",this._resume()),o=r=0,ee.trigger("dragEnd",this))};e.addEventListener("pointerdown",s),e.addEventListener("pointermove",a),e.addEventListener("pointerup",l),e.addEventListener("pointercancel",l),this._cleanups.push(()=>{e.removeEventListener("pointerdown",s),e.removeEventListener("pointermove",a),e.removeEventListener("pointerup",l),e.removeEventListener("pointercancel",l)})}_startTimer(e=!1){if((this.config.duration||0)<=0)return;e||(this.startedAt=Date.now(),this.remaining=this.config.duration||0,ee.trigger("progressStart",this));const t=()=>{if(!this.paused&&!this.closing){try{const e=Date.now()-this.startedAt;if(this.remaining=Math.max(0,(this.config.duration||0)-e),this.barEl){const e=this.remaining/(this.config.duration||1),t="vertical"===this.config.progressDirection?`scaleY(${e})`:`scaleX(${e})`;this.barEl.style.transform=t}if(this.remaining<=0)return ee.trigger("progressEnd",this),void this.close()}catch(e){if(ee._onError)try{ee._onError({source:"timer",error:e,toast:this})}catch(e){}}this.rafId=requestAnimationFrame(t)}};this.rafId=requestAnimationFrame(t)}_pause(){this.paused||(this.config.duration||0)<=0||(this.paused=!0,null!==this.rafId&&cancelAnimationFrame(this.rafId),this.remaining=Math.max(0,(this.config.duration||0)-(Date.now()-this.startedAt)))}_resume(){this.paused&&(this.paused=!1,this.startedAt=Date.now()-((this.config.duration||0)-this.remaining),this._startTimer(!0))}update(e){if(!ee.trigger("beforeUpdate",this))return this;const n=e.type&&e.type!==this.type;if(e.type&&(this.type=e.type),void 0!==e.title&&(this.title=e.title),void 0!==e.message&&(this.message=e.message),void 0!==e.html&&(this.html=e.html),!this.el)return ee.trigger("afterUpdate",this),this;if(n){if(["met-success","met-error","met-warning","met-info","met-loading","met-default"].forEach(e=>this.el.classList.remove(e)),this.el.classList.add(`met-${this.type}`),this.barEl){const e=s[this.type]||s.default;this.barEl.style.background=e.fg}const e=this.el.querySelector(".met-side");if(e){const t=s[this.type]||s.default;e.style.background=t.fg}}const o=this.el.querySelector(".met-content");if(o){const e=this.title?`<div class="met-title">${t(this.title)}</div>`:"",n=this.html?`<div class="met-message">${this.html}</div>`:this.message?`<div class="met-message">${t(this.message)}</div>`:"";o.innerHTML=`${e}${n}`}if(this.config.resetTimerOnUpdate&&(this.config.duration||0)>0&&(null!==this.rafId&&cancelAnimationFrame(this.rafId),this.startedAt=Date.now(),this.remaining=this.config.duration||0,this._startTimer()),"function"==typeof this.config.onUpdate)try{this.config.onUpdate(this)}catch(e){}return ee.trigger("afterUpdate",this),this}updatePosition(e){if(!e||!this.el)return this;const t=this.el.parentNode;this.config.position=e;const n=this._getContainer();return t===n||(t&&this.el.parentNode===t&&t.removeChild(this.el),e.startsWith("top")?n.insertBefore(this.el,n.firstChild):n.appendChild(this.el)),this}remove(){null!==this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this._cleanups.forEach(e=>{try{e()}catch(e){}}),this._cleanups=[],this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=null,ee._registry.delete(this.id),ee._removeToast&&ee._removeToast(this.id)}close(e=!1){if(this.closing)return;if(!ee.trigger("beforeClose",this))return;this.closing=!0,null!==this.rafId&&cancelAnimationFrame(this.rafId),this._cleanups.forEach(e=>{try{e()}catch(e){}}),this._cleanups=[];const t=this.el;if(!t)return void(ee._removeToast&&ee._removeToast(this.id));const n=t.parentNode;if(n&&!e){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect();t.style.position="absolute",t.style.top=e.top-o.top+"px",t.style.left=e.left-o.left+"px",t.style.width=e.width+"px",t.style.margin="0"}t.classList.add("met-leaving"),t.classList.remove("met-show");const o=this.config.position||"top-right",r="rtl"===O(L());let i="scale(.96)";i=o.includes("right")?r?"translateX(-120%)":"translateX(120%)":o.includes("left")?r?"translateX(120%)":"translateX(-120%)":o.startsWith("top")?"translateY(-20px)":"translateY(20px)",t.style.transform=i,t.style.opacity="0",setTimeout(()=>this._destroy(),e?0:300)}_destroy(){if(this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=null,"function"==typeof this.config.onClose)try{this.config.onClose(this)}catch(e){}ee.trigger("afterClose",this),ee._registry.delete(this.id),ee._removeToast&&ee._removeToast(this.id)}}ee._hooks=new Map,ee._registry=new Map,ee._onError=null,ee._removeToast=null;const te=new Map,ne=e=>`\n <div style="display: flex; gap: 8px; margin-top: 12px;">\n ${e}\n </div>`,oe=e=>{const n=e.confirmText||z("confirm"),o=e.cancelText||z("cancel"),r=e.confirmColor||"#10b981",i=e.cancelColor||"#6b7280";return ne(`\n <button class="met-confirm-btn" style="flex:1;padding:8px 16px;border:none;border-radius:6px;background:${r};color:white;cursor:pointer;font-size:13px">${t(n)}</button>\n <button class="met-cancel-btn" style="flex:1;padding:8px 16px;border:none;border-radius:6px;background:${i};color:white;cursor:pointer;font-size:13px">${t(o)}</button>\n `)},re=e=>{const n=e.submitText||z("confirm"),o=e.cancelText||z("cancel"),r=e.submitColor||"#3b82f6",i=e.cancelColor||"#6b7280";return`\n <input type="${e.inputType||"text"}" \n class="met-input" \n placeholder="${t(e.placeholder||"")}"\n value="${t(e.defaultValue||"")}"\n style="width:100%;padding:8px 12px;border:1px solid rgba(0,0,0,0.1);border-radius:6px;font-size:13px;margin-top:8px;background:transparent;color:inherit;box-sizing:border-box">\n ${ne(`\n <button class="met-submit-btn" style="flex:1;padding:8px 16px;border:none;border-radius:6px;background:${r};color:white;cursor:pointer;font-size:13px">${t(n)}</button>\n <button class="met-cancel-btn" style="flex:1;padding:8px 16px;border:none;border-radius:6px;background:${i};color:white;cursor:pointer;font-size:13px">${t(o)}</button>\n `)}\n `},ie=e=>`\n <div class="met-progress-bar" style="width:100%;height:8px;background:rgba(0,0,0,0.1);border-radius:4px;margin-top:12px;overflow:hidden">\n <div class="met-progress-fill" style="width:0%;height:100%;background:${e.progressColor||"#3b82f6"};border-radius:4px;transition:width 0.3s ease"></div>\n </div>\n <div class="met-progress-text" style="font-size:12px;opacity:0.7;margin-top:4px;text-align:right">0%</div>\n `,se=e=>{if(!Array.isArray(e)||0===e.length)return"";const n=e.map((e,n)=>`<button class="met-action-btn-${n}" style="flex:1;padding:6px 12px;border:none;border-radius:6px;background:${e.style?.background||e.color||"#6366f1"};color:white;cursor:pointer;font-size:12px;font-weight:500">${t(e.text||"")}</button>`).join("");return ne(n)};class ae{constructor(){this.plugins=new Map,this.initialized=!1}register(e,t){if(this.plugins.has(e))return this;if(!t||"object"!=typeof t||!t.name)return this;const n={...t,installed:!1,enabled:!0};if(n.name||(n.name=e),this.plugins.set(e,n),n.install)try{n.install(this),n.installed=!0}catch(e){}return this}unregister(e){const t=this.plugins.get(e);if(!t)return this;if(t.uninstall)try{t.uninstall(this)}catch(e){}return this.plugins.delete(e),this}get(e){return this.plugins.get(e)||null}has(e){return this.plugins.has(e)}getAll(){return Array.from(this.plugins.values())}getNames(){return Array.from(this.plugins.keys())}enable(e){const t=this.plugins.get(e);return t&&(t.enabled=!0),this}disable(e){const t=this.plugins.get(e);return t&&(t.enabled=!1),this}isEnabled(e){const t=this.plugins.get(e);return!!t&&!!t.enabled}destroy(){this.plugins.forEach(e=>{if(e.destroy)try{e.destroy(this)}catch(e){}}),this.plugins.clear()}}const le={keyboard:{name:"keyboard",version:"1.0.0",description:"ESC 关闭所有 Toast",_handler:null,install(){if("undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&document.querySelectorAll(".met-toast .met-close").forEach(e=>{try{e.click()}catch(e){}})};this._handler=e,document.addEventListener("keydown",e)},uninstall(){const e=this._handler;e&&"undefined"!=typeof document&&(document.removeEventListener("keydown",e),this._handler=null)}},persistence:{name:"persistence",version:"1.0.0",description:"自动持久化配置到 localStorage",storageKey:"metona-toast-config",install(){if("undefined"!=typeof localStorage)try{const e=this.storageKey,t=localStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return null}return null},save(e){if("undefined"!=typeof localStorage)try{const t=this.storageKey;localStorage.setItem(t,JSON.stringify(e))}catch(e){}},uninstall(){if("undefined"!=typeof localStorage)try{const e=this.storageKey;localStorage.removeItem(e)}catch(e){}}},accessibility:{name:"accessibility",version:"1.0.0",description:"通过屏幕阅读器朗读 Toast 内容",announce(e){if("undefined"==typeof document)return;const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;";const n=z(e.type)||e.type;t.textContent=`${n}: ${e.title||""} ${e.message||""}`,document.body.appendChild(t),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t)},3e3)}}},ce={createManager:()=>new ae,register:(e,t)=>de.register(e,t),unregister:e=>de.unregister(e),get:e=>de.get(e),has:e=>de.has(e),getAll:()=>de.getAll(),getNames:()=>de.getNames(),enable:e=>de.enable(e),disable:e=>de.disable(e),isEnabled:e=>de.isEnabled(e),getPreset:e=>le[e]||null,getAllPresets:()=>({...le}),createPlugin:e=>({name:e.name||"custom",version:e.version||"1.0.0",description:e.description||"",hooks:e.hooks||{},install:e.install||void 0,uninstall:e.uninstall||void 0,...e}),validatePlugin(e){const t=[];return e&&"object"==typeof e||t.push("Plugin must be an object"),e.name||e.version||t.push("Plugin must have a name or version"),{valid:0===t.length,errors:t}}},de=new ae,he=(e,t="default")=>{const[n,o]=e;return"string"==typeof n?{...o||{},type:o?.type||t,message:n}:n&&"object"==typeof n?{...n,type:n.type||t}:{type:t,message:""}},ge={_toasts:new Map,_config:{...i},version:r,configure(e){return e&&"object"==typeof e?(Object.assign(this._config,e),e.theme&&y(e.theme),e.locale&&E(e.locale),ee.trigger("configChange"),this):this},_emit(e){const t={...this._config,...e};t.content&&!t.message&&(t.message=t.content);const n=new ee(t);return n.create(),this._toasts.set(n.id,n),n},_remove(e){this._toasts.delete(e)},find(e){if(e)return this._toasts.get(e)},show(e,t={}){const n=he([e,t],"default");return this._emit(n)},success(e,t={}){const n=he([e,t],"success");return this._emit(n)},error(e,t={}){const n=he([e,t],"error");return this._emit(n)},warning(e,t={}){const n=he([e,t],"warning");return this._emit(n)},info(e,t={}){const n=he([e,t],"info");return this._emit(n)},loading(e,t={}){const n=he([e,t],"loading");n.duration=0,n.closeButton=!1,n.showProgress=!1;const o=this._emit(n);return{id:o.id,success:(e,t={})=>this._resolve(o,"success",e||z("success"),t),error:(e,t={})=>this._resolve(o,"error",e||z("error"),t),info:(e,t={})=>this._resolve(o,"info",e||z("info"),t),warning:(e,t={})=>this._resolve(o,"warning",e||z("warning"),t),update:e=>(o.update(e),this),dismiss:()=>o.close()}},promise(e,t={}){if(!e||"function"!=typeof e.then)return Promise.reject(new Error("Invalid promise"));const n=t.loading||z("loading"),o=t.success||z("success"),r=t.error||z("error"),i=this.loading(n);return Promise.resolve(e).then(e=>(i.success(o),e)).catch(e=>{throw i.error(r),e})},_resolve(e,t,n,o){const r=e.id,i=this._toasts.get(r);if(!i)return null;const s=i.config.position;return i.close(),this._emit({...o,type:t,message:n,position:s})},confirm(e,t={}){return"string"!=typeof e?Promise.resolve(!1):new Promise(n=>{let o=!1;const r=e=>{o||(o=!0,clearTimeout(i),n(e))},i=setTimeout(()=>r(!1),1e4),s=this._emit({...t,type:t.type||"warning",message:e,duration:0,closeButton:!1,closeOnClick:!1,draggable:!1,html:oe(t)});setTimeout(()=>{const e=s.el?.querySelector(".met-confirm-btn"),t=s.el?.querySelector(".met-cancel-btn");e&&e.addEventListener("click",()=>{s.close(),r(!0)}),t&&t.addEventListener("click",()=>{s.close(),r(!1)})},0)})},prompt(e,t={}){return"string"!=typeof e?Promise.resolve(null):new Promise(n=>{let o=!1;const r=e=>{o||(o=!0,clearTimeout(i),n(e))},i=setTimeout(()=>r(null),1e4),s=this._emit({...t,type:t.type||"info",message:e,duration:0,closeButton:!1,closeOnClick:!1,draggable:!1,html:re(t)});setTimeout(()=>{const e=s.el?.querySelector(".met-input"),t=s.el?.querySelector(".met-submit-btn"),n=s.el?.querySelector(".met-cancel-btn");e&&(e.focus(),e.addEventListener("keydown",t=>{"Enter"===t.key&&(s.close(),r(e.value))})),t&&t.addEventListener("click",()=>{s.close(),r(e?.value||null)}),n&&n.addEventListener("click",()=>{s.close(),r(null)})},0)})},progress(e,t={}){const n=he([e,t],"info");n.duration=0,n.closeButton=!1,n.showProgress=!1;const o=this._emit({...n,html:ie(t)});return{id:o.id,setProgress(e){const t=o.el?.querySelector(".met-progress-fill"),n=o.el?.querySelector(".met-progress-text");t&&(t.style.width=`${Math.min(100,Math.max(0,e))}%`),n&&(n.textContent=`${Math.round(e)}%`)},complete(e){this.setProgress(100),setTimeout(()=>{o.update({type:"success",message:e||z("success"),html:""}),setTimeout(()=>o.close(),1e3)},300)},error(e){o.update({type:"error",message:e||z("error"),html:""}),setTimeout(()=>o.close(),2e3)},dismiss(){o.close()}}},countdown(e,t=10,n={}){if("string"!=typeof e)return{id:"",cancel:()=>{},pause:()=>{},resume:()=>{}};let o=Math.max(1,parseInt(String(t))||10),r=null;const i=this._emit({...n,type:n.type||"warning",message:e.replace(/\{seconds\}/g,String(o)),duration:0,closeButton:!0,showProgress:!1}),s=()=>{if(o--,o<=0){if(null!==r&&clearInterval(r),i.close(),"function"==typeof n.onComplete)try{n.onComplete()}catch(e){}}else i.update({message:e.replace(/\{seconds\}/g,String(o))})};return r=setInterval(s,1e3),{id:i.id,cancel(){null!==r&&clearInterval(r),i.close()},pause(){null!==r&&clearInterval(r)},resume(){null!==r&&clearInterval(r),r=setInterval(s,1e3)}}},action(e,t=[],n={}){const o=he([e,n],"info");o.duration=n.duration??0,o.closeButton=n.closeButton??!0;const r=this._emit({...o,html:(o.html||"")+se(t)});return Array.isArray(t)&&setTimeout(()=>{t.forEach((e,t)=>{const n=r.el?.querySelector(`.met-action-btn-${t}`);n&&"function"==typeof e.onClick&&n.addEventListener("click",()=>{try{e.onClick(r)}catch(e){}!1!==e.close&&r.close()})})},0),{id:r.id,toast:r,dismiss:()=>r.close()}},queue(e,t={}){if(!Array.isArray(e)){const e=Promise.resolve();return{then:t=>e.then(t),catch:t=>e.catch(t),cancel:()=>{}}}let n=!1;const o=new Promise(o=>{let r=0;const i=t.delay||1e3,s=t.onClose,a=()=>{if(n||r>=e.length)return void o();const l=e[r];r++;const c="string"==typeof l?l:l?.message||"",d="object"==typeof l&&null!==l?l:{},h=d.onClose;this._emit({...t,...d,message:c,duration:d.duration||t.duration||3e3,onClose:e=>{if("function"==typeof h)try{h(e)}catch(e){}if("function"==typeof s)try{s(e)}catch(e){}setTimeout(a,i)}})};a()});return{then:(e,t)=>o.then(e,t),catch:e=>o.catch(e),cancel:()=>{n=!0}}},stack(e,t={}){Array.isArray(e)&&e.forEach((e,n)=>{setTimeout(()=>{const n="string"==typeof e?e:e?.message||"";this._emit({...t,..."object"==typeof e&&null!==e?e:{},message:n})},n*(t.stagger||100))})},dismiss(e){if(e){const t=this._toasts.get(e);return void(t&&t.close())}this._toasts.forEach(e=>e.close())},removeToast(e){if(!e)return;const t=this._toasts.get(e);t&&t.remove()},clear(e){this._toasts.forEach(t=>{e&&t.config.position!==e||t.close()})},getAll(){return new Map(this._toasts)},count(){return this._toasts.size},group(e){const t=this,n={_group:e};return["show","success","error","warning","info","loading","action"].forEach(o=>{n[o]=(...n)=>{const r=n[n.length-1],i="object"==typeof r&&null!==r&&!Array.isArray(r),s=t;return i&&1===n.length?s[o]({...r,group:e}):i?(n.pop(),s[o](...n,{...r,group:e})):s[o](...n,{group:e})}}),n.dismiss=()=>t.dismissGroup(e),n.count=()=>t._groupCount(e),n},dismissGroup(e){this._toasts.forEach(t=>{t.group===e&&t.close()})},_groupCount(e){let t=0;return this._toasts.forEach(n=>{n.group===e&&t++}),t},getToasts(){return Array.from(this._toasts.values())},hasToasts(){return this._toasts.size>0},getToast(e){return e&&this._toasts.get(e)||null},closeAll(){this._toasts.forEach(e=>e.close())},clearAll(){this._toasts.forEach(e=>e.close())},pauseAll(){this._toasts.forEach(e=>e._pause())},resumeAll(){this._toasts.forEach(e=>e._resume())},updateAll(e){e&&"object"==typeof e&&this._toasts.forEach(t=>t.update(e))},findToasts(e){return"function"!=typeof e?[]:Array.from(this._toasts.values()).filter(e)},findByType(e){return this.findToasts(t=>t.type===e)},findByPosition(e){return this.findToasts(t=>t.config.position===e)},init(e={}){return ee.trigger("beforeInit"),this._destroyed=!1,e.config&&this.configure(e.config),e.theme&&this.themes&&this.themes.switchTheme(e.theme),e.locale&&this.i18n&&this.i18n.switchLocale(e.locale),e.plugins&&Array.isArray(e.plugins)&&e.plugins.forEach(e=>{this.use(e)}),ee.trigger("afterInit"),this},getStatus(){return{version:r,toasts:this._toasts.size,theme:this.themes?.getCurrentTheme?.()||"auto",locale:this.i18n?.getCurrentLocale?.()||"zh-CN",plugins:this.plugins?.getNames?.()||[],animations:this.animations?.getActiveCount?.()||0}},getConfig(){return{...this._config}},updateConfig(e){return e&&"object"==typeof e&&(Object.assign(this._config,e),ee.trigger("configChange")),this},resetConfig(){return Object.keys(this._config).forEach(e=>delete this._config[e]),Object.assign(this._config,i),ee.trigger("configChange"),this},use(e,t={}){if("string"==typeof e){const n=le[e];if(!n)return this;if(this.plugins.register(e,{...n,...t}),"accessibility"===e&&ee.on("afterShow",e=>{const t=n;"function"==typeof t.announce&&t.announce(e)}),"persistence"===e){const e="function"==typeof n.install?n.install(this.plugins):null;e&&this.configure(e),ee.on("afterClose",()=>{const e=n;"function"==typeof e.save&&e.save(this.getConfig())})}}else e&&"object"==typeof e&&this.plugins.register(e.name||"custom",{...e,...t});return this},destroy(){this._destroyed||(this._destroyed=!0,ee.trigger("beforeDestroy"),this.dismiss(),this.plugins&&"function"==typeof this.plugins.destroy&&this.plugins.destroy(),this.themes&&("function"==typeof this.themes.clearThemeListeners&&this.themes.clearThemeListeners(),"function"==typeof this.themes.unwatchSystemTheme&&this.themes.unwatchSystemTheme()),this.i18n&&"function"==typeof this.i18n.clearLocaleListeners&&this.i18n.clearLocaleListeners(),this.animations&&"function"==typeof this.animations.destroy&&this.animations.destroy(),"undefined"!=typeof document&&(document.querySelectorAll(".met-container").forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),["metona-toast-styles","metona-toast-theme-css","metona-toast-custom-styles","metona-toast-anim-styles"].forEach(e=>{const t=document.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)})),this._toasts.clear(),te.clear(),ee._registry.clear(),ee.trigger("afterDestroy"),ee._hooks.clear())},animations:null,themes:null,i18n:null,plugins:null,presetPlugins:{}};ee.setCallbacks({onError:e=>{const t=ge._config.onError;if("function"==typeof t)try{t(e)}catch(e){}},removeToast:e=>{ge._toasts.delete(e)}});const pe={...ge,version:r,animations:Q,themes:_,i18n:W,plugins:ce,presetPlugins:le};if("function"==typeof _.initTheme&&_.initTheme(),"function"==typeof W.initI18n&&W.initI18n(),"function"==typeof _.addThemeListener&&_.addThemeListener(()=>ee.trigger("themeChange")),"function"==typeof W.addLocaleListener&&W.addLocaleListener(()=>ee.trigger("localeChange")),"undefined"!=typeof window){window.MeToast=pe,window.Met=pe;const e=e=>{try{new Notification(e.title||e.type,{body:e.message})}catch(e){}};pe._notify=t=>{"undefined"!=typeof Notification&&"denied"!==Notification.permission&&document.hidden&&("default"!==Notification.permission?e(t):Notification.requestPermission().then(n=>{"granted"===n&&e(t)}))},ee.on("afterShow",e=>{e.config.notifyWhenHidden&&pe._notify(e)})}e.MeToast=pe,e.Met=pe,e.Toast=ee,e.VERSION=r,e.default=pe,e.meToast=pe,Object.defineProperty(e,"__esModule",{value:!0})});
|