customizable-toast-notification 3.14.0 → 3.16.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 +67 -0
- package/README.md +643 -4
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2 -0
- package/dist/index.css.d.ts +50 -0
- package/dist/index.css.map +7 -0
- package/dist/index.d.ts +586 -6
- 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 +16 -5
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Customizable Toast Notifications
|
|
3
|
-
* Build: 2026-10-
|
|
4
|
-
* Cache-Buster:
|
|
3
|
+
* Build: 2026-10-08 21:44:20
|
|
4
|
+
* Cache-Buster: 1791495860842
|
|
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
|
-
"use strict";function t(t){try{return(null==t?void 0:t.offsetWidth)||0}catch{return 0}}const e=new class{constructor(t=200){this.maxSize=t,this.map=new Map}get(t){if(!this.map.has(t))return;const e=this.map.get(t);return this.map.delete(t),this.map.set(t,e),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxSize){const t=this.map.keys().next().value;this.map.delete(t)}this.map.set(t,e)}}(200),o={};function n(t){if(!t)return"snow";const n=String(t),r=e.get(n);if(r)return r;if(o[null==t?void 0:t.toLowerCase()]){const r=o[t.toLowerCase()];return e.set(n,r),r}let i,a,s;try{const e=function(t){const e=null==t?void 0:t.match(/^#([0-9a-f]{3,8})$/i);if(e){let t=e[1];return 3===t.length&&(t=t.split("").map(t=>t+t).join("")),{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}const o=null==t?void 0:t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/i);if(o)return{r:Number(o[1]),g:Number(o[2]),b:Number(o[3])};const n=null==t?void 0:t.match(/hsla?\(\s*([\d.]+)(?:deg)?\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*[\d.]+)?\)/i);if(n){const t=Number(n[1])/360,e=Number(n[2])/100,o=Number(n[3])/100;if(0===e){const t=Math.round(255*o);return{r:t,g:t,b:t}}const r=(t,e,o)=>(o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+6*(e-t)*o:o<.5?e:o<2/3?t+(e-t)*(2/3-o)*6:t),i=o<.5?o*(1+e):o+e-o*e,a=2*o-i;return{r:Math.round(255*r(a,i,t+1/3)),g:Math.round(255*r(a,i,t)),b:Math.round(255*r(a,i,t-1/3))}}return null}(function(t){var e;const o=null==t?void 0:t.match(/^var\((--[\w-]+)(?:\s*,\s*(.+))?\)$/i);if(!o)return t;try{if("undefined"!=typeof document&&"function"==typeof getComputedStyle){const t=getComputedStyle(document.documentElement).getPropertyValue(o[1]).trim();if(t)return t}}catch(t){}return(null===(e=o[2])||void 0===e?void 0:e.trim())||t}(t));if(!e)throw new Error("Unknown color");({r:i,g:a,b:s}=e)}catch{i=a=s=128}const l=(t,e,o)=>{const n=[t,e,o].map(t=>(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*n[0]+.7152*n[1]+.0722*n[2]},c=(t,e)=>{const o=l(...t),n=l(...e);return(Math.max(o,n)+.05)/(Math.min(o,n)+.05)};let[u,d,p]=((t,e,o)=>{t/=255,e/=255,o/=255;const n=Math.max(t,e,o),r=Math.min(t,e,o);let i,a,s=(n+r)/2;if(n===r)i=a=0;else{const l=n-r;switch(a=s>.5?l/(2-n-r):l/(n+r),n){case t:i=(e-o)/l+(e<o?6:0);break;case e:i=(o-t)/l+2;break;case o:i=(t-e)/l+4}i/=6}return[360*i,a,s]})(i,a,s),m=p<.5?Math.min(p+.5,1):Math.max(p-.5,0),[f,h,y]=((t,e,o)=>{let n,r,i;if(t/=360,0===e)n=r=i=o;else{const a=(t,e,o)=>(o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+6*(e-t)*o:o<.5?e:o<2/3?t+(e-t)*(2/3-o)*6:t),s=o<.5?o*(1+e):o+e-o*e,l=2*o-s;n=a(l,s,t+1/3),r=a(l,s,t),i=a(l,s,t-1/3)}return[Math.round(255*n),Math.round(255*r),Math.round(255*i)]})(u,d,m);if(c([i,a,s],[f,h,y])<4.5){const t=c([i,a,s],[0,0,0]),e=c([i,a,s],[255,255,255]);[f,h,y]=t>=e?[0,0,0]:[255,255,255]}const g=((t,e,o)=>`#${t.toString(16).padStart(2,"0")}${e.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}`)(f,h,y);return e.set(n,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],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(([t,[e,n,r]])=>{const i=t=>{const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},a=.2126*i(e)+.7152*i(n)+.0722*i(r),s=(a+.05)/.05,l=1.05/(a+.05);o[t.toLowerCase()]=s>=l?"#000000":"#ffffff"});const r=new Set(["DIV","SPAN","P","BR","STRONG","B","EM","I","U","SMALL","UL","OL","LI","A","IMG","PRE","CODE","MARK"]),i=new Set(["href","src","alt","title","class","target","rel","loading"]),a=/<\/?(script|iframe|object|embed|link|meta|style|form|input|button|svg|math|video|audio|details|dialog|applet|frame|frameset|textarea|select|option|optgroup|fieldset|legend|datalist|output|progress|meter|keygen|canvas|map|area|base|basefont|bgsound|blink|center|dir|font|hgroup|isindex|listing|marquee|multicol|nextid|noembed|noframes|plaintext|rb|rtc|spacer|strike|tt|xmp)[^>]*>/gi,s=/\s(on\w+)\s*=\s*(['"])[\s\S]*?\2/gi,l=/(href|src)\s*=\s*(['"])\s*javascript:[^'"]*\2/gi;function c(t,e,o){if(t.nodeType===Node.TEXT_NODE)return document.createTextNode(t.nodeValue);if(t.nodeType===Node.COMMENT_NODE)return null;if(t.nodeType!==Node.ELEMENT_NODE)return null;const n=t.tagName.toUpperCase();if(!e.has(n)){const n=document.createDocumentFragment();return Array.from(t.childNodes).forEach(t=>{const r=c(t,e,o);r&&n.appendChild(r)}),n}const r=document.createElement(t.tagName);return Array.from(t.attributes||[]).forEach(t=>{r.setAttribute(t.name,t.value)}),function(t,e){const o=[];Array.from(t.attributes||[]).forEach(n=>{const r=n.name.toLowerCase(),i=n.value;if(e.has(r))if("href"!==r&&"src"!==r||!/^\s*javascript:/i.test(i))if("src"!==r||/^\s*(https?:|data:image\/)/i.test(i)){if("target"===r&&"_blank"===i){const e=(t.getAttribute("rel")||"").split(/\s+/).filter(Boolean);e.includes("noopener")||e.push("noopener"),e.includes("noreferrer")||e.push("noreferrer"),t.setAttribute("rel",e.join(" "))}}else o.push(r);else o.push(r);else o.push(r)}),o.forEach(e=>t.removeAttribute(e))}(r,o),Array.from(t.childNodes).forEach(t=>{const n=c(t,e,o);n&&r.appendChild(n)}),r}function u(t,e={}){if("string"!=typeof t||!t.trim())return"";try{if(!e.forceFallback&&function(){try{if("undefined"!=typeof window&&window.DOMPurify)return!0}catch(t){}return!1}()){const e=window.DOMPurify.sanitize(t,{ALLOWED_TAGS:Array.from(r),ALLOWED_ATTR:Array.from(i),ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|ftp|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i}),o=document.createElement("div");return o.innerHTML=e,o.querySelectorAll('a[target="_blank"]').forEach(t=>{const e=(t.getAttribute("rel")||"").split(/\s+/).filter(Boolean);e.includes("noopener")||e.push("noopener"),e.includes("noreferrer")||e.push("noreferrer"),t.setAttribute("rel",e.join(" "))}),o.innerHTML}}catch(t){console.warn("DOMPurify sanitization failed, falling back:",t)}return function(t){if(!t||"string"!=typeof t)return"";let e=t.replace(a,"");e=e.replace(s,""),e=e.replace(l,"$1=$2#$2");const o=document.createElement("div");o.innerHTML=e;const n=document.createDocumentFragment();Array.from(o.childNodes).forEach(t=>{const e=c(t,r,i);e&&n.appendChild(e)});const u=document.createElement("div");return u.appendChild(n),u.querySelectorAll('a[target="_blank"]').forEach(t=>{const e=(t.getAttribute("rel")||"").split(/\s+/).filter(Boolean);e.includes("noopener")||e.push("noopener"),e.includes("noreferrer")||e.push("noreferrer"),t.setAttribute("rel",e.join(" "))}),u.innerHTML}(t)}function d(t={}){const e=t&&"object"==typeof t&&!Array.isArray(t)?t:{},o=Number(e.size)||14,n="string"==typeof e.color&&e.color.trim()?e.color.trim():"currentColor",r="string"==typeof e.text?e.text:"",i=document.createElement("span");i.className="toast-loader",i.style.display="inline-flex",i.style.alignItems="center",i.style.gap="8px";const a="http://www.w3.org/2000/svg",s=document.createElementNS(a,"svg");s.setAttribute("width",String(o)),s.setAttribute("height",String(o)),s.setAttribute("viewBox","0 0 50 50"),s.setAttribute("aria-hidden","true");const l=document.createElementNS(a,"circle");if(l.setAttribute("cx","25"),l.setAttribute("cy","25"),l.setAttribute("r","20"),l.setAttribute("fill","none"),l.setAttribute("stroke",n),l.setAttribute("stroke-width","4"),l.setAttribute("stroke-linecap","round"),l.style.opacity="0.85",l.style.strokeDasharray="90",l.style.strokeDashoffset="60",l.style.transformOrigin="center",l.style.animation="toast-spinner 1s linear infinite",s.appendChild(l),i.appendChild(s),r){const t=document.createElement("span");t.style.fontSize="13px",t.textContent=r,i.appendChild(t)}if("undefined"!=typeof document&&!document.getElementById("toast-spinner-styles")){const t=document.createElement("style");t.id="toast-spinner-styles",t.textContent="@keyframes toast-spinner { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }";const e=document.head||document.documentElement;e&&e.appendChild(t)}return i}function p(e,o){const n=document.createElement("div");n.className="toast-progress-bar",e._progressBar=n;const r=o.borderRadius||"0",i=parseInt(r,10),a=parseInt(o.progressHeight,10)||4,s=Number(o.duration??2500)+5,l=Math.min(i,2*a),c=i>0?`calc(100% - ${l}px)`:"100%";if(Object.assign(n.style,{position:"absolute",left:`${l}px`,height:`${a}px`,background:o.progressColor||"currentColor",width:`${c}`,transition:`width ${s}ms linear`,["top"===o.progressPosition?"top":"bottom"]:"0",borderRadius:a/2+"px",opacity:"0.8"}),e.appendChild(n),void 0!==o.progress){let t=Number(o.progress);return Number.isFinite(t)||(t=0),t<=1&&t>0&&(t*=100),t=Math.min(100,Math.max(0,t)),n.style.width=`${t}%`,void(n.style.transition="width 200ms ease")}"function"==typeof n.animate?e._progressAnimation=n.animate([{width:c},{width:"0%"}],{duration:s,easing:"linear",fill:"forwards",delay:50}):(n.style.transition=`width ${s}ms linear`,setTimeout(()=>{t(n),n.style.width="0%"},50))}let m=null,f=!0;function h(t="info"){if(!f)return;const e=function(){if("undefined"==typeof window)return null;const t=window.AudioContext||window.webkitAudioContext;if(!t)return null;if(!m)try{m=new t}catch{return null}if(m&&"suspended"===m.state)try{m.resume().catch(()=>{})}catch{}return m}();if(e)try{const o=e.currentTime,n=String(t||"info").toLowerCase().trim();if("success"===n)[523.25,659.25,783.99].forEach((t,n)=>{const r=e.createOscillator(),i=e.createGain();r.type="sine",r.frequency.setValueAtTime(t,o+.08*n),i.gain.setValueAtTime(.001,o+.08*n),i.gain.exponentialRampToValueAtTime(.12,o+.08*n+.02),i.gain.exponentialRampToValueAtTime(1e-4,o+.08*n+.35),r.connect(i),i.connect(e.destination),r.start(o+.08*n),r.stop(o+.08*n+.36)});else if("error"===n)[320,240].forEach((t,n)=>{const r=e.createOscillator(),i=e.createGain();r.type="triangle",r.frequency.setValueAtTime(t,o+.1*n),i.gain.setValueAtTime(.001,o+.1*n),i.gain.exponentialRampToValueAtTime(.15,o+.1*n+.02),i.gain.exponentialRampToValueAtTime(1e-4,o+.1*n+.22),r.connect(i),i.connect(e.destination),r.start(o+.1*n),r.stop(o+.1*n+.23)});else if("warning"===n){const t=e.createOscillator(),n=e.createGain();t.type="sine",t.frequency.setValueAtTime(440,o),t.frequency.exponentialRampToValueAtTime(493.88,o+.12),n.gain.setValueAtTime(.001,o),n.gain.exponentialRampToValueAtTime(.12,o+.02),n.gain.exponentialRampToValueAtTime(1e-4,o+.28),t.connect(n),n.connect(e.destination),t.start(o),t.stop(o+.3)}else{const t=e.createOscillator(),n=e.createGain();t.type="sine",t.frequency.setValueAtTime(600,o),t.frequency.exponentialRampToValueAtTime(950,o+.04),t.frequency.exponentialRampToValueAtTime(400,o+.09),n.gain.setValueAtTime(.001,o),n.gain.exponentialRampToValueAtTime(.1,o+.015),n.gain.exponentialRampToValueAtTime(1e-4,o+.12),t.connect(n),n.connect(e.destination),t.start(o),t.stop(o+.13)}}catch{}}function y(t){f=Boolean(t)}function g(){return f}async function b(e,o,r){const i=await async function(t){if("number"==typeof t&&Number.isFinite(t)&&t>0)return t;if("string"==typeof t){if(t.endsWith("s")&&!t.endsWith("ms")){const e=1e3*parseFloat(t);return Number.isFinite(e)&&e>0?e:500}const e=parseFloat(t);return Number.isFinite(e)&&e>0?e:500}return 500}(null==o?void 0:o.animationDuration),a=`${i}ms`,s="string"==typeof(null==o?void 0:o.animationEasing)&&o.animationEasing.trim()?o.animationEasing.trim():"ease",l="string"==typeof(null==o?void 0:o.className)&&o.className.trim()?` ${o.className.trim()}`:"";e.className=`toast toast-${(null==o?void 0:o.type)??"info"}${l}`;const c="number"==typeof(null==o?void 0:o.borderRadius)?`${o.borderRadius}px`:null==o?void 0:o.borderRadius,m="number"==typeof(null==o?void 0:o.maxWidth)?`${o.maxWidth}px`:null==o?void 0:o.maxWidth;Object.assign(e.style,{background:null==o?void 0:o.backgroundColor,padding:"12px 16px",marginBottom:"10px",borderRadius:c,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"space-between",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",minWidth:"250px",maxWidth:m,opacity:"0",position:"relative",cursor:"default",boxSizing:"border-box",userSelect:"text",pointerEvents:"auto",transition:`opacity ${a} ${s}, transform ${a} ${s}`,transform:"translateY(20px)",zIndex:"9999"}),e.setAttribute("role","alert"),e.setAttribute("aria-live","polite"),e.tabIndex=0,e._animationDuration=i;const f=document.createElement("span");f.className="toast-message",e._messageSpan=f,"truncate"!==(null==o?void 0:o.wrapText)&&"ellipsis"!==(null==o?void 0:o.wrapText)&&!1!==(null==o?void 0:o.wrapText)&&null!=o&&o.wrapText?Object.assign(f.style,{display:"block",whiteSpace:"normal"}):Object.assign(f.style,{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",whiteSpace:"normal",overflow:"hidden",textOverflow:"ellipsis"});const y="number"==typeof(null==o?void 0:o.fontSize)?`${o.fontSize}px`:null==o?void 0:o.fontSize;Object.assign(f.style,{flex:"1",padding:null==o?void 0:o.fontPadding,fontFamily:null==o?void 0:o.fontFamily,fontSize:y,fontWeight:null==o?void 0:o.fontWeight,lineHeight:null==o?void 0:o.fontLineHeight,color:null==o?void 0:o.textColor,userSelect:"text",wordBreak:"break-word",overflow:"hidden",textOverflow:"ellipsis",direction:null!=o&&o.fontDirection&&"auto"!==o.fontDirection?o.fontDirection:void 0});const g=!!o.allowHtml,b=o.message??"";if(o.loader||o.showLoader){const t=d(o.loader||{});f.appendChild(t);const e=document.createElement("span");e.style.display="inline-block",e.style.width="8px",f.appendChild(e)}if(g&&"string"==typeof b&&b.trim().length>0)try{const t=u(b),e=document.createElement("div");for(e.innerHTML=t;e.firstChild;)f.appendChild(e.firstChild)}catch(t){console.warn("HTML message sanitization failed, falling back to text:",t),f.appendChild(document.createTextNode(String(b)))}else f.appendChild(document.createTextNode(String(b)));f.setAttribute("title","string"==typeof b?b.replace(/<[^>]+>/g,""):String(b)),e.appendChild(f),null!=o&&o.cta&&0!==Object.keys(o.cta).length&&function(t,e,o){const r=null==e?void 0:e.cta;if(!r||"object"!=typeof r||Array.isArray(r))return;const i={...r};i.label||(i.label="CTA Label Missing!");const a="link"===i.variant||!i.variant&&!!i.href,s=document.createElement(a?"a":"button");a?(s.href=i.href,i.target&&(s.target=i.target),s.rel=i.rel||("_blank"===i.target?"noopener noreferrer":"")):s.type="button",s.setAttribute("aria-label",i.ariaLabel||i.label);const l=e.textColor||n(e.backgroundColor),c=e.backgroundColor&&(d=e.backgroundColor)&&"#000000"===n(d)?"rgba(0,0,0,0.15)":"rgba(255,255,255,0.15)",u="string"==typeof l&&/^#[0-9a-fA-F]{6}$/.test(l.trim())?`${l.trim()}44`:"rgba(128, 128, 128, 0.3)";var d;Object.assign(s.style,{marginLeft:"10px",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",border:`1px solid ${u}`,color:l,background:c,cursor:"pointer",whiteSpace:"nowrap",flexShrink:"0"}),s.textContent=i.label;const p=async e=>{try{if("function"==typeof i.onClick){const t=i.onClick(e);null!=t&&t.then&&await t}}catch(t){console.error("CTA onClick handler error:",t)}finally{!1!==i.autoClose&&"function"==typeof o&&o(t)}};s.addEventListener("click",p),s._cleanup=()=>s.removeEventListener("click",p),t._cleanupCTA=()=>s.removeEventListener("click",p),t.appendChild(s)}(e,o,r),null!=o&&o.showCloseButton&&function(t,e,o){const r=document.createElement("button");r.setAttribute("aria-label","Close notification"),r.setAttribute("title","Close"),r.textContent="×";const i=e.textColor||n(e.backgroundColor);Object.assign(r.style,{background:"none",border:"none",color:i,fontSize:"18px",marginLeft:"10px",cursor:"pointer",lineHeight:"1",padding:"0 4px"});const a=()=>{"function"==typeof o&&o(t)};r.addEventListener("click",a),t._cleanupCloseButton=()=>{r.removeEventListener("click",a)},t.appendChild(r)}(e,o,r),null!=o&&o.showProgressBar&&p(e,o),!1!==(null==o?void 0:o.swipeToDismiss)&&function(t,e){if(!t||"function"!=typeof t.addEventListener)return;let o=0,n=0,r=0,i=!1,a=!1;const s=e=>{e&&e.touches&&1===e.touches.length&&(o=e.touches[0].clientX,n=e.touches[0].clientY,r=o,i=!0,a=!1,t.style.transition="none")},l=e=>{if(!i||!e||!e.touches||1!==e.touches.length)return;const s=e.touches[0].clientX,l=e.touches[0].clientY,c=s-o,u=l-n;if(!a)if(Math.abs(c)>8&&Math.abs(c)>Math.abs(u))a=!0;else if(Math.abs(u)>8)return void(i=!1);if(a){r=s;const o=Math.max(0,1-Math.abs(c)/280);t.style.transform=`translateX(${c}px)`,t.style.opacity=String(o),e.cancelable&&e.preventDefault()}},c=()=>{if(!i||!a)return void(i=!1);i=!1;const n=r-o;if(Math.abs(n)>=75){const o=n>0?320:-320;t.style.transition="transform 180ms ease-out, opacity 180ms ease-out",t.style.transform=`translateX(${o}px)`,t.style.opacity="0",setTimeout(()=>{"function"==typeof e&&e(t)},180)}else t.style.transition="transform 200ms ease, opacity 200ms ease",t.style.transform="translateX(0)",t.style.opacity="1"};t.addEventListener("touchstart",s,{passive:!0}),t.addEventListener("touchmove",l,{passive:!1}),t.addEventListener("touchend",c,{passive:!0}),t.addEventListener("touchcancel",c,{passive:!0}),t._cleanupSwipe=()=>{t.removeEventListener("touchstart",s),t.removeEventListener("touchmove",l),t.removeEventListener("touchend",c),t.removeEventListener("touchcancel",c)}}(e,r),null!=o&&o.sound&&h("string"==typeof o.sound?o.sound:(null==o?void 0:o.type)||"info"),function(e){t(e),setTimeout(()=>{requestAnimationFrame(()=>{e.style.opacity="1",e.style.transform="translateY(0)"})},50)}(e)}async function v(t,e){try{const o=document.createElement("div"),n=((null==t?void 0:t.position)||"bottom-right").toLowerCase().trim();let r="auto",i="auto",a="auto",s="auto",l="none";n.startsWith("top")?r="20px":(n.startsWith("bottom")||n.includes("below"))&&(i="20px"),n.startsWith("left")?a="20px":n.startsWith("right")?s="20px":"center"===n?(a="50%",r="50%",l="translate(-50%, -50%)"):n.includes("center")?n.includes("left")?(a="20px",r="50%",l="translateY(-50%)"):n.includes("right")?(s="20px",r="50%",l="translateY(-50%)"):n.includes("top")?(r="20px",a="50%",l="translateX(-50%)"):n.includes("bottom")&&(i="20px",a="50%",l="translateX(-50%)"):(s="20px",i="20px"),Object.assign(o.style,{background:"#333",color:"white",padding:"10px 15px",position:"fixed",top:r,bottom:i,left:a,right:s,transform:l,zIndex:"99999",borderRadius:"3px",maxWidth:"250px",wordWrap:"break-word",boxShadow:"0 2px 10px rgba(0,0,0,0.3)"});const c=document.createElement("div"),d=document.createElement("span");d.style.display="inline-block",t.allowHtml?d.innerHTML=u(String(t.message||"Emergency Toast Showing!")):d.textContent=String(t.message||"Emergency Toast Creation Showing!"),c.appendChild(d);const p=document.createElement("span");for(p.style.cssText="float: right; margin-left: 10px; font-weight: bold; cursor: pointer;",p.textContent="×",c.appendChild(p);o.firstChild;)o.removeChild(o.firstChild);o.appendChild(c),p.addEventListener("click",()=>{o.remove(),"function"==typeof e&&e(o)});const m=Number(null==t?void 0:t.duration)||2500,f=setTimeout(()=>{o.remove(),"function"==typeof e&&e(o)},m);return"function"==typeof(null==f?void 0:f.unref)&&f.unref(),o}catch(t){return console.error("Emergency toast creation failed:",t),"function"==typeof e&&e(null),null}}const w=new Map,x=new Map;function C(t){if(!t||"string"!=typeof t)return"bottom-right";const e=t.toLowerCase().trim();return e?e.replace(/\bbelow\b/g,"bottom").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-"):"bottom-right"}async function k(t,e){const o=`toast-container-${C((null==t?void 0:t.position)||"bottom-right")}`;if(x.has(o))return x.get(o);const n=(async()=>{const n=w.get(o),r="undefined"==typeof document||(null==n?void 0:n.ownerDocument)===document;if(null!=n&&n.isConnected&&r)return n;n&&w.delete(o);let i=document.getElementById(o);i&&!i.isConnected&&document.body.appendChild(i),i?(i.style.position=i.style.position||"fixed",i.style.zIndex=i.style.zIndex||"9999","function"==typeof e&&await e(i,t)):(i=document.createElement("div"),i.id=o,i.setAttribute("role","status"),i.setAttribute("aria-atomic","true"),i.style.position="fixed",i.style.zIndex="9999",i.style.pointerEvents="none",i.style.inset="auto 10px 10px auto",i.style.display="flex",i.style.justifyContent="space-between",i.style.alignItems="center",i.style.flexDirection="column",i.style.overflow="hidden","function"==typeof e&&await e(i,t),document.body.appendChild(i));const a=document.querySelectorAll(`#${o}`);if(a.length>1)for(let t=1;t<a.length;t++)try{a[t].remove()}catch{}return w.set(o,i),i})();x.set(o,n);try{return await n}finally{x.delete(o)}}const E=new Set(["top-left","top-right","bottom-left","bottom-right","top-center","bottom-center","left-center","right-center","top-full-width","bottom-full-width","center"]),T=new Set(["top","bottom"]);async function A(t,e){if(!t||null==e||!e.position)throw new Error("Invalid container or position!");const o=String(e.position).toLowerCase().trim();let n=o;var r;r=o,E.has(r)||T.has(o)||(console.warn(`Unknown position "${e.position}", defaulting to "bottom-right"`),n="bottom-right"),function(t){t.style.top="auto",t.style.bottom="auto",t.style.left="auto",t.style.right="auto",t.style.transform="none"}(t);const i=function(t){const e=t.toLowerCase().trim();return{hasTop:e.startsWith("top"),hasBottom:e.startsWith("bottom")||e.startsWith("below"),hasLeft:e.startsWith("left"),hasRight:e.startsWith("right"),hasCenter:"center"===e||e.includes("center")&&!e.includes("left")&&!e.includes("right")&&!e.includes("top")&&!e.includes("bottom"),hasFullWidth:"top-full-width"===e||"bottom-full-width"===e}}(n);(function(t,e,o){if(!o.hasFullWidth)return!1;t.style.maxWidth="100vw";try{e&&!e.maxWidth&&(e.maxWidth="100vw")}catch{}return o.hasTop?(t.style.top="10px",t.style.left="10px",t.style.right="10px",!0):!!o.hasBottom&&(t.style.bottom="10px",t.style.left="10px",t.style.right="10px",!0)})(t,e,i)||function(t,e){return!!e.hasCenter&&(!e.hasTop||e.hasLeft||e.hasRight?!e.hasBottom||e.hasLeft||e.hasRight?!e.hasLeft||e.hasTop||e.hasBottom?!e.hasRight||e.hasTop||e.hasBottom?!(e.hasLeft||e.hasRight||e.hasTop||e.hasBottom)&&(t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)",!0):(t.style.right="10px",t.style.top="50%",t.style.transform="translateY(-50%)",!0):(t.style.left="10px",t.style.top="50%",t.style.transform="translateY(-50%)",!0):(t.style.bottom="10px",t.style.left="50%",t.style.transform="translateX(-50%)",!0):(t.style.top="10px",t.style.left="50%",t.style.transform="translateX(-50%)",!0))}(t,i)||function(t,e){e.hasBottom?t.style.bottom="10px":e.hasTop?t.style.top="10px":t.style.bottom="10px",e.hasRight?t.style.right="10px":e.hasLeft?t.style.left="10px":(t.style.left="50%",t.style.transform="translateX(-50%)")}(t,i)}class S{constructor(t,e){this.callback="function"==typeof t?t:()=>{};const o=Number.isFinite(e)&&e>=0?e:0;this.delay=o,this.remaining=o,this.startTime=null,this.timeoutId=null,this.isPaused=!1,this.isCompleted=!1}start(){var t;return this.isCompleted||this.timeoutId||(this.startTime=Date.now(),this.timeoutId=setTimeout(()=>{this.isCompleted=!0,this.timeoutId=null;try{this.callback()}catch(t){console.error("PausableTimer callback error:",t)}},this.remaining),"function"==typeof(null===(t=this.timeoutId)||void 0===t?void 0:t.unref)&&this.timeoutId.unref()),this}pause(){return this.isPaused||!this.timeoutId||this.isCompleted||(clearTimeout(this.timeoutId),this.timeoutId=null,this.remaining-=Date.now()-this.startTime,this.remaining=Math.max(0,this.remaining),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}}const L=new Map,M=new Map,I=[];let N=0;function _(t){if(!t||!t.children)return;if("true"!==t.getAttribute("data-stacked"))return;t._stackedInitialized||"function"!=typeof t.addEventListener||(t._stackedInitialized=!0,t.addEventListener("mouseenter",()=>{t._isExpanded=!0,_(t)}),t.addEventListener("mouseleave",()=>{t._isExpanded=!1,_(t)}),t.addEventListener("focusin",()=>{t._isExpanded=!0,_(t)}),t.addEventListener("focusout",e=>{t.contains(e.relatedTarget)||(t._isExpanded=!1,_(t))}));const e=Array.from(t.children),o=e.length,n=Boolean(t._isExpanded),r=Boolean(t.id&&t.id.includes("top"));e.forEach((t,e)=>{const i=o-1-e;if(t.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",n)t.style.transform="none",t.style.marginTop="0px",t.style.marginBottom="10px",t.style.opacity="1",t.style.zIndex=String(100+e),t.style.pointerEvents="auto";else if(0===i)t.style.transform="scale(1)",t.style.marginTop="0px",t.style.marginBottom="0px",t.style.opacity="1",t.style.zIndex="30",t.style.pointerEvents="auto";else if(1===i){const e=r?10:-10;t.style.transform=`scale(0.95) translateY(${e}px)`,t.style.marginTop="-55px",t.style.marginBottom="0px",t.style.opacity="0.9",t.style.zIndex="20",t.style.pointerEvents="auto"}else if(2===i){const e=r?20:-20;t.style.transform=`scale(0.90) translateY(${e}px)`,t.style.marginTop="-55px",t.style.marginBottom="0px",t.style.opacity="0.75",t.style.zIndex="10",t.style.pointerEvents="auto"}else{const e=r?30:-30;t.style.transform=`scale(0.85) translateY(${e}px)`,t.style.marginTop="-55px",t.style.marginBottom="0px",t.style.opacity="0",t.style.zIndex="1",t.style.pointerEvents="none"}})}async function B(t,e,o){try{if(!t||"object"!=typeof t)throw new TypeError("options must be an object");N++;const n=await k(t,A);if(!n)throw new Error("Failed to create toast container");const r=await async function(t,e){let o;try{return o=await async function(t,e){const o=document.createElement(t);return o.id=function(t="toast"){return`${"string"==typeof t&&t.trim()?t.trim():"toast"}-${Date.now().toString(36)}-${Math.floor(1048575*Math.random()).toString(36)}`}(e),o}("div","toast"),await b(o,t,e),o}catch(n){return console.warn("toast creation failed with error showing fallback one: ",n),o=await v(t,e),o}}(t,j);if(!r)throw new Error("Toast element creation failed");const i=document.createElement("div");Object.assign(i.style,{position:"relative",display:"inline-block",overflow:"visible",marginBottom:"10px",zIndex:"0",width:"100%",pointerEvents:"auto"});const a=document.createElement("div");Object.assign(a.style,{position:"relative",overflow:"hidden",zIndex:"1"}),a.appendChild(r),i.appendChild(a),n.id.includes("toast-container-")&&(n.appendChild(i),t.stacked&&n.setAttribute("data-stacked","true"),"true"===n.getAttribute("data-stacked")&&_(n));const s=!1!==t.pauseOnHover&&(!0===t.pauseOnHover||!!t.cta),l={outer:i,toast:r,options:t,count:Math.max(1,Math.floor(o??0)),pauseOnHover:s};L.set(e,l),r._key=e,l.count>1&&await q(l),l.timer=$(r,t),await z(l)}catch(e){console.error("Something went wrong: ",e),N=Math.max(0,N-1),(document.querySelector('[id^="toast-container-"]')||document.body).appendChild(await v(t,j))}}const O=async function(){try{if(0===L.size){if(M.size>0){const[t,e]=Array.from(M.entries()).at(-1);return null!=e&&e.rafId&&cancelAnimationFrame(e.rafId),void M.delete(t)}return I.length>0?void I.pop():void 0}let t=null;const e=Array.from(L.values());if(e.length>0){const o=e.at(-1);t=o.toast||o.outer&&o.outer.querySelector('[id^="toast-"]')}if(t||document.querySelectorAll('[id^="toast-container-"]').forEach(e=>{const o=Array.from(e.children||[]);if(0===o.length)return;const n=o.at(-1);n&&(t=n.querySelector('[id^="toast-"]')||n)}),!t)return;const o=t._key?t:t.querySelector('[id^="toast-"]')||t;await j(o)}catch(t){console.error("dismissMostRecent failed:",t)}};function $(t,e){const o=Number(null==e?void 0:e.duration),n=Number.isFinite(o)&&o>0?o:2500,r=new S(async()=>await j(t),n+5);return r.start(),r}async function z(t){if(!t.pauseOnHover||!t.outer||!t.timer)return;const{outer:e,timer:o,toast:n}=t,r=()=>{var t;o.pause(),null==n||null===(t=n._progressAnimation)||void 0===t||t.pause()},i=()=>{var t;o.resume(),null==n||null===(t=n._progressAnimation)||void 0===t||t.play()},a=t=>{var e;t.target.matches("[tabindex], div, span, button, a")&&(o.pause(),null==n||null===(e=n._progressAnimation)||void 0===e||e.pause())},s=t=>{var r;e.contains(t.relatedTarget)||(o.resume(),null==n||null===(r=n._progressAnimation)||void 0===r||r.play())};e.addEventListener("mouseenter",r),e.addEventListener("mouseleave",i),e.addEventListener("focusin",a),e.addEventListener("focusout",s),e._pauseCleanup=()=>{e.removeEventListener("mouseenter",r),e.removeEventListener("mouseleave",i),e.removeEventListener("focusin",a),e.removeEventListener("focusout",s)}}async function j(t){if(null!=t&&t._key)return D(t._key)}async function D(t){try{var e,o,n,r,i,a,s,l,c,u,d,p,m,f,h,y;if(!t)return;const g=M.get(t);if(g)return cancelAnimationFrame(g.rafId),void M.delete(t);const b=I.findIndex(e=>e.key===t);if(-1!==b)return void I.splice(b,1);const v=L.get(t);if(!v)return;null===(e=v.timer)||void 0===e||e.clear(),null===(o=v.outer)||void 0===o||null===(n=o._pauseCleanup)||void 0===n||n.call(o),null===(r=v.toast)||void 0===r||null===(i=r._cleanupCloseButton)||void 0===i||i.call(r),null===(a=v.toast)||void 0===a||null===(s=a._cleanupCTA)||void 0===s||s.call(a),null===(l=v.toast)||void 0===l||null===(c=l._cleanupSwipe)||void 0===c||c.call(l),null===(u=v.toast)||void 0===u||null===(d=u._cleanup)||void 0===d||d.call(u);const w=null===(p=v.toast)||void 0===p?void 0:p.querySelector("button, a");null==w||null===(m=w._cleanup)||void 0===m||m.call(w),L.delete(t),N=Math.max(0,N-1);const x=v.outer.querySelector(".toast-count-badge");x&&x.remove();const C=(null===(f=v.toast)||void 0===f?void 0:f._animationDuration)??400;v.toast&&(v.toast.style.opacity="0",v.toast.style.transform="translateY(20px)");const k=null===(h=v.outer)||void 0===h?void 0:h.parentElement;if(await async function(t,e,o=400){return t?new Promise(n=>{let r=!1;const i=()=>{r||(r=!0,async function(t){if(!t)return!0;try{if("function"==typeof t.remove)return t.remove(),!0}catch{}try{if(t.parentNode)return t.parentNode.removeChild(t),!0}catch{}}(t),n())},a=e||t.firstElementChild||t;if(!a)return n();const s=t=>{try{if(t.target!==a)return;a.removeEventListener("transitionend",s,!0),i()}catch(t){console.error("removeWithTransition error:",t)}};try{a.addEventListener("transitionend",s,!0)}catch(t){console.error("removeWithTransition error:",t)}setTimeout(()=>{try{a.removeEventListener("transitionend",s,!0),i()}catch(t){console.error("removeWithTransition error:",t)}},o+100)}):Promise.resolve()}(v.outer,v.toast,C),k&&0===k.children.length&&null!==(y=k.id)&&void 0!==y&&y.startsWith("toast-container-"))try{k.remove()}catch{}else k&&"true"===k.getAttribute("data-stacked")&&_(k);await W()}catch(t){console.error("Closing Toast failed!: ",t)}}async function W(){for(;N<3&&I.length;){const t=I.shift();if(L.has(t.key)){const e=L.get(t.key);e.count+=t.count,await q(e);continue}B(t.options,t.key,t.count)}}async function q({outer:t,count:e}){if(!(t&&t instanceof HTMLElement))throw new Error("updateBadge: outer must be a valid HTMLElement");if(e<2){const e=t.querySelector(".toast-count-badge");return void(e&&e.remove())}let o=t.querySelector(".toast-count-badge");o||(o=document.createElement("span"),o.className="toast-count-badge",o.setAttribute("aria-label",`${e} identical notifications`),Object.assign(o.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"}),t.appendChild(o)),o.textContent=e>99?"99+":String(e);try{o.style.transform="scale(1.2)",setTimeout(()=>o.style.transform="scale(1)",150)}catch(t){console.error("updateBadge animation error:",t)}}async function P(t,e={}){if(!t||"object"!=typeof e||null===e)return;if(M.has(t)){const o=M.get(t);return void(o.options={...o.options,...e})}const o=I.find(e=>e.key===t);if(o)return void(o.options={...o.options,...e});const r=L.get(t);if(!r||!r.toast)return;r.options={...r.options,...e};const i=r.toast,a=i._messageSpan||i.querySelector(".toast-message")||i.querySelector("span:not(.toast-count-badge)");if(void 0!==e.message){const t=String(e.message??""),o=void 0!==e.allowHtml?Boolean(e.allowHtml):Boolean(r.options.allowHtml);if(a){const n=a.querySelector(".toast-loader");if(a.innerHTML="",n&&!1!==e.showLoader&&null!==e.loader){a.appendChild(n);const t=document.createElement("span");t.style.display="inline-block",t.style.width="8px",a.appendChild(t)}if(o&&t.trim().length>0)try{const e=u(t),o=document.createElement("div");for(o.innerHTML=e;o.firstChild;)a.appendChild(o.firstChild)}catch{a.appendChild(document.createTextNode(t))}else a.appendChild(document.createTextNode(t));a.setAttribute("title",t.replace(/<[^>]+>/g,""))}}if(!1===e.showLoader||null===e.loader){const t=null==a?void 0:a.querySelector(".toast-loader");t&&(t.nextSibling&&"SPAN"===t.nextSibling.nodeName&&t.nextSibling.remove(),t.remove())}else if((!0===e.showLoader||e.loader&&"object"==typeof e.loader)&&a&&!a.querySelector(".toast-loader")){const t=d(e.loader||{});a.insertBefore(t,a.firstChild);const o=document.createElement("span");o.style.display="inline-block",o.style.width="8px",a.insertBefore(o,t.nextSibling)}if(e.type){const t=String(e.type).toLowerCase().trim();if(i.className=i.className.replace(/\btoast-(info|success|error|warning)\b/g,`toast-${t}`),!e.backgroundColor){const e={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"};e[t]&&(i.style.background=e[t])}}if(e.backgroundColor&&(i.style.background=e.backgroundColor),e.textColor)i.style.color=e.textColor,a&&(a.style.color=e.textColor);else if(e.type||e.backgroundColor){const t=i.style.background;if(t){const e=n(t);i.style.color=e,a&&(a.style.color=e)}}if(void 0!==e.progress){let t=Number(e.progress);Number.isFinite(t)||(t=0),t<=1&&t>0&&(t*=100),t=Math.min(100,Math.max(0,t));let o=i.querySelector(".toast-progress-bar");if(o||!e.showProgressBar&&!r.options.showProgressBar||(p(i,{...r.options,...e}),o=i.querySelector(".toast-progress-bar")),o){if(i._progressAnimation){try{i._progressAnimation.cancel()}catch{}i._progressAnimation=null}o.style.transition="width 200ms ease",o.style.width=`${t}%`}}else if(!1===e.showProgressBar){const t=i.querySelector(".toast-progress-bar");t&&t.remove()}if(void 0!==e.duration){var s;null===(s=r.timer)||void 0===s||s.clear();const t=Number(e.duration);Number.isFinite(t)&&t>0&&(r.timer=$(i,{duration:t}))}e.sound&&h("string"==typeof e.sound?e.sound:e.type||r.options.type||"info");const l=i.closest('[id^="toast-container-"]');l&&"true"===l.getAttribute("data-stacked")&&_(l)}let R={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"},H={success:"Operation completed successfully!",error:"Something went wrong!",warning:"Warning message!",info:"Information message!"},F=!1,V=null;async function X(t={}){try{const e=await async function(t){var e;const o=null==t||null===(e=t.position)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim(),r={allowHtml:!1,sanitizeHtml:!0,pauseOnHover:void 0,duration:2500,position:"bottom-right",type:"info",borderRadius:"50px",backgroundColor:void 0,textColor:void 0,showCloseButton:!0,animationDuration:"0.4s",animationEasing:"ease",showProgressBar:!0,progressColor:void 0,progressHeight:"4px",progressPosition:"bottom",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:null!=o&&o.includes("top-full-width")||null!=o&&o.includes("bottom-full-width")?"100vw":"400px",..."object"!=typeof t||Array.isArray(t)?{}:t};r.message=(null==t?void 0:t.message)??r.message;try{var i;r.backgroundColor||(r.backgroundColor=(null===(i=R)||void 0===i?void 0:i[r.type])??(window.matchMedia("(prefers-color-scheme: dark)").matches?"#f5f5f5":"#111111"))}catch(t){console.warn("Background color resolution failed:",t)}try{var a;r.message=r.message||(null===(a=H)||void 0===a?void 0:a[r.type])||"No Message Provided!"}catch(t){console.warn("Default message resolution failed:",t)}try{!r.textColor&&r.backgroundColor&&(r.textColor=n(r.backgroundColor))}catch(t){console.warn("Text color resolution failed:",t)}try{!r.progressColor&&r.backgroundColor&&(r.progressColor=r.textColor||n(r.backgroundColor))}catch(t){console.warn("Progress bar color resolution failed:",t)}return"string"!=typeof r.message&&(r.message="No Message Provided!"),r}(t);return await async function(t){try{return await k(t,A)}catch(t){return console.error("Failed to create toast container:",t),document.body}}(e),await async function(t={}){try{const e=function(t={}){const e=t&&"object"==typeof t?t:{};return`${String(e.type||"info").trim().toLowerCase()}|${function(t){let e=5381;for(let o=0;o<t.length;o++)e=(e<<5)+e+t.charCodeAt(o);return e>>>0}(String(e.message||"")).toString(16)}|${C(e.position||"bottom-right")}`}(t);if(L.has(e)){const o=L.get(e);if(!o)throw new Error(`Active toast with key ${e} not found`);return o.count++,o.timer.clear(),o.timer=$(o.toast,t),await z(o),await q(o),e}if(M.has(e)){const t=M.get(e);if(!t)throw new Error(`Pending toast with key ${e} not found`);return t.count++,e}const o={options:t,count:1,rafId:0};return M.set(e,o),o.rafId=requestAnimationFrame(async()=>{const t=M.get(e);if(t){if(M.delete(e),N>=3)return I.push({options:t.options,key:e,count:t.count}),void await W();try{await B(t.options,e,t.count)}catch(t){console.error("showToast failed:",t)}}}),e}catch(t){console.error("showToast failed:",t)}}(e)}catch(t){return console.error("CreateToast failed:",t),null}}function Y(t){try{if(t&&"object"==typeof t&&!Array.isArray(t)){const e=["success","error","warning","info"],o={};for(const[n,r]of Object.entries(t))e.includes(n)&&"string"==typeof r&&r.trim()&&(o[n]=r.trim());Object.keys(o).length>0&&(R={...R,...o})}}catch(t){console.error("setDefaultColors failed:",t)}}function G(t){try{if(t&&"object"==typeof t&&!Array.isArray(t)){const e=["success","error","warning","info"],o={};for(const[n,r]of Object.entries(t))e.includes(n)&&"string"==typeof r&&r.trim()&&(o[n]=r.trim());Object.keys(o).length>0&&(H={...H,...o})}}catch(t){console.error("setDefaultMessages failed:",t)}}let U=!1,K=null;async function J(t={}){const e=await async function(){if(U&&K)try{await K}catch(t){console.warn("Previous close operation failed (continuing anyway):",t)}return async function(t={}){return"undefined"!=typeof window&&"undefined"!=typeof document?(await async function(){F||"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?(V||(V=new Promise(t=>{document.addEventListener("DOMContentLoaded",()=>{F=!0,t()},{once:!0})})),await V):F=!0)}(),await X(t)):(console.warn("ToastNotification: running in non-browser environment, no DOM available."),null)}(t)}();return{dismiss:()=>e?D(e):Promise.resolve(),update:t=>e?P(e,t):Promise.resolve()}}const Q=async()=>{U=!0,K=(async()=>{try{await O()}finally{U=!1,K=null}})(),await K},Z=async()=>{U=!0,K=(async()=>{try{await async function(){try{for(const[,t]of M)null!=t&&t.rafId&&cancelAnimationFrame(t.rafId);M.clear(),I.length=0;const t=Array.from(L.values()).map(t=>t.toast).filter(Boolean);await Promise.allSettled(t.map(async t=>{try{await j(t)}catch(t){console.warn("closeAllToasts: failed to close one toast:",t)}}))}catch(t){console.error("closeAllToasts failed:",t)}}()}finally{U=!1,K=null}})(),await K};async function tt(t,e={},o={}){const n=e&&"object"==typeof e?e:{},r=o&&"object"==typeof o?o:{},i=n.loading??"Loading...",a=await J({...r,type:"info",message:i,duration:864e5,showProgressBar:!1,pauseOnHover:!1}),s={...r,pauseOnHover:r.pauseOnHover};try{const e="function"==typeof t?t():t,o=await e;await a.dismiss();const r="function"==typeof n.success?n.success(o):n.success??"Done!";return await J({...s,type:"success",message:r}),o}catch(t){await a.dismiss();const e="function"==typeof n.error?n.error(t):n.error??"Something went wrong.";throw await J({...s,type:"error",message:e}),t}}const et="3.13.0";if("undefined"!=typeof window&&"undefined"!=typeof document&&!window.__customizableToastEscapeAttached){window.__customizableToastEscapeAttached=!0;const t=t=>{"Escape"!==t.key&&"Esc"!==t.key||(async()=>{try{U=!0,K=(async()=>{try{await O()}finally{U=!1,K=null}})(),await K}catch(t){console.error("Escape key dismiss failed:",t),U=!1,K=null}})()};window.addEventListener("keydown",t,{passive:!0})}try{"undefined"!=typeof window&&(window.customizableToast={version:et,createToast:J,setDefaultColors:Y,setDefaultMessages:G,noop:Z,dismiss:Q,toastPromise:tt,updateToastByKey:P,setAudioEnabled:y,isAudioEnabled:g,playTone:h})}catch(t){console.error("Global assignment failed:",t)}exports.createToast=J,exports.dismiss=Q,exports.isAudioEnabled=g,exports.noop=Z,exports.playTone=h,exports.resetContainerRegistry=function(){w.clear(),x.clear()},exports.resetToastManager=function(){for(const[,t]of M)null!=t&&t.rafId&&cancelAnimationFrame(t.rafId);M.clear(),I.length=0;for(const[,d]of L){var t,e,o,n,r,i,a,s,l,c,u;null===(t=d.timer)||void 0===t||t.clear(),null===(e=d.outer)||void 0===e||null===(o=e._pauseCleanup)||void 0===o||o.call(e),null===(n=d.toast)||void 0===n||null===(r=n._cleanupCloseButton)||void 0===r||r.call(n),null===(i=d.toast)||void 0===i||null===(a=i._cleanupCTA)||void 0===a||a.call(i),null===(s=d.toast)||void 0===s||null===(l=s._cleanupSwipe)||void 0===l||l.call(s),null===(c=d.toast)||void 0===c||null===(u=c._cleanup)||void 0===u||u.call(c)}L.clear(),N=0},exports.setAudioEnabled=y,exports.setDefaultColors=Y,exports.setDefaultMessages=G,exports.toastPromise=tt,exports.updateToastByKey=P,exports.version=et;
|
|
15
|
+
"use strict";const e=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",syncTabs:!1,aiPrioritization:!1,priorityScorer:null,onMetrics:null}),t={...e};function n(e={}){if(!e||"object"!=typeof e||Array.isArray(e))return i();const{maxVisible:n,maxQueueSize:o,zIndex:s,targetNode:r,disableInlineStyles:a,reducedMotion:l,defaultPosition:c,theme:u,stacked:d,swipeToDismiss:p,sound:m,soundPreset:f,syncTabs:h,aiPrioritization:y,priorityScorer:g,onMetrics:b}=e;if(void 0!==n){const e=Number(n);Number.isFinite(e)&&e>0&&(t.maxVisible=Math.max(1,Math.floor(e)))}if(void 0!==o){const e=Number(o);Number.isFinite(e)&&e>=0&&(t.maxQueueSize=Math.floor(e))}if(void 0!==s){const e=Number(s);Number.isFinite(e)&&(t.zIndex=Math.trunc(e))}if(void 0!==r&&(t.targetNode=r&&"object"==typeof r&&"function"==typeof r.appendChild?r:null),void 0!==a&&(t.disableInlineStyles=Boolean(a)),void 0!==l){const e=String(l||"auto").toLowerCase();["auto","always","never"].includes(e)&&(t.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&&(t.defaultPosition=e)}if(void 0!==u){const e=String(u||"light").toLowerCase();["light","dark","high-contrast","compact","spacious","glass"].includes(e)&&(t.theme=e,"undefined"!=typeof document&&document.documentElement.setAttribute("data-toast-theme",e))}if(void 0!==d&&(t.stacked=Boolean(d)),void 0!==p&&(t.swipeToDismiss=Boolean(p)),void 0!==m&&(t.sound=Boolean(m)),void 0!==f){const e=String(f||"modern").toLowerCase().trim();e&&(t.soundPreset=e)}return void 0!==h&&(t.syncTabs=Boolean(h)),void 0!==y&&(t.aiPrioritization=Boolean(y)),void 0!==g&&(t.priorityScorer="function"==typeof g?g:null),void 0!==b&&(t.onMetrics="function"==typeof b?b:null),i()}function o(){return Object.assign(t,e),"undefined"!=typeof document&&(document.documentElement.removeAttribute("data-toast-theme"),document.documentElement.removeAttribute("data-toast-reduced-motion")),i()}function i(){return{...t}}function s(){if("always"===t.reducedMotion)return!0;if("never"===t.reducedMotion)return!1;try{return Boolean("undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)}catch{return!1}}let r=0;const a=Math.floor(65535*Math.random()).toString(36).padStart(3,"0");function l(){r=0}function c(e="toast"){const t="string"==typeof e?e.trim().replace(/[^a-zA-Z0-9_-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""):"",n=t&&!/^[0-9]/.test(t)?t:"toast",o=Date.now().toString(36);r=r+1&16777215;const i=r.toString(36);return`${n}-${o}-${a}${i}`}const u=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),d={};function p(e){if(!e)return"snow";const t=String(e),n=u.get(t);if(n)return n;if(d[e?.toLowerCase()]){const n=d[e.toLowerCase()];return u.set(t,n),n}let o,i,s;try{const t=function(e){const t=e?.match(/^#([0-9a-f]{3,8})$/i);if(t){let e=t[1];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?.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/i);if(n)return{r:Number(n[1]),g:Number(n[2]),b:Number(n[3])};const o=e?.match(/hsla?\(\s*([\d.]+)(?:deg)?\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*[\d.]+)?\)/i);if(o){const e=Number(o[1])/360,t=Number(o[2])/100,n=Number(o[3])/100;if(0===t){const e=Math.round(255*n);return{r:e,g:e,b:e}}const i=(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),s=n<.5?n*(1+t):n+t-n*t,r=2*n-s;return{r:Math.round(255*i(r,s,e+1/3)),g:Math.round(255*i(r,s,e)),b:Math.round(255*i(r,s,e-1/3))}}return null}(function(e){const t=e?.match(/^var\((--[\w-]+)(?:\s*,\s*(.+))?\)$/i);if(!t)return e;try{if("undefined"!=typeof document&&"function"==typeof getComputedStyle){const e=getComputedStyle(document.documentElement).getPropertyValue(t[1]).trim();if(e)return e}}catch(e){}return t[2]?.trim()||e}(e));if(!t)throw new Error("Unknown color");({r:o,g:i,b:s}=t)}catch{o=i=s=128}const r=(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=r(...e),o=r(...t);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)};let[l,c,p]=((e,t,n)=>{e/=255,t/=255,n/=255;const o=Math.max(e,t,n),i=Math.min(e,t,n);let s,r,a=(o+i)/2;if(o===i)s=r=0;else{const l=o-i;switch(r=a>.5?l/(2-o-i):l/(o+i),o){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4}s/=6}return[360*s,r,a]})(o,i,s),m=p<.5?Math.min(p+.5,1):Math.max(p-.5,0),[f,h,y]=((e,t,n)=>{let o,i,s;if(e/=360,0===t)o=i=s=n;else{const r=(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=r(l,a,e+1/3),i=r(l,a,e),s=r(l,a,e-1/3)}return[Math.round(255*o),Math.round(255*i),Math.round(255*s)]})(l,c,m);if(a([o,i,s],[f,h,y])<4.5){const e=a([o,i,s],[0,0,0]),t=a([o,i,s],[255,255,255]);[f,h,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")}`)(f,h,y);return u.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],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)},s=.2126*i(t)+.7152*i(n)+.0722*i(o),r=(s+.05)/.05,a=1.05/(s+.05);d[e.toLowerCase()]=r>=a?"#000000":"#ffffff"});const m=new Set(["DIV","SPAN","P","BR","STRONG","B","EM","I","U","SMALL","UL","OL","LI","A","IMG","PRE","CODE","MARK"]),f=new Set(["href","src","alt","title","class","target","rel","loading"]),h=/<\/?(script|iframe|object|embed|link|meta|style|form|input|button|svg|math|video|audio|details|dialog|applet|frame|frameset|textarea|select|option|optgroup|fieldset|legend|datalist|output|progress|meter|keygen|canvas|map|area|base|basefont|bgsound|blink|center|dir|font|hgroup|isindex|listing|marquee|multicol|nextid|noembed|noframes|plaintext|rb|rtc|spacer|strike|tt|xmp)[^>]*>/gi,y=/\s(on\w+)\s*=\s*(['"])[\s\S]*?\2/gi,g=/(href|src)\s*=\s*(['"])\s*javascript:[^'"]*\2/gi;function b(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(!t.has(o)){const o=document.createDocumentFragment();return Array.from(e.childNodes).forEach(e=>{const i=b(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(),s=o.value;if(t.has(i))if("href"!==i&&"src"!==i||!/^\s*javascript:/i.test(s))if("src"!==i||/^\s*(https?:|data:image\/)/i.test(s)){if("target"===i&&"_blank"===s){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(i);else n.push(i);else n.push(i)}),n.forEach(t=>e.removeAttribute(t))}(i,n),Array.from(e.childNodes).forEach(e=>{const o=b(e,t,n);o&&i.appendChild(o)}),i}function w(e,t={}){if("string"!=typeof e||!e.trim())return"";try{if(!t.forceFallback&&function(){try{if("undefined"!=typeof window&&window.DOMPurify)return!0}catch(e){}return!1}()){const t=window.DOMPurify.sanitize(e,{ALLOWED_TAGS:Array.from(m),ALLOWED_ATTR:Array.from(f),ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|ftp|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i}),n=document.createElement("div");return n.innerHTML=t,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 function(e){if(!e||"string"!=typeof e)return"";let t=e.replace(h,"");t=t.replace(y,""),t=t.replace(g,"$1=$2#$2");const n=document.createElement("div");n.innerHTML=t;const o=document.createDocumentFragment();Array.from(n.childNodes).forEach(e=>{const t=b(e,m,f);t&&o.appendChild(t)});const i=document.createElement("div");return i.appendChild(o),i.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(" "))}),i.innerHTML}(e)}function x(e={}){const t=e&&"object"==typeof e&&!Array.isArray(e)?e:{},n=Number(t.size)||14,o="string"==typeof t.color&&t.color.trim()?t.color.trim():"currentColor",r="string"==typeof t.text?t.text:"",a=document.createElement("span");a.className="toast-loader";const l=i();l.disableInlineStyles||(a.style.display="inline-flex",a.style.alignItems="center",a.style.gap="8px");const c="http://www.w3.org/2000/svg",u=document.createElementNS(c,"svg");u.setAttribute("width",String(n)),u.setAttribute("height",String(n)),u.setAttribute("viewBox","0 0 50 50"),u.setAttribute("aria-hidden","true");const d=document.createElementNS(c,"circle");if(d.classList.add("toast-loader-circle"),d.setAttribute("cx","25"),d.setAttribute("cy","25"),d.setAttribute("r","20"),d.setAttribute("fill","none"),d.setAttribute("stroke",o),d.setAttribute("stroke-width","4"),d.setAttribute("stroke-linecap","round"),l.disableInlineStyles||(d.style.opacity="0.85",d.style.strokeDasharray="90",d.style.strokeDashoffset="60",d.style.transformOrigin="center",s()||(d.style.animation="toast-spinner 1s linear infinite")),u.appendChild(d),a.appendChild(u),r){const e=document.createElement("span");e.className="toast-loader-label",l.disableInlineStyles||(e.style.fontSize="13px"),e.textContent=r,a.appendChild(e)}if(!l.disableInlineStyles&&"undefined"!=typeof document&&!document.getElementById("toast-spinner-styles")){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)}return a}function T(e){return e&&"#000000"===p(e)?"rgba(0,0,0,0.15)":"rgba(255,255,255,0.15)"}function v(e,t){const n=document.createElement("div");n.className="toast-progress-bar",e._progressBar=n;const o=t.borderRadius||"0",r=parseInt(o,10),a=parseInt(t.progressHeight,10)||4,l=Number(t.duration??2500)+5,c=Math.min(r,2*a),u=r>0?`calc(100% - ${c}px)`:"100%";if(i().disableInlineStyles||Object.assign(n.style,{position:"absolute",left:`${c}px`,height:`${a}px`,background:t.progressColor||"currentColor",width:`${u}`,transition:`width ${l}ms linear`,["top"===t.progressPosition?"top":"bottom"]:"0",borderRadius:a/2+"px",opacity:"0.8"}),e.appendChild(n),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)),n.style.width=`${e}%`,void(n.style.transition="width 200ms ease")}s()?n.style.display="none":"function"==typeof n.animate?e._progressAnimation=n.animate([{width:u},{width:"0%"}],{duration:l,easing:"linear",fill:"forwards",delay:50}):(n.style.transition=`width ${l}ms linear`,requestAnimationFrame(()=>{n.style.width="0%"}))}let A=null,S=!0;const C=new Map;function k(){if("undefined"==typeof window)return null;const e=window.AudioContext||window.webkitAudioContext;if(!e)return null;if(!A)try{A=new e}catch{return null}if(A&&"suspended"===A.state)try{A.resume().catch(()=>{})}catch{}return A}let E=null;function M(){const e=k();if(!e||"function"!=typeof e.createAnalyser)return null;if(!E)try{E=e.createAnalyser(),E.fftSize=128,E.connect(e.destination)}catch{return null}return E}function L(e,t){E?t.connect(E):t.connect(e.destination)}const I={modern:function(e,t,n){if("success"===t)[523.25,659.25,783.99].forEach((t,o)=>{const i=e.createOscillator(),s=e.createGain();i.type="sine",i.frequency.setValueAtTime(t,n+.08*o),s.gain.setValueAtTime(.001,n+.08*o),s.gain.exponentialRampToValueAtTime(.12,n+.08*o+.02),s.gain.exponentialRampToValueAtTime(1e-4,n+.08*o+.35),i.connect(s),L(e,s),i.start(n+.08*o),i.stop(n+.08*o+.36)});else if("error"===t)[320,240].forEach((t,o)=>{const i=e.createOscillator(),s=e.createGain();i.type="triangle",i.frequency.setValueAtTime(t,n+.1*o),s.gain.setValueAtTime(.001,n+.1*o),s.gain.exponentialRampToValueAtTime(.15,n+.1*o+.02),s.gain.exponentialRampToValueAtTime(1e-4,n+.1*o+.22),i.connect(s),L(e,s),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),L(e,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),L(e,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(),s=e.createGain();i.type="square";const r=n+.045*o;i.frequency.setValueAtTime(t,r),s.gain.setValueAtTime(.001,r),s.gain.linearRampToValueAtTime(.08,r+.005),s.gain.exponentialRampToValueAtTime(1e-4,r+.042),i.connect(s),L(e,s),i.start(r),i.stop(r+.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),L(e,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 s=n+t;o.frequency.setValueAtTime(880,s),i.gain.setValueAtTime(.001,s),i.gain.linearRampToValueAtTime(.07,s+.005),i.gain.exponentialRampToValueAtTime(1e-4,s+.05),o.connect(i),L(e,i),o.start(s),o.stop(s+.055)}):[987.77,1318.51].forEach((t,o)=>{const i=e.createOscillator(),s=e.createGain();i.type="square";const r=n+.035*o;i.frequency.setValueAtTime(t,r),s.gain.setValueAtTime(.001,r),s.gain.linearRampToValueAtTime(.08,r+.005),s.gain.exponentialRampToValueAtTime(1e-4,r+.035),i.connect(s),L(e,s),i.start(r),i.stop(r+.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),L(e,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),L(e,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),L(e,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),L(e,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(),s=e.createGain();i.type="sine";const r=n+.04*o;i.frequency.setValueAtTime(t,r),s.gain.setValueAtTime(.001,r),s.gain.linearRampToValueAtTime(.04,r+.003),s.gain.exponentialRampToValueAtTime(1e-4,r+.025),i.connect(s),L(e,s),i.start(r),i.stop(r+.03)});else if("error"===t)[180,130].forEach((t,o)=>{const i=e.createOscillator(),s=e.createGain();i.type="triangle";const r=n+.05*o;i.frequency.setValueAtTime(t,r),s.gain.setValueAtTime(.001,r),s.gain.linearRampToValueAtTime(.05,r+.005),s.gain.exponentialRampToValueAtTime(1e-4,r+.035),i.connect(s),L(e,s),i.start(r),i.stop(r+.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),L(e,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),L(e,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(),s=e.createGain();i.type="sine",i.frequency.setValueAtTime(t,n);const r=.09/(o+1);s.gain.setValueAtTime(.001,n),s.gain.exponentialRampToValueAtTime(r,n+.015),s.gain.exponentialRampToValueAtTime(1e-4,n+.55),i.connect(s),L(e,s),i.start(n),i.stop(n+.58)});else if("error"===t)[220,440].forEach((t,o)=>{const i=e.createOscillator(),s=e.createGain();i.type="triangle",i.frequency.setValueAtTime(t,n);const r=.1/(o+1);s.gain.setValueAtTime(.001,n),s.gain.exponentialRampToValueAtTime(r,n+.015),s.gain.exponentialRampToValueAtTime(1e-4,n+.38),i.connect(s),L(e,s),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),L(e,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),L(e,o),t.start(n),t.stop(n+.3)}}};function N(e="info",t){if("undefined"!=typeof window&&window.customizableToast&&"function"==typeof window.customizableToast.playTone&&window.customizableToast.playTone!==N)return void window.customizableToast.playTone(e,t);if(!S)return;const n=k();if(n)try{const o=n.currentTime,s=String(e||"info").toLowerCase().trim(),r=String(t||i().soundPreset||"modern").toLowerCase().trim();if(C.has(r))try{const e=C.get(r);if("function"==typeof e)return void e(n,s,o)}catch(e){console.warn("Custom sound preset synthesizer error:",e)}(I[r]||I.modern)(n,s,o)}catch{}}function _(e,t){if("string"!=typeof e||!e.trim()||"function"!=typeof t)return!1;const n=e.toLowerCase().trim();return C.set(n,t),!0}function z(){const e=Object.keys(I),t=Array.from(C.keys());return Array.from(new Set([...e,...t]))}function V(){C.clear()}function q(e){S=Boolean(e)}function P(){return S}function R(){if(A)try{A.close?.().catch?.(()=>{})}catch{}A=null,E=null}const O={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)"}},B=new Map;function $(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);B.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 D(){return[...Object.keys(O),...B.keys()]}function F(){B.clear()}function j(e){if(!e)return null;if("string"==typeof e){const t=e.trim().toLowerCase();return B.has(t)?B.get(t):Object.prototype.hasOwnProperty.call(O,t)?O[t]:O.default}if(!0===e)return O.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,s=Number.isFinite(n)&&n>0?n:10,r=Number.isFinite(o)&&o>0?o:1,a=s/(2*Math.sqrt(i*r));let l="cubic-bezier(0.25, 1, 0.5, 1)";return 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:s,mass:r,bezierFallback:l}}return null}function W(e,t){if(e<=0)return 0;const n=Math.max(.001,t.stiffness||100),o=Math.max(.001,t.damping||10),i=Math.max(.001,t.mass||1),s=Math.sqrt(n/i),r=o/(2*Math.sqrt(n*i));if(r<1){const t=s*Math.sqrt(1-r*r);return 1-Math.exp(-r*s*e)*(Math.cos(t*e)+r/Math.sqrt(1-r*r)*Math.sin(t*e))}if(Math.abs(r-1)<1e-5)return 1-Math.exp(-s*e)*(1+s*e);const a=s*Math.sqrt(r*r-1);return 1-Math.exp(-r*s*e)*(Math.cosh(a*e)+r/Math.sqrt(r*r-1)*Math.sinh(a*e))}function H(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 s=3;for(let e=.1;e<=3;e+=.01){const r=W(e,{stiffness:n,damping:o,mass:i});if(Math.abs(r-1)<=t){let r=!0;for(let s=e;s<=Math.min(3,e+.12);s+=.01)if(Math.abs(W(s,{stiffness:n,damping:o,mass:i})-1)>t){r=!1;break}if(r){s=e;break}}}const r=Math.round(1e3*s);return Math.max(150,Math.min(2500,r))}function U(e,t=32){const n=H(e)/1e3,o=[];for(let i=0;i<=t;i++){const s=i/t,r=W(s*n,e),a=Math.round(1e3*r)/1e3,l=Math.round(1e3*s)/10;o.push(`${a} ${l}%`)}return`linear(${o.join(", ")})`}function G(e){const t=j(e);if(!t)return null;const n=H(t),o=U(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, 1)")}catch{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}}async function Y(e={},t){try{const n=i(),o=document.createElement("div"),s=e?.position||n.defaultPosition,r=String(s).toLowerCase().trim();let a="auto",l="auto",c="auto",u="auto",d="none";r.startsWith("top")?a="20px":(r.startsWith("bottom")||r.includes("below"))&&(l="20px"),r.startsWith("left")?c="20px":r.startsWith("right")?u="20px":"center"===r?(c="50%",a="50%",d="translate(-50%, -50%)"):r.includes("center")?r.includes("left")?(c="20px",a="50%",d="translateY(-50%)"):r.includes("right")?(u="20px",a="50%",d="translateY(-50%)"):r.includes("top")?(a="20px",c="50%",d="translateX(-50%)"):r.includes("bottom")&&(l="20px",c="50%",d="translateX(-50%)"):(u="20px",l="20px"),o.className="toast-emergency",n.disableInlineStyles||Object.assign(o.style,{background:"#333",color:"white",padding:"10px 15px",position:"fixed",top:a,bottom:l,left:c,right:u,transform:d,zIndex:String(n.zIndex+100),borderRadius:"3px",maxWidth:"250px",wordWrap:"break-word",boxShadow:"0 2px 10px rgba(0,0,0,0.3)"});const p=document.createElement("div"),m=document.createElement("span");m.className="toast-emergency-message",n.disableInlineStyles||(m.style.display="inline-block"),e.allowHtml?m.innerHTML=w(String(e.message||"Emergency Toast Showing!")):m.textContent=String(e.message||"Emergency Toast Creation Showing!"),p.appendChild(m);const f=document.createElement("span");for(f.className="toast-emergency-close",n.disableInlineStyles||Object.assign(f.style,{float:"right",marginLeft:"10px",fontWeight:"bold",cursor:"pointer"}),f.textContent="×",p.appendChild(f);o.firstChild;)o.removeChild(o.firstChild);o.appendChild(p);let h=null;const y=()=>{h&&clearTimeout(h),f.removeEventListener("click",y),o.remove(),"function"==typeof t&&t(o)};f.addEventListener("click",y);const g=Number(e?.duration)||2500;return h=setTimeout(()=>{f.removeEventListener("click",y),o.remove(),"function"==typeof t&&t(o)},g),"function"==typeof h?.unref&&h.unref(),o}catch(e){return console.error("Emergency toast creation failed:",e),"function"==typeof t&&t(null),null}}class X{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(){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);return!t&&this.pool.length<this.maxSize&&(t={element:this._createToastElement(),inUse:!1,id:null},this.pool.push(t)),t||(t=this.pool[0],t.element.parentNode&&t.element.parentNode.removeChild(t.element)),t.element.innerHTML="",t.element.className="toast",t.element.setAttribute("role","alert"),t.element.id=`toast-${e}`,t.inUse=!0,t.id=e,this.inUseCount+=1,t.element}release(e,t){if(!e||!t)return;const n=this.pool.find(e=>e.id===t);n&&n.inUse&&(n.element.parentNode&&n.element.parentNode.removeChild(n.element),n.element=this._createToastElement(),n.inUse=!1,n.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 Q=null;function K(e=5,t=50){return Q||(Q=new X(e,t)),Q}function Z(){Q&&(Q.clear(),Q=null)}async function J(e,t){let n;const o="toast";try{if(e?.usePool){const e=c(o);n=K().acquire(e),n._pooledId=e}else n=await async function(e,t){const n=document.createElement("div");return n.id=c(t),n}(0,o);return await async function(e,t,n){const o=i(),r=t?.spring?G(t.spring):null,a=r?r.duration:await async function(e){if("number"==typeof e&&Number.isFinite(e)&&e>0)return e;if("string"==typeof e){if(e.endsWith("s")&&!e.endsWith("ms")){const t=1e3*parseFloat(e);return Number.isFinite(t)&&t>0?t:500}const t=parseFloat(e);return Number.isFinite(t)&&t>0?t:500}return 500}(t?.animationDuration),l=`${a}ms`,c=r?r.easing:"string"==typeof t?.animationEasing&&t.animationEasing.trim()?t.animationEasing.trim():"ease";r&&(e._spring=r);const u="string"==typeof t?.className&&t.className.trim()?` ${t.className.trim()}`:"";e.className=`toast toast-${t?.type??"info"}${u}`;const d="number"==typeof t?.borderRadius?`${t.borderRadius}px`:t?.borderRadius,m="number"==typeof t?.maxWidth?`${t.maxWidth}px`:t?.maxWidth,f=r?`${Math.min(300,a)}ms`:l,h=r?"ease":c;o.disableInlineStyles||Object.assign(e.style,{background:t?.backgroundColor,padding:"12px 16px",marginBottom:"10px",borderRadius:d,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"space-between",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",minWidth:"250px",maxWidth:m,opacity:"0",position:"relative",cursor:"default",boxSizing:"border-box",userSelect:"text",pointerEvents:"auto",transition:`opacity ${f} ${h}, transform ${l} ${c}`,transform:"translateY(20px)",zIndex:String(o.zIndex)}),e.setAttribute("role","alert"),e.setAttribute("aria-live","polite"),e.tabIndex=0,e._animationDuration=a;const y=document.createElement("span");y.className="toast-message",e._messageSpan=y,"truncate"!==t?.wrapText&&"ellipsis"!==t?.wrapText&&!1!==t?.wrapText&&t?.wrapText?o.disableInlineStyles||Object.assign(y.style,{display:"block",whiteSpace:"normal"}):(y.classList.add("is-truncated"),o.disableInlineStyles||Object.assign(y.style,{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",whiteSpace:"normal",overflow:"hidden",textOverflow:"ellipsis"}));const g="number"==typeof t?.fontSize?`${t.fontSize}px`:t?.fontSize;o.disableInlineStyles||Object.assign(y.style,{flex:"1",padding:t?.fontPadding,fontFamily:t?.fontFamily,fontSize:g,fontWeight:t?.fontWeight,lineHeight:t?.fontLineHeight,color:t?.textColor,userSelect:"text",wordBreak:"break-word",overflow:"hidden",textOverflow:"ellipsis",direction:t?.fontDirection&&"auto"!==t.fontDirection?t.fontDirection:void 0});const b=!!t.allowHtml,A=t.message??"";if(t.loader||t.showLoader){const e=x(t.loader||{});y.appendChild(e);const n=document.createElement("span");n.className="toast-message-spacer",o.disableInlineStyles||(n.style.display="inline-block",n.style.width="8px"),y.appendChild(n)}if(b&&"string"==typeof A&&A.trim().length>0)try{const e=w(A),t=document.createElement("div");for(t.innerHTML=e;t.firstChild;)y.appendChild(t.firstChild)}catch(e){console.warn("HTML message sanitization failed, falling back to text:",e),y.appendChild(document.createTextNode(String(A)))}else y.appendChild(document.createTextNode(String(A)));y.setAttribute("title","string"==typeof A?A.replace(/<[^>]+>/g,""):String(A)),e.appendChild(y),t?.cta&&0!==Object.keys(t.cta).length&&function(e,t,n){const o=t?.cta;if(!o||"object"!=typeof o)return;const s=Array.isArray(o)?o.filter(Boolean):[o];if(0===s.length)return;const r=[];s.forEach((o,a)=>{if(!o||"object"!=typeof o)return;const l={...o};l.label||(l.label=s.length>1?`Action ${a+1}`:"CTA Label Missing!");const c="link"===l.variant||!l.variant&&!!l.href,u=document.createElement(c?"a":"button");c?(u.href=l.href,l.target&&(u.target=l.target),u.rel=l.rel||("_blank"===l.target?"noopener noreferrer":"")):u.type="button",u.setAttribute("aria-label",l.ariaLabel||l.label);const d=t.textColor||p(t.backgroundColor),m=t.backgroundColor?T(t.backgroundColor):"rgba(255,255,255,0.15)",f="string"==typeof d&&/^#[0-9a-fA-F]{6}$/.test(d.trim())?`${d.trim()}44`:"rgba(128, 128, 128, 0.3)";u.className="toast-cta",i().disableInlineStyles||Object.assign(u.style,{marginLeft:0===a?"10px":"6px",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",border:`1px solid ${f}`,color:d,background:m,cursor:"pointer",whiteSpace:"nowrap",flexShrink:"0"}),u.textContent=l.label;const h=async t=>{try{if("function"==typeof l.onClick){const e=l.onClick(t);e?.then&&await e}}catch(e){console.error("CTA onClick handler error:",e)}finally{!1!==l.autoClose&&"function"==typeof n&&n(e)}};u.addEventListener("click",h);const y=()=>u.removeEventListener("click",h);u._cleanup=y,r.push(y),e.appendChild(u)});const a=e._cleanupCTA;e._cleanupCTA=()=>{a?.(),r.forEach(e=>e())}}(e,t,n),t?.undo&&function(e,t,n){const o=t?.undo;if(!o)return;const s="function"==typeof o;if(!s&&("object"!=typeof o||Array.isArray(o)))return;const r=s?{onUndo:o}:{...o},a="string"==typeof r.label&&r.label.trim()?r.label.trim():"Undo",l=Number(t?.duration),c=!1!==r.showCountdown&&Number.isFinite(l)&&l>0,u=document.createElement("button");u.type="button",u.className="toast-undo-btn",u.setAttribute("aria-label",`${a} action`);const d=t.textColor||p(t.backgroundColor),m=t.backgroundColor?T(t.backgroundColor):"rgba(255,255,255,0.18)",f="string"==typeof d&&/^#[0-9a-fA-F]{6}$/.test(d.trim())?`${d.trim()}55`:"rgba(128, 128, 128, 0.35)";i().disableInlineStyles||Object.assign(u.style,{marginLeft:"10px",padding:"5px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"700",lineHeight:"1",border:`1px solid ${f}`,color:d,background:m,cursor:"pointer",whiteSpace:"nowrap",flexShrink:"0",display:"inline-flex",alignItems:"center",gap:"4px"});let h=Math.max(1,Math.ceil((l||2500)/1e3));const y=()=>{u.textContent=c?`${a} (${h}s)`:a};y();let g=null;c&&(g=setInterval(()=>{h=Math.max(0,h-1),y(),h<=0&&g&&(clearInterval(g),g=null)},1e3),"function"==typeof g?.unref&&g.unref());const b=()=>{g&&(clearInterval(g),g=null)},w=async t=>{b(),u.removeEventListener("click",w);try{if("function"==typeof r.onUndo){const n=r.onUndo(t,e);n?.then&&await n}}catch(e){console.error("Undo action error:",e)}finally{"function"==typeof n&&n(e)}};u.addEventListener("click",w),u._cleanup=()=>{b(),u.removeEventListener("click",w)},e._cleanupUndo=()=>{b(),u.removeEventListener("click",w)},e.appendChild(u)}(e,t,n),t?.showCloseButton&&function(e,t,n){const o=document.createElement("button");o.setAttribute("aria-label","Close notification"),o.setAttribute("title","Close"),o.textContent="×";const s=t.textColor||p(t.backgroundColor);o.className="toast-close-btn",i().disableInlineStyles||Object.assign(o.style,{background:"none",border:"none",color:s,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)}(e,t,n),t?.showProgressBar&&v(e,t),!1!==t?.swipeToDismiss&&function(e,t){if(!e||"function"!=typeof e.addEventListener)return;let n=0,o=0,r=0,a=0,l=!1,c=!1,u=!1;const d=()=>{u&&(u=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",f))},p=t=>{if(!t)return;const i=t.touches?t.touches[0]:t;n=i.clientX,o=i.clientY,r=n,a=Date.now(),l=!0,c=!1,e.style.transition="none",e.style.userSelect="none",u||"undefined"==typeof window||(u=!0,window.addEventListener("mousemove",m,{passive:!1}),window.addEventListener("mouseup",f,{passive:!0}))},m=t=>{if(!l||!t)return;const a=t.touches?t.touches[0]:t,u=a.clientX,p=a.clientY,m=u-n,f=p-o;if(!c)if(Math.abs(m)>8&&Math.abs(m)>Math.abs(f))c=!0;else if(Math.abs(f)>8)return l=!1,void d();if(c){r=u;const n=Math.max(0,1-Math.abs(m)/280);i().disableInlineStyles&&!1!==s()||(e.style.transform=`translateX(${m}px)`,e.style.opacity=String(n)),t.cancelable&&t.preventDefault()}},f=()=>{if(d(),!l||!c)return l=!1,void(e.style.userSelect="");l=!1,e.style.userSelect="";const o=r-n,u=Math.max(1,Date.now()-a),p=Math.abs(o)/u>=.65&&Math.abs(o)>=50,m=p?50:75;if(Math.abs(o)>=m){const n=o>0?320:-320,r=p?120:180;i().disableInlineStyles&&!1!==s()||(e.style.transition=`transform ${r}ms ease-out, opacity ${r}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)},r),"function"==typeof e._swipeTimeout?.unref&&e._swipeTimeout.unref()}else if(!i().disableInlineStyles||!1===s()){const t=e._spring,n=t?.easing||"cubic-bezier(0.34, 1.56, 0.64, 1)",o=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.addEventListener("touchstart",p,{passive:!0}),e.addEventListener("touchmove",m,{passive:!1}),e.addEventListener("touchend",f,{passive:!0}),e.addEventListener("touchcancel",f,{passive:!0}),e.addEventListener("mousedown",p,{passive:!0}),e._cleanupSwipe=()=>{e._swipeTimeout&&(clearTimeout(e._swipeTimeout),e._swipeTimeout=null),d(),e.removeEventListener("touchstart",p),e.removeEventListener("touchmove",m),e.removeEventListener("touchend",f),e.removeEventListener("touchcancel",f),e.removeEventListener("mousedown",p)}}(e,n),(void 0!==t?.sound?t.sound:o.sound)&&N("string"==typeof t.sound?t.sound:t?.type||"info",t?.soundPreset||o.soundPreset||"modern"),function(e){if(s())return e.style.transition="none",e.style.opacity="1",void(e.style.transform="translateY(0)");requestAnimationFrame(()=>{e.style.opacity="1",e.style.transform="translateY(0)"})}(e)}(n,e,t),n}catch(o){return console.warn("toast creation failed with error showing fallback one: ",o),n=await Y(e,t),n}}const ee=new Map,te=new Map;function ne(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 oe(e){const t=i();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 ie(e={},n){const o=i(),s=`toast-container-${ne(e?.position||o.defaultPosition)}`,r=(a=t.targetNode)&&"object"==typeof a&&"function"==typeof a.appendChild?t.targetNode:"undefined"!=typeof document?document.body:null;var a;if(!r)throw new Error("Toast container root is unavailable");if(te.has(s))return te.get(s);const l=(async()=>{const t=ee.get(s);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)}(t,r))return t;t&&ee.delete(s);let o=function(e,t){return e?"function"==typeof e.getElementById?e.getElementById(t):"function"==typeof e.querySelector?e.querySelector(`#${t}`):null:null}(r,s);if(o?(oe(o),"function"==typeof n&&await n(o,e)):(o=document.createElement("div"),o.id=s,o.setAttribute("role","status"),o.setAttribute("aria-atomic","true"),oe(o),"function"==typeof n&&await n(o,e),r.appendChild(o)),"function"==typeof r.querySelectorAll){const e=r.querySelectorAll(`#${s}`);if(e.length>1)for(let t=1;t<e.length;t++)try{e[t].remove()}catch{}}return ee.set(s,o),o})();te.set(s,l);try{return await l}finally{te.delete(s)}}const se=new Set(["top-left","top-right","bottom-left","bottom-right","top-center","bottom-center","left-center","right-center","top-full-width","bottom-full-width","center"]),re=new Set(["top","bottom"]),ae=[...se,...re];async function le(e,t){if(!e||!t?.position)throw new Error("Invalid container or position!");const n=String(t.position).toLowerCase().trim();let o=n;var s;if(s=n,se.has(s)||re.has(n)||(console.warn(`Unknown position "${t.position}", defaulting to "bottom-right"`),o="bottom-right"),function(e){if(e?.classList)for(let t=0;t<ae.length;t++)e.classList.remove("toast-position-"+ae[t])}(e),e.classList?.add("toast-position-"+o),i().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);const r=function(e){const t=e.toLowerCase().trim();return{hasTop:t.startsWith("top"),hasBottom:t.startsWith("bottom")||t.startsWith("below"),hasLeft:t.startsWith("left"),hasRight:t.startsWith("right"),hasCenter:"center"===t||t.includes("center")&&!t.includes("left")&&!t.includes("right")&&!t.includes("top")&&!t.includes("bottom"),hasFullWidth:"top-full-width"===t||"bottom-full-width"===t}}(o);(function(e,t,n){if(!n.hasFullWidth)return!1;e.style.maxWidth="100vw";try{!t||t.maxWidth||Object.isFrozen(t)||(t.maxWidth="100vw")}catch{}return n.hasTop?(e.style.top="10px",e.style.left="10px",e.style.right="10px",!0):!!n.hasBottom&&(e.style.bottom="10px",e.style.left="10px",e.style.right="10px",!0)})(e,t,r)||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,r)||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,r)}class ce{constructor(e,t){this.callback="function"==typeof e?e:()=>{};const n=Number.isFinite(t)&&t>=0?t:0;this.delay=n,this.remaining=n,this.startTime=null,this.timeoutId=null,this.isPaused=!1,this.isCompleted=!1}start(){return this.isCompleted||this.timeoutId||(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 this.timeoutId?.unref&&this.timeoutId.unref()),this}pause(){return this.isPaused||!this.timeoutId||this.isCompleted||(clearTimeout(this.timeoutId),this.timeoutId=null,this.remaining-=Date.now()-this.startTime,this.remaining=Math.max(0,this.remaining),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 ue{constructor(){this.channel=null,this.tabId=this._generateTabId(),this.isLeadTab=!1,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{}return t||(t=Math.floor(9007199254740991*Math.random()).toString(36).slice(0,9)),`tab-${e}-${t}`}_initBroadcastChannel(){try{this.channel=new BroadcastChannel("toast-notifications"),this.channel.unref?.(),this.channel.onmessage=e=>this._handleMessage(e.data),this._becomeLeadIfNeeded()}catch(e){console.warn("[Toast] BroadcastChannel initialization failed:",e),this.supportsBroadcastChannel=!1}}_becomeLeadIfNeeded(){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),this.leaderTimer.unref?.())}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 s={type:e,toastId:"string"==typeof o?o:String(o??""),payload:i&&"object"==typeof i?i:{},timestamp:Date.now(),tabId:this.tabId};try{this.channel.postMessage(s)}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;"leader-elected"!==t||this.isLeadTab?"sync-request"===t&&this.isLeadTab?this.broadcast("sync-response","all-toasts",{active:Array.from(this._getActiveToasts?.()||[]),queue:this._getQueuedToasts?.()||[]}):(this.listeners.get(t)||[]).forEach(i=>{try{i({toastId:n,payload:o,message:e})}catch(e){console.warn(`[Toast] Listener error for ${t}:`,e)}}):this.isLeadTab=!1}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 de=null;function pe(){return de||(de=new ue,"undefined"!=typeof window&&window.addEventListener("unload",()=>{de?.destroy(),de=null})),de}function me(){de&&(de.destroy(),de=null)}const fe={error:85,warning:70,info:40,success:30},he=["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"],ye=["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 ge(e){if(!e||"object"!=typeof e)return{score:50,breakdown:{base:50},keywords:[]};const{type:t,message:n,duration:o}=e,i={},s=[];let r=50;const a=fe[t]||50;i.type=a,r+=.6*(a-50);const l="string"==typeof n?n:String(n??""),c=l.toLowerCase();let u=0;for(const e of he)c.includes(e.toLowerCase())&&(s.push(e),u+=2);for(const e of ye)c.includes(e.toLowerCase())&&(s.push(e),u-=1);if(i.urgency=Math.min(Math.max(u,-10),20),r+=u,"number"==typeof o&&o>0){const e=Math.max(0,30-o/1e3);i.duration=Math.round(e),r+=.5*e}const d=c.length;if(d>0){const e=Math.min(10,Math.floor(d/50));i.length=-e,r-=e}const p=(l.match(/!/g)||[]).length,m=Math.min(5,p);i.emphasis=m,r+=m;const f=(l.match(/\b[A-Z]{3,}\b/g)||[]).length,h=Math.min(5,f);return i.caps=h,r+=h,r=Math.max(0,Math.min(100,Math.round(r))),{score:r,breakdown:i,keywords:[...new Set(s)]}}function be(e){if(!e||"string"!=typeof e)return["unknown"];const t=e.toLowerCase(),n=[];return(t.includes("security")||t.includes("auth")||t.includes("password")||t.includes("unauthorized")||t.includes("breach")||t.includes("hack"))&&n.push("security"),(t.includes("performance")||t.includes("slow")||t.includes("timeout")||t.includes("load")||t.includes("responsive")||t.includes("latency"))&&n.push("performance"),(t.includes("user")||t.includes("profile")||t.includes("account")||t.includes("preferences")||t.includes("settings")||t.includes("avatar"))&&n.push("user"),(t.includes("system")||t.includes("server")||t.includes("database")||t.includes("network")||t.includes("connection")||t.includes("backend"))&&n.push("system"),(t.includes("payment")||t.includes("transaction")||t.includes("billing")||t.includes("charge")||t.includes("order")||t.includes("cart"))&&n.push("business"),(t.includes("ui")||t.includes("interface")||t.includes("click")||t.includes("scroll")||t.includes("responsive")||t.includes("mobile"))&&n.push("ui"),0===n.length&&n.push("general"),n}function we(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 xe(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 Te(e,t,n=.5,o=50){const i=Number(e),s=Number(t);return!(!Number.isFinite(i)||!Number.isFinite(s))&&i>=n&&Math.abs(s)>=o}function ve(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 Ae(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 Se(e,t={}){const{onFlick:n,onPinch:o,onSwipe:i,flickVelocityThreshold:s=.5,swipeVelocityThreshold:r=.3,swipeDistanceThreshold:a=50,pinchSensitivity:l=20}=t;let c=null,u=!1;const d=e=>{u=!0,c=function(e){const t=ve(e);return{touches:t,startTouches:t.map(e=>({...e})),startTime:Date.now(),startDistance:t.length>=2?we(t[0],t[1]):0,currentDistance:t.length>=2?we(t[0],t[1]):0}}(e)},p=e=>{u&&c&&(c=function(e,t){const n=ve(t);return{...e,touches:n,currentDistance:n.length>=2?we(n[0],n[1]):e.currentDistance}}(c,e))},m=e=>{if(!u||!c)return;u=!1;const t=Ae(c,l);t.isPinch&&"function"==typeof o&&o(t);const d=function(e){if(0===e.startTouches.length||0===e.touches.length)return{distance:0,velocity:0,direction:"none"};const t=e.startTouches[0],n=e.touches[0].x-t.x,o=Date.now()-e.startTime;return{distance:n,velocity:xe(n,o),direction:n>0?"right":"left",duration:o}}(c);Te(d.velocity,d.distance,s,30)&&"function"==typeof n&&n(d);const p=function(e,t=.3,n=50){return e.velocity>=t||Math.abs(e.distance)>=n}(d,r,a);p&&"function"==typeof i&&i(d),c=null};return{attach(){e&&(e.addEventListener("touchstart",d,{passive:!0}),e.addEventListener("touchmove",p,{passive:!0}),e.addEventListener("touchend",m,{passive:!0}),e.addEventListener("touchcancel",m,{passive:!0}))},detach(){e&&(e.removeEventListener("touchstart",d),e.removeEventListener("touchmove",p),e.removeEventListener("touchend",m),e.removeEventListener("touchcancel",m))},getState:()=>c}}const Ce=new Map,ke=new Map,Ee=[];let Me=0,Le=0;function Ie(){return{activeCount:Ce.size,queueDepth:Ee.length,visibleCount:Me,droppedCount:Le,timestamp:Date.now()}}function Ne(){const e=i();if("function"==typeof e.onMetrics)try{e.onMetrics(Ie())}catch(e){console.error("onMetrics callback error:",e)}}const _e=pe();function ze(e){const t=e?.priority?.score;if("number"==typeof t&&Number.isFinite(t))return t;const n=i();if("function"==typeof n.priorityScorer)try{const t=n.priorityScorer({type:e?.options?.type||"info",message:e?.options?.message||"",duration:e?.options?.duration,options: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 ge(e?.options).score}function Ve(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,Ve(e)},n=()=>{e._isExpanded=!1,Ve(e)},o=()=>{e._isExpanded=!0,Ve(e)},i=t=>{e.contains(t.relatedTarget)||(e._isExpanded=!1,Ve(e))};e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),e.addEventListener("focusin",o),e.addEventListener("focusout",i);let s=null;s=Se(e,{onPinch:t=>{"out"!==t.direction||e._isExpanded?"in"===t.direction&&e._isExpanded&&(e._isExpanded=!1,Ve(e)):(e._isExpanded=!0,Ve(e))}}),s.attach(),e._stackedCleanup=()=>{e.removeEventListener("mouseenter",t),e.removeEventListener("mouseleave",n),e.removeEventListener("focusin",o),e.removeEventListener("focusout",i),s?.detach?.(),e._stackedInitialized=!1}}if(!e.children||0===e.children.length)return;const t=Array.from(e.children),n=t.length,o=Boolean(e._isExpanded),s=Boolean(e.id&&e.id.includes("top"));t.forEach((e,t)=>{const r=n-1-t,a=o?"expanded":r>=3?"overflow":String(r);if("function"==typeof e.setAttribute&&e.setAttribute("data-stacked-depth",a),!i().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=s?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=s?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=s?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 qe(e={}){try{const t=function(e={}){const t=e&&"object"==typeof e?e:{};return`${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)}|${ne(t.position||"bottom-right")}`}(e);if(Ce.has(t)){const n=Ce.get(t);if(!n)throw new Error(`Active toast with key ${t} not found`);return n.count++,n.timer.clear(),n.timer=Oe(n.toast,e),await Be(n),await We(n),Ne(),!e.fromSync&&i().syncTabs&&_e.isSupported()&&_e.broadcast("update",t,{count:n.count}),t}if(ke.has(t)){const e=ke.get(t);if(!e)throw new Error(`Pending toast with key ${t} not found`);return e.count++,t}const n={options:e,count:1,rafId:0};return ke.set(t,n),n.rafId=requestAnimationFrame(async()=>{const e=ke.get(t);if(e){if(ke.delete(t),Me>=i().maxVisible){const n={options:e.options,key:t,count:e.count},o=i().maxQueueSize??100;return o<=0?(Le++,void Ne()):(Ee.length>=o&&(Ee.shift(),Le++),i().aiPrioritization||e.options?.aiPrioritization?(n.priority=ge(e.options),Ee.push(n),Ee.sort((e,t)=>ze(t)-ze(e))):Ee.push(n),Ne(),void await je())}try{await Pe(e.options,t,e.count)}catch(e){console.error("showToast failed:",e)}}}),!e.fromSync&&i().syncTabs&&_e.isSupported()&&_e.broadcast("create",t,{options:e}),t}catch(e){console.error("showToast failed:",e)}}async function Pe(e,t,n){try{if(!e||"object"!=typeof e)throw new TypeError("options must be an object");Me++;const o=await ie(e,le);if(!o)throw new Error("Failed to create toast container");const s=await J(e,$e);if(!s)throw new Error("Toast element creation failed");const r=document.createElement("div");r.className="toast-outer-wrapper",i().disableInlineStyles||Object.assign(r.style,{position:"relative",display:"inline-block",overflow:"visible",marginBottom:"10px",zIndex:"0",width:"100%",pointerEvents:"auto"});const a=document.createElement("div");a.className="toast-inner-wrapper",i().disableInlineStyles||Object.assign(a.style,{position:"relative",overflow:"hidden",zIndex:"1"}),a.appendChild(s),r.appendChild(a),o.id.includes("toast-container-")&&(o.appendChild(r),e.stacked&&o.setAttribute("data-stacked","true"),"true"===o.getAttribute("data-stacked")&&Ve(o));const l=!1!==e.pauseOnHover&&(!0===e.pauseOnHover||!!e.cta),c={outer:r,toast:s,options:e,count:Math.max(1,Math.floor(n??0)),pauseOnHover:l};Ce.set(t,c),s._key=t,Ne(),c.count>1&&await We(c),c.timer=Oe(s,e),await Be(c)}catch(t){console.error("Something went wrong: ",t),Me=Math.max(0,Me-1),Ne(),(document.querySelector('[id^="toast-container-"]')||document.body).appendChild(await Y(e,$e))}}_e.registerActiveToastsGetter(()=>Array.from(Ce.keys())),_e.registerQueuedToastsGetter(()=>Ee.map(e=>({key:e.key,options:e.options,count:e.count}))),_e.isSupported()&&"undefined"!=typeof window&&(_e.on("create",({toastId:e,payload:t})=>{i().syncTabs&&e&&t&&!Ce.has(e)&&!ke.has(e)&&qe({...t.options,fromSync:!0})}),_e.on("update",({toastId:e,payload:t})=>{if(i().syncTabs&&e&&t&&Ce.has(e)){const n=Ce.get(e);n&&n.count!==t.count&&(n.count=t.count,We(n))}}),_e.on("dismiss",({toastId:e})=>{i().syncTabs&&e&&Ce.has(e)&&De(e)}),_e.on("sync-response",({payload:e})=>{if(i().syncTabs&&e&&Array.isArray(e.queue))for(const t of e.queue)!t?.options||Ce.has(t.key)||ke.has(t.key)||qe({...t.options,fromSync:!0})}));const Re=async function(){try{if(0===Ce.size){if(ke.size>0){const[e,t]=Array.from(ke.entries()).at(-1);return t?.rafId&&cancelAnimationFrame(t.rafId),ke.delete(e),void Ne()}return Ee.length>0?(Ee.pop(),void Ne()):void 0}let e=null;const t=Array.from(Ce.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 $e(n)}catch(e){console.error("dismissMostRecent failed:",e)}};function Oe(e,t){const n=Number(t?.duration),o=Number.isFinite(n)&&n>0?n:2500,i=new ce(async()=>await $e(e),o+5);return i.start(),i}async function Be(e){if(!e.pauseOnHover||!e.outer||!e.timer)return;const{outer:t,timer:n,toast:o}=e,i=()=>{n.pause(),o?._progressAnimation?.pause()},s=()=>{n.resume(),o?._progressAnimation?.play()},r=e=>{e.target.matches("[tabindex], div, span, button, a")&&(n.pause(),o?._progressAnimation?.pause())},a=e=>{t.contains(e.relatedTarget)||(n.resume(),o?._progressAnimation?.play())};t.addEventListener("mouseenter",i),t.addEventListener("mouseleave",s),t.addEventListener("focusin",r),t.addEventListener("focusout",a),t._pauseCleanup=()=>{t.removeEventListener("mouseenter",i),t.removeEventListener("mouseleave",s),t.removeEventListener("focusin",r),t.removeEventListener("focusout",a)}}async function $e(e){if(e?._key)return De(e._key)}async function De(e){try{if(!e)return;i().syncTabs&&_e.isSupported()&&_e.broadcast("dismiss",e,{});const n=ke.get(e);if(n)return cancelAnimationFrame(n.rafId),ke.delete(e),void Ne();const o=Ee.findIndex(t=>t.key===e);if(-1!==o)return Ee.splice(o,1),void Ne();const s=Ce.get(e);if(!s)return;if(s.timer?.clear(),s.outer?._pauseCleanup?.(),s.toast?._cleanupCloseButton?.(),s.toast?._cleanupCTA?.(),s.toast?._cleanupUndo?.(),s.toast?._cleanupSwipe?.(),s.toast?._cleanup?.(),s.toast?._progressAnimation){try{s.toast._progressAnimation.cancel()}catch{}s.toast._progressAnimation=null}const r=s.outer?.querySelector(".toast-count-badge");r?._scaleTimer&&(clearTimeout(r._scaleTimer),r._scaleTimer=null);const a=s.toast?.querySelector("button, a");a?._cleanup?.(),Ce.delete(e),Me=Math.max(0,Me-1),Ne(),r&&r.remove();const l=s.toast?._animationDuration??400;s.toast&&(s.toast.style.opacity="0",s.toast.style.transform="translateY(20px)");const c=s.outer?.parentElement;if(await async function(e,t,n=400){return e?new Promise(o=>{let i=!1,s=null;const r=t||e.firstElementChild||e,a=()=>{if(i)return;i=!0,s&&(clearTimeout(s),s=null);try{r?.removeEventListener?.("transitionend",l,!0)}catch{}const t=e.querySelector?.(".toast")||e;if(t?._pooledId)try{K().release(t,t._pooledId)}catch{}!async function(e){if(!e)return!0;try{if("function"==typeof e.remove)return e.remove(),!0}catch{}try{if(e.parentNode)return e.parentNode.removeChild(e),!0}catch{}}(e),o()},l=e=>{try{if(e.target!==r)return;a()}catch(e){console.error("removeWithTransition error:",e)}};if(!r)return a();try{r.addEventListener("transitionend",l,!0)}catch(e){console.error("removeWithTransition error:",e)}s=setTimeout(a,n+100),"function"==typeof s?.unref&&s.unref()}):Promise.resolve()}(s.outer,s.toast,l),c&&0===c.children.length&&c.id?.startsWith("toast-container-"))try{c._stackedCleanup?.(),(t=c.id)&&(ee.delete(t),te.delete(t)),c.remove()}catch{}else c&&"true"===c.getAttribute("data-stacked")&&Ve(c);await je()}catch(e){console.error("Closing Toast failed!: ",e)}var t}let Fe=!1;async function je(){if(!Fe){Fe=!0;try{const e=i();for(e.aiPrioritization&&Ee.length>1&&Ee.sort((e,t)=>ze(t)-ze(e));Me<e.maxVisible&&Ee.length;){const e=Ee.shift();if(Ce.has(e.key)){const t=Ce.get(e.key);t.count+=e.count,await We(t),Ne();continue}await Pe(e.options,e.key,e.count)}Ne()}finally{Fe=!1}}}async function We({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`),i().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{s()||(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 n._scaleTimer?.unref&&n._scaleTimer.unref())}catch(e){console.error("updateBadge animation error:",e)}}async function He(e,t={}){if(!e||"object"!=typeof t||null===t)return;if(ke.has(e)){const n=ke.get(e);return void(n.options={...n.options,...t})}const n=Ee.find(t=>t.key===e);if(n)return void(n.options={...n.options,...t});const o=Ce.get(e);if(!o||!o.toast)return;o.options={...o.options,...t};const s=o.toast,r=s._messageSpan||s.querySelector(".toast-message")||s.querySelector("span:not(.toast-count-badge)");if(void 0!==t.message){const e=String(t.message??""),n=void 0!==t.allowHtml?Boolean(t.allowHtml):Boolean(o.options.allowHtml);if(r){const o=r.querySelector(".toast-loader");if(r.innerHTML="",o&&!1!==t.showLoader&&null!==t.loader){r.appendChild(o);const e=document.createElement("span");e.style.display="inline-block",e.style.width="8px",r.appendChild(e)}if(n&&e.trim().length>0)try{const t=w(e),n=document.createElement("div");for(n.innerHTML=t;n.firstChild;)r.appendChild(n.firstChild)}catch{r.appendChild(document.createTextNode(e))}else r.appendChild(document.createTextNode(e));r.setAttribute("title",e.replace(/<[^>]+>/g,""))}}if(!1===t.showLoader||null===t.loader){const e=r?.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)&&r&&!r.querySelector(".toast-loader")){const e=x(t.loader||{});r.insertBefore(e,r.firstChild);const n=document.createElement("span");n.style.display="inline-block",n.style.width="8px",r.insertBefore(n,e.nextSibling)}if(t.type){const e=String(t.type).toLowerCase().trim();if(s.className=s.className.replace(/\btoast-(info|success|error|warning)\b/g,`toast-${e}`),!t.backgroundColor){const t={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"};t[e]&&(s.style.background=t[e])}}if(t.backgroundColor&&(s.style.background=t.backgroundColor),t.textColor)s.style.color=t.textColor,r&&(r.style.color=t.textColor);else if(t.type||t.backgroundColor){const e=s.style.background;if(e){const t=p(e);s.style.color=t,r&&(r.style.color=t)}}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&&!o.options.showProgressBar||(v(s,{...o.options,...t}),n=s.querySelector(".toast-progress-bar")),n){if(s._progressAnimation){try{s._progressAnimation.cancel()}catch{}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(void 0!==t.duration){o.timer?.clear();const e=Number(t.duration);Number.isFinite(e)&&e>0&&(o.timer=Oe(s,{duration:e}))}t.sound&&N("string"==typeof t.sound?t.sound:t.type||o.options.type||"info",t.soundPreset||o.options.soundPreset||i().soundPreset||"modern");const a=s.closest('[id^="toast-container-"]');a&&"true"===a.getAttribute("data-stacked")&&Ve(a)}let Ue={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"},Ge={success:"Operation completed successfully!",error:"Something went wrong!",warning:"Warning message!",info:"Information message!"},Ye=!1,Xe=null;function Qe(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&&(Ue={...Ue,...n})}}catch(e){console.error("setDefaultColors failed:",e)}}function Ke(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&&(Ge={...Ge,...n})}}catch(e){console.error("setDefaultMessages failed:",e)}}let Ze=!1,Je=null;const et=async function(e={}){return"undefined"!=typeof window&&"undefined"!=typeof document?(await async function(){Ye||"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?(Xe||(Xe=new Promise(e=>{document.addEventListener("DOMContentLoaded",()=>{Ye=!0,e()},{once:!0})})),await Xe):Ye=!0)}(),await async function(e={}){try{const t=await async function(e){const t=i(),n=String(e?.position??t.defaultPosition).toLowerCase().trim(),o=n?.includes("top-full-width")||n?.includes("bottom-full-width")?"100vw":"400px",s={allowHtml:!1,sanitizeHtml:!0,pauseOnHover:void 0,duration:2500,position:t.defaultPosition,type:"info",borderRadius:"50px",backgroundColor:void 0,textColor:void 0,showCloseButton:!0,animationDuration:"0.4s",animationEasing:"ease",showProgressBar:!0,progressColor:void 0,progressHeight:"4px",progressPosition:"bottom",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:o,..."object"!=typeof e||Array.isArray(e)?{}:e};s.message=e?.message??s.message;try{s.backgroundColor||(s.backgroundColor=Ue?.[s.type]??(window.matchMedia("(prefers-color-scheme: dark)").matches?"#f5f5f5":"#111111"))}catch(e){console.warn("Background color resolution failed:",e)}try{s.message=s.message||Ge?.[s.type]||"No Message Provided!"}catch(e){console.warn("Default message resolution failed:",e)}try{!s.textColor&&s.backgroundColor&&(s.textColor=p(s.backgroundColor))}catch(e){console.warn("Text color resolution failed:",e)}try{!s.progressColor&&s.backgroundColor&&(s.progressColor=s.textColor||p(s.backgroundColor))}catch(e){console.warn("Progress bar color resolution failed:",e)}return"string"!=typeof s.message&&(s.message="No Message Provided!"),s}(e);return await async function(e){try{return await ie(e,le)}catch(e){return console.error("Failed to create toast container:",e),i().targetNode||document.body}}(t),await qe(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 tt(e={}){const t=await async function(){if(Ze&&Je)try{await Je}catch(e){console.warn("Previous close operation failed (continuing anyway):",e)}return et(e)}();return{dismiss:()=>t?De(t):Promise.resolve(),update:e=>t?He(t,e):Promise.resolve()}}const nt=async()=>{Ze=!0,Je=(async()=>{try{await Re()}finally{Ze=!1,Je=null}})(),await Je},ot=async()=>{Ze=!0,Je=(async()=>{try{await async function(){try{for(const[,e]of ke)e?.rafId&&cancelAnimationFrame(e.rafId);ke.clear(),Ee.length=0,Ne();const e=Array.from(Ce.values()).map(e=>e.toast).filter(Boolean);await Promise.allSettled(e.map(async e=>{try{await $e(e)}catch(e){console.warn("closeAllToasts: failed to close one toast:",e)}}))}catch(e){console.error("closeAllToasts failed:",e)}}()}finally{Ze=!1,Je=null}})(),await Je};async function it(e,t={},n={}){const o=t&&"object"==typeof t?t:{},i=n&&"object"==typeof n?n:{},s=o.loading??"Loading...",r=await tt({...i,type:"info",message:s,duration:864e5,showProgressBar:!1,pauseOnHover:!1}),a={...i,pauseOnHover:i.pauseOnHover};try{const t="function"==typeof e?e():e,n=await t;await r.dismiss();const i="function"==typeof o.success?o.success(n):o.success??"Done!";return await tt({...a,type:"success",message:i}),n}catch(e){await r.dismiss();const t="function"==typeof o.error?o.error(e):o.error??"Something went wrong.";throw await tt({...a,type:"error",message:t}),e}}const st="3.16.0";if("undefined"!=typeof window&&"undefined"!=typeof document&&!window.__customizableToastEscapeAttached){window.__customizableToastEscapeAttached=!0;const e=e=>{"Escape"!==e.key&&"Esc"!==e.key||(async()=>{try{Ze=!0,Je=(async()=>{try{await Re()}finally{Ze=!1,Je=null}})(),await Je}catch(e){console.error("Escape key dismiss failed:",e),Ze=!1,Je=null}})()};window.addEventListener("keydown",e,{passive:!0})}try{"undefined"!=typeof window&&(window.customizableToast={setConfig:n,getConfig:i,resetConfig:o,shouldReduceMotion:s,version:st,createToast:tt,setDefaultColors:Qe,setDefaultMessages:Ke,noop:ot,dismiss:nt,toastPromise:it,updateToastByKey:He,setAudioEnabled:q,isAudioEnabled:P,playTone:N,registerSoundPreset:_,getSoundPresets:z,resetSoundPresets:V,resetAudioContext:R,getToastPool:K,resetToastPool:Z,getToastBroadcaster:pe,resetToastBroadcaster:me,calculateToastPriority:ge,categorizeToast:be,createGestureDetector:Se,detectPinch:Ae,isFlick:Te,calculateVelocity:xe,generateToastId:c,resetToastIdCounter:l,getToastMetrics:Ie,registerSpringPreset:$,getSpringPresets:D,resetSpringPresets:F,resolveSpringConfig:j,solveSpring:W,calculateSpringSettlingDuration:H,generateSpringLinearEasing:U,getSpringTransition:G,getAudioAnalyser:M})}catch(e){console.error("Global assignment failed:",e)}exports.calculateSpringSettlingDuration=H,exports.calculateToastPriority=ge,exports.calculateVelocity=xe,exports.categorizeToast=be,exports.createGestureDetector=Se,exports.createToast=tt,exports.detectPinch=Ae,exports.dismiss=nt,exports.generateSpringLinearEasing=U,exports.generateToastId=c,exports.getAudioAnalyser=M,exports.getConfig=i,exports.getSoundPresets=z,exports.getSpringPresets=D,exports.getSpringTransition=G,exports.getToastBroadcaster=pe,exports.getToastMetrics=Ie,exports.getToastPool=K,exports.isAudioEnabled=P,exports.isFlick=Te,exports.noop=ot,exports.playTone=N,exports.registerSoundPreset=_,exports.registerSpringPreset=$,exports.resetAudioContext=R,exports.resetConfig=o,exports.resetContainerRegistry=function(){ee.clear(),te.clear()},exports.resetSoundPresets=V,exports.resetSpringPresets=F,exports.resetToastBroadcaster=me,exports.resetToastIdCounter=l,exports.resetToastManager=function(){for(const[,e]of ke)e?.rafId&&cancelAnimationFrame(e.rafId);ke.clear(),Ee.length=0;for(const[,e]of Ce){if(e.timer?.clear(),e.outer?._pauseCleanup?.(),e.toast?._cleanupCloseButton?.(),e.toast?._cleanupCTA?.(),e.toast?._cleanupUndo?.(),e.toast?._cleanupSwipe?.(),e.toast?._cleanup?.(),e.toast?._progressAnimation){try{e.toast._progressAnimation.cancel()}catch{}e.toast._progressAnimation=null}const t=e.outer?.querySelector(".toast-count-badge");t?._scaleTimer&&(clearTimeout(t._scaleTimer),t._scaleTimer=null)}Ce.clear(),Me=0,Le=0,Fe=!1,Ne()},exports.resetToastPool=Z,exports.resolveSpringConfig=j,exports.setAudioEnabled=q,exports.setConfig=n,exports.setDefaultColors=Qe,exports.setDefaultMessages=Ke,exports.shouldReduceMotion=s,exports.solveSpring=W,exports.toastPromise=it,exports.updateToastByKey=He,exports.version=st;
|
|
16
16
|
//# sourceMappingURL=index.cjs.map
|