customizable-toast-notification 3.11.2 → 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.
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * Customizable Toast Notifications 3.11.1
3
- * Build: 2026-08-12 21:55:37
4
- * Cache-Buster: 1786571737019
2
+ * Customizable Toast Notifications 3.11.2
3
+ * Build: 2026-08-12 23:02:31
4
+ * Cache-Buster: 1786575751652
5
5
  * Author: Priyanshu Patel
6
6
  * Email: priyanshu.alt191@gmail.com
7
7
  * License: Apache-2.0
@@ -12,5 +12,5 @@
12
12
  * Supports flexible positioning, theming, icons, animations, and timing options
13
13
  * out of the box — with CTA support and zero dependencies.
14
14
  */
15
- function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function e(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function o(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?n(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function r(e,n){return function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=i.call(n)).done)&&(s.push(o.value),s.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(e,n)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?t(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}async function i(t,e){const n=document.createElement(t);return n.id=function(t){const e=Date.now().toString(36),n=Math.floor(1048575*Math.random()).toString(36);return"".concat(t,"-").concat(e,"-").concat(n)}(e),n}const a=new class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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),s={};function l(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!t)return"snow";const n="".concat(t,"|").concat(e),o=a.get(n);if(o)return o;if(s[null==t?void 0:t.toLowerCase()]){const e=s[t.toLowerCase()];return a.set(n,e),e}let i,l,c;try{const e=null==t?void 0:t.match(/^#([0-9a-f]{3,8})$/i);if(e){let t=e[1];3===t.length&&(t=t.split("").map(t=>t+t).join("")),i=parseInt(t.slice(0,2),16),l=parseInt(t.slice(2,4),16),c=parseInt(t.slice(4,6),16)}else{const e=null==t?void 0:t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/i);if(!e)throw new Error("Unknown color");i=Number(e[1]),l=Number(e[2]),c=Number(e[3])}}catch(t){i=50+Math.floor(206*Math.random()),l=50+Math.floor(206*Math.random()),c=50+Math.floor(206*Math.random())}i=Math.round(i*e+255*(1-e)),l=Math.round(l*e+255*(1-e)),c=Math.round(c*e+255*(1-e));const u=(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]},d=(t,e)=>{const n=u(...t),o=u(...e);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)};let m=((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]})(i,l,c),f=r(m,3),p=f[0],h=f[1],y=f[2];let 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)]})(p,h,y<.5?Math.min(y+.5,1):Math.max(y-.5,0)),b=r(g,3),w=b[0],v=b[1],x=b[2];if(d([i,l,c],[w,v,x])<4.5){var C=r(d([i,l,c],[0,0,0])>=d([i,l,c],[255,255,255])?[0,0,0]:[255,255,255],3);w=C[0],v=C[1],x=C[2]}const k=((t,e,n)=>"#".concat(t.toString(16).padStart(2,"0")).concat(e.toString(16).padStart(2,"0")).concat(n.toString(16).padStart(2,"0")))(w,v,x);return a.set(n,k),k}function c(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");n.innerHTML=e;const o=new Set(["DIV","SPAN","P","BR","STRONG","B","EM","I","U","SMALL","UL","OL","LI","A","IMG","PRE","CODE","MARK"]),r=new Set(["href","src","alt","title","class","target","rel"]);function i(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(!o.has(e)){const e=document.createDocumentFragment();return Array.from(t.childNodes).forEach(t=>{const n=i(t);n&&e.appendChild(n)}),e}const n=document.createElement(t.tagName);return Array.from(t.attributes||[]).forEach(e=>{const o=e.name.toLowerCase(),i=e.value;r.has(o)&&("href"!==o&&"src"!==o||!/^\s*javascript:/i.test(i))&&("src"!==o||/^\s*(https?:|data:image\/)/i.test(i))&&("target"===o&&"_blank"===i&&n.setAttribute("rel",(t.getAttribute("rel")||"")+" noopener noreferrer"),n.setAttribute(o,i))}),Array.from(t.childNodes).forEach(t=>{const e=i(t);e&&n.appendChild(e)}),n}const a=document.createDocumentFragment();Array.from(n.childNodes).forEach(t=>{const e=i(t);e&&a.appendChild(e)});const s=document.createElement("div");return s.appendChild(a),s.innerHTML}function u(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return"";try{if(!e.forceFallback&&function(){try{if("undefined"!=typeof window&&window.DOMPurify)return!0}catch(t){}return!1}())return window.DOMPurify.sanitize(t,{ADD_ATTR:["target"],ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto|ftp|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i})}catch(t){}return c(t)}async function d(t,e,n){var o,r;const i=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-".concat(null!==(o=null==e?void 0:e.type)&&void 0!==o?o:"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 ".concat(null==e?void 0:e.animationDuration," ").concat(null==e?void 0:e.animationEasing,", transform ").concat(null==e?void 0:e.animationDuration," ").concat(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=i;const a=document.createElement("span");null!=e&&e.wrapText?Object.assign(a.style,{display:"block",whiteSpace:"normal"}):Object.assign(a.style,{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",whiteSpace:"nowrap"}),Object.assign(a.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 s=!!e.allowHtml,l=null!==(r=e.message)&&void 0!==r?r:"";if(e.loader||e.showLoader){const t=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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||{});a.appendChild(t);const n=document.createElement("span");n.style.display="inline-block",n.style.width="8px",a.appendChild(n)}if(s&&"string"==typeof l&&l.trim().length>0)try{const t=u(l),e=document.createElement("div");for(e.innerHTML=t;e.firstChild;)a.appendChild(e.firstChild)}catch(t){a.textContent=l}else a.textContent=String(l);a.setAttribute("aria-label","Toast Notification Center"),a.setAttribute("title","string"==typeof l?l.replace(/<[^>]+>/g,""):String(l)),t.appendChild(a),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% - ".concat(s,"px)"):"100%";Object.assign(n.style,{position:"absolute",left:"".concat(i),height:e.progressHeight||"4px",background:e.progressColor||"rgba(255, 255, 255, 0.3)",width:"".concat(l),transition:"width ".concat(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 ".concat(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 m(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=u(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}}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=>{let e=r(t,2),n=e[0],o=r(e[1],3),i=o[0],a=o[1],l=o[2];const c=t=>{const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},u=.2126*c(i)+.7152*c(a)+.0722*c(l),d=(u+.05)/.05,m=1.05/(u+.05);s[n.toLowerCase()]=d>=m?"#000000":"#ffffff"});const f=new Map,p=new Map;function h(t){return"toast-container-".concat(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 y(t,e){const n=h(t.position);if(p.has(n))return p.get(n);const o=(async()=>{const o=f.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("#".concat(n));if(i.length>1)for(let t=1;t<i.length;t++)try{i[t].remove()}catch(t){}return f.set(n,r),r})();p.set(n,o);try{return await o}finally{p.delete(h(t.position))}}async function g(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 b{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 w=new Map,v=new Map,x=[];let C=0;async function k(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const e=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=String(t.type).trim().toLowerCase(),n=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),o=String(t.position).trim().toLowerCase();return"".concat(e,"|").concat(n,"|").concat(o)}(t);if(w.has(e)){const n=w.get(e);if(!n)throw new Error("Active toast with key ".concat(e," not found"));return n.count++,n.timer.clear(),n.timer=T(n.toast,t),await L(n),void await j(n)}if(v.has(e)){const t=v.get(e);if(!t)throw new Error("Pending toast with key ".concat(e," not found"));return void t.count++}const n={options:t,count:1,rafId:0};v.set(e,n),n.rafId=requestAnimationFrame(async()=>{const t=v.get(e);if(t){if(v.delete(e),C>=3)return x.push({options:t.options,key:e,count:t.count}),void await O();try{await E(t.options,e,t.count)}catch(t){}}})}catch(t){}}async function E(t,e,n){try{if(!t||"object"!=typeof t)throw new TypeError("options must be an object");C++;const o=await y(t,g);if(!o)throw new Error("Failed to create toast container");const r=await async function(t,e){if(!document.querySelector('[id^="toast-container-"]'))return null;let n;try{return n=await i("div","toast"),await d(n,t,e),n}catch(o){return n=await m(t,e),n}}(t,M);if(!r)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(r),a.appendChild(s),o.id.includes("toast-container-")&&o.appendChild(a);const l=!1!==t.pauseOnHover&&(!0===t.pauseOnHover||!!t.cta),c={outer:a,toast:r,count:Math.max(1,Math.floor(null!=n?n:0)),timeout:null,pauseOnHover:l};w.set(e,c),r._key=e,c.count>1&&await j(c),c.timer=T(r,t),await L(c)}catch(e){C=Math.max(0,C-1);(document.querySelector('[id^="toast-container-"]')||document.body).appendChild(await m(t,M))}}const S=async function(){try{if(0===w.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(w.entries());if(e.length>0){const n=e.at(-1),o=r(n,2)[1];t=o.toast||o.outer&&o.outer.querySelector('[id^="toast-"]')}}if(!t)return;const e=t._key?t:t.querySelector('[id^="toast-"]')||t;await M(e)}catch(t){}},A=async function(){try{const t=Array.from(w.values()).map(t=>t.toast).filter(Boolean);x.length=0,v.clear();for(const e of t)try{await M(e)}catch(t){}}catch(t){}};function T(t,e){var n;const o=Number(null!==(n=e.duration)&&void 0!==n?n:1800)+5,r=new b(async()=>await M(t),o);return r.start(),r}async function L(t){if(!t.pauseOnHover||!t.outer||!t.timer)return;const e=t.outer,n=t.timer,o=t.toast,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 M(t){try{var e,n,o;if(null==t||!t._key)return;const r=w.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),w.delete(t._key),C=Math.max(0,C-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(t){}try{if(t.remove)return t.remove(),!0}catch(t){}try{return Object.assign(t.style,{display:"none",opacity:"0",pointerEvents:"none",position:"absolute",left:"-9999px"}),!0}catch(t){}}(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 O()}catch(t){}}async function O(){for(;C<3&&x.length;){const t=x.shift();if(w.has(t.key)){const e=w.get(t.key);e.count+=t.count,await j(e);continue}E(t.options,t.key,t.count)}}async function j(t){let e=t.outer,n=t.count;if(!(e&&e instanceof HTMLElement))throw new Error("updateBadge: outer must be a valid HTMLElement");if(n<2){const t=e.querySelector(".toast-count-badge");return void(t&&t.remove())}let o=e.querySelector(".toast-count-badge");o||(o=document.createElement("span"),o.className="toast-count-badge",o.setAttribute("aria-label","".concat(n," identical notifications")),Object.assign(o.style,{position:"absolute",top:"6px",right:"6px",backgroundColor:"#f44336",color:"#fff",borderRadius:"50%",minWidth:"20px",height:"20px",fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center",border:"2px solid #fff",boxShadow:"0 2px 6px rgba(0,0,0,0.3)",zIndex:"2",pointerEvents:"none",transition:"transform 150ms ease"}),e.appendChild(o)),o.textContent=n>99?"99+":String(n);try{o.style.transform="scale(1.2)",setTimeout(()=>o.style.transform="scale(1)",150)}catch(t){}}let I={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"},P={success:"Operation completed successfully!",error:"Something went wrong!",warning:"Warning message!",info:"Information message!"};const D=[];let z=!1;async function N(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const e=await async function(t){var e,n;const r=null==t||null===(e=t.position)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim(),i=null!=r&&r.includes("top-full-width")||null!=r&&r.includes("bottom-full-width")?"100vw":"400px",a=o(o({},{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:i}),"object"!=typeof t||Array.isArray(t)?{}:t);a.message=null!==(n=null==t?void 0:t.message)&&void 0!==n?n:a.message;try{var s,c,u;if(!a.backgroundColor)a.backgroundColor=null!==(c=null===(u=I)||void 0===u?void 0:u[a.type])&&void 0!==c?c:window.matchMedia("(prefers-color-scheme: dark)").matches?"#f5f5f5":"#111111";if(a.message=a.message||(null===(s=P)||void 0===s?void 0:s[a.type])||"No Message Provided!",!a.textColor&&a.backgroundColor){const t=l(a.backgroundColor);a.textColor=t}if(!a.progressColor&&a.backgroundColor)if(a.textColor)a.progressColor=a.textColor;else{const t=l(a.backgroundColor);a.progressColor=t}}catch(t){}"string"!=typeof a.message&&(a.message="No Message Provided!");return a}(t);await async function(t){try{return await y(t,g)}catch(t){return document.body}}(e),await k(e)}catch(e){const n="string"==typeof(null==t?void 0:t.message)&&null!==(null==t?void 0:t.message)?"".concat(t.message.substring(0,200)," toast creation failed!"):"Toast creation failed!";alert(n)}}function B(t){try{t&&"object"==typeof t&&!Array.isArray(t)&&(I=o(o({},I),t))}catch(t){}}function R(t){try{t&&"object"==typeof t&&!Array.isArray(t)&&(P=o(o({},P),t))}catch(t){}}let H=!1,W=null;const _=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"undefined"!=typeof window&&"undefined"!=typeof document&&(await async function(){z||"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"interactive"===document.readyState?(z=!0,D.forEach(t=>setTimeout(()=>N(t),2500)),D.length=0):document.addEventListener("DOMContentLoaded",()=>{z=!0,D.forEach(t=>setTimeout(()=>N(t),2500)),D.length=0},{once:!0}))}(),z?await N(t):D.push(t))};async function q(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async function(t){if(H&&W)try{await W}catch(t){}return t()}(()=>_(t))}const F=async()=>{H=!0,W=(async()=>{try{await S()}finally{H=!1,W=null}})(),await W},U=async()=>{H=!0,W=(async()=>{try{await A()}finally{H=!1,W=null}})(),await W};if("undefined"!=typeof window&&"undefined"!=typeof document){let t=!1;if(!t){const e=t=>{"Escape"!==t.key&&"Esc"!==t.key||(async()=>{H=!0,W=(async()=>{try{await S()}finally{H=!1,W=null}})(),await W})()};window.addEventListener("keydown",e,{passive:!0}),t=!0}}try{"undefined"!=typeof window&&(window.customizableToast={createToast:q,setDefaultColors:B,setDefaultMessages:R,noop:U,dismiss:F})}catch(t){}export{q as createToast,F as dismiss,F as dismissToast,U as noop,U as noopAll,B as setDefaultColors,R as setDefaultMessages};
15
+ function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function e(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function o(t){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?n(Object(r),!0).forEach(function(n){e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function r(e,n){return function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(o=i.call(n)).done)&&(s.push(o.value),s.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(e,n)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?t(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}async function i(t,e){const n=document.createElement(t);return n.id=function(t){const e=Date.now().toString(36),n=Math.floor(1048575*Math.random()).toString(36);return"".concat(t,"-").concat(e,"-").concat(n)}(e),n}const a=new class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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),s={};function l(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!t)return"snow";const n="".concat(t,"|").concat(e),o=a.get(n);if(o)return o;if(s[null==t?void 0:t.toLowerCase()]){const e=s[t.toLowerCase()];return a.set(n,e),e}let i,l,c;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");i=e.r,l=e.g,c=e.b}catch(t){i=l=c=128}i=Math.round(i*e+255*(1-e)),l=Math.round(l*e+255*(1-e)),c=Math.round(c*e+255*(1-e));const u=(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]},d=(t,e)=>{const n=u(...t),o=u(...e);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)};let m=((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]})(i,l,c),f=r(m,3),p=f[0],h=f[1],y=f[2];let 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)]})(p,h,y<.5?Math.min(y+.5,1):Math.max(y-.5,0)),b=r(g,3),w=b[0],v=b[1],x=b[2];if(d([i,l,c],[w,v,x])<4.5){var C=r(d([i,l,c],[0,0,0])>=d([i,l,c],[255,255,255])?[0,0,0]:[255,255,255],3);w=C[0],v=C[1],x=C[2]}const k=((t,e,n)=>"#".concat(t.toString(16).padStart(2,"0")).concat(e.toString(16).padStart(2,"0")).concat(n.toString(16).padStart(2,"0")))(w,v,x);return a.set(n,k),k}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=>{let e=r(t,2),n=e[0],o=r(e[1],3),i=o[0],a=o[1],l=o[2];const c=t=>{const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},u=.2126*c(i)+.7152*c(a)+.0722*c(l),d=(u+.05)/.05,m=1.05/(u+.05);s[n.toLowerCase()]=d>=m?"#000000":"#ffffff"});const c=new Set(["DIV","SPAN","P","BR","STRONG","B","EM","I","U","SMALL","UL","OL","LI","A","IMG","PRE","CODE","MARK"]),u=new Set(["href","src","alt","title","class","target","rel"]);function d(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(!c.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;u.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 r=document.createDocumentFragment();Array.from(n.childNodes).forEach(t=>{const e=o(t);e&&r.appendChild(e)});const i=document.createElement("div");return i.appendChild(r),i.innerHTML}function m(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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(c),ALLOWED_ATTR:Array.from(u),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 d(t)}async function f(t,e,n){var o,r;const i=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-".concat(null!==(o=null==e?void 0:e.type)&&void 0!==o?o:"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 ".concat(null==e?void 0:e.animationDuration," ").concat(null==e?void 0:e.animationEasing,", transform ").concat(null==e?void 0:e.animationDuration," ").concat(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=i;const a=document.createElement("span");null!=e&&e.wrapText?Object.assign(a.style,{display:"block",whiteSpace:"normal"}):Object.assign(a.style,{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3",whiteSpace:"nowrap"}),Object.assign(a.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 s=!!e.allowHtml,l=null!==(r=e.message)&&void 0!==r?r:"";if(e.loader||e.showLoader){const t=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};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||{});a.appendChild(t);const n=document.createElement("span");n.style.display="inline-block",n.style.width="8px",a.appendChild(n)}if(s&&"string"==typeof l&&l.trim().length>0)try{const t=m(l),e=document.createElement("div");for(e.innerHTML=t;e.firstChild;)a.appendChild(e.firstChild)}catch(t){a.textContent=l}else a.textContent=String(l);a.setAttribute("aria-label","Toast Notification Center"),a.setAttribute("title","string"==typeof l?l.replace(/<[^>]+>/g,""):String(l)),t.appendChild(a),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% - ".concat(s,"px)"):"100%";Object.assign(n.style,{position:"absolute",left:"".concat(i),height:e.progressHeight||"4px",background:e.progressColor||"rgba(255, 255, 255, 0.3)",width:"".concat(l),transition:"width ".concat(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 ".concat(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 p(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=m(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 h=new Map,y=new Map;function g(t){return"toast-container-".concat(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 b(t,e){const n=g(t.position);if(y.has(n))return y.get(n);const o=(async()=>{const o=h.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("#".concat(n));if(i.length>1)for(let t=1;t<i.length;t++)try{i[t].remove()}catch(t){}return h.set(n,r),r})();y.set(n,o);try{return await o}finally{y.delete(g(t.position))}}async function w(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 v{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 x=new Map,C=new Map,k=[];let E=0;async function S(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const e=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=String(t.type).trim().toLowerCase(),n=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),o=String(t.position).trim().toLowerCase();return"".concat(e,"|").concat(n,"|").concat(o)}(t);if(x.has(e)){const n=x.get(e);if(!n)throw new Error("Active toast with key ".concat(e," not found"));return n.count++,n.timer.clear(),n.timer=M(n.toast,t),await O(n),void await P(n)}if(C.has(e)){const t=C.get(e);if(!t)throw new Error("Pending toast with key ".concat(e," not found"));return void t.count++}const n={options:t,count:1,rafId:0};C.set(e,n),n.rafId=requestAnimationFrame(async()=>{const t=C.get(e);if(t){if(C.delete(e),E>=3)return k.push({options:t.options,key:e,count:t.count}),void await I();try{await A(t.options,e,t.count)}catch(t){}}})}catch(t){}}async function A(t,e,n){try{if(!t||"object"!=typeof t)throw new TypeError("options must be an object");E++;const o=await b(t,w);if(!o)throw new Error("Failed to create toast container");const r=await async function(t,e){if(!document.querySelector('[id^="toast-container-"]'))return null;let n;try{return n=await i("div","toast"),await f(n,t,e),n}catch(o){return n=await p(t,e),n}}(t,j);if(!r)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(r),a.appendChild(s),o.id.includes("toast-container-")&&o.appendChild(a);const l=!1!==t.pauseOnHover&&(!0===t.pauseOnHover||!!t.cta),c={outer:a,toast:r,count:Math.max(1,Math.floor(null!=n?n:0)),timeout:null,pauseOnHover:l};x.set(e,c),r._key=e,c.count>1&&await P(c),c.timer=M(r,t),await O(c)}catch(e){E=Math.max(0,E-1);(document.querySelector('[id^="toast-container-"]')||document.body).appendChild(await p(t,j))}}const L=async function(){try{if(0===x.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(x.entries());if(e.length>0){const n=e.at(-1),o=r(n,2)[1];t=o.toast||o.outer&&o.outer.querySelector('[id^="toast-"]')}}if(!t)return;const e=t._key?t:t.querySelector('[id^="toast-"]')||t;await j(e)}catch(t){}},T=async function(){try{const t=Array.from(x.values()).map(t=>t.toast).filter(Boolean);k.length=0,C.clear();for(const e of t)try{await j(e)}catch(t){}}catch(t){}};function M(t,e){var n;const o=Number(null!==(n=e.duration)&&void 0!==n?n:1800)+5,r=new v(async()=>await j(t),o);return r.start(),r}async function O(t){if(!t.pauseOnHover||!t.outer||!t.timer)return;const e=t.outer,n=t.timer,o=t.toast,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 j(t){try{var e,n,o;if(null==t||!t._key)return;const r=x.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),x.delete(t._key),E=Math.max(0,E-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(t){}try{if(t.remove)return t.remove(),!0}catch(t){}try{return Object.assign(t.style,{display:"none",opacity:"0",pointerEvents:"none",position:"absolute",left:"-9999px"}),!0}catch(t){}}(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 I()}catch(t){}}async function I(){for(;E<3&&k.length;){const t=k.shift();if(x.has(t.key)){const e=x.get(t.key);e.count+=t.count,await P(e);continue}A(t.options,t.key,t.count)}}async function P(t){let e=t.outer,n=t.count;if(!(e&&e instanceof HTMLElement))throw new Error("updateBadge: outer must be a valid HTMLElement");if(n<2){const t=e.querySelector(".toast-count-badge");return void(t&&t.remove())}let o=e.querySelector(".toast-count-badge");o||(o=document.createElement("span"),o.className="toast-count-badge",o.setAttribute("aria-label","".concat(n," identical notifications")),Object.assign(o.style,{position:"absolute",top:"6px",right:"6px",backgroundColor:"#f44336",color:"#fff",borderRadius:"50%",minWidth:"20px",height:"20px",fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center",border:"2px solid #fff",boxShadow:"0 2px 6px rgba(0,0,0,0.3)",zIndex:"2",pointerEvents:"none",transition:"transform 150ms ease"}),e.appendChild(o)),o.textContent=n>99?"99+":String(n);try{o.style.transform="scale(1.2)",setTimeout(()=>o.style.transform="scale(1)",150)}catch(t){}}let N={success:"#28a745",error:"#dc3545",warning:"#ffc107",info:"#17a2b8"},D={success:"Operation completed successfully!",error:"Something went wrong!",warning:"Warning message!",info:"Information message!"};const z=[];let B=!1;async function H(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const e=await async function(t){var e,n;const r=null==t||null===(e=t.position)||void 0===e||null===(e=e.toLowerCase())||void 0===e?void 0:e.trim(),i=null!=r&&r.includes("top-full-width")||null!=r&&r.includes("bottom-full-width")?"100vw":"400px",a=o(o({},{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:i}),"object"!=typeof t||Array.isArray(t)?{}:t);a.message=null!==(n=null==t?void 0:t.message)&&void 0!==n?n:a.message;try{var s,c,u;if(!a.backgroundColor)a.backgroundColor=null!==(c=null===(u=N)||void 0===u?void 0:u[a.type])&&void 0!==c?c:window.matchMedia("(prefers-color-scheme: dark)").matches?"#f5f5f5":"#111111";if(a.message=a.message||(null===(s=D)||void 0===s?void 0:s[a.type])||"No Message Provided!",!a.textColor&&a.backgroundColor){const t=l(a.backgroundColor);a.textColor=t}if(!a.progressColor&&a.backgroundColor)if(a.textColor)a.progressColor=a.textColor;else{const t=l(a.backgroundColor);a.progressColor=t}}catch(t){}"string"!=typeof a.message&&(a.message="No Message Provided!");return a}(t);await async function(t){try{return await b(t,w)}catch(t){return document.body}}(e),await S(e)}catch(e){const n="string"==typeof(null==t?void 0:t.message)&&null!==(null==t?void 0:t.message)?"".concat(t.message.substring(0,200)," toast creation failed!"):"Toast creation failed!";alert(n)}}function R(t){try{t&&"object"==typeof t&&!Array.isArray(t)&&(N=o(o({},N),t))}catch(t){}}function W(t){try{t&&"object"==typeof t&&!Array.isArray(t)&&(D=o(o({},D),t))}catch(t){}}let _=!1,q=null;const F=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"undefined"!=typeof window&&"undefined"!=typeof document&&(await async function(){B||"undefined"!=typeof window&&"undefined"!=typeof document&&("complete"===document.readyState||"interactive"===document.readyState?(B=!0,z.forEach(t=>setTimeout(()=>H(t),2500)),z.length=0):document.addEventListener("DOMContentLoaded",()=>{B=!0,z.forEach(t=>setTimeout(()=>H(t),2500)),z.length=0},{once:!0}))}(),B?await H(t):z.push(t))};async function U(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async function(t){if(_&&q)try{await q}catch(t){}return t()}(()=>F(t))}const $=async()=>{_=!0,q=(async()=>{try{await L()}finally{_=!1,q=null}})(),await q},X=async()=>{_=!0,q=(async()=>{try{await T()}finally{_=!1,q=null}})(),await q};if("undefined"!=typeof window&&"undefined"!=typeof document){let t=!1;if(!t){const e=t=>{"Escape"!==t.key&&"Esc"!==t.key||(async()=>{_=!0,q=(async()=>{try{await L()}finally{_=!1,q=null}})(),await q})()};window.addEventListener("keydown",e,{passive:!0}),t=!0}}try{"undefined"!=typeof window&&(window.customizableToast={createToast:U,setDefaultColors:R,setDefaultMessages:W,noop:X,dismiss:$})}catch(t){}export{U as createToast,$ as dismiss,$ as dismissToast,X as noop,X as noopAll,R as setDefaultColors,W as setDefaultMessages};
16
16
  //# sourceMappingURL=index.esm.mjs.map