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,GAChC,EAAgB,QAAQ,EAAa,KAAO,GAC9C,EAAO,SAAS,mBAAmB,EAAa,IAEpD,IAEA,EAAc,SAAQ,SAAU,GAC9B,EAAO,SAAS,gBAAgB,SAAS,CAAC,EAAG,EAAc,CACzD,SACE,WACE,EAAM,SAAS,QAAQ,KAAK,EAAa,MACzC,EAAa,UAAY,EAAa,UACxC,IAKN,KAGE,EAAU,gBAAkB,GAA0C,IAAzB,EAAc,QAC7D,KAAK,SAAS,oBAElB,GAID,CACD,IAAK,wBACL,MACE,SAA+B,GAC7B,OAAO,KAAK,QAAU,CACxB,GAID,CACD,IAAK,SACL,MACE,WACE,IAAI,EAAU,KAAK,MAGf,GAFgB,EAAQ,cAChB,EAAQ,MACT,yBAAyB,EAAS,CAAC,gBAAiB,WAE/D,OAAO,QAAiB,QAAE,cAAc,0BAAmC,QAAG,SAAS,CAAE,IAAK,KAAK,WAAa,GAClH,KAMG,CACT,CA5FoB,GA8FpB,cAAc,UAAY,CACxB,cAAe,YAAqB,QAAE,MACtC,MAAO,YAAqB,QAAE,MAAM,CAClC,SAAU,YAAqB,QAAE,KAAK,aACrC,YAGL,IAAI,yBAA2B,SAAkC,GAC/D,IAAI,EAAU,EAAM,SAAW,YAAY,kBAE3C,GAAe,MAAX,EACF,KAAM,mCAGR,OAAO,QAAiB,QAAE,cACxB,EAAQ,SACR,MACA,SAAU,GACR,IAAI,EAAQ,EAAW,MAEvB,OAAO,QAAiB,QAAE,cAAc,cAAe,SAAS,CAAE,MAAO,GAAS,GACpF,GAEJ,EAEA,yBAAyB,UAAY,CACnC,QAAS,YAAqB,QAAE,QAIlC,OAAO,KAAK,SAAS,SAAQ,SAAU,GACrC,yBAAyB,GAAO,QAAQ,EAC1C,IAEA,yBAAyB,QAAU,UAAmB,QAEtD,OAAO,QAAU","file":"/npm/react-notification-system-redux3@2.0.3/lib/notifications.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-notification-system-redux3@2.0.3/lib/notifications.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactRedux = require('react-redux');\n\nvar _actions = require('./actions');\n\nvar actions = _interopRequireWildcard(_actions);\n\nvar _reducer = require('./reducer');\n\nvar _reducer2 = _interopRequireDefault(_reducer);\n\nvar _reactNotificationSystem = require('react-notification-system');\n\nvar _reactNotificationSystem2 = _interopRequireDefault(_reactNotificationSystem);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Notifications = function (_React$Component) {\n  _inherits(Notifications, _React$Component);\n\n  function Notifications(props) {\n    _classCallCheck(this, Notifications);\n\n    var _this = _possibleConstructorReturn(this, (Notifications.__proto__ || Object.getPrototypeOf(Notifications)).call(this, props));\n\n    _this.notifyRef = _react2['default'].createRef();\n    return _this;\n  }\n\n  _createClass(Notifications, [{\n    key: 'system',\n    value: function () {\n      function system() {\n        return this.notifyRef.current;\n      }\n\n      return system;\n    }()\n  }, {\n    key: 'componentDidUpdate',\n    value: function () {\n      function componentDidUpdate(prevProps) {\n        var _this2 = this;\n\n        var _props = this.props,\n            notifications = _props.notifications,\n            store = _props.store;\n\n        var notificationIds = notifications.map(function (notification) {\n          return notification.uid;\n        });\n        var systemNotifications = this.system().state.notifications || [];\n\n        if (notifications.length > 0) {\n          // Get all active notifications from react-notification-system\n          /// and remove all where uid is not found in the reducer\n          systemNotifications.forEach(function (notification) {\n            if (notificationIds.indexOf(notification.uid) < 0) {\n              _this2.system().removeNotification(notification.uid);\n            }\n          });\n\n          notifications.forEach(function (notification) {\n            _this2.system().addNotification(_extends({}, notification, {\n              onRemove: function () {\n                function onRemove() {\n                  store.dispatch(actions.hide(notification.uid));\n                  notification.onRemove && notification.onRemove();\n                }\n\n                return onRemove;\n              }()\n            }));\n          });\n        }\n\n        if (prevProps.notifications !== notifications && notifications.length === 0) {\n          this.system().clearNotifications();\n        }\n      }\n\n      return componentDidUpdate;\n    }()\n  }, {\n    key: 'shouldComponentUpdate',\n    value: function () {\n      function shouldComponentUpdate(nextProps) {\n        return this.props !== nextProps;\n      }\n\n      return shouldComponentUpdate;\n    }()\n  }, {\n    key: 'render',\n    value: function () {\n      function render() {\n        var _props2 = this.props,\n            notifications = _props2.notifications,\n            store = _props2.store,\n            rest = _objectWithoutProperties(_props2, ['notifications', 'store']);\n\n        return _react2['default'].createElement(_reactNotificationSystem2['default'], _extends({ ref: this.notifyRef }, rest));\n      }\n\n      return render;\n    }()\n  }]);\n\n  return Notifications;\n}(_react2['default'].Component);\n\nNotifications.propTypes = {\n  notifications: _propTypes2['default'].array,\n  store: _propTypes2['default'].shape({\n    dispatch: _propTypes2['default'].func.isRequired\n  }).isRequired\n};\n\nvar NotificationsWithContext = function NotificationsWithContext(props) {\n  var Context = props.context || _reactRedux.ReactReduxContext;\n\n  if (Context == null) {\n    throw 'Please upgrade to react-redux v6';\n  }\n\n  return _react2['default'].createElement(\n    Context.Consumer,\n    null,\n    function (otherProps) {\n      var store = otherProps.store;\n\n      return _react2['default'].createElement(Notifications, _extends({ store: store }, props));\n    }\n  );\n};\n\nNotificationsWithContext.propTypes = {\n  context: _propTypes2['default'].object\n};\n\n// Tie actions to Notifications component instance\nObject.keys(actions).forEach(function (key) {\n  NotificationsWithContext[key] = actions[key];\n});\n\nNotificationsWithContext.reducer = _reducer2['default'];\n\nmodule.exports = NotificationsWithContext;"]}