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A,EAAoB,CACtB,IAAK,GACL,OAAQ,IAEN,EAAqB,CACvB,IAAK,GACL,OAAQ,IAEN,EAAa,CACf,IAAK,GACL,OAAQ,IAIN,EAAY,SAAS,uBAAuB,YAKvC,EAAI,EAAG,EAAI,EAAU,OAAQ,IAAK,CAGvC,GADkD,IAAhD,EAAc,EAAU,GAAI,gBAClB,eAEA,kBAGd,IAAI,EAAS,EAAU,GAAG,aAC1B,EAAY,EAAU,OAAO,EAAG,EAAU,OAAO,IAIrC,OAAO,WAAa,EAAI,OAAO,WAAa,OAAO,QAGlD,KAEX,EAAU,GAAG,MAAM,GAAa,EAAW,GAAa,KAExD,EAAW,IAAc,EATd,KAW0C,IAAjD,EAAc,EAAU,GAAI,kBAE9B,EAAU,GAAG,MAAM,GAAa,EAAkB,GAAa,KAE/D,EAAkB,IAAc,EAfvB,KAkBT,EAAU,GAAG,MAAM,GAAa,EAAmB,GAAa,KAEhE,EAAmB,IAAc,EApBxB,GAuBf,CAGA,OAAO,IACT,EAmBA,EAAS,IAAI,KAAK,UAAY,EAAS,IAGhC,CACT","file":"/npm/toastify-js@1.8.0/src/toastify.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/toastify-js@1.8.0/src/toastify.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*!\n * Toastify js 1.8.0\n * https://github.com/apvarun/toastify-js\n * @license MIT licensed\n *\n * Copyright (C) 2018 Varun A P\n */\n(function(root, factory) {\n  if (typeof module === \"object\" && module.exports) {\n    module.exports = factory();\n  } else {\n    root.Toastify = factory();\n  }\n})(this, function(global) {\n  // Object initialization\n  var Toastify = function(options) {\n      // Returning a new init object\n      return new Toastify.lib.init(options);\n    },\n    // Library version\n    version = \"1.8.0\";\n\n  // Defining the prototype of the object\n  Toastify.lib = Toastify.prototype = {\n    toastify: version,\n\n    constructor: Toastify,\n\n    // Initializing the object with required parameters\n    init: function(options) {\n      // Verifying and validating the input object\n      if (!options) {\n        options = {};\n      }\n\n      // Creating the options object\n      this.options = {};\n\n      this.toastElement = null;\n\n      // Validating the options\n      this.options.text = options.text || \"Hi there!\"; // Display message\n      this.options.node = options.node // Display content as node\n      this.options.duration = options.duration === 0 ? 0 : options.duration || 3000; // Display duration\n      this.options.selector = options.selector; // Parent selector\n      this.options.callback = options.callback || function() {}; // Callback after display\n      this.options.destination = options.destination; // On-click destination\n      this.options.newWindow = options.newWindow || false; // Open destination in new window\n      this.options.close = options.close || false; // Show toast close icon\n      this.options.gravity = options.gravity === \"bottom\" ? \"toastify-bottom\" : \"toastify-top\"; // toast position - top or bottom\n      this.options.positionLeft = options.positionLeft || false; // toast position - left or right\n      this.options.position = options.position || ''; // toast position - left or right\n      this.options.backgroundColor = options.backgroundColor; // toast background color\n      this.options.avatar = options.avatar || \"\"; // img element src - url or a path\n      this.options.className = options.className || \"\"; // additional class names for the toast\n      this.options.stopOnFocus = options.stopOnFocus === undefined? true: options.stopOnFocus; // stop timeout on focus\n      this.options.onClick = options.onClick; // Callback after click\n\n      // Returning the current object for chaining functions\n      return this;\n    },\n\n    // Building the DOM element\n    buildToast: function() {\n      // Validating if the options are defined\n      if (!this.options) {\n        throw \"Toastify is not initialized\";\n      }\n\n      // Creating the DOM object\n      var divElement = document.createElement(\"div\");\n      divElement.className = \"toastify on \" + this.options.className;\n\n      // Positioning toast to left or right or center\n      if (!!this.options.position) {\n        divElement.className += \" toastify-\" + this.options.position;\n      } else {\n        // To be depreciated in further versions\n        if (this.options.positionLeft === true) {\n          divElement.className += \" toastify-left\";\n          console.warn('Property `positionLeft` will be depreciated in further versions. Please use `position` instead.')\n        } else {\n          // Default position\n          divElement.className += \" toastify-right\";\n        }\n      }\n\n      // Assigning gravity of element\n      divElement.className += \" \" + this.options.gravity;\n\n      if (this.options.backgroundColor) {\n        divElement.style.background = this.options.backgroundColor;\n      }\n\n      // Adding the toast message/node\n      if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) {\n        // If we have a valid node, we insert it\n        divElement.appendChild(this.options.node)\n      } else {\n        divElement.innerHTML = this.options.text;\n\n        if (this.options.avatar !== \"\") {\n          var avatarElement = document.createElement(\"img\");\n          avatarElement.src = this.options.avatar;\n\n          avatarElement.className = \"toastify-avatar\";\n\n          if (this.options.position == \"left\" || this.options.positionLeft === true) {\n            // Adding close icon on the left of content\n            divElement.appendChild(avatarElement);\n          } else {\n            // Adding close icon on the right of content\n            divElement.insertAdjacentElement(\"beforeend\", avatarElement);\n          }\n        }\n      }\n\n      // Adding a close icon to the toast\n      if (this.options.close === true) {\n        // Create a span for close element\n        var closeElement = document.createElement(\"span\");\n        closeElement.innerHTML = \"&#10006;\";\n\n        closeElement.className = \"toast-close\";\n\n        // Triggering the removal of toast from DOM on close click\n        closeElement.addEventListener(\n          \"click\",\n          function(event) {\n            event.stopPropagation();\n            this.removeElement(this.toastElement);\n            window.clearTimeout(this.toastElement.timeOutValue);\n          }.bind(this)\n        );\n\n        //Calculating screen width\n        var width = window.innerWidth > 0 ? window.innerWidth : screen.width;\n\n        // Adding the close icon to the toast element\n        // Display on the right if screen width is less than or equal to 360px\n        if ((this.options.position == \"left\" || this.options.positionLeft === true) && width > 360) {\n          // Adding close icon on the left of content\n          divElement.insertAdjacentElement(\"afterbegin\", closeElement);\n        } else {\n          // Adding close icon on the right of content\n          divElement.appendChild(closeElement);\n        }\n      }\n\n      // Clear timeout while toast is focused\n      if (this.options.stopOnFocus && this.options.duration > 0) {\n        const self = this;\n        // stop countdown\n        divElement.addEventListener(\n          \"mouseover\",\n          function(event) {\n            window.clearTimeout(divElement.timeOutValue);\n          }\n        )\n        // add back the timeout\n        divElement.addEventListener(\n          \"mouseleave\",\n          function() {\n            divElement.timeOutValue = window.setTimeout(\n              function() {\n                // Remove the toast from DOM\n                self.removeElement(divElement);\n              },\n              self.options.duration\n            )\n          }\n        )\n      }\n      \n      // Adding an on-click destination path\n      if (typeof this.options.destination !== \"undefined\") {\n        divElement.addEventListener(\n          \"click\",\n          function(event) {\n            event.stopPropagation();\n            if (this.options.newWindow === true) {\n              window.open(this.options.destination, \"_blank\");\n            } else {\n              window.location = this.options.destination;\n            }\n          }.bind(this)\n        );\n      }\n\n      if (typeof this.options.onClick === \"function\" && typeof this.options.destination === \"undefined\") {\n        divElement.addEventListener(\n          \"click\",\n          function(event) {\n            event.stopPropagation();\n            this.options.onClick();            \n          }.bind(this)\n        );\n      }\n\n      // Returning the generated element\n      return divElement;\n    },\n\n    // Displaying the toast\n    showToast: function() {\n      // Creating the DOM object for the toast\n      this.toastElement = this.buildToast();\n\n      // Getting the root element to with the toast needs to be added\n      var rootElement;\n      if (typeof this.options.selector === \"undefined\") {\n        rootElement = document.body;\n      } else {\n        rootElement = document.getElementById(this.options.selector);\n      }\n\n      // Validating if root element is present in DOM\n      if (!rootElement) {\n        throw \"Root element is not defined\";\n      }\n\n      // Adding the DOM element\n      rootElement.insertBefore(this.toastElement, rootElement.firstChild);\n\n      // Repositioning the toasts in case multiple toasts are present\n      Toastify.reposition();\n\n      if (this.options.duration > 0) {\n        this.toastElement.timeOutValue = window.setTimeout(\n          function() {\n            // Remove the toast from DOM\n            this.removeElement(this.toastElement);\n          }.bind(this),\n          this.options.duration\n        ); // Binding `this` for function invocation\n      }\n\n      // Supporting function chaining\n      return this;\n    },\n\n    hideToast: function() {\n      if (this.toastElement.timeOutValue) {\n        clearTimeout(this.toastElement.timeOutValue);\n      }\n      this.removeElement(this.toastElement);\n    },\n\n    // Removing the element from the DOM\n    removeElement: function(toastElement) {\n      // Hiding the element\n      // toastElement.classList.remove(\"on\");\n      toastElement.className = toastElement.className.replace(\" on\", \"\");\n\n      // Removing the element from DOM after transition end\n      window.setTimeout(\n        function() {\n          // remove options node if any\n          if (this.options.node && this.options.node.parentNode) {\n            this.options.node.parentNode.removeChild(this.options.node);\n          }\n\n          // Remove the elemenf from the DOM, only when the parent node was not removed before.\n          if (toastElement.parentNode) {\n            toastElement.parentNode.removeChild(toastElement);\n          }\n\n          // Calling the callback function\n          this.options.callback.call(toastElement);\n\n          // Repositioning the toasts again\n          Toastify.reposition();\n        }.bind(this),\n        400\n      ); // Binding `this` for function invocation\n    },\n  };\n\n  // Positioning the toasts on the DOM\n  Toastify.reposition = function() {\n    // Top margins with gravity\n    var topLeftOffsetSize = {\n      top: 15,\n      bottom: 15,\n    };\n    var topRightOffsetSize = {\n      top: 15,\n      bottom: 15,\n    };\n    var offsetSize = {\n      top: 15,\n      bottom: 15,\n    };\n\n    // Get all toast messages on the DOM\n    var allToasts = document.getElementsByClassName(\"toastify\");\n\n    var classUsed;\n\n    // Modifying the position of each toast element\n    for (var i = 0; i < allToasts.length; i++) {\n      // Getting the applied gravity\n      if (containsClass(allToasts[i], \"toastify-top\") === true) {\n        classUsed = \"toastify-top\";\n      } else {\n        classUsed = \"toastify-bottom\";\n      }\n\n      var height = allToasts[i].offsetHeight;\n      classUsed = classUsed.substr(9, classUsed.length-1)\n      // Spacing between toasts\n      var offset = 15;\n\n      var width = window.innerWidth > 0 ? window.innerWidth : screen.width;\n\n      // Show toast in center if screen with less than or qual to 360px\n      if (width <= 360) {\n        // Setting the position\n        allToasts[i].style[classUsed] = offsetSize[classUsed] + \"px\";\n\n        offsetSize[classUsed] += height + offset;\n      } else {\n        if (containsClass(allToasts[i], \"toastify-left\") === true) {\n          // Setting the position\n          allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + \"px\";\n\n          topLeftOffsetSize[classUsed] += height + offset;\n        } else {\n          // Setting the position\n          allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + \"px\";\n\n          topRightOffsetSize[classUsed] += height + offset;\n        }\n      }\n    }\n\n    // Supporting function chaining\n    return this;\n  };\n\n  function containsClass(elem, yourClass) {\n    if (!elem || typeof yourClass !== \"string\") {\n      return false;\n    } else if (\n      elem.className &&\n      elem.className\n        .trim()\n        .split(/\\s+/gi)\n        .indexOf(yourClass) > -1\n    ) {\n      return true;\n    } else {\n      return false;\n    }\n  }\n\n  // Setting up the prototype for the init object\n  Toastify.lib.init.prototype = Toastify.lib;\n\n  // Returning the Toastify function to be assigned to the window object/module\n  return Toastify;\n});\n"]}