{"ast":null,"code":"import _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 _assertThisInitialized from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _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 { isFunction } from './util/isFunction';\nimport { empty as emptyObserver } from './Observer';\nimport { Subscription } from './Subscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\nimport { config } from './config';\nimport { hostReportError } from './util/hostReportError';\nexport var Subscriber = /*#__PURE__*/function (_Subscription) {\n  _inherits(Subscriber, _Subscription);\n\n  var _super = _createSuper(Subscriber);\n\n  function Subscriber(destinationOrNext, error, complete) {\n    var _this;\n\n    _classCallCheck(this, Subscriber);\n\n    _this = _super.call(this);\n    _this.syncErrorValue = null;\n    _this.syncErrorThrown = false;\n    _this.syncErrorThrowable = false;\n    _this.isStopped = false;\n\n    switch (arguments.length) {\n      case 0:\n        _this.destination = emptyObserver;\n        break;\n\n      case 1:\n        if (!destinationOrNext) {\n          _this.destination = emptyObserver;\n          break;\n        }\n\n        if (typeof destinationOrNext === 'object') {\n          if (destinationOrNext instanceof Subscriber) {\n            _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;\n            _this.destination = destinationOrNext;\n            destinationOrNext.add(_assertThisInitialized(_this));\n          } else {\n            _this.syncErrorThrowable = true;\n            _this.destination = new SafeSubscriber(_assertThisInitialized(_this), destinationOrNext);\n          }\n\n          break;\n        }\n\n      default:\n        _this.syncErrorThrowable = true;\n        _this.destination = new SafeSubscriber(_assertThisInitialized(_this), destinationOrNext, error, complete);\n        break;\n    }\n\n    return _this;\n  }\n\n  _createClass(Subscriber, [{\n    key: rxSubscriberSymbol,\n    value: function value() {\n      return this;\n    }\n  }, {\n    key: \"next\",\n    value: function next(value) {\n      if (!this.isStopped) {\n        this._next(value);\n      }\n    }\n  }, {\n    key: \"error\",\n    value: function error(err) {\n      if (!this.isStopped) {\n        this.isStopped = true;\n\n        this._error(err);\n      }\n    }\n  }, {\n    key: \"complete\",\n    value: function complete() {\n      if (!this.isStopped) {\n        this.isStopped = true;\n\n        this._complete();\n      }\n    }\n  }, {\n    key: \"unsubscribe\",\n    value: function unsubscribe() {\n      if (this.closed) {\n        return;\n      }\n\n      this.isStopped = true;\n\n      _get(_getPrototypeOf(Subscriber.prototype), \"unsubscribe\", this).call(this);\n    }\n  }, {\n    key: \"_next\",\n    value: function _next(value) {\n      this.destination.next(value);\n    }\n  }, {\n    key: \"_error\",\n    value: function _error(err) {\n      this.destination.error(err);\n      this.unsubscribe();\n    }\n  }, {\n    key: \"_complete\",\n    value: function _complete() {\n      this.destination.complete();\n      this.unsubscribe();\n    }\n  }, {\n    key: \"_unsubscribeAndRecycle\",\n    value: function _unsubscribeAndRecycle() {\n      var _parentOrParents = this._parentOrParents;\n      this._parentOrParents = null;\n      this.unsubscribe();\n      this.closed = false;\n      this.isStopped = false;\n      this._parentOrParents = _parentOrParents;\n      return this;\n    }\n  }], [{\n    key: \"create\",\n    value: function create(next, error, complete) {\n      var subscriber = new Subscriber(next, error, complete);\n      subscriber.syncErrorThrowable = false;\n      return subscriber;\n    }\n  }]);\n\n  return Subscriber;\n}(Subscription);\nexport var SafeSubscriber = /*#__PURE__*/function (_Subscriber) {\n  _inherits(SafeSubscriber, _Subscriber);\n\n  var _super2 = _createSuper(SafeSubscriber);\n\n  function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {\n    var _this2;\n\n    _classCallCheck(this, SafeSubscriber);\n\n    _this2 = _super2.call(this);\n    _this2._parentSubscriber = _parentSubscriber;\n    var next;\n\n    var context = _assertThisInitialized(_this2);\n\n    if (isFunction(observerOrNext)) {\n      next = observerOrNext;\n    } else if (observerOrNext) {\n      next = observerOrNext.next;\n      error = observerOrNext.error;\n      complete = observerOrNext.complete;\n\n      if (observerOrNext !== emptyObserver) {\n        context = Object.create(observerOrNext);\n\n        if (isFunction(context.unsubscribe)) {\n          _this2.add(context.unsubscribe.bind(context));\n        }\n\n        context.unsubscribe = _this2.unsubscribe.bind(_assertThisInitialized(_this2));\n      }\n    }\n\n    _this2._context = context;\n    _this2._next = next;\n    _this2._error = error;\n    _this2._complete = complete;\n    return _this2;\n  }\n\n  _createClass(SafeSubscriber, [{\n    key: \"next\",\n    value: function next(value) {\n      if (!this.isStopped && this._next) {\n        var _parentSubscriber = this._parentSubscriber;\n\n        if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n          this.__tryOrUnsub(this._next, value);\n        } else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {\n          this.unsubscribe();\n        }\n      }\n    }\n  }, {\n    key: \"error\",\n    value: function error(err) {\n      if (!this.isStopped) {\n        var _parentSubscriber = this._parentSubscriber;\n        var useDeprecatedSynchronousErrorHandling = config.useDeprecatedSynchronousErrorHandling;\n\n        if (this._error) {\n          if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n            this.__tryOrUnsub(this._error, err);\n\n            this.unsubscribe();\n          } else {\n            this.__tryOrSetError(_parentSubscriber, this._error, err);\n\n            this.unsubscribe();\n          }\n        } else if (!_parentSubscriber.syncErrorThrowable) {\n          this.unsubscribe();\n\n          if (useDeprecatedSynchronousErrorHandling) {\n            throw err;\n          }\n\n          hostReportError(err);\n        } else {\n          if (useDeprecatedSynchronousErrorHandling) {\n            _parentSubscriber.syncErrorValue = err;\n            _parentSubscriber.syncErrorThrown = true;\n          } else {\n            hostReportError(err);\n          }\n\n          this.unsubscribe();\n        }\n      }\n    }\n  }, {\n    key: \"complete\",\n    value: function complete() {\n      var _this3 = this;\n\n      if (!this.isStopped) {\n        var _parentSubscriber = this._parentSubscriber;\n\n        if (this._complete) {\n          var wrappedComplete = function wrappedComplete() {\n            return _this3._complete.call(_this3._context);\n          };\n\n          if (!config.useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {\n            this.__tryOrUnsub(wrappedComplete);\n\n            this.unsubscribe();\n          } else {\n            this.__tryOrSetError(_parentSubscriber, wrappedComplete);\n\n            this.unsubscribe();\n          }\n        } else {\n          this.unsubscribe();\n        }\n      }\n    }\n  }, {\n    key: \"__tryOrUnsub\",\n    value: function __tryOrUnsub(fn, value) {\n      try {\n        fn.call(this._context, value);\n      } catch (err) {\n        this.unsubscribe();\n\n        if (config.useDeprecatedSynchronousErrorHandling) {\n          throw err;\n        } else {\n          hostReportError(err);\n        }\n      }\n    }\n  }, {\n    key: \"__tryOrSetError\",\n    value: function __tryOrSetError(parent, fn, value) {\n      if (!config.useDeprecatedSynchronousErrorHandling) {\n        throw new Error('bad call');\n      }\n\n      try {\n        fn.call(this._context, value);\n      } catch (err) {\n        if (config.useDeprecatedSynchronousErrorHandling) {\n          parent.syncErrorValue = err;\n          parent.syncErrorThrown = true;\n          return true;\n        } else {\n          hostReportError(err);\n          return true;\n        }\n      }\n\n      return false;\n    }\n  }, {\n    key: \"_unsubscribe\",\n    value: function _unsubscribe() {\n      var _parentSubscriber = this._parentSubscriber;\n      this._context = null;\n      this._parentSubscriber = null;\n\n      _parentSubscriber.unsubscribe();\n    }\n  }]);\n\n  return SafeSubscriber;\n}(Subscriber); //# sourceMappingURL=Subscriber.js.map","map":null,"metadata":{},"sourceType":"module"}