{"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';\nexport function skipLast(count) {\n  return function (source) {\n    return source.lift(new SkipLastOperator(count));\n  };\n}\n\nvar SkipLastOperator = /*#__PURE__*/function () {\n  function SkipLastOperator(_skipCount) {\n    _classCallCheck(this, SkipLastOperator);\n\n    this._skipCount = _skipCount;\n\n    if (this._skipCount < 0) {\n      throw new ArgumentOutOfRangeError();\n    }\n  }\n\n  _createClass(SkipLastOperator, [{\n    key: \"call\",\n    value: function call(subscriber, source) {\n      if (this._skipCount === 0) {\n        return source.subscribe(new Subscriber(subscriber));\n      } else {\n        return source.subscribe(new SkipLastSubscriber(subscriber, this._skipCount));\n      }\n    }\n  }]);\n\n  return SkipLastOperator;\n}();\n\nvar SkipLastSubscriber = /*#__PURE__*/function (_Subscriber) {\n  _inherits(SkipLastSubscriber, _Subscriber);\n\n  var _super = _createSuper(SkipLastSubscriber);\n\n  function SkipLastSubscriber(destination, _skipCount) {\n    var _this;\n\n    _classCallCheck(this, SkipLastSubscriber);\n\n    _this = _super.call(this, destination);\n    _this._skipCount = _skipCount;\n    _this._count = 0;\n    _this._ring = new Array(_skipCount);\n    return _this;\n  }\n\n  _createClass(SkipLastSubscriber, [{\n    key: \"_next\",\n    value: function _next(value) {\n      var skipCount = this._skipCount;\n      var count = this._count++;\n\n      if (count < skipCount) {\n        this._ring[count] = value;\n      } else {\n        var currentIndex = count % skipCount;\n        var ring = this._ring;\n        var oldValue = ring[currentIndex];\n        ring[currentIndex] = value;\n        this.destination.next(oldValue);\n      }\n    }\n  }]);\n\n  return SkipLastSubscriber;\n}(Subscriber); //# sourceMappingURL=skipLast.js.map","map":null,"metadata":{},"sourceType":"module"}