1/*! 2 * Toastify js 1.12.0 3 * https://github.com/apvarun/toastify-js 4 * @license MIT licensed 5 * 6 * Copyright (C) 2018 Varun A P 7 */(function(root,factory){typeof module=="object"&&module.exports?module.exports=factory():root.Toastify=factory()})(this,function(global){var Toastify=function(options){return new Toastify.lib.init(options)},version="1.12.0";Toastify.defaults={oldestFirst:!0,text:"Toastify is awesome!",node:void 0,duration:3e3,selector:void 0,callback:function(){},destination:void 0,newWindow:!1,close:!1,gravity:"toastify-top",positionLeft:!1,position:"",backgroundColor:"",avatar:"",className:"",stopOnFocus:!0,onClick:function(){},offset:{x:0,y:0},escapeMarkup:!0,ariaLive:"polite",style:{background:""}},Toastify.lib=Toastify.prototype={toastify:version,constructor:Toastify,init:function(options){return options||(options={}),this.options={},this.toastElement=null,this.options.text=options.text||Toastify.defaults.text,this.options.node=options.node||Toastify.defaults.node,this.options.duration=options.duration===0?0:options.duration||Toastify.defaults.duration,this.options.selector=options.selector||Toastify.defaults.selector,this.options.callback=options.callback||Toastify.defaults.callback,this.options.destination=options.destination||Toastify.defaults.destination,this.options.newWindow=options.newWindow||Toastify.defaults.newWindow,this.options.close=options.close||Toastify.defaults.close,this.options.gravity=options.gravity==="bottom"?"toastify-bottom":Toastify.defaults.gravity,this.options.positionLeft=options.positionLeft||Toastify.defaults.positionLeft,this.options.position=options.position||Toastify.defaults.position,this.options.backgroundColor=options.backgroundColor||Toastify.defaults.backgroundColor,this.options.avatar=options.avatar||Toastify.defaults.avatar,this.options.className=options.className||Toastify.defaults.className,this.options.stopOnFocus=options.stopOnFocus===void 0?Toastify.defaults.stopOnFocus:options.stopOnFocus,this.options.onClick=options.onClick||Toastify.defaults.onClick,this.options.offset=options.offset||Toastify.defaults.offset,this.options.escapeMarkup=options.escapeMarkup!==void 0?options.escapeMarkup:Toastify.defaults.escapeMarkup,this.options.ariaLive=options.ariaLive||Toastify.defaults.ariaLive,this.options.style=options.style||Toastify.defaults.style,options.backgroundColor&&(this.options.style.background=options.backgroundColor),this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var divElement=document.createElement("div");divElement.className="toastify on "+this.options.className,this.options.position?divElement.className+=" toastify-"+this.options.position:this.options.positionLeft===!0?(divElement.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):divElement.className+=" toastify-right",divElement.className+=" "+this.options.gravity,this.options.backgroundColor&&console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');for(var property in this.options.style)divElement.style[property]=this.options.style[property];if(this.options.ariaLive&&divElement.setAttribute("aria-live",this.options.ariaLive),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)divElement.appendChild(this.options.node);else if(this.options.escapeMarkup?divElement.innerText=this.options.text:divElement.innerHTML=this.options.text,this.options.avatar!==""){var avatarElement=document.createElement("img");avatarElement.src=this.options.avatar,avatarElement.className="toastify-avatar",this.options.position=="left"||this.options.positionLeft===!0?divElement.appendChild(avatarElement):divElement.insertAdjacentElement("afterbegin",avatarElement)}if(this.options.close===!0){var closeElement=document.createElement("button");closeElement.type="button",closeElement.setAttribute("aria-label","Close"),closeElement.className="toast-close",closeElement.innerHTML="✖",closeElement.addEventListener("click",function(event){event.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}.bind(this));var width=window.innerWidth>0?window.innerWidth:screen.width;(this.options.position=="left"||this.options.positionLeft===!0)&&width>360?divElement.insertAdjacentElement("afterbegin",closeElement):divElement.appendChild(closeElement)}if(this.options.stopOnFocus&&this.options.duration>0){var self=this;divElement.addEventListener("mouseover",function(event){window.clearTimeout(divElement.timeOutValue)}),divElement.addEventListener("mouseleave",function(){divElement.timeOutValue=window.setTimeout(function(){self.removeElement(divElement)},self.options.duration)})}if(typeof this.options.destination!="undefined"&&divElement.addEventListener("click",function(event){event.stopPropagation(),this.options.newWindow===!0?window.open(this.options.destination,"_blank"):window.location=this.options.destination}.bind(this)),typeof this.options.onClick=="function"&&typeof this.options.destination=="undefined"&&divElement.addEventListener("click",function(event){event.stopPropagation(),this.options.onClick()}.bind(this)),typeof this.options.offset=="object"){var x=getAxisOffsetAValue("x",this.options),y=getAxisOffsetAValue("y",this.options),xOffset=this.options.position=="left"?x:"-"+x,yOffset=this.options.gravity=="toastify-top"?y:"-"+y;divElement.style.transform="translate("+xOffset+","+yOffset+")"}return divElement},showToast:function(){this.toastElement=this.buildToast();var rootElement;if(typeof this.options.selector=="string"?rootElement=document.getElementById(this.options.selector):this.options.selector instanceof HTMLElement||typeof ShadowRoot!="undefined"&&this.options.selector instanceof ShadowRoot?rootElement=this.options.selector:rootElement=document.body,!rootElement)throw"Root element is not defined";var elementToInsert=Toastify.defaults.oldestFirst?rootElement.firstChild:rootElement.lastChild;return rootElement.insertBefore(this.toastElement,elementToInsert),Toastify.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout(function(){this.removeElement(this.toastElement)}.bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(toastElement){toastElement.className=toastElement.className.replace(" on",""),window.setTimeout(function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),toastElement.parentNode&&toastElement.parentNode.removeChild(toastElement),this.options.callback.call(toastElement),Toastify.reposition()}.bind(this),400)}},Toastify.reposition=function(){for(var topLeftOffsetSize={top:15,bottom:15},topRightOffsetSize={top:15,bottom:15},offsetSize={top:15,bottom:15},allToasts=document.getElementsByClassName("toastify"),classUsed,i=0;i<allToasts.length;i++){containsClass(allToasts[i],"toastify-top")===!0?classUsed="toastify-top":classUsed="toastify-bottom";var height=allToasts[i].offsetHeight;classUsed=classUsed.substr(9,classUsed.length-1);var offset=15,width=window.innerWidth>0?window.innerWidth:screen.width;width<=360?(allToasts[i].style[classUsed]=offsetSize[classUsed]+"px",offsetSize[classUsed]+=height+offset):containsClass(allToasts[i],"toastify-left")===!0?(allToasts[i].style[classUsed]=topLeftOffsetSize[classUsed]+"px",topLeftOffsetSize[classUsed]+=height+offset):(allToasts[i].style[classUsed]=topRightOffsetSize[classUsed]+"px",topRightOffsetSize[classUsed]+=height+offset)}return this};function getAxisOffsetAValue(axis,options){return options.offset[axis]?isNaN(options.offset[axis])?options.offset[axis]:options.offset[axis]+"px":"0px"}function containsClass(elem,yourClass){return!elem||typeof yourClass!="string"?!1:!!(elem.className&&elem.className.trim().split(/\s+/gi).indexOf(yourClass)>-1)}return Toastify.lib.init.prototype=Toastify.lib,Toastify}); 8//# sourceMappingURL=/cdn/shop/t/2/assets/toastify.js.map?v=26332787325675764681748524219
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.