New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-toastify

Package Overview
Dependencies
Maintainers
1
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-toastify - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

lib/toast.js

8

dist/ReactToastify.js

@@ -1,4 +0,4 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","prop-types","react-dom"],t):"object"==typeof exports?exports.ReactToastify=t(require("react"),require("prop-types"),require("react-dom")):e.ReactToastify=t(e.react,e["prop-types"],e["react-dom"])}(window,function(e,t,n){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=18)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},t.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},t.ACTION={SHOW:"SHOW_TOAST",CLEAR:"CLEAR_TOAST",MOUNTED:"CONTAINER_MOUNTED",ON_CHANGE:"ON_CHANGE"}},function(e,t,n){var o;
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","prop-types","react-dom"],t):"object"==typeof exports?exports.ReactToastify=t(require("react"),require("prop-types"),require("react-dom")):e.ReactToastify=t(e.react,e["prop-types"],e["react-dom"])}(window,function(e,t,n){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},t.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},t.ACTION={SHOW:0,CLEAR:1,DID_MOUNT:2,WILL_UNMOUNT:3,ON_CHANGE:4}},function(e,t,n){var o;
/*!
Copyright (c) 2016 Jed Watson.
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see

@@ -8,7 +8,7 @@ http://jedwatson.github.io/classnames

/*!
Copyright (c) 2016 Jed Watson.
Copyright (c) 2017 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var a=typeof o;if("string"===a||"number"===a)e.push(o);else if(Array.isArray(o))e.push(r.apply(null,o));else if("object"===a)for(var i in o)n.call(o,i)&&o[i]&&e.push(i)}}return e.join(" ")}void 0!==e&&e.exports?e.exports=r:void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o)}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o={eventList:new Map,on:function(e,t){return this.eventList.has(e)||this.eventList.set(e,[]),this.eventList.get(e).push(t),this},off:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.eventList.delete(e)},emit:function(e){for(var t=this,n=arguments.length,o=Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return!!this.eventList.has(e)&&(this.eventList.get(e).forEach(function(e){return setTimeout(function(){return e.call.apply(e,[t].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(o)))},0)}),!0)}};t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,r=!1,a=void 0;try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(e){r=!0,a=e}finally{try{!o&&s.return&&s.return()}finally{if(r)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.default=function(e){var t=e.enter,n=e.exit,s=e.duration,l=void 0===s?750:s,c=e.appendPosition,f=void 0!==c&&c;return function(e){var s=e.children,c=e.position,p=e.preventExitTransition,d=function(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(e,["children","position","preventExitTransition"]),h=f?t+"--"+c:t,y=f?n+"--"+c:n,v=void 0,g=void 0;if(Array.isArray(l)&&2===l.length){var m=r(l,2);v=m[0],g=m[1]}else v=g=l;return a.default.createElement(i.default,o({},d,{timeout:p?0:{enter:v,exit:g},onEnter:function(e){e.classList.add(h),e.style.animationFillMode="forwards",e.style.animationDuration=.001*v+"s"},onEntered:function(e){e.classList.remove(h),e.style.cssText=""},onExit:p?u:function(e){e.classList.add(y),e.style.animationFillMode="forwards",e.style.animationDuration=.001*g+"s"}}),s)}};var a=s(n(0)),i=s(n(11));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(){}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Flip=t.Zoom=t.Slide=t.Bounce=void 0;var o,r=n(5),a=(o=r)&&o.__esModule?o:{default:o};var i=(0,a.default)({enter:"Toastify__bounce-enter",exit:"Toastify__bounce-exit",appendPosition:!0}),s=(0,a.default)({enter:"Toastify__slide-enter",exit:"Toastify__slide-exit",duration:[450,750],appendPosition:!0}),u=(0,a.default)({enter:"Toastify__zoom-enter",exit:"Toastify__zoom-exit"}),l=(0,a.default)({enter:"Toastify__flip-enter",exit:"Toastify__flip-exit"});t.Bounce=i,t.Slide=s,t.Zoom=u,t.Flip=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.falseOrElement=t.falseOrDelay=void 0,t.isValidDelay=r,t.objectValues=function(e){return Object.keys(e).map(function(t){return e[t]})};var o=n(0);function r(e){return"number"==typeof e&&!isNaN(e)&&e>0}function a(e){return e.isRequired=function(t,n,o){if(void 0===t[n])return new Error("The prop "+n+" is marked as required in \n "+o+", but its value is undefined.");e(t,n,o)},e}t.falseOrDelay=a(function(e,t,n){var o=e[t];return!1===o||r(o)?null:new Error(n+" expect "+t+" \n to be a valid Number > 0 or equal to false. "+o+" given.")}),t.falseOrElement=a(function(e,t,n){var r=e[t];return!1===r||(0,o.isValidElement)(r)?null:new Error(n+" expect "+t+" \n to be a valid react element or equal to false. "+r+" given.")})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},a=n(4),i=(o=a)&&o.__esModule?o:{default:o},s=n(2);var u={type:s.TYPE.DEFAULT,autoClose:null,closeButton:null,hideProgressBar:null,position:null,pauseOnHover:null,closeOnClick:null,className:null,bodyClassName:null,progressClassName:null,transition:null,updateId:null,draggable:null},l=null,c=[],f=0;function p(e,t){return r({},u,e,{type:t,toastId:++f})}function d(e,t){return null!==l?i.default.emit(s.ACTION.SHOW,e,t):c.push({action:s.ACTION.SHOW,content:e,options:t}),t.toastId}var h=r(function(e,t){return d(e,p(t,t&&t.type||s.TYPE.DEFAULT))},{success:function(e,t){return d(e,p(t,s.TYPE.SUCCESS))},info:function(e,t){return d(e,p(t,s.TYPE.INFO))},warn:function(e,t){return d(e,p(t,s.TYPE.WARNING))},warning:function(e,t){return d(e,p(t,s.TYPE.WARNING))},error:function(e,t){return d(e,p(t,s.TYPE.ERROR))},dismiss:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return l&&i.default.emit(s.ACTION.CLEAR,e)},isActive:function(){return!1},update:function(e,t){setTimeout(function(){if(l&&void 0!==l.collection[e]){var n=l.collection[e],o=n.options,a=n.content,i=null!==o.updateId?o.updateId+1:1,s=r({},o,t,{toastId:e,updateId:i}),u=void 0!==s.render?s.render:a;delete s.render,d(u,s)}},0)},onChange:function(e){"function"==typeof e&&i.default.on(s.ACTION.ON_CHANGE,e)}},{POSITION:s.POSITION,TYPE:s.TYPE});i.default.on(s.ACTION.MOUNTED,function(e){l=e,h.isActive=function(e){return l.isToastActive(e)},c.forEach(function(e){i.default.emit(e.action,e.content,e.options)}),c=[]}),t.default=h},function(e,t,n){"use strict";t.__esModule=!0,t.classNamesShape=t.timeoutsShape=void 0,t.transitionTimeout=function(e){var t="transition"+e+"Timeout",n="transition"+e;return function(e){if(e[n]){if(null==e[t])return new Error(t+" wasn't supplied to CSSTransitionGroup: this can cause unreliable animations and won't be supported in a future version of React. See https://fb.me/react-animation-transition-group-timeout for more information.");if("number"!=typeof e[t])return new Error(t+" must be a number (in milliseconds)")}return null}};var o,r=n(1),a=(o=r)&&o.__esModule?o:{default:o};t.timeoutsShape=a.default.oneOfType([a.default.number,a.default.shape({enter:a.default.number,exit:a.default.number}).isRequired]),t.classNamesShape=a.default.oneOfType([a.default.string,a.default.shape({enter:a.default.string,exit:a.default.string,active:a.default.string}),a.default.shape({enter:a.default.string,enterDone:a.default.string,enterActive:a.default.string,exit:a.default.string,exitDone:a.default.string,exitActive:a.default.string})])},function(e,t){e.exports=n},function(e,t,n){"use strict";t.__esModule=!0,t.EXITING=t.ENTERED=t.ENTERING=t.EXITED=t.UNMOUNTED=void 0;var o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(1)),r=i(n(0)),a=i(n(10));n(9);function i(e){return e&&e.__esModule?e:{default:e}}var s=t.UNMOUNTED="unmounted",u=t.EXITED="exited",l=t.ENTERING="entering",c=t.ENTERED="entered",f=t.EXITING="exiting",p=function(e){function t(n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o)),a=o.transitionGroup,i=a&&!a.isMounting?n.enter:n.appear,f=void 0;return r.nextStatus=null,n.in?i?(f=u,r.nextStatus=l):f=c:f=n.unmountOnExit||n.mountOnEnter?s:u,r.state={status:f},r.nextCallback=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getChildContext=function(){return{transitionGroup:null}},t.prototype.componentDidMount=function(){this.updateStatus(!0)},t.prototype.componentWillReceiveProps=function(e){var t=(this.pendingState||this.state).status;e.in?(t===s&&this.setState({status:u}),t!==l&&t!==c&&(this.nextStatus=l)):t!==l&&t!==c||(this.nextStatus=f)},t.prototype.componentDidUpdate=function(){this.updateStatus()},t.prototype.componentWillUnmount=function(){this.cancelNextCallback()},t.prototype.getTimeouts=function(){var e=this.props.timeout,t=void 0,n=void 0,o=void 0;return t=n=o=e,null!=e&&"number"!=typeof e&&(t=e.exit,n=e.enter,o=e.appear),{exit:t,enter:n,appear:o}},t.prototype.updateStatus=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.nextStatus;if(null!==t){this.nextStatus=null,this.cancelNextCallback();var n=a.default.findDOMNode(this);t===l?this.performEnter(n,e):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===u&&this.setState({status:s})},t.prototype.performEnter=function(e,t){var n=this,o=this.props.enter,r=this.context.transitionGroup?this.context.transitionGroup.isMounting:t,a=this.getTimeouts();t||o?(this.props.onEnter(e,r),this.safeSetState({status:l},function(){n.props.onEntering(e,r),n.onTransitionEnd(e,a.enter,function(){n.safeSetState({status:c},function(){n.props.onEntered(e,r)})})})):this.safeSetState({status:c},function(){n.props.onEntered(e)})},t.prototype.performExit=function(e){var t=this,n=this.props.exit,o=this.getTimeouts();n?(this.props.onExit(e),this.safeSetState({status:f},function(){t.props.onExiting(e),t.onTransitionEnd(e,o.exit,function(){t.safeSetState({status:u},function(){t.props.onExited(e)})})})):this.safeSetState({status:u},function(){t.props.onExited(e)})},t.prototype.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},t.prototype.safeSetState=function(e,t){var n=this;this.pendingState=e,t=this.setNextCallback(t),this.setState(e,function(){n.pendingState=null,t()})},t.prototype.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(o){n&&(n=!1,t.nextCallback=null,e(o))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},t.prototype.onTransitionEnd=function(e,t,n){this.setNextCallback(n),e?(this.props.addEndListener&&this.props.addEndListener(e,this.nextCallback),null!=t&&setTimeout(this.nextCallback,t)):setTimeout(this.nextCallback,0)},t.prototype.render=function(){var e=this.state.status;if(e===s)return null;var t=this.props,n=t.children,o=function(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(t,["children"]);if(delete o.in,delete o.mountOnEnter,delete o.unmountOnExit,delete o.appear,delete o.enter,delete o.exit,delete o.timeout,delete o.addEndListener,delete o.onEnter,delete o.onEntering,delete o.onEntered,delete o.onExit,delete o.onExiting,delete o.onExited,"function"==typeof n)return n(e,o);var a=r.default.Children.only(n);return r.default.cloneElement(a,o)},t}(r.default.Component);function d(){}p.contextTypes={transitionGroup:o.object},p.childContextTypes={transitionGroup:function(){}},p.propTypes={},p.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:d,onEntering:d,onEntered:d,onExit:d,onExiting:d,onExited:d},p.UNMOUNTED=0,p.EXITED=1,p.ENTERING=2,p.ENTERED=3,p.EXITING=4,t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=a(n(0)),r=a(n(1));function a(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=e.closeToast,n=e.type,r=e.ariaLabel;return o.default.createElement("button",{className:"Toastify__close-button Toastify__close-button--"+n,type:"button",onClick:t,"aria-label":r},"✖")}i.propTypes={closeToast:r.default.func,arialLabel:r.default.string},i.defaultProps={ariaLabel:"close"},t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=s(n(0)),r=s(n(1)),a=s(n(3)),i=n(2);function s(e){return e&&e.__esModule?e:{default:e}}function u(e){var t=e.delay,n=e.isRunning,r=e.closeToast,i=e.type,s=e.hide,u=e.className,l=e.rtl,c={animationDuration:t+"ms",animationPlayState:n?"running":"paused",opacity:s?0:1},f=(0,a.default)("Toastify__progress-bar","Toastify__progress-bar--"+i,{"Toastify__progress-bar--rtl":l},u);return o.default.createElement("div",{className:f,style:c,onAnimationEnd:r})}u.propTypes={delay:r.default.number.isRequired,isRunning:r.default.bool.isRequired,closeToast:r.default.func.isRequired,rtl:r.default.bool.isRequired,type:r.default.string,hide:r.default.bool,className:r.default.oneOfType([r.default.string,r.default.object])},u.defaultProps={type:i.TYPE.DEFAULT,hide:!1},t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=n(0),i=p(a),s=p(n(1)),u=p(n(3)),l=p(n(13)),c=n(2),f=n(7);function p(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function h(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}var y=function(){},v=function(e){function t(){var e,n,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,a=Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=o=d(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),o.state={isRunning:!0,preventExitTransition:!1},o.flag={canCloseOnClick:!0,canDrag:!1},o.drag={start:0,x:0,y:0,deltaX:0,removalDistance:0},o.ref=null,o.pauseToast=function(){o.setState({isRunning:!1})},o.playToast=function(){o.setState({isRunning:!0})},o.onDragStart=function(e){o.flag.canCloseOnClick=!0,o.flag.canDrag=!0,o.ref.style.transition="",o.drag.start=o.drag.x=h(e.nativeEvent),o.drag.removalDistance=o.ref.offsetWidth*(o.props.draggablePercent/100)},o.onDragMove=function(e){o.flag.canDrag&&(o.state.isRunning&&o.pauseToast(),o.drag.x=h(e),o.drag.deltaX=o.drag.x-o.drag.start,o.drag.start!==o.drag.x&&(o.flag.canCloseOnClick=!1),o.ref.style.transform="translateX("+o.drag.deltaX+"px)",o.ref.style.opacity=1-Math.abs(o.drag.deltaX/o.drag.removalDistance))},o.onDragEnd=function(e){if(o.flag.canDrag){if(o.flag.canDrag=!1,Math.abs(o.drag.deltaX)>o.drag.removalDistance)return void o.setState({preventExitTransition:!0},o.props.closeToast);o.drag.y=function(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}(e),o.ref.style.transition="transform 0.2s, opacity 0.2s",o.ref.style.transform="translateX(0)",o.ref.style.opacity=1}},o.onDragTransitionEnd=function(){var e=o.ref.getBoundingClientRect(),t=e.top,n=e.bottom,r=e.left,a=e.right;o.props.pauseOnHover&&o.drag.x>=r&&o.drag.x<=a&&o.drag.y>=t&&o.drag.y<=n?o.pauseToast():o.playToast()},d(o,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.Component),r(t,[{key:"componentDidMount",value:function(){this.props.onOpen(this.props.children.props),this.props.draggable&&this.bindDragEvents()}},{key:"bindDragEvents",value:function(){document.addEventListener("mousemove",this.onDragMove),document.addEventListener("mouseup",this.onDragEnd),document.addEventListener("touchmove",this.onDragMove),document.addEventListener("touchend",this.onDragEnd)}},{key:"unbindDragEvents",value:function(){document.removeEventListener("mousemove",this.onDragMove),document.removeEventListener("mouseup",this.onDragEnd),document.removeEventListener("touchmove",this.onDragMove),document.removeEventListener("touchend",this.onDragEnd)}},{key:"componentDidUpdate",value:function(e){e.draggable!==this.props.draggable&&(this.props.draggable?this.bindDragEvents():this.unbindDragEvents())}},{key:"componentWillUnmount",value:function(){this.props.onClose(this.props.children.props),this.props.draggable&&this.unbindDragEvents()}},{key:"render",value:function(){var e=this,t=this.props,n=t.closeButton,r=t.children,a=t.autoClose,s=t.pauseOnHover,c=t.closeOnClick,f=t.type,p=t.hideProgressBar,d=t.closeToast,h=t.transition,y=t.position,v=t.onExited,g=t.className,m=t.bodyClassName,b=t.progressClassName,E=t.updateId,O=t.role,T=t.rtl,C={className:(0,u.default)("Toastify__toast","Toastify__toast--"+f,{"Toastify__toast--rtl":T},g)};return a&&s&&(C.onMouseEnter=this.pauseToast,C.onMouseLeave=this.playToast),c&&(C.onClick=function(){return e.flag.canCloseOnClick&&d()}),i.default.createElement(h,{in:this.props.in,appear:!0,unmountOnExit:!0,onExited:v,position:y,preventExitTransition:this.state.preventExitTransition},i.default.createElement("div",o({},C,{ref:function(t){return e.ref=t},onMouseDown:this.onDragStart,onTouchStart:this.onDragStart,onTransitionEnd:this.onDragTransitionEnd}),i.default.createElement("div",o({},this.props.in&&{role:O},{className:(0,u.default)("Toastify__toast-body",m)}),r),!1!==n&&n,!1!==a&&i.default.createElement(l.default,o({},E?{key:"pb-"+E}:{},{rtl:T,delay:a,isRunning:this.state.isRunning,closeToast:d,hide:p,type:f,className:b}))))}}]),t}();v.propTypes={closeButton:f.falseOrElement.isRequired,autoClose:f.falseOrDelay.isRequired,children:s.default.node.isRequired,closeToast:s.default.func.isRequired,position:s.default.oneOf((0,f.objectValues)(c.POSITION)).isRequired,pauseOnHover:s.default.bool.isRequired,closeOnClick:s.default.bool.isRequired,transition:s.default.func.isRequired,isDocumentHidden:s.default.bool.isRequired,rtl:s.default.bool.isRequired,hideProgressBar:s.default.bool.isRequired,draggable:s.default.bool.isRequired,draggablePercent:s.default.number.isRequired,in:s.default.bool,onExited:s.default.func,onOpen:s.default.func,onClose:s.default.func,type:s.default.oneOf((0,f.objectValues)(c.TYPE)),className:s.default.oneOfType([s.default.string,s.default.object]),bodyClassName:s.default.oneOfType([s.default.string,s.default.object]),progressClassName:s.default.oneOfType([s.default.string,s.default.object]),updateId:s.default.number,ariaLabel:s.default.string},v.defaultProps={type:c.TYPE.DEFAULT,in:!0,onOpen:y,onClose:y,className:null,bodyClassName:null,progressClassName:null,updateId:null,role:"alert"},t.default=v},function(e,t,n){"use strict";t.__esModule=!0,t.getChildMapping=function(e,t){var n=Object.create(null);e&&o.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&(0,o.isValidElement)(e)?t(e):e}(e)});return n},t.mergeChildMappings=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var o=Object.create(null),r=[];for(var a in e)a in t?r.length&&(o[a]=r,r=[]):r.push(a);var i=void 0,s={};for(var u in t){if(o[u])for(i=0;i<o[u].length;i++){var l=o[u][i];s[o[u][i]]=n(l)}s[u]=n(u)}for(i=0;i<r.length;i++)s[r[i]]=n(r[i]);return s};var o=n(0)},function(e,t,n){"use strict";t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=u(n(1)),a=n(0),i=u(a),s=n(15);function u(e){return e&&e.__esModule?e:{default:e}}var l=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},c=(r.default.any,r.default.node,r.default.bool,r.default.bool,r.default.bool,r.default.func,function(e){function t(n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o));return r.state={children:(0,s.getChildMapping)(n.children,function(e){return(0,a.cloneElement)(e,{onExited:r.handleExited.bind(r,e),in:!0,appear:r.getProp(e,"appear"),enter:r.getProp(e,"enter"),exit:r.getProp(e,"exit")})})},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getChildContext=function(){return{transitionGroup:{isMounting:!this.appeared}}},t.prototype.getProp=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props;return null!=n[t]?n[t]:e.props[t]},t.prototype.componentDidMount=function(){this.appeared=!0},t.prototype.componentWillReceiveProps=function(e){var t=this,n=this.state.children,o=(0,s.getChildMapping)(e.children),r=(0,s.mergeChildMappings)(n,o);Object.keys(r).forEach(function(i){var s=r[i];if((0,a.isValidElement)(s)){var u=i in n,l=i in o,c=n[i],f=(0,a.isValidElement)(c)&&!c.props.in;!l||u&&!f?l||!u||f?l&&u&&(0,a.isValidElement)(c)&&(r[i]=(0,a.cloneElement)(s,{onExited:t.handleExited.bind(t,s),in:c.props.in,exit:t.getProp(s,"exit",e),enter:t.getProp(s,"enter",e)})):r[i]=(0,a.cloneElement)(s,{in:!1}):r[i]=(0,a.cloneElement)(s,{onExited:t.handleExited.bind(t,s),in:!0,exit:t.getProp(s,"exit",e),enter:t.getProp(s,"enter",e)})}}),this.setState({children:r})},t.prototype.handleExited=function(e,t){var n=(0,s.getChildMapping)(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.setState(function(t){var n=o({},t.children);return delete n[e.key],{children:n}}))},t.prototype.render=function(){var e=this.props,t=e.component,n=e.childFactory,o=function(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(e,["component","childFactory"]),r=l(this.state.children).map(n);return delete o.appear,delete o.enter,delete o.exit,null===t?r:i.default.createElement(t,o,r)},t}(i.default.Component));c.childContextTypes={transitionGroup:r.default.object.isRequired},c.propTypes={},c.defaultProps={component:"div",childFactory:function(e){return e}},t.default=c,e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=n(0),s=g(i),u=g(n(1)),l=g(n(3)),c=g(n(16)),f=g(n(14)),p=g(n(12)),d=n(6),h=n(2),y=g(n(4)),v=n(7);function g(e){return e&&e.__esModule?e:{default:e}}function m(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function b(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var E=function(e){function t(){var e,n,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,a=Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=o=b(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),o.state={toast:[],isDocumentHidden:!1},o.collection={},o.isToastActive=function(e){return-1!==o.state.toast.indexOf(parseInt(e,10))},b(o,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.Component),a(t,[{key:"componentDidMount",value:function(){var e=this,t=h.ACTION.SHOW,n=h.ACTION.CLEAR,o=h.ACTION.MOUNTED;y.default.on(t,function(t,n){return e.show(t,n)}).on(n,function(t){return null!==t?e.removeToast(t):e.clear()}).emit(o,this)}},{key:"componentWillUnmount",value:function(){y.default.off(h.ACTION.SHOW),y.default.off(h.ACTION.CLEAR)}},{key:"removeToast",value:function(e){this.setState({toast:this.state.toast.filter(function(t){return t!==parseInt(e,10)})},this.dispatchChange)}},{key:"dispatchChange",value:function(){y.default.emit(h.ACTION.ON_CHANGE,this.state.toast.length)}},{key:"makeCloseButton",value:function(e,t,n){var o=this,r=this.props.closeButton;return((0,i.isValidElement)(e)||!1===e)&&(r=e),!1!==r&&(0,i.cloneElement)(r,{closeToast:function(){return o.removeToast(t)},type:n})}},{key:"getAutoCloseDelay",value:function(e){return!1===e||(0,v.isValidDelay)(e)?e:this.props.autoClose}},{key:"canBeRendered",value:function(e){return(0,i.isValidElement)(e)||"string"==typeof e||"number"==typeof e||"function"==typeof e}},{key:"parseClassName",value:function(e){return"string"==typeof e?e:null!==e&&"object"===(void 0===e?"undefined":r(e))&&"toString"in e?e.toString():null}},{key:"show",value:function(e,t){var n=this;if(!this.canBeRendered(e))throw new Error("The element you provided cannot be rendered. You provided an element of type "+(void 0===e?"undefined":r(e)));var a,s,u,l=t.toastId,c=function(){return n.removeToast(l)},f={id:l,type:t.type,closeToast:c,updateId:t.updateId,rtl:this.props.rtl,position:t.position||this.props.position,transition:t.transition||this.props.transition,className:this.parseClassName(t.className||this.props.toastClassName),bodyClassName:this.parseClassName(t.bodyClassName||this.props.bodyClassName),closeButton:this.makeCloseButton(t.closeButton,l,t.type),pauseOnHover:null!==t.pauseOnHover?t.pauseOnHover:this.props.pauseOnHover,draggable:null!==t.draggable?t.draggable:this.props.draggable,draggablePercent:null!==t.draggable?t.draggablePercent:this.props.draggablePercent,closeOnClick:null!==t.closeOnClick?t.closeOnClick:this.props.closeOnClick,progressClassName:this.parseClassName(t.progressClassName||this.props.progressClassName),autoClose:this.getAutoCloseDelay(!1!==t.autoClose?parseInt(t.autoClose,10):t.autoClose),hideProgressBar:"boolean"==typeof t.hideProgressBar?t.hideProgressBar:this.props.hideProgressBar};"function"==typeof t.onOpen&&(f.onOpen=t.onOpen),"function"==typeof t.onClose&&(f.onClose=t.onClose),(0,i.isValidElement)(e)&&"string"!=typeof e.type&&"number"!=typeof e.type?e=(0,i.cloneElement)(e,{closeToast:c}):"function"==typeof e&&(e=e({closeToast:c})),this.collection=o({},this.collection,(a={},s=l,u={position:f.position,options:f,content:e},s in a?Object.defineProperty(a,s,{value:u,enumerable:!0,configurable:!0,writable:!0}):a[s]=u,a)),this.setState({toast:null!==f.updateId?[].concat(m(this.state.toast)):[].concat(m(this.state.toast),[l])},this.dispatchChange)}},{key:"makeToast",value:function(e,t){return s.default.createElement(f.default,o({},t,{isDocumentHidden:this.state.isDocumentHidden,key:"toast-"+t.id}),e)}},{key:"clear",value:function(){this.setState({toast:[]})}},{key:"renderToast",value:function(){var e=this,t={},n=this.props,r=n.className,a=n.style;return(n.newestOnTop?Object.keys(this.collection).reverse():Object.keys(this.collection)).forEach(function(n){var o=e.collection[n];t[o.position]||(t[o.position]=[]),-1!==e.state.toast.indexOf(parseInt(n,10))?t[o.position].push(e.makeToast(o.content,o.options)):(t[o.position].push(null),delete e.collection[n])}),Object.keys(t).map(function(n){var i=1===t[n].length&&null===t[n][0],u={className:(0,l.default)("Toastify__toast-container","Toastify__toast-container--"+n,{"Toastify__toast-container--rtl":e.props.rtl},e.parseClassName(r)),style:i?o({},a,{pointerEvents:"none"}):o({},a)};return s.default.createElement(c.default,o({},u,{key:"container-"+n}),t[n])})}},{key:"render",value:function(){return s.default.createElement("div",{className:"Toastify"},this.renderToast())}}]),t}();E.propTypes={position:u.default.oneOf((0,v.objectValues)(h.POSITION)),autoClose:v.falseOrDelay,closeButton:v.falseOrElement,hideProgressBar:u.default.bool,pauseOnHover:u.default.bool,closeOnClick:u.default.bool,newestOnTop:u.default.bool,className:u.default.oneOfType([u.default.string,u.default.object]),style:u.default.object,toastClassName:u.default.oneOfType([u.default.string,u.default.object]),bodyClassName:u.default.oneOfType([u.default.string,u.default.object]),progressClassName:u.default.oneOfType([u.default.string,u.default.object]),transition:u.default.func,rtl:u.default.bool,draggable:u.default.bool,draggablePercent:u.default.number,pauseOnVisibilityChange:u.default.bool},E.defaultProps={position:h.POSITION.TOP_RIGHT,transition:d.Bounce,rtl:!1,pauseOnVisibilityChange:!0,autoClose:5e3,hideProgressBar:!1,closeButton:s.default.createElement(p.default,null),pauseOnHover:!0,closeOnClick:!0,newestOnTop:!1,draggable:!0,draggablePercent:80,className:null,style:null,toastClassName:null,bodyClassName:null,progressClassName:null},t.default=E},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Flip=t.Zoom=t.Slide=t.Bounce=t.cssTransition=t.toast=t.ToastContainer=void 0;var o=s(n(17)),r=n(6),a=s(n(8)),i=s(n(5));function s(e){return e&&e.__esModule?e:{default:e}}t.ToastContainer=o.default,t.toast=a.default,t.cssTransition=i.default,t.Bounce=r.Bounce,t.Slide=r.Slide,t.Zoom=r.Zoom,t.Flip=r.Flip}])});
!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)&&o.length){var a=r.apply(null,o);a&&e.push(a)}else if("object"===i)for(var s in o)n.call(o,s)&&o[s]&&e.push(s)}}return e.join(" ")}void 0!==e&&e.exports?(r.default=r,e.exports=r):void 0===(o=function(){return r}.apply(t,[]))||(e.exports=o)}()},function(e,t,n){"use strict";function o(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!==e&&void 0!==e&&this.setState(e)}function r(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!==n&&void 0!==n?n:null}.bind(this))}function i(e,t){try{var n=this.props,o=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,o)}finally{this.props=n,this.state=o}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,s=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?s="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(s="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==s){var u=e.displayName||e.name,l="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+u+" uses "+l+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==s?"\n "+s:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=o,t.componentWillReceiveProps=r),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var c=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var o=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;c.call(this,e,t,o)}}return e}n.r(t),n.d(t,"polyfill",function(){return a}),o.__suppressDeprecationWarning=!0,r.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.falseOrElement=t.falseOrDelay=void 0,t.isValidDelay=r,t.objectValues=function(e){return Object.keys(e).map(function(t){return e[t]})};var o=n(0);function r(e){return"number"==typeof e&&!isNaN(e)&&e>0}function i(e){return e.isRequired=function(t,n,o){if(void 0===t[n])return new Error("The prop "+n+" is marked as required in \n "+o+", but its value is undefined.");e(t,n,o)},e}t.falseOrDelay=i(function(e,t,n){var o=e[t];return!1===o||r(o)?null:new Error(n+" expect "+t+" \n to be a valid Number > 0 or equal to false. "+o+" given.")}),t.falseOrElement=i(function(e,t,n){var r=e[t];return!1===r||(0,o.isValidElement)(r)?null:new Error(n+" expect "+t+" \n to be a valid react element or equal to false. "+r+" given.")})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Flip=t.Zoom=t.Slide=t.Bounce=void 0;var o=function(e){return e&&e.__esModule?e:{default:e}}(n(7));var r=(0,o.default)({enter:"Toastify__bounce-enter",exit:"Toastify__bounce-exit",appendPosition:!0}),i=(0,o.default)({enter:"Toastify__slide-enter",exit:"Toastify__slide-exit",duration:[450,750],appendPosition:!0}),a=(0,o.default)({enter:"Toastify__zoom-enter",exit:"Toastify__zoom-exit"}),s=(0,o.default)({enter:"Toastify__flip-enter",exit:"Toastify__flip-exit"});t.Bounce=r,t.Slide=i,t.Zoom=a,t.Flip=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],o=!0,r=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(o=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);o=!0);}catch(e){r=!0,i=e}finally{try{!o&&s.return&&s.return()}finally{if(r)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.default=function(e){var t=e.enter,n=e.exit,s=e.duration,l=void 0===s?750:s,c=e.appendPosition,f=void 0!==c&&c;return function(e){var s=e.children,c=e.position,p=e.preventExitTransition,d=function(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(e,["children","position","preventExitTransition"]),h=f?t+"--"+c:t,y=f?n+"--"+c:n,v=void 0,m=void 0;if(Array.isArray(l)&&2===l.length){var b=r(l,2);v=b[0],m=b[1]}else v=m=l;return i.default.createElement(a.default,o({},d,{timeout:p?0:{enter:v,exit:m},onEnter:function(e){e.classList.add(h),e.style.animationFillMode="forwards",e.style.animationDuration=.001*v+"s"},onEntered:function(e){e.classList.remove(h),e.style.cssText=""},onExit:p?u:function(e){e.classList.add(y),e.style.animationFillMode="forwards",e.style.animationDuration=.001*m+"s"}}),s)}};var i=s(n(0)),a=s(n(16));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(){}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o={list:new Map,on:function(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.list.delete(e),this},emit:function(e){for(var t=this,n=arguments.length,o=Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];if(!this.list.has(e))return!1;var i=function(e){setTimeout(function(){return e.call.apply(e,[t].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(o)))},0)},a=!0,s=!1,u=void 0;try{for(var l,c=this.list.get(e)[Symbol.iterator]();!(a=(l=c.next()).done);a=!0){i(l.value)}}catch(e){s=!0,u=e}finally{try{!a&&c.return&&c.return()}finally{if(s)throw u}}return!0}};t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Flip=t.Zoom=t.Slide=t.Bounce=t.cssTransition=t.toast=t.ToastContainer=void 0;var o=s(n(10)),r=n(6),i=s(n(19)),a=s(n(7));function s(e){return e&&e.__esModule?e:{default:e}}t.ToastContainer=o.default,t.toast=i.default,t.cssTransition=a.default,t.Bounce=r.Bounce,t.Slide=r.Slide,t.Zoom=r.Zoom,t.Flip=r.Flip},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),a=n(0),s=m(a),u=m(n(1)),l=m(n(3)),c=m(n(11)),f=m(n(13)),p=m(n(15)),d=n(6),h=n(2),y=m(n(8)),v=n(5);function m(e){return e&&e.__esModule?e:{default:e}}function b(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function g(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var E=function(e){function t(){var e,n,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=o=g(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),o.state={toast:[]},o.collection={},o.isToastActive=function(e){return-1!==o.state.toast.indexOf(parseInt(e,10))},g(o,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,a.Component),i(t,[{key:"componentDidMount",value:function(){var e=this;y.default.on(h.ACTION.SHOW,function(t,n){return e.show(t,n)}).on(h.ACTION.CLEAR,function(t){return null!==t?e.removeToast(t):e.clear()}).emit(h.ACTION.DID_MOUNT,this)}},{key:"componentWillUnmount",value:function(){y.default.off(h.ACTION.SHOW).off(h.ACTION.CLEAR).emit(h.ACTION.WILL_UNMOUNT)}},{key:"removeToast",value:function(e){this.setState({toast:this.state.toast.filter(function(t){return t!==parseInt(e,10)})},this.dispatchChange)}},{key:"dispatchChange",value:function(){y.default.emit(h.ACTION.ON_CHANGE,this.state.toast.length)}},{key:"makeCloseButton",value:function(e,t,n){var o=this,r=this.props.closeButton;return((0,a.isValidElement)(e)||!1===e)&&(r=e),!1!==r&&(0,a.cloneElement)(r,{closeToast:function(){return o.removeToast(t)},type:n})}},{key:"getAutoCloseDelay",value:function(e){return!1===e||(0,v.isValidDelay)(e)?e:this.props.autoClose}},{key:"canBeRendered",value:function(e){return(0,a.isValidElement)(e)||"string"==typeof e||"number"==typeof e||"function"==typeof e}},{key:"parseClassName",value:function(e){return"string"==typeof e?e:null!==e&&"object"===(void 0===e?"undefined":r(e))&&"toString"in e?e.toString():null}},{key:"show",value:function(e,t){var n=this;if(!this.canBeRendered(e))throw new Error("The element you provided cannot be rendered. You provided an element of type "+(void 0===e?"undefined":r(e)));var i=t.toastId,s=function(){return n.removeToast(i)},u={id:i,type:t.type,closeToast:s,updateId:t.updateId,rtl:this.props.rtl,position:t.position||this.props.position,transition:t.transition||this.props.transition,className:this.parseClassName(t.className||this.props.toastClassName),bodyClassName:this.parseClassName(t.bodyClassName||this.props.bodyClassName),closeButton:this.makeCloseButton(t.closeButton,i,t.type),pauseOnHover:"boolean"==typeof t.pauseOnHover?t.pauseOnHover:this.props.pauseOnHover,pauseOnFocusLoss:"boolean"==typeof t.pauseOnFocusLoss?t.pauseOnFocusLoss:this.props.pauseOnFocusLoss,draggable:"boolean"==typeof t.draggable?t.draggable:this.props.draggable,draggablePercent:"number"!=typeof t.draggablePercent||isNaN(t.draggablePercent)?this.props.draggablePercent:t.draggablePercent,closeOnClick:"boolean"==typeof t.closeOnClick?t.closeOnClick:this.props.closeOnClick,progressClassName:this.parseClassName(t.progressClassName||this.props.progressClassName),autoClose:this.getAutoCloseDelay(t.autoClose),hideProgressBar:"boolean"==typeof t.hideProgressBar?t.hideProgressBar:this.props.hideProgressBar};"function"==typeof t.onOpen&&(u.onOpen=t.onOpen),"function"==typeof t.onClose&&(u.onClose=t.onClose),(0,a.isValidElement)(e)&&"string"!=typeof e.type&&"number"!=typeof e.type?e=(0,a.cloneElement)(e,{closeToast:s}):"function"==typeof e&&(e=e({closeToast:s})),this.collection=o({},this.collection,function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},i,{position:u.position,options:u,content:e})),this.setState({toast:u.updateId?[].concat(b(this.state.toast)):[].concat(b(this.state.toast),[i])},this.dispatchChange)}},{key:"makeToast",value:function(e,t){return s.default.createElement(f.default,o({},t,{isDocumentHidden:this.state.isDocumentHidden,key:"toast-"+t.id}),e)}},{key:"clear",value:function(){this.setState({toast:[]})}},{key:"renderToast",value:function(){var e=this,t={},n=this.props,r=n.className,i=n.style,a=n.newestOnTop?Object.keys(this.collection).reverse():Object.keys(this.collection),u=!0,f=!1,p=void 0;try{for(var d,h=a[Symbol.iterator]();!(u=(d=h.next()).done);u=!0){var y=d.value,v=this.collection[y];t[v.position]||(t[v.position]=[]),-1!==this.state.toast.indexOf(parseInt(y,10))?t[v.position].push(this.makeToast(v.content,v.options)):(t[v.position].push(null),delete this.collection[y])}}catch(e){f=!0,p=e}finally{try{!u&&h.return&&h.return()}finally{if(f)throw p}}return Object.keys(t).map(function(n){var a=1===t[n].length&&null===t[n][0],u={className:(0,l.default)("Toastify__toast-container","Toastify__toast-container--"+n,{"Toastify__toast-container--rtl":e.props.rtl},e.parseClassName(r)),style:a?o({},i,{pointerEvents:"none"}):o({},i)};return s.default.createElement(c.default,o({},u,{key:"container-"+n}),t[n])})}},{key:"render",value:function(){return s.default.createElement("div",{className:"Toastify"},this.renderToast())}}]),t}();E.propTypes={position:u.default.oneOf((0,v.objectValues)(h.POSITION)),autoClose:v.falseOrDelay,closeButton:v.falseOrElement,hideProgressBar:u.default.bool,pauseOnHover:u.default.bool,closeOnClick:u.default.bool,newestOnTop:u.default.bool,className:u.default.oneOfType([u.default.string,u.default.object]),style:u.default.object,toastClassName:u.default.oneOfType([u.default.string,u.default.object]),bodyClassName:u.default.oneOfType([u.default.string,u.default.object]),progressClassName:u.default.oneOfType([u.default.string,u.default.object]),transition:u.default.func,rtl:u.default.bool,draggable:u.default.bool,draggablePercent:u.default.number,pauseOnFocusLoss:u.default.bool},E.defaultProps={position:h.POSITION.TOP_RIGHT,transition:d.Bounce,rtl:!1,autoClose:5e3,hideProgressBar:!1,closeButton:s.default.createElement(p.default,null),pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,newestOnTop:!1,draggable:!0,draggablePercent:80,className:null,style:null,toastClassName:null,bodyClassName:null,progressClassName:null},t.default=E},function(e,t,n){"use strict";t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=u(n(1)),i=u(n(0)),a=n(4),s=n(12);function u(e){return e&&e.__esModule?e:{default:e}}var l=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},c=(r.default.any,r.default.node,r.default.bool,r.default.bool,r.default.bool,r.default.func,function(e){function t(n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o)),i=r.handleExited.bind(r);return r.state={handleExited:i,firstRender:!0},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getChildContext=function(){return{transitionGroup:{isMounting:!this.appeared}}},t.prototype.componentDidMount=function(){this.appeared=!0},t.getDerivedStateFromProps=function(e,t){var n=t.children,o=t.handleExited;return{children:t.firstRender?(0,s.getInitialChildMapping)(e,o):(0,s.getNextChildMapping)(e,n,o),firstRender:!1}},t.prototype.handleExited=function(e,t){var n=(0,s.getChildMapping)(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.setState(function(t){var n=o({},t.children);return delete n[e.key],{children:n}}))},t.prototype.render=function(){var e=this.props,t=e.component,n=e.childFactory,o=function(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(e,["component","childFactory"]),r=l(this.state.children).map(n);return delete o.appear,delete o.enter,delete o.exit,null===t?r:i.default.createElement(t,o,r)},t}(i.default.Component));c.childContextTypes={transitionGroup:r.default.object.isRequired},c.propTypes={},c.defaultProps={component:"div",childFactory:function(e){return e}},t.default=(0,a.polyfill)(c),e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.getChildMapping=r,t.mergeChildMappings=i,t.getInitialChildMapping=function(e,t){return r(e.children,function(n){return(0,o.cloneElement)(n,{onExited:t.bind(null,n),in:!0,appear:a(n,"appear",e),enter:a(n,"enter",e),exit:a(n,"exit",e)})})},t.getNextChildMapping=function(e,t,n){var s=r(e.children),u=i(t,s);return Object.keys(u).forEach(function(r){var i=u[r];if((0,o.isValidElement)(i)){var l=r in t,c=r in s,f=t[r],p=(0,o.isValidElement)(f)&&!f.props.in;!c||l&&!p?c||!l||p?c&&l&&(0,o.isValidElement)(f)&&(u[r]=(0,o.cloneElement)(i,{onExited:n.bind(null,i),in:f.props.in,exit:a(i,"exit",e),enter:a(i,"enter",e)})):u[r]=(0,o.cloneElement)(i,{in:!1}):u[r]=(0,o.cloneElement)(i,{onExited:n.bind(null,i),in:!0,exit:a(i,"exit",e),enter:a(i,"enter",e)})}}),u};var o=n(0);function r(e,t){var n=Object.create(null);return e&&o.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&(0,o.isValidElement)(e)?t(e):e}(e)}),n}function i(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var o=Object.create(null),r=[];for(var i in e)i in t?r.length&&(o[i]=r,r=[]):r.push(i);var a=void 0,s={};for(var u in t){if(o[u])for(a=0;a<o[u].length;a++){var l=o[u][a];s[o[u][a]]=n(l)}s[u]=n(u)}for(a=0;a<r.length;a++)s[r[a]]=n(r[a]);return s}function a(e,t,n){return null!=n[t]?n[t]:e.props[t]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),i=n(0),a=p(i),s=p(n(1)),u=p(n(3)),l=p(n(14)),c=n(2),f=n(5);function p(e){return e&&e.__esModule?e:{default:e}}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function h(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}var y=function(){},v=function(e){function t(){var e,n,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return n=o=d(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),o.state={isRunning:!0,preventExitTransition:!1},o.flag={canCloseOnClick:!0,canDrag:!1},o.drag={start:0,x:0,y:0,deltaX:0,removalDistance:0},o.ref=null,o.pauseToast=function(){o.props.autoClose&&o.setState({isRunning:!1})},o.playToast=function(){o.props.autoClose&&o.setState({isRunning:!0})},o.onDragStart=function(e){o.flag.canCloseOnClick=!0,o.flag.canDrag=!0,o.ref.style.transition="",o.drag.start=o.drag.x=h(e.nativeEvent),o.drag.removalDistance=o.ref.offsetWidth*(o.props.draggablePercent/100)},o.onDragMove=function(e){o.flag.canDrag&&(o.state.isRunning&&o.pauseToast(),o.drag.x=h(e),o.drag.deltaX=o.drag.x-o.drag.start,o.drag.start!==o.drag.x&&(o.flag.canCloseOnClick=!1),o.ref.style.transform="translateX("+o.drag.deltaX+"px)",o.ref.style.opacity=1-Math.abs(o.drag.deltaX/o.drag.removalDistance))},o.onDragEnd=function(e){if(o.flag.canDrag){if(o.flag.canDrag=!1,Math.abs(o.drag.deltaX)>o.drag.removalDistance)return void o.setState({preventExitTransition:!0},o.props.closeToast);o.drag.y=function(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}(e),o.ref.style.transition="transform 0.2s, opacity 0.2s",o.ref.style.transform="translateX(0)",o.ref.style.opacity=1}},o.onDragTransitionEnd=function(){var e=o.ref.getBoundingClientRect(),t=e.top,n=e.bottom,r=e.left,i=e.right;o.props.pauseOnHover&&o.drag.x>=r&&o.drag.x<=i&&o.drag.y>=t&&o.drag.y<=n?o.pauseToast():o.playToast()},d(o,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.Component),r(t,[{key:"componentDidMount",value:function(){this.props.onOpen(this.props.children.props),this.props.draggable&&this.bindDragEvents(),this.props.pauseOnFocusLoss&&this.bindFocusEvents()}},{key:"componentDidUpdate",value:function(e){e.draggable!==this.props.draggable&&(this.props.draggable?this.bindDragEvents():this.unbindDragEvents()),e.pauseOnFocusLoss!==this.props.pauseOnFocusLoss&&(this.props.pauseOnFocusLoss?this.bindFocusEvents():this.unbindFocusEvents())}},{key:"componentWillUnmount",value:function(){this.props.onClose(this.props.children.props),this.props.draggable&&this.unbindDragEvents(),this.props.pauseOnFocusLoss&&this.unbindFocusEvents()}},{key:"bindFocusEvents",value:function(){window.addEventListener("focus",this.playToast),window.addEventListener("blur",this.pauseToast)}},{key:"unbindFocusEvents",value:function(){window.removeEventListener("focus",this.playToast),window.removeEventListener("blur",this.pauseToast)}},{key:"bindDragEvents",value:function(){document.addEventListener("mousemove",this.onDragMove),document.addEventListener("mouseup",this.onDragEnd),document.addEventListener("touchmove",this.onDragMove),document.addEventListener("touchend",this.onDragEnd)}},{key:"unbindDragEvents",value:function(){document.removeEventListener("mousemove",this.onDragMove),document.removeEventListener("mouseup",this.onDragEnd),document.removeEventListener("touchmove",this.onDragMove),document.removeEventListener("touchend",this.onDragEnd)}},{key:"render",value:function(){var e=this,t=this.props,n=t.closeButton,r=t.children,i=t.autoClose,s=t.pauseOnHover,c=t.closeOnClick,f=t.type,p=t.hideProgressBar,d=t.closeToast,h=t.transition,y=t.position,v=t.onExited,m=t.className,b=t.bodyClassName,g=t.progressClassName,E=t.updateId,O=t.role,T=t.rtl,_={className:(0,u.default)("Toastify__toast","Toastify__toast--"+f,{"Toastify__toast--rtl":T},m)};return i&&s&&(_.onMouseEnter=this.pauseToast,_.onMouseLeave=this.playToast),c&&(_.onClick=function(){return e.flag.canCloseOnClick&&d()}),a.default.createElement(h,{in:this.props.in,appear:!0,unmountOnExit:!0,onExited:v,position:y,preventExitTransition:this.state.preventExitTransition},a.default.createElement("div",o({},_,{ref:function(t){return e.ref=t},onMouseDown:this.onDragStart,onTouchStart:this.onDragStart,onTransitionEnd:this.onDragTransitionEnd}),a.default.createElement("div",o({},this.props.in&&{role:O},{className:(0,u.default)("Toastify__toast-body",b)}),r),n&&n,i&&a.default.createElement(l.default,o({},E?{key:"pb-"+E}:{},{rtl:T,delay:i,isRunning:this.state.isRunning,closeToast:d,hide:p,type:f,className:g}))))}}]),t}();v.propTypes={closeButton:f.falseOrElement.isRequired,autoClose:f.falseOrDelay.isRequired,children:s.default.node.isRequired,closeToast:s.default.func.isRequired,position:s.default.oneOf((0,f.objectValues)(c.POSITION)).isRequired,pauseOnHover:s.default.bool.isRequired,pauseOnFocusLoss:s.default.bool.isRequired,closeOnClick:s.default.bool.isRequired,transition:s.default.func.isRequired,rtl:s.default.bool.isRequired,hideProgressBar:s.default.bool.isRequired,draggable:s.default.bool.isRequired,draggablePercent:s.default.number.isRequired,in:s.default.bool,onExited:s.default.func,onOpen:s.default.func,onClose:s.default.func,type:s.default.oneOf((0,f.objectValues)(c.TYPE)),className:s.default.oneOfType([s.default.string,s.default.object]),bodyClassName:s.default.oneOfType([s.default.string,s.default.object]),progressClassName:s.default.oneOfType([s.default.string,s.default.object]),updateId:s.default.number,ariaLabel:s.default.string},v.defaultProps={type:c.TYPE.DEFAULT,in:!0,onOpen:y,onClose:y,className:null,bodyClassName:null,progressClassName:null,updateId:null,role:"alert"},t.default=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=s(n(0)),r=s(n(1)),i=s(n(3)),a=n(2);function s(e){return e&&e.__esModule?e:{default:e}}function u(e){var t=e.delay,n=e.isRunning,r=e.closeToast,a=e.type,s=e.hide,u=e.className,l=e.rtl,c={animationDuration:t+"ms",animationPlayState:n?"running":"paused",opacity:s?0:1},f=(0,i.default)("Toastify__progress-bar","Toastify__progress-bar--"+a,{"Toastify__progress-bar--rtl":l},u);return o.default.createElement("div",{className:f,style:c,onAnimationEnd:r})}u.propTypes={delay:r.default.number.isRequired,isRunning:r.default.bool.isRequired,closeToast:r.default.func.isRequired,rtl:r.default.bool.isRequired,type:r.default.string,hide:r.default.bool,className:r.default.oneOfType([r.default.string,r.default.object])},u.defaultProps={type:a.TYPE.DEFAULT,hide:!1},t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(0)),r=i(n(1));function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=e.closeToast,n=e.type,r=e.ariaLabel;return o.default.createElement("button",{className:"Toastify__close-button Toastify__close-button--"+n,type:"button",onClick:t,"aria-label":r},"✖")}a.propTypes={closeToast:r.default.func,arialLabel:r.default.string},a.defaultProps={ariaLabel:"close"},t.default=a},function(e,t,n){"use strict";t.__esModule=!0,t.EXITING=t.ENTERED=t.ENTERING=t.EXITED=t.UNMOUNTED=void 0;var o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(1)),r=s(n(0)),i=s(n(17)),a=n(4);n(18);function s(e){return e&&e.__esModule?e:{default:e}}var u=t.UNMOUNTED="unmounted",l=t.EXITED="exited",c=t.ENTERING="entering",f=t.ENTERED="entered",p=t.EXITING="exiting",d=function(e){function t(n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o)),i=o.transitionGroup,a=i&&!i.isMounting?n.enter:n.appear,s=void 0;return r.appearStatus=null,n.in?a?(s=l,r.appearStatus=c):s=f:s=n.unmountOnExit||n.mountOnEnter?u:l,r.state={status:s},r.nextCallback=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getChildContext=function(){return{transitionGroup:null}},t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===u?{status:l}:null},t.prototype.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.prototype.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==c&&n!==f&&(t=c):n!==c&&n!==f||(t=p)}this.updateStatus(!1,t)},t.prototype.componentWillUnmount=function(){this.cancelNextCallback()},t.prototype.getTimeouts=function(){var e=this.props.timeout,t=void 0,n=void 0,o=void 0;return t=n=o=e,null!=e&&"number"!=typeof e&&(t=e.exit,n=e.enter,o=e.appear),{exit:t,enter:n,appear:o}},t.prototype.updateStatus=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments[1];if(null!==t){this.cancelNextCallback();var n=i.default.findDOMNode(this);t===c?this.performEnter(n,e):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===l&&this.setState({status:u})},t.prototype.performEnter=function(e,t){var n=this,o=this.props.enter,r=this.context.transitionGroup?this.context.transitionGroup.isMounting:t,i=this.getTimeouts();t||o?(this.props.onEnter(e,r),this.safeSetState({status:c},function(){n.props.onEntering(e,r),n.onTransitionEnd(e,i.enter,function(){n.safeSetState({status:f},function(){n.props.onEntered(e,r)})})})):this.safeSetState({status:f},function(){n.props.onEntered(e)})},t.prototype.performExit=function(e){var t=this,n=this.props.exit,o=this.getTimeouts();n?(this.props.onExit(e),this.safeSetState({status:p},function(){t.props.onExiting(e),t.onTransitionEnd(e,o.exit,function(){t.safeSetState({status:l},function(){t.props.onExited(e)})})})):this.safeSetState({status:l},function(){t.props.onExited(e)})},t.prototype.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},t.prototype.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},t.prototype.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(o){n&&(n=!1,t.nextCallback=null,e(o))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},t.prototype.onTransitionEnd=function(e,t,n){this.setNextCallback(n),e?(this.props.addEndListener&&this.props.addEndListener(e,this.nextCallback),null!=t&&setTimeout(this.nextCallback,t)):setTimeout(this.nextCallback,0)},t.prototype.render=function(){var e=this.state.status;if(e===u)return null;var t=this.props,n=t.children,o=function(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}(t,["children"]);if(delete o.in,delete o.mountOnEnter,delete o.unmountOnExit,delete o.appear,delete o.enter,delete o.exit,delete o.timeout,delete o.addEndListener,delete o.onEnter,delete o.onEntering,delete o.onEntered,delete o.onExit,delete o.onExiting,delete o.onExited,"function"==typeof n)return n(e,o);var i=r.default.Children.only(n);return r.default.cloneElement(i,o)},t}(r.default.Component);function h(){}d.contextTypes={transitionGroup:o.object},d.childContextTypes={transitionGroup:function(){}},d.propTypes={},d.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:h,onEntering:h,onEntered:h,onExit:h,onExiting:h,onExited:h},d.UNMOUNTED=0,d.EXITED=1,d.ENTERING=2,d.ENTERED=3,d.EXITING=4,t.default=(0,a.polyfill)(d)},function(e,t){e.exports=n},function(e,t,n){"use strict";t.__esModule=!0,t.classNamesShape=t.timeoutsShape=void 0,t.transitionTimeout=function(e){var t="transition"+e+"Timeout",n="transition"+e;return function(e){if(e[n]){if(null==e[t])return new Error(t+" wasn't supplied to CSSTransitionGroup: this can cause unreliable animations and won't be supported in a future version of React. See https://fb.me/react-animation-transition-group-timeout for more information.");if("number"!=typeof e[t])return new Error(t+" must be a number (in milliseconds)")}return null}};var o=function(e){return e&&e.__esModule?e:{default:e}}(n(1));t.timeoutsShape=o.default.oneOfType([o.default.number,o.default.shape({enter:o.default.number,exit:o.default.number}).isRequired]),t.classNamesShape=o.default.oneOfType([o.default.string,o.default.shape({enter:o.default.string,exit:o.default.string,active:o.default.string}),o.default.shape({enter:o.default.string,enterDone:o.default.string,enterActive:o.default.string,exit:o.default.string,exitDone:o.default.string,exitActive:o.default.string})])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=function(e){return e&&e.__esModule?e:{default:e}}(n(8)),i=n(2);var a=null,s=[],u=0,l=function(){return!1};function c(e,t){return o({},e,{type:t,toastId:++u})}function f(e,t){return null!==a?r.default.emit(i.ACTION.SHOW,e,t):s.push({action:i.ACTION.SHOW,content:e,options:t}),t.toastId}var p=o(function(e,t){return f(e,c(t,t&&t.type||i.TYPE.DEFAULT))},{success:function(e,t){return f(e,c(t,i.TYPE.SUCCESS))},info:function(e,t){return f(e,c(t,i.TYPE.INFO))},warn:function(e,t){return f(e,c(t,i.TYPE.WARNING))},warning:function(e,t){return f(e,c(t,i.TYPE.WARNING))},error:function(e,t){return f(e,c(t,i.TYPE.ERROR))},dismiss:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return a&&r.default.emit(i.ACTION.CLEAR,e)},isActive:l,update:function(e,t){setTimeout(function(){if(a&&void 0!==a.collection[e]){var n=a.collection[e],r=n.options,i=n.content,s=r.updateId?r.updateId+1:1,u=o({},r,t,{toastId:e,updateId:s}),l=void 0!==u.render?u.render:i;delete u.render,f(l,u)}},0)},onChange:function(e){"function"==typeof e&&r.default.on(i.ACTION.ON_CHANGE,e)},POSITION:i.POSITION,TYPE:i.TYPE});r.default.on(i.ACTION.DID_MOUNT,function(e){a=e,p.isActive=function(e){return a.isToastActive(e)};var t=!0,n=!1,o=void 0;try{for(var i,u=s[Symbol.iterator]();!(t=(i=u.next()).done);t=!0){var l=i.value;r.default.emit(l.action,l.content,l.options)}}catch(e){n=!0,o=e}finally{try{!t&&u.return&&u.return()}finally{if(n)throw o}}s=[]}).on(i.ACTION.WILL_UNMOUNT,function(){a=null,p.isActive=l,u=0}),t.default=p}])});
//# sourceMappingURL=ReactToastify.js.map

@@ -5,2 +5,4 @@ import * as React from 'react';

type ToastPosition = 'top-right' | 'top-center' | 'top-left' | 'bottom-right' | 'bottom-center' | 'bottom-left';
type ToastContent = React.ReactNode | { (): void };

@@ -41,2 +43,8 @@

/**
* Pause the toast when the window loose focus.
* `Default: true`
*/
pauseOnFocusLoss?: boolean;
/**
* Remove the toast when clicked.

@@ -59,3 +67,3 @@ * `Default: true`

*/
position?: string;
position?: ToastPosition;

