PageSourceSearch

https://interaction.site/wp-content/plugins/fluent-cart/assets/pub…/toastify/toastify-js-1.12.0.js?ver=1.7.0

js interaction.site collected 2026-10-04 02:16:56 UTC 10,309 bytes, 8 lines download raw bytes

1/*!
2 * Toastify js 1.12.0 (Class Implementation with slideFrom option)
3 * https://github.com/apvarun/toastify-js
4 * @license MIT licensed
5 *
6 * Copyright (C) 2018 Varun A P
7 * Converted to class-based implementation
8 */(function(p,e){typeof module=="object"&&module.exports?module.exports=e():p.Toastify=e()})(this,function(p){const e={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:""},slideFrom:"",type:""};class r{constructor(t={}){this.options={},this.toastElement=null,this.version="1.12.0",this.options.text=t.text||e.text,this.options.node=t.node||e.node,this.options.duration=t.duration===0?0:t.duration||e.duration,this.options.selector=t.selector||e.selector,this.options.callback=t.callback||e.callback,this.options.destination=t.destination||e.destination,this.options.newWindow=t.newWindow||e.newWindow,this.options.close=t.close||e.close,this.options.gravity=t.gravity==="bottom"?"toastify-bottom":e.gravity,this.options.positionLeft=t.positionLeft||e.positionLeft,this.options.position=t.position||e.position,this.options.backgroundColor=t.backgroundColor||e.backgroundColor,this.options.avatar=t.avatar||e.avatar,this.options.className=t.className||e.className,this.options.stopOnFocus=t.stopOnFocus===void 0?e.stopOnFocus:t.stopOnFocus,this.options.onClick=t.onClick||e.onClick,this.options.offset=t.offset||e.offset,this.options.escapeMarkup=t.escapeMarkup!==void 0?t.escapeMarkup:e.escapeMarkup,this.options.ariaLive=t.ariaLive||e.ariaLive,this.options.style=t.style||Object.assign({},e.style),this.options.slideFrom=t.slideFrom||e.slideFrom,this.options.type=t.type||null,t.backgroundColor&&(this.options.style.background=t.backgroundColor)}buildToast(){if(!this.options)throw"Toastify is not initialized";const t=document.createElement("div");t.className="toastify "+this.options.className,this.options.position?t.className+=" toastify-"+this.options.position:this.options.positionLeft===!0?(t.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):t.className+=" toastify-right",t.className+=" "+this.options.gravity,this.options.backgroundColor&&console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');for(const s in this.options.style)t.style[s]=this.options.style[s];if(this.options.ariaLive&&t.setAttribute("aria-live",this.options.ariaLive),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)t.appendChild(this.options.node);else{this.options.escapeMarkup?t.innerText=this.options.text:t.innerHTML=this.options.text;const s='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="green" d="M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"></path></svg>',a='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"></path></svg>',n='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"></path></svg>',o='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
8<path fill="currentColor" d="M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"></path></svg>';if(this.options.type){const i=document.createElement("div");i.classList.add("toastify-icon"),this.options.type==="success"?(i.innerHTML=s.trim(),i.classList.add("success")):this.options.type==="error"?(i.innerHTML=a.trim(),i.classList.add("error")):this.options.type==="info"?(i.innerHTML=n.trim(),i.classList.add("info")):this.options.type==="warning"&&(i.innerHTML=o.trim(),i.classList.add("warning")),t.classList.add("has-toastify-icon"),this.options.position==="left"||this.options.positionLeft===!0?t.appendChild(i):t.insertAdjacentElement("afterbegin",i)}if(this.options.avatar!==""&&!this.options.type){const i=document.createElement("img");i.src=this.options.avatar,i.className="toastify-avatar",this.options.position=="left"||this.options.positionLeft===!0?t.appendChild(i):t.insertAdjacentElement("afterbegin",i)}}if(this.options.close===!0){const s=document.createElement("button");s.type="button",s.setAttribute("aria-label","Close"),s.className="toast-close",s.innerHTML="&#10006;",s.addEventListener("click",n=>{n.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)});const a=window.innerWidth>0?window.innerWidth:screen.width;(this.options.position=="left"||this.options.positionLeft===!0)&&a>360?t.insertAdjacentElement("afterbegin",s):t.appendChild(s)}if(this.options.stopOnFocus&&this.options.duration>0&&(t.addEventListener("mouseover",()=>{window.clearTimeout(t.timeOutValue)}),t.addEventListener("mouseleave",()=>{t.timeOutValue=window.setTimeout(()=>{this.removeElement(t)},this.options.duration)})),typeof this.options.destination<"u"&&t.addEventListener("click",s=>{s.stopPropagation(),this.options.newWindow===!0?window.open(this.options.destination,"_blank"):window.location=this.options.destination}),typeof this.options.onClick=="function"&&typeof this.options.destination>"u"&&t.addEventListener("click",s=>{s.stopPropagation(),this.options.onClick()}),typeof this.options.offset=="object"){const s=r.getAxisOffsetAValue("x",this.options),a=r.getAxisOffsetAValue("y",this.options),n=this.options.position=="left"?s:"-"+s,o=this.options.gravity=="toastify-top"?a:"-"+a;t.style.transform="translate("+n+","+o+")"}return t}getSlidePosition(){if(!this.options.slideFrom)return null;const t=window.innerWidth,s=window.innerHeight;switch(this.options.slideFrom.toLowerCase()){case"left":return{transform:`translateX(-${t}px)`};case"right":return{transform:`translateX(${t}px)`};case"top":return{transform:`translateY(-${s}px)`};case"bottom":return{transform:`translateY(${s}px)`};default:return null}}getFinalPosition(){let t="";if(typeof this.options.offset=="object"){const s=r.getAxisOffsetAValue("x",this.options),a=r.getAxisOffsetAValue("y",this.options),n=this.options.position=="left"?s:"-"+s,o=this.options.gravity=="toastify-top"?a:"-"+a;t=`translate(${n}, ${o})`}return{transform:t}}showToast(){this.toastElement=this.buildToast();const t=this.getSlidePosition();t&&Object.assign(this.toastElement.style,t);let s;if(typeof this.options.selector=="string"?s=document.getElementById(this.options.selector):this.options.selector instanceof HTMLElement||typeof ShadowRoot<"u"&&this.options.selector instanceof ShadowRoot?s=this.options.selector:s=document.body,!s)throw"Root element is not defined";const a=e.oldestFirst?s.firstChild:s.lastChild;return s.insertBefore(this.toastElement,a),this.toastElement.offsetWidth,this.options.slideFrom||(this.toastElement.className+=" on"),t&&(this.toastElement.style.transition="transform 0.4s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.4s cubic-bezier(0.215, 0.61, 0.355, 1)",setTimeout(()=>{const n=this.getFinalPosition();Object.assign(this.toastElement.style,n),this.toastElement.className+=" on"},20)),r.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout(()=>{this.removeElement(this.toastElement)},this.options.duration)),this}hideToast(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)}removeElement(t){if(this.options.slideFrom){const s=window.innerWidth,a=window.innerHeight;switch(t.style.transition="transform 0.4s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.4s cubic-bezier(0.215, 0.61, 0.355, 1)",this.options.slideFrom.toLowerCase()){case"left":t.style.transform=`translateX(-${s}px)`;break;case"right":t.style.transform=`translateX(${s}px)`;break;case"top":t.style.transform=`translateY(-${a}px)`;break;case"bottom":t.style.transform=`translateY(${a}px)`;break}t.style.opacity="0"}else t.className=t.className.replace(" on","");window.setTimeout(()=>{this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),t.parentNode&&t.parentNode.removeChild(t),this.options.callback.call(t),r.reposition()},400)}static getAxisOffsetAValue(t,s){return s.offset[t]?isNaN(s.offset[t])?s.offset[t]:s.offset[t]+"px":"0px"}
8static containsClass(t,s){return!t||typeof s!="string"?!1:!!(t.className&&t.className.trim().split(/\s+/gi).indexOf(s)>-1)}static reposition(){const t={top:15,bottom:15},s={top:15,bottom:15},a={top:15,bottom:15},n=Array.from(document.getElementsByClassName("toastify"));r.defaults.oldestFirst&&n.reverse();let o;for(let i=0;i<n.length;i++){r.containsClass(n[i],"toastify-top")===!0?o="toastify-top":o="toastify-bottom";const l=n[i].offsetHeight;o=o.substr(9,o.length-1);const c=15;(window.innerWidth>0?window.innerWidth:screen.width)<=360?(n[i].style[o]=a[o]+"px",a[o]+=l+c):r.containsClass(n[i],"toastify-left")===!0?(n[i].style[o]=t[o]+"px",t[o]+=l+c):(n[i].style[o]=s[o]+"px",s[o]+=l+c)}return this}}return r.defaults=e,r});

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.