customizable-toast-notification 3.18.2 → 3.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +3 -3
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.esm.mjs +3 -3
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -2
package/dist/index.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Customizable Toast Notifications
|
|
3
|
-
* Build: 2026-10-24
|
|
4
|
-
* Cache-Buster:
|
|
3
|
+
* Build: 2026-10-24 08:53:02
|
|
4
|
+
* Cache-Buster: 1792831982389
|
|
5
5
|
* Author: Priyanshu Patel
|
|
6
6
|
* Email: priyanshu.alt191@gmail.com
|
|
7
7
|
* License: Apache-2.0
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
* Supports flexible positioning, theming, icons, animations, and timing options
|
|
13
13
|
* out of the box — with CTA support and zero dependencies.
|
|
14
14
|
*/
|
|
15
|
-
!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).customizableToast={})}(this,function(e){"use strict";function t(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function o(e){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?n(Object(i),!0).forEach(function(n){t(e,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}const i=Object.freeze({maxVisible:3,maxQueueSize:100,zIndex:9999,targetNode:null,disableInlineStyles:!1,reducedMotion:"auto",defaultPosition:"bottom-right",theme:"light",stacked:!1,swipeToDismiss:!0,sound:!0,soundPreset:"modern",pauseOnHover:!1,syncTabs:!1,aiPrioritization:!1,priorityScorer:null,onMetrics:null,debug:!1}),r=o({},i);function s(e={}){if(!e||"object"!=typeof e||Array.isArray(e))return l();const{maxVisible:t,maxQueueSize:n,zIndex:o,targetNode:i,disableInlineStyles:s,reducedMotion:a,defaultPosition:c,theme:u,stacked:d,swipeToDismiss:p,sound:f,soundPreset:m,pauseOnHover:h,syncTabs:y,aiPrioritization:g,priorityScorer:b,onMetrics:v,debug:w}=e;if(void 0!==w&&(r.debug=Boolean(w)),void 0!==t){const e=Number(t);Number.isFinite(e)&&e>0&&(r.maxVisible=Math.max(1,Math.floor(e)))}if(void 0!==n){const e=Number(n);Number.isFinite(e)&&e>=0&&(r.maxQueueSize=Math.floor(e))}if(void 0!==o){const e=Number(o);Number.isFinite(e)&&(r.zIndex=Math.trunc(e))}if(void 0!==i&&(r.targetNode=i&&"object"==typeof i&&"function"==typeof i.appendChild?i:null),void 0!==s&&(r.disableInlineStyles=Boolean(s)),void 0!==a){const e=String(a||"auto").toLowerCase();["auto","always","never"].includes(e)&&(r.reducedMotion=e,"undefined"!=typeof document&&("always"===e?document.documentElement.setAttribute("data-toast-reduced-motion","always"):"never"===e?document.documentElement.setAttribute("data-toast-reduced-motion","never"):document.documentElement.removeAttribute("data-toast-reduced-motion")))}if(void 0!==c){const e=String(c||"").toLowerCase().trim();e&&(r.defaultPosition=e)}if(void 0!==u){const e=String(u||"light").toLowerCase();["light","dark","high-contrast","compact","spacious","glass"].includes(e)&&(r.theme=e,"undefined"!=typeof document&&document.documentElement.setAttribute("data-toast-theme",e))}if(void 0!==d&&(r.stacked=Boolean(d)),void 0!==p&&(r.swipeToDismiss=Boolean(p)),void 0!==f&&(r.sound=Boolean(f)),void 0!==m){const e=String(m||"modern").toLowerCase().trim();e&&(r.soundPreset=e)}return void 0!==h&&(r.pauseOnHover=Boolean(h)),void 0!==y&&(r.syncTabs=Boolean(y)),void 0!==g&&(r.aiPrioritization=Boolean(g)),void 0!==b&&(r.priorityScorer="function"==typeof b?b:null),void 0!==v&&(r.onMetrics="function"==typeof v?v:null),l()}function a(){return Object.assign(r,i),"undefined"!=typeof document&&(document.documentElement.removeAttribute("data-toast-theme"),document.documentElement.removeAttribute("data-toast-reduced-motion")),l()}function l(){return o({},r)}function c(){if("always"===r.reducedMotion)return!0;if("never"===r.reducedMotion)return!1;try{return Boolean("undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)}catch(e){return!1}}let u=0;const d=Math.floor(65535*Math.random()).toString(36).padStart(3,"0");function p(){u=0}function f(e="toast"){const t="string"==typeof e?e.trim().toLowerCase().replace(/[^a-z0-9_-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""):"",n=t&&!/^[0-9]/.test(t)?t:"toast",o=Date.now().toString(36);u=u+1&16777215;const i=u.toString(36);return`${n}-${o}-${d}${i}`}const m=new class{constructor(e=200){this.maxSize=e,this.map=new Map}get(e){if(!this.map.has(e))return;const t=this.map.get(e);return this.map.delete(e),this.map.set(e,t),t}set(e,t){if(this.map.has(e))this.map.delete(e);else if(this.map.size>=this.maxSize){const e=this.map.keys().next().value;this.map.delete(e)}this.map.set(e,t)}}(200),h={};function y(e){if(!e)return"#ffffff";const t=String(e),n=m.get(t);if(n)return n;if(h[null==e?void 0:e.toLowerCase()]){const n=h[e.toLowerCase()];return m.set(t,n),n}let o,i,r;try{const t=function(e){const t=null==e?void 0:e.match(/^#(?:([0-9a-f]{3,4})|([0-9a-f]{6})|([0-9a-f]{8}))$/i);if(t){let e=t[1]||t[2]||t[3];if(3!==e.length&&4!==e.length||(e=e.slice(0,3).split("").map(e=>e+e).join("")),e.length>=6){const t=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),o=parseInt(e.slice(4,6),16);if(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(o))return{r:t,g:n,b:o}}return null}const n=e=>{if("string"!=typeof e)return Number(e);const t=e.trim();return t.endsWith("%")?Math.round(parseFloat(t)/100*255):Number(t)},o=null==e?void 0:e.match(/rgba?\(\s*([\d.]+%?)\s*,\s*([\d.]+%?)\s*,\s*([\d.]+%?)(?:\s*,\s*[\d.%]+)?\s*\)/i);if(o){const e=Math.min(255,Math.max(0,n(o[1]))),t=Math.min(255,Math.max(0,n(o[2]))),i=Math.min(255,Math.max(0,n(o[3])));if(Number.isFinite(e)&&Number.isFinite(t)&&Number.isFinite(i))return{r:e,g:t,b:i}}const i=null==e?void 0:e.match(/rgba?\(\s*([\d.]+%?)\s+([\d.]+%?)\s+([\d.]+%?)(?:\s*\/\s*[\d.%]+)?\s*\)/i);if(i){const e=Math.min(255,Math.max(0,n(i[1]))),t=Math.min(255,Math.max(0,n(i[2]))),o=Math.min(255,Math.max(0,n(i[3])));if(Number.isFinite(e)&&Number.isFinite(t)&&Number.isFinite(o))return{r:e,g:t,b:o}}const r=null==e?void 0:e.match(/hsla?\(\s*(-?[\d.]+(?:deg|rad|turn)?)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*[\d.%]+)?\s*\)/i),s=!r&&(null==e?void 0:e.match(/hsla?\(\s*(-?[\d.]+(?:deg|rad|turn)?)\s+([\d.]+)%\s+([\d.]+)%(?:\s*\/\s*[\d.%]+)?\s*\)/i)),a=r||s;if(a){const e=(e=>{const t=e.trim().toLowerCase();let n=parseFloat(t);return Number.isFinite(n)?(t.endsWith("turn")?n*=360:t.endsWith("rad")&&(n=180*n/Math.PI),(n%360+360)%360/360):0})(a[1]),t=Math.min(1,Math.max(0,Number(a[2])/100)),n=Math.min(1,Math.max(0,Number(a[3])/100));if(0===t){const e=Math.round(255*n);return{r:e,g:e,b:e}}const o=(e,t,n)=>{let o=n;return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+6*(t-e)*o:o<.5?t:o<2/3?e+(t-e)*(2/3-o)*6:e},i=n<.5?n*(1+t):n+t-n*t,r=2*n-i;return{r:Math.round(255*o(r,i,e+1/3)),g:Math.round(255*o(r,i,e)),b:Math.round(255*o(r,i,e-1/3))}}return null}(function(e){if("string"!=typeof e)return e;let t=e.trim(),n=0;for(;t.toLowerCase().startsWith("var(")&&t.endsWith(")")&&n<5;){n++;const e=t.slice(4,-1).trim(),o=e.indexOf(","),i=(-1===o?e:e.slice(0,o)).trim(),r=-1===o?"":e.slice(o+1).trim();if(!i.startsWith("--"))return t;let s="";try{"undefined"!=typeof document&&"function"==typeof getComputedStyle&&(s=getComputedStyle(document.documentElement).getPropertyValue(i).trim())}catch(e){}if(s)t=s;else{if(!r)break;t=r}}return t}("string"==typeof e?e.trim():String(e||"")).trim());if(!t)throw new Error("Unknown color");({r:o,g:i,b:r}=t)}catch(e){o=i=r=128}const s=(e,t,n)=>{const o=[e,t,n].map(e=>(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4));return.2126*o[0]+.7152*o[1]+.0722*o[2]},a=(e,t)=>{const n=s(...e),o=s(...t);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)};let[l,c,u]=((e,t,n)=>{e/=255,t/=255,n/=255;const o=Math.max(e,t,n),i=Math.min(e,t,n);let r,s,a=(o+i)/2;if(o===i)r=s=0;else{const l=o-i;switch(s=a>.5?l/(2-o-i):l/(o+i),o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return[360*r,s,a]})(o,i,r),d=u<.5?Math.min(u+.5,1):Math.max(u-.5,0),[p,f,y]=((e,t,n)=>{let o,i,r;if(e/=360,0===t)o=i=r=n;else{const s=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=s(l,a,e+1/3),i=s(l,a,e),r=s(l,a,e-1/3)}return[Math.round(255*o),Math.round(255*i),Math.round(255*r)]})(l,c,d);if(a([o,i,r],[p,f,y])<4.5){const e=a([o,i,r],[0,0,0]),t=a([o,i,r],[255,255,255]);[p,f,y]=e>=t?[0,0,0]:[255,255,255]}const g=((e,t,n)=>`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`)(p,f,y);return m.set(t,g),g}Object.entries({aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],transparent:[255,255,255],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}).forEach(([e,[t,n,o]])=>{const i=e=>{const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)},r=.2126*i(t)+.7152*i(n)+.0722*i(o),s=(r+.05)/.05,a=1.05/(r+.05);h[e.toLowerCase()]=s>=a?"#000000":"#ffffff"});const g=new Set(["DIV","SPAN","P","BR","STRONG","B","EM","I","U","SMALL","UL","OL","LI","A","IMG","PRE","CODE","MARK"]),b=new Set(["href","src","alt","title","class","target","rel","loading"]),v=new Set(["SCRIPT","STYLE","IFRAME","NOSCRIPT","OBJECT","EMBED","SVG","MATH","AUDIO","VIDEO","CANVAS","TEMPLATE"]),w=/^\s*(?:https?:|mailto:|data:image\/(?:png|jpe?g|gif|webp|avif|bmp|ico);|\/(?!\/|\\)|\.\/|\.\.\/|#)/i;function T(e,t,n){if(e.nodeType===Node.TEXT_NODE)return document.createTextNode(e.nodeValue);if(e.nodeType===Node.COMMENT_NODE)return null;if(e.nodeType!==Node.ELEMENT_NODE)return null;const o=e.tagName.toUpperCase();if(v.has(o)||o.includes("SCRIPT")||o.includes("<")||o.includes(">"))return null;if(!t.has(o)){const o=document.createDocumentFragment();return Array.from(e.childNodes).forEach(e=>{const i=T(e,t,n);i&&o.appendChild(i)}),o}const i=document.createElement(e.tagName);return Array.from(e.attributes||[]).forEach(e=>{i.setAttribute(e.name,e.value)}),function(e,t){const n=[];Array.from(e.attributes||[]).forEach(o=>{const i=o.name.toLowerCase(),r=o.value;if(t.has(i)&&!i.startsWith("on")){if("href"===i||"src"===i){const t="string"==typeof r?r.trim().toLowerCase():"";if((t.startsWith("javascript:")||t.startsWith("vbscript:")||t.startsWith("data:"))&&("src"!==i||!t.startsWith("data:image/")||t.startsWith("data:image/svg+xml")))return"href"===i?void e.setAttribute("href","#"):void n.push(o.name);if(!w.test(r))return"href"===i?void e.setAttribute("href","#"):void n.push(o.name)}if("target"===i&&"string"==typeof r&&"_blank"===r.trim().toLowerCase()){const t=(e.getAttribute("rel")||"").split(/\s+/).filter(Boolean);t.includes("noopener")||t.push("noopener"),t.includes("noreferrer")||t.push("noreferrer"),e.setAttribute("rel",t.join(" "))}}else n.push(o.name)}),n.forEach(t=>e.removeAttribute(t));const o=e.getAttribute("target");if("A"===e.tagName&&"string"==typeof o&&"_blank"===o.trim().toLowerCase()){const t=(e.getAttribute("rel")||"").split(/\s+/).filter(Boolean);t.includes("noopener")||t.push("noopener"),t.includes("noreferrer")||t.push("noreferrer"),e.setAttribute("rel",t.join(" "))}}(i,n),Array.from(e.childNodes).forEach(e=>{const o=T(e,t,n);o&&i.appendChild(o)}),i}function x(e){if(!e||"string"!=typeof e)return"";const t=function(e){if("undefined"!=typeof DOMParser)try{const t=(new DOMParser).parseFromString(e,"text/html");if(t&&t.body)return t.body}catch(e){}if("undefined"!=typeof document){const t=document.createElement("template");if("content"in t)return t.innerHTML=e,t.content;const n=document.createElement("div");return n.innerHTML=e,n}return null}(e);if(!t)return"";const n=document.createDocumentFragment();Array.from(t.childNodes).forEach(e=>{const t=T(e,g,b);t&&n.appendChild(t)});const o=document.createElement("div");return o.appendChild(n),o.querySelectorAll('a[target="_blank"]').forEach(e=>{const t=(e.getAttribute("rel")||"").split(/\s+/).filter(Boolean);t.includes("noopener")||t.push("noopener"),t.includes("noreferrer")||t.push("noreferrer"),e.setAttribute("rel",t.join(" "))}),o.innerHTML}function A(e,t={}){if("string"!=typeof e||!e.trim())return"";try{if(!t.forceFallback&&function(){try{return Boolean("undefined"!=typeof window&&window.DOMPurify&&"function"==typeof window.DOMPurify.sanitize)}catch(e){}return!1}()){const t=window.DOMPurify.sanitize(e,{ALLOWED_TAGS:Array.from(g),ALLOWED_ATTR:Array.from(b),ALLOWED_URI_REGEXP:w}),n=document.createElement("div");return n.innerHTML=t,n.querySelectorAll("a[href]").forEach(e=>{const t=e.getAttribute("href")||"";w.test(t)||e.setAttribute("href","#")}),n.querySelectorAll('a[target="_blank"]').forEach(e=>{const t=(e.getAttribute("rel")||"").split(/\s+/).filter(Boolean);t.includes("noopener")||t.push("noopener"),t.includes("noreferrer")||t.push("noreferrer"),e.setAttribute("rel",t.join(" "))}),n.innerHTML}}catch(e){console.warn("DOMPurify sanitization failed, falling back:",e)}return x(e)}function C(e={}){if("undefined"==typeof document)return null;const t=e&&"object"==typeof e&&!Array.isArray(e)?e:{},n=Number(t.size),o=Number.isFinite(n)&&n>0?n:14,i="string"==typeof t.color&&t.color.trim()?t.color.trim():"currentColor",r=/[\r\n<>"';]/.test(i)||/^\s*javascript:/i.test(i)?"currentColor":i,s="string"==typeof t.text?t.text:"",a=document.createElement("span");a.className="toast-loader",a.setAttribute("role","status"),a.setAttribute("aria-label",s||"Loading");const u=l();u.disableInlineStyles||(a.style.display="inline-flex",a.style.alignItems="center",a.style.gap="8px");const d="http://www.w3.org/2000/svg",p=document.createElementNS(d,"svg");p.setAttribute("width",String(o)),p.setAttribute("height",String(o)),p.setAttribute("viewBox","0 0 50 50"),p.setAttribute("aria-hidden","true");const f=document.createElementNS(d,"circle");if(f.classList.add("toast-loader-circle"),f.setAttribute("cx","25"),f.setAttribute("cy","25"),f.setAttribute("r","20"),f.setAttribute("fill","none"),f.setAttribute("stroke",r),f.setAttribute("stroke-width","4"),f.setAttribute("stroke-linecap","round"),u.disableInlineStyles||(f.style.opacity="0.85",f.style.strokeDasharray="90",f.style.strokeDashoffset="60",f.style.transformOrigin="center",c()||(f.style.animation="toast-spinner 1s linear infinite")),p.appendChild(f),a.appendChild(p),s){const e=document.createElement("span");e.className="toast-loader-label",u.disableInlineStyles||(e.style.fontSize="13px"),e.textContent=s,a.appendChild(e)}if(!u.disableInlineStyles&&"undefined"!=typeof document&&!document.getElementById("toast-spinner-styles"))try{const e=document.createElement("style");e.id="toast-spinner-styles",e.textContent="@keyframes toast-spinner { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }";const t=document.head||document.documentElement;t&&t.appendChild(e)}catch(e){}return a}function S(e,t,n){const i=null==t?void 0:t.cta;if(!i||"object"!=typeof i)return;const r=Array.isArray(i)?i.filter(e=>e&&"object"==typeof e):[i];if(0===r.length)return;const s=[];r.forEach((i,a)=>{if(!i||"object"!=typeof i)return;const c=o({},i);c.label||(c.label=r.length>1?`Action ${a+1}`:"CTA Label Missing!");const u="link"===c.variant||!c.variant&&!!c.href,d=document.createElement(u?"a":"button");if(u){if(c.href){const e=String(c.href).trim(),t=/^(javascript:|vbscript:|data:(?!image\/[a-z0-9.+-]+;base64,))/i.test(e);d.href=t?"#":e}else d.setAttribute("role","button"),d.tabIndex=0;c.target&&(d.target=c.target);const e=new Set((c.rel||"").split(/\s+/).filter(Boolean));"string"==typeof c.target&&"_blank"===c.target.trim().toLowerCase()&&(e.add("noopener"),e.add("noreferrer")),d.rel=Array.from(e).join(" ")}else d.type="button";d.setAttribute("aria-label",c.ariaLabel||c.label);const p=c.textColor||c.color||t.textColor||y(t.backgroundColor),f=c.backgroundColor||c.background||(t.backgroundColor?_(t.backgroundColor):"rgba(255,255,255,0.15)"),m="string"==typeof p&&/^#[0-9a-fA-F]{6}$/.test(p.trim())?`${p.trim()}44`:"rgba(128, 128, 128, 0.3)";d.className="toast-cta",l().disableInlineStyles||Object.assign(d.style,{marginLeft:0===a?"10px":"6px",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",border:`1px solid ${m}`,color:p,background:f,cursor:"pointer",whiteSpace:"nowrap",flexShrink:"0"}),d.textContent=c.label;const h=async t=>{try{if("function"==typeof c.onClick){const e=c.onClick(t);null!=e&&e.then&&await e}}catch(e){console.error("CTA onClick handler error:",e)}finally{!1!==c.autoClose&&"function"==typeof n&&n(e)}},g=e=>{!u||c.href||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),h(e))};d.addEventListener("click",h),u&&!c.href&&d.addEventListener("keydown",g);const b=()=>{d.removeEventListener("click",h),u&&!c.href&&d.removeEventListener("keydown",g)};d._cleanup=b,s.push(b);const v=e.querySelector(".toast-undo-btn")||e.querySelector(".toast-close-btn")||e.querySelector(".toast-progress-bar");v?e.insertBefore(d,v):e.appendChild(d)});const a=e._cleanupCTA;e._cleanupCTA=()=>{null==a||a(),s.forEach(e=>e())}}function k(e,t,n){const i=null==t?void 0:t.undo;if(!i)return;const r="function"==typeof i;if(!r&&("object"!=typeof i||Array.isArray(i)))return;const s=r?{onUndo:i}:o({},i),a="string"==typeof s.label&&s.label.trim()?s.label.trim():"Undo",c=Number(null==t?void 0:t.duration),u=!1!==s.showCountdown&&Number.isFinite(c)&&c>0,d=document.createElement("button");d.type="button",d.className="toast-undo-btn",d.setAttribute("aria-label",`${a} action`);const p=t.textColor||y(t.backgroundColor),f=t.backgroundColor?_(t.backgroundColor):"rgba(255,255,255,0.18)",m="string"==typeof p&&/^#[0-9a-fA-F]{6}$/.test(p.trim())?`${p.trim()}55`:"rgba(128, 128, 128, 0.35)";l().disableInlineStyles||Object.assign(d.style,{marginLeft:"10px",padding:"5px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"700",lineHeight:"1",border:`1px solid ${m}`,color:p,background:f,cursor:"pointer",whiteSpace:"nowrap",flexShrink:"0",display:"inline-flex",alignItems:"center",gap:"4px"});let h=Math.max(1,Math.ceil((c||2500)/1e3));const g=()=>{d.textContent=u?`${a} (${h}s)`:a};g();let b=null,v=!1;var w;u&&(b=setInterval(()=>{v||(h=Math.max(0,h-1),g(),h<=0&&b&&(clearInterval(b),b=null))},1e3),"function"==typeof(null===(w=b)||void 0===w?void 0:w.unref)&&b.unref()),e._pauseUndo=()=>{v=!0},e._resumeUndo=()=>{v=!1};const T=()=>{b&&(clearInterval(b),b=null),e._pauseUndo=null,e._resumeUndo=null},x=async t=>{T(),d.removeEventListener("click",x);try{if("function"==typeof s.onUndo){const n=s.onUndo(t,e);null!=n&&n.then&&await n}}catch(e){console.error("Undo action error:",e)}finally{"function"==typeof n&&n(e)}};d.addEventListener("click",x),d._cleanup=()=>{T(),d.removeEventListener("click",x)},e._cleanupUndo=()=>{T(),d.removeEventListener("click",x)};const A=e.querySelector(".toast-close-btn")||e.querySelector(".toast-progress-bar");A?e.insertBefore(d,A):e.appendChild(d)}function E(e,t,n){const o=document.createElement("button");o.type="button",o.setAttribute("aria-label","Close notification"),o.setAttribute("title","Close"),o.textContent="×";const i=t.textColor||y(t.backgroundColor);o.className="toast-close-btn",l().disableInlineStyles||Object.assign(o.style,{background:"none",border:"none",color:i,fontSize:"18px",marginLeft:"10px",cursor:"pointer",lineHeight:"1",padding:"0 4px"});const r=()=>{"function"==typeof n&&n(e)};o.addEventListener("click",r),e._cleanupCloseButton=()=>{o.removeEventListener("click",r)},e.appendChild(o)}function _(e){return e&&"#000000"===y(e)?"rgba(0,0,0,0.15)":"rgba(255,255,255,0.15)"}function L(e,t={}){var n;const o=document.createElement("div");o.className="toast-progress-bar",e._progressBar=o;const i=t.borderRadius||"0",r=parseInt(i,10),s=Number.isFinite(r)&&r>0?r:0;let a=4,u="4px";if("number"==typeof t.progressHeight&&Number.isFinite(t.progressHeight)&&t.progressHeight>0)a=t.progressHeight,u=`${a}px`;else if("string"==typeof t.progressHeight&&t.progressHeight.trim()){const e=t.progressHeight.trim(),n=parseFloat(e);Number.isFinite(n)&&n>0&&(e.endsWith("rem")||e.endsWith("em")?(a=16*n,u=e):(a=n,u=/^\d+(\.\d+)?$/.test(e)?`${n}px`:e))}const d=Number(null!==(n=t.duration)&&void 0!==n?n:2500),p=Math.max(0,d+5),f=Math.min(s,2*a),m=s>0?`calc(100% - ${2*f}px)`:"100%",h="reverse"===t.progressDirection||"increasing"===t.progressDirection||"ltr"===t.progressDirection;o._leftOffset=f,o._finalWidth=m,o._isReverse=h;const y=t.progressBarColor||t.progressColor||"currentColor";if(l().disableInlineStyles||Object.assign(o.style,{position:"absolute",left:`${f}px`,height:u,background:y,width:h?"0%":`${m}`,transition:`width ${p}ms linear`,["top"===t.progressPosition?"top":"bottom"]:"0",borderRadius:a/2+"px",opacity:"0.8",zIndex:"2",willChange:"width"}),e.appendChild(o),"indeterminate"===t.progress||Boolean(t.showProgressBar)&&(0===t.duration||t.duration===1/0)&&void 0===t.progress)return o.classList.add("toast-progress-bar-indeterminate"),l().disableInlineStyles||(function(){if("undefined"==typeof document||document.getElementById("toast-progress-indeterminate-styles"))return;const e=document.createElement("style");e.id="toast-progress-indeterminate-styles",e.textContent="\n @keyframes toast-progress-indeterminate {\n 0% { left: 0%; width: 0%; }\n 50% { left: 20%; width: 60%; }\n 100% { left: 100%; width: 0%; }\n }\n .toast-progress-bar-indeterminate {\n animation: toast-progress-indeterminate 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;\n }\n ";const t=document.head||document.documentElement;t&&t.appendChild(e)}(),o.style.animation="toast-progress-indeterminate 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite"),void(o.style.width=m);if(void 0!==t.progress){let e=Number(t.progress);return Number.isFinite(e)||(e=0),e<1&&e>0&&(e*=100),e=Math.min(100,Math.max(0,e)),o.style.width=`${e}%`,void(o.style.transition="width 200ms ease")}if(0!==t.duration&&t.duration!==1/0)if(c())o.style.display="none";else if("function"==typeof o.animate){const t=h?[{width:"0%"},{width:m}]:[{width:m},{width:"0%"}];e._progressAnimation=o.animate(t,{duration:p,easing:"linear",fill:"forwards",delay:50})}else o.style.transition=`width ${p}ms linear`,requestAnimationFrame(()=>{o.style.width=h?m:"0%"});else o.style.width="0%"}function M(e){if(!e)return;if(e._hasAnimated)return;if(c())return e._hasAnimated=!0,e.style.transition="none",e.style.opacity="1",e.style.transform="translateY(0)",void e.classList.add("active");const t=()=>{if(!e._hasAnimated){e._hasAnimated=!0;try{e.offsetHeight}catch(e){}requestAnimationFrame(()=>{e.style.opacity="1",e.style.transform="none",e.classList.add("active")})}};e.isConnected?t():requestAnimationFrame(()=>{e.isConnected?t():requestAnimationFrame(()=>{t()})})}let N=null,I=!0,z=!1;var B;if("undefined"!=typeof window)if("undefined"!=typeof navigator&&null!==(B=navigator.userActivation)&&void 0!==B&&B.hasBeenActive)z=!0;else{const e=()=>{if(z=!0,N&&"suspended"===N.state)try{N.resume().catch(()=>{})}catch(e){}try{window.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",e,!0),window.removeEventListener("touchstart",e,!0)}catch(e){}};try{window.addEventListener("pointerdown",e,{capture:!0,once:!0,passive:!0}),window.addEventListener("keydown",e,{capture:!0,once:!0,passive:!0}),window.addEventListener("touchstart",e,{capture:!0,once:!0,passive:!0})}catch(e){}}const P=new Map;function O(e=!0){if("undefined"==typeof window)return null;const t=window.AudioContext||window.webkitAudioContext;if(!t)return null;if(!N)try{N=new t}catch(e){return null}const n=z||"undefined"!=typeof navigator&&navigator.userActivation&&navigator.userActivation.hasBeenActive;if(N&&"suspended"===N.state&&(e||n))try{N.resume().catch(()=>{})}catch(e){}return N}let V=null;function q(){const e=O(!1);if(!e||"function"!=typeof e.createAnalyser)return null;if(!V)try{V=e.createAnalyser(),V.fftSize=128,V.connect(e.destination)}catch(e){return null}return V}function j(e,t){V?t.connect(V):t.connect(e.destination)}function D(e,t){e&&(e.onended=()=>{try{var n;e.disconnect(),null==t||null===(n=t.disconnect)||void 0===n||n.call(t)}catch(e){}})}const F={modern:function(e,t,n){if("success"===t)[523.25,659.25,783.99].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.setValueAtTime(t,n+.08*o),r.gain.setValueAtTime(.001,n+.08*o),r.gain.exponentialRampToValueAtTime(.12,n+.08*o+.02),r.gain.exponentialRampToValueAtTime(1e-4,n+.08*o+.35),i.connect(r),j(e,r),D(i,r),i.start(n+.08*o),i.stop(n+.08*o+.36)});else if("error"===t)[320,240].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="triangle",i.frequency.setValueAtTime(t,n+.1*o),r.gain.setValueAtTime(.001,n+.1*o),r.gain.exponentialRampToValueAtTime(.15,n+.1*o+.02),r.gain.exponentialRampToValueAtTime(1e-4,n+.1*o+.22),i.connect(r),j(e,r),D(i,r),i.start(n+.1*o),i.stop(n+.1*o+.23)});else if("warning"===t){const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(440,n),t.frequency.exponentialRampToValueAtTime(493.88,n+.12),o.gain.setValueAtTime(.001,n),o.gain.exponentialRampToValueAtTime(.12,n+.02),o.gain.exponentialRampToValueAtTime(1e-4,n+.28),t.connect(o),j(e,o),D(t,o),t.start(n),t.stop(n+.3)}else{const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(600,n),t.frequency.exponentialRampToValueAtTime(950,n+.04),t.frequency.exponentialRampToValueAtTime(400,n+.09),o.gain.setValueAtTime(.001,n),o.gain.exponentialRampToValueAtTime(.1,n+.015),o.gain.exponentialRampToValueAtTime(1e-4,n+.12),t.connect(o),j(e,o),D(t,o),t.start(n),t.stop(n+.13)}},retro:function(e,t,n){if("success"===t)[523.25,659.25,783.99,1046.5].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="square";const s=n+.045*o;i.frequency.setValueAtTime(t,s),r.gain.setValueAtTime(.001,s),r.gain.linearRampToValueAtTime(.08,s+.005),r.gain.exponentialRampToValueAtTime(1e-4,s+.042),i.connect(r),j(e,r),D(i,r),i.start(s),i.stop(s+.045)});else if("error"===t){const t=e.createOscillator(),o=e.createGain();t.type="square",t.frequency.setValueAtTime(360,n),t.frequency.exponentialRampToValueAtTime(90,n+.22),o.gain.setValueAtTime(.001,n),o.gain.linearRampToValueAtTime(.1,n+.01),o.gain.exponentialRampToValueAtTime(1e-4,n+.22),t.connect(o),j(e,o),D(t,o),t.start(n),t.stop(n+.23)}else"warning"===t?[0,.08].forEach(t=>{const o=e.createOscillator(),i=e.createGain();o.type="square";const r=n+t;o.frequency.setValueAtTime(880,r),i.gain.setValueAtTime(.001,r),i.gain.linearRampToValueAtTime(.07,r+.005),i.gain.exponentialRampToValueAtTime(1e-4,r+.05),o.connect(i),j(e,i),D(o,i),o.start(r),o.stop(r+.055)}):[987.77,1318.51].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="square";const s=n+.035*o;i.frequency.setValueAtTime(t,s),r.gain.setValueAtTime(.001,s),r.gain.linearRampToValueAtTime(.08,s+.005),r.gain.exponentialRampToValueAtTime(1e-4,s+.035),i.connect(r),j(e,r),D(i,r),i.start(s),i.stop(s+.04)})},futuristic:function(e,t,n){if("success"===t){const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(440,n),t.frequency.exponentialRampToValueAtTime(1760,n+.2),o.gain.setValueAtTime(.001,n),o.gain.exponentialRampToValueAtTime(.12,n+.03),o.gain.exponentialRampToValueAtTime(1e-4,n+.32),t.connect(o),j(e,o),D(t,o),t.start(n),t.stop(n+.33)}else if("error"===t){const t=e.createOscillator(),o=e.createGain();t.type="sawtooth",t.frequency.setValueAtTime(700,n),t.frequency.exponentialRampToValueAtTime(120,n+.24),o.gain.setValueAtTime(.001,n),o.gain.linearRampToValueAtTime(.09,n+.02),o.gain.exponentialRampToValueAtTime(1e-4,n+.25),t.connect(o),j(e,o),D(t,o),t.start(n),t.stop(n+.26)}else if("warning"===t)[580,870].forEach(t=>{const o=e.createOscillator(),i=e.createGain();o.type="sine",o.frequency.setValueAtTime(t,n),o.frequency.linearRampToValueAtTime(1.15*t,n+.1),o.frequency.linearRampToValueAtTime(t,n+.2),i.gain.setValueAtTime(.001,n),i.gain.exponentialRampToValueAtTime(.07,n+.02),i.gain.exponentialRampToValueAtTime(1e-4,n+.25),o.connect(i),j(e,i),D(o,i),o.start(n),o.stop(n+.26)});else{const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(1100,n),t.frequency.exponentialRampToValueAtTime(1600,n+.03),t.frequency.exponentialRampToValueAtTime(750,n+.09),o.gain.setValueAtTime(.001,n),o.gain.exponentialRampToValueAtTime(.09,n+.015),o.gain.exponentialRampToValueAtTime(1e-4,n+.12),t.connect(o),j(e,o),D(t,o),t.start(n),t.stop(n+.13)}},subtle:function(e,t,n){if("success"===t)[750,1100].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="sine";const s=n+.04*o;i.frequency.setValueAtTime(t,s),r.gain.setValueAtTime(.001,s),r.gain.linearRampToValueAtTime(.04,s+.003),r.gain.exponentialRampToValueAtTime(1e-4,s+.025),i.connect(r),j(e,r),D(i,r),i.start(s),i.stop(s+.03)});else if("error"===t)[180,130].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="triangle";const s=n+.05*o;i.frequency.setValueAtTime(t,s),r.gain.setValueAtTime(.001,s),r.gain.linearRampToValueAtTime(.05,s+.005),r.gain.exponentialRampToValueAtTime(1e-4,s+.035),i.connect(r),j(e,r),D(i,r),i.start(s),i.stop(s+.04)});else if("warning"===t){const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(600,n),o.gain.setValueAtTime(.001,n),o.gain.linearRampToValueAtTime(.045,n+.003),o.gain.exponentialRampToValueAtTime(1e-4,n+.025),t.connect(o),j(e,o),D(t,o),t.start(n),t.stop(n+.03)}else{const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(450,n),o.gain.setValueAtTime(.001,n),o.gain.linearRampToValueAtTime(.035,n+.003),o.gain.exponentialRampToValueAtTime(1e-4,n+.02),t.connect(o),j(e,o),D(t,o),t.start(n),t.stop(n+.025)}},bell:function(e,t,n){if("success"===t)[659.25,1318.5,2637].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.setValueAtTime(t,n);const s=.09/(o+1);r.gain.setValueAtTime(.001,n),r.gain.exponentialRampToValueAtTime(s,n+.015),r.gain.exponentialRampToValueAtTime(1e-4,n+.55),i.connect(r),j(e,r),D(i,r),i.start(n),i.stop(n+.58)});else if("error"===t)[220,440].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="triangle",i.frequency.setValueAtTime(t,n);const s=.1/(o+1);r.gain.setValueAtTime(.001,n),r.gain.exponentialRampToValueAtTime(s,n+.015),r.gain.exponentialRampToValueAtTime(1e-4,n+.38),i.connect(r),j(e,r),D(i,r),i.start(n),i.stop(n+.4)});else if("warning"===t){const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(880,n),o.gain.setValueAtTime(.001,n),o.gain.exponentialRampToValueAtTime(.1,n+.015),o.gain.exponentialRampToValueAtTime(1e-4,n+.45),t.connect(o),j(e,o),D(t,o),t.start(n),t.stop(n+.48)}else{const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(1320,n),o.gain.setValueAtTime(.001,n),o.gain.exponentialRampToValueAtTime(.08,n+.01),o.gain.exponentialRampToValueAtTime(1e-4,n+.28),t.connect(o),j(e,o),D(t,o),t.start(n),t.stop(n+.3)}}};let R=!1;function $(e="info",t){if(!I)return;if(!R&&"undefined"!=typeof window&&window.customizableToast&&"function"==typeof window.customizableToast.playTone&&window.customizableToast.playTone!==$)try{return R=!0,void window.customizableToast.playTone(e,t)}finally{R=!1}const n=O();if(n)try{"suspended"===n.state&&n.resume().catch(()=>{});const o=n.currentTime,i="number"==typeof e?e:parseFloat(e);if(Number.isFinite(i)&&i>=20&&i<=2e4&&("number"==typeof e||/^\d+(\.\d+)?(hz)?$/i.test(String(e).trim()))){const e=n.createOscillator(),t=n.createGain();return e.type="sine",e.frequency.setValueAtTime(i,o),t.gain.setValueAtTime(.001,o),t.gain.exponentialRampToValueAtTime(.1,o+.015),t.gain.exponentialRampToValueAtTime(1e-4,o+.35),e.connect(t),j(n,t),D(e,t),e.start(o),void e.stop(o+.36)}const r=String(e||"info").toLowerCase().trim(),s=String(t||l().soundPreset||"modern").toLowerCase().trim();if(P.has(s))try{const e=P.get(s);if("function"==typeof e)return void e(n,r,o)}catch(e){console.warn("Custom sound preset synthesizer error:",e)}(F[s]||F.modern)(n,r,o)}catch(e){}}function W(e,t){if("string"!=typeof e||!e.trim()||"function"!=typeof t)return!1;const n=e.toLowerCase().trim();return P.set(n,t),!0}function H(){const e=Object.keys(F),t=Array.from(P.keys());return Array.from(new Set([...e,...t]))}function U(){P.clear()}function G(e){I=Boolean(e)}function Y(){return I}function X(){if(N)try{var e,t,n,o;null===(e=(t=N).close)||void 0===e||null===(n=(o=e.call(t)).catch)||void 0===n||n.call(o,()=>{})}catch(e){}N=null,V=null}const Q={default:{stiffness:100,damping:10,mass:1,bezierFallback:"cubic-bezier(0.34, 1.4, 0.64, 1)"},gentle:{stiffness:120,damping:14,mass:1,bezierFallback:"cubic-bezier(0.25, 1, 0.5, 1)"},wobbly:{stiffness:180,damping:12,mass:1,bezierFallback:"cubic-bezier(0.35, 1.6, 0.55, 1)"},stiff:{stiffness:210,damping:20,mass:1,bezierFallback:"cubic-bezier(0.18, 0.9, 0.32, 1)"},bouncy:{stiffness:300,damping:15,mass:1.2,bezierFallback:"cubic-bezier(0.34, 1.75, 0.5, 1)"}},K=new Map;function J(e,t){if("string"!=typeof e||!e.trim())throw new TypeError("registerSpringPreset: name must be a non-empty string");if(!t||"object"!=typeof t||Array.isArray(t))throw new TypeError("registerSpringPreset: config must be an object");const n=Number(t.stiffness),o=Number(t.damping),i=Number(t.mass);K.set(e.trim().toLowerCase(),{stiffness:Number.isFinite(n)&&n>0?n:100,damping:Number.isFinite(o)&&o>0?o:10,mass:Number.isFinite(i)&&i>0?i:1,bezierFallback:"string"==typeof t.bezierFallback&&t.bezierFallback.trim()?t.bezierFallback.trim():"cubic-bezier(0.34, 1.4, 0.64, 1)"})}function Z(){return[...Object.keys(Q),...K.keys()]}function ee(){K.clear()}function te(e){if(!e)return null;if("string"==typeof e){const t=e.trim().toLowerCase();return K.has(t)?K.get(t):Object.prototype.hasOwnProperty.call(Q,t)?Q[t]:Q.default}if(!0===e)return Q.default;if("object"==typeof e&&!Array.isArray(e)){const t=Number(e.stiffness),n=Number(e.damping),o=Number(e.mass),i=Number.isFinite(t)&&t>0?t:100,r=Number.isFinite(n)&&n>0?n:10,s=Number.isFinite(o)&&o>0?o:1,a=r/(2*Math.sqrt(i*s));let l="string"==typeof e.bezierFallback&&e.bezierFallback.trim()?e.bezierFallback.trim():"cubic-bezier(0.25, 1, 0.5, 1)";return e.bezierFallback||(a<.6?l="cubic-bezier(0.34, 1.7, 0.55, 1)":a<.85&&(l="cubic-bezier(0.34, 1.35, 0.64, 1)")),{stiffness:i,damping:r,mass:s,bezierFallback:l}}return null}function ne(e,t){if(e<=0)return 0;const n=Math.max(.001,(null==t?void 0:t.stiffness)||100),o=Math.max(.001,(null==t?void 0:t.damping)||10),i=Math.max(.001,(null==t?void 0:t.mass)||1),r=Math.sqrt(n/i),s=o/(2*Math.sqrt(n*i));if(Math.abs(s-1)<1e-4)return 1-Math.exp(-r*e)*(1+r*e);if(s<1){const t=r*Math.sqrt(1-s*s);return 1-Math.exp(-s*r*e)*(Math.cos(t*e)+s/Math.sqrt(1-s*s)*Math.sin(t*e))}const a=r*Math.sqrt(s*s-1),l=-s*r+a,c=-s*r-a,u=-l/(c-l);return 1-(c/(c-l)*Math.exp(l*e)+u*Math.exp(c*e))}function oe(e,t=.005){if(!e)return 400;const n=Math.max(.001,e.stiffness||100),o=Math.max(.001,e.damping||10),i=Math.max(.001,e.mass||1);let r=3;for(let e=.1;e<=3;e+=.01){const s=ne(e,{stiffness:n,damping:o,mass:i});if(Math.abs(s-1)<=t){let s=!0;for(let r=e;r<=Math.min(3,e+.12);r+=.01)if(Math.abs(ne(r,{stiffness:n,damping:o,mass:i})-1)>t){s=!1;break}if(s){r=e;break}}}const s=Math.round(1e3*r);return Math.max(150,Math.min(2500,s))}function ie(e,t=32){const n=oe(e)/1e3,o=[];for(let i=0;i<=t;i++){const r=i/t,s=ne(r*n,e),a=Math.round(1e3*s)/1e3,l=Math.round(1e3*r)/10;o.push(`${a} ${l}%`)}return`linear(${o.join(", ")})`}function re(e){const t=te(e);if(!t)return null;const n=oe(t),o=ie(t),i=function(){if("undefined"==typeof window||"undefined"==typeof CSS||"function"!=typeof CSS.supports)return!1;try{return CSS.supports("transition-timing-function","linear(0 0%, 1 100%)")||CSS.supports("transition-timing-function","linear(0, 1)")||CSS.supports("animation-timing-function","linear(0 0%, 1 100%)")}catch(e){return!1}}()?o:t.bezierFallback||"cubic-bezier(0.34, 1.4, 0.64, 1)";return{config:{stiffness:t.stiffness,damping:t.damping,mass:t.mass},duration:n,easing:i,isSpring:!0}}const se=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","title","desc","defs","clippath","use"]),ae=new Set(["viewbox","width","height","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","opacity","fill-opacity","stroke-opacity","d","cx","cy","r","x","y","x1","y1","x2","y2","points","rx","ry","transform","role","aria-hidden","focusable","xmlns","preserveaspectratio","class","id","href","xlink:href"]);function le(e=""){return/^\s*javascript:/i.test(e)}function ce(e){const t="undefined"!=typeof DOMParser?DOMParser:"undefined"!=typeof window&&window.DOMParser?window.DOMParser:null;if(!t)return null;try{const n=(new t).parseFromString(e,"image/svg+xml");if(n.querySelector("parsererror"))return null;const o=n.documentElement;if(!o||"svg"!==o.tagName.toLowerCase())return null;const i=e=>{if(3===e.nodeType)return document.createTextNode(e.textContent||"");if(1!==e.nodeType)return null;const t=e.tagName.toLowerCase();if(!se.has(t))return null;const n=document.createElementNS("http://www.w3.org/2000/svg",t);if(e.attributes)for(let o=0;o<e.attributes.length;o++){const i=e.attributes[o],r=i.name,s=r.toLowerCase(),a=i.value||"";if(!s.startsWith("on")&&ae.has(s)){if("href"===s||"xlink:href"===s){if(le(a))continue;if("use"===t&&a&&!a.startsWith("#"))continue}n.setAttribute(r,a)}}if(e.childNodes)for(let t=0;t<e.childNodes.length;t++){const o=i(e.childNodes[t]);o&&n.appendChild(o)}return n};return i(o)}catch(e){return null}}const ue={success:'\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">\n <path d="M20 6L9 17l-5-5"/>\n </svg>\n ',error:'\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">\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>\n ',warning:'\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">\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>\n ',info:'\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">\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>\n '};function de(e={}){const t=e&&"object"==typeof e&&!Array.isArray(e)?e:{};let n=t.icon;if("function"==typeof n)try{n=n(t)}catch(e){console.warn("options.icon callback error:",e),n=null}if(!1===n||""===n||null===n)return null;if("undefined"==typeof document)return null;const o=t.type,i=l(),r=document.createElement("i");if(r.className="toast-icon",r.setAttribute("aria-hidden","true"),i.disableInlineStyles||Object.assign(r.style,{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:"0",marginRight:"8px",lineHeight:"1",fontStyle:"normal"}),n&&"object"==typeof n&&(1===n.nodeType||"undefined"!=typeof HTMLElement&&n instanceof HTMLElement)&&"function"==typeof n.cloneNode)return r.appendChild(n.cloneNode(!0)),r;if("string"==typeof n&&n.trim()){const e=n.trim(),t={check:ue.success,checkmark:ue.success,success:ue.success,cross:ue.error,error:ue.error,alert:ue.warning,warning:ue.warning,circle:ue.info,info:ue.info}[e.toLowerCase()];if(t){const e=ce(t.trim());return e&&r.appendChild(e),r}if(e.startsWith("<svg")&&e.endsWith("</svg>")){const t=ce(e);t?(t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t.getAttribute("width")||t.setAttribute("width","18"),t.getAttribute("height")||t.setAttribute("height","18"),r.appendChild(t)):r.textContent=e}else r.textContent=e;return r}const s="string"==typeof o?o.toLowerCase().trim():"";if((!0===n||void 0===n)&&s&&ue[s]){const e=ce(ue[s].trim());return e&&r.appendChild(e),r}return null}function pe(e,t,n){const o=String(e||"").toLowerCase(),i=o.includes("top"),r=o.includes("left"),s=o.includes("right"),a=String(t||"").toLowerCase().trim();return"fade"===a?"none":"zoom"===a||"scale"===a?"scale(0.75)":"flip"===a?"perspective(600px) rotateX(45deg)":"slide"===a?r?"translateX(-100%)":s?"translateX(100%)":i?"translateY(-100%)":"translateY(100%)":n?!o.includes("center")||i||o.includes("bottom")?i?"translateY(-36px) scale(0.92)":"translateY(36px) scale(0.92)":r?"translateX(-36px) scale(0.92)":s?"translateX(36px) scale(0.92)":"scale(0.85)":"bounce"===a?i?"translateY(-36px) scale(0.9)":"translateY(36px) scale(0.9)":i?"translateY(-20px)":"translateY(20px)"}async function fe(e={},t){try{var n;const o=l(),i=document.createElement("div"),r=(null==e?void 0:e.position)||o.defaultPosition,s=String(r).toLowerCase().trim();let a="auto",c="auto",u="auto",d="auto",p="none";s.startsWith("top")?a="20px":(s.startsWith("bottom")||s.includes("below"))&&(c="20px"),s.startsWith("left")?u="20px":s.startsWith("right")?d="20px":"center"===s?(u="50%",a="50%",p="translate(-50%, -50%)"):s.includes("center")?s.includes("left")?(u="20px",a="50%",p="translateY(-50%)"):s.includes("right")?(d="20px",a="50%",p="translateY(-50%)"):s.includes("top")?(a="20px",u="50%",p="translateX(-50%)"):s.includes("bottom")&&(c="20px",u="50%",p="translateX(-50%)"):(d="20px",c="20px"),i.className="toast-emergency",o.disableInlineStyles||Object.assign(i.style,{background:"#333",color:"white",padding:"10px 15px",position:"fixed",top:a,bottom:c,left:u,right:d,transform:p,zIndex:String(o.zIndex+100),borderRadius:"3px",maxWidth:"250px",wordWrap:"break-word",boxShadow:"0 2px 10px rgba(0,0,0,0.3)"});const f=document.createElement("div"),m=document.createElement("span");if(m.className="toast-emergency-message",o.disableInlineStyles||(m.style.display="inline-block"),e.allowHtml)try{const t=A(String(e.message||"Emergency Toast Showing!")),n=document.createElement("div");for(n.innerHTML=t;n.firstChild;)m.appendChild(n.firstChild)}catch(t){m.appendChild(document.createTextNode(String(e.message||"Emergency Toast Showing!")))}else m.textContent=String(e.message||"Emergency Toast Creation Showing!");f.appendChild(m);const h=document.createElement("button");for(h.type="button",h.className="toast-emergency-close",h.setAttribute("aria-label","Close emergency notification"),o.disableInlineStyles||Object.assign(h.style,{float:"right",marginLeft:"10px",fontWeight:"bold",cursor:"pointer",background:"transparent",border:"none",color:"inherit",padding:"0",font:"inherit"}),h.textContent="×",f.appendChild(h);i.firstChild;)i.removeChild(i.firstChild);i.appendChild(f);let y=null;const g=()=>{y&&clearTimeout(y),h.removeEventListener("click",g),i.remove(),"function"==typeof t&&t(i)};h.addEventListener("click",g);const b=Number(null==e?void 0:e.duration)||2500;return y=setTimeout(()=>{h.removeEventListener("click",g),i.remove(),"function"==typeof t&&t(i)},b),"function"==typeof(null===(n=y)||void 0===n?void 0:n.unref)&&y.unref(),i}catch(e){return console.error("Emergency toast creation failed:",e),"function"==typeof t&&t(null),null}}class me{constructor(e=5,t=50){this.initialSize=Math.max(1,Math.floor(e)),this.maxSize=Math.max(this.initialSize,Math.floor(t)),this.pool=[],this.inUseCount=0;for(let e=0;e<this.initialSize;e++)this.pool.push({element:this._createToastElement(),inUse:!1,id:null})}_createToastElement(){if("undefined"==typeof document)return{className:"toast",setAttribute(){},removeAttribute(){},appendChild(){},removeChild(){},style:{},childNodes:[]};const e=document.createElement("div");return e.className="toast",e.setAttribute("role","alert"),e.setAttribute("aria-live","polite"),e.tabIndex=0,e}acquire(e){if(!e||"string"!=typeof e)throw new Error("Toast ID required for pool allocation");let t=this.pool.find(e=>!e.inUse);!t&&this.pool.length<this.maxSize&&(t={element:this._createToastElement(),inUse:!1,id:null},this.pool.push(t));let n=!1;return t||(t=this.pool[0],n=!0,t.element._cleanupSwipe&&t.element._cleanupSwipe(),t.element._cleanupCloseButton&&t.element._cleanupCloseButton(),t.element._cleanupCTA&&t.element._cleanupCTA(),t.element._cleanupUndo&&t.element._cleanupUndo(),t.element._pauseCleanup&&t.element._pauseCleanup(),t.element._cleanup&&t.element._cleanup(),t.element.parentNode&&t.element.parentNode.removeChild(t.element),t.element=this._createToastElement()),t.element.innerHTML="",t.element.className="toast",t.element.removeAttribute("style"),t.element.setAttribute("role","alert"),t.element.id=`toast-${e}`,t.element._pooledId=e,delete t.element._progressAnimation,delete t.element._pauseCleanup,delete t.element._cleanupSwipe,delete t.element._cleanupCloseButton,delete t.element._cleanupCTA,delete t.element._cleanupUndo,delete t.element._key,delete t.element._cleanup,t.inUse=!0,t.id=e,n||(this.inUseCount+=1),t.element}release(e,t){if(!e&&!t)return;const n=e instanceof HTMLElement?e:null,o="string"==typeof t?t:"string"==typeof e?e:null,i=this.pool.find(e=>n&&e.element===n||o&&e.id===o);i&&i.inUse&&(i.element.parentNode&&i.element.parentNode.removeChild(i.element),i.element=this._createToastElement(),i.inUse=!1,i.id=null,this.inUseCount=Math.max(0,this.inUseCount-1))}getStats(){return{total:this.pool.length,inUse:this.inUseCount,available:this.pool.length-this.inUseCount,utilization:this.pool.length>0?this.inUseCount/this.pool.length*100:0,maxSize:this.maxSize}}clear(){this.pool.forEach(e=>{e.element.parentNode&&e.element.parentNode.removeChild(e.element)}),this.pool=[],this.inUseCount=0}compact(){if(this.pool.length>this.initialSize){const e=this.pool.filter(e=>!e.inUse),t=Math.max(0,e.length-this.initialSize);if(t>0)for(let n=0;n<t;n++){const t=this.pool.indexOf(e[n]);t>-1&&this.pool.splice(t,1)}}}}let he=null;function ye(e=5,t=50){return he||(he=new me(e,t)),he}function ge(){he&&(he.clear(),he=null)}async function be(e,t){let n;const o="toast";try{if(null!=e&&e.usePool){const e=f(o);n=ye().acquire(e),n._pooledId=e}else n=await async function(e,t){const n=document.createElement("div");return n.id=f(t),n}(0,o);return await async function(e,t,n){var o,i,r;const s=l(),a=null!=t&&t.spring?re(t.spring):null,u=a?a.duration:await async function(e){if("number"==typeof e&&Number.isFinite(e)&&e>=0)return e;if("string"==typeof e){const t=e.trim().toLowerCase();if(t.endsWith("s")&&!t.endsWith("ms")){const e=1e3*parseFloat(t);return Number.isFinite(e)&&e>=0?e:500}const n=parseFloat(t);return Number.isFinite(n)&&n>=0?n:500}return 500}(null==t?void 0:t.animationDuration),d=`${u}ms`,p=a?a.easing:"string"==typeof(null==t?void 0:t.animationEasing)&&t.animationEasing.trim()?t.animationEasing.trim():"ease";a&&(e._spring=a),e._animationType=null==t?void 0:t.animationType;const f="string"==typeof(null==t?void 0:t.className)&&t.className.trim()?` ${t.className.trim()}`:"";e.className=`toast toast-${null!==(o=null==t?void 0:t.type)&&void 0!==o?o:"info"}${f}`;const m="number"==typeof(null==t?void 0:t.borderRadius)?`${t.borderRadius}px`:null==t?void 0:t.borderRadius,h="number"==typeof(null==t?void 0:t.maxWidth)?`${t.maxWidth}px`:null==t?void 0:t.maxWidth,y=a?`${Math.min(300,u)}ms`:d,g=a?"ease":p;s.disableInlineStyles||Object.assign(e.style,{background:null==t?void 0:t.backgroundColor,padding:"12px 16px",marginBottom:"10px",borderRadius:m,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"space-between",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",minWidth:"250px",maxWidth:h,opacity:"0",position:"relative",cursor:"default",boxSizing:"border-box",userSelect:"text",pointerEvents:"auto",transition:`opacity ${y} ${g}, transform ${d} ${p}`,transform:pe(null==t?void 0:t.position,null==t?void 0:t.animationType,!!a),zIndex:String(s.zIndex),direction:null!=t&&t.fontDirection&&"auto"!==t.fontDirection?t.fontDirection:void 0});const b="error"===(null==t?void 0:t.type),v=(null==t?void 0:t.role)||(b?"alert":null!==(i=null==t?void 0:t.role)&&void 0!==i?i:"alert"),w=(null==t?void 0:t.ariaLive)||(b?"assertive":"polite");e.setAttribute("role",v),e.setAttribute("aria-live",w),e.tabIndex=0,e._animationDuration=u;const T=document.createElement("span");T.className="toast-message",e._messageSpan=T,"truncate"!==(null==t?void 0:t.wrapText)&&"ellipsis"!==(null==t?void 0:t.wrapText)&&!1!==(null==t?void 0:t.wrapText)&&null!=t&&t.wrapText?s.disableInlineStyles||Object.assign(T.style,{display:"block",whiteSpace:"normal"}):(T.classList.add("is-truncated"),s.disableInlineStyles||Object.assign(T.style,{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",whiteSpace:"normal",overflow:"hidden",textOverflow:"ellipsis"}));const x="number"==typeof(null==t?void 0:t.fontSize)?`${t.fontSize}px`:null==t?void 0:t.fontSize;s.disableInlineStyles||Object.assign(T.style,{flex:"1",padding:null==t?void 0:t.fontPadding,fontFamily:null==t?void 0:t.fontFamily,fontSize:x,fontWeight:null==t?void 0:t.fontWeight,lineHeight:null==t?void 0:t.fontLineHeight,color:null==t?void 0:t.textColor,userSelect:"text",wordBreak:"break-word",overflow:"hidden",textOverflow:"ellipsis",direction:null!=t&&t.fontDirection&&"auto"!==t.fontDirection?t.fontDirection:void 0});const _=!!t.allowHtml,N=null!==(r=t.message)&&void 0!==r?r:"",I=de(t);if(I&&e.appendChild(I),t.loader||t.showLoader){const e=C(t.loader||{});T.appendChild(e);const n=document.createElement("span");n.className="toast-message-spacer",s.disableInlineStyles||(n.style.display="inline-block",n.style.width="8px"),T.appendChild(n)}if(_&&"string"==typeof N&&N.trim().length>0)try{const e=A(N),t=document.createElement("div");for(t.innerHTML=e;t.firstChild;)T.appendChild(t.firstChild)}catch(e){console.warn("HTML message sanitization failed, falling back to text:",e),T.appendChild(document.createTextNode(String(N)))}else T.appendChild(document.createTextNode(String(N)));T.setAttribute("title",T.textContent||""),e.appendChild(T),null!=t&&t.cta&&"object"==typeof t.cta&&S(e,t,n),null!=t&&t.undo&&k(e,t,n),null!=t&&t.showCloseButton&&E(e,t,n),!1!==(null==t?void 0:t.showProgressBar)&&(null!=t&&t.showProgressBar||void 0!==(null==t?void 0:t.progress))&&L(e,t),!1!==(void 0!==(null==t?void 0:t.swipeToDismiss)?t.swipeToDismiss:s.swipeToDismiss)&&function(e,t){if(!e||"function"!=typeof e.addEventListener)return;let n=0,o=0,i=0,r=0,s=!1,a=!1,u=null,d=!1;const p=()=>{d&&(d=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",h))},f=t=>{if(!t)return;const l=t.target;if(l&&"function"==typeof l.closest&&l.closest("button, a, input, textarea, select, label"))return;let c=t;var p;t.touches&&t.touches.length>0?(c=t.touches[0],u=null!==(p=c.identifier)&&void 0!==p?p:null):u=null,n=c.clientX,o=c.clientY,i=n,r=Date.now(),s=!0,a=!1,e._originalTransition=e.style.transition||"",e.style.transition="none",e.style.userSelect="none",d||"undefined"==typeof window||(d=!0,window.addEventListener("mousemove",m,{passive:!1}),window.addEventListener("mouseup",h,{passive:!0}))},m=t=>{if(!s||!t)return;let r=t;if(t.touches)if(null!==u){for(let e=0;e<t.touches.length;e++)if(t.touches[e].identifier===u){r=t.touches[e];break}}else t.touches.length>0&&(r=t.touches[0]);const d=r.clientX,f=r.clientY,m=d-n,h=f-o;if(!a)if(Math.abs(m)>8&&Math.abs(m)>Math.abs(h))a=!0;else if(Math.abs(h)>8)return s=!1,e.style.userSelect="",void p();if(a){i=d;const n=Math.max(0,1-Math.abs(m)/280);l().disableInlineStyles||c()||(e.style.transform=`translateX(${m}px)`,e.style.opacity=String(n)),t.cancelable&&t.preventDefault()}},h=()=>{if(p(),u=null,!s||!a)return s=!1,void(e.style.userSelect="");s=!1,e.style.userSelect="";const o=i-n,d=Math.max(1,Date.now()-r),f=(d>0?Math.abs(o)/d:0)>=.65&&Math.abs(o)>=50,m=f?50:75;if(Math.abs(o)>=m){var h;const n=o>0?320:-320,i=f?120:180;l().disableInlineStyles||c()||(e.style.transition=`transform ${i}ms ease-out, opacity ${i}ms ease-out`,e.style.transform=`translateX(${n}px)`,e.style.opacity="0"),e._swipeTimeout&&clearTimeout(e._swipeTimeout),e._swipeTimeout=setTimeout(()=>{e._swipeTimeout=null,"function"==typeof t&&t(e)},i),"function"==typeof(null===(h=e._swipeTimeout)||void 0===h?void 0:h.unref)&&e._swipeTimeout.unref()}else if(!l().disableInlineStyles&&!c()){var y;const t=e._spring,n=(null==t?void 0:t.easing)||"cubic-bezier(0.34, 1.56, 0.64, 1)",o=null!=t&&t.duration?Math.min(400,t.duration):200;e.style.transition=`transform ${o}ms ${n}, opacity 200ms ease`,e.style.transform="translateX(0)",e.style.opacity="1",e._snapbackTimer&&clearTimeout(e._snapbackTimer),e._snapbackTimer=setTimeout(()=>{e._snapbackTimer=null,e._originalTransition&&(e.style.transition=e._originalTransition)},o),"function"==typeof(null===(y=e._snapbackTimer)||void 0===y?void 0:y.unref)&&e._snapbackTimer.unref()}};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchmove",m,{passive:!1}),e.addEventListener("touchend",h,{passive:!0}),e.addEventListener("touchcancel",h,{passive:!0}),e.addEventListener("mousedown",f,{passive:!0}),e._cleanupSwipe=()=>{e._swipeTimeout&&(clearTimeout(e._swipeTimeout),e._swipeTimeout=null),e._snapbackTimer&&(clearTimeout(e._snapbackTimer),e._snapbackTimer=null),p(),e.removeEventListener("touchstart",f),e.removeEventListener("touchmove",m),e.removeEventListener("touchend",h),e.removeEventListener("touchcancel",h),e.removeEventListener("mousedown",f)}}(e,n),(void 0!==(null==t?void 0:t.sound)?t.sound:s.sound)&&$("string"==typeof t.sound?t.sound:(null==t?void 0:t.type)||"info",(null==t?void 0:t.soundPreset)||s.soundPreset||"modern"),M(e)}(n,e,t),n}catch(o){var i;if(null!=e&&e.usePool&&null!==(i=n)&&void 0!==i&&i._pooledId)try{ye().release(n,n._pooledId)}catch(e){}return console.warn("toast creation failed with error showing fallback one: ",o),n=await fe(e,t),n}}const ve=new Map,we=new Map;function Te(e){if(!e||"string"!=typeof e)return"bottom-right";const t=e.toLowerCase().trim();return t?t.replace(/\bbelow\b/g,"bottom").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-"):"bottom-right"}function xe(e){return`toast-container-${Te(e)}`}function Ae(e){const t=l();e.className="toast-container-base",t.disableInlineStyles||(e.style.position="fixed",e.style.zIndex=String(t.zIndex),e.style.pointerEvents="none",e.style.inset="auto 10px 10px auto",e.style.display="flex",e.style.justifyContent="space-between",e.style.alignItems="center",e.style.flexDirection="column",e.style.overflow="hidden")}async function Ce(e={},t){const n=l(),o=xe((null==e?void 0:e.position)||n.defaultPosition),i=(s=r.targetNode)&&"object"==typeof s&&"function"==typeof s.appendChild?r.targetNode:"undefined"!=typeof document?document.body:null;var s;if(!i)throw new Error("Toast container root is unavailable");if(we.has(o))return we.get(o);const a=(async()=>{const n=ve.get(o);if(function(e,t){return!(!e||!t)&&(t===document.body?e.isConnected&&e.ownerDocument===document:"function"==typeof t.contains?t.contains(e):e.isConnected&&e.ownerDocument===document)}(n,i))return n;n&&ve.delete(o);let r=function(e,t){return e?"function"==typeof e.getElementById?e.getElementById(t):"function"==typeof e.querySelector?e.querySelector(`#${t}`):null:null}(i,o);if(r)Ae(r),"function"==typeof t&&await t(r,e);else{const n=(null==i?void 0:i.ownerDocument)||("undefined"!=typeof document?document:null);if(!n)throw new Error("Document is unavailable");r=n.createElement("div"),r.id=o,r.setAttribute("role","status"),r.setAttribute("aria-atomic","true"),Ae(r),"function"==typeof t&&await t(r,e),i.appendChild(r)}if("function"==typeof i.querySelectorAll){const e=i.querySelectorAll(`#${o}`);if(e.length>1)for(let t=1;t<e.length;t++)try{e[t].remove()}catch(e){}}return ve.set(o,r),r})();we.set(o,a);try{return await a}finally{we.delete(o)}}const Se=new Set(["top-left","top-right","bottom-left","bottom-right","top-center","bottom-center","center-top","center-bottom","left-center","right-center","center-left","center-right","top-full-width","bottom-full-width","center"]),ke=new Set(["top","bottom"]),Ee=[...Se,...ke];async function _e(e,t={}){var n;if(!e||!t||"object"!=typeof t)throw new Error("Invalid container or position!");const o=l(),i=String((null==t?void 0:t.position)||o.defaultPosition||"bottom-right").toLowerCase().trim().replace(/\s+/g,"-");let r=i;var s;if(s=i,Se.has(s)||ke.has(i)||(console.warn(`Unknown position "${t.position}", defaulting to "bottom-right"`),r="bottom-right"),function(e){if(null!=e&&e.classList)for(let t=0;t<Ee.length;t++)e.classList.remove("toast-position-"+Ee[t])}(e),null===(n=e.classList)||void 0===n||n.add("toast-position-"+r),l().disableInlineStyles)return;!function(e){e.style.top="auto",e.style.bottom="auto",e.style.left="auto",e.style.right="auto",e.style.transform="none",e.style.maxWidth="none"}(e);const a=function(e){const t=e.toLowerCase().trim(),n="top-full-width"===t||"bottom-full-width"===t;return{hasTop:t.startsWith("top")||t.endsWith("top"),hasBottom:t.startsWith("bottom")||t.endsWith("bottom")||t.includes("below"),hasLeft:t.startsWith("left")||t.endsWith("left"),hasRight:t.startsWith("right")||t.endsWith("right"),hasCenter:t.includes("center"),hasFullWidth:n}}(r);(function(e,t){return!!t.hasFullWidth&&(e.style.maxWidth="100vw",t.hasTop?(e.style.top="10px",e.style.left="10px",e.style.right="10px",!0):!!t.hasBottom&&(e.style.bottom="10px",e.style.left="10px",e.style.right="10px",!0))})(e,a)||function(e,t){return!!t.hasCenter&&(!t.hasTop||t.hasLeft||t.hasRight?!t.hasBottom||t.hasLeft||t.hasRight?!t.hasLeft||t.hasTop||t.hasBottom?!t.hasRight||t.hasTop||t.hasBottom?!(t.hasLeft||t.hasRight||t.hasTop||t.hasBottom)&&(e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)",!0):(e.style.right="10px",e.style.top="50%",e.style.transform="translateY(-50%)",!0):(e.style.left="10px",e.style.top="50%",e.style.transform="translateY(-50%)",!0):(e.style.bottom="10px",e.style.left="50%",e.style.transform="translateX(-50%)",!0):(e.style.top="10px",e.style.left="50%",e.style.transform="translateX(-50%)",!0))}(e,a)||function(e,t){t.hasBottom?e.style.bottom="10px":t.hasTop?e.style.top="10px":e.style.bottom="10px",t.hasRight?e.style.right="10px":t.hasLeft?e.style.left="10px":(e.style.left="50%",e.style.transform="translateX(-50%)")}(e,a)}class Le{constructor(e,t){this.callback="function"==typeof e?e:()=>{};const n=t===1/0,o=Number.isFinite(t)&&t>=0?t:n?1/0:0;this.delay=o,this.remaining=o,this.startTime=null,this.timeoutId=null,this.isPaused=!1,this.isCompleted=!1,this.isInfinite=n}start(){var e;return this.isCompleted||this.timeoutId||this.isInfinite||(this.isPaused=!1,this.startTime=Date.now(),this.timeoutId=setTimeout(()=>{this.isCompleted=!0,this.timeoutId=null;try{this.callback()}catch(e){console.error("PausableTimer callback error:",e)}},this.remaining),"function"==typeof(null===(e=this.timeoutId)||void 0===e?void 0:e.unref)&&this.timeoutId.unref()),this}pause(){if(this.isPaused||!this.timeoutId||this.isCompleted)return this;clearTimeout(this.timeoutId),this.timeoutId=null;const e=Math.max(0,Date.now()-this.startTime);return this.remaining=Math.min(this.delay,Math.max(0,this.remaining-e)),this.isPaused=!0,this}resume(){return!this.isPaused||this.isCompleted||(this.isPaused=!1,this.start()),this}clear(){return this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.isCompleted=!0,this}getRemainingTime(){return this.isCompleted?0:this.isPaused?this.remaining:this.timeoutId?Math.max(0,this.remaining-(Date.now()-this.startTime)):this.delay}}class Me{constructor(){this.channel=null,this.tabId=this._generateTabId(),this.isLeadTab=!1,this.leaderTimer=null,this.listeners=new Map,this.supportsBroadcastChannel="undefined"!=typeof BroadcastChannel,this.supportsBroadcastChannel&&this._initBroadcastChannel()}_generateTabId(){const e=Date.now().toString(36);let t="";if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues)try{const e=new Uint32Array(2);crypto.getRandomValues(e),t=`${e[0].toString(36)}${e[1].toString(36)}`.slice(0,9)}catch(e){}return t||(t=Math.floor(9007199254740991*Math.random()).toString(36).slice(0,9)),`tab-${e}-${t}`}_initBroadcastChannel(){try{var e,t;this.channel=new BroadcastChannel("toast-notifications"),null===(e=(t=this.channel).unref)||void 0===e||e.call(t),this.channel.onmessage=e=>this._handleMessage(e.data),this._becomeLeadIfNeeded()}catch(e){console.warn("[Toast] BroadcastChannel initialization failed:",e),this.supportsBroadcastChannel=!1}}_becomeLeadIfNeeded(){var e,t;this.channel&&(this.broadcast("sync-request","",{}),this.leaderTimer=setTimeout(()=>{this.leaderTimer=null,this.isLeadTab||(this.isLeadTab=!0,this.broadcast("leader-elected","",{tabId:this.tabId}))},1e3),null===(e=(t=this.leaderTimer).unref)||void 0===e||e.call(t))}broadcast(e,t="",n={}){if(!this.supportsBroadcastChannel||!this.channel)return;let o=t,i=n;"object"==typeof t&&null!==t&&0===Object.keys(n).length&&(i=t,o="");const r={type:e,toastId:"string"==typeof o?o:String(null!=o?o:""),payload:i&&"object"==typeof i?i:{},timestamp:Date.now(),tabId:this.tabId};try{this.channel.postMessage(r)}catch(e){console.warn("[Toast] Failed to broadcast message:",e)}}_handleMessage(e){if(!e||e.tabId===this.tabId)return;const{type:t,toastId:n,payload:o}=e;if("leader-elected"===t)return this.leaderTimer&&(clearTimeout(this.leaderTimer),this.leaderTimer=null),void(this.isLeadTab=!1);var i,r;"sync-response"===t&&this.leaderTimer&&(clearTimeout(this.leaderTimer),this.leaderTimer=null),"sync-request"===t&&this.isLeadTab?this.broadcast("sync-response","all-toasts",{active:Array.from((null===(i=this._getActiveToasts)||void 0===i?void 0:i.call(this))||[]),queue:(null===(r=this._getQueuedToasts)||void 0===r?void 0:r.call(this))||[]}):(this.listeners.get(t)||[]).forEach(i=>{try{i({toastId:n,payload:o,message:e})}catch(e){console.warn(`[Toast] Listener error for ${t}:`,e)}})}on(e,t){if("function"!=typeof t)throw new Error("Callback must be a function");return this.listeners.has(e)||this.listeners.set(e,[]),this.listeners.get(e).push(t),()=>{const n=this.listeners.get(e)||[],o=n.indexOf(t);o>-1&&n.splice(o,1)}}registerActiveToastsGetter(e){this._getActiveToasts=e}registerQueuedToastsGetter(e){this._getQueuedToasts=e}isSupported(){return this.supportsBroadcastChannel}getTabId(){return this.tabId}isLeadingTab(){return this.isLeadTab}destroy(){if(this.leaderTimer&&(clearTimeout(this.leaderTimer),this.leaderTimer=null),this.channel)try{this.channel.close()}catch(e){console.warn("[Toast] Failed to close BroadcastChannel:",e)}this.listeners.clear(),this.channel=null}}let Ne=null;function Ie(){if(!Ne&&(Ne=new Me,"undefined"!=typeof window)){const e=()=>{var e;null===(e=Ne)||void 0===e||e.destroy(),Ne=null};window.addEventListener("pagehide",e),window.addEventListener("beforeunload",e)}return Ne}function ze(){Ne&&(Ne.destroy(),Ne=null)}const Be={error:85,warning:70,info:40,success:30},Pe=["error","critical","severe","emergency","failure","fatal","crash","urgent","important","attention","immediate","now","fast","deadline","due","timeout","expired","overdue","security","breach","attack","unauthorized","hack","lost","missing","offline","down","unavailable","outage","downtime","broken","malfunction","defect","bug","data loss","corruption","invalid","wrong","incorrect","blocked","stopped","halted","paused","interrupted","exceeded","limit","quota","full","capacity","cannot","unable","failed","rejected","denied","blocked","invalid","expired","credentials","password","auth","payment","billing","charge","transaction","money","account","profile","settings","preferences"],Oe=["success","completed","finished","done","ready","info","information","note","notice","reminder","progress","processing","loading","saving","uploading","test","demo","sample","example","placeholder","updated","changed","modified","edited","created","connected","disconnected","online","offline"];function Ve(e){if(!e||"object"!=typeof e)return{score:50,breakdown:{base:50},keywords:[]};const{type:t,message:n,duration:o}=e,i={},r=[];let s=50;const a=Be[t]||50;i.type=a,s+=.6*(a-50);const l="string"==typeof n?n:String(null!=n?n:""),c=l.toLowerCase();let u=0;for(const e of Pe){const t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");new RegExp(`\\b${t}\\b`,"i").test(l)&&(r.push(e),u+=2)}for(const e of Oe){const t=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");new RegExp(`\\b${t}\\b`,"i").test(l)&&(r.push(e),u-=1)}if(i.urgency=Math.min(Math.max(u,-10),20),s+=i.urgency,o===1/0||0===o)i.duration=30,s+=15;else if("number"==typeof o&&Number.isFinite(o)&&o>0){const e=Math.max(0,30-o/1e3);i.duration=Math.round(e),s+=.5*e}const d=c.length;if(d>0){const e=Math.min(10,Math.floor(d/50));i.length=-e,s-=e}const p=(l.match(/!/g)||[]).length,f=Math.min(5,p);i.emphasis=f,s+=f;const m=(l.match(/\b[A-Z]{3,}\b/g)||[]).length,h=Math.min(5,m);return i.caps=h,s+=h,s=Math.max(0,Math.min(100,Math.round(s))),{score:s,breakdown:i,keywords:[...new Set(r)]}}function qe(e){if(!e||"string"!=typeof e)return["unknown"];const t=e.toLowerCase(),n=[];return/\b(security|auth|password|unauthorized|breach|hack)\b/i.test(t)&&n.push("security"),/\b(performance|slow|timeout|load|latency|responsive)\b/i.test(t)&&n.push("performance"),/\b(user|profile|account|preferences|settings|avatar)\b/i.test(t)&&n.push("user"),/\b(system|server|database|network|connection|backend)\b/i.test(t)&&n.push("system"),/\b(payment|transaction|billing|charge|order|cart)\b/i.test(t)&&n.push("business"),/\b(ui|interface|click|scroll|mobile)\b/i.test(t)&&n.push("ui"),0===n.length&&n.push("general"),n}function je(e,t){if(!e||!t||"number"!=typeof e.x||"number"!=typeof t.x||"number"!=typeof e.y||"number"!=typeof t.y)return 0;const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)}function De(e,t){const n=Number(e),o=Number(t);return!Number.isFinite(n)||!Number.isFinite(o)||o<0?0:0===o?0===n?0:1/0:Math.abs(n)/o}function Fe(e,t,n=.5,o=50){const i=Number(e),r=Number(t);return!(!Number.isFinite(i)||!Number.isFinite(r))&&i>=n&&Math.abs(r)>=o}function Re(e){const t=[];if(e.touches&&e.touches.length>0)for(let n=0;n<e.touches.length;n++){const o=e.touches[n];t.push({x:o.clientX,y:o.clientY,id:o.identifier,time:Date.now()})}else if(e.changedTouches&&e.changedTouches.length>0)for(let n=0;n<e.changedTouches.length;n++){const o=e.changedTouches[n];t.push({x:o.clientX,y:o.clientY,id:o.identifier,time:Date.now()})}return t}function $e(e,t=20){if(0===e.startDistance||0===e.currentDistance)return{isPinch:!1,scale:1,direction:"none"};const n=e.currentDistance-e.startDistance;return{isPinch:Math.abs(n)>=t,scale:e.currentDistance/e.startDistance,direction:n>0?"out":"in",distanceChange:n}}function We(e,t={}){const{onFlick:n,onPinch:i,onSwipe:r,flickVelocityThreshold:s=.5,swipeVelocityThreshold:a=.3,swipeDistanceThreshold:l=50,pinchSensitivity:c=20}=t;let u=null,d=!1;const p=e=>{d=!0,u=function(e){const t=Re(e);return{touches:t,startTouches:t.map(e=>o({},e)),startTime:Date.now(),startDistance:t.length>=2?je(t[0],t[1]):0,currentDistance:t.length>=2?je(t[0],t[1]):0}}(e)},f=e=>{d&&u&&(u=function(e,t){const n=Re(t);return o(o({},e),{},{touches:n,currentDistance:n.length>=2?je(n[0],n[1]):e.currentDistance})}(u,e))},m=e=>{if(!d||!u)return;d=!1;const t=$e(u,c);t.isPinch&&"function"==typeof i&&i(t);const o=function(e){if(0===e.startTouches.length||0===e.touches.length)return{distance:0,velocity:0,direction:"none",duration:0};const t=e.startTouches[0],n=(e.touches.find(e=>e.id===t.id)||e.touches[0]).x-t.x,o=Date.now()-e.startTime;return{distance:n,velocity:De(n,o),direction:n>0?"right":"left",duration:o}}(u);Fe(o.velocity,o.distance,s,30)&&"function"==typeof n&&n(o);const p=function(e,t=.3,n=50){return e.velocity>=t||Math.abs(e.distance)>=n}(o,a,l);p&&"function"==typeof r&&r(o),u=null};return{attach(){e&&"function"==typeof e.addEventListener&&(e.addEventListener("touchstart",p,{passive:!0}),e.addEventListener("touchmove",f,{passive:!0}),e.addEventListener("touchend",m,{passive:!0}),e.addEventListener("touchcancel",m,{passive:!0}))},detach(){e&&"function"==typeof e.removeEventListener&&(e.removeEventListener("touchstart",p),e.removeEventListener("touchmove",f),e.removeEventListener("touchend",m),e.removeEventListener("touchcancel",m))},getState:()=>u}}const He=new Map,Ue=new Map,Ge=[];let Ye=0,Xe=0;function Qe(){return{activeCount:He.size,queueDepth:Ge.length,visibleCount:Ye,droppedCount:Xe,timestamp:Date.now()}}function Ke(){const e=l();if("function"==typeof e.onMetrics)try{e.onMetrics(Qe())}catch(e){console.error("onMetrics callback error:",e)}}const Je=Ie();function Ze(e){var t,n;if("number"==typeof(null==e||null===(t=e.options)||void 0===t?void 0:t.priority)&&Number.isFinite(e.options.priority))return e.options.priority;const o=null==e||null===(n=e.priority)||void 0===n?void 0:n.score;if("number"==typeof o&&Number.isFinite(o))return o;const i=l();if("function"==typeof i.priorityScorer)try{var r,s,a;const t=i.priorityScorer({type:(null==e||null===(r=e.options)||void 0===r?void 0:r.type)||"info",message:(null==e||null===(s=e.options)||void 0===s?void 0:s.message)||"",duration:null==e||null===(a=e.options)||void 0===a?void 0:a.duration,options:null==e?void 0:e.options});if("number"==typeof t&&Number.isFinite(t))return t;if(t&&"number"==typeof t.score&&Number.isFinite(t.score))return t.score}catch(e){console.warn("[Toast] Custom priorityScorer error, falling back to built-in:",e)}return Ve(null==e?void 0:e.options).score}function et(e){if(!e||!e.children)return;if("true"!==e.getAttribute("data-stacked"))return;if(!e._stackedInitialized&&"function"==typeof e.addEventListener){e._stackedInitialized=!0;const t=()=>{e._isExpanded=!0,et(e)},n=()=>{e._isExpanded=!1,et(e)},o=()=>{e._isExpanded=!0,et(e)},i=t=>{e.contains(t.relatedTarget)||(e._isExpanded=!1,et(e))};e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),e.addEventListener("focusin",o),e.addEventListener("focusout",i);let r=null;r=We(e,{onPinch:t=>{"out"!==t.direction||e._isExpanded?"in"===t.direction&&e._isExpanded&&(e._isExpanded=!1,et(e)):(e._isExpanded=!0,et(e))}}),r.attach(),e._stackedCleanup=()=>{var s,a;e.removeEventListener("mouseenter",t),e.removeEventListener("mouseleave",n),e.removeEventListener("focusin",o),e.removeEventListener("focusout",i),null===(s=r)||void 0===s||null===(a=s.detach)||void 0===a||a.call(s),e._stackedInitialized=!1}}if(!e.children||0===e.children.length)return;const t=Array.from(e.children),n=t.length,o=Boolean(e._isExpanded),i=Boolean(e.id&&e.id.includes("top"));t.forEach((e,t)=>{const r=n-1-t,s=o?"expanded":r>=3?"overflow":String(r);if("function"==typeof e.setAttribute&&e.setAttribute("data-stacked-depth",s),!l().disableInlineStyles)if(e.style.transition="transform 240ms cubic-bezier(0.16, 1, 0.3, 1), margin 240ms cubic-bezier(0.16, 1, 0.3, 1), opacity 240ms ease",o)e.style.transform="none",e.style.marginTop="0px",e.style.marginBottom="10px",e.style.opacity="1",e.style.zIndex=String(100+t),e.style.pointerEvents="auto";else if(0===r)e.style.transform="scale(1)",e.style.marginTop="0px",e.style.marginBottom="0px",e.style.opacity="1",e.style.zIndex="30",e.style.pointerEvents="auto";else if(1===r){const t=i?10:-10;e.style.transform=`scale(0.95) translateY(${t}px)`,e.style.marginTop="-55px",e.style.marginBottom="0px",e.style.opacity="0.9",e.style.zIndex="20",e.style.pointerEvents="auto"}else if(2===r){const t=i?20:-20;e.style.transform=`scale(0.90) translateY(${t}px)`,e.style.marginTop="-55px",e.style.marginBottom="0px",e.style.opacity="0.75",e.style.zIndex="10",e.style.pointerEvents="auto"}else{const t=i?30:-30;e.style.transform=`scale(0.85) translateY(${t}px)`,e.style.marginTop="-55px",e.style.marginBottom="0px",e.style.opacity="0",e.style.zIndex="1",e.style.pointerEvents="none"}})}async function tt(e={}){try{const n=function(e={}){const t=e&&"object"==typeof e?e:{};return t.id?String(t.id):`${String(t.type||"info").trim().toLowerCase()}|${function(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n);return t>>>0}(String(t.message||"")).toString(16)}|${Te(t.position||"bottom-right")}`}(e);if(He.has(n)){var t;const o=He.get(n);if(!o)throw new Error(`Active toast with key ${n} not found`);return o.count++,null===(t=o.timer)||void 0===t||t.clear(),o.timer=it(o.toast,e),await rt(o),await ut(o),Ke(),!e.fromSync&&l().syncTabs&&Je.isSupported()&&Je.broadcast("update",n,{count:o.count}),n}if(Ue.has(n)){const e=Ue.get(n);if(!e)throw new Error(`Pending toast with key ${n} not found`);return e.count++,n}const o={options:e,count:1,rafId:0};return Ue.set(n,o),o.rafId=requestAnimationFrame(async()=>{const e=Ue.get(n);if(e){if(Ue.delete(n),Ye>=l().maxVisible){var t,o,i;const r={options:e.options,key:n,count:e.count},s=null!==(t=l().maxQueueSize)&&void 0!==t?t:100;if(s<=0)return Xe++,void Ke();const a=l().aiPrioritization||(null===(o=e.options)||void 0===o?void 0:o.aiPrioritization)||"number"==typeof(null===(i=e.options)||void 0===i?void 0:i.priority)||Ge.some(e=>{var t,n;return(null==e||null===(t=e.options)||void 0===t?void 0:t.aiPrioritization)||"number"==typeof(null==e||null===(n=e.options)||void 0===n?void 0:n.priority)});if(a&&(r.priority=Ve(e.options)),Ge.length>=s){if(a){const e=Ze(r);let t=0,n=Ze(Ge[0]);for(let e=1;e<Ge.length;e++){const o=Ze(Ge[e]);o<n&&(t=e,n=o)}if(e<=n)return Xe++,void Ke();Ge.splice(t,1)}else Ge.shift();Xe++}return Ge.push(r),a&&Ge.sort((e,t)=>Ze(t)-Ze(e)),Ke(),void await ct()}try{await nt(e.options,n,e.count)}catch(e){console.error("showToast failed:",e)}}}),!e.fromSync&&l().syncTabs&&Je.isSupported()&&Je.broadcast("create",n,{options:e}),n}catch(e){console.error("showToast failed:",e)}}async function nt(e,t,n){try{if(!e||"object"!=typeof e)throw new TypeError("options must be an object");Ye++;const o=await Ce(e,_e);if(!o)throw new Error("Failed to create toast container");const i=await be(e,st);if(!i)throw new Error("Toast element creation failed");const r=document.createElement("div");r.className="toast-outer-wrapper",l().disableInlineStyles||Object.assign(r.style,{position:"relative",display:"inline-block",overflow:"visible",marginBottom:"10px",zIndex:"0",width:"100%",pointerEvents:"auto"});const s=document.createElement("div");s.className="toast-inner-wrapper",l().disableInlineStyles||Object.assign(s.style,{position:"relative",overflow:"hidden",zIndex:"1"}),s.appendChild(i),r.appendChild(s),o.id.includes("toast-container-")&&(o.appendChild(r),e.stacked&&o.setAttribute("data-stacked","true"),"true"===o.getAttribute("data-stacked")&&et(o)),M(i);const a=!1!==e.pauseOnHover&&(!0===e.pauseOnHover||!!e.cta||Boolean(l().pauseOnHover)),c={outer:r,toast:i,options:e,count:Math.max(1,Math.floor(null!=n?n:0)),pauseOnHover:a};He.set(t,c),i._key=t,Ke(),c.count>1&&await ut(c),c.timer=it(i,e),await rt(c)}catch(t){console.error("Something went wrong: ",t),Ye=Math.max(0,Ye-1),Ke(),(document.querySelector('[id^="toast-container-"]')||document.body).appendChild(await fe(e,st))}}Je.registerActiveToastsGetter(()=>Array.from(He.keys())),Je.registerQueuedToastsGetter(()=>Ge.map(e=>({key:e.key,options:e.options,count:e.count}))),Je.isSupported()&&"undefined"!=typeof window&&(Je.on("create",({toastId:e,payload:t})=>{l().syncTabs&&e&&t&&!He.has(e)&&!Ue.has(e)&&tt(o(o({},t.options),{},{fromSync:!0}))}),Je.on("update",({toastId:e,payload:t})=>{if(l().syncTabs&&e&&t&&He.has(e)){const n=He.get(e);n&&n.count!==t.count&&(n.count=t.count,ut(n))}}),Je.on("dismiss",({toastId:e})=>{l().syncTabs&&e&&(He.has(e)||Ue.has(e))&&at(e,!0)}),Je.on("sync-response",({payload:e})=>{if(l().syncTabs&&e&&Array.isArray(e.queue))for(const t of e.queue)null==t||!t.options||He.has(t.key)||Ue.has(t.key)||tt(o(o({},t.options),{},{fromSync:!0}))}));const ot=async function(){try{if(0===He.size){if(Ue.size>0){const[e,t]=Array.from(Ue.entries()).at(-1);return null!=t&&t.rafId&&cancelAnimationFrame(t.rafId),Ue.delete(e),void Ke()}return Ge.length>0?(Ge.pop(),void Ke()):void 0}let e=null;const t=Array.from(He.values());if(t.length>0){const n=t.at(-1);e=n.toast||n.outer&&n.outer.querySelector('[id^="toast-"]')}if(e||document.querySelectorAll('[id^="toast-container-"]').forEach(t=>{const n=Array.from(t.children||[]);if(0===n.length)return;const o=n.at(-1);o&&(e=o.querySelector('[id^="toast-"]')||o)}),!e)return;const n=e._key?e:e.querySelector('[id^="toast-"]')||e;await st(n)}catch(e){console.error("dismissMostRecent failed:",e)}};function it(e,t){const n=Number(null==t?void 0:t.duration);if((null==t?void 0:t.duration)===1/0||"number"==typeof(null==t?void 0:t.duration)&&(null==t?void 0:t.duration)<=0)return null;const o=Number.isFinite(n)&&n>0?n:2500,i=new Le(async()=>await st(e),o+5);return i.start(),i}async function rt(e){var t,n;if(!e.pauseOnHover||!e.outer||!e.timer)return;null===(t=(n=e.outer)._pauseCleanup)||void 0===t||t.call(n);const{outer:o,timer:i,toast:r}=e,s=()=>{if(null!=r&&r._progressAnimation)try{r._progressAnimation.pause()}catch(e){}else if(null!=r&&r._progressBar)try{const e=window.getComputedStyle(r._progressBar).width;r._progressBar._pausedWidth=e,r._progressBar.style.transition="none",r._progressBar.style.width=e}catch(e){}},a=()=>{if(null!=r&&r._progressAnimation)try{r._progressAnimation.play()}catch(e){}else if(null!=r&&r._progressBar&&r._progressBar._pausedWidth)try{var e,t;const n=null!==(e=null===(t=i.getRemainingTime)||void 0===t?void 0:t.call(i))&&void 0!==e?e:1e3,o=r._progressBar._isReverse,s=r._progressBar._finalWidth||"100%";r._progressBar.style.transition=`width ${Math.max(0,n)}ms linear`,r._progressBar.style.width=o?s:"0%",r._progressBar._pausedWidth=null}catch(e){}},l=()=>{var e;i.pause(),s(),null==r||null===(e=r._pauseUndo)||void 0===e||e.call(r),null==r||r.classList.add("toast-paused")},c=()=>{var e;i.resume(),a(),null==r||null===(e=r._resumeUndo)||void 0===e||e.call(r),null==r||r.classList.remove("toast-paused")},u=e=>{var t;e.target.matches("[tabindex], div, span, button, a")&&(i.pause(),s(),null==r||null===(t=r._pauseUndo)||void 0===t||t.call(r),null==r||r.classList.add("toast-paused"))},d=e=>{var t;o.contains(e.relatedTarget)||(i.resume(),a(),null==r||null===(t=r._resumeUndo)||void 0===t||t.call(r),null==r||r.classList.remove("toast-paused"))};o.addEventListener("mouseenter",l),o.addEventListener("mouseleave",c),o.addEventListener("focusin",u),o.addEventListener("focusout",d),o._pauseCleanup=()=>{o.removeEventListener("mouseenter",l),o.removeEventListener("mouseleave",c),o.removeEventListener("focusin",u),o.removeEventListener("focusout",d)}}async function st(e){if(null!=e&&e._key)return at(e._key)}async function at(e,t=!1){try{var n,o,i,r,s,a,u,d,p,f,m,h,y,g,b,v,w,T,x,A,C;if(!e)return;!t&&l().syncTabs&&Je.isSupported()&&Je.broadcast("dismiss",e,{});const M=Ue.get(e);if(M)return cancelAnimationFrame(M.rafId),Ue.delete(e),void Ke();const N=Ge.findIndex(t=>t.key===e);if(-1!==N)return Ge.splice(N,1),void Ke();const I=He.get(e);if(!I)return;if(null===(n=I.timer)||void 0===n||n.clear(),null===(o=I.outer)||void 0===o||null===(i=o._pauseCleanup)||void 0===i||i.call(o),null===(r=I.toast)||void 0===r||null===(s=r._cleanupCloseButton)||void 0===s||s.call(r),null===(a=I.toast)||void 0===a||null===(u=a._cleanupCTA)||void 0===u||u.call(a),null===(d=I.toast)||void 0===d||null===(p=d._cleanupUndo)||void 0===p||p.call(d),null===(f=I.toast)||void 0===f||null===(m=f._cleanupSwipe)||void 0===m||m.call(f),null===(h=I.toast)||void 0===h||null===(y=h._cleanup)||void 0===y||y.call(h),null!==(g=I.toast)&&void 0!==g&&g._progressAnimation){try{I.toast._progressAnimation.cancel()}catch(e){}I.toast._progressAnimation=null}const z=null===(b=I.outer)||void 0===b?void 0:b.querySelector(".toast-count-badge");null!=z&&z._scaleTimer&&(clearTimeout(z._scaleTimer),z._scaleTimer=null);const B=null===(v=I.toast)||void 0===v?void 0:v.querySelector("button, a");null==B||null===(w=B._cleanup)||void 0===w||w.call(B),He.delete(e),Ye=Math.max(0,Ye-1),Ke(),z&&z.remove();const P=null!==(T=null===(x=I.toast)||void 0===x?void 0:x._animationDuration)&&void 0!==T?T:400,O=Math.min(P,300);if(I.toast){if(!l().disableInlineStyles){var S,k,E,_;const e=String((null===(S=I.options)||void 0===S?void 0:S.position)||(null===(k=I.outer)||void 0===k||null===(k=k.parentElement)||void 0===k?void 0:k.id)||"").toLowerCase(),t=e.includes("top"),n=e.includes("left"),o=e.includes("right"),i=String((null===(E=I.options)||void 0===E?void 0:E.animationType)||"").toLowerCase().trim();let r="translateY(20px)";const s=null===(_=I.toast)||void 0===_?void 0:_._spring;c()?(I.toast.style.transition="none",I.toast.style.opacity="0"):("fade"===i?r="none":"zoom"===i||"scale"===i?r="scale(0.75)":"flip"===i?r="perspective(600px) rotateX(-45deg)":"slide"===i?r=n?"translateX(-100%)":o?"translateX(100%)":t?"translateY(-100%)":"translateY(100%)":"bounce"===i?r=t?"translateY(-36px) scale(0.9)":"translateY(36px) scale(0.9)":s&&(r=t?"translateY(-28px) scale(0.94)":"translateY(28px) scale(0.94)"),I.toast.style.transition=`opacity ${O}ms ease-in, transform ${O}ms ease-in`,I.toast.style.opacity="0",I.toast.style.transform=r)}I.toast.classList.remove("active")}const V=null===(A=I.outer)||void 0===A?void 0:A.parentElement;if(await async function(e,t,n=400){return e?new Promise(o=>{var i;let r=!1,s=null;const a=t||e.firstElementChild||e,l=()=>{var t;if(r)return;r=!0,s&&(clearTimeout(s),s=null);try{var n;null==a||null===(n=a.removeEventListener)||void 0===n||n.call(a,"transitionend",c,!0)}catch(e){}const i=(null===(t=e.querySelector)||void 0===t?void 0:t.call(e,".toast"))||e;if(null!=i&&i._pooledId)try{ye().release(i,i._pooledId)}catch(e){}!async function(e){if(!e)return!0;try{if("function"==typeof e.remove)return e.remove(),!0}catch(e){}try{if(e.parentNode)return e.parentNode.removeChild(e),!0}catch(e){}}(e),o()},c=e=>{try{if(e.target!==a)return;("transform"===e.propertyName||!a.style.transform&&"opacity"===e.propertyName)&&l()}catch(e){console.error("removeWithTransition error:",e)}};if(!a)return l();try{a.addEventListener("transitionend",c,!0)}catch(e){console.error("removeWithTransition error:",e)}s=setTimeout(l,n+100),"function"==typeof(null===(i=s)||void 0===i?void 0:i.unref)&&s.unref()}):Promise.resolve()}(I.outer,I.toast,O),V&&0===V.children.length&&null!==(C=V.id)&&void 0!==C&&C.startsWith("toast-container-"))try{var L;null===(L=V._stackedCleanup)||void 0===L||L.call(V),function(e){if(!e)return;const t="string"==typeof e&&e.startsWith("toast-container-")?e:xe(e);ve.delete(t),we.delete(t)}(V.id),V.remove()}catch(e){}else V&&"true"===V.getAttribute("data-stacked")&&et(V);await ct()}catch(e){console.error("Closing Toast failed!: ",e)}}let lt=!1;async function ct(){if(!lt){lt=!0;try{const e=l();for((e.aiPrioritization||Ge.some(e=>{var t,n;return(null===(t=e.options)||void 0===t?void 0:t.aiPrioritization)||"number"==typeof(null===(n=e.options)||void 0===n?void 0:n.priority)}))&&Ge.length>1&&Ge.sort((e,t)=>Ze(t)-Ze(e));Ye<e.maxVisible&&Ge.length;){const e=Ge.shift();if(He.has(e.key)){const t=He.get(e.key);t.count+=e.count,await ut(t),Ke();continue}await nt(e.options,e.key,e.count)}Ke()}finally{lt=!1}}}async function ut({outer:e,count:t}){if(!(e&&e instanceof HTMLElement))throw new Error("updateBadge: outer must be a valid HTMLElement");if(t<2){const t=e.querySelector(".toast-count-badge");return void(t&&t.remove())}let n=e.querySelector(".toast-count-badge");n||(n=document.createElement("span"),n.className="toast-count-badge",n.setAttribute("aria-label",`${t} identical notifications`),l().disableInlineStyles||Object.assign(n.style,{position:"absolute",top:"6px",right:"6px",backgroundColor:"#f44336",color:"#fff",borderRadius:"50%",minWidth:"20px",height:"20px",fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center",border:"2px solid #fff",boxShadow:"0 2px 6px rgba(0,0,0,0.3)",zIndex:"2",pointerEvents:"none",transition:"transform 150ms ease"}),e.appendChild(n)),n.textContent=t>99?"99+":String(t);try{var o;c()||(n._scaleTimer&&clearTimeout(n._scaleTimer),n.style.transform="scale(1.2)",n._scaleTimer=setTimeout(()=>{n.style.transform="scale(1)",n._scaleTimer=null},150),"function"==typeof(null===(o=n._scaleTimer)||void 0===o?void 0:o.unref)&&n._scaleTimer.unref())}catch(e){console.error("updateBadge animation error:",e)}}async function dt(e,t={}){if(!e||"object"!=typeof t||null===t)return;if(Ue.has(e)){const n=Ue.get(e);return void(n.options=o(o({},n.options),t))}const n=Ge.find(t=>t.key===e);if(n)return void(n.options=o(o({},n.options),t));const i=He.get(e);if(!i||!i.toast)return;const r=o({},i.options);i.options=o(o({},i.options),t);const s=i.toast,a=s._messageSpan||s.querySelector(".toast-message")||s.querySelector("span:not(.toast-count-badge)");if(void 0!==t.message){var c;const e=String(null!==(c=t.message)&&void 0!==c?c:""),n=void 0!==t.allowHtml?Boolean(t.allowHtml):Boolean(i.options.allowHtml),o=("success"===t.type||"error"===t.type)&&!0!==t.showLoader;if(a){const i=a.querySelector(".toast-loader");if(a.innerHTML="",i&&!1!==t.showLoader&&null!==t.loader&&!o){a.appendChild(i);const e=document.createElement("span");e.style.display="inline-block",e.style.width="8px",a.appendChild(e)}if(n&&e.trim().length>0)try{const t=A(e),n=document.createElement("div");for(n.innerHTML=t;n.firstChild;)a.appendChild(n.firstChild)}catch(t){a.appendChild(document.createTextNode(e))}else a.appendChild(document.createTextNode(e));a.setAttribute("title",a.textContent||"")}}const u=("success"===t.type||"error"===t.type)&&!0!==t.showLoader;if(!1===t.showLoader||null===t.loader||u){const e=null==a?void 0:a.querySelector(".toast-loader");e&&(e.nextSibling&&"SPAN"===e.nextSibling.nodeName&&e.nextSibling.remove(),e.remove())}else if((!0===t.showLoader||t.loader&&"object"==typeof t.loader)&&a&&!a.querySelector(".toast-loader")){const e=C(t.loader||{});a.insertBefore(e,a.firstChild);const n=document.createElement("span");n.style.display="inline-block",n.style.width="8px",a.insertBefore(n,e.nextSibling)}if(t.type){const e=String(t.type).toLowerCase().trim();s.className=s.className.replace(/\btoast-(info|success|error|warning)\b/g,`toast-${e}`);const n="error"===e;if(t.role?s.setAttribute("role",t.role):s.setAttribute("role","alert"),s.setAttribute("aria-live",t.ariaLive||(n?"assertive":"polite")),!t.backgroundColor){const t={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"};t[e]&&(s.style.background=t[e])}}if(void 0!==t.icon||void 0!==t.type){const e=null==s?void 0:s.querySelector(".toast-icon");e&&e.remove();const n=de(o(o({},i.options),t));n&&(a?s.insertBefore(n,a):s.appendChild(n))}if(t.backgroundColor&&(s.style.background=t.backgroundColor),t.textColor)s.style.color=t.textColor,a&&(a.style.color=t.textColor);else if(t.type||t.backgroundColor){const e=s.style.background;if(e){const t=y(e);s.style.color=t,a&&(a.style.color=t)}}if(void 0!==t.borderRadius){const e="number"==typeof t.borderRadius?`${t.borderRadius}px`:t.borderRadius;s.style.borderRadius=e}if(void 0!==t.maxWidth){const e="number"==typeof t.maxWidth?`${t.maxWidth}px`:t.maxWidth;s.style.maxWidth=e}if(void 0!==t.fontDirection){const e="auto"!==t.fontDirection?t.fontDirection:"";s.style.direction=e,a&&(a.style.direction=e)}if(void 0!==t.fontSize){const e="number"==typeof t.fontSize?`${t.fontSize}px`:t.fontSize;s.style.fontSize=e,a&&(a.style.fontSize=e)}if(void 0!==t.fontFamily&&(s.style.fontFamily=t.fontFamily,a&&(a.style.fontFamily=t.fontFamily)),void 0!==t.fontWeight){const e="number"==typeof t.fontWeight?String(t.fontWeight):t.fontWeight;s.style.fontWeight=e,a&&(a.style.fontWeight=e)}if(void 0!==t.fontLineHeight&&(s.style.lineHeight=t.fontLineHeight,a&&(a.style.lineHeight=t.fontLineHeight)),void 0!==t.role&&s.setAttribute("role",t.role),void 0!==t.ariaLive&&s.setAttribute("aria-live",t.ariaLive),void 0!==t.className){const e=r.className;e&&"string"==typeof e&&s.classList.remove(...e.trim().split(/\s+/)),t.className&&"string"==typeof t.className&&s.classList.add(...t.className.trim().split(/\s+/))}if(void 0!==t.progress){let e=Number(t.progress);Number.isFinite(e)||(e=0),e<1&&e>0&&(e*=100),e=Math.min(100,Math.max(0,e));let n=s.querySelector(".toast-progress-bar");if(n||!t.showProgressBar&&!i.options.showProgressBar||(L(s,o(o({},i.options),t)),n=s.querySelector(".toast-progress-bar")),n){if(s._progressAnimation){try{s._progressAnimation.cancel()}catch(e){}s._progressAnimation=null}n.style.transition="width 200ms ease",n.style.width=`${e}%`}}else if(!1===t.showProgressBar){const e=s.querySelector(".toast-progress-bar");e&&e.remove()}if(t.progressBarColor||t.progressColor){const e=s.querySelector(".toast-progress-bar");e&&(e.style.background=t.progressBarColor||t.progressColor)}if(t.progressPosition){const e=s.querySelector(".toast-progress-bar");e&&(e.style.top="top"===t.progressPosition?"0":"auto",e.style.bottom="bottom"===t.progressPosition?"0":"auto")}if(void 0!==t.progressHeight){const e=s.querySelector(".toast-progress-bar");if(e){const n="number"==typeof t.progressHeight?`${t.progressHeight}px`:t.progressHeight;e.style.height=n}}if(void 0!==t.animationType&&(i.options.animationType=t.animationType,s._animationType=t.animationType),void 0!==t.duration){var d;null===(d=i.timer)||void 0===d||d.clear();const e=Number(t.duration);Number.isFinite(e)&&e>0?(i.timer=it(s,{duration:e}),await rt(i)):i.timer=null}else if(!(0!==i.options.duration&&i.timer||"success"!==t.type&&"error"!==t.type&&"warning"!==t.type&&!1!==t.showLoader)){var p;null===(p=i.timer)||void 0===p||p.clear(),i.timer=it(s,{duration:2500}),await rt(i)}if(void 0!==t.cta&&(s._cleanupCTA&&(s._cleanupCTA(),s._cleanupCTA=null),s.querySelectorAll(".toast-cta").forEach(e=>e.remove()),t.cta&&"object"==typeof t.cta)&&S(s,o(o({},i.options),t),st),void 0!==t.undo&&(s._cleanupUndo&&(s._cleanupUndo(),s._cleanupUndo=null),s.querySelectorAll(".toast-undo-btn").forEach(e=>e.remove()),t.undo)&&k(s,o(o({},i.options),t),st),void 0!==t.showCloseButton){const e=s.querySelector(".toast-close-btn");!1===t.showCloseButton?(s._cleanupCloseButton&&(s._cleanupCloseButton(),s._cleanupCloseButton=null),e&&e.remove()):!0!==t.showCloseButton||e||E(s,i.options,st)}(void 0!==t.sound?Boolean(t.sound):Boolean(t.type&&(i.options.sound||l().sound)))&&$("string"==typeof t.sound?t.sound:t.type||i.options.type||"info",t.soundPreset||i.options.soundPreset||l().soundPreset||"modern");const f=s.closest('[id^="toast-container-"]');f&&"true"===f.getAttribute("data-stacked")&&et(f)}let pt={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"},ft={success:"Operation completed successfully!",error:"Something went wrong!",warning:"Warning message!",info:"Information message!"},mt=!1,ht=null;function yt(e,t){const n="object"!=typeof t||null===t||Array.isArray(t)?{}:t;return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e?o(o({},n),{},{message:String(e)}):e instanceof Error?o(o({},n),{},{message:e.message||String(e)}):"object"!=typeof e||null===e||Array.isArray(e)?o({},n):o(o({},n),e)}function gt(e){try{if(e&&"object"==typeof e&&!Array.isArray(e)){const t=["success","error","warning","info"],n={};for(const[o,i]of Object.entries(e))t.includes(o)&&"string"==typeof i&&i.trim()&&(n[o]=i.trim());Object.keys(n).length>0&&(pt=o(o({},pt),n))}}catch(e){console.error("setDefaultColors failed:",e)}}function bt(e){try{if(e&&"object"==typeof e&&!Array.isArray(e)){const t=["success","error","warning","info"],n={};for(const[o,i]of Object.entries(e))t.includes(o)&&"string"==typeof i&&i.trim()&&(n[o]=i.trim());Object.keys(n).length>0&&(ft=o(o({},ft),n))}}catch(e){console.error("setDefaultMessages failed:",e)}}let vt=!1,wt=null;const Tt=async function(e={}){return"undefined"!=typeof window&&"undefined"!=typeof document?(await async function(){mt||"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?(ht||(ht=new Promise(e=>{document.addEventListener("DOMContentLoaded",()=>{mt=!0,e()},{once:!0})})),await ht):mt=!0)}(),await async function(e={}){try{const t=await async function(e){var t,n;const i=yt(e),r=l(),s=String(null!==(t=null==i?void 0:i.position)&&void 0!==t?t:r.defaultPosition).toLowerCase().trim(),a=null!=s&&s.includes("top-full-width")||null!=s&&s.includes("bottom-full-width")?"100vw":"400px",c=o(o({},{allowHtml:!1,sanitizeHtml:!0,pauseOnHover:void 0,duration:2500,position:r.defaultPosition,type:"info",borderRadius:"50px",backgroundColor:void 0,textColor:void 0,showCloseButton:!0,animationDuration:"0.4s",animationEasing:"ease",showProgressBar:!0,progressColor:void 0,progressBarColor:void 0,progressHeight:"4px",progressPosition:"bottom",progressDirection:"decreasing",animationType:"default",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"14px",fontWeight:"400",fontLineHeight:"1.4",fontDirection:"auto",wrapText:"normal",maxWidth:a}),i);c.message=null!==(n=null==i?void 0:i.message)&&void 0!==n?n:c.message;try{var u,d;c.backgroundColor||(c.backgroundColor=null!==(u=null===(d=pt)||void 0===d?void 0:d[c.type])&&void 0!==u?u:window.matchMedia("(prefers-color-scheme: dark)").matches?"#f5f5f5":"#111111")}catch(e){console.warn("Background color resolution failed:",e)}try{var p;c.message=c.message||(null===(p=ft)||void 0===p?void 0:p[c.type])||"No Message Provided!"}catch(e){console.warn("Default message resolution failed:",e)}try{!c.textColor&&c.backgroundColor&&(c.textColor=y(c.backgroundColor))}catch(e){console.warn("Text color resolution failed:",e)}try{const e=(null==i?void 0:i.progressBarColor)||(null==i?void 0:i.progressColor);e?(c.progressColor=e,c.progressBarColor=e):!c.progressColor&&c.backgroundColor&&(c.progressColor=c.textColor||y(c.backgroundColor),c.progressBarColor=c.progressColor)}catch(e){console.warn("Progress bar color resolution failed:",e)}return"string"!=typeof c.message&&(c.message="No Message Provided!"),c}(e);return await async function(e){try{return await Ce(e,_e)}catch(e){return console.error("Failed to create toast container:",e),l().targetNode||document.body}}(t),await tt(t)}catch(e){return console.error("CreateToast failed:",e),null}}(e)):(console.warn("ToastNotification: running in non-browser environment, no DOM available."),null)};async function xt(e={},t){const n=yt(e,t),o=await async function(){if(vt&&wt)try{await wt}catch(e){console.warn("Previous close operation failed (continuing anyway):",e)}return Tt(n)}();return{id:o,dismiss:()=>o?at(o):Promise.resolve(),update:e=>o?dt(o,e):Promise.resolve()}}xt.success=(e,t)=>xt(o(o({},yt(e,t)),{},{type:"success"})),xt.error=(e,t)=>xt(o(o({},yt(e,t)),{},{type:"error"})),xt.warning=(e,t)=>xt(o(o({},yt(e,t)),{},{type:"warning"})),xt.info=(e,t)=>xt(o(o({},yt(e,t)),{},{type:"info"})),xt.loading=(e,t)=>xt(o({type:"info",showLoader:!0,duration:0,showProgressBar:!1,pauseOnHover:!1},yt(e,t))),xt.custom=(e,t)=>xt(o({allowHtml:!0},yt(e,t)));const At=xt.success,Ct=xt.error,St=xt.warning,kt=xt.info,Et=xt.loading,_t=xt.custom,Lt=async e=>{let t=e;if(e&&"function"==typeof e.then)try{t=await e}catch(e){return}vt=!0,wt=(async()=>{try{"string"==typeof t&&t.length>0?await at(t):t&&"object"==typeof t?"function"==typeof t.dismiss?await t.dismiss():t._key&&"string"==typeof t._key?await at(t._key):t.id&&"string"==typeof t.id?await at(t.id):await ot():await ot()}finally{vt=!1,wt=null}})(),await wt},Mt=async()=>{vt=!0,wt=(async()=>{try{await async function(){try{for(const[,e]of Ue)null!=e&&e.rafId&&cancelAnimationFrame(e.rafId);Ue.clear(),Ge.length=0,Ke();const e=Array.from(He.values()).map(e=>e.toast).filter(Boolean);await Promise.allSettled(e.map(async e=>{try{await st(e)}catch(e){console.warn("closeAllToasts: failed to close one toast:",e)}}))}catch(e){console.error("closeAllToasts failed:",e)}}()}finally{vt=!1,wt=null}})(),await wt},Nt=Mt,It=Mt,zt=864e5;async function Bt(e,t={},n={}){var i,r;const s=t&&"object"==typeof t?t:{},a=n&&"object"==typeof n?n:{},l=null!==(i=s.loading)&&void 0!==i?i:"Loading...",c="object"!=typeof l||null===l||Array.isArray(l)?o(o({},a),{},{type:"info",message:String(l),duration:zt,showProgressBar:!1,pauseOnHover:!1,showLoader:null===(r=a.showLoader)||void 0===r||r}):o(o({},a),{},{type:"info",duration:zt,showProgressBar:!1,pauseOnHover:!1,showLoader:!0},l),u=await xt(c),d=o(o({},a),{},{pauseOnHover:a.pauseOnHover});try{var p;const t="function"==typeof e?e():e,n=await t;if(u&&"function"==typeof u.dismiss)try{await u.dismiss()}catch(e){}const i="function"==typeof s.success?s.success(n):null!==(p=s.success)&&void 0!==p?p:"Done!",r="object"!=typeof i||null===i||Array.isArray(i)?o(o({},d),{},{type:"success",message:String(i)}):o(o({},d),{},{type:"success"},i);return await xt(r),n}catch(e){var f;if(u&&"function"==typeof u.dismiss)try{await u.dismiss()}catch(e){}const t="function"==typeof s.error?s.error(e):null!==(f=s.error)&&void 0!==f?f:"Something went wrong.",n="object"!=typeof t||null===t||Array.isArray(t)?o(o({},d),{},{type:"error",message:String(t)}):o(o({},d),{},{type:"error"},t);throw await xt(n),e}}xt.promise=Bt,xt.dismiss=Lt,xt.dismissAll=Mt,xt.clear=Mt;const Pt="3.18.2";if("undefined"!=typeof window&&"undefined"!=typeof document&&!window.__customizableToastEscapeAttached){window.__customizableToastEscapeAttached=!0;const e=e=>{if("Escape"===e.key||"Esc"===e.key)(async()=>{try{vt=!0,wt=(async()=>{try{await ot()}finally{vt=!1,wt=null}})(),await wt}catch(e){console.error("Escape key dismiss failed:",e),vt=!1,wt=null}})();else if("F6"===e.key||(e.altKey||e.metaKey)&&("t"===e.key||"T"===e.key)){const e=document.querySelectorAll('[id^="toast-container-"] [id^="toast-"]');if(e.length>0){const t=e[e.length-1],n=t.querySelector("button, a, [tabindex='0']");n&&"function"==typeof n.focus?n.focus():"function"==typeof t.focus&&t.focus()}}};window.addEventListener("keydown",e,{passive:!0})}try{"undefined"!=typeof window&&(window.customizableToast={setConfig:s,getConfig:l,resetConfig:a,shouldReduceMotion:c,version:Pt,createToast:xt,success:At,error:Ct,warning:St,info:kt,loading:Et,custom:_t,setDefaultColors:gt,setDefaultMessages:bt,noop:Mt,dismiss:Lt,dismissAll:Mt,clear:Mt,toastPromise:Bt,promise:Bt,updateToastByKey:dt,setAudioEnabled:G,isAudioEnabled:Y,playTone:$,registerSoundPreset:W,getSoundPresets:H,resetSoundPresets:U,resetAudioContext:X,getToastPool:ye,resetToastPool:ge,getToastBroadcaster:Ie,resetToastBroadcaster:ze,calculateToastPriority:Ve,categorizeToast:qe,createGestureDetector:We,detectPinch:$e,isFlick:Fe,calculateVelocity:De,generateToastId:f,resetToastIdCounter:p,getToastMetrics:Qe,registerSpringPreset:J,getSpringPresets:Z,resetSpringPresets:ee,resolveSpringConfig:te,solveSpring:ne,calculateSpringSettlingDuration:oe,generateSpringLinearEasing:ie,getSpringTransition:re,getAudioContext:O,getAudioAnalyser:q})}catch(Ct){console.error("Global assignment failed:",Ct)}e.calculateSpringSettlingDuration=oe,e.calculateToastPriority=Ve,e.calculateVelocity=De,e.categorizeToast=qe,e.clear=Nt,e.createGestureDetector=We,e.createToast=xt,e.custom=_t,e.default=xt,e.detectPinch=$e,e.dismiss=Lt,e.dismissAll=It,e.error=Ct,e.generateSpringLinearEasing=ie,e.generateToastId=f,e.getAudioAnalyser=q,e.getAudioContext=O,e.getConfig=l,e.getSoundPresets=H,e.getSpringPresets=Z,e.getSpringTransition=re,e.getToastBroadcaster=Ie,e.getToastMetrics=Qe,e.getToastPool=ye,e.info=kt,e.isAudioEnabled=Y,e.isFlick=Fe,e.loading=Et,e.noop=Mt,e.playTone=$,e.registerSoundPreset=W,e.registerSpringPreset=J,e.resetAudioContext=X,e.resetConfig=a,e.resetContainerRegistry=function(){ve.clear(),we.clear()},e.resetSoundPresets=U,e.resetSpringPresets=ee,e.resetToastBroadcaster=ze,e.resetToastIdCounter=p,e.resetToastManager=function(){for(const[,e]of Ue)null!=e&&e.rafId&&cancelAnimationFrame(e.rafId);Ue.clear(),Ge.length=0;for(const[,h]of He){var e,t,n,o,i,r,s,a,l,c,u,d,p,f,m;if(null===(e=h.timer)||void 0===e||e.clear(),null===(t=h.outer)||void 0===t||null===(n=t._pauseCleanup)||void 0===n||n.call(t),null===(o=h.toast)||void 0===o||null===(i=o._cleanupCloseButton)||void 0===i||i.call(o),null===(r=h.toast)||void 0===r||null===(s=r._cleanupCTA)||void 0===s||s.call(r),null===(a=h.toast)||void 0===a||null===(l=a._cleanupUndo)||void 0===l||l.call(a),null===(c=h.toast)||void 0===c||null===(u=c._cleanupSwipe)||void 0===u||u.call(c),null===(d=h.toast)||void 0===d||null===(p=d._cleanup)||void 0===p||p.call(d),null!==(f=h.toast)&&void 0!==f&&f._progressAnimation){try{h.toast._progressAnimation.cancel()}catch(e){}h.toast._progressAnimation=null}const y=null===(m=h.outer)||void 0===m?void 0:m.querySelector(".toast-count-badge");null!=y&&y._scaleTimer&&(clearTimeout(y._scaleTimer),y._scaleTimer=null)}"undefined"!=typeof document&&document.querySelectorAll('[id^="toast-container-"]').forEach(e=>{try{var t;null===(t=e._stackedCleanup)||void 0===t||t.call(e)}catch(e){}}),He.clear(),Ye=0,Xe=0,lt=!1,Ke()},e.resetToastPool=ge,e.resolveSpringConfig=te,e.setAudioEnabled=G,e.setConfig=s,e.setDefaultColors=gt,e.setDefaultMessages=bt,e.shouldReduceMotion=c,e.solveSpring=ne,e.success=At,e.toastPromise=Bt,e.updateToastByKey=dt,e.version=Pt,e.warning=St,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
15
|
+
!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).customizableToast={})}(this,function(e){"use strict";function t(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function o(e){for(var o=1;o<arguments.length;o++){var i=null!=arguments[o]?arguments[o]:{};o%2?n(Object(i),!0).forEach(function(n){t(e,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}const i=Object.freeze({maxVisible:3,maxQueueSize:100,zIndex:9999,targetNode:null,disableInlineStyles:!1,reducedMotion:"auto",defaultPosition:"bottom-right",theme:"light",stacked:!1,swipeToDismiss:!0,sound:!0,soundPreset:"modern",icon:!0,pauseOnHover:!1,syncTabs:!1,aiPrioritization:!1,priorityScorer:null,onMetrics:null,debug:!1}),r=o({},i);function s(e={}){if(!e||"object"!=typeof e||Array.isArray(e))return l();const{maxVisible:t,maxQueueSize:n,zIndex:o,targetNode:i,disableInlineStyles:s,reducedMotion:a,defaultPosition:c,theme:u,stacked:d,swipeToDismiss:p,sound:f,soundPreset:m,icon:h,pauseOnHover:y,syncTabs:g,aiPrioritization:b,priorityScorer:v,onMetrics:w,debug:T}=e;if(void 0!==T&&(r.debug=Boolean(T)),void 0!==t){const e=Number(t);Number.isFinite(e)&&e>0&&(r.maxVisible=Math.max(1,Math.floor(e)))}if(void 0!==n){const e=Number(n);Number.isFinite(e)&&e>=0&&(r.maxQueueSize=Math.floor(e))}if(void 0!==o){const e=Number(o);Number.isFinite(e)&&(r.zIndex=Math.trunc(e))}if(void 0!==i&&(r.targetNode=i&&"object"==typeof i&&"function"==typeof i.appendChild?i:null),void 0!==s&&(r.disableInlineStyles=Boolean(s)),void 0!==a){const e=String(a||"auto").toLowerCase();["auto","always","never"].includes(e)&&(r.reducedMotion=e,"undefined"!=typeof document&&("always"===e?document.documentElement.setAttribute("data-toast-reduced-motion","always"):"never"===e?document.documentElement.setAttribute("data-toast-reduced-motion","never"):document.documentElement.removeAttribute("data-toast-reduced-motion")))}if(void 0!==c){const e=String(c||"").toLowerCase().trim();e&&(r.defaultPosition=e)}if(void 0!==u){const e=String(u||"light").toLowerCase();["light","dark","high-contrast","compact","spacious","glass"].includes(e)&&(r.theme=e,"undefined"!=typeof document&&document.documentElement.setAttribute("data-toast-theme",e))}if(void 0!==d&&(r.stacked=Boolean(d)),void 0!==p&&(r.swipeToDismiss=Boolean(p)),void 0!==f&&(r.sound=Boolean(f)),void 0!==m){const e=String(m||"modern").toLowerCase().trim();e&&(r.soundPreset=e)}return void 0!==h&&(r.icon=Boolean(h)),void 0!==y&&(r.pauseOnHover=Boolean(y)),void 0!==g&&(r.syncTabs=Boolean(g)),void 0!==b&&(r.aiPrioritization=Boolean(b)),void 0!==v&&(r.priorityScorer="function"==typeof v?v:null),void 0!==w&&(r.onMetrics="function"==typeof w?w:null),l()}function a(){return Object.assign(r,i),"undefined"!=typeof document&&(document.documentElement.removeAttribute("data-toast-theme"),document.documentElement.removeAttribute("data-toast-reduced-motion")),l()}function l(){return o({},r)}function c(){if("always"===r.reducedMotion)return!0;if("never"===r.reducedMotion)return!1;try{return Boolean("undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)}catch(e){return!1}}let u=0;const d=Math.floor(65535*Math.random()).toString(36).padStart(3,"0");function p(){u=0}function f(e="toast"){const t="string"==typeof e?e.trim().toLowerCase().replace(/[^a-z0-9_-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""):"",n=t&&!/^[0-9]/.test(t)?t:"toast",o=Date.now().toString(36);u=u+1&16777215;const i=u.toString(36);return`${n}-${o}-${d}${i}`}const m=new class{constructor(e=200){this.maxSize=e,this.map=new Map}get(e){if(!this.map.has(e))return;const t=this.map.get(e);return this.map.delete(e),this.map.set(e,t),t}set(e,t){if(this.map.has(e))this.map.delete(e);else if(this.map.size>=this.maxSize){const e=this.map.keys().next().value;this.map.delete(e)}this.map.set(e,t)}}(200),h={};function y(e){if(!e)return"#ffffff";const t=String(e),n=m.get(t);if(n)return n;if(h[null==e?void 0:e.toLowerCase()]){const n=h[e.toLowerCase()];return m.set(t,n),n}let o,i,r;try{const t=function(e){const t=null==e?void 0:e.match(/^#(?:([0-9a-f]{3,4})|([0-9a-f]{6})|([0-9a-f]{8}))$/i);if(t){let e=t[1]||t[2]||t[3];if(3!==e.length&&4!==e.length||(e=e.slice(0,3).split("").map(e=>e+e).join("")),e.length>=6){const t=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),o=parseInt(e.slice(4,6),16);if(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(o))return{r:t,g:n,b:o}}return null}const n=e=>{if("string"!=typeof e)return Number(e);const t=e.trim();return t.endsWith("%")?Math.round(parseFloat(t)/100*255):Number(t)},o=null==e?void 0:e.match(/rgba?\(\s*([\d.]+%?)\s*,\s*([\d.]+%?)\s*,\s*([\d.]+%?)(?:\s*,\s*[\d.%]+)?\s*\)/i);if(o){const e=Math.min(255,Math.max(0,n(o[1]))),t=Math.min(255,Math.max(0,n(o[2]))),i=Math.min(255,Math.max(0,n(o[3])));if(Number.isFinite(e)&&Number.isFinite(t)&&Number.isFinite(i))return{r:e,g:t,b:i}}const i=null==e?void 0:e.match(/rgba?\(\s*([\d.]+%?)\s+([\d.]+%?)\s+([\d.]+%?)(?:\s*\/\s*[\d.%]+)?\s*\)/i);if(i){const e=Math.min(255,Math.max(0,n(i[1]))),t=Math.min(255,Math.max(0,n(i[2]))),o=Math.min(255,Math.max(0,n(i[3])));if(Number.isFinite(e)&&Number.isFinite(t)&&Number.isFinite(o))return{r:e,g:t,b:o}}const r=null==e?void 0:e.match(/hsla?\(\s*(-?[\d.]+(?:deg|grad|rad|turn)?)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*[\d.%]+)?\s*\)/i),s=!r&&(null==e?void 0:e.match(/hsla?\(\s*(-?[\d.]+(?:deg|grad|rad|turn)?)\s+([\d.]+)%\s+([\d.]+)%(?:\s*\/\s*[\d.%]+)?\s*\)/i)),a=r||s;if(a){const e=(e=>{const t=e.trim().toLowerCase();let n=parseFloat(t);return Number.isFinite(n)?(t.endsWith("turn")?n*=360:t.endsWith("grad")?n=360*n/400:t.endsWith("rad")&&(n=180*n/Math.PI),(n%360+360)%360/360):0})(a[1]),t=Math.min(1,Math.max(0,Number(a[2])/100)),n=Math.min(1,Math.max(0,Number(a[3])/100));if(0===t){const e=Math.round(255*n);return{r:e,g:e,b:e}}const o=(e,t,n)=>{let o=n;return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+6*(t-e)*o:o<.5?t:o<2/3?e+(t-e)*(2/3-o)*6:e},i=n<.5?n*(1+t):n+t-n*t,r=2*n-i;return{r:Math.round(255*o(r,i,e+1/3)),g:Math.round(255*o(r,i,e)),b:Math.round(255*o(r,i,e-1/3))}}return null}(function(e){if("string"!=typeof e)return e;let t=e.trim(),n=0;for(;t.toLowerCase().startsWith("var(")&&t.endsWith(")")&&n<5;){n++;const e=t.slice(4,-1).trim(),o=e.indexOf(","),i=(-1===o?e:e.slice(0,o)).trim(),r=-1===o?"":e.slice(o+1).trim();if(!i.startsWith("--"))return t;let s="";try{"undefined"!=typeof document&&"function"==typeof getComputedStyle&&(s=getComputedStyle(document.documentElement).getPropertyValue(i).trim())}catch(e){}if(s)t=s;else{if(!r)break;t=r}}return t}("string"==typeof e?e.trim():String(e||"")).trim());if(!t)throw new Error("Unknown color");({r:o,g:i,b:r}=t)}catch(e){o=i=r=128}const s=(e,t,n)=>{const o=[e,t,n].map(e=>(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4));return.2126*o[0]+.7152*o[1]+.0722*o[2]},a=(e,t)=>{const n=s(...e),o=s(...t);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)};let[l,c,u]=((e,t,n)=>{e/=255,t/=255,n/=255;const o=Math.max(e,t,n),i=Math.min(e,t,n);let r,s,a=(o+i)/2;if(o===i)r=s=0;else{const l=o-i;switch(s=a>.5?l/(2-o-i):l/(o+i),o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return[360*r,s,a]})(o,i,r),d=u<.5?Math.min(u+.5,1):Math.max(u-.5,0),[p,f,y]=((e,t,n)=>{let o,i,r;if(e/=360,0===t)o=i=r=n;else{const s=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=s(l,a,e+1/3),i=s(l,a,e),r=s(l,a,e-1/3)}return[Math.round(255*o),Math.round(255*i),Math.round(255*r)]})(l,c,d);if(a([o,i,r],[p,f,y])<4.5){const e=a([o,i,r],[0,0,0]),t=a([o,i,r],[255,255,255]);[p,f,y]=e>=t?[0,0,0]:[255,255,255]}const g=((e,t,n)=>`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`)(p,f,y);return m.set(t,g),g}Object.entries({aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],transparent:[255,255,255],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}).forEach(([e,[t,n,o]])=>{const i=e=>{const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)},r=.2126*i(t)+.7152*i(n)+.0722*i(o),s=(r+.05)/.05,a=1.05/(r+.05);h[e.toLowerCase()]=s>=a?"#000000":"#ffffff"});const g=new Set(["DIV","SPAN","P","BR","STRONG","B","EM","I","U","SMALL","UL","OL","LI","A","IMG","PRE","CODE","MARK"]),b=new Set(["href","src","alt","title","class","target","rel","loading"]),v=new Set(["SCRIPT","STYLE","IFRAME","NOSCRIPT","OBJECT","EMBED","SVG","MATH","AUDIO","VIDEO","CANVAS","TEMPLATE"]),w=/^\s*(?:https?:|mailto:|data:image\/(?:png|jpe?g|gif|webp|avif|bmp|ico);|\/(?!\/|\\)|\.\/|\.\.\/|#)/i;function T(e,t,n){if(e.nodeType===Node.TEXT_NODE)return document.createTextNode(e.nodeValue);if(e.nodeType===Node.COMMENT_NODE)return null;if(e.nodeType!==Node.ELEMENT_NODE)return null;const o=e.tagName.toUpperCase();if(v.has(o)||o.includes("SCRIPT")||o.includes("<")||o.includes(">"))return null;if(!t.has(o)){const o=document.createDocumentFragment();return Array.from(e.childNodes).forEach(e=>{const i=T(e,t,n);i&&o.appendChild(i)}),o}const i=document.createElement(e.tagName);return Array.from(e.attributes||[]).forEach(e=>{i.setAttribute(e.name,e.value)}),function(e,t){const n=[];Array.from(e.attributes||[]).forEach(o=>{const i=o.name.toLowerCase(),r=o.value;if(t.has(i)&&!i.startsWith("on")){if("href"===i||"src"===i){const t="string"==typeof r?r.trim().toLowerCase():"";if((t.startsWith("javascript:")||t.startsWith("vbscript:")||t.startsWith("data:"))&&("src"!==i||!t.startsWith("data:image/")||t.startsWith("data:image/svg+xml")))return"href"===i?void e.setAttribute("href","#"):void n.push(o.name);if(!w.test(r))return"href"===i?void e.setAttribute("href","#"):void n.push(o.name)}if("target"===i&&"string"==typeof r&&"_blank"===r.trim().toLowerCase()){const t=(e.getAttribute("rel")||"").split(/\s+/).filter(Boolean);t.includes("noopener")||t.push("noopener"),t.includes("noreferrer")||t.push("noreferrer"),e.setAttribute("rel",t.join(" "))}}else n.push(o.name)}),n.forEach(t=>e.removeAttribute(t));const o=e.getAttribute("target");if("A"===e.tagName&&"string"==typeof o&&"_blank"===o.trim().toLowerCase()){const t=(e.getAttribute("rel")||"").split(/\s+/).filter(Boolean);t.includes("noopener")||t.push("noopener"),t.includes("noreferrer")||t.push("noreferrer"),e.setAttribute("rel",t.join(" "))}}(i,n),Array.from(e.childNodes).forEach(e=>{const o=T(e,t,n);o&&i.appendChild(o)}),i}function x(e){if(!e||"string"!=typeof e)return"";const t=function(e){if("undefined"!=typeof DOMParser)try{const t=(new DOMParser).parseFromString(e,"text/html");if(t&&t.body)return t.body}catch(e){}if("undefined"!=typeof document){const t=document.createElement("template");if("content"in t)return t.innerHTML=e,t.content;const n=document.createElement("div");return n.innerHTML=e,n}return null}(e);if(!t)return"";const n=document.createDocumentFragment();Array.from(t.childNodes).forEach(e=>{const t=T(e,g,b);t&&n.appendChild(t)});const o=document.createElement("div");return o.appendChild(n),o.querySelectorAll('a[target="_blank"]').forEach(e=>{const t=(e.getAttribute("rel")||"").split(/\s+/).filter(Boolean);t.includes("noopener")||t.push("noopener"),t.includes("noreferrer")||t.push("noreferrer"),e.setAttribute("rel",t.join(" "))}),o.innerHTML}function A(e,t={}){if("string"!=typeof e||!e.trim())return"";try{if(!t.forceFallback&&function(){try{return Boolean("undefined"!=typeof window&&window.DOMPurify&&"function"==typeof window.DOMPurify.sanitize)}catch(e){}return!1}()){const t=window.DOMPurify.sanitize(e,{ALLOWED_TAGS:Array.from(g),ALLOWED_ATTR:Array.from(b),ALLOWED_URI_REGEXP:w}),n=document.createElement("div");return n.innerHTML=t,n.querySelectorAll("a[href]").forEach(e=>{const t=e.getAttribute("href")||"";w.test(t)||e.setAttribute("href","#")}),n.querySelectorAll('a[target="_blank"]').forEach(e=>{const t=(e.getAttribute("rel")||"").split(/\s+/).filter(Boolean);t.includes("noopener")||t.push("noopener"),t.includes("noreferrer")||t.push("noreferrer"),e.setAttribute("rel",t.join(" "))}),n.innerHTML}}catch(e){console.warn("DOMPurify sanitization failed, falling back:",e)}return x(e)}function C(e={}){if("undefined"==typeof document)return null;const t=e&&"object"==typeof e&&!Array.isArray(e)?e:{},n=Number(t.size),o=Number.isFinite(n)&&n>0?n:14,i="string"==typeof t.color&&t.color.trim()?t.color.trim():"currentColor",r=/[\r\n<>"';]/.test(i)||/^\s*javascript:/i.test(i)?"currentColor":i,s="string"==typeof t.text?t.text:"",a=document.createElement("span");a.className="toast-loader",a.setAttribute("role","status"),a.setAttribute("aria-label",s||"Loading");const u=l();u.disableInlineStyles||(a.style.display="inline-flex",a.style.alignItems="center",a.style.gap="8px");const d="http://www.w3.org/2000/svg",p=document.createElementNS(d,"svg");p.setAttribute("width",String(o)),p.setAttribute("height",String(o)),p.setAttribute("viewBox","0 0 50 50"),p.setAttribute("aria-hidden","true");const f=document.createElementNS(d,"circle");if(f.classList.add("toast-loader-circle"),f.setAttribute("cx","25"),f.setAttribute("cy","25"),f.setAttribute("r","20"),f.setAttribute("fill","none"),f.setAttribute("stroke",r),f.setAttribute("stroke-width","4"),f.setAttribute("stroke-linecap","round"),u.disableInlineStyles||(f.style.opacity="0.85",f.style.strokeDasharray="90",f.style.strokeDashoffset="60",f.style.transformOrigin="center",c()||(f.style.animation="toast-spinner 1s linear infinite")),p.appendChild(f),a.appendChild(p),s){const e=document.createElement("span");e.className="toast-loader-label",u.disableInlineStyles||(e.style.fontSize="13px"),e.textContent=s,a.appendChild(e)}if(!u.disableInlineStyles&&"undefined"!=typeof document&&!document.getElementById("toast-spinner-styles"))try{const e=document.createElement("style");e.id="toast-spinner-styles",e.textContent="@keyframes toast-spinner { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }";const t=document.head||document.documentElement;t&&t.appendChild(e)}catch(e){}return a}function S(e,t,n){const i=null==t?void 0:t.cta;if(!i||"object"!=typeof i)return;const r=Array.isArray(i)?i.filter(e=>e&&"object"==typeof e):[i];if(0===r.length)return;const s=[];r.forEach((i,a)=>{if(!i||"object"!=typeof i)return;const c=o({},i);c.label||(c.label=r.length>1?`Action ${a+1}`:"CTA Label Missing!");const u="link"===c.variant||!c.variant&&!!c.href,d=document.createElement(u?"a":"button");if(u){if(c.href){const e=String(c.href).trim(),t=/^(javascript:|vbscript:|data:(?!image\/[a-z0-9.+-]+;base64,))/i.test(e);d.href=t?"#":e}else d.setAttribute("role","button"),d.tabIndex=0;c.target&&(d.target=c.target);const e=new Set((c.rel||"").split(/\s+/).filter(Boolean));"string"==typeof c.target&&"_blank"===c.target.trim().toLowerCase()&&(e.add("noopener"),e.add("noreferrer")),d.rel=Array.from(e).join(" ")}else d.type="button";d.setAttribute("aria-label",c.ariaLabel||c.label);const p=c.textColor||c.color||t.textColor||y(t.backgroundColor),f=c.backgroundColor||c.background||(t.backgroundColor?E(t.backgroundColor):"rgba(255,255,255,0.15)"),m=("string"==typeof p?p.trim():"").match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);let h="rgba(128, 128, 128, 0.3)";m&&(h=(3===m[1].length?`#${m[1][0]}${m[1][0]}${m[1][1]}${m[1][1]}${m[1][2]}${m[1][2]}`:`#${m[1]}`)+"44"),d.className="toast-cta",l().disableInlineStyles||Object.assign(d.style,{marginLeft:0===a?"10px":"6px",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",border:`1px solid ${h}`,color:p,background:f,cursor:"pointer",whiteSpace:"nowrap",flexShrink:"0"}),d.textContent=c.label;const g=async t=>{try{if("function"==typeof c.onClick){const e=c.onClick(t);null!=e&&e.then&&await e}}catch(e){console.error("CTA onClick handler error:",e)}finally{!1!==c.autoClose&&"function"==typeof n&&n(e)}},b=e=>{!u||c.href||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),g(e))};d.addEventListener("click",g),u&&!c.href&&d.addEventListener("keydown",b);const v=()=>{d.removeEventListener("click",g),u&&!c.href&&d.removeEventListener("keydown",b)};d._cleanup=v,s.push(v);const w=e.querySelector(".toast-undo-btn")||e.querySelector(".toast-close-btn")||e.querySelector(".toast-progress-bar");w?e.insertBefore(d,w):e.appendChild(d)});const a=e._cleanupCTA;e._cleanupCTA=()=>{null==a||a(),s.forEach(e=>e())}}function k(e,t,n){const i=null==t?void 0:t.undo;if(!i)return;const r="function"==typeof i;if(!r&&("object"!=typeof i||Array.isArray(i)))return;const s=r?{onUndo:i}:o({},i),a="string"==typeof s.label&&s.label.trim()?s.label.trim():"Undo",c=Number(null==t?void 0:t.duration),u=!1!==s.showCountdown&&Number.isFinite(c)&&c>0,d=document.createElement("button");d.type="button",d.className="toast-undo-btn",d.setAttribute("aria-label",`${a} action`);const p=t.textColor||y(t.backgroundColor),f=t.backgroundColor?E(t.backgroundColor):"rgba(255,255,255,0.18)",m=("string"==typeof p?p.trim():"").match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);let h="rgba(128, 128, 128, 0.35)";m&&(h=(3===m[1].length?`#${m[1][0]}${m[1][0]}${m[1][1]}${m[1][1]}${m[1][2]}${m[1][2]}`:`#${m[1]}`)+"55"),l().disableInlineStyles||Object.assign(d.style,{marginLeft:"10px",padding:"5px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"700",lineHeight:"1",border:`1px solid ${h}`,color:p,background:f,cursor:"pointer",whiteSpace:"nowrap",flexShrink:"0",display:"inline-flex",alignItems:"center",gap:"4px"});let g=Math.max(1,Math.ceil((c||2500)/1e3));const b=()=>{d.textContent=u?`${a} (${g}s)`:a};b();let v=null,w=!1;var T;u&&(v=setInterval(()=>{w||(g=Math.max(0,g-1),b(),g<=0&&v&&(clearInterval(v),v=null))},1e3),"function"==typeof(null===(T=v)||void 0===T?void 0:T.unref)&&v.unref()),e._pauseUndo=()=>{w=!0},e._resumeUndo=()=>{w=!1};const x=()=>{v&&(clearInterval(v),v=null),e._pauseUndo=null,e._resumeUndo=null},A=async t=>{x(),d.removeEventListener("click",A);try{if("function"==typeof s.onUndo){const n=s.onUndo(t,e);null!=n&&n.then&&await n}}catch(e){console.error("Undo action error:",e)}finally{"function"==typeof n&&n(e)}};d.addEventListener("click",A),d._cleanup=()=>{x(),d.removeEventListener("click",A)},e._cleanupUndo=()=>{x(),d.removeEventListener("click",A)};const C=e.querySelector(".toast-close-btn")||e.querySelector(".toast-progress-bar");C?e.insertBefore(d,C):e.appendChild(d)}function _(e,t,n){const o=document.createElement("button");o.type="button",o.setAttribute("aria-label","Close notification"),o.setAttribute("title","Close"),o.textContent="×";const i=t.textColor||y(t.backgroundColor);o.className="toast-close-btn",l().disableInlineStyles||Object.assign(o.style,{background:"none",border:"none",color:i,fontSize:"18px",marginLeft:"10px",cursor:"pointer",lineHeight:"1",padding:"0 4px"});const r=()=>{"function"==typeof n&&n(e)};o.addEventListener("click",r),e._cleanupCloseButton=()=>{o.removeEventListener("click",r)},e.appendChild(o)}function E(e){return e&&"#000000"===y(e)?"rgba(0,0,0,0.15)":"rgba(255,255,255,0.15)"}function M(){if("undefined"==typeof document||document.getElementById("toast-progress-indeterminate-styles"))return;const e=document.createElement("style");e.id="toast-progress-indeterminate-styles",e.textContent="\n @keyframes toast-progress-indeterminate {\n 0% { left: 0%; width: 0%; }\n 50% { left: 20%; width: 60%; }\n 100% { left: 100%; width: 0%; }\n }\n @keyframes toast-progress-indeterminate-rtl {\n 0% { right: 0%; width: 0%; }\n 50% { right: 20%; width: 60%; }\n 100% { right: 100%; width: 0%; }\n }\n .toast-progress-bar-indeterminate {\n animation: toast-progress-indeterminate 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;\n }\n .toast-progress-bar-indeterminate-rtl {\n animation: toast-progress-indeterminate-rtl 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;\n }\n ";const t=document.head||document.documentElement;t&&t.appendChild(e)}function L(e,t,n={}){if(null==e)return null;if("indeterminate"===e)return"indeterminate";let o;if("string"==typeof e){const t=e.trim();t.endsWith("%"),o=parseFloat(t)}else o=Number(e);return Number.isFinite(o)?(t&&o>0&&o<1&&(t._progressRatioMode=!0),((Boolean(n.progressNormalized)||Boolean(null==t?void 0:t._progressRatioMode))&&o>0&&o<=1||o>0&&o<1)&&(o*=100),Math.min(100,Math.max(0,o))):0}function N(e,t={}){var n,o;if(!e)return;const i=document.createElement("div");i.className="toast-progress-bar",e._progressBar=i;const r=t.borderRadius||"0",s=parseInt(r,10),a=Number.isFinite(s)&&s>0?s:0;let u=4,d="4px";if("number"==typeof t.progressHeight&&Number.isFinite(t.progressHeight)&&t.progressHeight>0)u=t.progressHeight,d=`${u}px`;else if("string"==typeof t.progressHeight&&t.progressHeight.trim()){const e=t.progressHeight.trim(),n=parseFloat(e);Number.isFinite(n)&&n>0&&(e.endsWith("rem")||e.endsWith("em")?(u=16*n,d=e):(u=n,d=/^\d+(\.\d+)?$/.test(e)?`${n}px`:e))}const p=Number(null!==(n=t.duration)&&void 0!==n?n:2500),f=Math.max(0,p+5),m=Math.min(a,2*u),h=a>0?`calc(100% - ${2*m}px)`:"100%",y="reverse"===t.progressDirection||"increasing"===t.progressDirection||"ltr"===t.progressDirection,g="rtl"===t.fontDirection||"rtl"===t.progressDirection||"rtl"===(null==e||null===(o=e.style)||void 0===o?void 0:o.direction);i._leftOffset=m,i._finalWidth=h,i._isReverse=y,i._isRtl=g;const b=t.progressBarColor||t.progressColor||"currentColor";l().disableInlineStyles||Object.assign(i.style,{position:"absolute",left:g?"auto":`${m}px`,right:g?`${m}px`:"auto",height:d,background:b,width:y?"0%":`${h}`,transition:`width ${f}ms linear`,["top"===t.progressPosition?"top":"bottom"]:"0",borderRadius:u/2+"px",opacity:"0.8",zIndex:"2",willChange:"width"}),e.appendChild(i);const v="indeterminate"===t.progress||Boolean(t.showProgressBar)&&(0===t.duration||t.duration===1/0)&&void 0===t.progress;if(i._isIndeterminate=v,i._isManualProgress=void 0!==t.progress&&"indeterminate"!==t.progress,v){if(i.classList.add("toast-progress-bar-indeterminate"),g&&i.classList.add("toast-progress-bar-indeterminate-rtl"),!l().disableInlineStyles){M();const e=g?"toast-progress-indeterminate-rtl":"toast-progress-indeterminate";i.style.animation=`${e} 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite`}i.style.width=h}else{if(void 0!==t.progress){const n=L(t.progress,e,t);return i.style.width=`${n}%`,void(i.style.transition="width 200ms ease")}if(0!==t.duration&&t.duration!==1/0)if(c())i.style.display="none";else if("function"==typeof i.animate){const t=y?[{width:"0%"},{width:h}]:[{width:h},{width:"0%"}];e._progressAnimation=i.animate(t,{duration:f,easing:"linear",fill:"forwards",delay:50})}else i.style.transition=`width ${f}ms linear`,requestAnimationFrame(()=>{i.style.width=y?h:"0%"});else i.style.width="0%"}}function I(e){if(!e)return;if(e._hasAnimated)return;if(c())return e._hasAnimated=!0,e.style.transition="none",e.style.opacity="1",e.style.transform="translateY(0)",void e.classList.add("active");const t=()=>{if(!e._hasAnimated){e._hasAnimated=!0;try{e.offsetHeight}catch(e){}requestAnimationFrame(()=>{e.style.opacity="1",e.style.transform="none",e.classList.add("active")})}};e.isConnected?t():requestAnimationFrame(()=>{e.isConnected?t():requestAnimationFrame(()=>{t()})})}let B=null,P=!0,z=!1;var O;if("undefined"!=typeof window)if("undefined"!=typeof navigator&&null!==(O=navigator.userActivation)&&void 0!==O&&O.hasBeenActive)z=!0;else{const e=()=>{if(z=!0,B&&"suspended"===B.state)try{B.resume().catch(()=>{})}catch(e){}try{window.removeEventListener("pointerdown",e,!0),window.removeEventListener("keydown",e,!0),window.removeEventListener("touchstart",e,!0)}catch(e){}};try{window.addEventListener("pointerdown",e,{capture:!0,once:!0,passive:!0}),window.addEventListener("keydown",e,{capture:!0,once:!0,passive:!0}),window.addEventListener("touchstart",e,{capture:!0,once:!0,passive:!0})}catch(e){}}const V=new Map;function q(e=!0){if("undefined"==typeof window)return null;const t=window.AudioContext||window.webkitAudioContext;if(!t)return null;if(!B)try{B=new t}catch(e){return null}const n=z||"undefined"!=typeof navigator&&navigator.userActivation&&navigator.userActivation.hasBeenActive;if(B&&"suspended"===B.state&&(e||n))try{B.resume().catch(()=>{})}catch(e){}return B}let R=null;function D(){const e=q(!1);if(!e||"function"!=typeof e.createAnalyser)return null;if(!R)try{R=e.createAnalyser(),R.fftSize=128,R.connect(e.destination)}catch(e){return null}return R}function F(e,t){R?t.connect(R):t.connect(e.destination)}function j(e,t){e&&(e.onended=()=>{try{var n;e.disconnect(),null==t||null===(n=t.disconnect)||void 0===n||n.call(t)}catch(e){}})}const $={modern:function(e,t,n){if("success"===t)[523.25,659.25,783.99].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.setValueAtTime(t,n+.08*o),r.gain.setValueAtTime(.001,n+.08*o),r.gain.exponentialRampToValueAtTime(.12,n+.08*o+.02),r.gain.exponentialRampToValueAtTime(1e-4,n+.08*o+.35),i.connect(r),F(e,r),j(i,r),i.start(n+.08*o),i.stop(n+.08*o+.36)});else if("error"===t)[320,240].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="triangle",i.frequency.setValueAtTime(t,n+.1*o),r.gain.setValueAtTime(.001,n+.1*o),r.gain.exponentialRampToValueAtTime(.15,n+.1*o+.02),r.gain.exponentialRampToValueAtTime(1e-4,n+.1*o+.22),i.connect(r),F(e,r),j(i,r),i.start(n+.1*o),i.stop(n+.1*o+.23)});else if("warning"===t){const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(440,n),t.frequency.exponentialRampToValueAtTime(493.88,n+.12),o.gain.setValueAtTime(.001,n),o.gain.exponentialRampToValueAtTime(.12,n+.02),o.gain.exponentialRampToValueAtTime(1e-4,n+.28),t.connect(o),F(e,o),j(t,o),t.start(n),t.stop(n+.3)}else{const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(600,n),t.frequency.exponentialRampToValueAtTime(950,n+.04),t.frequency.exponentialRampToValueAtTime(400,n+.09),o.gain.setValueAtTime(.001,n),o.gain.exponentialRampToValueAtTime(.1,n+.015),o.gain.exponentialRampToValueAtTime(1e-4,n+.12),t.connect(o),F(e,o),j(t,o),t.start(n),t.stop(n+.13)}},retro:function(e,t,n){if("success"===t)[523.25,659.25,783.99,1046.5].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="square";const s=n+.045*o;i.frequency.setValueAtTime(t,s),r.gain.setValueAtTime(.001,s),r.gain.linearRampToValueAtTime(.08,s+.005),r.gain.exponentialRampToValueAtTime(1e-4,s+.042),i.connect(r),F(e,r),j(i,r),i.start(s),i.stop(s+.045)});else if("error"===t){const t=e.createOscillator(),o=e.createGain();t.type="square",t.frequency.setValueAtTime(360,n),t.frequency.exponentialRampToValueAtTime(90,n+.22),o.gain.setValueAtTime(.001,n),o.gain.linearRampToValueAtTime(.1,n+.01),o.gain.exponentialRampToValueAtTime(1e-4,n+.22),t.connect(o),F(e,o),j(t,o),t.start(n),t.stop(n+.23)}else"warning"===t?[0,.08].forEach(t=>{const o=e.createOscillator(),i=e.createGain();o.type="square";const r=n+t;o.frequency.setValueAtTime(880,r),i.gain.setValueAtTime(.001,r),i.gain.linearRampToValueAtTime(.07,r+.005),i.gain.exponentialRampToValueAtTime(1e-4,r+.05),o.connect(i),F(e,i),j(o,i),o.start(r),o.stop(r+.055)}):[987.77,1318.51].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="square";const s=n+.035*o;i.frequency.setValueAtTime(t,s),r.gain.setValueAtTime(.001,s),r.gain.linearRampToValueAtTime(.08,s+.005),r.gain.exponentialRampToValueAtTime(1e-4,s+.035),i.connect(r),F(e,r),j(i,r),i.start(s),i.stop(s+.04)})},futuristic:function(e,t,n){if("success"===t){const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(440,n),t.frequency.exponentialRampToValueAtTime(1760,n+.2),o.gain.setValueAtTime(.001,n),o.gain.exponentialRampToValueAtTime(.12,n+.03),o.gain.exponentialRampToValueAtTime(1e-4,n+.32),t.connect(o),F(e,o),j(t,o),t.start(n),t.stop(n+.33)}else if("error"===t){const t=e.createOscillator(),o=e.createGain();t.type="sawtooth",t.frequency.setValueAtTime(700,n),t.frequency.exponentialRampToValueAtTime(120,n+.24),o.gain.setValueAtTime(.001,n),o.gain.linearRampToValueAtTime(.09,n+.02),o.gain.exponentialRampToValueAtTime(1e-4,n+.25),t.connect(o),F(e,o),j(t,o),t.start(n),t.stop(n+.26)}else if("warning"===t)[580,870].forEach(t=>{const o=e.createOscillator(),i=e.createGain();o.type="sine",o.frequency.setValueAtTime(t,n),o.frequency.linearRampToValueAtTime(1.15*t,n+.1),o.frequency.linearRampToValueAtTime(t,n+.2),i.gain.setValueAtTime(.001,n),i.gain.exponentialRampToValueAtTime(.07,n+.02),i.gain.exponentialRampToValueAtTime(1e-4,n+.25),o.connect(i),F(e,i),j(o,i),o.start(n),o.stop(n+.26)});else{const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(1100,n),t.frequency.exponentialRampToValueAtTime(1600,n+.03),t.frequency.exponentialRampToValueAtTime(750,n+.09),o.gain.setValueAtTime(.001,n),o.gain.exponentialRampToValueAtTime(.09,n+.015),o.gain.exponentialRampToValueAtTime(1e-4,n+.12),t.connect(o),F(e,o),j(t,o),t.start(n),t.stop(n+.13)}},subtle:function(e,t,n){if("success"===t)[750,1100].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="sine";const s=n+.04*o;i.frequency.setValueAtTime(t,s),r.gain.setValueAtTime(.001,s),r.gain.linearRampToValueAtTime(.04,s+.003),r.gain.exponentialRampToValueAtTime(1e-4,s+.025),i.connect(r),F(e,r),j(i,r),i.start(s),i.stop(s+.03)});else if("error"===t)[180,130].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="triangle";const s=n+.05*o;i.frequency.setValueAtTime(t,s),r.gain.setValueAtTime(.001,s),r.gain.linearRampToValueAtTime(.05,s+.005),r.gain.exponentialRampToValueAtTime(1e-4,s+.035),i.connect(r),F(e,r),j(i,r),i.start(s),i.stop(s+.04)});else if("warning"===t){const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(600,n),o.gain.setValueAtTime(.001,n),o.gain.linearRampToValueAtTime(.045,n+.003),o.gain.exponentialRampToValueAtTime(1e-4,n+.025),t.connect(o),F(e,o),j(t,o),t.start(n),t.stop(n+.03)}else{const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(450,n),o.gain.setValueAtTime(.001,n),o.gain.linearRampToValueAtTime(.035,n+.003),o.gain.exponentialRampToValueAtTime(1e-4,n+.02),t.connect(o),F(e,o),j(t,o),t.start(n),t.stop(n+.025)}},bell:function(e,t,n){if("success"===t)[659.25,1318.5,2637].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="sine",i.frequency.setValueAtTime(t,n);const s=.09/(o+1);r.gain.setValueAtTime(.001,n),r.gain.exponentialRampToValueAtTime(s,n+.015),r.gain.exponentialRampToValueAtTime(1e-4,n+.55),i.connect(r),F(e,r),j(i,r),i.start(n),i.stop(n+.58)});else if("error"===t)[220,440].forEach((t,o)=>{const i=e.createOscillator(),r=e.createGain();i.type="triangle",i.frequency.setValueAtTime(t,n);const s=.1/(o+1);r.gain.setValueAtTime(.001,n),r.gain.exponentialRampToValueAtTime(s,n+.015),r.gain.exponentialRampToValueAtTime(1e-4,n+.38),i.connect(r),F(e,r),j(i,r),i.start(n),i.stop(n+.4)});else if("warning"===t){const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(880,n),o.gain.setValueAtTime(.001,n),o.gain.exponentialRampToValueAtTime(.1,n+.015),o.gain.exponentialRampToValueAtTime(1e-4,n+.45),t.connect(o),F(e,o),j(t,o),t.start(n),t.stop(n+.48)}else{const t=e.createOscillator(),o=e.createGain();t.type="sine",t.frequency.setValueAtTime(1320,n),o.gain.setValueAtTime(.001,n),o.gain.exponentialRampToValueAtTime(.08,n+.01),o.gain.exponentialRampToValueAtTime(1e-4,n+.28),t.connect(o),F(e,o),j(t,o),t.start(n),t.stop(n+.3)}}};let W=!1;function H(e="info",t){if(!P)return;if(!W&&"undefined"!=typeof window&&window.customizableToast&&"function"==typeof window.customizableToast.playTone&&window.customizableToast.playTone!==H)try{return W=!0,void window.customizableToast.playTone(e,t)}finally{W=!1}const n=q();if(n)try{"suspended"===n.state&&n.resume().catch(()=>{});const o=n.currentTime,i="number"==typeof e?e:parseFloat(e);if(Number.isFinite(i)&&i>=20&&i<=2e4&&("number"==typeof e||/^\d+(\.\d+)?(hz)?$/i.test(String(e).trim()))){const e=n.createOscillator(),t=n.createGain();return e.type="sine",e.frequency.setValueAtTime(i,o),t.gain.setValueAtTime(.001,o),t.gain.exponentialRampToValueAtTime(.1,o+.015),t.gain.exponentialRampToValueAtTime(1e-4,o+.35),e.connect(t),F(n,t),j(e,t),e.start(o),void e.stop(o+.36)}const r=String(e||"info").toLowerCase().trim(),s=String(t||l().soundPreset||"modern").toLowerCase().trim();if(V.has(s))try{const e=V.get(s);if("function"==typeof e)return void e(n,r,o)}catch(e){console.warn("Custom sound preset synthesizer error:",e)}($[s]||$.modern)(n,r,o)}catch(e){}}function U(e,t){if("string"!=typeof e||!e.trim()||"function"!=typeof t)return!1;const n=e.toLowerCase().trim();return V.set(n,t),!0}function G(){const e=Object.keys($),t=Array.from(V.keys());return Array.from(new Set([...e,...t]))}function Y(){V.clear()}function X(e){P=Boolean(e)}function Q(){return P}function K(){if(B)try{var e,t,n,o;null===(e=(t=B).close)||void 0===e||null===(n=(o=e.call(t)).catch)||void 0===n||n.call(o,()=>{})}catch(e){}B=null,R=null}const J={default:{stiffness:100,damping:10,mass:1,bezierFallback:"cubic-bezier(0.34, 1.4, 0.64, 1)"},gentle:{stiffness:120,damping:14,mass:1,bezierFallback:"cubic-bezier(0.25, 1, 0.5, 1)"},wobbly:{stiffness:180,damping:12,mass:1,bezierFallback:"cubic-bezier(0.35, 1.6, 0.55, 1)"},stiff:{stiffness:210,damping:20,mass:1,bezierFallback:"cubic-bezier(0.18, 0.9, 0.32, 1)"},bouncy:{stiffness:300,damping:15,mass:1.2,bezierFallback:"cubic-bezier(0.34, 1.75, 0.5, 1)"}},Z=new Map;function ee(e,t){if("string"!=typeof e||!e.trim())throw new TypeError("registerSpringPreset: name must be a non-empty string");if(!t||"object"!=typeof t||Array.isArray(t))throw new TypeError("registerSpringPreset: config must be an object");const n=Number(t.stiffness),o=Number(t.damping),i=Number(t.mass);Z.set(e.trim().toLowerCase(),{stiffness:Number.isFinite(n)&&n>0?n:100,damping:Number.isFinite(o)&&o>0?o:10,mass:Number.isFinite(i)&&i>0?i:1,bezierFallback:"string"==typeof t.bezierFallback&&t.bezierFallback.trim()?t.bezierFallback.trim():"cubic-bezier(0.34, 1.4, 0.64, 1)"})}function te(){return[...Object.keys(J),...Z.keys()]}function ne(){Z.clear()}function oe(e){if(!e)return null;if("string"==typeof e){const t=e.trim().toLowerCase();return Z.has(t)?Z.get(t):Object.prototype.hasOwnProperty.call(J,t)?J[t]:J.default}if(!0===e)return J.default;if("object"==typeof e&&!Array.isArray(e)){const t=Number(e.stiffness),n=Number(e.damping),o=Number(e.mass),i=Number.isFinite(t)&&t>0?t:100,r=Number.isFinite(n)&&n>0?n:10,s=Number.isFinite(o)&&o>0?o:1,a=r/(2*Math.sqrt(i*s));let l="string"==typeof e.bezierFallback&&e.bezierFallback.trim()?e.bezierFallback.trim():"cubic-bezier(0.25, 1, 0.5, 1)";return e.bezierFallback||(a<.6?l="cubic-bezier(0.34, 1.7, 0.55, 1)":a<.85&&(l="cubic-bezier(0.34, 1.35, 0.64, 1)")),{stiffness:i,damping:r,mass:s,bezierFallback:l}}return null}function ie(e,t){if(e<=0)return 0;const n=Math.max(.001,(null==t?void 0:t.stiffness)||100),o=Math.max(.001,(null==t?void 0:t.damping)||10),i=Math.max(.001,(null==t?void 0:t.mass)||1),r=Math.sqrt(n/i),s=o/(2*Math.sqrt(n*i));if(Math.abs(s-1)<1e-4)return 1-Math.exp(-r*e)*(1+r*e);if(s<1){const t=r*Math.sqrt(1-s*s);return 1-Math.exp(-s*r*e)*(Math.cos(t*e)+s/Math.sqrt(1-s*s)*Math.sin(t*e))}const a=r*Math.sqrt(s*s-1),l=-s*r+a,c=-s*r-a,u=-l/(c-l);return 1-(c/(c-l)*Math.exp(l*e)+u*Math.exp(c*e))}function re(e,t=.005){if(!e)return 400;const n=Math.max(.001,e.stiffness||100),o=Math.max(.001,e.damping||10),i=Math.max(.001,e.mass||1);let r=3;for(let e=.1;e<=3;e+=.01){const s=ie(e,{stiffness:n,damping:o,mass:i});if(Math.abs(s-1)<=t){let s=!0;for(let r=e;r<=Math.min(3,e+.12);r+=.01)if(Math.abs(ie(r,{stiffness:n,damping:o,mass:i})-1)>t){s=!1;break}if(s){r=e;break}}}const s=Math.round(1e3*r);return Math.max(150,Math.min(2500,s))}function se(e,t=32){const n=re(e)/1e3,o=[];for(let i=0;i<=t;i++){const r=i/t,s=ie(r*n,e),a=Math.round(1e3*s)/1e3,l=Math.round(1e3*r)/10;o.push(`${a} ${l}%`)}return`linear(${o.join(", ")})`}function ae(e){const t=oe(e);if(!t)return null;const n=re(t),o=se(t),i=function(){if("undefined"==typeof window||"undefined"==typeof CSS||"function"!=typeof CSS.supports)return!1;try{return CSS.supports("transition-timing-function","linear(0 0%, 1 100%)")||CSS.supports("transition-timing-function","linear(0, 1)")||CSS.supports("animation-timing-function","linear(0 0%, 1 100%)")}catch(e){return!1}}()?o:t.bezierFallback||"cubic-bezier(0.34, 1.4, 0.64, 1)";return{config:{stiffness:t.stiffness,damping:t.damping,mass:t.mass},duration:n,easing:i,isSpring:!0}}const le=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","title","desc","defs","clippath","use"]),ce=new Set(["viewbox","width","height","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","opacity","fill-opacity","stroke-opacity","d","cx","cy","r","x","y","x1","y1","x2","y2","points","rx","ry","transform","role","aria-hidden","focusable","xmlns","preserveaspectratio","class","id","href","xlink:href"]);function ue(e=""){return/^\s*javascript:/i.test(e)}function de(e){const t="undefined"!=typeof DOMParser?DOMParser:"undefined"!=typeof window&&window.DOMParser?window.DOMParser:null;if(!t)return null;try{const n=(new t).parseFromString(e,"image/svg+xml");if(n.querySelector("parsererror"))return null;const o=n.documentElement;if(!o||"svg"!==o.tagName.toLowerCase())return null;const i=e=>{if(3===e.nodeType)return document.createTextNode(e.textContent||"");if(1!==e.nodeType)return null;const t=e.tagName.toLowerCase();if(!le.has(t))return null;const n=document.createElementNS("http://www.w3.org/2000/svg",t);if(e.attributes)for(let o=0;o<e.attributes.length;o++){const i=e.attributes[o],r=i.name,s=r.toLowerCase(),a=i.value||"";if(!s.startsWith("on")&&ce.has(s)){if("href"===s||"xlink:href"===s){if(ue(a))continue;if("use"===t&&a&&!a.startsWith("#"))continue}n.setAttribute(r,a)}}if(e.childNodes)for(let t=0;t<e.childNodes.length;t++){const o=i(e.childNodes[t]);o&&n.appendChild(o)}return n};return i(o)}catch(e){return null}}const pe={success:'\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">\n <path d="M20 6L9 17l-5-5"/>\n </svg>\n ',error:'\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">\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>\n ',warning:'\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">\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>\n ',info:'\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">\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>\n '};function fe(e={}){const t=e&&"object"==typeof e&&!Array.isArray(e)?e:{};let n=t.icon;if(void 0===n){const e=l().icon;void 0!==e&&(n=e)}if("function"==typeof n)try{n=n(t)}catch(e){console.warn("options.icon callback error:",e),n=null}if(!1===n||""===n||null===n)return null;if("undefined"==typeof document)return null;const o=t.type,i=l(),r=document.createElement("i");if(r.className="toast-icon",r.setAttribute("aria-hidden","true"),i.disableInlineStyles||Object.assign(r.style,{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:"0",marginRight:"8px",lineHeight:"1",fontStyle:"normal"}),n&&"object"==typeof n&&(1===n.nodeType||11===n.nodeType||"undefined"!=typeof HTMLElement&&n instanceof HTMLElement)&&"function"==typeof n.cloneNode)return r.appendChild(n.cloneNode(!0)),r;if("string"==typeof n&&n.trim()){const e=n.trim(),t={check:pe.success,checkmark:pe.success,success:pe.success,cross:pe.error,error:pe.error,alert:pe.warning,warning:pe.warning,circle:pe.info,info:pe.info}[e.toLowerCase()];if(t){const e=de(t.trim());return e&&r.appendChild(e),r}if(e.startsWith("<svg")&&e.endsWith("</svg>")){const t=de(e);t?(t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false"),t.getAttribute("width")||t.setAttribute("width","18"),t.getAttribute("height")||t.setAttribute("height","18"),r.appendChild(t)):r.textContent=e}else r.textContent=e;return r}const s="string"==typeof o?o.toLowerCase().trim():"";if((!0===n||void 0===n)&&s&&pe[s]){const e=de(pe[s].trim());return e&&r.appendChild(e),r}return null}function me(e,t,n){const o=String(e||"").toLowerCase(),i=o.includes("top"),r=o.includes("left"),s=o.includes("right"),a=String(t||"").toLowerCase().trim();return"fade"===a?"none":"zoom"===a||"scale"===a?"scale(0.75)":"flip"===a?"perspective(600px) rotateX(45deg)":"slide"===a?r?"translateX(-100%)":s?"translateX(100%)":i?"translateY(-100%)":"translateY(100%)":n?!o.includes("center")||i||o.includes("bottom")?i?"translateY(-36px) scale(0.92)":"translateY(36px) scale(0.92)":r?"translateX(-36px) scale(0.92)":s?"translateX(36px) scale(0.92)":"scale(0.85)":"bounce"===a?i?"translateY(-36px) scale(0.9)":"translateY(36px) scale(0.9)":i?"translateY(-20px)":"translateY(20px)"}async function he(e={},t){try{var n;const o=l(),i=document.createElement("div"),r=(null==e?void 0:e.position)||o.defaultPosition,s=String(r).toLowerCase().trim();let a="auto",c="auto",u="auto",d="auto",p="none";s.startsWith("top")?a="20px":(s.startsWith("bottom")||s.includes("below"))&&(c="20px"),s.startsWith("left")?u="20px":s.startsWith("right")?d="20px":"center"===s?(u="50%",a="50%",p="translate(-50%, -50%)"):s.includes("center")?s.includes("left")?(u="20px",a="50%",p="translateY(-50%)"):s.includes("right")?(d="20px",a="50%",p="translateY(-50%)"):s.includes("top")?(a="20px",u="50%",p="translateX(-50%)"):s.includes("bottom")&&(c="20px",u="50%",p="translateX(-50%)"):(d="20px",c="20px"),i.className="toast-emergency",o.disableInlineStyles||Object.assign(i.style,{background:"#333",color:"white",padding:"10px 15px",position:"fixed",top:a,bottom:c,left:u,right:d,transform:p,zIndex:String(o.zIndex+100),borderRadius:"3px",maxWidth:"250px",wordWrap:"break-word",boxShadow:"0 2px 10px rgba(0,0,0,0.3)"});const f=document.createElement("div"),m=document.createElement("span");if(m.className="toast-emergency-message",o.disableInlineStyles||(m.style.display="inline-block"),e.allowHtml)try{const t=A(String(e.message||"Emergency Toast Showing!")),n=document.createElement("div");for(n.innerHTML=t;n.firstChild;)m.appendChild(n.firstChild)}catch(t){m.appendChild(document.createTextNode(String(e.message||"Emergency Toast Showing!")))}else m.textContent=String(e.message||"Emergency Toast Creation Showing!");f.appendChild(m);const h=document.createElement("button");for(h.type="button",h.className="toast-emergency-close",h.setAttribute("aria-label","Close emergency notification"),o.disableInlineStyles||Object.assign(h.style,{float:"right",marginLeft:"10px",fontWeight:"bold",cursor:"pointer",background:"transparent",border:"none",color:"inherit",padding:"0",font:"inherit"}),h.textContent="×",f.appendChild(h);i.firstChild;)i.removeChild(i.firstChild);i.appendChild(f);let y=null;const g=()=>{y&&clearTimeout(y),h.removeEventListener("click",g),i.remove(),"function"==typeof t&&t(i)};h.addEventListener("click",g);const b=Number(null==e?void 0:e.duration)||2500;return y=setTimeout(()=>{h.removeEventListener("click",g),i.remove(),"function"==typeof t&&t(i)},b),"function"==typeof(null===(n=y)||void 0===n?void 0:n.unref)&&y.unref(),i}catch(e){return console.error("Emergency toast creation failed:",e),"function"==typeof t&&t(null),null}}class ye{constructor(e=5,t=50){this.initialSize=Math.max(1,Math.floor(e)),this.maxSize=Math.max(this.initialSize,Math.floor(t)),this.pool=[],this.inUseCount=0;for(let e=0;e<this.initialSize;e++)this.pool.push({element:this._createToastElement(),inUse:!1,id:null})}_createToastElement(){if("undefined"==typeof document)return{className:"toast",setAttribute(){},removeAttribute(){},appendChild(){},removeChild(){},style:{},childNodes:[]};const e=document.createElement("div");return e.className="toast",e.setAttribute("role","alert"),e.setAttribute("aria-live","polite"),e.tabIndex=0,e}acquire(e){if(!e||"string"!=typeof e)throw new Error("Toast ID required for pool allocation");let t=this.pool.find(e=>!e.inUse);!t&&this.pool.length<this.maxSize&&(t={element:this._createToastElement(),inUse:!1,id:null},this.pool.push(t));let n=!1;return t||(t=this.pool[0],n=!0,t.element._cleanupSwipe&&t.element._cleanupSwipe(),t.element._cleanupCloseButton&&t.element._cleanupCloseButton(),t.element._cleanupCTA&&t.element._cleanupCTA(),t.element._cleanupUndo&&t.element._cleanupUndo(),t.element._pauseCleanup&&t.element._pauseCleanup(),t.element._cleanup&&t.element._cleanup(),t.element.parentNode&&t.element.parentNode.removeChild(t.element),t.element=this._createToastElement()),t.element.innerHTML="",t.element.className="toast",t.element.removeAttribute("style"),t.element.setAttribute("role","alert"),t.element.id=`toast-${e}`,t.element._pooledId=e,delete t.element._progressAnimation,delete t.element._pauseCleanup,delete t.element._cleanupSwipe,delete t.element._cleanupCloseButton,delete t.element._cleanupCTA,delete t.element._cleanupUndo,delete t.element._key,delete t.element._cleanup,t.inUse=!0,t.id=e,n||(this.inUseCount+=1),t.element}release(e,t){if(!e&&!t)return;const n=e instanceof HTMLElement?e:null,o="string"==typeof t?t:"string"==typeof e?e:null,i=this.pool.find(e=>n&&e.element===n||o&&e.id===o);i&&i.inUse&&(i.element.parentNode&&i.element.parentNode.removeChild(i.element),i.element=this._createToastElement(),i.inUse=!1,i.id=null,this.inUseCount=Math.max(0,this.inUseCount-1))}getStats(){return{total:this.pool.length,inUse:this.inUseCount,available:this.pool.length-this.inUseCount,utilization:this.pool.length>0?this.inUseCount/this.pool.length*100:0,maxSize:this.maxSize}}clear(){this.pool.forEach(e=>{e.element.parentNode&&e.element.parentNode.removeChild(e.element)}),this.pool=[],this.inUseCount=0}compact(){if(this.pool.length>this.initialSize){const e=this.pool.filter(e=>!e.inUse),t=Math.max(0,e.length-this.initialSize);if(t>0)for(let n=0;n<t;n++){const t=this.pool.indexOf(e[n]);t>-1&&this.pool.splice(t,1)}}}}let ge=null;function be(e=5,t=50){return ge||(ge=new ye(e,t)),ge}function ve(){ge&&(ge.clear(),ge=null)}async function we(e,t){let n;const o="toast";try{if(null!=e&&e.usePool){const e=f(o);n=be().acquire(e),n._pooledId=e}else n=await async function(e,t){const n=document.createElement("div");return n.id=f(t),n}(0,o);return await async function(e,t,n){var o,i,r;const s=l(),a=null!=t&&t.spring?ae(t.spring):null,u=a?a.duration:await async function(e){if("number"==typeof e&&Number.isFinite(e)&&e>=0)return e;if("string"==typeof e){const t=e.trim().toLowerCase();if(t.endsWith("s")&&!t.endsWith("ms")){const e=1e3*parseFloat(t);return Number.isFinite(e)&&e>=0?e:500}const n=parseFloat(t);return Number.isFinite(n)&&n>=0?n:500}return 500}(null==t?void 0:t.animationDuration),d=`${u}ms`,p=a?a.easing:"string"==typeof(null==t?void 0:t.animationEasing)&&t.animationEasing.trim()?t.animationEasing.trim():"ease";a&&(e._spring=a),e._animationType=null==t?void 0:t.animationType;const f="string"==typeof(null==t?void 0:t.className)&&t.className.trim()?` ${t.className.trim()}`:"";e.className=`toast toast-${null!==(o=null==t?void 0:t.type)&&void 0!==o?o:"info"}${f}`;const m="number"==typeof(null==t?void 0:t.borderRadius)?`${t.borderRadius}px`:null==t?void 0:t.borderRadius,h="number"==typeof(null==t?void 0:t.maxWidth)?`${t.maxWidth}px`:null==t?void 0:t.maxWidth,y=a?`${Math.min(300,u)}ms`:d,g=a?"ease":p;s.disableInlineStyles||Object.assign(e.style,{background:null==t?void 0:t.backgroundColor,padding:"12px 16px",marginBottom:"10px",borderRadius:m,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"space-between",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",minWidth:"250px",maxWidth:h,opacity:"0",position:"relative",cursor:"default",boxSizing:"border-box",userSelect:"text",pointerEvents:"auto",transition:`opacity ${y} ${g}, transform ${d} ${p}`,transform:me(null==t?void 0:t.position,null==t?void 0:t.animationType,!!a),zIndex:String(s.zIndex),direction:null!=t&&t.fontDirection&&"auto"!==t.fontDirection?t.fontDirection:void 0});const b="error"===(null==t?void 0:t.type),v=(null==t?void 0:t.role)||(b?"alert":null!==(i=null==t?void 0:t.role)&&void 0!==i?i:"alert"),w=(null==t?void 0:t.ariaLive)||(b?"assertive":"polite");e.setAttribute("role",v),e.setAttribute("aria-live",w),e.tabIndex=0,e._animationDuration=u;const T=document.createElement("span");T.className="toast-message",e._messageSpan=T,"truncate"!==(null==t?void 0:t.wrapText)&&"ellipsis"!==(null==t?void 0:t.wrapText)&&!1!==(null==t?void 0:t.wrapText)&&null!=t&&t.wrapText?s.disableInlineStyles||Object.assign(T.style,{display:"block",whiteSpace:"normal"}):(T.classList.add("is-truncated"),s.disableInlineStyles||Object.assign(T.style,{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",whiteSpace:"normal",overflow:"hidden",textOverflow:"ellipsis"}));const x="number"==typeof(null==t?void 0:t.fontSize)?`${t.fontSize}px`:null==t?void 0:t.fontSize;s.disableInlineStyles||Object.assign(T.style,{flex:"1",padding:null==t?void 0:t.fontPadding,fontFamily:null==t?void 0:t.fontFamily,fontSize:x,fontWeight:null==t?void 0:t.fontWeight,lineHeight:null==t?void 0:t.fontLineHeight,color:null==t?void 0:t.textColor,userSelect:"text",wordBreak:"break-word",overflow:"hidden",textOverflow:"ellipsis",direction:null!=t&&t.fontDirection&&"auto"!==t.fontDirection?t.fontDirection:void 0});const E=!!t.allowHtml,M=null!==(r=t.message)&&void 0!==r?r:"",L=fe(t);if(L&&e.appendChild(L),t.loader||t.showLoader){const e=C(t.loader||{});T.appendChild(e);const n=document.createElement("span");n.className="toast-message-spacer",s.disableInlineStyles||(n.style.display="inline-block",n.style.width="8px"),T.appendChild(n)}if(E&&"string"==typeof M&&M.trim().length>0)try{const e=A(M),t=document.createElement("div");for(t.innerHTML=e;t.firstChild;)T.appendChild(t.firstChild)}catch(e){console.warn("HTML message sanitization failed, falling back to text:",e),T.appendChild(document.createTextNode(String(M)))}else T.appendChild(document.createTextNode(String(M)));T.setAttribute("title",T.textContent||""),e.appendChild(T),null!=t&&t.cta&&"object"==typeof t.cta&&S(e,t,n),null!=t&&t.undo&&k(e,t,n),null!=t&&t.showCloseButton&&_(e,t,n),!1!==(null==t?void 0:t.showProgressBar)&&(null!=t&&t.showProgressBar||void 0!==(null==t?void 0:t.progress))&&N(e,t),!1!==(void 0!==(null==t?void 0:t.swipeToDismiss)?t.swipeToDismiss:s.swipeToDismiss)&&function(e,t){if(!e||"function"!=typeof e.addEventListener)return;let n=0,o=0,i=0,r=0,s=!1,a=!1,u=null,d=!1;const p=()=>{d&&(d=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",h))},f=t=>{if(!t)return;if(void 0!==t.button&&0!==t.button)return;const l=t.target;if(l&&"function"==typeof l.closest&&l.closest("button, a, input, textarea, select, label"))return;let c=t;var p;t.touches&&t.touches.length>0?(c=t.touches[0],u=null!==(p=c.identifier)&&void 0!==p?p:null):u=null,n=c.clientX,o=c.clientY,i=n,r=Date.now(),s=!0,a=!1,e._originalTransition=e.style.transition||"",e.style.transition="none",e.style.userSelect="none",d||"undefined"==typeof window||(d=!0,window.addEventListener("mousemove",m,{passive:!1}),window.addEventListener("mouseup",h,{passive:!0}))},m=t=>{if(!s||!t)return;let r=t;if(t.touches)if(null!==u){for(let e=0;e<t.touches.length;e++)if(t.touches[e].identifier===u){r=t.touches[e];break}}else t.touches.length>0&&(r=t.touches[0]);const d=r.clientX,f=r.clientY,m=d-n,h=f-o;if(!a)if(Math.abs(m)>8&&Math.abs(m)>Math.abs(h))a=!0;else if(Math.abs(h)>8)return s=!1,e.style.userSelect="",void p();if(a){i=d;const n=Math.max(0,1-Math.abs(m)/280);l().disableInlineStyles||c()||(e.style.transform=`translateX(${m}px)`,e.style.opacity=String(n)),t.cancelable&&t.preventDefault()}},h=()=>{if(p(),u=null,!s||!a)return s=!1,void(e.style.userSelect="");s=!1,e.style.userSelect="";const o=i-n,d=Math.max(1,Date.now()-r),f=(d>0?Math.abs(o)/d:0)>=.65&&Math.abs(o)>=50,m=f?50:75;if(Math.abs(o)>=m){var h;const n=o>0?320:-320,i=f?120:180;l().disableInlineStyles||c()||(e.style.transition=`transform ${i}ms ease-out, opacity ${i}ms ease-out`,e.style.transform=`translateX(${n}px)`,e.style.opacity="0"),e._swipeTimeout&&clearTimeout(e._swipeTimeout),e._swipeTimeout=setTimeout(()=>{e._swipeTimeout=null,"function"==typeof t&&t(e)},i),"function"==typeof(null===(h=e._swipeTimeout)||void 0===h?void 0:h.unref)&&e._swipeTimeout.unref()}else if(!l().disableInlineStyles&&!c()){var y;const t=e._spring,n=(null==t?void 0:t.easing)||"cubic-bezier(0.34, 1.56, 0.64, 1)",o=null!=t&&t.duration?Math.min(400,t.duration):200;e.style.transition=`transform ${o}ms ${n}, opacity 200ms ease`,e.style.transform="translateX(0)",e.style.opacity="1",e._snapbackTimer&&clearTimeout(e._snapbackTimer),e._snapbackTimer=setTimeout(()=>{e._snapbackTimer=null,e._originalTransition&&(e.style.transition=e._originalTransition)},o),"function"==typeof(null===(y=e._snapbackTimer)||void 0===y?void 0:y.unref)&&e._snapbackTimer.unref()}};e.addEventListener("touchstart",f,{passive:!0}),e.addEventListener("touchmove",m,{passive:!1}),e.addEventListener("touchend",h,{passive:!0}),e.addEventListener("touchcancel",h,{passive:!0}),e.addEventListener("mousedown",f,{passive:!0}),e._cleanupSwipe=()=>{e._swipeTimeout&&(clearTimeout(e._swipeTimeout),e._swipeTimeout=null),e._snapbackTimer&&(clearTimeout(e._snapbackTimer),e._snapbackTimer=null),p(),e.removeEventListener("touchstart",f),e.removeEventListener("touchmove",m),e.removeEventListener("touchend",h),e.removeEventListener("touchcancel",h),e.removeEventListener("mousedown",f)}}(e,n),(void 0!==(null==t?void 0:t.sound)?t.sound:s.sound)&&H("string"==typeof t.sound?t.sound:(null==t?void 0:t.type)||"info",(null==t?void 0:t.soundPreset)||s.soundPreset||"modern"),I(e)}(n,e,t),n}catch(o){var i;if(null!=e&&e.usePool&&null!==(i=n)&&void 0!==i&&i._pooledId)try{be().release(n,n._pooledId)}catch(e){}return console.warn("toast creation failed with error showing fallback one: ",o),n=await he(e,t),n}}const Te=new Map,xe=new Map;function Ae(e){if(!e||"string"!=typeof e)return"bottom-right";const t=e.toLowerCase().trim();if(!t)return"bottom-right";const n=t.replace(/\bbelow\b/g,"bottom").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-");return{"center-top":"top-center","center-bottom":"bottom-center","center-left":"left-center","center-right":"right-center",top:"top-center",bottom:"bottom-center"}[n]||n}function Ce(e){return`toast-container-${Ae(e)}`}function Se(e){const t=l();e.className="toast-container-base",t.disableInlineStyles||(e.style.position="fixed",e.style.zIndex=String(t.zIndex),e.style.pointerEvents="none",e.style.inset="auto 10px 10px auto",e.style.display="flex",e.style.justifyContent="space-between",e.style.alignItems="center",e.style.flexDirection="column",e.style.overflow="hidden")}async function ke(e={},t){const n=l(),o=Ce((null==e?void 0:e.position)||n.defaultPosition),i=(s=r.targetNode)&&"object"==typeof s&&"function"==typeof s.appendChild?r.targetNode:"undefined"!=typeof document?document.body:null;var s;if(!i)throw new Error("Toast container root is unavailable");if(xe.has(o))return xe.get(o);const a=(async()=>{const n=Te.get(o);if(function(e,t){return!(!e||!t)&&(t===document.body?e.isConnected&&e.ownerDocument===document:"function"==typeof t.contains?t.contains(e):e.isConnected&&e.ownerDocument===document)}(n,i))return n;n&&Te.delete(o);let r=function(e,t){return e?"function"==typeof e.getElementById?e.getElementById(t):"function"==typeof e.querySelector?e.querySelector(`#${t}`):null:null}(i,o);if(r)Se(r),"function"==typeof t&&await t(r,e);else{const n=(null==i?void 0:i.ownerDocument)||("undefined"!=typeof document?document:null);if(!n)throw new Error("Document is unavailable");r=n.createElement("div"),r.id=o,r.setAttribute("role","status"),r.setAttribute("aria-atomic","true"),Se(r),"function"==typeof t&&await t(r,e),i.appendChild(r)}if("function"==typeof i.querySelectorAll){const e=i.querySelectorAll(`#${o}`);if(e.length>1)for(let t=1;t<e.length;t++)try{e[t].remove()}catch(e){}}return Te.set(o,r),r})();xe.set(o,a);try{return await a}finally{xe.delete(o)}}const _e=new Set(["top-left","top-right","bottom-left","bottom-right","top-center","bottom-center","center-top","center-bottom","left-center","right-center","center-left","center-right","top-full-width","bottom-full-width","center"]),Ee=new Set(["top","bottom"]),Me=[..._e,...Ee];async function Le(e,t={}){var n;if(!e||!t||"object"!=typeof t)throw new Error("Invalid container or position!");const o=l(),i=String((null==t?void 0:t.position)||o.defaultPosition||"bottom-right").toLowerCase().trim().replace(/\s+/g,"-");let r=i;var s;if(s=i,_e.has(s)||Ee.has(i)||(console.warn(`Unknown position "${t.position}", defaulting to "bottom-right"`),r="bottom-right"),function(e){if(null!=e&&e.classList)for(let t=0;t<Me.length;t++)e.classList.remove("toast-position-"+Me[t])}(e),null===(n=e.classList)||void 0===n||n.add("toast-position-"+r),l().disableInlineStyles)return;!function(e){e.style.top="auto",e.style.bottom="auto",e.style.left="auto",e.style.right="auto",e.style.transform="none",e.style.maxWidth="none"}(e);const a=function(e){const t=e.toLowerCase().trim(),n="top-full-width"===t||"bottom-full-width"===t;return{hasTop:t.startsWith("top")||t.endsWith("top"),hasBottom:t.startsWith("bottom")||t.endsWith("bottom")||t.includes("below"),hasLeft:t.startsWith("left")||t.endsWith("left"),hasRight:t.startsWith("right")||t.endsWith("right"),hasCenter:t.includes("center"),hasFullWidth:n}}(r);(function(e,t){return!!t.hasFullWidth&&(e.style.maxWidth="100vw",t.hasTop?(e.style.top="10px",e.style.left="10px",e.style.right="10px",!0):!!t.hasBottom&&(e.style.bottom="10px",e.style.left="10px",e.style.right="10px",!0))})(e,a)||function(e,t){return!!t.hasCenter&&(!t.hasTop||t.hasLeft||t.hasRight?!t.hasBottom||t.hasLeft||t.hasRight?!t.hasLeft||t.hasTop||t.hasBottom?!t.hasRight||t.hasTop||t.hasBottom?!(t.hasLeft||t.hasRight||t.hasTop||t.hasBottom)&&(e.style.top="50%",e.style.left="50%",e.style.transform="translate(-50%, -50%)",!0):(e.style.right="10px",e.style.top="50%",e.style.transform="translateY(-50%)",!0):(e.style.left="10px",e.style.top="50%",e.style.transform="translateY(-50%)",!0):(e.style.bottom="10px",e.style.left="50%",e.style.transform="translateX(-50%)",!0):(e.style.top="10px",e.style.left="50%",e.style.transform="translateX(-50%)",!0))}(e,a)||function(e,t){t.hasBottom?e.style.bottom="10px":t.hasTop?e.style.top="10px":e.style.bottom="10px",t.hasRight?e.style.right="10px":t.hasLeft?e.style.left="10px":(e.style.left="50%",e.style.transform="translateX(-50%)")}(e,a)}class Ne{constructor(e,t){this.callback="function"==typeof e?e:()=>{};const n=t===1/0,o=Number.isFinite(t)&&t>=0?t:n?1/0:0;this.delay=o,this.remaining=o,this.startTime=null,this.timeoutId=null,this.isPaused=!1,this.isCompleted=!1,this.isInfinite=n}start(){var e;return this.isCompleted||this.timeoutId||this.isInfinite||(this.isPaused=!1,this.startTime=Date.now(),this.timeoutId=setTimeout(()=>{this.isCompleted=!0,this.timeoutId=null;try{this.callback()}catch(e){console.error("PausableTimer callback error:",e)}},this.remaining),"function"==typeof(null===(e=this.timeoutId)||void 0===e?void 0:e.unref)&&this.timeoutId.unref()),this}pause(){if(this.isPaused||!this.timeoutId||this.isCompleted)return this;clearTimeout(this.timeoutId),this.timeoutId=null;const e=Math.max(0,Date.now()-this.startTime);return this.remaining=Math.min(this.delay,Math.max(0,this.remaining-e)),this.isPaused=!0,this}resume(){return!this.isPaused||this.isCompleted||(this.isPaused=!1,this.start()),this}clear(){return this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null),this.isCompleted=!0,this}getRemainingTime(){return this.isCompleted?0:this.isPaused?this.remaining:this.timeoutId?Math.max(0,this.remaining-(Date.now()-this.startTime)):this.delay}}class Ie{constructor(){this.channel=null,this.tabId=this._generateTabId(),this.isLeadTab=!1,this.leaderTimer=null,this.listeners=new Map,this.supportsBroadcastChannel="undefined"!=typeof BroadcastChannel,this.supportsBroadcastChannel&&this._initBroadcastChannel()}_generateTabId(){const e=Date.now().toString(36);let t="";if("undefined"!=typeof crypto&&"function"==typeof crypto.getRandomValues)try{const e=new Uint32Array(2);crypto.getRandomValues(e),t=`${e[0].toString(36)}${e[1].toString(36)}`.slice(0,9)}catch(e){}return t||(t=Math.floor(9007199254740991*Math.random()).toString(36).slice(0,9)),`tab-${e}-${t}`}_initBroadcastChannel(){try{var e,t;this.channel=new BroadcastChannel("toast-notifications"),null===(e=(t=this.channel).unref)||void 0===e||e.call(t),this.channel.onmessage=e=>this._handleMessage(e.data),this._becomeLeadIfNeeded()}catch(e){console.warn("[Toast] BroadcastChannel initialization failed:",e),this.supportsBroadcastChannel=!1}}_becomeLeadIfNeeded(){var e,t;this.channel&&(this.broadcast("sync-request","",{}),this.leaderTimer=setTimeout(()=>{this.leaderTimer=null,this.isLeadTab||(this.isLeadTab=!0,this.broadcast("leader-elected","",{tabId:this.tabId}))},1e3),null===(e=(t=this.leaderTimer).unref)||void 0===e||e.call(t))}broadcast(e,t="",n={}){if(!this.supportsBroadcastChannel||!this.channel)return;let o=t,i=n;"object"==typeof t&&null!==t&&0===Object.keys(n).length&&(i=t,o="");const r={type:e,toastId:"string"==typeof o?o:String(null!=o?o:""),payload:i&&"object"==typeof i?i:{},timestamp:Date.now(),tabId:this.tabId};try{this.channel.postMessage(r)}catch(e){console.warn("[Toast] Failed to broadcast message:",e)}}_handleMessage(e){if(!e||e.tabId===this.tabId)return;const{type:t,toastId:n,payload:o}=e;if("leader-elected"===t)return this.leaderTimer&&(clearTimeout(this.leaderTimer),this.leaderTimer=null),void(this.isLeadTab=!1);var i,r;"sync-response"===t&&this.leaderTimer&&(clearTimeout(this.leaderTimer),this.leaderTimer=null),"sync-request"===t&&this.isLeadTab?this.broadcast("sync-response","all-toasts",{active:Array.from((null===(i=this._getActiveToasts)||void 0===i?void 0:i.call(this))||[]),queue:(null===(r=this._getQueuedToasts)||void 0===r?void 0:r.call(this))||[]}):(this.listeners.get(t)||[]).forEach(i=>{try{i({toastId:n,payload:o,message:e})}catch(e){console.warn(`[Toast] Listener error for ${t}:`,e)}})}on(e,t){if("function"!=typeof t)throw new Error("Callback must be a function");return this.listeners.has(e)||this.listeners.set(e,[]),this.listeners.get(e).push(t),()=>{const n=this.listeners.get(e)||[],o=n.indexOf(t);o>-1&&n.splice(o,1)}}registerActiveToastsGetter(e){this._getActiveToasts=e}registerQueuedToastsGetter(e){this._getQueuedToasts=e}isSupported(){return this.supportsBroadcastChannel}getTabId(){return this.tabId}isLeadingTab(){return this.isLeadTab}destroy(){if(this.leaderTimer&&(clearTimeout(this.leaderTimer),this.leaderTimer=null),this.channel)try{this.channel.close()}catch(e){console.warn("[Toast] Failed to close BroadcastChannel:",e)}this.listeners.clear(),this.channel=null}}let Be=null;function Pe(){if(!Be&&(Be=new Ie,"undefined"!=typeof window)){const e=()=>{var e;null===(e=Be)||void 0===e||e.destroy(),Be=null};window.addEventListener("pagehide",e),window.addEventListener("beforeunload",e)}return Be}function ze(){Be&&(Be.destroy(),Be=null)}const Oe={error:85,warning:70,info:40,success:30},Ve=["error","critical","severe","emergency","failure","fatal","crash","urgent","important","attention","immediate","now","fast","deadline","due","timeout","expired","overdue","security","breach","attack","unauthorized","hack","lost","missing","offline","down","unavailable","outage","downtime","broken","malfunction","defect","bug","data loss","corruption","invalid","wrong","incorrect","blocked","stopped","halted","paused","interrupted","exceeded","limit","quota","full","capacity","cannot","unable","failed","rejected","denied","blocked","invalid","expired","credentials","password","auth","payment","billing","charge","transaction","money","account","profile","settings","preferences"].map(e=>({keyword:e,regex:new RegExp(`\\b${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"i")})),qe=["success","completed","finished","done","ready","info","information","note","notice","reminder","progress","processing","loading","saving","uploading","test","demo","sample","example","placeholder","updated","changed","modified","edited","created","connected","disconnected","online","offline"].map(e=>({keyword:e,regex:new RegExp(`\\b${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`,"i")}));function Re(e){if(!e||"object"!=typeof e)return{score:50,breakdown:{base:50},keywords:[]};const{type:t,message:n,duration:o}=e,i={},r=[];let s=50;const a=Oe[t]||50;i.type=a,s+=.6*(a-50);const l="string"==typeof n?n:String(null!=n?n:""),c=l.toLowerCase();let u=0;for(let e=0;e<Ve.length;e++){const{keyword:t,regex:n}=Ve[e];n.test(l)&&(r.push(t),u+=2)}for(let e=0;e<qe.length;e++){const{keyword:t,regex:n}=qe[e];n.test(l)&&(r.push(t),u-=1)}if(i.urgency=Math.min(Math.max(u,-10),20),s+=i.urgency,o===1/0||0===o)i.duration=30,s+=15;else if("number"==typeof o&&Number.isFinite(o)&&o>0){const e=Math.max(0,30-o/1e3);i.duration=Math.round(e),s+=.5*e}const d=c.length;if(d>0){const e=Math.min(10,Math.floor(d/50));i.length=-e,s-=e}const p=(l.match(/!/g)||[]).length,f=Math.min(5,p);i.emphasis=f,s+=f;const m=(l.match(/\b[A-Z]{3,}\b/g)||[]).length,h=Math.min(5,m);return i.caps=h,s+=h,s=Math.max(0,Math.min(100,Math.round(s))),{score:s,breakdown:i,keywords:[...new Set(r)]}}function De(e){if(!e||"string"!=typeof e)return["unknown"];const t=e.toLowerCase(),n=[];return/\b(security|auth|password|unauthorized|breach|hack)\b/i.test(t)&&n.push("security"),/\b(performance|slow|timeout|load|latency|responsive)\b/i.test(t)&&n.push("performance"),/\b(user|profile|account|preferences|settings|avatar)\b/i.test(t)&&n.push("user"),/\b(system|server|database|network|connection|backend)\b/i.test(t)&&n.push("system"),/\b(payment|transaction|billing|charge|order|cart)\b/i.test(t)&&n.push("business"),/\b(ui|interface|click|scroll|mobile)\b/i.test(t)&&n.push("ui"),0===n.length&&n.push("general"),n}function Fe(e,t){if(!e||!t||"number"!=typeof e.x||"number"!=typeof t.x||"number"!=typeof e.y||"number"!=typeof t.y)return 0;const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)}function je(e,t){const n=Number(e),o=Number(t);return!Number.isFinite(n)||!Number.isFinite(o)||o<0?0:0===o?0===n?0:1/0:Math.abs(n)/o}function $e(e,t,n=.5,o=50){const i=Number(e),r=Number(t);return!(!Number.isFinite(i)||!Number.isFinite(r))&&i>=n&&Math.abs(r)>=o}function We(e){const t=[];if(e.touches&&e.touches.length>0)for(let n=0;n<e.touches.length;n++){const o=e.touches[n];t.push({x:o.clientX,y:o.clientY,id:o.identifier,time:Date.now()})}else if(e.changedTouches&&e.changedTouches.length>0)for(let n=0;n<e.changedTouches.length;n++){const o=e.changedTouches[n];t.push({x:o.clientX,y:o.clientY,id:o.identifier,time:Date.now()})}return t}function He(e,t=20){if(0===e.startDistance||0===e.currentDistance)return{isPinch:!1,scale:1,direction:"none"};const n=e.currentDistance-e.startDistance;return{isPinch:Math.abs(n)>=t,scale:e.currentDistance/e.startDistance,direction:n>0?"out":"in",distanceChange:n}}function Ue(e,t={}){const{onFlick:n,onPinch:i,onSwipe:r,flickVelocityThreshold:s=.5,swipeVelocityThreshold:a=.3,swipeDistanceThreshold:l=50,pinchSensitivity:c=20}=t;let u=null,d=!1;const p=e=>{d=!0,u=function(e){const t=We(e);return{touches:t,startTouches:t.map(e=>o({},e)),startTime:Date.now(),startDistance:t.length>=2?Fe(t[0],t[1]):0,currentDistance:t.length>=2?Fe(t[0],t[1]):0}}(e)},f=e=>{d&&u&&(u=function(e,t){const n=We(t);return o(o({},e),{},{touches:n,currentDistance:n.length>=2?Fe(n[0],n[1]):e.currentDistance})}(u,e))},m=e=>{if(!d||!u)return;d=!1;const t=He(u,c);t.isPinch&&"function"==typeof i&&i(t);const o=function(e){if(0===e.startTouches.length||0===e.touches.length)return{distance:0,velocity:0,direction:"none",duration:0};const t=e.startTouches[0],n=(e.touches.find(e=>e.id===t.id)||e.touches[0]).x-t.x,o=Date.now()-e.startTime;return{distance:n,velocity:je(n,o),direction:n>0?"right":"left",duration:o}}(u);$e(o.velocity,o.distance,s,30)&&"function"==typeof n&&n(o);const p=function(e,t=.3,n=50){return e.velocity>=t||Math.abs(e.distance)>=n}(o,a,l);p&&"function"==typeof r&&r(o),u=null};return{attach(){e&&"function"==typeof e.addEventListener&&(e.addEventListener("touchstart",p,{passive:!0}),e.addEventListener("touchmove",f,{passive:!0}),e.addEventListener("touchend",m,{passive:!0}),e.addEventListener("touchcancel",m,{passive:!0}))},detach(){e&&"function"==typeof e.removeEventListener&&(e.removeEventListener("touchstart",p),e.removeEventListener("touchmove",f),e.removeEventListener("touchend",m),e.removeEventListener("touchcancel",m))},getState:()=>u}}const Ge=new Map,Ye=new Map,Xe=[];let Qe=0,Ke=0;function Je(){return{activeCount:Ge.size,queueDepth:Xe.length,visibleCount:Qe,droppedCount:Ke,timestamp:Date.now()}}function Ze(){const e=l();if("function"==typeof e.onMetrics)try{e.onMetrics(Je())}catch(e){console.error("onMetrics callback error:",e)}}const et=Pe();function tt(e){var t,n;if("number"==typeof(null==e||null===(t=e.options)||void 0===t?void 0:t.priority)&&Number.isFinite(e.options.priority))return e.options.priority;const o=null==e||null===(n=e.priority)||void 0===n?void 0:n.score;if("number"==typeof o&&Number.isFinite(o))return o;const i=l();if("function"==typeof i.priorityScorer)try{var r,s,a;const t=i.priorityScorer({type:(null==e||null===(r=e.options)||void 0===r?void 0:r.type)||"info",message:(null==e||null===(s=e.options)||void 0===s?void 0:s.message)||"",duration:null==e||null===(a=e.options)||void 0===a?void 0:a.duration,options:null==e?void 0:e.options});if("number"==typeof t&&Number.isFinite(t))return t;if(t&&"number"==typeof t.score&&Number.isFinite(t.score))return t.score}catch(e){console.warn("[Toast] Custom priorityScorer error, falling back to built-in:",e)}return Re(null==e?void 0:e.options).score}function nt(e){if(!e||!e.children)return;if("true"!==e.getAttribute("data-stacked"))return;if(!e._stackedInitialized&&"function"==typeof e.addEventListener){e._stackedInitialized=!0;const t=()=>{e._isExpanded=!0,nt(e)},n=()=>{e._isExpanded=!1,nt(e)},o=()=>{e._isExpanded=!0,nt(e)},i=t=>{e.contains(t.relatedTarget)||(e._isExpanded=!1,nt(e))};e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),e.addEventListener("focusin",o),e.addEventListener("focusout",i);let r=null;r=Ue(e,{onPinch:t=>{"out"!==t.direction||e._isExpanded?"in"===t.direction&&e._isExpanded&&(e._isExpanded=!1,nt(e)):(e._isExpanded=!0,nt(e))}}),r.attach(),e._stackedCleanup=()=>{var s,a;e.removeEventListener("mouseenter",t),e.removeEventListener("mouseleave",n),e.removeEventListener("focusin",o),e.removeEventListener("focusout",i),null===(s=r)||void 0===s||null===(a=s.detach)||void 0===a||a.call(s),e._stackedInitialized=!1}}if(!e.children||0===e.children.length)return;const t=Array.from(e.children),n=t.length,o=Boolean(e._isExpanded),i=Boolean(e.id&&e.id.includes("top"));t.forEach((e,t)=>{const r=n-1-t,s=o?"expanded":r>=3?"overflow":String(r);if("function"==typeof e.setAttribute&&e.setAttribute("data-stacked-depth",s),!l().disableInlineStyles)if(e.style.transition="transform 240ms cubic-bezier(0.16, 1, 0.3, 1), margin 240ms cubic-bezier(0.16, 1, 0.3, 1), opacity 240ms ease",o)e.style.transform="none",e.style.marginTop="0px",e.style.marginBottom="10px",e.style.opacity="1",e.style.zIndex=String(100+t),e.style.pointerEvents="auto";else if(0===r)e.style.transform="scale(1)",e.style.marginTop="0px",e.style.marginBottom="0px",e.style.opacity="1",e.style.zIndex="30",e.style.pointerEvents="auto";else if(1===r){const t=i?10:-10;e.style.transform=`scale(0.95) translateY(${t}px)`,e.style.marginTop="-55px",e.style.marginBottom="0px",e.style.opacity="0.9",e.style.zIndex="20",e.style.pointerEvents="auto"}else if(2===r){const t=i?20:-20;e.style.transform=`scale(0.90) translateY(${t}px)`,e.style.marginTop="-55px",e.style.marginBottom="0px",e.style.opacity="0.75",e.style.zIndex="10",e.style.pointerEvents="auto"}else{const t=i?30:-30;e.style.transform=`scale(0.85) translateY(${t}px)`,e.style.marginTop="-55px",e.style.marginBottom="0px",e.style.opacity="0",e.style.zIndex="1",e.style.pointerEvents="none"}})}async function ot(e={}){try{const n=function(e={}){const t=e&&"object"==typeof e?e:{};return void 0!==t.id&&null!==t.id&&""!==t.id?String(t.id):`${String(t.type||"info").trim().toLowerCase()}|${function(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n);return t>>>0}(String(t.message||"")).toString(16)}|${Ae(t.position||"bottom-right")}`}(e);if(Ge.has(n)){var t;const o=Ge.get(n);if(!o)throw new Error(`Active toast with key ${n} not found`);return o.count++,null===(t=o.timer)||void 0===t||t.clear(),o.timer=st(o.toast,e),await at(o),await pt(o),Ze(),!e.fromSync&&l().syncTabs&&et.isSupported()&&et.broadcast("update",n,{count:o.count}),n}if(Ye.has(n)){const e=Ye.get(n);if(!e)throw new Error(`Pending toast with key ${n} not found`);return e.count++,n}const i={options:e,count:1,rafId:0};return Ye.set(n,i),i.rafId=requestAnimationFrame(async()=>{const e=Ye.get(n);if(e){if(Ye.delete(n),Qe>=l().maxVisible){var t,i,r;const a={options:e.options,key:n,count:e.count},c=null!==(t=l().maxQueueSize)&&void 0!==t?t:100;if(c<=0)return Ke++,void Ze();const u=Xe.find(e=>e.key===n);var s;if(u)return u.count+=e.count,"number"==typeof(null===(s=e.options)||void 0===s?void 0:s.priority)&&(u.options=o(o({},u.options),e.options),u.priority=Re(u.options)),void Ze();const d=l().aiPrioritization||(null===(i=e.options)||void 0===i?void 0:i.aiPrioritization)||"number"==typeof(null===(r=e.options)||void 0===r?void 0:r.priority)||Xe.some(e=>{var t,n;return(null==e||null===(t=e.options)||void 0===t?void 0:t.aiPrioritization)||"number"==typeof(null==e||null===(n=e.options)||void 0===n?void 0:n.priority)});if(d&&(a.priority=Re(e.options)),Xe.length>=c){if(d){const e=tt(a);let t=0,n=tt(Xe[0]);for(let e=1;e<Xe.length;e++){const o=tt(Xe[e]);o<n&&(t=e,n=o)}if(e<=n)return Ke++,void Ze();Xe.splice(t,1)}else Xe.shift();Ke++}return Xe.push(a),d&&Xe.sort((e,t)=>tt(t)-tt(e)),Ze(),void await dt()}try{await it(e.options,n,e.count)}catch(e){console.error("showToast failed:",e)}}}),!e.fromSync&&l().syncTabs&&et.isSupported()&&et.broadcast("create",n,{options:e}),n}catch(e){console.error("showToast failed:",e)}}async function it(e,t,n){try{if(!e||"object"!=typeof e)throw new TypeError("options must be an object");Qe++;const o=await ke(e,Le);if(!o)throw new Error("Failed to create toast container");const i=await we(e,lt);if(!i)throw new Error("Toast element creation failed");const r=document.createElement("div");r.className="toast-outer-wrapper",l().disableInlineStyles||Object.assign(r.style,{position:"relative",display:"inline-block",overflow:"visible",marginBottom:"10px",zIndex:"0",width:"100%",pointerEvents:"auto"});const s=document.createElement("div");s.className="toast-inner-wrapper",l().disableInlineStyles||Object.assign(s.style,{position:"relative",overflow:"hidden",zIndex:"1"}),s.appendChild(i),r.appendChild(s),o.id.includes("toast-container-")&&(o.appendChild(r),e.stacked&&o.setAttribute("data-stacked","true"),"true"===o.getAttribute("data-stacked")&&nt(o)),I(i);const a=!1!==e.pauseOnHover&&(!0===e.pauseOnHover||!!e.cta||Boolean(l().pauseOnHover)),c={outer:r,toast:i,options:e,count:Math.max(1,Math.floor(null!=n?n:0)),pauseOnHover:a};Ge.set(t,c),i._key=t,Ze(),c.count>1&&await pt(c),c.timer=st(i,e),await at(c)}catch(t){console.error("Something went wrong: ",t),Qe=Math.max(0,Qe-1),Ze(),(document.querySelector('[id^="toast-container-"]')||document.body).appendChild(await he(e,lt))}}et.registerActiveToastsGetter(()=>Array.from(Ge.keys())),et.registerQueuedToastsGetter(()=>Xe.map(e=>({key:e.key,options:e.options,count:e.count}))),et.isSupported()&&"undefined"!=typeof window&&(et.on("create",({toastId:e,payload:t})=>{l().syncTabs&&e&&t&&!Ge.has(e)&&!Ye.has(e)&&ot(o(o({},t.options),{},{fromSync:!0}))}),et.on("update",({toastId:e,payload:t})=>{if(l().syncTabs&&e&&t&&Ge.has(e)){const n=Ge.get(e);n&&n.count!==t.count&&(n.count=t.count,pt(n))}}),et.on("dismiss",({toastId:e})=>{l().syncTabs&&e&&(Ge.has(e)||Ye.has(e))&&ct(e,!0)}),et.on("sync-response",({payload:e})=>{if(l().syncTabs&&e&&Array.isArray(e.queue))for(const t of e.queue)null==t||!t.options||Ge.has(t.key)||Ye.has(t.key)||ot(o(o({},t.options),{},{fromSync:!0}))}));const rt=async function(){try{if(0===Ge.size){if(Ye.size>0){const[e,t]=Array.from(Ye.entries()).at(-1);return null!=t&&t.rafId&&cancelAnimationFrame(t.rafId),Ye.delete(e),void Ze()}return Xe.length>0?(Xe.pop(),void Ze()):void 0}let e=null;const t=Array.from(Ge.values());if(t.length>0){const n=t.at(-1);e=n.toast||n.outer&&n.outer.querySelector('[id^="toast-"]')}if(e||document.querySelectorAll('[id^="toast-container-"]').forEach(t=>{const n=Array.from(t.children||[]);if(0===n.length)return;const o=n.at(-1);o&&(e=o.querySelector('[id^="toast-"]')||o)}),!e)return;const n=e._key?e:e.querySelector('[id^="toast-"]')||e;await lt(n)}catch(e){console.error("dismissMostRecent failed:",e)}};function st(e,t){const n=Number(null==t?void 0:t.duration);if((null==t?void 0:t.duration)===1/0||"number"==typeof(null==t?void 0:t.duration)&&(null==t?void 0:t.duration)<=0)return null;const o=Number.isFinite(n)&&n>0?n:2500,i=new Ne(async()=>await lt(e),o+5);return i.start(),i}async function at(e){var t,n;if(!e.pauseOnHover||!e.outer||!e.timer)return;null===(t=(n=e.outer)._pauseCleanup)||void 0===t||t.call(n);const{outer:o,timer:i,toast:r}=e,s=()=>{if(null!=r&&r._progressAnimation)try{r._progressAnimation.pause()}catch(e){}else if(null!=r&&r._progressBar)try{if(r._progressBar._isIndeterminate)r._progressBar.style.animationPlayState="paused";else if(r._progressBar._isManualProgress);else{const e=window.getComputedStyle(r._progressBar).width;r._progressBar._pausedWidth=e,r._progressBar.style.transition="none",r._progressBar.style.width=e}}catch(e){}},a=()=>{if(null!=r&&r._progressAnimation)try{r._progressAnimation.play()}catch(e){}else if(null!=r&&r._progressBar)try{if(r._progressBar._isIndeterminate)r._progressBar.style.animationPlayState="running";else if(r._progressBar._isManualProgress);else if(r._progressBar._pausedWidth){var e,t;const n=null!==(e=null===(t=i.getRemainingTime)||void 0===t?void 0:t.call(i))&&void 0!==e?e:1e3,o=r._progressBar._isReverse,s=r._progressBar._finalWidth||"100%";r._progressBar.style.transition=`width ${Math.max(0,n)}ms linear`,r._progressBar.style.width=o?s:"0%",r._progressBar._pausedWidth=null}}catch(e){}},l=()=>{var e;i.pause(),s(),null==r||null===(e=r._pauseUndo)||void 0===e||e.call(r),null==r||r.classList.add("toast-paused")},c=()=>{var e;i.resume(),a(),null==r||null===(e=r._resumeUndo)||void 0===e||e.call(r),null==r||r.classList.remove("toast-paused")},u=e=>{var t;e.target.matches("[tabindex], div, span, button, a")&&(i.pause(),s(),null==r||null===(t=r._pauseUndo)||void 0===t||t.call(r),null==r||r.classList.add("toast-paused"))},d=e=>{var t;o.contains(e.relatedTarget)||(i.resume(),a(),null==r||null===(t=r._resumeUndo)||void 0===t||t.call(r),null==r||r.classList.remove("toast-paused"))};o.addEventListener("mouseenter",l),o.addEventListener("mouseleave",c),o.addEventListener("focusin",u),o.addEventListener("focusout",d),o._pauseCleanup=()=>{o.removeEventListener("mouseenter",l),o.removeEventListener("mouseleave",c),o.removeEventListener("focusin",u),o.removeEventListener("focusout",d)}}async function lt(e){if(null!=e&&e._key)return ct(e._key)}async function ct(e,t=!1){try{var n,o,i,r,s,a,u,d,p,f,m,h,y,g,b,v,w,T,x,A,C;if(!e)return;!t&&l().syncTabs&&et.isSupported()&&et.broadcast("dismiss",e,{});const L=Ye.get(e);if(L)return cancelAnimationFrame(L.rafId),Ye.delete(e),void Ze();const N=Xe.findIndex(t=>t.key===e);if(-1!==N)return Xe.splice(N,1),void Ze();const I=Ge.get(e);if(!I)return;if(null===(n=I.timer)||void 0===n||n.clear(),null===(o=I.outer)||void 0===o||null===(i=o._pauseCleanup)||void 0===i||i.call(o),null===(r=I.toast)||void 0===r||null===(s=r._cleanupCloseButton)||void 0===s||s.call(r),null===(a=I.toast)||void 0===a||null===(u=a._cleanupCTA)||void 0===u||u.call(a),null===(d=I.toast)||void 0===d||null===(p=d._cleanupUndo)||void 0===p||p.call(d),null===(f=I.toast)||void 0===f||null===(m=f._cleanupSwipe)||void 0===m||m.call(f),null===(h=I.toast)||void 0===h||null===(y=h._cleanup)||void 0===y||y.call(h),null!==(g=I.toast)&&void 0!==g&&g._progressAnimation){try{I.toast._progressAnimation.cancel()}catch(e){}I.toast._progressAnimation=null}const B=null===(b=I.outer)||void 0===b?void 0:b.querySelector(".toast-count-badge");null!=B&&B._scaleTimer&&(clearTimeout(B._scaleTimer),B._scaleTimer=null);const P=null===(v=I.toast)||void 0===v?void 0:v.querySelector("button, a");null==P||null===(w=P._cleanup)||void 0===w||w.call(P),Ge.delete(e),Qe=Math.max(0,Qe-1),Ze(),B&&B.remove();const z=null!==(T=null===(x=I.toast)||void 0===x?void 0:x._animationDuration)&&void 0!==T?T:400,O=Math.min(z,300);if(I.toast){if(!l().disableInlineStyles){var S,k,_,E;const e=String((null===(S=I.options)||void 0===S?void 0:S.position)||(null===(k=I.outer)||void 0===k||null===(k=k.parentElement)||void 0===k?void 0:k.id)||"").toLowerCase(),t=e.includes("top"),n=e.includes("left"),o=e.includes("right"),i=String((null===(_=I.options)||void 0===_?void 0:_.animationType)||"").toLowerCase().trim();let r="translateY(20px)";const s=null===(E=I.toast)||void 0===E?void 0:E._spring;c()?(I.toast.style.transition="none",I.toast.style.opacity="0"):("fade"===i?r="none":"zoom"===i||"scale"===i?r="scale(0.75)":"flip"===i?r="perspective(600px) rotateX(-45deg)":"slide"===i?r=n?"translateX(-100%)":o?"translateX(100%)":t?"translateY(-100%)":"translateY(100%)":"bounce"===i?r=t?"translateY(-36px) scale(0.9)":"translateY(36px) scale(0.9)":s&&(r=t?"translateY(-28px) scale(0.94)":"translateY(28px) scale(0.94)"),I.toast.style.transition=`opacity ${O}ms ease-in, transform ${O}ms ease-in`,I.toast.style.opacity="0",I.toast.style.transform=r)}I.toast.classList.remove("active")}const V=null===(A=I.outer)||void 0===A?void 0:A.parentElement;if(await async function(e,t,n=400){return e?new Promise(o=>{var i;let r=!1,s=null;const a=t||e.firstElementChild||e,l=()=>{var t;if(r)return;r=!0,s&&(clearTimeout(s),s=null);try{var n;null==a||null===(n=a.removeEventListener)||void 0===n||n.call(a,"transitionend",u,!0)}catch(e){}const i=(null===(t=e.querySelector)||void 0===t?void 0:t.call(e,".toast"))||e;if(null!=i&&i._pooledId)try{be().release(i,i._pooledId)}catch(e){}!async function(e){if(!e)return!0;try{if("function"==typeof e.remove)return e.remove(),!0}catch(e){}try{if(e.parentNode)return e.parentNode.removeChild(e),!0}catch(e){}}(e),o()};if(c()||n<=0)return void l();const u=e=>{try{if(e.target!==a)return;("transform"===e.propertyName||!a.style.transform&&"opacity"===e.propertyName)&&l()}catch(e){console.error("removeWithTransition error:",e)}};if(!a)return l();try{a.addEventListener("transitionend",u,!0)}catch(e){console.error("removeWithTransition error:",e)}s=setTimeout(l,n+100),"function"==typeof(null===(i=s)||void 0===i?void 0:i.unref)&&s.unref()}):Promise.resolve()}(I.outer,I.toast,O),V&&0===V.children.length&&null!==(C=V.id)&&void 0!==C&&C.startsWith("toast-container-"))try{var M;null===(M=V._stackedCleanup)||void 0===M||M.call(V),function(e){if(!e)return;const t="string"==typeof e&&e.startsWith("toast-container-")?e:Ce(e);Te.delete(t),xe.delete(t)}(V.id),V.remove()}catch(e){}else V&&"true"===V.getAttribute("data-stacked")&&nt(V);await dt()}catch(e){console.error("Closing Toast failed!: ",e)}}let ut=!1;async function dt(){if(!ut){ut=!0;try{const e=l();for((e.aiPrioritization||Xe.some(e=>{var t,n;return(null===(t=e.options)||void 0===t?void 0:t.aiPrioritization)||"number"==typeof(null===(n=e.options)||void 0===n?void 0:n.priority)}))&&Xe.length>1&&Xe.sort((e,t)=>tt(t)-tt(e));Qe<e.maxVisible&&Xe.length;){const e=Xe.shift();if(Ge.has(e.key)){const t=Ge.get(e.key);t.count+=e.count,await pt(t),Ze();continue}await it(e.options,e.key,e.count)}Ze()}finally{ut=!1}}}async function pt({outer:e,count:t}){if(!(e&&e instanceof HTMLElement))throw new Error("updateBadge: outer must be a valid HTMLElement");if(t<2){const t=e.querySelector(".toast-count-badge");return void(t&&t.remove())}let n=e.querySelector(".toast-count-badge");n||(n=document.createElement("span"),n.className="toast-count-badge",n.setAttribute("aria-label",`${t} identical notifications`),l().disableInlineStyles||Object.assign(n.style,{position:"absolute",top:"6px",right:"6px",backgroundColor:"#f44336",color:"#fff",borderRadius:"50%",minWidth:"20px",height:"20px",fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center",border:"2px solid #fff",boxShadow:"0 2px 6px rgba(0,0,0,0.3)",zIndex:"2",pointerEvents:"none",transition:"transform 150ms ease"}),e.appendChild(n)),n.textContent=t>99?"99+":String(t);try{var o;c()||(n._scaleTimer&&clearTimeout(n._scaleTimer),n.style.transform="scale(1.2)",n._scaleTimer=setTimeout(()=>{n.style.transform="scale(1)",n._scaleTimer=null},150),"function"==typeof(null===(o=n._scaleTimer)||void 0===o?void 0:o.unref)&&n._scaleTimer.unref())}catch(e){console.error("updateBadge animation error:",e)}}async function ft(e,t={}){if(!e||"object"!=typeof t||null===t)return;if(Ye.has(e)){const n=Ye.get(e);return void(n.options=o(o({},n.options),t))}const n=Xe.find(t=>t.key===e);if(n)return void(n.options=o(o({},n.options),t));const i=Ge.get(e);if(!i||!i.toast)return;const r=o({},i.options);i.options=o(o({},i.options),t);const s=i.toast,a=s._messageSpan||s.querySelector(".toast-message")||s.querySelector("span:not(.toast-count-badge)");if(void 0!==t.message){var c;const e=String(null!==(c=t.message)&&void 0!==c?c:""),n=void 0!==t.allowHtml?Boolean(t.allowHtml):Boolean(i.options.allowHtml),o=("success"===t.type||"error"===t.type)&&!0!==t.showLoader;if(a){const i=a.querySelector(".toast-loader");if(a.innerHTML="",i&&!1!==t.showLoader&&null!==t.loader&&!o){a.appendChild(i);const e=document.createElement("span");e.style.display="inline-block",e.style.width="8px",a.appendChild(e)}if(n&&e.trim().length>0)try{const t=A(e),n=document.createElement("div");for(n.innerHTML=t;n.firstChild;)a.appendChild(n.firstChild)}catch(t){a.appendChild(document.createTextNode(e))}else a.appendChild(document.createTextNode(e));a.setAttribute("title",a.textContent||"")}}const u=("success"===t.type||"error"===t.type)&&!0!==t.showLoader;if(!1===t.showLoader||null===t.loader||u){const e=null==a?void 0:a.querySelector(".toast-loader");e&&(e.nextSibling&&"SPAN"===e.nextSibling.nodeName&&e.nextSibling.remove(),e.remove())}else if((!0===t.showLoader||t.loader&&"object"==typeof t.loader)&&a&&!a.querySelector(".toast-loader")){const e=C(t.loader||{});a.insertBefore(e,a.firstChild);const n=document.createElement("span");n.style.display="inline-block",n.style.width="8px",a.insertBefore(n,e.nextSibling)}if(t.type){const e=String(t.type).toLowerCase().trim();s.className=s.className.replace(/\btoast-(info|success|error|warning)\b/g,`toast-${e}`);const n="error"===e;if(t.role?s.setAttribute("role",t.role):s.setAttribute("role","alert"),s.setAttribute("aria-live",t.ariaLive||(n?"assertive":"polite")),!t.backgroundColor){const t={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"};t[e]&&(s.style.background=t[e])}}if(void 0!==t.icon||void 0!==t.type){const e=null==s?void 0:s.querySelector(".toast-icon");e&&e.remove();const n=fe(o(o({},i.options),t));n&&(a?s.insertBefore(n,a):s.appendChild(n))}if(t.backgroundColor&&(s.style.background=t.backgroundColor),t.textColor)s.style.color=t.textColor,a&&(a.style.color=t.textColor);else if(t.type||t.backgroundColor){const e=s.style.background;if(e){const t=y(e);s.style.color=t,a&&(a.style.color=t)}}if(void 0!==t.borderRadius){const e="number"==typeof t.borderRadius?`${t.borderRadius}px`:t.borderRadius;s.style.borderRadius=e}if(void 0!==t.maxWidth){const e="number"==typeof t.maxWidth?`${t.maxWidth}px`:t.maxWidth;s.style.maxWidth=e}if(void 0!==t.fontDirection){const e="auto"!==t.fontDirection?t.fontDirection:"";s.style.direction=e,a&&(a.style.direction=e)}if(void 0!==t.fontSize){const e="number"==typeof t.fontSize?`${t.fontSize}px`:t.fontSize;s.style.fontSize=e,a&&(a.style.fontSize=e)}if(void 0!==t.fontFamily&&(s.style.fontFamily=t.fontFamily,a&&(a.style.fontFamily=t.fontFamily)),void 0!==t.fontWeight){const e="number"==typeof t.fontWeight?String(t.fontWeight):t.fontWeight;s.style.fontWeight=e,a&&(a.style.fontWeight=e)}if(void 0!==t.fontLineHeight&&(s.style.lineHeight=t.fontLineHeight,a&&(a.style.lineHeight=t.fontLineHeight)),void 0!==t.role&&s.setAttribute("role",t.role),void 0!==t.ariaLive&&s.setAttribute("aria-live",t.ariaLive),void 0!==t.className){const e=r.className;e&&"string"==typeof e&&s.classList.remove(...e.trim().split(/\s+/)),t.className&&"string"==typeof t.className&&s.classList.add(...t.className.trim().split(/\s+/))}let d=s.querySelector(".toast-progress-bar");if(!1===t.showProgressBar){if(s._progressAnimation){try{s._progressAnimation.cancel()}catch(e){}s._progressAnimation=null}d&&d.remove(),s._progressBar=null,d=null}else d||!1===t.showProgressBar||void 0===t.progress&&!0!==t.showProgressBar||(N(s,o(o(o({},i.options),t),{},{showProgressBar:!0})),d=s.querySelector(".toast-progress-bar"));if(d){if(void 0!==t.progress)if("indeterminate"===t.progress){if(d._isIndeterminate=!0,d._isManualProgress=!1,s._progressAnimation){try{s._progressAnimation.cancel()}catch(e){}s._progressAnimation=null}d.classList.add("toast-progress-bar-indeterminate");const e=d._isRtl||"rtl"===t.fontDirection||"rtl"===t.progressDirection;if(e&&d.classList.add("toast-progress-bar-indeterminate-rtl"),!l().disableInlineStyles){M();const t=e?"toast-progress-indeterminate-rtl":"toast-progress-indeterminate";d.style.animation=`${t} 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite`}d.style.width=d._finalWidth||"100%"}else{const e=L(t.progress,s,o(o({},i.options),t));if(d._isIndeterminate=!1,d._isManualProgress=!0,d.classList.remove("toast-progress-bar-indeterminate"),d.classList.remove("toast-progress-bar-indeterminate-rtl"),d.style.animation="none",s._progressAnimation){try{s._progressAnimation.cancel()}catch(e){}s._progressAnimation=null}d.style.transition="width 200ms ease",d.style.width=`${e}%`}if((t.progressBarColor||t.progressColor)&&(d.style.background=t.progressBarColor||t.progressColor),t.progressPosition&&(d.style.top="top"===t.progressPosition?"0":"auto",d.style.bottom="bottom"===t.progressPosition?"0":"auto"),void 0!==t.progressHeight){const e="number"==typeof t.progressHeight?`${t.progressHeight}px`:t.progressHeight;d.style.height=e}}if(void 0!==t.animationType&&(i.options.animationType=t.animationType,s._animationType=t.animationType),void 0!==t.duration){var p;null===(p=i.timer)||void 0===p||p.clear();const e=Number(t.duration);if(Number.isFinite(e)&&e>0){if(i.timer=st(s,{duration:e}),await at(i),d&&!d._isManualProgress&&!d._isIndeterminate){const t=e+5;if(s._progressAnimation){try{s._progressAnimation.cancel()}catch(e){}const e=d._isReverse,n=d._finalWidth||"100%",o=e?[{width:"0%"},{width:n}]:[{width:n},{width:"0%"}];s._progressAnimation=d.animate(o,{duration:t,easing:"linear",fill:"forwards",delay:0})}else{d.style.transition=`width ${t}ms linear`;const e=d._isReverse,n=d._finalWidth||"100%";d.style.width=e?n:"0%"}}}else if(i.timer=null,d&&!d._isManualProgress&&!d._isIndeterminate){if(s._progressAnimation){try{s._progressAnimation.cancel()}catch(e){}s._progressAnimation=null}d.style.width="0%"}}else if(!(0!==i.options.duration&&i.timer||"success"!==t.type&&"error"!==t.type&&"warning"!==t.type&&!1!==t.showLoader)){var f;i.options.duration=2500,null===(f=i.timer)||void 0===f||f.clear(),i.timer=st(s,{duration:2500}),await at(i)}if(void 0!==t.cta&&(s._cleanupCTA&&(s._cleanupCTA(),s._cleanupCTA=null),s.querySelectorAll(".toast-cta").forEach(e=>e.remove()),t.cta&&"object"==typeof t.cta)&&S(s,o(o({},i.options),t),lt),void 0!==t.undo&&(s._cleanupUndo&&(s._cleanupUndo(),s._cleanupUndo=null),s.querySelectorAll(".toast-undo-btn").forEach(e=>e.remove()),t.undo)&&k(s,o(o({},i.options),t),lt),void 0!==t.showCloseButton){const e=s.querySelector(".toast-close-btn");!1===t.showCloseButton?(s._cleanupCloseButton&&(s._cleanupCloseButton(),s._cleanupCloseButton=null),e&&e.remove()):!0!==t.showCloseButton||e||_(s,i.options,lt)}(void 0!==t.sound?Boolean(t.sound):Boolean(t.type&&(i.options.sound||l().sound)))&&H("string"==typeof t.sound?t.sound:t.type||i.options.type||"info",t.soundPreset||i.options.soundPreset||l().soundPreset||"modern");const m=s.closest('[id^="toast-container-"]');m&&"true"===m.getAttribute("data-stacked")&&nt(m)}let mt={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"},ht={success:"Operation completed successfully!",error:"Something went wrong!",warning:"Warning message!",info:"Information message!"},yt=!1,gt=null;function bt(e,t){const n="object"!=typeof t||null===t||Array.isArray(t)?{}:t;return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e?o(o({},n),{},{message:String(e)}):e instanceof Error?o(o({},n),{},{message:e.message||String(e)}):"object"!=typeof e||null===e||Array.isArray(e)?o({},n):o(o({},n),e)}function vt(e){try{if(e&&"object"==typeof e&&!Array.isArray(e)){const t=["success","error","warning","info"],n={};for(const[o,i]of Object.entries(e))t.includes(o)&&"string"==typeof i&&i.trim()&&(n[o]=i.trim());Object.keys(n).length>0&&(mt=o(o({},mt),n))}}catch(e){console.error("setDefaultColors failed:",e)}}function wt(e){try{if(e&&"object"==typeof e&&!Array.isArray(e)){const t=["success","error","warning","info"],n={};for(const[o,i]of Object.entries(e))t.includes(o)&&"string"==typeof i&&i.trim()&&(n[o]=i.trim());Object.keys(n).length>0&&(ht=o(o({},ht),n))}}catch(e){console.error("setDefaultMessages failed:",e)}}let Tt=!1,xt=null;const At=async function(e={}){return"undefined"!=typeof window&&"undefined"!=typeof document?(await async function(){yt||"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?(gt||(gt=new Promise(e=>{document.addEventListener("DOMContentLoaded",()=>{yt=!0,e()},{once:!0})})),await gt):yt=!0)}(),await async function(e={}){try{const t=await async function(e){var t,n;const i=bt(e),r=l(),s=String(null!==(t=null==i?void 0:i.position)&&void 0!==t?t:r.defaultPosition).toLowerCase().trim(),a=null!=s&&s.includes("top-full-width")||null!=s&&s.includes("bottom-full-width")?"100vw":"400px",c=o(o({},{allowHtml:!1,sanitizeHtml:!0,pauseOnHover:void 0,duration:2500,position:r.defaultPosition,type:"info",borderRadius:"50px",backgroundColor:void 0,textColor:void 0,showCloseButton:!0,animationDuration:"0.4s",animationEasing:"ease",showProgressBar:!0,progressColor:void 0,progressBarColor:void 0,progressHeight:"4px",progressPosition:"bottom",progressDirection:"decreasing",animationType:"default",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"14px",fontWeight:"400",fontLineHeight:"1.4",fontDirection:"auto",wrapText:"normal",maxWidth:a}),i);c.message=null!==(n=null==i?void 0:i.message)&&void 0!==n?n:c.message;try{if(!c.backgroundColor){var u,d,p;const e="undefined"!=typeof window&&"function"==typeof window.matchMedia&&(null===(u=window.matchMedia("(prefers-color-scheme: dark)"))||void 0===u?void 0:u.matches);c.backgroundColor=null!==(d=null===(p=mt)||void 0===p?void 0:p[c.type])&&void 0!==d?d:e?"#f5f5f5":"#111111"}}catch(e){console.warn("Background color resolution failed:",e),c.backgroundColor||(c.backgroundColor="#111111")}try{var f;c.message=c.message||(null===(f=ht)||void 0===f?void 0:f[c.type])||"No Message Provided!"}catch(e){console.warn("Default message resolution failed:",e)}try{!c.textColor&&c.backgroundColor&&(c.textColor=y(c.backgroundColor))}catch(e){console.warn("Text color resolution failed:",e)}try{const e=(null==i?void 0:i.progressBarColor)||(null==i?void 0:i.progressColor);e?(c.progressColor=e,c.progressBarColor=e):!c.progressColor&&c.backgroundColor&&(c.progressColor=c.textColor||y(c.backgroundColor),c.progressBarColor=c.progressColor)}catch(e){console.warn("Progress bar color resolution failed:",e)}return"string"!=typeof c.message&&(c.message="No Message Provided!"),c}(e);return await async function(e){try{return await ke(e,Le)}catch(e){return console.error("Failed to create toast container:",e),l().targetNode||document.body}}(t),await ot(t)}catch(e){return console.error("CreateToast failed:",e),null}}(e)):(console.warn("ToastNotification: running in non-browser environment, no DOM available."),null)};async function Ct(e={},t){const n=bt(e,t),o=await async function(){if(Tt&&xt)try{await xt}catch(e){console.warn("Previous close operation failed (continuing anyway):",e)}return At(n)}();return{id:o,dismiss:()=>o?ct(o):Promise.resolve(),update:e=>o?ft(o,e):Promise.resolve()}}Ct.success=(e,t)=>Ct(o(o({},bt(e,t)),{},{type:"success"})),Ct.error=(e,t)=>Ct(o(o({},bt(e,t)),{},{type:"error"})),Ct.warning=(e,t)=>Ct(o(o({},bt(e,t)),{},{type:"warning"})),Ct.info=(e,t)=>Ct(o(o({},bt(e,t)),{},{type:"info"})),Ct.loading=(e,t)=>Ct(o({type:"info",showLoader:!0,duration:0,showProgressBar:!1,pauseOnHover:!1},bt(e,t))),Ct.custom=(e,t)=>Ct(o({allowHtml:!0},bt(e,t)));const St=Ct.success,kt=Ct.error,_t=Ct.warning,Et=Ct.info,Mt=Ct.loading,Lt=Ct.custom,Nt=async e=>{let t=e;if(e&&"function"==typeof e.then)try{t=await e}catch(e){return}Tt=!0,xt=(async()=>{try{"string"==typeof t&&t.length>0?await ct(t):t&&"object"==typeof t?"function"==typeof t.dismiss?await t.dismiss():t._key&&"string"==typeof t._key?await ct(t._key):t.id&&"string"==typeof t.id?await ct(t.id):await rt():await rt()}finally{Tt=!1,xt=null}})(),await xt},It=async()=>{Tt=!0,xt=(async()=>{try{await async function(){try{for(const[,e]of Ye)null!=e&&e.rafId&&cancelAnimationFrame(e.rafId);Ye.clear(),Xe.length=0,Ze();const e=Array.from(Ge.values()).map(e=>e.toast).filter(Boolean);await Promise.allSettled(e.map(async e=>{try{await lt(e)}catch(e){console.warn("closeAllToasts: failed to close one toast:",e)}}))}catch(e){console.error("closeAllToasts failed:",e)}}()}finally{Tt=!1,xt=null}})(),await xt},Bt=It,Pt=It,zt=864e5;async function Ot(e,t={},n={}){var i,r,s;const a=t&&"object"==typeof t?t:{},l=n&&"object"==typeof n?n:{},c=null!==(i=a.loading)&&void 0!==i?i:"Loading...",u="object"!=typeof c||null===c||Array.isArray(c)?o(o({},l),{},{type:"info",message:String(c),duration:zt,showProgressBar:!1,pauseOnHover:!1,showLoader:null===(s=l.showLoader)||void 0===s||s}):o(o({},l),{},{type:"info",duration:zt,showProgressBar:!1,pauseOnHover:!1,showLoader:null===(r=l.showLoader)||void 0===r||r},c),d=await Ct(u),p=o(o({},l),{},{pauseOnHover:l.pauseOnHover});try{var f;const t="function"==typeof e?e():e,n=await t;if(d&&"function"==typeof d.dismiss)try{await d.dismiss()}catch(e){}const i="function"==typeof a.success?a.success(n):null!==(f=a.success)&&void 0!==f?f:"Done!",r="object"!=typeof i||null===i||Array.isArray(i)?o(o({},p),{},{type:"success",message:String(i)}):o(o({},p),{},{type:"success"},i);return await Ct(r),n}catch(e){var m;if(d&&"function"==typeof d.dismiss)try{await d.dismiss()}catch(e){}const t="function"==typeof a.error?a.error(e):null!==(m=a.error)&&void 0!==m?m:"Something went wrong.",n="object"!=typeof t||null===t||Array.isArray(t)?o(o({},p),{},{type:"error",message:String(t)}):o(o({},p),{},{type:"error"},t);throw await Ct(n),e}}Ct.promise=Ot,Ct.dismiss=Nt,Ct.dismissAll=It,Ct.clear=It;const Vt="3.19.0";if("undefined"!=typeof window&&"undefined"!=typeof document&&!window.__customizableToastEscapeAttached){window.__customizableToastEscapeAttached=!0;const e=e=>{if("Escape"===e.key||"Esc"===e.key)(async()=>{try{Tt=!0,xt=(async()=>{try{await rt()}finally{Tt=!1,xt=null}})(),await xt}catch(e){console.error("Escape key dismiss failed:",e),Tt=!1,xt=null}})();else if("F6"===e.key||(e.altKey||e.metaKey)&&("t"===e.key||"T"===e.key)){const e=(l().targetNode&&"function"==typeof l().targetNode.querySelectorAll?l().targetNode:document).querySelectorAll('[id^="toast-container-"] [id^="toast-"]');if(e.length>0){const t=e[e.length-1],n=t.querySelector("button, a, [tabindex='0']");n&&"function"==typeof n.focus?n.focus():"function"==typeof t.focus&&t.focus()}}};window.addEventListener("keydown",e,{passive:!0})}try{"undefined"!=typeof window&&(window.customizableToast={setConfig:s,getConfig:l,resetConfig:a,shouldReduceMotion:c,version:Vt,createToast:Ct,success:St,error:kt,warning:_t,info:Et,loading:Mt,custom:Lt,setDefaultColors:vt,setDefaultMessages:wt,noop:It,dismiss:Nt,dismissAll:It,clear:It,toastPromise:Ot,promise:Ot,updateToastByKey:ft,setAudioEnabled:X,isAudioEnabled:Q,playTone:H,registerSoundPreset:U,getSoundPresets:G,resetSoundPresets:Y,resetAudioContext:K,getToastPool:be,resetToastPool:ve,getToastBroadcaster:Pe,resetToastBroadcaster:ze,calculateToastPriority:Re,categorizeToast:De,createGestureDetector:Ue,detectPinch:He,isFlick:$e,calculateVelocity:je,generateToastId:f,resetToastIdCounter:p,getToastMetrics:Je,registerSpringPreset:ee,getSpringPresets:te,resetSpringPresets:ne,resolveSpringConfig:oe,solveSpring:ie,calculateSpringSettlingDuration:re,generateSpringLinearEasing:se,getSpringTransition:ae,getAudioContext:q,getAudioAnalyser:D})}catch(kt){console.error("Global assignment failed:",kt)}e.calculateSpringSettlingDuration=re,e.calculateToastPriority=Re,e.calculateVelocity=je,e.categorizeToast=De,e.clear=Bt,e.createGestureDetector=Ue,e.createToast=Ct,e.custom=Lt,e.default=Ct,e.detectPinch=He,e.dismiss=Nt,e.dismissAll=Pt,e.error=kt,e.generateSpringLinearEasing=se,e.generateToastId=f,e.getAudioAnalyser=D,e.getAudioContext=q,e.getConfig=l,e.getSoundPresets=G,e.getSpringPresets=te,e.getSpringTransition=ae,e.getToastBroadcaster=Pe,e.getToastMetrics=Je,e.getToastPool=be,e.info=Et,e.isAudioEnabled=Q,e.isFlick=$e,e.loading=Mt,e.noop=It,e.playTone=H,e.registerSoundPreset=U,e.registerSpringPreset=ee,e.resetAudioContext=K,e.resetConfig=a,e.resetContainerRegistry=function(){Te.clear(),xe.clear()},e.resetSoundPresets=Y,e.resetSpringPresets=ne,e.resetToastBroadcaster=ze,e.resetToastIdCounter=p,e.resetToastManager=function(){for(const[,e]of Ye)null!=e&&e.rafId&&cancelAnimationFrame(e.rafId);Ye.clear(),Xe.length=0;for(const[,h]of Ge){var e,t,n,o,i,r,s,a,l,c,u,d,p,f,m;if(null===(e=h.timer)||void 0===e||e.clear(),null===(t=h.outer)||void 0===t||null===(n=t._pauseCleanup)||void 0===n||n.call(t),null===(o=h.toast)||void 0===o||null===(i=o._cleanupCloseButton)||void 0===i||i.call(o),null===(r=h.toast)||void 0===r||null===(s=r._cleanupCTA)||void 0===s||s.call(r),null===(a=h.toast)||void 0===a||null===(l=a._cleanupUndo)||void 0===l||l.call(a),null===(c=h.toast)||void 0===c||null===(u=c._cleanupSwipe)||void 0===u||u.call(c),null===(d=h.toast)||void 0===d||null===(p=d._cleanup)||void 0===p||p.call(d),null!==(f=h.toast)&&void 0!==f&&f._progressAnimation){try{h.toast._progressAnimation.cancel()}catch(e){}h.toast._progressAnimation=null}const y=null===(m=h.outer)||void 0===m?void 0:m.querySelector(".toast-count-badge");null!=y&&y._scaleTimer&&(clearTimeout(y._scaleTimer),y._scaleTimer=null)}"undefined"!=typeof document&&document.querySelectorAll('[id^="toast-container-"]').forEach(e=>{try{var t;null===(t=e._stackedCleanup)||void 0===t||t.call(e)}catch(e){}}),Ge.clear(),Qe=0,Ke=0,ut=!1,Ze()},e.resetToastPool=ve,e.resolveSpringConfig=oe,e.setAudioEnabled=X,e.setConfig=s,e.setDefaultColors=vt,e.setDefaultMessages=wt,e.shouldReduceMotion=c,e.solveSpring=ie,e.success=St,e.toastPromise=Ot,e.updateToastByKey=ft,e.version=Vt,e.warning=_t,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
16
16
|
//# sourceMappingURL=index.umd.js.map
|