{"ast":null,"code":"import _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 { Subscriber } from '../Subscriber';\nimport { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';\nimport { empty } from '../observable/empty';\nexport function take(count) {\n  return function (source) {\n    if (count === 0) {\n      return empty();\n    } else {\n      return source.lift(new TakeOperator(count));\n    }\n  };\n}\n\nvar TakeOperator = /*#__PURE__*/function () {\n  function TakeOperator(total) {\n    _classCallCheck(this, TakeOperator);\n\n    this.total = total;\n\n    if (this.total < 0) {\n      throw new ArgumentOutOfRangeError();\n    }\n  }\n\n  _createClass(TakeOperator, [{\n    key: \"call\",\n    value: function call(subscriber, source) {\n      return source.subscribe(new TakeSubscriber(subscriber, this.total));\n    }\n  }]);\n\n  return TakeOperator;\n}();\n\nvar TakeSubscriber = /*#__PURE__*/function (_Subscriber) {\n  _inherits(TakeSubscriber, _Subscriber);\n\n  var _super = _createSuper(TakeSubscriber);\n\n  function TakeSubscriber(destination, total) {\n    var _this;\n\n    _classCallCheck(this, TakeSubscriber);\n\n    _this = _super.call(this, destination);\n    _this.total = total;\n    _this.count = 0;\n    return _this;\n  }\n\n  _createClass(TakeSubscriber, [{\n    key: \"_next\",\n    value: function _next(value) {\n      var total = this.total;\n      var count = ++this.count;\n\n      if (count <= total) {\n        this.destination.next(value);\n\n        if (count === total) {\n          this.destination.complete();\n          this.unsubscribe();\n        }\n      }\n    }\n  }]);\n\n  return TakeSubscriber;\n}(Subscriber); //# sourceMappingURL=take.js.map","map":null,"metadata":{},"sourceType":"module"}