{"ast":null,"code":"import _get from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/get\";\nimport _getPrototypeOf from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/inherits\";\nimport _createSuper from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/createSuper\";\nimport _classCallCheck from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/createClass\";\nimport { Subject } from '../Subject';\nimport { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';\nexport function retryWhen(notifier) {\n  return function (source) {\n    return source.lift(new RetryWhenOperator(notifier, source));\n  };\n}\n\nvar RetryWhenOperator = /*#__PURE__*/function () {\n  function RetryWhenOperator(notifier, source) {\n    _classCallCheck(this, RetryWhenOperator);\n\n    this.notifier = notifier;\n    this.source = source;\n  }\n\n  _createClass(RetryWhenOperator, [{\n    key: \"call\",\n    value: function call(subscriber, source) {\n      return source.subscribe(new RetryWhenSubscriber(subscriber, this.notifier, this.source));\n    }\n  }]);\n\n  return RetryWhenOperator;\n}();\n\nvar RetryWhenSubscriber = /*#__PURE__*/function (_SimpleOuterSubscribe) {\n  _inherits(RetryWhenSubscriber, _SimpleOuterSubscribe);\n\n  var _super = _createSuper(RetryWhenSubscriber);\n\n  function RetryWhenSubscriber(destination, notifier, source) {\n    var _this;\n\n    _classCallCheck(this, RetryWhenSubscriber);\n\n    _this = _super.call(this, destination);\n    _this.notifier = notifier;\n    _this.source = source;\n    return _this;\n  }\n\n  _createClass(RetryWhenSubscriber, [{\n    key: \"error\",\n    value: function error(err) {\n      if (!this.isStopped) {\n        var errors = this.errors;\n        var retries = this.retries;\n        var retriesSubscription = this.retriesSubscription;\n\n        if (!retries) {\n          errors = new Subject();\n\n          try {\n            var notifier = this.notifier;\n            retries = notifier(errors);\n          } catch (e) {\n            return _get(_getPrototypeOf(RetryWhenSubscriber.prototype), \"error\", this).call(this, e);\n          }\n\n          retriesSubscription = innerSubscribe(retries, new SimpleInnerSubscriber(this));\n        } else {\n          this.errors = undefined;\n          this.retriesSubscription = undefined;\n        }\n\n        this._unsubscribeAndRecycle();\n\n        this.errors = errors;\n        this.retries = retries;\n        this.retriesSubscription = retriesSubscription;\n        errors.next(err);\n      }\n    }\n  }, {\n    key: \"_unsubscribe\",\n    value: function _unsubscribe() {\n      var errors = this.errors,\n          retriesSubscription = this.retriesSubscription;\n\n      if (errors) {\n        errors.unsubscribe();\n        this.errors = undefined;\n      }\n\n      if (retriesSubscription) {\n        retriesSubscription.unsubscribe();\n        this.retriesSubscription = undefined;\n      }\n\n      this.retries = undefined;\n    }\n  }, {\n    key: \"notifyNext\",\n    value: function notifyNext() {\n      var _unsubscribe = this._unsubscribe;\n      this._unsubscribe = null;\n\n      this._unsubscribeAndRecycle();\n\n      this._unsubscribe = _unsubscribe;\n      this.source.subscribe(this);\n    }\n  }]);\n\n  return RetryWhenSubscriber;\n}(SimpleOuterSubscriber); //# sourceMappingURL=retryWhen.js.map","map":null,"metadata":{},"sourceType":"module"}