{"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';\nexport function find(predicate, thisArg) {\n  if (typeof predicate !== 'function') {\n    throw new TypeError('predicate is not a function');\n  }\n\n  return function (source) {\n    return source.lift(new FindValueOperator(predicate, source, false, thisArg));\n  };\n}\nexport var FindValueOperator = /*#__PURE__*/function () {\n  function FindValueOperator(predicate, source, yieldIndex, thisArg) {\n    _classCallCheck(this, FindValueOperator);\n\n    this.predicate = predicate;\n    this.source = source;\n    this.yieldIndex = yieldIndex;\n    this.thisArg = thisArg;\n  }\n\n  _createClass(FindValueOperator, [{\n    key: \"call\",\n    value: function call(observer, source) {\n      return source.subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg));\n    }\n  }]);\n\n  return FindValueOperator;\n}();\nexport var FindValueSubscriber = /*#__PURE__*/function (_Subscriber) {\n  _inherits(FindValueSubscriber, _Subscriber);\n\n  var _super = _createSuper(FindValueSubscriber);\n\n  function FindValueSubscriber(destination, predicate, source, yieldIndex, thisArg) {\n    var _this;\n\n    _classCallCheck(this, FindValueSubscriber);\n\n    _this = _super.call(this, destination);\n    _this.predicate = predicate;\n    _this.source = source;\n    _this.yieldIndex = yieldIndex;\n    _this.thisArg = thisArg;\n    _this.index = 0;\n    return _this;\n  }\n\n  _createClass(FindValueSubscriber, [{\n    key: \"notifyComplete\",\n    value: function notifyComplete(value) {\n      var destination = this.destination;\n      destination.next(value);\n      destination.complete();\n      this.unsubscribe();\n    }\n  }, {\n    key: \"_next\",\n    value: function _next(value) {\n      var predicate = this.predicate,\n          thisArg = this.thisArg;\n      var index = this.index++;\n\n      try {\n        var result = predicate.call(thisArg || this, value, index, this.source);\n\n        if (result) {\n          this.notifyComplete(this.yieldIndex ? index : value);\n        }\n      } catch (err) {\n        this.destination.error(err);\n      }\n    }\n  }, {\n    key: \"_complete\",\n    value: function _complete() {\n      this.notifyComplete(this.yieldIndex ? -1 : undefined);\n    }\n  }]);\n\n  return FindValueSubscriber;\n}(Subscriber); //# sourceMappingURL=find.js.map","map":null,"metadata":{},"sourceType":"module"}