{"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 _createClass from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/createClass\";\nimport _classCallCheck from \"C:/Users/kgamal/Downloads/HijriGregorianDatepicker-master/HijriGregorianDatepicker-master/node_modules/@babel/runtime/helpers/esm/classCallCheck\";\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 { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { SubjectSubscription } from './SubjectSubscription';\nimport { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';\nexport var SubjectSubscriber = /*#__PURE__*/function (_Subscriber) {\n  _inherits(SubjectSubscriber, _Subscriber);\n\n  var _super = _createSuper(SubjectSubscriber);\n\n  function SubjectSubscriber(destination) {\n    var _this;\n\n    _classCallCheck(this, SubjectSubscriber);\n\n    _this = _super.call(this, destination);\n    _this.destination = destination;\n    return _this;\n  }\n\n  return _createClass(SubjectSubscriber);\n}(Subscriber);\nexport var Subject = /*@__PURE__*/function () {\n  var Subject = /*#__PURE__*/function (_Observable) {\n    _inherits(Subject, _Observable);\n\n    var _super2 = _createSuper(Subject);\n\n    function Subject() {\n      var _this2;\n\n      _classCallCheck(this, Subject);\n\n      _this2 = _super2.call(this);\n      _this2.observers = [];\n      _this2.closed = false;\n      _this2.isStopped = false;\n      _this2.hasError = false;\n      _this2.thrownError = null;\n      return _this2;\n    }\n\n    _createClass(Subject, [{\n      key: rxSubscriberSymbol,\n      value: function value() {\n        return new SubjectSubscriber(this);\n      }\n    }, {\n      key: \"lift\",\n      value: function lift(operator) {\n        var subject = new AnonymousSubject(this, this);\n        subject.operator = operator;\n        return subject;\n      }\n    }, {\n      key: \"next\",\n      value: function next(value) {\n        if (this.closed) {\n          throw new ObjectUnsubscribedError();\n        }\n\n        if (!this.isStopped) {\n          var observers = this.observers;\n          var len = observers.length;\n          var copy = observers.slice();\n\n          for (var i = 0; i < len; i++) {\n            copy[i].next(value);\n          }\n        }\n      }\n    }, {\n      key: \"error\",\n      value: function error(err) {\n        if (this.closed) {\n          throw new ObjectUnsubscribedError();\n        }\n\n        this.hasError = true;\n        this.thrownError = err;\n        this.isStopped = true;\n        var observers = this.observers;\n        var len = observers.length;\n        var copy = observers.slice();\n\n        for (var i = 0; i < len; i++) {\n          copy[i].error(err);\n        }\n\n        this.observers.length = 0;\n      }\n    }, {\n      key: \"complete\",\n      value: function complete() {\n        if (this.closed) {\n          throw new ObjectUnsubscribedError();\n        }\n\n        this.isStopped = true;\n        var observers = this.observers;\n        var len = observers.length;\n        var copy = observers.slice();\n\n        for (var i = 0; i < len; i++) {\n          copy[i].complete();\n        }\n\n        this.observers.length = 0;\n      }\n    }, {\n      key: \"unsubscribe\",\n      value: function unsubscribe() {\n        this.isStopped = true;\n        this.closed = true;\n        this.observers = null;\n      }\n    }, {\n      key: \"_trySubscribe\",\n      value: function _trySubscribe(subscriber) {\n        if (this.closed) {\n          throw new ObjectUnsubscribedError();\n        } else {\n          return _get(_getPrototypeOf(Subject.prototype), \"_trySubscribe\", this).call(this, subscriber);\n        }\n      }\n    }, {\n      key: \"_subscribe\",\n      value: function _subscribe(subscriber) {\n        if (this.closed) {\n          throw new ObjectUnsubscribedError();\n        } else if (this.hasError) {\n          subscriber.error(this.thrownError);\n          return Subscription.EMPTY;\n        } else if (this.isStopped) {\n          subscriber.complete();\n          return Subscription.EMPTY;\n        } else {\n          this.observers.push(subscriber);\n          return new SubjectSubscription(this, subscriber);\n        }\n      }\n    }, {\n      key: \"asObservable\",\n      value: function asObservable() {\n        var observable = new Observable();\n        observable.source = this;\n        return observable;\n      }\n    }]);\n\n    return Subject;\n  }(Observable);\n\n  Subject.create = function (destination, source) {\n    return new AnonymousSubject(destination, source);\n  };\n\n  return Subject;\n}();\nexport var AnonymousSubject = /*#__PURE__*/function (_Subject) {\n  _inherits(AnonymousSubject, _Subject);\n\n  var _super3 = _createSuper(AnonymousSubject);\n\n  function AnonymousSubject(destination, source) {\n    var _this3;\n\n    _classCallCheck(this, AnonymousSubject);\n\n    _this3 = _super3.call(this);\n    _this3.destination = destination;\n    _this3.source = source;\n    return _this3;\n  }\n\n  _createClass(AnonymousSubject, [{\n    key: \"next\",\n    value: function next(value) {\n      var destination = this.destination;\n\n      if (destination && destination.next) {\n        destination.next(value);\n      }\n    }\n  }, {\n    key: \"error\",\n    value: function error(err) {\n      var destination = this.destination;\n\n      if (destination && destination.error) {\n        this.destination.error(err);\n      }\n    }\n  }, {\n    key: \"complete\",\n    value: function complete() {\n      var destination = this.destination;\n\n      if (destination && destination.complete) {\n        this.destination.complete();\n      }\n    }\n  }, {\n    key: \"_subscribe\",\n    value: function _subscribe(subscriber) {\n      var source = this.source;\n\n      if (source) {\n        return this.source.subscribe(subscriber);\n      } else {\n        return Subscription.EMPTY;\n      }\n    }\n  }]);\n\n  return AnonymousSubject;\n}(Subject); //# sourceMappingURL=Subject.js.map","map":null,"metadata":{},"sourceType":"module"}