/*! * BSToast4 v0.2.0.059 * Copyright 2023-2025 Ray Lam (https://www.hiimray.co.uk/bootstrap-js-bstoast4) * */ (()=>{var t={};window.BSToast4=new class{pfx="bstoa4_";constructor(){}async Create(t){const e=this,o=Object.assign(e.DefaultOptions,t);e.#t(o.Position),e.#e(o)}get DefaultOptions(){return{Icon:"",Title:"",Time:"",Message:"",Footer:"",Animation:!0,AutoHide:!0,Delay:6e3,Position:"position:fixed; top:0; right:80px; margin:20px;",MinWidth:320,MinHeight:100,HeaderClass:"bg-light",FooterClass:"bg-light text-center"}}get#o(){return document.getElementsByTagName("body")[0]}get#n(){const t=this.#o.querySelectorAll(".toast-backdrop");return t.length<=0?null:t[0]}get#s(){const t=this.#o.querySelectorAll(".toast-backdrop-body");return t.length<=0?null:t[0]}Clear(){const t=this;t.#o.querySelectorAll(".toast").forEach((function(e){t.#a(e)})),t.#l()}Close(t){const e=this,o=e.pfx+t;e.#o.querySelectorAll("#"+o+".toast").forEach((function(t){e.#a(t)})),e.#o.querySelectorAll(".toast.hide").forEach((function(t){e.#a(t)})),e.#o.querySelectorAll(".toast").length<=0&&e.#l()}GetList(){const t=this,e=t.#o.querySelectorAll(".toast");if(e.length<=0)return[];let o=[];for(let n=0;n0?e+"px":"auto",a.style.minHeight=o>0?o+"px":"auto",s?this.#c(a,n):a.innerHTML=n)}UpdateFooter(t,e){const o=this.FindFooter(t);null!=o&&(o.style.display=this.#u(e)?"none":"",o.innerHTML=e)}async#t(t){const e=this;if(null!=e.#n)return;const o='\n\t\t\t
\n\t\t\t\t
\n\t\t\t
'\n\t\t";e.#c(e.#o,o)}#e(t){const e=this,o=Math.floor(1e5*Math.random())+1e4,n=e.pfx+o,s=e.#s;if(null==s)return;const a='\n\t\t\t\n\t\t';e.#c(s,a);const l=e.Find(o);null!=l&&(e.#r(l,o),e.Update(o,t,!1))}#r(t,e){const o=this;jQuery(t).on("hidden.bs.toast",(function(){o.Close(e)}))}#d(t){return"\n\t\t\t"+(this.#u(t.Icon)?"":t.Icon)+'\n\t\t\t'+t.Title+'\n\t\t\t'+t.Time+'\n\t\t\t\n\t\t'}#l(){const t=this.#n;null!=t&&this.#a(t)}#i(t,e,o,n){jQuery(t).toast({animation:e,autohide:o,delay:n}).toast("show")}#a(t){null!=t&&void 0!==t.parentNode&&t.parentNode.removeChild(t)}#c(t,e){let o=document.createElement("template");o.innerHTML=e.trim(),o=o.content.firstChild,t.appendChild(o)}#u(t){return void 0===t||null==t||("string"==typeof t?t.trim().length<=0:t.toString().trim().length<=0)}};var e=self;for(var o in t)e[o]=t[o];t.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})})();