@@ -155,9 +163,2 @@ /**

rtl?: boolean;
/**
* ⚠️ NOT WORKING ATM, has been disabled until I fix it ⚠️
* Pause toast's timer on document visibility change
* `Default: true`
*/
pauseOnVisibilityChange?: boolean;
}

@@ -164,0 +165,0 @@

@@ -76,5 +76,9 @@ 'use strict';

}, _this.ref = null, _this.pauseToast = function () {
_this.setState({ isRunning: false });
if (_this.props.autoClose) {
_this.setState({ isRunning: false });
}
}, _this.playToast = function () {
_this.setState({ isRunning: true });
if (_this.props.autoClose) {
_this.setState({ isRunning: true });
}
}, _this.onDragStart = function (e) {

@@ -138,7 +142,57 @@ _this.flag.canCloseOnClick = true;

this.props.onOpen(this.props.children.props);
if (this.props.draggable) {
this.bindDragEvents();
}
// Maybe I could bind the event in the ToastContainer and rely on delegation
if (this.props.pauseOnFocusLoss) {
this.bindFocusEvents();
}
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(prevProps) {
if (prevProps.draggable !== this.props.draggable) {
if (this.props.draggable) {
this.bindDragEvents();
} else {
this.unbindDragEvents();
}
}
if (prevProps.pauseOnFocusLoss !== this.props.pauseOnFocusLoss) {
if (this.props.pauseOnFocusLoss) {
this.bindFocusEvents();
} else {
this.unbindFocusEvents();
}
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.props.onClose(this.props.children.props);
if (this.props.draggable) {
this.unbindDragEvents();
}
if (this.props.pauseOnFocusLoss) {
this.unbindFocusEvents();
}
}
}, {
key: 'bindFocusEvents',
value: function bindFocusEvents() {
window.addEventListener('focus', this.playToast);
window.addEventListener('blur', this.pauseToast);
}
}, {
key: 'unbindFocusEvents',
value: function unbindFocusEvents() {
window.removeEventListener('focus', this.playToast);
window.removeEventListener('blur', this.pauseToast);
}
}, {
key: 'bindDragEvents',

@@ -162,17 +216,2 @@ value: function bindDragEvents() {

}, {
key: 'componentDidUpdate',
value: function componentDidUpdate(prevProps) {
if (prevProps.draggable !== this.props.draggable) {
this.props.draggable ? this.bindDragEvents() : this.unbindDragEvents();
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.props.onClose(this.props.children.props);
if (this.props.draggable) {
this.unbindDragEvents();
}
}
}, {
key: 'render',

@@ -247,4 +286,4 @@ value: function render() {

),
closeButton !== false && closeButton,
autoClose !== false && _react2.default.createElement(_ProgressBar2.default, _extends({}, updateId ? { key: 'pb-' + updateId } : {}, {
closeButton && closeButton,
autoClose && _react2.default.createElement(_ProgressBar2.default, _extends({}, updateId ? { key: 'pb-' + updateId } : {}, {
rtl: rtl,

@@ -273,5 +312,5 @@ delay: autoClose,

pauseOnHover: _propTypes2.default.bool.isRequired,
pauseOnFocusLoss: _propTypes2.default.bool.isRequired,
closeOnClick: _propTypes2.default.bool.isRequired,
transition: _propTypes2.default.func.isRequired,
isDocumentHidden: _propTypes2.default.bool.isRequired,
rtl: _propTypes2.default.bool.isRequired,

@@ -278,0 +317,0 @@ hideProgressBar: _propTypes2.default.bool.isRequired,

@@ -41,5 +41,5 @@ 'use strict';

var _EventManager = require('./../utils/EventManager');
var _eventManager = require('./../utils/eventManager');
var _EventManager2 = _interopRequireDefault(_EventManager);
var _eventManager2 = _interopRequireDefault(_eventManager);

@@ -75,4 +75,3 @@ var _propValidator = require('./../utils/propValidator');

return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ToastContainer.__proto__ || Object.getPrototypeOf(ToastContainer)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
toast: [],
isDocumentHidden: false
toast: []
}, _this.collection = {}, _this.isToastActive = function (id) {

@@ -102,14 +101,7 @@ return _this.state.toast.indexOf(parseInt(id, 10)) !== -1;

var SHOW = _constant.ACTION.SHOW,
CLEAR = _constant.ACTION.CLEAR,
MOUNTED = _constant.ACTION.MOUNTED;
_EventManager2.default.on(SHOW, function (content, options) {
_eventManager2.default.on(_constant.ACTION.SHOW, function (content, options) {
return _this2.show(content, options);
}).on(CLEAR, function (id) {
}).on(_constant.ACTION.CLEAR, function (id) {
return id !== null ? _this2.removeToast(id) : _this2.clear();
}).emit(MOUNTED, this);
//this.props.pauseOnVisibilityChange &&
// document.addEventListener('visibilitychange', this.isDocumentHidden);
}).emit(_constant.ACTION.DID_MOUNT, this);
}

@@ -119,11 +111,4 @@ }, {

value: function componentWillUnmount() {
_EventManager2.default.off(_constant.ACTION.SHOW);
_EventManager2.default.off(_constant.ACTION.CLEAR);
// this.props.pauseOnVisibilityChange &&
// document.removeEventListener('visibilitychange', this.isDocumentHidden);
_eventManager2.default.off(_constant.ACTION.SHOW).off(_constant.ACTION.CLEAR).emit(_constant.ACTION.WILL_UNMOUNT);
}
//isDocumentHidden = () => this.setState({ isDocumentHidden: document.hidden });
}, {

@@ -141,3 +126,3 @@ key: 'removeToast',

value: function dispatchChange() {
_EventManager2.default.emit(_constant.ACTION.ON_CHANGE, this.state.toast.length);
_eventManager2.default.emit(_constant.ACTION.ON_CHANGE, this.state.toast.length);
}

@@ -206,8 +191,9 @@ }, {

closeButton: this.makeCloseButton(options.closeButton, toastId, options.type),
pauseOnHover: options.pauseOnHover !== null ? options.pauseOnHover : this.props.pauseOnHover,
draggable: options.draggable !== null ? options.draggable : this.props.draggable,
draggablePercent: options.draggable !== null ? options.draggablePercent : this.props.draggablePercent,
closeOnClick: options.closeOnClick !== null ? options.closeOnClick : this.props.closeOnClick,
pauseOnHover: typeof options.pauseOnHover === 'boolean' ? options.pauseOnHover : this.props.pauseOnHover,
pauseOnFocusLoss: typeof options.pauseOnFocusLoss === 'boolean' ? options.pauseOnFocusLoss : this.props.pauseOnFocusLoss,
draggable: typeof options.draggable === 'boolean' ? options.draggable : this.props.draggable,
draggablePercent: typeof options.draggablePercent === 'number' && !isNaN(options.draggablePercent) ? options.draggablePercent : this.props.draggablePercent,
closeOnClick: typeof options.closeOnClick === 'boolean' ? options.closeOnClick : this.props.closeOnClick,
progressClassName: this.parseClassName(options.progressClassName || this.props.progressClassName),
autoClose: this.getAutoCloseDelay(options.autoClose !== false ? parseInt(options.autoClose, 10) : options.autoClose),
autoClose: this.getAutoCloseDelay(options.autoClose),
hideProgressBar: typeof options.hideProgressBar === 'boolean' ? options.hideProgressBar : this.props.hideProgressBar

@@ -236,3 +222,3 @@ };

this.setState({
toast: toastOptions.updateId !== null ? [].concat(_toConsumableArray(this.state.toast)) : [].concat(_toConsumableArray(this.state.toast), [toastId])
toast: toastOptions.updateId ? [].concat(_toConsumableArray(this.state.toast)) : [].concat(_toConsumableArray(this.state.toast), [toastId])
}, this.dispatchChange);

@@ -271,13 +257,34 @@ }

// group toast by position
collection.forEach(function (toastId) {
var toast = _this5.collection[toastId];
toastToRender[toast.position] || (toastToRender[toast.position] = []);
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
if (_this5.state.toast.indexOf(parseInt(toastId, 10)) !== -1) {
toastToRender[toast.position].push(_this5.makeToast(toast.content, toast.options));
} else {
toastToRender[toast.position].push(null);
delete _this5.collection[toastId];
try {
for (var _iterator = collection[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var toastId = _step.value;
var toast = this.collection[toastId];
toastToRender[toast.position] || (toastToRender[toast.position] = []);
if (this.state.toast.indexOf(parseInt(toastId, 10)) !== -1) {
toastToRender[toast.position].push(this.makeToast(toast.content, toast.options));
} else {
toastToRender[toast.position].push(null);
delete this.collection[toastId];
}
}
});
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}

@@ -394,6 +401,5 @@ return Object.keys(toastToRender).map(function (position) {

/**
* ⚠️ NOT WORKING ATM, has been disabled until I fix it ⚠️
* pause on document visibility change
* Pause the toast on focus loss
*/
pauseOnVisibilityChange: _propTypes2.default.bool
pauseOnFocusLoss: _propTypes2.default.bool
};

@@ -404,3 +410,2 @@ ToastContainer.defaultProps = {

rtl: false,
pauseOnVisibilityChange: true,
autoClose: 5000,

@@ -410,2 +415,3 @@ hideProgressBar: false,

pauseOnHover: true,
pauseOnFocusLoss: true,
closeOnClick: true,

@@ -412,0 +418,0 @@ newestOnTop: false,

@@ -14,5 +14,5 @@ 'use strict';

var _toaster = require('./toaster');
var _toast = require('./toast');
var _toaster2 = _interopRequireDefault(_toaster);
var _toast2 = _interopRequireDefault(_toast);

@@ -26,3 +26,3 @@ var _cssTransition = require('./utils/cssTransition');

exports.ToastContainer = _ToastContainer2.default;
exports.toast = _toaster2.default;
exports.toast = _toast2.default;
exports.cssTransition = _cssTransition2.default;

@@ -29,0 +29,0 @@ exports.Bounce = _Transitions.Bounce;

@@ -23,6 +23,7 @@ 'use strict';

var ACTION = exports.ACTION = {
SHOW: 'SHOW_TOAST',
CLEAR: 'CLEAR_TOAST',
MOUNTED: 'CONTAINER_MOUNTED',
ON_CHANGE: 'ON_CHANGE'
SHOW: 0,
CLEAR: 1,
DID_MOUNT: 2,
WILL_UNMOUNT: 3,
ON_CHANGE: 4
};
{
"name": "react-toastify",
"version": "4.1.0",
"version": "4.2.0",
"description": "React notification made easy",

@@ -51,5 +51,5 @@ "keywords": [

"dependencies": {
"classnames": "^2.2.5",
"classnames": "^2.2.6",
"prop-types": "^15.6.0",
"react-transition-group": "^2.2.1"
"react-transition-group": "^2.4.0"
},

@@ -56,0 +56,0 @@ "jest": {

@@ -8,47 +8,49 @@ # React Toastify [![Build Status](https://travis-ci.org/fkhadra/react-toastify.svg?branch=master)](https://travis-ci.org/fkhadra/react-toastify) [![npm](https://img.shields.io/npm/dm/react-toastify.svg)]() [![npm](https://img.shields.io/npm/v/react-toastify.svg)]() [![license](https://img.shields.io/github/license/fkhadra/react-toastify.svg?maxAge=2592000)]() [![Coverage Status](https://coveralls.io/repos/github/fkhadra/react-toastify/badge.svg?branch=master)](https://coveralls.io/github/fkhadra/react-toastify?branch=master)

* [Demo](#demo)
* [Installation](#installation)
* [Features](#features)
* [Migrate from v3 to v4](#from-v3-to-v4)
* [Usage](#usage)
+ [One component to rule them all](#one-component-to-rule-them-all)
+ [Positioning toast](#positioning-toast)
+ [Set autoclose delay or disable it](#set-autoclose-delay-or-disable-it)
+ [Render a component](#render-a-component)
+ [Remove a toast programmatically](#remove-a-toast-programmatically)
+ [Prevent duplicate](#prevent-duplicate)
+ [Update a toast](#update-a-toast)
- [Basic example](#basic-example)
- [Update the content](#update-the-content)
- [Apply a transition](#apply-a-transition)
- [Reset option or inherit from ToastContainer](#reset-option-or-inherit-from-toastcontainer)
+ [Define callback](#define-callback)
+ [Listen for change](#listen-for-change)
+ [Set a custom close button or simply remove it](#set-a-custom-close-button-or-simply-remove-it)
- [Override the default one](#override-the-default-one)
- [Define it per toast](#define-it-per-toast)
- [Remove it](#remove-it)
+ [Add an undo option to a toast like google drive](#add-an-undo-option-to-a-toast-like-google-drive)
+ [Replace the default transition](#replace-the-default-transition)
+ [Define a custom enter and exit transition](#define-a-custom-enter-and-exit-transition)
- [Ease your life with the cssTransition helper](#ease-your-life-with-the-csstransition-helper)
* [Handle transition based on the toast position](#handle-transition-based-on-the-toast-position)
- [Create a transition from scratch](#create-a-transition-from-scratch)
+ [Swipe to remove](#swipe-to-remove)
- [Define the width percentage to remove the toast](#define-the-width-percentage-to-remove-the-toast)
- [Disable it](#disable-it)
+ [Le style](#le-style)
- [style with css classes](#style-with-css-classes)
- [style with glamor](#style-with-glamor)
- [Define style globally](#define-style-globally)
- [Right to left support](#right-to-left-support)
+ [Mobile](#mobile)
* [Api](#api)
+ [ToastContainer](#toastcontainer)
+ [toast](#toast)
+ [cssTransition](#csstransition)
* [Browser Support](#browser-support)
* [Release Notes](#release-notes)
* [Contribute](#contribute)
* [License](#license)
- [Demo](#demo)
- [Installation](#installation)
- [Features](#features)
- [From v3 to v4](#from-v3-to-v4)
- [Usage](#usage)
- [One component to rule them all](#one-component-to-rule-them-all)
- [Positioning toast](#positioning-toast)
- [Set autoclose delay or disable it](#set-autoclose-delay-or-disable-it)
- [Render a component](#render-a-component)
- [Remove a toast programmatically](#remove-a-toast-programmatically)
- [Pause toast timer when the window loses focus](#pause-toast-timer-when-the-window-loses-focus)
- [Prevent duplicate](#prevent-duplicate)
- [Update a toast](#update-a-toast)
- [Basic example](#basic-example)
- [Update the content](#update-the-content)
- [Apply a transition](#apply-a-transition)
- [Reset option or inherit from ToastContainer](#reset-option-or-inherit-from-toastcontainer)
- [Define callback](#define-callback)
- [Listen for change](#listen-for-change)
- [Set a custom close button or simply remove it](#set-a-custom-close-button-or-simply-remove-it)
- [Override the default one](#override-the-default-one)
- [Define it per toast](#define-it-per-toast)
- [Remove it](#remove-it)
- [Add an undo option to a toast like google drive](#add-an-undo-option-to-a-toast-like-google-drive)
- [Replace the default transition](#replace-the-default-transition)
- [Define a custom enter and exit transition](#define-a-custom-enter-and-exit-transition)
- [Ease your life with the cssTransition helper](#ease-your-life-with-the-csstransition-helper)
- [Different duration for enter and exit](#different-duration-for-enter-and-exit)
- [Handle transition based on the toast position](#handle-transition-based-on-the-toast-position)
- [Create a transition from scratch](#create-a-transition-from-scratch)
- [Swipe to remove](#swipe-to-remove)
- [Define the width percentage to remove the toast](#define-the-width-percentage-to-remove-the-toast)
- [Disable it](#disable-it)
- [Le style](#le-style)
- [style with css classes](#style-with-css-classes)
- [style with glamor](#style-with-glamor)
- [Define style globally](#define-style-globally)
- [Right to left support](#right-to-left-support)
- [Mobile](#mobile)
- [Api](#api)
- [ToastContainer](#toastcontainer)
- [toast](#toast)
- [cssTransition](#csstransition)
- [Browser Support](#browser-support)
- [Release Notes](#release-notes)
- [Contribute](#contribute)
- [License](#license)

@@ -76,3 +78,3 @@ ## Demo

- Define behavior per toast
- ~~Pause toast when the browser is not visible thanks to visibility API~~ Need to fix it
- Pause toast when window loose focus 👁
- Fancy progress bar to display the remaining time

@@ -89,3 +91,3 @@ - Possibility to update a toast

- Playground for contributor
- You may use glamorous or any other css-in-js library that relies on glamor. (Haven't been tested)
- You may use glamorous or any other css-in-js library that relies on glamor. (Haven't been fully tested)

@@ -111,3 +113,3 @@ ## Usage

<div>
<button onClick={this.notify}>Notify !</button>
<button onClick={this.notify}>Notify !</button>
<ToastContainer />

@@ -279,2 +281,16 @@ </div>

### Pause toast timer when the window loses focus
The default behavior is to pause the toast timer whenever the window loses focus. You can opt-out by setting the `pauseOnFocusLoss` props to false:
```js
// Opt-out for all toast
<ToastContainer pauseOnFocusLoss={false} />
// Opt-out per toast
toast('Hello', {
pauseOnFocusLoss: false
})
```
### Prevent duplicate

@@ -344,3 +360,3 @@

toast.update(this.toastId, {
render: "New content"
render: "New content",
type: toast.TYPE.INFO,

@@ -972,2 +988,3 @@ autoClose: 5000

| pauseOnHover | bool | true | Keep the timer running or not on hover |
| pauseOnFocusLoss | bool | true | Pause the timer when the window loses focus |
| rtl | bool | false | Support right to left content |

@@ -1007,2 +1024,3 @@ | closeOnClick | bool | true | Dismiss toast on click |

- `pauseOnHover`: same as ToastContainer
- `pauseOnFocusLoss`: same as ToastContainer
- `className`: same as ToastContainer toastClassName

@@ -1082,253 +1100,7 @@ - `bodyClassName`: same as ToastContainer

### V4.1.0
You can find the release note for the latest release [here](https://github.com/fkhadra/react-toastify/releases/latest)
- Draggable prop can be updated, more details [here](https://github.com/fkhadra/react-toastify/issues/192)
- Fix issue when passing glamor className. [More details](https://github.com/fkhadra/react-toastify/issues/191)
- `pauseOnVisibility` has been disabled until I found a fix. The api is too much unstable 💩.
### V4.0.0
You can browse them all [here](https://github.com/fkhadra/react-toastify/releases)
- Switch back to css
- Added built-in transition
- Added playground for contributor
- Upgrade to webpack 4
- Draggable 👌
### V3.4.3
- Fix position on mobile
### V3.4.2
- Fix exit animation bug
### V3.4.1
- Fix rtl on mobile
### V3.4.0
- Add `rtl` props to support right to left content.
### V3.3.5
- Add `fontFamily` to typescript definition
### V3.3.4
- `toast.update` run now at the end of the call stack. For more details, check [issue #135](https://github.com/fkhadra/react-toastify/issues/135)
### V3.3.3
- Clean animation on entered. This was preventing any update transition to works.
### V3.3.1
- Fix height [issue #124](https://github.com/fkhadra/react-toastify/issues/124)
- Update typescript definition
### V3.3.0
- Better accessibility, relate to [issue #121](https://github.com/fkhadra/react-toastify/issues/121)
- Reviewed exit animation. No more clipping.
### V3.2.2
- Add comment to typescript definition.
### V3.2.1
- Fix typescript definition. Relate to [issue #110](https://github.com/fkhadra/react-toastify/issues/110)
### V3.2.0
- Allow "render props" rendering. Relate to [issue #106](https://github.com/fkhadra/react-toastify/issues/106)
- Can set fontFamily via the style helper. Relate to [issue #107](https://github.com/fkhadra/react-toastify/issues/107)
- Can override position default values via style helper. Realte to [issue #108](https://github.com/fkhadra/react-toastify/issues/108)
### V3.1.2
- Fix [issue #103](https://github.com/fkhadra/react-toastify/issues/103) for real...
- Fix [issue #104](https://github.com/fkhadra/react-toastify/issues/104) Incorrect TS definition for `toast.dismiss`
### V3.1.1
- Fix [issue #103](https://github.com/fkhadra/react-toastify/issues/103)
### V3.1.0
- Add ability to update an existing toast
- Allow to define the zIndex via the style helper
- Get rid of all inline style
### V3.0.0
- Switched to styled component with glamor
- Added style helper to replace sass variables
- Test suite improved
- Typescript definition improved
### V2.2.1
- Fix [issue #71](https://github.com/fkhadra/react-toastify/issues/71)
### V2.2.0
- Sass variables are now namespaced
### V2.1.7
- Can now use [sass variable default](http://sass-lang.com/documentation/file.SASS_REFERENCE.html#Variable_Defaults___default) thanks to [vikpe](https://github.com/vikpe)
### V2.1.5
- Test suites improved
### V2.1.4
- Fix broken typescript dependencies
### V2.1.3
- Added typescript definition
- Toast will pause when page is not visible thanks to page visibility api.
### V2.1.2
- Previous version was breaking compatibility with react < 16
### V2.1.1
#### Bugfix
- Remove toast from react dom when not displayed. Because of that the `onClose` callback on the toast was never called. Relate to [issue #50](https://github.com/fkhadra/react-toastify/issues/50)
### V2.1.0
#### New Features
- Can set a custom transition when the toat enter and exit the screen :sparkles:
#### Others
- Upgrade to react v16
- Upgrade to enzyme v3
- Switched to react-app preset for eslint
- Upgrade to webpack v3
- Upgrade to react-transition-group v2
### V2.0.0
This version may introduce breaking changes due to redesign. My apologies.
But, it brings a lots of new and exciting features !
#### New Features
- The default design has been reviewed. The component is now usable out of the box without the need to touch the css. Relate to [issue #28](https://github.com/fkhadra/react-toastify/issues/28)
- The toast timer can keep running on hover. [issue #33](https://github.com/fkhadra/react-toastify/issues/33)
- Added a possibility to check if a given toast is displayed or not. By using that method we can prevent duplicate. [issue #3](https://github.com/fkhadra/react-toastify/issues/3)
- Can decide to close the toast on click
- Can show newest toast on top
- Can define additionnal className for toast[issue #21](https://github.com/fkhadra/react-toastify/issues/21)
- Much more mobile ready than the past
#### Bug Fixes
- The space in of left boxes from window & right boxes from window is different.[issue #25](https://github.com/fkhadra/react-toastify/issues/25)
- Partial support of ie11. I still need to fix the animation but I need a computer with ie11 for that xD [issue #26](https://github.com/fkhadra/react-toastify/issues/26)
### v1.7.0
#### New Features
- Toast can now be positioned individually !
### v1.6.0
#### New Features
- Can now remove a toast programmatically. When you display a toast, the function return a **toastId**. You can use it
as follow to remove a given toast `toast.dismiss(toastId)`
- If the container is not mounted, the notification will be added to a queue and dispatched as soon as the container is mounted.
For more details check [issue #4](https://github.com/fkhadra/react-toastify/issues/4)
#### Others
- Added --no-idents flag to cssnano to avoid animation name collision with others libs.
- Tests are no longer transpiled
### v1.5.0
- That version does not bring any features but it brings tests made with the amazing jest and aslo Travis CI integration.
### v1.4.3
- React and react-dom are now peer dependencies
### v1.4.2
- Don't try to pass down the props when we render a string like so : `toast(<div>hello</div>)`
#### Bug fix
- Fixed the test to check if the toast can be rendered
### v1.4.0
- React v16 ready : moving to prop-types and react-transition-group
- Internal rewrite of components. The implementation wasn't bad but it wasn't good either. A better props validation has been added has well.
- Removed useless dependencies. I was using the Object.values polyfill when a one line forEach can do the same is my case.
- Now I believe it's even easier to style the components. The sass sources files are now included when you install the package via yarn or npm
- The default close button has been replaced.
#### New Features
- A progress bar is now visible to track the remaining time before the notification is closed. Of course if you don't like it, you are free to disable it.
- You can choose to display a close button or not.
- Event pointer is set to none to avoid losing pointer events on everything beneath the toast container when no toast are displayed
- The `closeToast` callback is also passed down to your component.
### v1.3.0
- PropTypes package update
- Dead code elimination
#### New Features
- Possibility to use a custom close button. Check the api docs of ToastContainer and toast.
### v1.2.2
I was storing react component into state which is a bad practice. [What should Go in State](http://web.archive.org/web/20150419023006/http://facebook.github.io/react/docs/interactivity-and-dynamic-uis.html)
This is no more the case now. The separation of concern between the data and the view is respected.
#### Bug fix
- Was calling cloneElement on undefined which cause your console bleed. See issue [#2](https://github.com/fkhadra/react-toastify/issues/2)
### v1.2.1
#### Bug fix
- Added Object.values polyfill otherwise won't work with IE or EDGE. I ♥ IE.
### v1.1.1
#### Bug fix
- OnClose and OnOpen can access all the props passed to the component. Before
only the props passed using toast options were accessible
#### New Features
- Passing prop using toast option will be removed at the next release. It doesn't
make sense to keep both way to pass props. Use the react way instead
### v1.1.0
#### New Features
- Added onOpen callback
- Added onClose callback
## Contribute

@@ -1335,0 +1107,0 @@

@@ -35,5 +35,5 @@ import React, { Component } from 'react';

pauseOnHover: PropTypes.bool.isRequired,
pauseOnFocusLoss: PropTypes.bool.isRequired,
closeOnClick: PropTypes.bool.isRequired,
transition: PropTypes.func.isRequired,
isDocumentHidden: PropTypes.bool.isRequired,
rtl: PropTypes.bool.isRequired,

@@ -92,7 +92,53 @@ hideProgressBar: PropTypes.bool.isRequired,

this.props.onOpen(this.props.children.props);
if (this.props.draggable) {
this.bindDragEvents();
}
// Maybe I could bind the event in the ToastContainer and rely on delegation
if (this.props.pauseOnFocusLoss) {
this.bindFocusEvents();
}
}
componentDidUpdate(prevProps) {
if (prevProps.draggable !== this.props.draggable) {
if (this.props.draggable) {
this.bindDragEvents();
} else {
this.unbindDragEvents();
}
}
if (prevProps.pauseOnFocusLoss !== this.props.pauseOnFocusLoss) {
if (this.props.pauseOnFocusLoss) {
this.bindFocusEvents();
} else {
this.unbindFocusEvents();
}
}
}
componentWillUnmount() {
this.props.onClose(this.props.children.props);
if (this.props.draggable) {
this.unbindDragEvents();
}
if (this.props.pauseOnFocusLoss) {
this.unbindFocusEvents();
}
}
bindFocusEvents() {
window.addEventListener('focus', this.playToast);
window.addEventListener('blur', this.pauseToast);
}
unbindFocusEvents() {
window.removeEventListener('focus', this.playToast);
window.removeEventListener('blur', this.pauseToast);
}
bindDragEvents() {

@@ -114,21 +160,12 @@ document.addEventListener('mousemove', this.onDragMove);

componentDidUpdate(prevProps) {
if (prevProps.draggable !== this.props.draggable) {
this.props.draggable ? this.bindDragEvents() : this.unbindDragEvents();
pauseToast = () => {
if (this.props.autoClose) {
this.setState({ isRunning: false });
}
}
componentWillUnmount() {
this.props.onClose(this.props.children.props);
if (this.props.draggable) {
this.unbindDragEvents();
}
}
pauseToast = () => {
this.setState({ isRunning: false });
};
playToast = () => {
this.setState({ isRunning: true });
if (this.props.autoClose) {
this.setState({ isRunning: true });
}
};

@@ -266,6 +303,6 @@

</div>
{closeButton !== false && closeButton}
{autoClose !== false && (
{closeButton && closeButton}
{autoClose && (
<ProgressBar
{...updateId ? { key: `pb-${updateId}` } : {}}
{...(updateId ? { key: `pb-${updateId}` } : {})}
rtl={rtl}

@@ -272,0 +309,0 @@ delay={autoClose}

@@ -10,3 +10,3 @@ import React, { Component, isValidElement, cloneElement } from 'react';

import { POSITION, ACTION } from './../utils/constant';
import EventManager from './../utils/EventManager';
import eventManager from './../utils/eventManager';
import {

@@ -105,6 +105,5 @@ falseOrDelay,

/**
* ⚠️ NOT WORKING ATM, has been disabled until I fix it ⚠️
* pause on document visibility change
* Pause the toast on focus loss
*/
pauseOnVisibilityChange: PropTypes.bool
pauseOnFocusLoss: PropTypes.bool
};

@@ -116,3 +115,2 @@

rtl: false,
pauseOnVisibilityChange: true,
autoClose: 5000,

@@ -122,2 +120,3 @@ hideProgressBar: false,

pauseOnHover: true,
pauseOnFocusLoss: true,
closeOnClick: true,

@@ -138,4 +137,3 @@ newestOnTop: false,

state = {
toast: [],
isDocumentHidden: false
toast: []
};

@@ -153,21 +151,18 @@

componentDidMount() {
const { SHOW, CLEAR, MOUNTED } = ACTION;
EventManager.on(SHOW, (content, options) => this.show(content, options))
.on(CLEAR, id => (id !== null ? this.removeToast(id) : this.clear()))
.emit(MOUNTED, this);
//this.props.pauseOnVisibilityChange &&
// document.addEventListener('visibilitychange', this.isDocumentHidden);
eventManager
.on(ACTION.SHOW, (content, options) => this.show(content, options))
.on(
ACTION.CLEAR,
id => (id !== null ? this.removeToast(id) : this.clear())
)
.emit(ACTION.DID_MOUNT, this);
}
componentWillUnmount() {
EventManager.off(ACTION.SHOW);
EventManager.off(ACTION.CLEAR);
// this.props.pauseOnVisibilityChange &&
// document.removeEventListener('visibilitychange', this.isDocumentHidden);
eventManager
.off(ACTION.SHOW)
.off(ACTION.CLEAR)
.emit(ACTION.WILL_UNMOUNT);
}
//isDocumentHidden = () => this.setState({ isDocumentHidden: document.hidden });
isToastActive = id => this.state.toast.indexOf(parseInt(id, 10)) !== -1;

@@ -185,3 +180,3 @@

dispatchChange() {
EventManager.emit(ACTION.ON_CHANGE, this.state.toast.length);
eventManager.emit(ACTION.ON_CHANGE, this.state.toast.length);
}

@@ -199,5 +194,5 @@

: cloneElement(closeButton, {
closeToast: () => this.removeToast(toastId),
type: type
});
closeToast: () => this.removeToast(toastId),
type: type
});
}

@@ -220,7 +215,11 @@

parseClassName(prop){
parseClassName(prop) {
if (typeof prop === 'string') {
return prop;
} else if(prop !== null && typeof prop === 'object' && 'toString' in prop) {
return prop.toString()
} else if (
prop !== null &&
typeof prop === 'object' &&
'toString' in prop
) {
return prop.toString();
}

@@ -247,4 +246,8 @@

transition: options.transition || this.props.transition,
className: this.parseClassName(options.className || this.props.toastClassName),
bodyClassName: this.parseClassName(options.bodyClassName || this.props.bodyClassName),
className: this.parseClassName(
options.className || this.props.toastClassName
),
bodyClassName: this.parseClassName(
options.bodyClassName || this.props.bodyClassName
),
closeButton: this.makeCloseButton(

@@ -256,22 +259,26 @@ options.closeButton,

pauseOnHover:
options.pauseOnHover !== null
typeof options.pauseOnHover === 'boolean'
? options.pauseOnHover
: this.props.pauseOnHover,
pauseOnFocusLoss:
typeof options.pauseOnFocusLoss === 'boolean'
? options.pauseOnFocusLoss
: this.props.pauseOnFocusLoss,
draggable:
options.draggable !== null ? options.draggable : this.props.draggable,
typeof options.draggable === 'boolean'
? options.draggable
: this.props.draggable,
draggablePercent:
options.draggable !== null
typeof options.draggablePercent === 'number' &&
!isNaN(options.draggablePercent)
? options.draggablePercent
: this.props.draggablePercent,
closeOnClick:
options.closeOnClick !== null
typeof options.closeOnClick === 'boolean'
? options.closeOnClick
: this.props.closeOnClick,
progressClassName:
this.parseClassName(options.progressClassName || this.props.progressClassName),
autoClose: this.getAutoCloseDelay(
options.autoClose !== false
? parseInt(options.autoClose, 10)
: options.autoClose
progressClassName: this.parseClassName(
options.progressClassName || this.props.progressClassName
),
autoClose: this.getAutoCloseDelay(options.autoClose),
hideProgressBar:

@@ -313,6 +320,5 @@ typeof options.hideProgressBar === 'boolean'

{
toast:
toastOptions.updateId !== null
? [...this.state.toast]
: [...this.state.toast, toastId]
toast: toastOptions.updateId
? [...this.state.toast]
: [...this.state.toast, toastId]
},

@@ -347,3 +353,3 @@ this.dispatchChange

// group toast by position
collection.forEach(toastId => {
for (const toastId of collection) {
const toast = this.collection[toastId];

@@ -360,3 +366,3 @@ toastToRender[toast.position] || (toastToRender[toast.position] = []);

}
});
}

@@ -363,0 +369,0 @@ return Object.keys(toastToRender).map(position => {

import ToastContainer from './components/ToastContainer';
import { Bounce, Slide, Zoom, Flip } from './components/Transitions';
import toaster from './toaster';
import toast from './toast';
import cssTransition from './utils/cssTransition';
export {
ToastContainer,
toaster as toast,
cssTransition,
Bounce,
Slide,
Zoom,
Flip
};
export { ToastContainer, toast, cssTransition, Bounce, Slide, Zoom, Flip };

@@ -18,6 +18,7 @@ export const POSITION = {

export const ACTION = {
SHOW: 'SHOW_TOAST',
CLEAR: 'CLEAR_TOAST',
MOUNTED: 'CONTAINER_MOUNTED',
ON_CHANGE: 'ON_CHANGE'
SHOW: 0,
CLEAR: 1,
DID_MOUNT: 2,
WILL_UNMOUNT: 3,
ON_CHANGE: 4
};

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc