customizable-toast-notification 3.11.1 → 3.11.3
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 +14 -0
- package/dist/index.cjs +16 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.esm.mjs +6 -5
- package/dist/index.esm.mjs.map +1 -0
- package/dist/index.umd.js +7 -6
- package/dist/index.umd.js.map +1 -0
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [3.11.3](https://github.com/sammy-cool/customizable-toast-notification/compare/v3.11.2...v3.11.3) (2026-08-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* parse hsl()/var() and deterministic color fallback ([3b5978d](https://github.com/sammy-cool/customizable-toast-notification/commit/3b5978d2373aa85b3007eeee46399b964e6d1b45))
|
|
7
|
+
|
|
8
|
+
## [3.11.2](https://github.com/sammy-cool/customizable-toast-notification/compare/v3.11.1...v3.11.2) (2026-08-12)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* improve package builds and release verification ([84d3150](https://github.com/sammy-cool/customizable-toast-notification/commit/84d3150fa258bb77005001c467702ea10dc954cf))
|
|
14
|
+
|
|
1
15
|
## [3.11.1](https://github.com/sammy-cool/customizable-toast-notification/compare/v3.11.0...v3.11.1) (2026-08-12)
|
|
2
16
|
|
|
3
17
|
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Customizable Toast Notifications 3.11.2
|
|
3
|
+
* Build: 2026-08-12 23:02:31
|
|
4
|
+
* Cache-Buster: 1786575751652
|
|
5
|
+
* Author: Priyanshu Patel
|
|
6
|
+
* Email: priyanshu.alt191@gmail.com
|
|
7
|
+
* License: Apache-2.0
|
|
8
|
+
* Dependencies: None
|
|
9
|
+
* Created: July 31, 2024
|
|
10
|
+
* A lightweight and fully customizable toast notification library
|
|
11
|
+
* designed for seamless integration with any JavaScript or framework-based UI.
|
|
12
|
+
* Supports flexible positioning, theming, icons, animations, and timing options
|
|
13
|
+
* out of the box — with CTA support and zero dependencies.
|
|
14
|
+
*/
|
|
15
|
+
"use strict";async function t(t,e){const n=document.createElement(t);return n.id=function(t){return`${t}-${Date.now().toString(36)}-${Math.floor(1048575*Math.random()).toString(36)}`}(e),n}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),n={};function o(t,o=1){if(!t)return"snow";const r=`${t}|${o}`,i=e.get(r);if(i)return i;if(n[null==t?void 0:t.toLowerCase()]){const o=n[t.toLowerCase()];return e.set(r,o),o}let a,s,l;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 n=null==t?void 0:t.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=null==t?void 0:t.match(/hsla?\(\s*([\d.]+)(?:deg)?\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*[\d.]+)?\)/i);if(o){const t=Number(o[1])/360,e=Number(o[2])/100,n=Number(o[3])/100;if(0===e){const t=Math.round(255*n);return{r:t,g:t,b:t}}const r=(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t),i=n<.5?n*(1+e):n+e-n*e,a=2*n-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 n=null==t?void 0:t.match(/^var\((--[\w-]+)(?:\s*,\s*(.+))?\)$/i);if(!n)return t;try{if("undefined"!=typeof document&&"function"==typeof getComputedStyle){const t=getComputedStyle(document.documentElement).getPropertyValue(n[1]).trim();if(t)return t}}catch(t){}return(null===(e=n[2])||void 0===e?void 0:e.trim())||t}(t));if(!e)throw new Error("Unknown color");({r:a,g:s,b:l}=e)}catch{a=s=l=128}a=Math.round(a*o+255*(1-o)),s=Math.round(s*o+255*(1-o)),l=Math.round(l*o+255*(1-o));const c=(t,e,n)=>{const o=[t,e,n].map(t=>(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*o[0]+.7152*o[1]+.0722*o[2]},u=(t,e)=>{const n=c(...t),o=c(...e);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)};let[d,m,p]=((t,e,n)=>{t/=255,e/=255,n/=255;const o=Math.max(t,e,n),r=Math.min(t,e,n);let i,a,s=(o+r)/2;if(o===r)i=a=0;else{const l=o-r;switch(a=s>.5?l/(2-o-r):l/(o+r),o){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4}i/=6}return[360*i,a,s]})(a,s,l);let f=p<.5?Math.min(p+.5,1):Math.max(p-.5,0),[h,y,g]=((t,e,n)=>{let o,r,i;if(t/=360,0===e)o=r=i=n;else{const a=(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t),s=n<.5?n*(1+e):n+e-n*e,l=2*n-s;o=a(l,s,t+1/3),r=a(l,s,t),i=a(l,s,t-1/3)}return[Math.round(255*o),Math.round(255*r),Math.round(255*i)]})(d,m,f);if(u([a,s,l],[h,y,g])<4.5){const t=u([a,s,l],[0,0,0]),e=u([a,s,l],[255,255,255]);[h,y,g]=t>=e?[0,0,0]:[255,255,255]}const b=((t,e,n)=>`#${t.toString(16).padStart(2,"0")}${e.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`)(h,y,g);return e.set(r,b),b}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,o,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(o)+.0722*i(r),s=(a+.05)/.05,l=1.05/(a+.05);n[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"]);function a(t){if(!t||"string"!=typeof t)return"";let e=t.replace(/<\/?(script|iframe|object|embed|link|meta|style|form|input|button)[^>]*>/gi,"");e=e.replace(/\s(on\w+)\s*=\s*(['"])[\s\S]*?\2/gi,""),e=e.replace(/(href|src)\s*=\s*(['"])\s*javascript:[^'"]*\2/gi,"$1=$2#$2");const n=document.createElement("div");function o(t){if(t.nodeType===Node.TEXT_NODE)return document.createTextNode(t.nodeValue);if(t.nodeType!==Node.ELEMENT_NODE)return null;const e=t.tagName.toUpperCase();if(!r.has(e)){const e=document.createDocumentFragment();return Array.from(t.childNodes).forEach(t=>{const n=o(t);n&&e.appendChild(n)}),e}const n=document.createElement(t.tagName);return Array.from(t.attributes||[]).forEach(e=>{const o=e.name.toLowerCase(),r=e.value;i.has(o)&&("href"!==o&&"src"!==o||!/^\s*javascript:/i.test(r))&&("src"!==o||/^\s*(https?:|data:image\/)/i.test(r))&&("target"===o&&"_blank"===r&&n.setAttribute("rel",(t.getAttribute("rel")||"")+" noopener noreferrer"),n.setAttribute(o,r))}),Array.from(t.childNodes).forEach(t=>{const e=o(t);e&&n.appendChild(e)}),n}n.innerHTML=e;const a=document.createDocumentFragment();Array.from(n.childNodes).forEach(t=>{const e=o(t);e&&a.appendChild(e)});const s=document.createElement("div");return s.appendChild(a),s.innerHTML}function s(t,e={}){if(!t)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}),n=document.createElement("div");return n.innerHTML=e,n.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(" "))}),n.innerHTML}}catch(t){}return a(t)}async function l(t,e,n){const o=await async function(t){if("number"==typeof t&&t>0)return t;if("string"==typeof t){if(t.endsWith("s")&&!t.endsWith("ms")){const e=1e3*parseFloat(t);return e>0?e:500}const e=parseFloat(t);return e>0?e:500}return 500}(null==e?void 0:e.animationDuration);t.className=`toast toast-${(null==e?void 0:e.type)??"info"}`,Object.assign(t.style,{background:null==e?void 0:e.backgroundColor,padding:"12px 16px",marginBottom:"10px",borderRadius:null==e?void 0:e.borderRadius,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"space-between",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)",minWidth:"250px",maxWidth:null==e?void 0:e.maxWidth,opacity:"0",position:"relative",cursor:"default",boxSizing:"border-box",userSelect:"text",transition:`opacity ${null==e?void 0:e.animationDuration} ${null==e?void 0:e.animationEasing}, transform ${null==e?void 0:e.animationDuration} ${null==e?void 0:e.animationEasing}`,transform:"translateY(20px)",zIndex:"9999"}),t.setAttribute("role","alert"),t.setAttribute("aria-live","polite"),t.tabIndex=0,t._animationDuration=o;const r=document.createElement("span");null!=e&&e.wrapText?Object.assign(r.style,{display:"block",whiteSpace:"normal"}):Object.assign(r.style,{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",whiteSpace:"nowrap"}),Object.assign(r.style,{flex:"1",padding:null==e?void 0:e.fontPadding,fontFamily:null==e?void 0:e.fontFamily,fontSize:null==e?void 0:e.fontSize,fontWeight:null==e?void 0:e.fontWeight,lineHeight:null==e?void 0:e.fontLineHeight,color:null==e?void 0:e.textColor,userSelect:"text",wordBreak:"break-word",overflow:"hidden",textOverflow:"ellipsis"});const i=!!e.allowHtml,a=e.message??"";if(e.loader||e.showLoader){const t=function(t={}){const e=t.size||14,n=t.color||"currentColor",o=t.text||"",r=document.createElement("span");r.className="toast-loader",r.style.display="inline-flex",r.style.alignItems="center",r.style.gap="8px";const i="http://www.w3.org/2000/svg",a=document.createElementNS(i,"svg");a.setAttribute("width",String(e)),a.setAttribute("height",String(e)),a.setAttribute("viewBox","0 0 50 50"),a.setAttribute("aria-hidden","true");const s=document.createElementNS(i,"circle");if(s.setAttribute("cx","25"),s.setAttribute("cy","25"),s.setAttribute("r","20"),s.setAttribute("fill","none"),s.setAttribute("stroke",n),s.setAttribute("stroke-width","4"),s.setAttribute("stroke-linecap","round"),s.style.opacity="0.85",s.style.strokeDasharray="90",s.style.strokeDashoffset="60",s.style.transformOrigin="center",s.style.animation="toast-spinner 1s linear infinite",a.appendChild(s),r.appendChild(a),o){const t=document.createElement("span");t.style.fontSize="13px",t.textContent=o,r.appendChild(t)}if(!document.getElementById("toast-spinner-styles")){const t=document.createElement("style");t.id="toast-spinner-styles",t.innerHTML="@keyframes toast-spinner { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }",document.head.appendChild(t)}return r}(e.loader||{});r.appendChild(t);const n=document.createElement("span");n.style.display="inline-block",n.style.width="8px",r.appendChild(n)}if(i&&"string"==typeof a&&a.trim().length>0)try{const t=s(a),e=document.createElement("div");for(e.innerHTML=t;e.firstChild;)r.appendChild(e.firstChild)}catch(t){r.textContent=a}else r.textContent=String(a);r.setAttribute("aria-label","Toast Notification Center"),r.setAttribute("title","string"==typeof a?a.replace(/<[^>]+>/g,""):String(a)),t.appendChild(r),null!=e&&e.cta&&0!==Object.keys(e.cta).length&&function(t,e,n){const o=null==e?void 0:e.cta;if(!o)return;o.label||(o.label="CTA Label Missing!");const r=!!o.href&&"link"===o.variant,i=document.createElement(r?"a":"button");r?(i.href=o.href,o.target&&(i.target=o.target),i.rel=o.rel||("_blank"===o.target?"noopener noreferrer":"")):i.type="button",i.setAttribute("aria-label",o.ariaLabel||o.label),Object.assign(i.style,{marginLeft:"10px",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",fontWeight:"600",lineHeight:"1",border:"1px solid rgba(255,255,255,0.35)",color:e.textColor||"#fff",background:"rgba(255,255,255,0.15)",cursor:"pointer",whiteSpace:"nowrap",flexShrink:"0"}),i.textContent=o.label;const a=async e=>{try{if("function"==typeof o.onClick){const t=o.onClick(e);null!=t&&t.then&&await t}}finally{!1!==o.autoClose&&n(t)}};i.addEventListener("click",a),i._cleanup=()=>i.removeEventListener("click",a),t.appendChild(i)}(t,e,n),null!=e&&e.showCloseButton&&function(t,e,n){const o=document.createElement("button");o.setAttribute("aria-label","Close notification"),o.setAttribute("title","Close"),o.textContent="×",Object.assign(o.style,{background:"none",border:"none",color:e.textColor||"white",fontSize:"18px",marginLeft:"10px",cursor:"pointer"});const r=()=>n(t);o.addEventListener("click",r),t._cleanupCloseButton=()=>{o.removeEventListener("click",r)},t.appendChild(o)}(t,e,n),null!=e&&e.showProgressBar&&function(t,e){const n=document.createElement("div"),o=e.borderRadius||0,r=parseInt(o,10),i=r?"12px":"0",a=r?12:0,s=Math.max(r-10,a),l=r?`calc(100% - ${s}px)`:"100%";Object.assign(n.style,{position:"absolute",left:`${i}`,height:e.progressHeight||"4px",background:e.progressColor||"rgba(255, 255, 255, 0.3)",width:`${l}`,transition:`width ${e.duration||1800}ms linear`,["top"===e.progressPosition?"top":"bottom"]:"0",borderRadius:e.borderRadius||"4px"}),t.appendChild(n),"function"==typeof n.animate?t._progressAnimation=n.animate([{width:l},{width:"0%"}],{duration:Number(e.duration)||1800,easing:"linear",fill:"forwards",delay:50}):(n.style.transition=`width ${e.duration||1800}ms linear`,setTimeout(()=>{n.offsetWidth,n.style.width="0%"},50))}(t,e),function(t){setTimeout(()=>{requestAnimationFrame(()=>{t.style.opacity="1",t.style.transform="translateY(0)"})},50)}(t)}async function c(t,e){try{const n=document.createElement("div");Object.assign(n.style,{background:"#333",color:"white",padding:"10px 15px",position:"fixed",top:"20px",right:"20px",zIndex:"99999",borderRadius:"3px",maxWidth:"250px",wordWrap:"break-word",boxShadow:"0 2px 10px rgba(0,0,0,0.3)",cursor:"pointer"});const o=document.createElement("div"),r=document.createElement("span");r.style.display="inline-block",t.allowHtml?r.innerHTML=s(String(t.message||"Emergency Toast Showing!")):r.textContent=String(t.message||"Emergency Toast Creation Showing!"),o.appendChild(r);const i=document.createElement("span");for(i.style.cssText="float: right; margin-left: 10px; font-weight: bold;",i.textContent="×",o.appendChild(i);n.firstChild;)n.removeChild(n.firstChild);return n.appendChild(o),i.onclick=()=>{n.remove(),e(n)},document.body.appendChild(n),setTimeout(()=>{n.remove(),e(n)},null==t?void 0:t.duration),n}catch(n){return setTimeout(()=>{alert((null==t?void 0:t.message)||"Emergency Toast Creation Showing!"),e(null)},100),null}}const u=new Map,d=new Map;function m(t){return`toast-container-${function(t){return String(t).toLowerCase().trim().replace(/\bbelow\b/g,"bottom").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-")}(t)}`}async function p(t,e){const n=m(t.position);if(d.has(n))return d.get(n);const o=(async()=>{const o=u.get(n);if(null!=o&&o.isConnected)return o;let r=document.getElementById(n);r&&!r.isConnected&&document.body.appendChild(r),r?(r.style.position=r.style.position||"fixed",r.style.zIndex=r.style.zIndex||"9999","function"==typeof e&&await e(r,t)):(r=document.createElement("div"),r.id=n,r.setAttribute("role","status"),r.setAttribute("aria-atomic","true"),r.style.position="fixed",r.style.zIndex="9999",r.style.inset="auto 10px 10px auto",r.style.display="flex",r.style.justifyContent="space-between",r.style.alignItems="center",r.style.flexDirection="column",r.style.overflow="hidden","function"==typeof e&&await e(r,t),document.body.appendChild(r));const i=document.querySelectorAll(`#${n}`);if(i.length>1)for(let t=1;t<i.length;t++)try{i[t].remove()}catch{}return u.set(n,r),r})();d.set(n,o);try{return await o}finally{d.delete(m(t.position))}}async function f(t,e){if(!t||!e.position)throw new Error("Invalid container or position!");!function(t){t.style.top="auto",t.style.bottom="auto",t.style.left="auto",t.style.right="auto",t.style.transform="none"}(t);const n=function(t){const e=t.toLowerCase().trim();return{hasTop:e.includes("top"),hasBottom:e.includes("bottom")||e.includes("below"),hasLeft:e.includes("left"),hasRight:e.includes("right"),hasCenter:e.includes("center"),hasFullWidth:e.includes("top-full-width")||e.includes("bottom-full-width")||e.includes("fullwidth")}}(e.position);(function(t,e,n){if(!n.hasFullWidth)return!1;if(e.maxWidth="100vw",n.hasTop)return t.style.top="10px",t.style.left="10px",t.style.right="10px",!0;if(n.hasBottom)return t.style.bottom="10px",t.style.left="10px",t.style.right="10px",!0;return!1})(t,e,n)||function(t,e){if(!e.hasCenter)return!1;if(e.hasTop&&!e.hasLeft&&!e.hasRight)return t.style.top="10px",t.style.left="50%",t.style.transform="translateX(-50%)",!0;if(e.hasBottom&&!e.hasLeft&&!e.hasRight)return t.style.bottom="10px",t.style.left="50%",t.style.transform="translateX(-50%)",!0;if(e.hasLeft&&!e.hasTop&&!e.hasBottom)return t.style.left="10px",t.style.top="50%",t.style.transform="translateY(-50%)",!0;if(e.hasRight&&!e.hasTop&&!e.hasBottom)return t.style.right="10px",t.style.top="50%",t.style.transform="translateY(-50%)",!0;if(!(e.hasLeft||e.hasRight||e.hasTop||e.hasBottom))return t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)",!0;return!1}(t,n)||function(t,e){e.hasBottom?t.style.bottom="10px":e.hasTop&&(t.style.top="10px");e.hasRight?t.style.right="10px":e.hasLeft?t.style.left="10px":(e.hasBottom||e.hasTop||(t.style.bottom="10px"),t.style.left="50%",t.style.transform="translateX(-50%)")}(t,n)}class h{constructor(t,e){this.callback=t,this.delay=e,this.remaining=e,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,this.callback()},this.remaining)),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 y=new Map,g=new Map,b=[];let w=0;async function v(t={}){try{const e=function(t={}){return`${String(t.type).trim().toLowerCase()}|${function(t){let e=5381;for(let n=0;n<t.length;n++)e=(e<<5)+e+t.charCodeAt(n);return e>>>0}(String(t.message||"")).toString(16)}|${String(t.position).trim().toLowerCase()}`}(t);if(y.has(e)){const n=y.get(e);if(!n)throw new Error(`Active toast with key ${e} not found`);return n.count++,n.timer.clear(),n.timer=E(n.toast,t),await S(n),void await T(n)}if(g.has(e)){const t=g.get(e);if(!t)throw new Error(`Pending toast with key ${e} not found`);return void t.count++}const n={options:t,count:1,rafId:0};g.set(e,n),n.rafId=requestAnimationFrame(async()=>{const t=g.get(e);if(t){if(g.delete(e),w>=3)return b.push({options:t.options,key:e,count:t.count}),void await L();try{await x(t.options,e,t.count)}catch(t){}}})}catch(t){}}async function x(e,n,o){try{if(!e||"object"!=typeof e)throw new TypeError("options must be an object");w++;const r=await p(e,f);if(!r)throw new Error("Failed to create toast container");const i=await async function(e,n){if(!document.querySelector('[id^="toast-container-"]'))return null;let o;try{return o=await t("div","toast"),await l(o,e,n),o}catch(t){return o=await c(e,n),o}}(e,A);if(!i)throw new Error("Toast element creation failed");const a=document.createElement("div");Object.assign(a.style,{position:"relative",display:"inline-block",overflow:"visible",marginBottom:"10px",zIndex:"0",width:"100%"});const s=document.createElement("div");Object.assign(s.style,{position:"relative",overflow:"hidden",zIndex:"1"}),s.appendChild(i),a.appendChild(s),r.id.includes("toast-container-")&&r.appendChild(a);const u=!1!==e.pauseOnHover&&(!0===e.pauseOnHover||!!e.cta),d={outer:a,toast:i,count:Math.max(1,Math.floor(o??0)),timeout:null,pauseOnHover:u};y.set(n,d),i._key=n,d.count>1&&await T(d),d.timer=E(i,e),await S(d)}catch(t){w=Math.max(0,w-1);(document.querySelector('[id^="toast-container-"]')||document.body).appendChild(await c(e,A))}}const C=async function(){try{if(0===y.size)return;let t=null;if(document.querySelectorAll('[id^="toast-container-"]').forEach(e=>{const n=Array.from(e.children||[]);if(0===n.length)return;const o=n.at(-1);o&&(t=o.querySelector('[id^="toast-"]')||o)}),!t){const e=Array.from(y.entries());if(e.length>0){const[,n]=e.at(-1);t=n.toast||n.outer&&n.outer.querySelector('[id^="toast-"]')}}if(!t)return;const e=t._key?t:t.querySelector('[id^="toast-"]')||t;await A(e)}catch(t){}},k=async function(){try{const t=Array.from(y.values()).map(t=>t.toast).filter(Boolean);b.length=0,g.clear();for(const e of t)try{await A(e)}catch(t){}}catch(t){}};function E(t,e){const n=Number(e.duration??1800)+5,o=new h(async()=>await A(t),n);return o.start(),o}async function S(t){if(!t.pauseOnHover||!t.outer||!t.timer)return;const{outer:e,timer:n,toast:o}=t,r=()=>{var t;n.pause(),null==o||null===(t=o._progressAnimation)||void 0===t||t.pause()},i=()=>{var t;n.resume(),null==o||null===(t=o._progressAnimation)||void 0===t||t.play()},a=t=>{var e;t.target.matches("[tabindex], div, span, button, a")&&(n.pause(),null==o||null===(e=o._progressAnimation)||void 0===e||e.pause())},s=t=>{var r;e.contains(t.relatedTarget)||(n.resume(),null==o||null===(r=o._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 A(t){try{var e,n,o;if(null==t||!t._key)return;const r=y.get(t._key);if(!r)return;null===(e=r.timer)||void 0===e||e.clear(),null===(n=r.outer)||void 0===n||null===(o=n._pauseCleanup)||void 0===o||o.call(n),y.delete(t._key),w=Math.max(0,w-1);const i=r.outer.querySelector(".toast-count-badge");i&&i.remove(),await async function(t){return t?new Promise(e=>{let n=!1;const o=()=>{n||(n=!0,async function(t){if(!t)return!0;try{var e;if(null!=t&&null!==(e=t.parentNode)&&void 0!==e&&e.id.includes("toast-container-"))return t.parentNode.removeChild(t),!0}catch{}try{if(t.remove)return t.remove(),!0}catch{}try{return Object.assign(t.style,{display:"none",opacity:"0",pointerEvents:"none",position:"absolute",left:"-9999px"}),!0}catch{}}(t),e())},r=t.firstElementChild||t;if(!r)return e();const i=t=>{try{if(t.target!==r)return;r.removeEventListener("transitionend",i,!0),o()}catch(t){}};try{r.addEventListener("transitionend",i,!0)}catch(t){}setTimeout(()=>{try{r.removeEventListener("transitionend",i,!0),o()}catch(t){}},700)}):Promise.resolve()}(r.outer),await L()}catch(t){}}async function L(){for(;w<3&&b.length;){const t=b.shift();if(y.has(t.key)){const e=y.get(t.key);e.count+=t.count,await T(e);continue}x(t.options,t.key,t.count)}}async function T({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 n=t.querySelector(".toast-count-badge");n||(n=document.createElement("span"),n.className="toast-count-badge",n.setAttribute("aria-label",`${e} identical notifications`),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"}),t.appendChild(n)),n.textContent=e>99?"99+":String(e);try{n.style.transform="scale(1.2)",setTimeout(()=>n.style.transform="scale(1)",150)}catch(t){}}let M={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"},I={success:"Operation completed successfully!",error:"Something went wrong!",warning:"Warning message!",info:"Information message!"};const O=[];let $=!1;async function N(t={}){try{const e=await async function(t){var e;const n=null==t||null===(e=t.position)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim(),r=null!=n&&n.includes("top-full-width")||null!=n&&n.includes("bottom-full-width")?"100vw":"400px",i={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",animationType:"fade",animationEasing:"ease",showProgressBar:!0,progressColor:void 0,progressHeight:"4px",progressPosition:"bottom",fontPosition:"relative",fontPadding:void 0,fontBorderRadius:void 0,fontBackgroundColor:void 0,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:r,..."object"!=typeof t||Array.isArray(t)?{}:t};i.message=(null==t?void 0:t.message)??i.message;try{var a,s;if(!i.backgroundColor)i.backgroundColor=(null===(s=M)||void 0===s?void 0:s[i.type])??(window.matchMedia("(prefers-color-scheme: dark)").matches?"#f5f5f5":"#111111");if(i.message=i.message||(null===(a=I)||void 0===a?void 0:a[i.type])||"No Message Provided!",!i.textColor&&i.backgroundColor){const t=o(i.backgroundColor);i.textColor=t}if(!i.progressColor&&i.backgroundColor)if(i.textColor)i.progressColor=i.textColor;else{const t=o(i.backgroundColor);i.progressColor=t}}catch(t){}"string"!=typeof i.message&&(i.message="No Message Provided!");return i}(t);await async function(t){try{return await p(t,f)}catch(t){return document.body}}(e),await v(e)}catch(e){const n="string"==typeof(null==t?void 0:t.message)&&null!==(null==t?void 0:t.message)?`${t.message.substring(0,200)} toast creation failed!`:"Toast creation failed!";alert(n)}}function j(t){try{t&&"object"==typeof t&&!Array.isArray(t)&&(M={...M,...t})}catch(t){}}function z(t){try{t&&"object"==typeof t&&!Array.isArray(t)&&(I={...I,...t})}catch(t){}}let D=!1,B=null;const H=async function(t={}){"undefined"!=typeof window&&"undefined"!=typeof document&&(await async function(){$||"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"interactive"===document.readyState?($=!0,O.forEach(t=>setTimeout(()=>N(t),2500)),O.length=0):document.addEventListener("DOMContentLoaded",()=>{$=!0,O.forEach(t=>setTimeout(()=>N(t),2500)),O.length=0},{once:!0}))}(),$?await N(t):O.push(t))};async function P(t={}){return async function(t){if(D&&B)try{await B}catch(t){}return t()}(()=>H(t))}const R=async()=>{D=!0,B=(async()=>{try{await C()}finally{D=!1,B=null}})(),await B},W=async()=>{D=!0,B=(async()=>{try{await k()}finally{D=!1,B=null}})(),await B};if("undefined"!=typeof window&&"undefined"!=typeof document){let t=!1;if(!t){const e=t=>{"Escape"!==t.key&&"Esc"!==t.key||(async()=>{D=!0,B=(async()=>{try{await C()}finally{D=!1,B=null}})(),await B})()};window.addEventListener("keydown",e,{passive:!0}),t=!0}}try{"undefined"!=typeof window&&(window.customizableToast={createToast:P,setDefaultColors:j,setDefaultMessages:z,noop:W,dismiss:R})}catch(t){}exports.createToast=P,exports.dismiss=R,exports.dismissToast=R,exports.noop=W,exports.noopAll=W,exports.setDefaultColors=j,exports.setDefaultMessages=z;
|
|
16
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/utils/dom.js","../src/utils/id.js","../src/utils/html-sanitizer.js","../src/components/toast-utils.js","../src/components/loader.js","../src/components/toast-utils-core.js","../src/utils/containerRegistry.js","../src/utils/position.js","../src/utils/PausableTimer.js","../src/components/ToastManager.js","../src/components/Toast.js","../src/index.js"],"sourcesContent":["\"use strict\";\n\nimport { generateToastId } from \"./id.js\";\n\nexport async function createElementWithId(tagName, prefix) {\n if (!tagName || !prefix) throw new Error(\"tagName and prefix are required\");\n const el = document.createElement(tagName);\n el.id = generateToastId(prefix);\n return el;\n}\n\nexport async function appendChild(parent, child) {\n if (!parent || !child) return false;\n\n try {\n if (!parent.contains(child)) parent.appendChild(child);\n return true;\n } catch (primaryError) {\n console.warn(\"appendChild primary failed:\", primaryError);\n try {\n parent.insertAdjacentElement(\"beforeend\", child);\n return true;\n } catch (fallbackError) {\n console.warn(\"appendChild fallback failed:\", fallbackError);\n try {\n if (parent === document.body) {\n const clone = child.cloneNode(true);\n parent.appendChild(clone);\n return true;\n }\n } catch (emergencyError) {\n console.error(\"appendChild emergency failed:\", emergencyError);\n return false;\n }\n }\n }\n return false;\n}\n\nexport async function removeElement(el) {\n if (!el) return true;\n\n try {\n if (el?.parentNode?.id.includes(\"toast-container-\")) {\n el.parentNode.removeChild(el);\n return true;\n }\n } catch {}\n\n try {\n if (el.remove) {\n el.remove();\n return true;\n }\n } catch {}\n\n try {\n Object.assign(el.style, {\n display: \"none\",\n opacity: \"0\",\n pointerEvents: \"none\",\n position: \"absolute\",\n left: \"-9999px\",\n });\n return true;\n } catch {}\n\n return false;\n}\n\nexport async function parseAnimationDuration(duration) {\n if (typeof duration === \"number\" && duration > 0) return duration;\n if (typeof duration === \"string\") {\n if (duration.endsWith(\"s\") && !duration.endsWith(\"ms\")) {\n const parsed = parseFloat(duration) * 1000;\n return parsed > 0 ? parsed : 500;\n }\n const parsed = parseFloat(duration);\n return parsed > 0 ? parsed : 500;\n }\n return 500;\n}\n\nexport function forceReflow(el) {\n try {\n return el?.offsetWidth || 0;\n } catch (error) {\n console.warn(\"Force reflow failed:\", error);\n return 0;\n }\n}\n\nexport function query(selector, root = document) {\n return root.querySelector(selector);\n}\n\nclass LRUCache {\n constructor(maxSize = 200) {\n this.maxSize = maxSize;\n this.map = new Map();\n }\n\n get(key) {\n if (!this.map.has(key)) return undefined;\n const value = this.map.get(key);\n this.map.delete(key);\n this.map.set(key, value);\n return value;\n }\n\n set(key, value) {\n if (this.map.has(key)) this.map.delete(key);\n else if (this.map.size >= this.maxSize) {\n const firstKey = this.map.keys().next().value;\n this.map.delete(firstKey);\n }\n this.map.set(key, value);\n }\n}\n\nconst colorCache = new LRUCache(200);\n\nconst namedColors = {\n aliceblue: [240, 248, 255],\n antiquewhite: [250, 235, 215],\n aqua: [0, 255, 255],\n aquamarine: [127, 255, 212],\n azure: [240, 255, 255],\n beige: [245, 245, 220],\n bisque: [255, 228, 196],\n black: [0, 0, 0],\n blanchedalmond: [255, 235, 205],\n blue: [0, 0, 255],\n blueviolet: [138, 43, 226],\n brown: [165, 42, 42],\n burlywood: [222, 184, 135],\n cadetblue: [95, 158, 160],\n chartreuse: [127, 255, 0],\n chocolate: [210, 105, 30],\n coral: [255, 127, 80],\n cornflowerblue: [100, 149, 237],\n cornsilk: [255, 248, 220],\n crimson: [220, 20, 60],\n cyan: [0, 255, 255],\n darkblue: [0, 0, 139],\n darkcyan: [0, 139, 139],\n darkgoldenrod: [184, 134, 11],\n darkgray: [169, 169, 169],\n darkgreen: [0, 100, 0],\n darkgrey: [169, 169, 169],\n darkkhaki: [189, 183, 107],\n darkmagenta: [139, 0, 139],\n darkolivegreen: [85, 107, 47],\n darkorange: [255, 140, 0],\n darkorchid: [153, 50, 204],\n darkred: [139, 0, 0],\n darksalmon: [233, 150, 122],\n darkseagreen: [143, 188, 143],\n darkslateblue: [72, 61, 139],\n darkslategray: [47, 79, 79],\n darkslategrey: [47, 79, 79],\n darkturquoise: [0, 206, 209],\n darkviolet: [148, 0, 211],\n deeppink: [255, 20, 147],\n deepskyblue: [0, 191, 255],\n dimgray: [105, 105, 105],\n dimgrey: [105, 105, 105],\n dodgerblue: [30, 144, 255],\n firebrick: [178, 34, 34],\n floralwhite: [255, 250, 240],\n forestgreen: [34, 139, 34],\n fuchsia: [255, 0, 255],\n gainsboro: [220, 220, 220],\n ghostwhite: [248, 248, 255],\n gold: [255, 215, 0],\n goldenrod: [218, 165, 32],\n gray: [128, 128, 128],\n green: [0, 128, 0],\n greenyellow: [173, 255, 47],\n grey: [128, 128, 128],\n honeydew: [240, 255, 240],\n hotpink: [255, 105, 180],\n indianred: [205, 92, 92],\n indigo: [75, 0, 130],\n ivory: [255, 255, 240],\n khaki: [240, 230, 140],\n lavender: [230, 230, 250],\n lavenderblush: [255, 240, 245],\n lawngreen: [124, 252, 0],\n lemonchiffon: [255, 250, 205],\n lightblue: [173, 216, 230],\n lightcoral: [240, 128, 128],\n lightcyan: [224, 255, 255],\n lightgoldenrodyellow: [250, 250, 210],\n lightgray: [211, 211, 211],\n lightgreen: [144, 238, 144],\n lightgrey: [211, 211, 211],\n lightpink: [255, 182, 193],\n lightsalmon: [255, 160, 122],\n lightseagreen: [32, 178, 170],\n lightskyblue: [135, 206, 250],\n lightslategray: [119, 136, 153],\n lightslategrey: [119, 136, 153],\n lightsteelblue: [176, 196, 222],\n lightyellow: [255, 255, 224],\n lime: [0, 255, 0],\n limegreen: [50, 205, 50],\n linen: [250, 240, 230],\n magenta: [255, 0, 255],\n maroon: [128, 0, 0],\n mediumaquamarine: [102, 205, 170],\n mediumblue: [0, 0, 205],\n mediumorchid: [186, 85, 211],\n mediumpurple: [147, 112, 219],\n mediumseagreen: [60, 179, 113],\n mediumslateblue: [123, 104, 238],\n mediumspringgreen: [0, 250, 154],\n mediumturquoise: [72, 209, 204],\n mediumvioletred: [199, 21, 133],\n midnightblue: [25, 25, 112],\n mintcream: [245, 255, 250],\n mistyrose: [255, 228, 225],\n moccasin: [255, 228, 181],\n navajowhite: [255, 222, 173],\n navy: [0, 0, 128],\n oldlace: [253, 245, 230],\n olive: [128, 128, 0],\n olivedrab: [107, 142, 35],\n orange: [255, 165, 0],\n orangered: [255, 69, 0],\n orchid: [218, 112, 214],\n palegoldenrod: [238, 232, 170],\n palegreen: [152, 251, 152],\n paleturquoise: [175, 238, 238],\n palevioletred: [219, 112, 147],\n papayawhip: [255, 239, 213],\n peachpuff: [255, 218, 185],\n peru: [205, 133, 63],\n pink: [255, 192, 203],\n plum: [221, 160, 221],\n powderblue: [176, 224, 230],\n purple: [128, 0, 128],\n rebeccapurple: [102, 51, 153],\n red: [255, 0, 0],\n rosybrown: [188, 143, 143],\n royalblue: [65, 105, 225],\n saddlebrown: [139, 69, 19],\n salmon: [250, 128, 114],\n sandybrown: [244, 164, 96],\n seagreen: [46, 139, 87],\n seashell: [255, 245, 238],\n sienna: [160, 82, 45],\n silver: [192, 192, 192],\n skyblue: [135, 206, 235],\n slateblue: [106, 90, 205],\n slategray: [112, 128, 144],\n slategrey: [112, 128, 144],\n snow: [255, 250, 250],\n springgreen: [0, 255, 127],\n steelblue: [70, 130, 180],\n tan: [210, 180, 140],\n teal: [0, 128, 128],\n thistle: [216, 191, 216],\n tomato: [255, 99, 71],\n turquoise: [64, 224, 208],\n violet: [238, 130, 238],\n wheat: [245, 222, 179],\n white: [255, 255, 255],\n whitesmoke: [245, 245, 245],\n yellow: [255, 255, 0],\n yellowgreen: [154, 205, 50],\n};\n\nconst precomputedNamedTextColors = {};\nObject.entries(namedColors).forEach(([name, [r, g, b]]) => {\n const lum = (c) => {\n const v = c / 255;\n return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\n };\n const L = 0.2126 * lum(r) + 0.7152 * lum(g) + 0.0722 * lum(b);\n const contrastBlack = (L + 0.05) / 0.05;\n const contrastWhite = 1.05 / (L + 0.05);\n precomputedNamedTextColors[name.toLowerCase()] =\n contrastBlack >= contrastWhite ? \"#000000\" : \"#ffffff\";\n});\n\nexport function getDynamicAccessibleTextColorHex(toastBg, opa = 1) {\n if (!toastBg) return \"snow\";\n\n const key = `${toastBg}|${opa}`;\n const cached = colorCache.get(key);\n if (cached) return cached;\n\n if (precomputedNamedTextColors[toastBg?.toLowerCase()]) {\n const textColor = precomputedNamedTextColors[toastBg.toLowerCase()];\n colorCache.set(key, textColor);\n return textColor;\n }\n\n let r, g, b;\n\n // AUDIT FIX (H2): this function previously only understood hex and\n // rgb()/rgba() strings. Anything else — hsl(), a CSS custom property\n // like var(--brand), any modern color syntax — fell straight into the\n // catch block below, which used to assign a RANDOM RGB triplet as the\n // \"background\" driving the black-vs-white text decision. For a function\n // whose entire purpose is accessibility, that meant it could pick white\n // text on a light background (or the reverse) for any color format it\n // didn't recognize, and the choice wasn't even stable between calls for\n // the same input. Two changes: (1) genuinely parse hsl()/hsla() and CSS\n // custom properties instead of giving up on them, (2) for the cases\n // that are still truly unparseable, fall back to a fixed neutral\n // midpoint gray instead of Math.random() — deterministic and\n // reasonable, never actively wrong in a random direction.\n function resolveCssCustomProperty(value) {\n const varMatch = value?.match(/^var\\((--[\\w-]+)(?:\\s*,\\s*(.+))?\\)$/i);\n if (!varMatch) return value;\n try {\n if (\n typeof document !== \"undefined\" &&\n typeof getComputedStyle === \"function\"\n ) {\n const resolved = getComputedStyle(document.documentElement)\n .getPropertyValue(varMatch[1])\n .trim();\n if (resolved) return resolved;\n }\n } catch (e) {}\n // Fall back to the var()'s own declared fallback value, if it had one\n // (e.g. var(--brand, #336699)), before giving up entirely.\n return varMatch[2]?.trim() || value;\n }\n\n function parseToRgb(value) {\n const hexMatch = value?.match(/^#([0-9a-f]{3,8})$/i);\n if (hexMatch) {\n let hex = hexMatch[1];\n if (hex.length === 3)\n hex = hex\n .split(\"\")\n .map((c) => c + c)\n .join(\"\");\n return {\n r: parseInt(hex.slice(0, 2), 16),\n g: parseInt(hex.slice(2, 4), 16),\n b: parseInt(hex.slice(4, 6), 16),\n };\n }\n\n const rgbMatch = value?.match(\n /rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)(?:,\\s*[\\d.]+)?\\)/i,\n );\n if (rgbMatch) {\n return {\n r: Number(rgbMatch[1]),\n g: Number(rgbMatch[2]),\n b: Number(rgbMatch[3]),\n };\n }\n\n const hslMatch = value?.match(\n /hsla?\\(\\s*([\\d.]+)(?:deg)?\\s*,\\s*([\\d.]+)%\\s*,\\s*([\\d.]+)%(?:\\s*,\\s*[\\d.]+)?\\)/i,\n );\n if (hslMatch) {\n const h = Number(hslMatch[1]) / 360;\n const s = Number(hslMatch[2]) / 100;\n const l = Number(hslMatch[3]) / 100;\n if (s === 0) {\n const gray = Math.round(l * 255);\n return { r: gray, g: gray, b: gray };\n }\n const hue2rgb = (p, q, t) => {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n };\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n return {\n r: Math.round(hue2rgb(p, q, h + 1 / 3) * 255),\n g: Math.round(hue2rgb(p, q, h) * 255),\n b: Math.round(hue2rgb(p, q, h - 1 / 3) * 255),\n };\n }\n\n return null;\n }\n\n try {\n const resolvedBg = resolveCssCustomProperty(toastBg);\n const parsed = parseToRgb(resolvedBg);\n if (!parsed) throw new Error(\"Unknown color\");\n ({ r, g, b } = parsed);\n } catch {\n // Deterministic neutral fallback — a mid-gray reads reasonably against\n // either black or white text, and critically, gives the SAME answer\n // every time for the same unparseable input instead of a coin flip.\n r = g = b = 128;\n }\n\n r = Math.round(r * opa + 255 * (1 - opa));\n g = Math.round(g * opa + 255 * (1 - opa));\n b = Math.round(b * opa + 255 * (1 - opa));\n\n const rgbToHsl = (r, g, b) => {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b),\n min = Math.min(r, g, b);\n let h,\n s,\n l = (max + min) / 2;\n if (max === min) h = s = 0;\n else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n }\n h /= 6;\n }\n return [h * 360, s, l];\n };\n const hslToRgb = (h, s, l) => {\n h /= 360;\n let r, g, b;\n if (s === 0) r = g = b = l;\n else {\n const hue2rgb = (p, q, t) => {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n };\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)];\n };\n const luminance = (r, g, b) => {\n const a = [r, g, b].map((v) => {\n v /= 255;\n return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\n });\n return 0.2126 * a[0] + 0.7152 * a[1] + 0.0722 * a[2];\n };\n const contrastRatio = (rgb1, rgb2) => {\n const L1 = luminance(...rgb1);\n const L2 = luminance(...rgb2);\n return (Math.max(L1, L2) + 0.05) / (Math.min(L1, L2) + 0.05);\n };\n const rgbToHex = (r, g, b) =>\n `#${r.toString(16).padStart(2, \"0\")}${g.toString(16).padStart(2, \"0\")}${b\n .toString(16)\n .padStart(2, \"0\")}`;\n\n let [h, s, l] = rgbToHsl(r, g, b);\n const minContrast = 4.5;\n let textL = l < 0.5 ? Math.min(l + 0.5, 1) : Math.max(l - 0.5, 0);\n let [tr, tg, tb] = hslToRgb(h, s, textL);\n\n if (contrastRatio([r, g, b], [tr, tg, tb]) < minContrast) {\n const contrastBlack = contrastRatio([r, g, b], [0, 0, 0]);\n const contrastWhite = contrastRatio([r, g, b], [255, 255, 255]);\n [tr, tg, tb] = contrastBlack >= contrastWhite ? [0, 0, 0] : [255, 255, 255];\n }\n\n const result = rgbToHex(tr, tg, tb);\n colorCache.set(key, result);\n return result;\n}\n","// src/utils/id.js\n\"use strict\";\n\n/**\n * Generate unique ID for DOM elements to avoid conflicts\n * @param {string} prefix - Optional prefix for ID\n * @returns {string} Unique ID\n */\nexport function generateToastId(prefix) {\n const timestamp = Date.now().toString(36); // shorter timestamp\n const random = Math.floor(Math.random() * 0xfffff).toString(36); // short random part\n return `${prefix}-${timestamp}-${random}`;\n}\n","// AUDIT FIX (H1): these used to live inside fallbackSanitize() only, which\n// meant sanitizeHtml()'s DOMPurify branch had no way to reference them —\n// it just used DOMPurify's own (much broader) default allowlist instead.\n// Same allowHtml:true input could sanitize completely differently\n// depending on whether some UNRELATED script on the host page happened to\n// load DOMPurify onto window — a security boundary that was an\n// environmental accident rather than a deliberate, consistent policy.\n// Hoisting these to module scope makes them the single source of truth\n// for BOTH paths, so the same input gets the same treatment regardless of\n// which sanitizer implementation actually runs.\nconst ALLOWED_TAGS = new Set([\n \"DIV\",\n \"SPAN\",\n \"P\",\n \"BR\",\n \"STRONG\",\n \"B\",\n \"EM\",\n \"I\",\n \"U\",\n \"SMALL\",\n \"UL\",\n \"OL\",\n \"LI\",\n \"A\",\n \"IMG\",\n \"PRE\",\n \"CODE\",\n \"MARK\",\n]);\n// AUDIT FIX (C1 — security): 'style' was previously allowed through with\n// zero validation, letting an attacker-controlled message (allowHtml:true)\n// inject `position:fixed;inset:0;z-index:999999` and render a full-page\n// clickjacking overlay through a toast that already renders at\n// z-index:9999. Inline style is a well-known sanitizer bypass class (see\n// OWASP's XSS Filter Evasion Cheat Sheet). Removed from the allowlist\n// entirely rather than attempting partial validation — toasts don't need\n// arbitrary inline styling to be useful, and \"no unchecked style\" is the\n// safe default most reputable sanitizers ship with.\nconst ALLOWED_ATTRS = new Set([\n \"href\",\n \"src\",\n \"alt\",\n \"title\",\n \"class\",\n \"target\",\n \"rel\",\n]);\n\nexport function hasDOMPurify() {\n try {\n if (typeof window !== \"undefined\" && window.DOMPurify) return true;\n } catch (e) {}\n return false;\n}\n\nexport function fallbackSanitize(dirty) {\n if (!dirty || typeof dirty !== \"string\") return \"\";\n\n const blockedTags =\n /<\\/?(script|iframe|object|embed|link|meta|style|form|input|button)[^>]*>/gi;\n let step1 = dirty.replace(blockedTags, \"\");\n\n step1 = step1.replace(/\\s(on\\w+)\\s*=\\s*(['\"])[\\s\\S]*?\\2/gi, \"\");\n\n step1 = step1.replace(\n /(href|src)\\s*=\\s*(['\"])\\s*javascript:[^'\"]*\\2/gi,\n \"$1=$2#$2\",\n );\n\n const container = document.createElement(\"div\");\n container.innerHTML = step1;\n\n function sanitizeNode(node) {\n if (node.nodeType === Node.TEXT_NODE) {\n return document.createTextNode(node.nodeValue);\n }\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return null;\n }\n const tag = node.tagName.toUpperCase();\n if (!ALLOWED_TAGS.has(tag)) {\n const frag = document.createDocumentFragment();\n Array.from(node.childNodes).forEach((child) => {\n const sanitized = sanitizeNode(child);\n if (sanitized) frag.appendChild(sanitized);\n });\n return frag;\n }\n const el = document.createElement(node.tagName);\n Array.from(node.attributes || []).forEach((attr) => {\n const name = attr.name.toLowerCase();\n const val = attr.value;\n if (!ALLOWED_ATTRS.has(name)) return;\n if ((name === \"href\" || name === \"src\") && /^\\s*javascript:/i.test(val))\n return;\n if (name === \"src\" && !/^\\s*(https?:|data:image\\/)/i.test(val)) return;\n if (name === \"target\" && val === \"_blank\") {\n el.setAttribute(\n \"rel\",\n (node.getAttribute(\"rel\") || \"\") + \" noopener noreferrer\",\n );\n }\n el.setAttribute(name, val);\n });\n Array.from(node.childNodes).forEach((child) => {\n const sanitizedChild = sanitizeNode(child);\n if (sanitizedChild) el.appendChild(sanitizedChild);\n });\n return el;\n }\n\n const outFrag = document.createDocumentFragment();\n Array.from(container.childNodes).forEach((child) => {\n const s = sanitizeNode(child);\n if (s) outFrag.appendChild(s);\n });\n\n const wrapper = document.createElement(\"div\");\n wrapper.appendChild(outFrag);\n return wrapper.innerHTML;\n}\n\nexport function sanitizeHtml(dirty, opts = {}) {\n if (!dirty) return \"\";\n try {\n if (!opts.forceFallback && hasDOMPurify()) {\n const DOMPurify = window.DOMPurify;\n // AUDIT FIX (H1): previously called DOMPurify.sanitize() with only\n // ADD_ATTR/ALLOWED_URI_REGEXP, meaning tags/attributes were governed\n // by DOMPurify's own broad DEFAULT allowlist — not the tight,\n // deliberately-curated one this library actually promises. Now\n // passing the SAME ALLOWED_TAGS/ALLOWED_ATTRS used by\n // fallbackSanitize(), so a consumer gets identical sanitization\n // behavior whether or not some other script on the page happens to\n // have loaded DOMPurify.\n const cleaned = DOMPurify.sanitize(dirty, {\n ALLOWED_TAGS: Array.from(ALLOWED_TAGS),\n ALLOWED_ATTR: Array.from(ALLOWED_ATTRS),\n ALLOWED_URI_REGEXP:\n /^(?:(?:https?|mailto|ftp|tel|data):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i,\n });\n\n // Replicates fallbackSanitize()'s auto rel=\"noopener noreferrer\" on\n // target=\"_blank\" links — DOMPurify doesn't do this automatically,\n // so without this the two paths would still diverge on this one\n // detail even with matching tag/attribute allowlists. Re-parsing the\n // already-clean output (not the original dirty string) so this can\n // only ever tighten, never loosen, what DOMPurify already produced.\n const wrapper = document.createElement(\"div\");\n wrapper.innerHTML = cleaned;\n wrapper.querySelectorAll('a[target=\"_blank\"]').forEach((a) => {\n const rel = (a.getAttribute(\"rel\") || \"\").split(/\\s+/).filter(Boolean);\n if (!rel.includes(\"noopener\")) rel.push(\"noopener\");\n if (!rel.includes(\"noreferrer\")) rel.push(\"noreferrer\");\n a.setAttribute(\"rel\", rel.join(\" \"));\n });\n return wrapper.innerHTML;\n }\n } catch (err) {}\n return fallbackSanitize(dirty);\n}\n","// src/components/toast-utils.js\n\"use strict\";\n\nimport { parseAnimationDuration } from \"../utils/dom.js\";\nimport { sanitizeHtml } from \"../utils/html-sanitizer.js\";\nimport { createLoader } from \"./loader.js\";\nimport {\n createCTA,\n createCloseButton,\n createProgressBar,\n runToastAnimation,\n} from \"./toast-utils-core.js\";\n\n/**\n * Applies rich styling and content to a toast element.\n * @param {HTMLElement} toast - The toast container element.\n * @param {object} options - Configuration options for the toast.\n * @param {Function} onClose - Callback invoked when the toast closes.\n */\nexport async function applyRichStyling(toast, options, onClose) {\n const durationMs = await parseAnimationDuration(options?.animationDuration);\n\n // Compose className based on provided type (default to \"info\")\n toast.className = `toast toast-${options?.type ?? \"info\"}`;\n\n Object.assign(toast.style, {\n background: options?.backgroundColor,\n padding: \"12px 16px\",\n marginBottom: \"10px\",\n borderRadius: options?.borderRadius,\n overflow: \"hidden\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n boxShadow: \"0 4px 6px rgba(0, 0, 0, 0.1)\",\n minWidth: \"250px\",\n maxWidth: options?.maxWidth,\n opacity: \"0\",\n position: \"relative\",\n cursor: \"default\",\n boxSizing: \"border-box\",\n userSelect: \"text\",\n transition: `opacity ${options?.animationDuration} ${options?.animationEasing}, transform ${options?.animationDuration} ${options?.animationEasing}`,\n transform: \"translateY(20px)\",\n zIndex: \"9999\",\n });\n // Accessibility settings\n toast.setAttribute(\"role\", \"alert\");\n toast.setAttribute(\"aria-live\", \"polite\");\n toast.tabIndex = 0; // Make focusable for accessibility if needed\n\n toast._animationDuration = durationMs;\n\n const messageSpan = document.createElement(\"span\");\n\n if (options?.wrapText) {\n Object.assign(messageSpan.style, {\n display: \"block\",\n whiteSpace: \"normal\",\n });\n } else {\n Object.assign(messageSpan.style, {\n display: \"-webkit-box\",\n WebkitBoxOrient: \"vertical\",\n WebkitLineClamp: \"3\",\n whiteSpace: \"nowrap\",\n });\n }\n\n Object.assign(messageSpan.style, {\n flex: \"1\",\n padding: options?.fontPadding,\n fontFamily: options?.fontFamily,\n fontSize: options?.fontSize,\n fontWeight: options?.fontWeight,\n lineHeight: options?.fontLineHeight,\n color: options?.textColor,\n userSelect: \"text\",\n wordBreak: \"break-word\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n // AUDIT FIX (C4): display/WebkitLineClamp/WebkitBoxOrient used to be\n // re-applied here unconditionally, silently overwriting whatever the\n // wrapText conditional above had just set — meaning wrapText:\"normal\"\n // never actually worked; every toast truncated to 3 lines regardless.\n // Those three properties are already correctly set by the if/else block\n // above based on options.wrapText, so they're intentionally NOT\n // repeated here anymore.\n });\n\n const allowHtml = !!options.allowHtml; // opt-in flag\n const rawMessage = options.message ?? \"\";\n\n // If a loader is requested as part of the message, create it safely\n if (options.loader || options.showLoader) {\n // createLoader returns an element (see new function below)\n const loaderEl = createLoader(options.loader || {});\n // Put loader before message content\n messageSpan.appendChild(loaderEl);\n // Small spacer\n const spacer = document.createElement(\"span\");\n spacer.style.display = \"inline-block\";\n spacer.style.width = \"8px\";\n messageSpan.appendChild(spacer);\n }\n\n // If allowHtml is explicitly true, sanitize and set innerHTML, otherwise use textContent\n if (\n allowHtml &&\n typeof rawMessage === \"string\" &&\n rawMessage.trim().length > 0\n ) {\n try {\n const sanitized = sanitizeHtml(rawMessage);\n // Use DOM APIs to set sanitized HTML safely\n const tmp = document.createElement(\"div\");\n tmp.innerHTML = sanitized;\n // Move children to messageSpan to avoid re-parsing at outer scope\n while (tmp.firstChild) {\n messageSpan.appendChild(tmp.firstChild);\n }\n } catch (err) {\n console.warn(\n \"HTML message sanitization failed, falling back to text:\",\n err\n );\n messageSpan.textContent = rawMessage;\n }\n } else {\n // default safe text mode\n messageSpan.textContent = String(rawMessage);\n }\n\n // set aria + title\n messageSpan.setAttribute(\"aria-label\", \"Toast Notification Center\");\n messageSpan.setAttribute(\n \"title\",\n typeof rawMessage === \"string\"\n ? rawMessage.replace(/<[^>]+>/g, \"\")\n : String(rawMessage)\n );\n toast.appendChild(messageSpan);\n\n if (options?.cta && Object.keys(options.cta).length !== 0) {\n createCTA(toast, options, onClose);\n }\n\n if (options?.showCloseButton) {\n createCloseButton(toast, options, onClose);\n }\n\n if (options?.showProgressBar) {\n createProgressBar(toast, options);\n }\n\n runToastAnimation(toast);\n}\n\n/**\n * Creates an emergency toast as a safe fallback.\n * @param {object} options - Configuration options for the toast.\n * @param {Function} onClose - Callback invoked when the toast closes.\n * @returns {Promise<HTMLElement|null>}\n */\nexport async function createEmergencyToast(options, onClose) {\n try {\n const emergency = document.createElement(\"div\");\n Object.assign(emergency.style, {\n background: \"#333\",\n color: \"white\",\n padding: \"10px 15px\",\n position: \"fixed\",\n top: \"20px\",\n right: \"20px\",\n zIndex: \"99999\",\n borderRadius: \"3px\",\n maxWidth: \"250px\",\n wordWrap: \"break-word\",\n boxShadow: \"0 2px 10px rgba(0,0,0,0.3)\",\n cursor: \"pointer\",\n });\n\n const innerWrapper = document.createElement(\"div\");\n const msgEl = document.createElement(\"span\");\n msgEl.style.display = \"inline-block\";\n if (options.allowHtml) {\n msgEl.innerHTML = sanitizeHtml(\n String(options.message || \"Emergency Toast Showing!\")\n );\n } else {\n msgEl.textContent = String(\n options.message || \"Emergency Toast Creation Showing!\"\n );\n }\n innerWrapper.appendChild(msgEl);\n\n // add close X via textContent to avoid innerHTML\n const closeSpan = document.createElement(\"span\");\n closeSpan.style.cssText =\n \"float: right; margin-left: 10px; font-weight: bold;\";\n closeSpan.textContent = \"×\";\n innerWrapper.appendChild(closeSpan);\n\n while (emergency.firstChild) emergency.removeChild(emergency.firstChild);\n emergency.appendChild(innerWrapper);\n closeSpan.onclick = () => {\n emergency.remove();\n onClose(emergency);\n };\n\n document.body.appendChild(emergency);\n setTimeout(() => {\n emergency.remove();\n onClose(emergency);\n }, options?.duration);\n\n return emergency;\n } catch (error) {\n console.error(\"Emergency toast creation failed:\", error);\n setTimeout(() => {\n alert(options?.message || \"Emergency Toast Creation Showing!\");\n onClose(null);\n }, 100);\n return null;\n }\n}\n","// src/components/loader.js\nexport function createLoader(opts = {}) {\n const size = opts.size || 14;\n const color = opts.color || \"currentColor\";\n const labelText = opts.text || \"\";\n const wrapper = document.createElement(\"span\");\n wrapper.className = \"toast-loader\";\n wrapper.style.display = \"inline-flex\";\n wrapper.style.alignItems = \"center\";\n wrapper.style.gap = \"8px\";\n\n const svgNS = \"http://www.w3.org/2000/svg\";\n const svg = document.createElementNS(svgNS, \"svg\");\n svg.setAttribute(\"width\", String(size));\n svg.setAttribute(\"height\", String(size));\n svg.setAttribute(\"viewBox\", \"0 0 50 50\");\n svg.setAttribute(\"aria-hidden\", \"true\");\n // spinner circle\n const circle = document.createElementNS(svgNS, \"circle\");\n circle.setAttribute(\"cx\", \"25\");\n circle.setAttribute(\"cy\", \"25\");\n circle.setAttribute(\"r\", \"20\");\n circle.setAttribute(\"fill\", \"none\");\n circle.setAttribute(\"stroke\", color);\n circle.setAttribute(\"stroke-width\", \"4\");\n circle.setAttribute(\"stroke-linecap\", \"round\");\n circle.style.opacity = \"0.85\";\n circle.style.strokeDasharray = \"90\";\n circle.style.strokeDashoffset = \"60\";\n circle.style.transformOrigin = \"center\";\n circle.style.animation = \"toast-spinner 1s linear infinite\";\n\n svg.appendChild(circle);\n wrapper.appendChild(svg);\n\n if (labelText) {\n const lbl = document.createElement(\"span\");\n lbl.style.fontSize = \"13px\";\n lbl.textContent = labelText;\n wrapper.appendChild(lbl);\n }\n\n // add minimal spinner keyframes if not present\n if (!document.getElementById(\"toast-spinner-styles\")) {\n const st = document.createElement(\"style\");\n st.id = \"toast-spinner-styles\";\n st.innerHTML = `@keyframes toast-spinner { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }`;\n document.head.appendChild(st);\n }\n\n return wrapper;\n}\n","\"use strict\";\n\n/**\n * Creates a Call-To-Action (CTA) button or link for the toast.\n * @param {HTMLElement} toast - The toast container element.\n * @param {Object} options - Toast options including cta config.\n * @param {Function} onClose - Callback when toast closes.\n */\nexport function createCTA(toast, options, onClose) {\n const cfg = options?.cta;\n if (!cfg) return;\n\n if (!cfg.label) {\n cfg.label = \"CTA Label Missing!\";\n }\n\n const isLink = !!cfg.href && cfg.variant === \"link\";\n const el = document.createElement(isLink ? \"a\" : \"button\");\n\n if (isLink) {\n el.href = cfg.href;\n if (cfg.target) el.target = cfg.target;\n el.rel = cfg.rel || (cfg.target === \"_blank\" ? \"noopener noreferrer\" : \"\");\n } else {\n el.type = \"button\";\n }\n\n el.setAttribute(\"aria-label\", cfg.ariaLabel || cfg.label);\n\n Object.assign(el.style, {\n marginLeft: \"10px\",\n padding: \"6px 10px\",\n borderRadius: \"6px\",\n fontSize: \"12px\",\n fontWeight: \"600\",\n lineHeight: \"1\",\n border: \"1px solid rgba(255,255,255,0.35)\",\n color: options.textColor || \"#fff\",\n background: \"rgba(255,255,255,0.15)\",\n cursor: \"pointer\",\n whiteSpace: \"nowrap\",\n flexShrink: \"0\",\n });\n\n el.textContent = cfg.label;\n\n const onClick = async (e) => {\n try {\n if (typeof cfg.onClick === \"function\") {\n const res = cfg.onClick(e);\n if (res?.then) await res;\n }\n } finally {\n if (cfg.autoClose !== false) onClose(toast);\n }\n };\n\n el.addEventListener(\"click\", onClick);\n\n // Store cleanup for event listener removal if needed\n el._cleanup = () => el.removeEventListener(\"click\", onClick);\n\n toast.appendChild(el);\n}\n\n/**\n * Creates the close button for the toast.\n * @param {HTMLElement} toast\n * @param {Object} options\n * @param {Function} onClose\n */\nexport function createCloseButton(toast, options, onClose) {\n const closeBtn = document.createElement(\"button\");\n closeBtn.setAttribute(\"aria-label\", \"Close notification\");\n closeBtn.setAttribute(\"title\", \"Close\");\n closeBtn.textContent = \"×\";\n\n Object.assign(closeBtn.style, {\n background: \"none\",\n border: \"none\",\n color: options.textColor || \"white\",\n fontSize: \"18px\",\n marginLeft: \"10px\",\n cursor: \"pointer\",\n });\n\n const onClick = () => onClose(toast);\n closeBtn.addEventListener(\"click\", onClick);\n\n // Provide cleanup for memory management\n toast._cleanupCloseButton = () => {\n closeBtn.removeEventListener(\"click\", onClick);\n };\n\n toast.appendChild(closeBtn);\n}\n\n/**\n * Creates and animates the progress bar on the toast.\n * @param {HTMLElement} toast\n * @param {Object} options\n */\nexport function createProgressBar(toast, options) {\n const progressBar = document.createElement(\"div\");\n const borderRadiusStr = options.borderRadius || 0;\n const borderRadiusNum = parseInt(borderRadiusStr, 10);\n // AUDIT FIX (H4, corrected): the first pass at this fix only stopped\n // `borderRadiusNum - 10` from going negative (which had flipped the\n // calc() into an addition). But the bar is also shifted right by\n // `left: 12px` below — and clamping the subtracted amount to a floor of\n // 0 doesn't account for that offset, so the bar's right edge still sat\n // at `12px + 100%`, ~12px past the container, for any small\n // borderRadius. The real constraint is: leftOffset + width must not\n // exceed 100%, i.e. the subtracted amount must be at least as large as\n // the left offset (12px) whenever that offset is applied. For large\n // borderRadius (the library's own default is 50px) this clamp never\n // kicks in — behavior there is unchanged from before.\n const leftVal = borderRadiusNum ? \"12px\" : \"0\";\n const minSafeOffset = borderRadiusNum ? 12 : 0;\n const radiusOffset = Math.max(borderRadiusNum - 10, minSafeOffset);\n const finalWidth = borderRadiusNum\n ? `calc(100% - ${radiusOffset}px)`\n : \"100%\";\n\n Object.assign(progressBar.style, {\n position: \"absolute\",\n left: `${leftVal}`,\n height: options.progressHeight || \"4px\",\n background: options.progressColor || \"rgba(255, 255, 255, 0.3)\",\n width: `${finalWidth}`,\n transition: `width ${options.duration || 1800}ms linear`,\n [options.progressPosition === \"top\" ? \"top\" : \"bottom\"]: \"0\",\n borderRadius: options.borderRadius || \"4px\",\n });\n\n toast.appendChild(progressBar);\n\n // AUDIT FIX (H3): this used to be a plain CSS `transition`, kicked off by\n // flipping `style.width` to \"0%\" after a setTimeout. That works visually,\n // but a CSS transition has no idea PausableTimer exists — it runs on its\n // own clock. When ToastManager.js calls timer.pause() on hover, the real\n // dismiss genuinely freezes, but the transition kept animating to 0% (or\n // had already finished), so the bar visually lied about how much time was\n // actually left.\n //\n // The Web Animations API (Element.animate()) solves this properly: it\n // returns an Animation object with real .pause()/.play() methods that we\n // can call from the exact same mouseenter/mouseleave/focus handlers that\n // already call timer.pause()/timer.resume() in ToastManager.js — so the\n // bar and the real timer are now driven by the same pause signal instead\n // of two independent clocks. Stored on the toast element (matching the\n // existing _cleanup/_pauseCleanup convention) so ToastManager.js can\n // reach it without createProgressBar needing to know about PausableTimer.\n //\n // Compatibility fallback: Element.animate() isn't available in every\n // environment this package claims to support (browserslist floor is\n // safari>=10.1; Web Animations API landed in Safari 13.1) or in test\n // environments like jsdom. Rather than throw and break toast creation\n // entirely, fall back to the original CSS-transition approach — it won't\n // get the pause-sync fix, but it degrades to the previous (already\n // shipped) behavior instead of crashing.\n if (typeof progressBar.animate === \"function\") {\n toast._progressAnimation = progressBar.animate(\n [{ width: finalWidth }, { width: \"0%\" }],\n {\n duration: Number(options.duration) || 1800,\n easing: \"linear\",\n fill: \"forwards\",\n delay: 50,\n },\n );\n } else {\n progressBar.style.transition = `width ${options.duration || 1800}ms linear`;\n setTimeout(() => {\n progressBar.offsetWidth;\n progressBar.style.width = \"0%\";\n }, 50);\n }\n}\n\n/**\n * Runs the toast's fade-in animation.\n * @param {HTMLElement} toast\n */\nexport function runToastAnimation(toast) {\n setTimeout(() => {\n requestAnimationFrame(() => {\n toast.style.opacity = \"1\";\n toast.style.transform = \"translateY(0)\";\n });\n }, 50);\n}\n","// src/utils/containerRegistry.js\n\"use strict\";\n\nconst containerRegistry = new Map(); // id -> HTMLElement\nconst containerLocks = new Map(); // id -> Promise<HTMLElement>\n\n/**\n * Normalize a position string to a canonical key (id-safe, stable).\n */\nexport function normalizePositionKey(position) {\n // lower-case, trim, unify separators, alias \"below\" -> \"bottom\"\n const raw = String(position).toLowerCase().trim();\n const aliased = raw.replace(/\\bbelow\\b/g, \"bottom\");\n return aliased\n .replace(/\\s+/g, \"-\")\n .replace(/[^a-z0-9-]/g, \"-\")\n .replace(/-{2,}/g, \"-\");\n}\n\n/**\n * Canonical container id\n */\nexport function getContainerId(position) {\n return `toast-container-${normalizePositionKey(position)}`;\n}\n\n/**\n * Atomically get or create a single container per canonical id.\n */\nexport async function getOrCreateToastContainer(options, setPosition) {\n const id = getContainerId(options.position);\n // If a creation is in-flight, await it\n if (containerLocks.has(id)) {\n return containerLocks.get(id);\n }\n\n const p = (async () => {\n // 1) Prefer registry cache if still connected\n const cached = containerRegistry.get(id);\n if (cached?.isConnected) {\n return cached;\n }\n\n // 2) Find existing in DOM\n let el = document.getElementById(id); // unique by spec, but may return first if duplicates exist\n if (el && !el.isConnected) {\n // re-attach if detached\n document.body.appendChild(el);\n }\n\n // 3) If not found, create\n if (!el) {\n el = document.createElement(\"div\");\n el.id = id;\n el.setAttribute(\"role\", \"status\"); // polite + atomic by default\n el.setAttribute(\"aria-atomic\", \"true\"); // explicit for consistency\n el.style.position = \"fixed\";\n el.style.zIndex = \"9999\";\n el.style.inset = \"auto 10px 10px auto\";\n el.style.display = \"flex\";\n el.style.justifyContent = \"space-between\";\n el.style.alignItems = \"center\";\n el.style.flexDirection = \"column\";\n el.style.overflow = \"hidden\";\n // Position with provided helper\n if (typeof setPosition === \"function\") {\n await setPosition(el, options);\n }\n document.body.appendChild(el);\n } else {\n // Ensure base styles and (re)apply position in case options changed\n el.style.position = el.style.position || \"fixed\";\n el.style.zIndex = el.style.zIndex || \"9999\";\n if (typeof setPosition === \"function\") {\n await setPosition(el, options);\n }\n }\n\n // 4) If somehow duplicates exist, keep the first and remove the rest\n // getElementById would have returned the first; clean up others proactively\n const all = document.querySelectorAll(`#${id}`);\n if (all.length > 1) {\n for (let i = 1; i < all.length; i++) {\n try {\n all[i].remove();\n } catch {}\n }\n }\n\n containerRegistry.set(id, el);\n return el;\n })();\n\n containerLocks.set(id, p);\n try {\n const out = await p;\n return out;\n } finally {\n // Clear the lock so future calls can re-enter if needed\n containerLocks.delete(getContainerId(options.position));\n }\n}\n","// src/utils/position.js\n\"use strict\";\n\n/**\n * Set position for toast container\n * @param {HTMLElement} container - Toast container element\n * @param {Object} options - Options object containing position\n * @returns {Promise<void>}\n */\nexport async function setPosition(container, options) {\n if (!container || !options.position) {\n throw new Error(\"Invalid container or position!\");\n }\n\n resetContainerStyles(container);\n const positionFlags = parsePosition(options.position);\n\n if (handleFullWidthPositions(container, options, positionFlags)) return;\n if (handleCenterPositions(container, positionFlags)) return;\n\n applyStandardPositioning(container, positionFlags);\n}\n\n/**\n * Reset all position-related styles\n * @param {HTMLElement} container\n */\nfunction resetContainerStyles(container) {\n container.style.top = \"auto\";\n container.style.bottom = \"auto\";\n container.style.left = \"auto\";\n container.style.right = \"auto\";\n container.style.transform = \"none\";\n}\n\n/**\n * Parse position string into boolean flags\n * @param {string} position\n * @returns {Object} Position flags\n */\nfunction parsePosition(position) {\n const pos = position.toLowerCase().trim();\n return {\n hasTop: pos.includes(\"top\"),\n hasBottom: pos.includes(\"bottom\") || pos.includes(\"below\"),\n hasLeft: pos.includes(\"left\"),\n hasRight: pos.includes(\"right\"),\n hasCenter: pos.includes(\"center\"),\n hasFullWidth:\n pos.includes(\"top-full-width\") ||\n pos.includes(\"bottom-full-width\") ||\n pos.includes(\"fullwidth\"),\n };\n}\n\n/**\n * Handle full-width positioning cases\n * @param {HTMLElement} container\n * @param {Object} options\n * @param {Object} flags\n * @returns {boolean} True if position was handled\n */\nfunction handleFullWidthPositions(container, options, flags) {\n if (!flags.hasFullWidth) return false;\n\n options.maxWidth = \"100vw\";\n\n if (flags.hasTop) {\n container.style.top = \"10px\";\n container.style.left = \"10px\";\n container.style.right = \"10px\";\n return true;\n }\n\n if (flags.hasBottom) {\n container.style.bottom = \"10px\";\n container.style.left = \"10px\";\n container.style.right = \"10px\";\n return true;\n }\n\n return false;\n}\n\n/**\n * Handle center positioning cases\n * @param {HTMLElement} container\n * @param {Object} flags\n * @returns {boolean} True if position was handled\n */\nfunction handleCenterPositions(container, flags) {\n if (!flags.hasCenter) return false;\n\n // top-center\n if (flags.hasTop && !flags.hasLeft && !flags.hasRight) {\n container.style.top = \"10px\";\n container.style.left = \"50%\";\n container.style.transform = \"translateX(-50%)\";\n return true;\n }\n\n // bottom-center\n if (flags.hasBottom && !flags.hasLeft && !flags.hasRight) {\n container.style.bottom = \"10px\";\n container.style.left = \"50%\";\n container.style.transform = \"translateX(-50%)\";\n return true;\n }\n\n // left-center\n if (flags.hasLeft && !flags.hasTop && !flags.hasBottom) {\n container.style.left = \"10px\";\n container.style.top = \"50%\";\n container.style.transform = \"translateY(-50%)\";\n return true;\n }\n\n // right-center\n if (flags.hasRight && !flags.hasTop && !flags.hasBottom) {\n container.style.right = \"10px\";\n container.style.top = \"50%\";\n container.style.transform = \"translateY(-50%)\";\n return true;\n }\n\n // full center (no sides specified)\n if (!flags.hasLeft && !flags.hasRight && !flags.hasTop && !flags.hasBottom) {\n container.style.top = \"50%\";\n container.style.left = \"50%\";\n container.style.transform = \"translate(-50%, -50%)\";\n return true;\n }\n\n return false;\n}\n\n/**\n * Apply standard positioning (corners and edges)\n * @param {HTMLElement} container\n * @param {Object} flags\n */\nfunction applyStandardPositioning(container, flags) {\n if (flags.hasBottom) {\n container.style.bottom = \"10px\";\n } else if (flags.hasTop) {\n container.style.top = \"10px\";\n }\n\n if (flags.hasRight) {\n container.style.right = \"10px\";\n } else if (flags.hasLeft) {\n container.style.left = \"10px\";\n } else {\n // AUDIT FIX (M1): this branch previously set `bottom: 10px`\n // unconditionally, even when `hasTop` had already set `top: 10px`\n // above (e.g. an undocumented/malformed position string like \"top\"\n // alone). A position:fixed element with BOTH top and bottom set and no\n // explicit height gets stretched to fill the gap between them. Only\n // fall back to \"bottom\" here if no vertical anchor was chosen at all.\n if (!flags.hasBottom && !flags.hasTop) {\n container.style.bottom = \"10px\";\n }\n container.style.left = \"50%\";\n container.style.transform = \"translateX(-50%)\";\n }\n}\n","// src/utils/PausableTimer.js\n\"use strict\";\n\nexport class PausableTimer {\n constructor(callback, delay) {\n this.callback = callback;\n this.delay = delay;\n this.remaining = delay;\n this.startTime = null;\n this.timeoutId = null;\n this.isPaused = false;\n this.isCompleted = false;\n }\n\n start() {\n if (this.isCompleted || this.timeoutId) return this;\n this.startTime = Date.now();\n this.timeoutId = setTimeout(() => {\n this.isCompleted = true;\n this.timeoutId = null;\n this.callback();\n }, this.remaining);\n return this;\n }\n\n pause() {\n if (this.isPaused || !this.timeoutId || this.isCompleted) return this;\n clearTimeout(this.timeoutId);\n this.timeoutId = null;\n this.remaining -= Date.now() - this.startTime;\n this.remaining = Math.max(0, this.remaining); // prevent negative\n this.isPaused = true;\n return this;\n }\n\n resume() {\n if (!this.isPaused || this.isCompleted) return this;\n this.isPaused = false;\n this.start();\n return this;\n }\n\n clear() {\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n this.timeoutId = null;\n }\n this.isCompleted = true;\n return this;\n }\n\n getRemainingTime() {\n if (this.isCompleted) return 0;\n if (this.isPaused) return this.remaining;\n if (!this.timeoutId) return this.delay;\n return Math.max(0, this.remaining - (Date.now() - this.startTime));\n }\n}\n","// src/components/ToastManager.js\n\"use strict\";\n\nimport { createToastElement } from \"./Toast.js\";\nimport { removeElement } from \"../utils/dom.js\";\nimport { createEmergencyToast } from \"./toast-utils.js\";\nimport { getOrCreateToastContainer } from \"../utils/containerRegistry.js\";\nimport { setPosition } from \"../utils/position.js\";\nimport { PausableTimer } from \"../utils/PausableTimer.js\";\n\n// Config\nconst MAX_VISIBLE = 3;\n\n// State\nconst active = new Map(); // key -> { outer, toast, count, timeout }\nconst pending = new Map(); // key -> { options, count, rafId }\nconst queue = []; // [{ options, key, count }]\nlet visibleCount = 0;\n\n// djb2 hash function for message deduplication\nfunction hashString(str) {\n let h = 5381;\n for (let i = 0; i < str.length; i++) h = (h << 5) + h + str.charCodeAt(i);\n return h >>> 0;\n}\n\n/**\n * Creates a unique key for a toast notification based on its type, message, and position.\n * This key is used to identify and deduplicate identical toast notifications.\n * @param {Object} options - Toast options with type, message, and position.\n * @returns {string} A unique key for the toast notification.\n */\nfunction makeKey(options = {}) {\n const type = String(options.type).trim().toLowerCase();\n const messageHash = hashString(String(options.message || \"\")).toString(16);\n const position = String(options.position).trim().toLowerCase();\n\n return `${type}|${messageHash}|${position}`;\n}\n\n/**\n * Shows a toast notification with the given options.\n * If there is already an active toast with the same type, message, and position,\n * it will be grouped immediately and the count will be incremented.\n * If there is already a pending toast with the same type, message, and position,\n * it will be coalesced and the count will be incremented.\n * If there is no capacity left (i.e. the number of visible toasts is at the maximum),\n * the grouped request will be enqueued and processed later.\n * @param {Object} options - Toast options with type, message, and position.\n * @returns {Promise<void>} A promise that resolves when the toast is fully created and displayed.\n */\nexport async function showToast(options = {}) {\n try {\n const key = makeKey(options);\n\n // If already active: group immediately\n if (active.has(key)) {\n const data = active.get(key);\n if (!data) throw new Error(`Active toast with key ${key} not found`);\n data.count++;\n\n // Reset timer with new duration\n data.timer.clear();\n data.timer = createDismissTimer(data.toast, options);\n await setupPauseOnHover(data);\n await updateBadge(data);\n return;\n }\n\n // If coalescing is already scheduled for this key, just increment the pending count\n if (pending.has(key)) {\n const current = pending.get(key);\n if (!current) throw new Error(`Pending toast with key ${key} not found`);\n current.count++;\n return;\n }\n\n // Start coalescing identical calls in the same frame\n const entry = { options, count: 1, rafId: 0 };\n pending.set(key, entry);\n\n entry.rafId = requestAnimationFrame(async () => {\n // finalize batch for this key\n const current = pending.get(key);\n if (!current) return;\n pending.delete(key);\n\n // If capacity full, enqueue the grouped request\n if (visibleCount >= MAX_VISIBLE) {\n queue.push({ options: current.options, key, count: current.count });\n await drainQueue();\n return;\n }\n\n // Otherwise create immediately with the grouped count\n try {\n await createOne(current.options, key, current.count);\n } catch (error) {\n console.error(\"showToast failed:\", error);\n }\n });\n } catch (error) {\n console.error(\"showToast failed:\", error);\n }\n}\n\n/**\n * Creates a single toast notification with the given options and initial count.\n * Will create and mount the toast element, and setup a timer to auto-dismiss.\n * If the toast creation fails, it will fallback to an emergency toast.\n * @param {Object} options - Toast options with type, message, and position.\n * @param {string} key - Unique key for the toast.\n * @param {number} initialCount - Initial count for the toast.\n * @returns {Promise<void>} A promise that resolves when the toast is fully created and displayed.\n */\nasync function createOne(options, key, initialCount) {\n try {\n if (!options || typeof options !== \"object\") {\n throw new TypeError(\"options must be an object\");\n }\n\n visibleCount++;\n\n const container = await getOrCreateToastContainer(options, setPosition);\n if (!container) {\n throw new Error(\"Failed to create toast container\");\n }\n\n // Build the toast element\n const toast = await createToastElement(options, closeToast);\n if (!toast) {\n throw new Error(\"Toast element creation failed\");\n }\n\n // Outer wrapper (badge surface; visible overflow)\n const outer = document.createElement(\"div\");\n Object.assign(outer.style, {\n position: \"relative\",\n display: \"inline-block\",\n overflow: \"visible\",\n marginBottom: \"10px\",\n zIndex: \"0\",\n width: \"100%\",\n });\n\n // Inner wrapper (clip progress bar & rounded corners)\n const inner = document.createElement(\"div\");\n Object.assign(inner.style, {\n position: \"relative\",\n overflow: \"hidden\",\n // borderRadius: options.borderRadius || \"8px\",\n zIndex: \"1\",\n });\n\n inner.appendChild(toast);\n outer.appendChild(inner);\n\n // Mount\n if (container.id.includes(\"toast-container-\")) {\n container.appendChild(outer);\n }\n\n // Determine if should pause on hover (default: true if has CTA)\n const shouldPauseOnHover =\n options.pauseOnHover !== false &&\n (options.pauseOnHover === true || !!options.cta);\n\n // Track\n const data = {\n outer,\n toast,\n count: Math.max(1, Math.floor(initialCount ?? 0)),\n timeout: null,\n pauseOnHover: shouldPauseOnHover,\n };\n active.set(key, data);\n toast._key = key;\n\n if (data.count > 1) await updateBadge(data);\n\n // Create and start timer\n data.timer = createDismissTimer(toast, options);\n await setupPauseOnHover(data);\n } catch (err) {\n console.error(\"Something went wrong: \", err);\n visibleCount = Math.max(0, visibleCount - 1);\n const el =\n document.querySelector('[id^=\"toast-container-\"]') || document.body;\n el.appendChild(await createEmergencyToast(options, closeToast));\n }\n}\n\n/**\n * Dismiss (close) the most recently shown toast.\n * - Finds the most recently appended toast element across containers.\n * - Calls closeToast on it (which handles timers, cleanup, and queue drain).\n * - Returns a Promise that resolves when the close completes.\n */\nexport async function dismissMostRecent() {\n try {\n // If no active toasts, nothing to dismiss\n if (active.size === 0) return;\n\n // Strategy: find the last inserted element in DOM among all containers.\n // Iterate containers and pick lastElementChild of container that is a toast wrapper.\n let lastToastEl = null;\n\n const containers = document.querySelectorAll('[id^=\"toast-container-\"]');\n containers.forEach((container) => {\n const children = Array.from(container.children || []);\n if (children.length === 0) return;\n // AUDIT FIX (L3): toasts are always appended (never prepended), so\n // the LAST child in DOM order is the most recently created one.\n // children.at(0) — the previous behavior — was actually the OLDEST\n // visible toast, the opposite of what \"dismissMostRecent\" promises.\n const candidate = children.at(-1);\n if (candidate) {\n lastToastEl = candidate.querySelector('[id^=\"toast-\"]') || candidate;\n }\n });\n\n if (!lastToastEl) {\n // Same fix applied to the Map-based fallback: Map preserves\n // insertion order, so the LAST entry is the most recently created\n // toast, not the first.\n const entries = Array.from(active.entries());\n if (entries.length > 0) {\n const [, data] = entries.at(-1);\n lastToastEl =\n data.toast ||\n (data.outer && data.outer.querySelector('[id^=\"toast-\"]'));\n }\n }\n\n if (!lastToastEl) return;\n\n // If the element is a wrapper, attempt to find the actual toast element with _key\n const toastEl = lastToastEl._key\n ? lastToastEl\n : lastToastEl.querySelector('[id^=\"toast-\"]') || lastToastEl;\n\n await closeToast(toastEl);\n } catch (err) {\n console.error(\"dismissMostRecent failed:\", err);\n }\n}\n\n/**\n * Close all active toasts immediately.\n * - Clears timers, runs closeToast for each active toast,\n * - Also clears the pending queue.\n */\nexport async function closeAllToasts() {\n try {\n // mark in-progress (consumers can use this flag via module if needed)\n const activeToasts = Array.from(active.values())\n .map((d) => d.toast)\n .filter(Boolean);\n // clear pending queue (so no queued toasts will appear after we remove active)\n queue.length = 0;\n pending.clear();\n\n // Close in clockwise order (oldest first)\n for (const t of activeToasts) {\n try {\n // Sequentially close to preserve animation and queue order\n await closeToast(t);\n } catch (error_inner) {\n console.warn(\"closeAllToasts: failed to close one toast:\", error_inner);\n }\n }\n } catch (err) {\n console.error(\"closeAllToasts failed:\", err);\n }\n}\n\n// Export aliases for clarity / compatibility\nexport const dismiss = dismissMostRecent;\nexport const noop = closeAllToasts;\n\n/**\n * Creates a PausableTimer that auto-closes a toast after a delay.\n * @param {HTMLElement} toast - The toast element to auto-close.\n * @param {Object} options - Toast options with duration.\n * @returns {PausableTimer} A timer that can be paused, resumed, or cleared.\n */\nfunction createDismissTimer(toast, options) {\n const delay = Number(options.duration ?? 1800) + 5;\n const timer = new PausableTimer(async () => await closeToast(toast), delay);\n timer.start();\n return timer;\n}\n\nasync function setupPauseOnHover(data) {\n if (!data.pauseOnHover || !data.outer || !data.timer) return;\n\n const { outer, timer, toast } = data;\n\n const onMouseEnter = () => {\n timer.pause();\n // AUDIT FIX (H3): the progress bar's Web Animations API animation\n // (toast._progressAnimation, set on the INNER toast element by\n // toast-utils-core.js's createProgressBar — not on `outer`, which is\n // just ToastManager's positioning wrapper div around it) previously\n // had no connection to pause-on-hover at all — it ran on its own\n // clock and kept animating to 0% even while the real PausableTimer\n // was genuinely frozen, so the bar visually lied about how much time\n // was actually left. Pausing it here, from the exact same event that\n // pauses the real timer, keeps both in sync.\n toast?._progressAnimation?.pause();\n };\n const onMouseLeave = () => {\n timer.resume();\n toast?._progressAnimation?.play();\n };\n\n const onFocusIn = (e) => {\n if (e.target.matches(\"[tabindex], div, span, button, a\")) {\n timer.pause();\n toast?._progressAnimation?.pause();\n }\n };\n\n const onFocusOut = (e) => {\n if (!outer.contains(e.relatedTarget)) {\n timer.resume();\n toast?._progressAnimation?.play();\n }\n };\n\n // Add event listeners\n outer.addEventListener(\"mouseenter\", onMouseEnter);\n outer.addEventListener(\"mouseleave\", onMouseLeave);\n outer.addEventListener(\"focusin\", onFocusIn);\n outer.addEventListener(\"focusout\", onFocusOut);\n\n // Store cleanup function\n outer._pauseCleanup = () => {\n outer.removeEventListener(\"mouseenter\", onMouseEnter);\n outer.removeEventListener(\"mouseleave\", onMouseLeave);\n outer.removeEventListener(\"focusin\", onFocusIn);\n outer.removeEventListener(\"focusout\", onFocusOut);\n };\n}\n\n/**\n * Closes a toast notification immediately.\n * If the toast is not found in the active toasts map, this function does nothing.\n * @param {HTMLElement|null} toast - The toast element to close.\n * @returns {Promise<void>} A promise that resolves when the toast is fully removed from the DOM.\n */\nexport async function closeToast(toast) {\n try {\n if (!toast?._key) return;\n const data = active.get(toast._key);\n if (!data) return;\n\n // Clear timer and cleanup pause events\n data.timer?.clear();\n data.outer?._pauseCleanup?.();\n\n active.delete(toast._key);\n visibleCount = Math.max(0, visibleCount - 1);\n\n // Remove badge if present\n const badge = data.outer.querySelector(\".toast-count-badge\");\n if (badge) badge.remove();\n\n // Remove wrapper after transition ends (or fallback)\n await removeWithTransition(data.outer);\n\n // Drain queue after a slot frees\n await drainQueue();\n } catch (error) {\n console.error(\"Closing Toast failed!: \", error);\n }\n}\n\nasync function drainQueue() {\n // Fill available slots; coalesce queued entries against active if they became active meanwhile\n while (visibleCount < MAX_VISIBLE && queue.length) {\n const item = queue.shift();\n if (active.has(item.key)) {\n const data = active.get(item.key);\n data.count += item.count;\n await updateBadge(data);\n continue;\n }\n // Create without awaiting to keep loop responsive; visibleCount is incremented inside createOne\n void createOne(item.options, item.key, item.count);\n }\n}\n\n/**\n * Safely remove an element after its transition ends, with a hard timeout fallback\n * @param {Element} el - The element to remove\n * @returns {Promise<void>} A promise that resolves after the element is removed\n */\nasync function removeWithTransition(el) {\n if (!el) return Promise.resolve();\n\n return new Promise((resolve) => {\n let done = false;\n const finish = () => {\n if (done) return;\n done = true;\n removeElement(el);\n resolve();\n };\n\n // Listen on the immediate child (inner wrapper) if possible\n const child = el.firstElementChild || el;\n if (!child) return resolve();\n\n const onEnd = (e) => {\n try {\n // Check if the event target is the same element we're listening on\n if (e.target !== child) return;\n // Remove the event listener to prevent multiple triggers\n child.removeEventListener(\"transitionend\", onEnd, true);\n finish();\n } catch (error) {\n console.error(\"removeWithTransition error:\", error);\n }\n };\n\n // Add the event listener to the child element\n try {\n child.addEventListener(\"transitionend\", onEnd, true);\n } catch (error) {\n console.error(\"removeWithTransition error:\", error);\n }\n\n // Hard fallback if no transition fires after 700ms\n setTimeout(() => {\n try {\n // Remove the event listener to prevent multiple triggers\n child.removeEventListener(\"transitionend\", onEnd, true);\n finish();\n } catch (error) {\n console.error(\"removeWithTransition error:\", error);\n }\n }, 700);\n });\n}\n\n/**\n * Updates the badge count on the outer toast wrapper.\n * @param {Object} options Options object containing the outer toast wrapper and the count.\n * @param {HTMLElement} options.outer The outer toast wrapper element.\n * @param {number} options.count The count of identical notifications.\n */\nasync function updateBadge({ outer, count }) {\n if (!outer || !(outer instanceof HTMLElement)) {\n throw new Error(\"updateBadge: outer must be a valid HTMLElement\");\n }\n\n if (count < 2) {\n // Remove the badge if the count is less than 2\n const badge = outer.querySelector(\".toast-count-badge\");\n if (badge) badge.remove();\n return;\n }\n\n let badge = outer.querySelector(\".toast-count-badge\");\n if (!badge) {\n // Create the badge if it doesn't exist\n badge = document.createElement(\"span\");\n badge.className = \"toast-count-badge\";\n badge.setAttribute(\"aria-label\", `${count} identical notifications`);\n\n // Style the badge\n Object.assign(badge.style, {\n position: \"absolute\",\n top: \"6px\",\n right: \"6px\",\n backgroundColor: \"#f44336\",\n color: \"#fff\",\n borderRadius: \"50%\",\n minWidth: \"20px\",\n height: \"20px\",\n fontSize: \"12px\",\n fontWeight: \"600\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n border: \"2px solid #fff\",\n boxShadow: \"0 2px 6px rgba(0,0,0,0.3)\",\n zIndex: \"2\",\n pointerEvents: \"none\",\n transition: \"transform 150ms ease\",\n });\n\n // Add the badge to the outer toast wrapper\n outer.appendChild(badge);\n }\n\n // Update the badge text content\n badge.textContent = count > 99 ? \"99+\" : String(count);\n\n // Animate the badge by scaling it up and then back down\n try {\n badge.style.transform = \"scale(1.2)\";\n setTimeout(() => (badge.style.transform = \"scale(1)\"), 150);\n } catch (error) {\n console.error(\"updateBadge animation error:\", error);\n }\n}\n","// src/components/Toast.js //# Single responsibility\n\"use strict\";\n\nimport { createElementWithId } from \"../utils/dom.js\";\nimport { applyRichStyling, createEmergencyToast } from \"./toast-utils.js\";\n\n/**\n * Creates a multi-layer toast element with satellite-grade fallbacks\n * @param {Object} options - Toast configuration options\n * @param {Function} onClose - Callback when toast closes\n * @returns {HTMLElement} Toast element\n */\nexport async function createToastElement(options, onClose) {\n const toastContainerSelector = '[id^=\"toast-container-\"]';\n const toastContainer = document.querySelector(toastContainerSelector);\n if (!toastContainer) return null;\n\n let toast;\n const tagName = \"div\";\n const prefix = \"toast\";\n\n // PRIMARY: Full-featured toast\n try {\n toast = await createElementWithId(tagName, prefix);\n await applyRichStyling(toast, options, onClose);\n return toast;\n } catch (error) {\n console.warn(\n \"toast creation failed with error showing fallback one: \",\n error\n );\n // Fallback: create emergency toast\n toast = await createEmergencyToast(options, onClose);\n return toast;\n }\n}\n","// src/index.js\n\"use strict\";\n\nimport { showToast } from \"./components/ToastManager.js\";\nimport { getOrCreateToastContainer } from \"./utils/containerRegistry.js\";\nimport { getDynamicAccessibleTextColorHex } from \"./utils/dom.js\";\nimport { setPosition } from \"./utils/position.js\";\n\n// Protected default colors with fallbacks\nlet defaultColors = {\n success: \"#28a745\",\n error: \"#dc3545\",\n warning: \"#ffc107\",\n info: \"#17a2b8\",\n};\n\nlet defaultMessages = {\n success: \"Operation completed successfully!\",\n error: \"Something went wrong!\",\n warning: \"Warning message!\",\n info: \"Information message!\",\n};\n\n/**\n * Create toast with satellite-grade reliability\n */\n// Toast queue for calls before DOM ready\nconst pendingToasts = [];\n\n// Flag to indicate DOM ready for toast execution\nlet domReady = false;\n\n/**\n * Checks if DOM is ready and flushes pending toasts after a delay\n */\nasync function checkDOMReady() {\n if (domReady) return;\n\n if (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n if (\n document.readyState === \"complete\" ||\n document.readyState === \"interactive\"\n ) {\n domReady = true;\n // Flush queued toasts after 2.5s delay\n pendingToasts.forEach((options) =>\n setTimeout(() => createToastNow(options), 2500)\n );\n pendingToasts.length = 0;\n } else {\n // Wait for DOMContentLoaded\n document.addEventListener(\n \"DOMContentLoaded\",\n () => {\n domReady = true;\n pendingToasts.forEach((options) =>\n setTimeout(() => createToastNow(options), 2500)\n );\n pendingToasts.length = 0;\n },\n { once: true }\n );\n }\n }\n}\n\n/**\n * Core toast creation logic\n * @param {Object} options - Toast options\n * @returns {Promise<void>} Toast creation promise\n */\nasync function createToastNow(options = {}) {\n try {\n /**\n * Sanitize toast options and fill in defaults\n * @param {Object} options - Toast options\n * @returns {Promise<Object>} Sanitized toast options promise\n */\n const sanitizedOptions = await sanitizeToastOptions(options);\n\n /**\n * Create the first toast container for pre-validate to a given position for same position toast stacking\n * @param {Object} options - Sanitized toast options\n * @returns {Promise<HTMLElement>} Toast container promise\n */\n await createFirstToastContainer(sanitizedOptions);\n\n /**\n * Show the toast notification with given options\n * @param {Object} options - Sanitized toast options\n * @returns {Promise<void>} Show toast promise\n */\n await showToast(sanitizedOptions);\n } catch (error) {\n console.error(\"CreateToast failed:\", error);\n\n const safeMessage =\n typeof options?.message === \"string\" && options?.message !== null\n ? `${options.message.substring(0, 200)} toast creation failed!`\n : \"Toast creation failed!\";\n\n alert(safeMessage);\n }\n}\n\n/**\n * Public API for creating a toast\n * @param {Object} options Toast options\n */\nasync function createToast(options = {}) {\n // Check browser environment\n const isBrowser =\n typeof window !== \"undefined\" && typeof document !== \"undefined\";\n\n if (!isBrowser) {\n console.warn(\n \"ToastNotification: running in non-browser environment, no DOM available.\"\n );\n return;\n }\n\n // Check if DOM ready\n await checkDOMReady();\n\n if (!domReady) {\n // Queue for later execution\n pendingToasts.push(options);\n return;\n }\n\n await createToastNow(options);\n}\n\n/**\n * Creates or retrieves the toast container for a given position\n * Single source of truth for containers; prevents same-id duplicates\n * @param {Object} options\n * @returns {Promise<HTMLElement>}\n */\nasync function createFirstToastContainer(options) {\n try {\n return await getOrCreateToastContainer(options, setPosition);\n } catch (error) {\n console.error(\"Failed to create toast container:\", error);\n return document.body;\n }\n}\n\n/**\n * Sanitizes and normalizes toast options.\n * Fills in defaults, validates input, and ensures colors & messages are set.\n * @param {Object} options - User-provided toast options\n * @returns {Promise<Object>} final sanitized toast options\n */\nasync function sanitizeToastOptions(options) {\n const contPosition = options?.position?.toLowerCase()?.trim();\n const contMaxWidth =\n contPosition?.includes(\"top-full-width\") ||\n contPosition?.includes(\"bottom-full-width\")\n ? \"100vw\"\n : \"400px\";\n\n const defaults = {\n allowHtml: false, // default: false for safety\n sanitizeHtml: true, // whether to sanitize (if DOMPurify present it's used)\n pauseOnHover: undefined,\n duration: 2500,\n position: \"bottom-right\",\n type: \"info\",\n borderRadius: \"50px\",\n backgroundColor: undefined,\n textColor: undefined,\n showCloseButton: true,\n animationDuration: \"0.4s\",\n animationType: \"fade\",\n animationEasing: \"ease\",\n showProgressBar: true,\n progressColor: undefined,\n progressHeight: \"4px\",\n progressPosition: \"bottom\",\n fontPosition: \"relative\",\n fontPadding: undefined,\n fontBorderRadius: undefined,\n fontBackgroundColor: undefined,\n fontFamily:\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"',\n fontSize: \"14px\",\n fontWeight: \"400\",\n fontLineHeight: \"1.4\",\n fontDirection: \"auto\",\n wrapText: \"normal\",\n maxWidth: contMaxWidth,\n };\n\n // Merge defaults with user options\n const final = {\n ...defaults,\n ...(typeof options === \"object\" && !Array.isArray(options) ? options : {}),\n };\n\n // Ensure message property separately\n final.message = options?.message ?? final.message;\n\n try {\n // Background color fallback based on type or system preference\n if (!final.backgroundColor) {\n final.backgroundColor =\n defaultColors?.[final.type] ??\n (window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n ? \"#f5f5f5\"\n : \"#111111\");\n }\n\n // Default message if not provided\n final.message =\n final.message || defaultMessages?.[final.type] || \"No Message Provided!\";\n\n // Ensure textColor is set\n if (!final.textColor && final.backgroundColor) {\n const textColorResult = getDynamicAccessibleTextColorHex(\n final.backgroundColor\n );\n final.textColor = textColorResult;\n }\n\n // Ensure progressColor is set\n if (!final.progressColor && final.backgroundColor) {\n if (final.textColor) {\n final.progressColor = final.textColor;\n } else {\n const barColorResult = getDynamicAccessibleTextColorHex(\n final.backgroundColor\n );\n final.progressColor = barColorResult;\n }\n }\n } catch (error) {\n console.warn(\"Option processing failed:\", error);\n }\n\n // Safety check for message type\n if (typeof final.message !== \"string\") {\n final.message = \"No Message Provided!\";\n }\n\n return final;\n}\n\n/**\n * Sets default colors\n * @param {Object} colors\n */\nfunction setDefaultColors(colors) {\n try {\n if (colors && typeof colors === \"object\" && !Array.isArray(colors)) {\n defaultColors = { ...defaultColors, ...colors };\n }\n } catch (error) {\n console.error(\"setDefaultColors failed:\", error);\n }\n}\n\n/**\n * Sets default messages\n * @param {Object} messages\n */\nfunction setDefaultMessages(messages) {\n try {\n if (messages && typeof messages === \"object\" && !Array.isArray(messages)) {\n defaultMessages = { ...defaultMessages, ...messages };\n }\n } catch (error) {\n console.error(\"setDefaultMessages failed:\", error);\n }\n}\n\n// import the manager functions\nimport { dismiss, noop as managerNoop } from \"./components/ToastManager.js\";\n\n// Replace any existing noop export with the manager one\n// (If file previously defined a noop here, remove/replace it.)\n\n// Close-priority lock: when true, createToast should wait until close finishes.\nlet closeInProgress = false;\nlet closePromise = null;\n\nasync function runWithClosePriority(fn) {\n // If a close is in progress, await it first\n if (closeInProgress && closePromise) {\n try {\n await closePromise;\n } catch (e) {\n // ignore errors from close\n }\n }\n return fn();\n}\n\n// Wrap createToast to respect close priority\nconst originalCreateToast = createToast;\nasync function createToastWithPriority(options = {}) {\n return runWithClosePriority(() => originalCreateToast(options));\n}\n\n// Re-export the wrapped createToast\nexport { createToastWithPriority as createToast };\n\n// Re-export the manager APIs with expected names:\nexport { setDefaultColors, setDefaultMessages };\nexport const dismissToast = async () => {\n // mark close in progress for dismiss\n closeInProgress = true;\n closePromise = (async () => {\n try {\n await dismiss();\n } finally {\n closeInProgress = false;\n closePromise = null;\n }\n })();\n await closePromise;\n};\nexport const noopAll = async () => {\n closeInProgress = true;\n closePromise = (async () => {\n try {\n await managerNoop();\n } finally {\n closeInProgress = false;\n closePromise = null;\n }\n })();\n await closePromise;\n};\n// For backward-compat, export names the user expects:\nexport { dismissToast as dismiss, noopAll as noop };\n\n// Add Esc key listener (register once)\nif (typeof window !== \"undefined\" && typeof document !== \"undefined\") {\n let escRegistered = false;\n if (!escRegistered) {\n const onKeyDown = (e) => {\n if (e.key === \"Escape\" || e.key === \"Esc\") {\n // Prevent default behavior and dismiss the most recent toast.\n // e.preventDefault();\n // Fire-and-forget, but ensure close priority is set\n (async () => {\n closeInProgress = true;\n closePromise = (async () => {\n try {\n await dismiss();\n } finally {\n closeInProgress = false;\n closePromise = null;\n }\n })();\n await closePromise;\n })();\n }\n };\n window.addEventListener(\"keydown\", onKeyDown, { passive: true });\n escRegistered = true;\n }\n}\n\n// Module exports\n// export { createToast, setDefaultColors, setDefaultMessages, noop };\n\n// Global assignment with protection\ntry {\n // UMD/Global support\n if (typeof window !== \"undefined\") {\n // AUDIT FIX (H5): this object previously used the RAW, unwrapped\n // `createToast`/`dismiss`/`noop` locals — meaning window.customizableToast\n // (the exact global your README's CDN usage example is built around)\n // lacked the closeInProgress/closePromise race-condition serialization\n // that ESM consumers get for free via the named exports. Now both\n // consumption paths behave identically.\n window.customizableToast = {\n createToast: createToastWithPriority,\n setDefaultColors,\n setDefaultMessages,\n noop: noopAll,\n dismiss: dismissToast,\n };\n }\n} catch (error) {\n console.error(\"Global assignment failed:\", error);\n}\n"],"names":["async","createElementWithId","tagName","prefix","el","document","createElement","id","Date","now","toString","Math","floor","random","generateToastId","colorCache","constructor","maxSize","this","map","Map","get","key","has","value","delete","set","size","firstKey","keys","next","precomputedNamedTextColors","getDynamicAccessibleTextColorHex","toastBg","opa","cached","toLowerCase","textColor","r","g","b","parsed","hexMatch","match","hex","length","split","c","join","parseInt","slice","rgbMatch","Number","hslMatch","h","s","l","gray","round","hue2rgb","p","q","t","parseToRgb","_varMatch$","varMatch","getComputedStyle","resolved","documentElement","getPropertyValue","trim","e","resolveCssCustomProperty","Error","luminance","a","v","pow","contrastRatio","rgb1","rgb2","L1","L2","max","min","rgbToHsl","d","textL","tr","tg","tb","hslToRgb","contrastBlack","contrastWhite","result","rgbToHex","padStart","Object","entries","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","forEach","name","lum","L","ALLOWED_TAGS","Set","ALLOWED_ATTRS","fallbackSanitize","dirty","step1","replace","container","sanitizeNode","node","nodeType","Node","TEXT_NODE","createTextNode","nodeValue","ELEMENT_NODE","tag","toUpperCase","frag","createDocumentFragment","Array","from","childNodes","child","sanitized","appendChild","attributes","attr","val","test","setAttribute","getAttribute","sanitizedChild","innerHTML","outFrag","wrapper","sanitizeHtml","opts","forceFallback","window","DOMPurify","hasDOMPurify","cleaned","sanitize","ALLOWED_ATTR","ALLOWED_URI_REGEXP","querySelectorAll","rel","filter","Boolean","includes","push","err","applyRichStyling","toast","options","onClose","durationMs","duration","endsWith","parseFloat","parseAnimationDuration","animationDuration","className","type","assign","style","background","backgroundColor","padding","marginBottom","borderRadius","overflow","display","alignItems","justifyContent","boxShadow","minWidth","maxWidth","opacity","position","cursor","boxSizing","userSelect","transition","animationEasing","transform","zIndex","tabIndex","_animationDuration","messageSpan","wrapText","whiteSpace","WebkitBoxOrient","WebkitLineClamp","flex","fontPadding","fontFamily","fontSize","fontWeight","lineHeight","fontLineHeight","color","wordBreak","textOverflow","allowHtml","rawMessage","message","loader","showLoader","loaderEl","labelText","text","gap","svgNS","svg","createElementNS","String","circle","strokeDasharray","strokeDashoffset","transformOrigin","animation","lbl","textContent","getElementById","st","head","createLoader","spacer","width","tmp","firstChild","cta","cfg","label","isLink","href","variant","target","ariaLabel","marginLeft","border","flexShrink","onClick","res","then","autoClose","addEventListener","_cleanup","removeEventListener","createCTA","showCloseButton","closeBtn","_cleanupCloseButton","createCloseButton","showProgressBar","progressBar","borderRadiusStr","borderRadiusNum","leftVal","minSafeOffset","radiusOffset","finalWidth","left","height","progressHeight","progressColor","progressPosition","animate","_progressAnimation","easing","fill","delay","setTimeout","offsetWidth","createProgressBar","requestAnimationFrame","runToastAnimation","createEmergencyToast","emergency","top","right","wordWrap","innerWrapper","msgEl","closeSpan","cssText","removeChild","onclick","remove","body","error","alert","containerRegistry","containerLocks","getContainerId","normalizePositionKey","getOrCreateToastContainer","setPosition","isConnected","inset","flexDirection","all","i","bottom","resetContainerStyles","positionFlags","pos","hasTop","hasBottom","hasLeft","hasRight","hasCenter","hasFullWidth","parsePosition","flags","handleFullWidthPositions","handleCenterPositions","applyStandardPositioning","PausableTimer","callback","remaining","startTime","timeoutId","isPaused","isCompleted","start","pause","clearTimeout","resume","clear","getRemainingTime","active","pending","queue","visibleCount","showToast","str","charCodeAt","hashString","makeKey","data","count","timer","createDismissTimer","setupPauseOnHover","updateBadge","current","entry","rafId","drainQueue","createOne","initialCount","TypeError","querySelector","createToastElement","closeToast","outer","inner","shouldPauseOnHover","pauseOnHover","timeout","_key","dismiss","lastToastEl","children","candidate","at","toastEl","noop","activeToasts","values","error_inner","onMouseEnter","_toast$_progressAnima","onMouseLeave","_toast$_progressAnima2","play","onFocusIn","_toast$_progressAnima3","matches","onFocusOut","_toast$_progressAnima4","contains","relatedTarget","_pauseCleanup","_data$timer","_data$outer","_data$outer$_pauseCle","call","badge","Promise","resolve","done","finish","_el$parentNode","parentNode","pointerEvents","removeElement","firstElementChild","onEnd","removeWithTransition","item","shift","HTMLElement","defaultColors","success","warning","info","defaultMessages","pendingToasts","domReady","createToastNow","sanitizedOptions","_options$position","contPosition","contMaxWidth","final","undefined","animationType","fontPosition","fontBorderRadius","fontBackgroundColor","fontDirection","isArray","_defaultMessages","_defaultColors","matchMedia","textColorResult","barColorResult","sanitizeToastOptions","createFirstToastContainer","safeMessage","substring","setDefaultColors","colors","setDefaultMessages","messages","closeInProgress","closePromise","originalCreateToast","readyState","once","checkDOMReady","createToastWithPriority","fn","runWithClosePriority","dismissToast","noopAll","managerNoop","escRegistered","onKeyDown","passive","customizableToast","createToast"],"mappings":";;;;;;;;;;;;;;aAIOA,eAAeC,EAAoBC,EAASC,GAEjD,MAAMC,EAAKC,SAASC,cAAcJ,GAElC,OADAE,EAAGG,GCCE,SAAyBJ,GAG9B,MAAO,GAAGA,KAFQK,KAAKC,MAAMC,SAAS,OACvBC,KAAKC,MAAsB,QAAhBD,KAAKE,UAAoBH,SAAS,KAE9D,CDLUI,CAAgBX,GACjBC,CACT,CA+GA,MAAMW,EAAa,IAxBnB,MACEC,WAAAA,CAAYC,EAAU,KACpBC,KAAKD,QAAUA,EACfC,KAAKC,IAAM,IAAIC,GACjB,CAEAC,GAAAA,CAAIC,GACF,IAAKJ,KAAKC,IAAII,IAAID,GAAM,OACxB,MAAME,EAAQN,KAAKC,IAAIE,IAAIC,GAG3B,OAFAJ,KAAKC,IAAIM,OAAOH,GAChBJ,KAAKC,IAAIO,IAAIJ,EAAKE,GACXA,CACT,CAEAE,GAAAA,C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