$.Toast=function(t,s,o,a){var e=null,i=$.extend(!0,{},{appendTo:"body",stack:!1,position_class:"toast-bottom-right",fullscreen:!1,width:250,spacing:20,timeout:4e3,has_close_btn:!0,has_icon:!0,sticky:!1,border_radius:6,has_progress:!1,rtl:!1},a),n=i.spacing,p={position:"body"==i.appendTo?"fixed":"absolute","min-width":i.width,display:"none","border-radius":i.border_radius,"z-index":99999};if(e=$('<div class="toast-item-wrapper '+o+" "+i.position_class+'"></div>'),$('<p class="toast-title">'+t+"</p>").appendTo(e),$('<p class="toast-message">'+s+"</p>").appendTo(e),i.fullscreen&&e.addClass("fullscreen"),i.rtl&&e.addClass("rtl"),i.has_close_btn&&($('<span class="toast-close">&times;</span>').appendTo(e),i.rtl?p["padding-left"]=20:p["padding-right"]=20),i.has_icon&&($('<i class="toast-icon toast-icon-'+o+'"></i>').appendTo(e),i.rtl?p["padding-right"]=50:p["padding-left"]=50),i.has_progress&&i.timeout>0&&$('<div class="toast-progress"></div>').appendTo(e),i.sticky)switch(i.spacing=0,n=0,i.position_class){case"toast-top-left":case"toast-top-right":p.top=0,p.left=0;break;case"toast-top-center":p.top=0,p.left=p.right=0,p.width="100%";break;case"toast-bottom-left":p.bottom=0,p.left=0;break;case"toast-bottom-right":p.bottom=0,p.right=0;break;case"toast-bottom-center":p.bottom=0,p.left=p.right=0,p.width="100%"}function r(){$.Toast.remove(e)}return i.stack&&(-1!==i.position_class.indexOf("toast-top")?$(i.appendTo).find(".toast-item-wrapper").each(function(){p.top=parseInt($(this).css("top"))+this.offsetHeight+n}):-1!==i.position_class.indexOf("toast-bottom")&&$(i.appendTo).find(".toast-item-wrapper").each(function(){p.bottom=parseInt($(this).css("bottom"))+this.offsetHeight+n})),e.css(p),e.appendTo(i.appendTo),e.fadeIn?e.fadeIn():$alert.css({display:"block",opacity:1}),i.timeout>0&&(setTimeout(r,i.timeout),i.has_progress&&$(".toast-progress",e).animate({width:"100%"},i.timeout)),$(".toast-close",e).click(r),e},$.Toast.remove=function(t){t.fadeOut?t.fadeOut(function(){return t.remove()}):t.remove()};