anti-redirect (typescript)

GM脚本, 去除各搜索引擎/常用网站的重定向

当前为 2017-03-21 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name anti-redirect (typescript)
  3. // @author Axetroy
  4. // @collaborator Axetroy
  5. // @description GM脚本, 去除各搜索引擎/常用网站的重定向
  6. // @version 1.2.1
  7. // @update 2017-03-21 16:56:48
  8. // @grant GM_xmlhttpRequest
  9. // @include *www.baidu.com*
  10. // @include *tieba.baidu.com*
  11. // @include *v.baidu.com*
  12. // @include *www.google.*
  13. // @include *encrypted.google.com*
  14. // @include *www.so.com*
  15. // @include *www.zhihu.com*
  16. // @include *daily.zhihu.com*
  17. // @include *zhuanlan.zhihu.com*
  18. // @include *weibo.com*
  19. // @include *twitter.com*
  20. // @include *www.sogou.com*
  21. // @connect *
  22. // @compatible chrome 完美运行
  23. // @compatible firefox 完美运行
  24. // @supportURL http://www.burningall.com
  25. // @run-at document-start
  26. // @contributionURL troy450409405@gmail.com|alipay.com
  27. // @namespace https://greasyfork.org/zh-CN/users/3400-axetroy
  28. // @license The MIT License (MIT); http://opensource.org/licenses/MIT
  29. // ==/UserScript==
  30.  
  31. // Github源码:https://github.com/axetroy/anti-redirect
  32.  
  33.  
  34. /******/ (function(modules) { // webpackBootstrap
  35. /******/ // The module cache
  36. /******/ var installedModules = {};
  37. /******/
  38. /******/ // The require function
  39. /******/ function __webpack_require__(moduleId) {
  40. /******/
  41. /******/ // Check if module is in cache
  42. /******/ if(installedModules[moduleId])
  43. /******/ return installedModules[moduleId].exports;
  44. /******/
  45. /******/ // Create a new module (and put it into the cache)
  46. /******/ var module = installedModules[moduleId] = {
  47. /******/ i: moduleId,
  48. /******/ l: false,
  49. /******/ exports: {}
  50. /******/ };
  51. /******/
  52. /******/ // Execute the module function
  53. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  54. /******/
  55. /******/ // Flag the module as loaded
  56. /******/ module.l = true;
  57. /******/
  58. /******/ // Return the exports of the module
  59. /******/ return module.exports;
  60. /******/ }
  61. /******/
  62. /******/
  63. /******/ // expose the modules object (__webpack_modules__)
  64. /******/ __webpack_require__.m = modules;
  65. /******/
  66. /******/ // expose the module cache
  67. /******/ __webpack_require__.c = installedModules;
  68. /******/
  69. /******/ // identity function for calling harmony imports with the correct context
  70. /******/ __webpack_require__.i = function(value) { return value; };
  71. /******/
  72. /******/ // define getter function for harmony exports
  73. /******/ __webpack_require__.d = function(exports, name, getter) {
  74. /******/ if(!__webpack_require__.o(exports, name)) {
  75. /******/ Object.defineProperty(exports, name, {
  76. /******/ configurable: false,
  77. /******/ enumerable: true,
  78. /******/ get: getter
  79. /******/ });
  80. /******/ }
  81. /******/ };
  82. /******/
  83. /******/ // getDefaultExport function for compatibility with non-harmony modules
  84. /******/ __webpack_require__.n = function(module) {
  85. /******/ var getter = module && module.__esModule ?
  86. /******/ function getDefault() { return module['default']; } :
  87. /******/ function getModuleExports() { return module; };
  88. /******/ __webpack_require__.d(getter, 'a', getter);
  89. /******/ return getter;
  90. /******/ };
  91. /******/
  92. /******/ // Object.prototype.hasOwnProperty.call
  93. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  94. /******/
  95. /******/ // __webpack_public_path__
  96. /******/ __webpack_require__.p = "";
  97. /******/
  98. /******/ // Load entry module and return exports
  99. /******/ return __webpack_require__(__webpack_require__.s = 85);
  100. /******/ })
  101. /************************************************************************/
  102. /******/ ([
  103. /* 0 */
  104. /***/ (function(module, exports, __webpack_require__) {
  105.  
  106. "use strict";
  107.  
  108. var root_1 = __webpack_require__(2);
  109. var toSubscriber_1 = __webpack_require__(83);
  110. var observable_1 = __webpack_require__(8);
  111. /**
  112. * A representation of any set of values over any amount of time. This the most basic building block
  113. * of RxJS.
  114. *
  115. * @class Observable<T>
  116. */
  117. var Observable = (function () {
  118. /**
  119. * @constructor
  120. * @param {Function} subscribe the function that is called when the Observable is
  121. * initially subscribed to. This function is given a Subscriber, to which new values
  122. * can be `next`ed, or an `error` method can be called to raise an error, or
  123. * `complete` can be called to notify of a successful completion.
  124. */
  125. function Observable(subscribe) {
  126. this._isScalar = false;
  127. if (subscribe) {
  128. this._subscribe = subscribe;
  129. }
  130. }
  131. /**
  132. * Creates a new Observable, with this Observable as the source, and the passed
  133. * operator defined as the new observable's operator.
  134. * @method lift
  135. * @param {Operator} operator the operator defining the operation to take on the observable
  136. * @return {Observable} a new observable with the Operator applied
  137. */
  138. Observable.prototype.lift = function (operator) {
  139. var observable = new Observable();
  140. observable.source = this;
  141. observable.operator = operator;
  142. return observable;
  143. };
  144. Observable.prototype.subscribe = function (observerOrNext, error, complete) {
  145. var operator = this.operator;
  146. var sink = toSubscriber_1.toSubscriber(observerOrNext, error, complete);
  147. if (operator) {
  148. operator.call(sink, this.source);
  149. }
  150. else {
  151. sink.add(this._trySubscribe(sink));
  152. }
  153. if (sink.syncErrorThrowable) {
  154. sink.syncErrorThrowable = false;
  155. if (sink.syncErrorThrown) {
  156. throw sink.syncErrorValue;
  157. }
  158. }
  159. return sink;
  160. };
  161. Observable.prototype._trySubscribe = function (sink) {
  162. try {
  163. return this._subscribe(sink);
  164. }
  165. catch (err) {
  166. sink.syncErrorThrown = true;
  167. sink.syncErrorValue = err;
  168. sink.error(err);
  169. }
  170. };
  171. /**
  172. * @method forEach
  173. * @param {Function} next a handler for each value emitted by the observable
  174. * @param {PromiseConstructor} [PromiseCtor] a constructor function used to instantiate the Promise
  175. * @return {Promise} a promise that either resolves on observable completion or
  176. * rejects with the handled error
  177. */
  178. Observable.prototype.forEach = function (next, PromiseCtor) {
  179. var _this = this;
  180. if (!PromiseCtor) {
  181. if (root_1.root.Rx && root_1.root.Rx.config && root_1.root.Rx.config.Promise) {
  182. PromiseCtor = root_1.root.Rx.config.Promise;
  183. }
  184. else if (root_1.root.Promise) {
  185. PromiseCtor = root_1.root.Promise;
  186. }
  187. }
  188. if (!PromiseCtor) {
  189. throw new Error('no Promise impl found');
  190. }
  191. return new PromiseCtor(function (resolve, reject) {
  192. var subscription = _this.subscribe(function (value) {
  193. if (subscription) {
  194. // if there is a subscription, then we can surmise
  195. // the next handling is asynchronous. Any errors thrown
  196. // need to be rejected explicitly and unsubscribe must be
  197. // called manually
  198. try {
  199. next(value);
  200. }
  201. catch (err) {
  202. reject(err);
  203. subscription.unsubscribe();
  204. }
  205. }
  206. else {
  207. // if there is NO subscription, then we're getting a nexted
  208. // value synchronously during subscription. We can just call it.
  209. // If it errors, Observable's `subscribe` will ensure the
  210. // unsubscription logic is called, then synchronously rethrow the error.
  211. // After that, Promise will trap the error and send it
  212. // down the rejection path.
  213. next(value);
  214. }
  215. }, reject, resolve);
  216. });
  217. };
  218. Observable.prototype._subscribe = function (subscriber) {
  219. return this.source.subscribe(subscriber);
  220. };
  221. /**
  222. * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable
  223. * @method Symbol.observable
  224. * @return {Observable} this instance of the observable
  225. */
  226. Observable.prototype[observable_1.$$observable] = function () {
  227. return this;
  228. };
  229. // HACK: Since TypeScript inherits static properties too, we have to
  230. // fight against TypeScript here so Subject can have a different static create signature
  231. /**
  232. * Creates a new cold Observable by calling the Observable constructor
  233. * @static true
  234. * @owner Observable
  235. * @method create
  236. * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor
  237. * @return {Observable} a new cold observable
  238. */
  239. Observable.create = function (subscribe) {
  240. return new Observable(subscribe);
  241. };
  242. return Observable;
  243. }());
  244. exports.Observable = Observable;
  245. //# sourceMappingURL=Observable.js.map
  246.  
  247. /***/ }),
  248. /* 1 */
  249. /***/ (function(module, exports, __webpack_require__) {
  250.  
  251. "use strict";
  252.  
  253. var __extends = (this && this.__extends) || function (d, b) {
  254. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  255. function __() { this.constructor = d; }
  256. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  257. };
  258. var isFunction_1 = __webpack_require__(11);
  259. var Subscription_1 = __webpack_require__(5);
  260. var Observer_1 = __webpack_require__(16);
  261. var rxSubscriber_1 = __webpack_require__(20);
  262. /**
  263. * Implements the {@link Observer} interface and extends the
  264. * {@link Subscription} class. While the {@link Observer} is the public API for
  265. * consuming the values of an {@link Observable}, all Observers get converted to
  266. * a Subscriber, in order to provide Subscription-like capabilities such as
  267. * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for
  268. * implementing operators, but it is rarely used as a public API.
  269. *
  270. * @class Subscriber<T>
  271. */
  272. var Subscriber = (function (_super) {
  273. __extends(Subscriber, _super);
  274. /**
  275. * @param {Observer|function(value: T): void} [destinationOrNext] A partially
  276. * defined Observer or a `next` callback function.
  277. * @param {function(e: ?any): void} [error] The `error` callback of an
  278. * Observer.
  279. * @param {function(): void} [complete] The `complete` callback of an
  280. * Observer.
  281. */
  282. function Subscriber(destinationOrNext, error, complete) {
  283. _super.call(this);
  284. this.syncErrorValue = null;
  285. this.syncErrorThrown = false;
  286. this.syncErrorThrowable = false;
  287. this.isStopped = false;
  288. switch (arguments.length) {
  289. case 0:
  290. this.destination = Observer_1.empty;
  291. break;
  292. case 1:
  293. if (!destinationOrNext) {
  294. this.destination = Observer_1.empty;
  295. break;
  296. }
  297. if (typeof destinationOrNext === 'object') {
  298. if (destinationOrNext instanceof Subscriber) {
  299. this.destination = destinationOrNext;
  300. this.destination.add(this);
  301. }
  302. else {
  303. this.syncErrorThrowable = true;
  304. this.destination = new SafeSubscriber(this, destinationOrNext);
  305. }
  306. break;
  307. }
  308. default:
  309. this.syncErrorThrowable = true;
  310. this.destination = new SafeSubscriber(this, destinationOrNext, error, complete);
  311. break;
  312. }
  313. }
  314. Subscriber.prototype[rxSubscriber_1.$$rxSubscriber] = function () { return this; };
  315. /**
  316. * A static factory for a Subscriber, given a (potentially partial) definition
  317. * of an Observer.
  318. * @param {function(x: ?T): void} [next] The `next` callback of an Observer.
  319. * @param {function(e: ?any): void} [error] The `error` callback of an
  320. * Observer.
  321. * @param {function(): void} [complete] The `complete` callback of an
  322. * Observer.
  323. * @return {Subscriber<T>} A Subscriber wrapping the (partially defined)
  324. * Observer represented by the given arguments.
  325. */
  326. Subscriber.create = function (next, error, complete) {
  327. var subscriber = new Subscriber(next, error, complete);
  328. subscriber.syncErrorThrowable = false;
  329. return subscriber;
  330. };
  331. /**
  332. * The {@link Observer} callback to receive notifications of type `next` from
  333. * the Observable, with a value. The Observable may call this method 0 or more
  334. * times.
  335. * @param {T} [value] The `next` value.
  336. * @return {void}
  337. */
  338. Subscriber.prototype.next = function (value) {
  339. if (!this.isStopped) {
  340. this._next(value);
  341. }
  342. };
  343. /**
  344. * The {@link Observer} callback to receive notifications of type `error` from
  345. * the Observable, with an attached {@link Error}. Notifies the Observer that
  346. * the Observable has experienced an error condition.
  347. * @param {any} [err] The `error` exception.
  348. * @return {void}
  349. */
  350. Subscriber.prototype.error = function (err) {
  351. if (!this.isStopped) {
  352. this.isStopped = true;
  353. this._error(err);
  354. }
  355. };
  356. /**
  357. * The {@link Observer} callback to receive a valueless notification of type
  358. * `complete` from the Observable. Notifies the Observer that the Observable
  359. * has finished sending push-based notifications.
  360. * @return {void}
  361. */
  362. Subscriber.prototype.complete = function () {
  363. if (!this.isStopped) {
  364. this.isStopped = true;
  365. this._complete();
  366. }
  367. };
  368. Subscriber.prototype.unsubscribe = function () {
  369. if (this.closed) {
  370. return;
  371. }
  372. this.isStopped = true;
  373. _super.prototype.unsubscribe.call(this);
  374. };
  375. Subscriber.prototype._next = function (value) {
  376. this.destination.next(value);
  377. };
  378. Subscriber.prototype._error = function (err) {
  379. this.destination.error(err);
  380. this.unsubscribe();
  381. };
  382. Subscriber.prototype._complete = function () {
  383. this.destination.complete();
  384. this.unsubscribe();
  385. };
  386. Subscriber.prototype._unsubscribeAndRecycle = function () {
  387. var _a = this, _parent = _a._parent, _parents = _a._parents;
  388. this._parent = null;
  389. this._parents = null;
  390. this.unsubscribe();
  391. this.closed = false;
  392. this.isStopped = false;
  393. this._parent = _parent;
  394. this._parents = _parents;
  395. return this;
  396. };
  397. return Subscriber;
  398. }(Subscription_1.Subscription));
  399. exports.Subscriber = Subscriber;
  400. /**
  401. * We need this JSDoc comment for affecting ESDoc.
  402. * @ignore
  403. * @extends {Ignored}
  404. */
  405. var SafeSubscriber = (function (_super) {
  406. __extends(SafeSubscriber, _super);
  407. function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {
  408. _super.call(this);
  409. this._parentSubscriber = _parentSubscriber;
  410. var next;
  411. var context = this;
  412. if (isFunction_1.isFunction(observerOrNext)) {
  413. next = observerOrNext;
  414. }
  415. else if (observerOrNext) {
  416. context = observerOrNext;
  417. next = observerOrNext.next;
  418. error = observerOrNext.error;
  419. complete = observerOrNext.complete;
  420. if (isFunction_1.isFunction(context.unsubscribe)) {
  421. this.add(context.unsubscribe.bind(context));
  422. }
  423. context.unsubscribe = this.unsubscribe.bind(this);
  424. }
  425. this._context = context;
  426. this._next = next;
  427. this._error = error;
  428. this._complete = complete;
  429. }
  430. SafeSubscriber.prototype.next = function (value) {
  431. if (!this.isStopped && this._next) {
  432. var _parentSubscriber = this._parentSubscriber;
  433. if (!_parentSubscriber.syncErrorThrowable) {
  434. this.__tryOrUnsub(this._next, value);
  435. }
  436. else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
  437. this.unsubscribe();
  438. }
  439. }
  440. };
  441. SafeSubscriber.prototype.error = function (err) {
  442. if (!this.isStopped) {
  443. var _parentSubscriber = this._parentSubscriber;
  444. if (this._error) {
  445. if (!_parentSubscriber.syncErrorThrowable) {
  446. this.__tryOrUnsub(this._error, err);
  447. this.unsubscribe();
  448. }
  449. else {
  450. this.__tryOrSetError(_parentSubscriber, this._error, err);
  451. this.unsubscribe();
  452. }
  453. }
  454. else if (!_parentSubscriber.syncErrorThrowable) {
  455. this.unsubscribe();
  456. throw err;
  457. }
  458. else {
  459. _parentSubscriber.syncErrorValue = err;
  460. _parentSubscriber.syncErrorThrown = true;
  461. this.unsubscribe();
  462. }
  463. }
  464. };
  465. SafeSubscriber.prototype.complete = function () {
  466. if (!this.isStopped) {
  467. var _parentSubscriber = this._parentSubscriber;
  468. if (this._complete) {
  469. if (!_parentSubscriber.syncErrorThrowable) {
  470. this.__tryOrUnsub(this._complete);
  471. this.unsubscribe();
  472. }
  473. else {
  474. this.__tryOrSetError(_parentSubscriber, this._complete);
  475. this.unsubscribe();
  476. }
  477. }
  478. else {
  479. this.unsubscribe();
  480. }
  481. }
  482. };
  483. SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {
  484. try {
  485. fn.call(this._context, value);
  486. }
  487. catch (err) {
  488. this.unsubscribe();
  489. throw err;
  490. }
  491. };
  492. SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {
  493. try {
  494. fn.call(this._context, value);
  495. }
  496. catch (err) {
  497. parent.syncErrorValue = err;
  498. parent.syncErrorThrown = true;
  499. return true;
  500. }
  501. return false;
  502. };
  503. SafeSubscriber.prototype._unsubscribe = function () {
  504. var _parentSubscriber = this._parentSubscriber;
  505. this._context = null;
  506. this._parentSubscriber = null;
  507. _parentSubscriber.unsubscribe();
  508. };
  509. return SafeSubscriber;
  510. }(Subscriber));
  511. //# sourceMappingURL=Subscriber.js.map
  512.  
  513. /***/ }),
  514. /* 2 */
  515. /***/ (function(module, exports, __webpack_require__) {
  516.  
  517. "use strict";
  518. /* WEBPACK VAR INJECTION */(function(global) {
  519. /**
  520. * window: browser in DOM main thread
  521. * self: browser in WebWorker
  522. * global: Node.js/other
  523. */
  524. exports.root = (typeof window == 'object' && window.window === window && window
  525. || typeof self == 'object' && self.self === self && self
  526. || typeof global == 'object' && global.global === global && global);
  527. if (!exports.root) {
  528. throw new Error('RxJS could not find any global context (window, self, global)');
  529. }
  530. //# sourceMappingURL=root.js.map
  531. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(84)))
  532.  
  533. /***/ }),
  534. /* 3 */
  535. /***/ (function(module, exports, __webpack_require__) {
  536.  
  537. "use strict";
  538.  
  539. Object.defineProperty(exports, "__esModule", { value: true });
  540. var Observable_1 = __webpack_require__(0);
  541. var log_1 = __webpack_require__(28);
  542. var config_1 = __webpack_require__(27);
  543. var DEBUG = config_1.CONFIG.debug;
  544. var RedirectOnUrl = (function () {
  545. function RedirectOnUrl(domainTester, urlTester, matcher, ASelector) {
  546. this.domainTester = domainTester;
  547. this.urlTester = urlTester;
  548. this.matcher = matcher;
  549. this.ASelector = ASelector;
  550. this.match = false;
  551. this.DEBUG = DEBUG;
  552. this.ASelector = this.ASelector || 'a';
  553. this.match = domainTester.test(document.domain);
  554. }
  555. /**
  556. * 已经转化成功之后的元素
  557. * @param aEle
  558. */
  559. RedirectOnUrl.prototype.handlerOneCallBack = function (aEle) {
  560. };
  561. /**
  562. * 默认,处理一个A元素
  563. * @param aEle
  564. */
  565. RedirectOnUrl.prototype.handler = function (aEle) {
  566. var matcher = this.matcher.exec(aEle.href);
  567. if (!matcher || !matcher.length || !matcher[1])
  568. return;
  569. var url = '';
  570. try {
  571. url = decodeURIComponent(matcher[1]);
  572. }
  573. catch (e) {
  574. url = /https?:\/\//.test(matcher[1]) ? matcher[1] : '';
  575. }
  576. if (url) {
  577. aEle.setAttribute('origin-href', aEle.getAttribute('href'));
  578. aEle.href = url;
  579. DEBUG && (aEle.style.backgroundColor = 'green');
  580. this.handlerOneCallBack(aEle);
  581. }
  582. };
  583. RedirectOnUrl.prototype.handlerOne = function (aEle) {
  584. var _this = this;
  585. return Observable_1.Observable.of(aEle)
  586. .filter(function (ele) { return _this.urlTester.test(ele.href); })
  587. .subscribe(function (aEle) { return _this.handler(aEle); });
  588. };
  589. RedirectOnUrl.prototype.handlerOneByOne = function () {
  590. return Observable_1.Observable.from([].slice.call(document.querySelectorAll(this.ASelector)))
  591. .filter(function (target) { return !!(target.nodeName === 'A' && target.href); });
  592. };
  593. RedirectOnUrl.prototype.scroll = function () {
  594. var _this = this;
  595. return Observable_1.Observable.fromEvent(document, 'scroll')
  596. .debounceTime(200)
  597. .flatMap(function () { return _this.handlerOneByOne(); })
  598. .subscribe(function (aEle) { return _this.handlerOne(aEle); });
  599. };
  600. RedirectOnUrl.prototype.mouseover = function () {
  601. return Observable_1.Observable.fromEvent(document, 'mousemove')
  602. .throttleTime(100)
  603. .map(function (event) {
  604. var target = event.target;
  605. return target.nodeName === 'A' ? target : target.parentNode.nodeName === 'A' ? target.parentNode : target;
  606. })
  607. .filter(function (ele) { return ele.nodeName === 'A'; });
  608. };
  609. RedirectOnUrl.prototype.onInit = function () {
  610. var agm = [];
  611. for (var _i = 0; _i < arguments.length; _i++) {
  612. agm[_i] = arguments[_i];
  613. }
  614. };
  615. RedirectOnUrl.prototype.bootstrap = function () {
  616. var _this = this;
  617. if (!this.match)
  618. return;
  619. Observable_1.Observable.fromEvent(document, 'DOMContentLoaded')
  620. .delay(1000)
  621. .flatMap(function () { return _this.handlerOneByOne().filter(function (aEle) { return __webpack_require__(14).is(aEle); }); })
  622. .subscribe(function (aEle) {
  623. _this.onInit();
  624. _this.handlerOne(aEle);
  625. _this.scroll();
  626. _this.mouseover().subscribe(function (aEle) { return _this.handlerOne(aEle); });
  627. log_1.log();
  628. });
  629. };
  630. return RedirectOnUrl;
  631. }());
  632. exports.RedirectOnUrl = RedirectOnUrl;
  633.  
  634.  
  635. /***/ }),
  636. /* 4 */
  637. /***/ (function(module, exports, __webpack_require__) {
  638.  
  639. "use strict";
  640.  
  641. var AsyncAction_1 = __webpack_require__(78);
  642. var AsyncScheduler_1 = __webpack_require__(79);
  643. /**
  644. *
  645. * Async Scheduler
  646. *
  647. * <span class="informal">Schedule task as if you used setTimeout(task, duration)</span>
  648. *
  649. * `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript
  650. * event loop queue. It is best used to delay tasks in time or to schedule tasks repeating
  651. * in intervals.
  652. *
  653. * If you just want to "defer" task, that is to perform it right after currently
  654. * executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`),
  655. * better choice will be the {@link asap} scheduler.
  656. *
  657. * @example <caption>Use async scheduler to delay task</caption>
  658. * const task = () => console.log('it works!');
  659. *
  660. * Rx.Scheduler.async.schedule(task, 2000);
  661. *
  662. * // After 2 seconds logs:
  663. * // "it works!"
  664. *
  665. *
  666. * @example <caption>Use async scheduler to repeat task in intervals</caption>
  667. * function task(state) {
  668. * console.log(state);
  669. * this.schedule(state + 1, 1000); // `this` references currently executing Action,
  670. * // which we reschedule with new state and delay
  671. * }
  672. *
  673. * Rx.Scheduler.async.schedule(task, 3000, 0);
  674. *
  675. * // Logs:
  676. * // 0 after 3s
  677. * // 1 after 4s
  678. * // 2 after 5s
  679. * // 3 after 6s
  680. *
  681. * @static true
  682. * @name async
  683. * @owner Scheduler
  684. */
  685. exports.async = new AsyncScheduler_1.AsyncScheduler(AsyncAction_1.AsyncAction);
  686. //# sourceMappingURL=async.js.map
  687.  
  688. /***/ }),
  689. /* 5 */
  690. /***/ (function(module, exports, __webpack_require__) {
  691.  
  692. "use strict";
  693.  
  694. var isArray_1 = __webpack_require__(10);
  695. var isObject_1 = __webpack_require__(23);
  696. var isFunction_1 = __webpack_require__(11);
  697. var tryCatch_1 = __webpack_require__(26);
  698. var errorObject_1 = __webpack_require__(9);
  699. var UnsubscriptionError_1 = __webpack_require__(81);
  700. /**
  701. * Represents a disposable resource, such as the execution of an Observable. A
  702. * Subscription has one important method, `unsubscribe`, that takes no argument
  703. * and just disposes the resource held by the subscription.
  704. *
  705. * Additionally, subscriptions may be grouped together through the `add()`
  706. * method, which will attach a child Subscription to the current Subscription.
  707. * When a Subscription is unsubscribed, all its children (and its grandchildren)
  708. * will be unsubscribed as well.
  709. *
  710. * @class Subscription
  711. */
  712. var Subscription = (function () {
  713. /**
  714. * @param {function(): void} [unsubscribe] A function describing how to
  715. * perform the disposal of resources when the `unsubscribe` method is called.
  716. */
  717. function Subscription(unsubscribe) {
  718. /**
  719. * A flag to indicate whether this Subscription has already been unsubscribed.
  720. * @type {boolean}
  721. */
  722. this.closed = false;
  723. this._parent = null;
  724. this._parents = null;
  725. this._subscriptions = null;
  726. if (unsubscribe) {
  727. this._unsubscribe = unsubscribe;
  728. }
  729. }
  730. /**
  731. * Disposes the resources held by the subscription. May, for instance, cancel
  732. * an ongoing Observable execution or cancel any other type of work that
  733. * started when the Subscription was created.
  734. * @return {void}
  735. */
  736. Subscription.prototype.unsubscribe = function () {
  737. var hasErrors = false;
  738. var errors;
  739. if (this.closed) {
  740. return;
  741. }
  742. var _a = this, _parent = _a._parent, _parents = _a._parents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
  743. this.closed = true;
  744. this._parent = null;
  745. this._parents = null;
  746. // null out _subscriptions first so any child subscriptions that attempt
  747. // to remove themselves from this subscription will noop
  748. this._subscriptions = null;
  749. var index = -1;
  750. var len = _parents ? _parents.length : 0;
  751. // if this._parent is null, then so is this._parents, and we
  752. // don't have to remove ourselves from any parent subscriptions.
  753. while (_parent) {
  754. _parent.remove(this);
  755. // if this._parents is null or index >= len,
  756. // then _parent is set to null, and the loop exits
  757. _parent = ++index < len && _parents[index] || null;
  758. }
  759. if (isFunction_1.isFunction(_unsubscribe)) {
  760. var trial = tryCatch_1.tryCatch(_unsubscribe).call(this);
  761. if (trial === errorObject_1.errorObject) {
  762. hasErrors = true;
  763. errors = errors || (errorObject_1.errorObject.e instanceof UnsubscriptionError_1.UnsubscriptionError ?
  764. flattenUnsubscriptionErrors(errorObject_1.errorObject.e.errors) : [errorObject_1.errorObject.e]);
  765. }
  766. }
  767. if (isArray_1.isArray(_subscriptions)) {
  768. index = -1;
  769. len = _subscriptions.length;
  770. while (++index < len) {
  771. var sub = _subscriptions[index];
  772. if (isObject_1.isObject(sub)) {
  773. var trial = tryCatch_1.tryCatch(sub.unsubscribe).call(sub);
  774. if (trial === errorObject_1.errorObject) {
  775. hasErrors = true;
  776. errors = errors || [];
  777. var err = errorObject_1.errorObject.e;
  778. if (err instanceof UnsubscriptionError_1.UnsubscriptionError) {
  779. errors = errors.concat(flattenUnsubscriptionErrors(err.errors));
  780. }
  781. else {
  782. errors.push(err);
  783. }
  784. }
  785. }
  786. }
  787. }
  788. if (hasErrors) {
  789. throw new UnsubscriptionError_1.UnsubscriptionError(errors);
  790. }
  791. };
  792. /**
  793. * Adds a tear down to be called during the unsubscribe() of this
  794. * Subscription.
  795. *
  796. * If the tear down being added is a subscription that is already
  797. * unsubscribed, is the same reference `add` is being called on, or is
  798. * `Subscription.EMPTY`, it will not be added.
  799. *
  800. * If this subscription is already in an `closed` state, the passed
  801. * tear down logic will be executed immediately.
  802. *
  803. * @param {TeardownLogic} teardown The additional logic to execute on
  804. * teardown.
  805. * @return {Subscription} Returns the Subscription used or created to be
  806. * added to the inner subscriptions list. This Subscription can be used with
  807. * `remove()` to remove the passed teardown logic from the inner subscriptions
  808. * list.
  809. */
  810. Subscription.prototype.add = function (teardown) {
  811. if (!teardown || (teardown === Subscription.EMPTY)) {
  812. return Subscription.EMPTY;
  813. }
  814. if (teardown === this) {
  815. return this;
  816. }
  817. var subscription = teardown;
  818. switch (typeof teardown) {
  819. case 'function':
  820. subscription = new Subscription(teardown);
  821. case 'object':
  822. if (subscription.closed || typeof subscription.unsubscribe !== 'function') {
  823. return subscription;
  824. }
  825. else if (this.closed) {
  826. subscription.unsubscribe();
  827. return subscription;
  828. }
  829. else if (typeof subscription._addParent !== 'function' /* quack quack */) {
  830. var tmp = subscription;
  831. subscription = new Subscription();
  832. subscription._subscriptions = [tmp];
  833. }
  834. break;
  835. default:
  836. throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
  837. }
  838. var subscriptions = this._subscriptions || (this._subscriptions = []);
  839. subscriptions.push(subscription);
  840. subscription._addParent(this);
  841. return subscription;
  842. };
  843. /**
  844. * Removes a Subscription from the internal list of subscriptions that will
  845. * unsubscribe during the unsubscribe process of this Subscription.
  846. * @param {Subscription} subscription The subscription to remove.
  847. * @return {void}
  848. */
  849. Subscription.prototype.remove = function (subscription) {
  850. var subscriptions = this._subscriptions;
  851. if (subscriptions) {
  852. var subscriptionIndex = subscriptions.indexOf(subscription);
  853. if (subscriptionIndex !== -1) {
  854. subscriptions.splice(subscriptionIndex, 1);
  855. }
  856. }
  857. };
  858. Subscription.prototype._addParent = function (parent) {
  859. var _a = this, _parent = _a._parent, _parents = _a._parents;
  860. if (!_parent || _parent === parent) {
  861. // If we don't have a parent, or the new parent is the same as the
  862. // current parent, then set this._parent to the new parent.
  863. this._parent = parent;
  864. }
  865. else if (!_parents) {
  866. // If there's already one parent, but not multiple, allocate an Array to
  867. // store the rest of the parent Subscriptions.
  868. this._parents = [parent];
  869. }
  870. else if (_parents.indexOf(parent) === -1) {
  871. // Only add the new parent to the _parents list if it's not already there.
  872. _parents.push(parent);
  873. }
  874. };
  875. Subscription.EMPTY = (function (empty) {
  876. empty.closed = true;
  877. return empty;
  878. }(new Subscription()));
  879. return Subscription;
  880. }());
  881. exports.Subscription = Subscription;
  882. function flattenUnsubscriptionErrors(errors) {
  883. return errors.reduce(function (errs, err) { return errs.concat((err instanceof UnsubscriptionError_1.UnsubscriptionError) ? err.errors : err); }, []);
  884. }
  885. //# sourceMappingURL=Subscription.js.map
  886.  
  887. /***/ }),
  888. /* 6 */
  889. /***/ (function(module, exports, __webpack_require__) {
  890.  
  891. "use strict";
  892.  
  893. var __extends = (this && this.__extends) || function (d, b) {
  894. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  895. function __() { this.constructor = d; }
  896. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  897. };
  898. var Observable_1 = __webpack_require__(0);
  899. /**
  900. * We need this JSDoc comment for affecting ESDoc.
  901. * @extends {Ignored}
  902. * @hide true
  903. */
  904. var EmptyObservable = (function (_super) {
  905. __extends(EmptyObservable, _super);
  906. function EmptyObservable(scheduler) {
  907. _super.call(this);
  908. this.scheduler = scheduler;
  909. }
  910. /**
  911. * Creates an Observable that emits no items to the Observer and immediately
  912. * emits a complete notification.
  913. *
  914. * <span class="informal">Just emits 'complete', and nothing else.
  915. * </span>
  916. *
  917. * <img src="./img/empty.png" width="100%">
  918. *
  919. * This static operator is useful for creating a simple Observable that only
  920. * emits the complete notification. It can be used for composing with other
  921. * Observables, such as in a {@link mergeMap}.
  922. *
  923. * @example <caption>Emit the number 7, then complete.</caption>
  924. * var result = Rx.Observable.empty().startWith(7);
  925. * result.subscribe(x => console.log(x));
  926. *
  927. * @example <caption>Map and flatten only odd numbers to the sequence 'a', 'b', 'c'</caption>
  928. * var interval = Rx.Observable.interval(1000);
  929. * var result = interval.mergeMap(x =>
  930. * x % 2 === 1 ? Rx.Observable.of('a', 'b', 'c') : Rx.Observable.empty()
  931. * );
  932. * result.subscribe(x => console.log(x));
  933. *
  934. * // Results in the following to the console:
  935. * // x is equal to the count on the interval eg(0,1,2,3,...)
  936. * // x will occur every 1000ms
  937. * // if x % 2 is equal to 1 print abc
  938. * // if x % 2 is not equal to 1 nothing will be output
  939. *
  940. * @see {@link create}
  941. * @see {@link never}
  942. * @see {@link of}
  943. * @see {@link throw}
  944. *
  945. * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling
  946. * the emission of the complete notification.
  947. * @return {Observable} An "empty" Observable: emits only the complete
  948. * notification.
  949. * @static true
  950. * @name empty
  951. * @owner Observable
  952. */
  953. EmptyObservable.create = function (scheduler) {
  954. return new EmptyObservable(scheduler);
  955. };
  956. EmptyObservable.dispatch = function (arg) {
  957. var subscriber = arg.subscriber;
  958. subscriber.complete();
  959. };
  960. EmptyObservable.prototype._subscribe = function (subscriber) {
  961. var scheduler = this.scheduler;
  962. if (scheduler) {
  963. return scheduler.schedule(EmptyObservable.dispatch, 0, { subscriber: subscriber });
  964. }
  965. else {
  966. subscriber.complete();
  967. }
  968. };
  969. return EmptyObservable;
  970. }(Observable_1.Observable));
  971. exports.EmptyObservable = EmptyObservable;
  972. //# sourceMappingURL=EmptyObservable.js.map
  973.  
  974. /***/ }),
  975. /* 7 */
  976. /***/ (function(module, exports, __webpack_require__) {
  977.  
  978. "use strict";
  979.  
  980. var root_1 = __webpack_require__(2);
  981. function symbolIteratorPonyfill(root) {
  982. var Symbol = root.Symbol;
  983. if (typeof Symbol === 'function') {
  984. if (!Symbol.iterator) {
  985. Symbol.iterator = Symbol('iterator polyfill');
  986. }
  987. return Symbol.iterator;
  988. }
  989. else {
  990. // [for Mozilla Gecko 27-35:](https://mzl.la/2ewE1zC)
  991. var Set_1 = root.Set;
  992. if (Set_1 && typeof new Set_1()['@@iterator'] === 'function') {
  993. return '@@iterator';
  994. }
  995. var Map_1 = root.Map;
  996. // required for compatability with es6-shim
  997. if (Map_1) {
  998. var keys = Object.getOwnPropertyNames(Map_1.prototype);
  999. for (var i = 0; i < keys.length; ++i) {
  1000. var key = keys[i];
  1001. // according to spec, Map.prototype[@@iterator] and Map.orototype.entries must be equal.
  1002. if (key !== 'entries' && key !== 'size' && Map_1.prototype[key] === Map_1.prototype['entries']) {
  1003. return key;
  1004. }
  1005. }
  1006. }
  1007. return '@@iterator';
  1008. }
  1009. }
  1010. exports.symbolIteratorPonyfill = symbolIteratorPonyfill;
  1011. exports.$$iterator = symbolIteratorPonyfill(root_1.root);
  1012. //# sourceMappingURL=iterator.js.map
  1013.  
  1014. /***/ }),
  1015. /* 8 */
  1016. /***/ (function(module, exports, __webpack_require__) {
  1017.  
  1018. "use strict";
  1019.  
  1020. var root_1 = __webpack_require__(2);
  1021. function getSymbolObservable(context) {
  1022. var $$observable;
  1023. var Symbol = context.Symbol;
  1024. if (typeof Symbol === 'function') {
  1025. if (Symbol.observable) {
  1026. $$observable = Symbol.observable;
  1027. }
  1028. else {
  1029. $$observable = Symbol('observable');
  1030. Symbol.observable = $$observable;
  1031. }
  1032. }
  1033. else {
  1034. $$observable = '@@observable';
  1035. }
  1036. return $$observable;
  1037. }
  1038. exports.getSymbolObservable = getSymbolObservable;
  1039. exports.$$observable = getSymbolObservable(root_1.root);
  1040. //# sourceMappingURL=observable.js.map
  1041.  
  1042. /***/ }),
  1043. /* 9 */
  1044. /***/ (function(module, exports, __webpack_require__) {
  1045.  
  1046. "use strict";
  1047.  
  1048. // typeof any so that it we don't have to cast when comparing a result to the error object
  1049. exports.errorObject = { e: {} };
  1050. //# sourceMappingURL=errorObject.js.map
  1051.  
  1052. /***/ }),
  1053. /* 10 */
  1054. /***/ (function(module, exports, __webpack_require__) {
  1055.  
  1056. "use strict";
  1057.  
  1058. exports.isArray = Array.isArray || (function (x) { return x && typeof x.length === 'number'; });
  1059. //# sourceMappingURL=isArray.js.map
  1060.  
  1061. /***/ }),
  1062. /* 11 */
  1063. /***/ (function(module, exports, __webpack_require__) {
  1064.  
  1065. "use strict";
  1066.  
  1067. function isFunction(x) {
  1068. return typeof x === 'function';
  1069. }
  1070. exports.isFunction = isFunction;
  1071. //# sourceMappingURL=isFunction.js.map
  1072.  
  1073. /***/ }),
  1074. /* 12 */
  1075. /***/ (function(module, exports, __webpack_require__) {
  1076.  
  1077. "use strict";
  1078.  
  1079. Object.defineProperty(exports, "__esModule", { value: true });
  1080. var _ = __webpack_require__(30);
  1081. var Observable_1 = __webpack_require__(0);
  1082. var Http = (function () {
  1083. function Http(options) {
  1084. this.options = options;
  1085. }
  1086. Http.prototype.request = function (requestOptions) {
  1087. var options = _.extend({}, this.options, requestOptions);
  1088. var onreadystatechange = options.onreadystatechange, onerror = options.onerror, onabort = options.onabort, ontimeout = options.ontimeout;
  1089. return Observable_1.Observable.create(function (observer) {
  1090. // options.synchronous = true; // async
  1091. options.onreadystatechange = function (response) {
  1092. _.isFunction(onreadystatechange) && onreadystatechange.call(this, response);
  1093. if (response.readyState !== 4)
  1094. return;
  1095. response.status >= 200 && response.status < 400 && response.finalUrl ? observer.next(response) : observer.error(response);
  1096. observer.complete();
  1097. };
  1098. options.onerror = function (response) {
  1099. _.isFunction(onerror) && onerror.call(this, response);
  1100. observer.error(response);
  1101. observer.complete();
  1102. };
  1103. options.onabort = function (response) {
  1104. _.isFunction(onabort) && onabort.call(this, response);
  1105. observer.error(response);
  1106. observer.complete();
  1107. };
  1108. options.ontimeout = function (response) {
  1109. _.isFunction(ontimeout) && ontimeout.call(this, response);
  1110. observer.error(response);
  1111. observer.complete();
  1112. };
  1113. GM_xmlhttpRequest(_.extend({}, options));
  1114. });
  1115. };
  1116. Http.prototype.get = function (url, options) {
  1117. var requestOptions = _.extend(options || {}, { url: url, method: 'GET' });
  1118. return this.request(requestOptions);
  1119. };
  1120. Http.prototype.post = function (url, data, options) {
  1121. return this.request(_.extend(options || {}, { url: url, method: 'POST', data: data }));
  1122. };
  1123. Http.prototype.head = function (url, options) {
  1124. return this.request(_.extend(options || {}, { url: url, method: 'HEAD' }));
  1125. };
  1126. return Http;
  1127. }());
  1128. var timeout = 5000;
  1129. exports.timeout = timeout;
  1130. var http = new Http({ timeout: timeout });
  1131. exports.http = http;
  1132.  
  1133.  
  1134. /***/ }),
  1135. /* 13 */
  1136. /***/ (function(module, exports, __webpack_require__) {
  1137.  
  1138. "use strict";
  1139.  
  1140. Object.defineProperty(exports, "__esModule", { value: true });
  1141. var Observable_1 = __webpack_require__(0);
  1142. var http_1 = __webpack_require__(12);
  1143. var log_1 = __webpack_require__(28);
  1144. var config_1 = __webpack_require__(27);
  1145. var DEBUG = config_1.CONFIG.debug;
  1146. var status = {
  1147. ing: 'redirect-ing',
  1148. done: 'redirect-done'
  1149. };
  1150. var inview;
  1151. var RedirectOnRequest = (function () {
  1152. function RedirectOnRequest(domainTester, urlTester, matcher, ASelector) {
  1153. this.domainTester = domainTester;
  1154. this.urlTester = urlTester;
  1155. this.matcher = matcher;
  1156. this.ASelector = ASelector;
  1157. this.DEBUG = DEBUG;
  1158. this.status = status;
  1159. this.ASelector = this.ASelector || 'a';
  1160. this.match = domainTester.test(document.domain);
  1161. }
  1162. RedirectOnRequest.prototype.handlerOneResponse = function (res) {
  1163. return res;
  1164. };
  1165. RedirectOnRequest.prototype.handlerOne = function (aElement) {
  1166. var _this = this;
  1167. if (!this.urlTester.test(aElement.href) || aElement.getAttribute(status.ing) || aElement.getAttribute(status.done))
  1168. return;
  1169. var protocol = location.protocol.replace(/:$/, ''); // in chrome[:http], but in firefox is:[http:]
  1170. var url = aElement.href.replace(/^https?/, protocol) + ("&timestamp=" + new Date().getTime());
  1171. aElement.style.cursor = 'progress';
  1172. aElement.setAttribute(status.ing, '1');
  1173. return http_1.http.get(url)
  1174. .retry(2)
  1175. .timeout(http_1.timeout)
  1176. .map(function (res) { return _this.handlerOneResponse(res); })
  1177. .do(function (res) {
  1178. if (_this.urlTester.test(res.finalUrl))
  1179. throw new Error('invalid final url');
  1180. })
  1181. .subscribe(function (res) {
  1182. _this.urlTester.test(aElement.href) && aElement.setAttribute('origin-href', aElement.href);
  1183. aElement.href = res.finalUrl;
  1184. aElement.removeAttribute(status.ing);
  1185. aElement.setAttribute(status.done, '1');
  1186. DEBUG && (aElement.style.backgroundColor = 'green');
  1187. }, function () {
  1188. aElement.style.cursor = null;
  1189. aElement.removeAttribute(status.ing);
  1190. }, function () {
  1191. aElement.style.cursor = null;
  1192. aElement.removeAttribute(status.ing);
  1193. });
  1194. };
  1195. RedirectOnRequest.prototype.handlerOneByOne = function () {
  1196. var _this = this;
  1197. return Observable_1.Observable.from([].slice.call(document.querySelectorAll(this.ASelector)))
  1198. .subscribe(function (aElement) {
  1199. inview = __webpack_require__(14);
  1200. inview && inview.is(aElement) && _this.handlerOne(aElement);
  1201. });
  1202. };
  1203. RedirectOnRequest.prototype.onInit = function () {
  1204. var agm = [];
  1205. for (var _i = 0; _i < arguments.length; _i++) {
  1206. agm[_i] = arguments[_i];
  1207. }
  1208. };
  1209. RedirectOnRequest.prototype.scroll = function () {
  1210. var _this = this;
  1211. return Observable_1.Observable.fromEvent(window, 'scroll')
  1212. .debounceTime(200)
  1213. .subscribe(function () {
  1214. _this.handlerOneByOne();
  1215. });
  1216. };
  1217. RedirectOnRequest.prototype.mouseover = function () {
  1218. var _this = this;
  1219. return Observable_1.Observable.fromEvent(document, 'mousemove')
  1220. .throttleTime(100)
  1221. .map(function (event) {
  1222. var target = event.toElement;
  1223. return target.nodeName === 'A' ? target : target.parentNode.nodeName === 'A' ? target.parentNode : target;
  1224. })
  1225. .filter(function (ele) { return ele.nodeName === 'A'; })
  1226. .subscribe(function (aEle) {
  1227. _this.handlerOne(aEle);
  1228. });
  1229. };
  1230. RedirectOnRequest.prototype.bootstrap = function () {
  1231. var _this = this;
  1232. if (!this.match)
  1233. return;
  1234. Observable_1.Observable.fromEvent(document, 'DOMContentLoaded')
  1235. .throttleTime(200)
  1236. .subscribe(function () {
  1237. _this.onInit();
  1238. _this.scroll();
  1239. _this.mouseover();
  1240. _this.handlerOneByOne();
  1241. Observable_1.Observable.create(function (observer) {
  1242. new MutationObserver(function (mutations) {
  1243. if (mutations === void 0) { mutations = []; }
  1244. return observer.next();
  1245. })
  1246. .observe(document.body, { childList: true });
  1247. }).debounceTime(100)
  1248. .subscribe(function () {
  1249. _this.onInit();
  1250. _this.handlerOneByOne();
  1251. });
  1252. log_1.log();
  1253. });
  1254. };
  1255. return RedirectOnRequest;
  1256. }());
  1257. exports.RedirectOnRequest = RedirectOnRequest;
  1258.  
  1259.  
  1260. /***/ }),
  1261. /* 14 */
  1262. /***/ (function(module, exports, __webpack_require__) {
  1263.  
  1264. /*!
  1265. * in-view 0.6.1 - Get notified when a DOM element enters or exits the viewport.
  1266. * Copyright (c) 2016 Cam Wiegert <cam@camwiegert.com> - https://camwiegert.github.io/in-view
  1267. * License: MIT
  1268. */
  1269. !function(t,e){ true?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.inView=e():t.inView=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}var i=n(2),o=r(i);t.exports=o["default"]},function(t,e){function n(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(9),o=r(i),u=n(3),f=r(u),s=n(4),c=function(){if("undefined"!=typeof window){var t=100,e=["scroll","resize","load"],n={history:[]},r={offset:{},threshold:0,test:s.inViewport},i=(0,o["default"])(function(){n.history.forEach(function(t){n[t].check()})},t);e.forEach(function(t){return addEventListener(t,i)}),window.MutationObserver&&addEventListener("DOMContentLoaded",function(){new MutationObserver(i).observe(document.body,{attributes:!0,childList:!0,subtree:!0})});var u=function(t){if("string"==typeof t){var e=[].slice.call(document.querySelectorAll(t));return n.history.indexOf(t)>-1?n[t].elements=e:(n[t]=(0,f["default"])(e,r),n.history.push(t)),n[t]}};return u.offset=function(t){if(void 0===t)return r.offset;var e=function(t){return"number"==typeof t};return["top","right","bottom","left"].forEach(e(t)?function(e){return r.offset[e]=t}:function(n){return e(t[n])?r.offset[n]=t[n]:null}),r.offset},u.threshold=function(t){return"number"==typeof t&&t>=0&&t<=1?r.threshold=t:r.threshold},u.test=function(t){return"function"==typeof t?r.test=t:r.test},u.is=function(t){return r.test(t,r)},u.offset(0),u}};e["default"]=c()},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=function(){function t(e,r){n(this,t),this.options=r,this.elements=e,this.current=[],this.handlers={enter:[],exit:[]},this.singles={enter:[],exit:[]}}return r(t,[{key:"check",value:function(){var t=this;return this.elements.forEach(function(e){var n=t.options.test(e,t.options),r=t.current.indexOf(e),i=r>-1,o=n&&!i,u=!n&&i;o&&(t.current.push(e),t.emit("enter",e)),u&&(t.current.splice(r,1),t.emit("exit",e))}),this}},{key:"on",value:function(t,e){return this.handlers[t].push(e),this}},{key:"once",value:function(t,e){return this.singles[t].unshift(e),this}},{key:"emit",value:function(t,e){for(;this.singles[t].length;)this.singles[t].pop()(e);for(var n=this.handlers[t].length;--n>-1;)this.handlers[t][n](e);return this}}]),t}();e["default"]=function(t,e){return new i(t,e)}},function(t,e){"use strict";function n(t,e){var n=t.getBoundingClientRect(),r=n.top,i=n.right,o=n.bottom,u=n.left,f=n.width,s=n.height,c={t:o,r:window.innerWidth-u,b:window.innerHeight-r,l:i},a={x:e.threshold*f,y:e.threshold*s};return c.t>e.offset.top+a.y&&c.r>e.offset.right+a.x&&c.b>e.offset.bottom+a.y&&c.l>e.offset.left+a.x}Object.defineProperty(e,"__esModule",{value:!0}),e.inViewport=n},function(t,e){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(e,function(){return this}())},function(t,e,n){var r=n(5),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e,n){function r(t,e,n){function r(e){var n=x,r=m;return x=m=void 0,E=e,w=t.apply(r,n)}function a(t){return E=t,j=setTimeout(h,e),M?r(t):w}function l(t){var n=t-O,r=t-E,i=e-n;return _?c(i,g-r):i}function d(t){var n=t-O,r=t-E;return void 0===O||n>=e||n<0||_&&r>=g}function h(){var t=o();return d(t)?p(t):void(j=setTimeout(h,l(t)))}function p(t){return j=void 0,T&&x?r(t):(x=m=void 0,w)}function v(){void 0!==j&&clearTimeout(j),E=0,x=O=m=j=void 0}function y(){return void 0===j?w:p(o())}function b(){var t=o(),n=d(t);if(x=arguments,m=this,O=t,n){if(void 0===j)return a(O);if(_)return j=setTimeout(h,e),r(O)}return void 0===j&&(j=setTimeout(h,e)),w}var x,m,g,w,j,O,E=0,M=!1,_=!1,T=!0;if("function"!=typeof t)throw new TypeError(f);return e=u(e)||0,i(n)&&(M=!!n.leading,_="maxWait"in n,g=_?s(u(n.maxWait)||0,e):g,T="trailing"in n?!!n.trailing:T),b.cancel=v,b.flush=y,b}var i=n(1),o=n(8),u=n(10),f="Expected a function",s=Math.max,c=Math.min;t.exports=r},function(t,e,n){var r=n(6),i=function(){return r.Date.now()};t.exports=i},function(t,e,n){function r(t,e,n){var r=!0,f=!0;if("function"!=typeof t)throw new TypeError(u);return o(n)&&(r="leading"in n?!!n.leading:r,f="trailing"in n?!!n.trailing:f),i(t,e,{leading:r,maxWait:e,trailing:f})}var i=n(7),o=n(1),u="Expected a function";t.exports=r},function(t,e){function n(t){return t}t.exports=n}])});
  1270.  
  1271. /***/ }),
  1272. /* 15 */
  1273. /***/ (function(module, exports, __webpack_require__) {
  1274.  
  1275. "use strict";
  1276.  
  1277. var Observable_1 = __webpack_require__(0);
  1278. /**
  1279. * Represents a push-based event or value that an {@link Observable} can emit.
  1280. * This class is particularly useful for operators that manage notifications,
  1281. * like {@link materialize}, {@link dematerialize}, {@link observeOn}, and
  1282. * others. Besides wrapping the actual delivered value, it also annotates it
  1283. * with metadata of, for instance, what type of push message it is (`next`,
  1284. * `error`, or `complete`).
  1285. *
  1286. * @see {@link materialize}
  1287. * @see {@link dematerialize}
  1288. * @see {@link observeOn}
  1289. *
  1290. * @class Notification<T>
  1291. */
  1292. var Notification = (function () {
  1293. function Notification(kind, value, error) {
  1294. this.kind = kind;
  1295. this.value = value;
  1296. this.error = error;
  1297. this.hasValue = kind === 'N';
  1298. }
  1299. /**
  1300. * Delivers to the given `observer` the value wrapped by this Notification.
  1301. * @param {Observer} observer
  1302. * @return
  1303. */
  1304. Notification.prototype.observe = function (observer) {
  1305. switch (this.kind) {
  1306. case 'N':
  1307. return observer.next && observer.next(this.value);
  1308. case 'E':
  1309. return observer.error && observer.error(this.error);
  1310. case 'C':
  1311. return observer.complete && observer.complete();
  1312. }
  1313. };
  1314. /**
  1315. * Given some {@link Observer} callbacks, deliver the value represented by the
  1316. * current Notification to the correctly corresponding callback.
  1317. * @param {function(value: T): void} next An Observer `next` callback.
  1318. * @param {function(err: any): void} [error] An Observer `error` callback.
  1319. * @param {function(): void} [complete] An Observer `complete` callback.
  1320. * @return {any}
  1321. */
  1322. Notification.prototype.do = function (next, error, complete) {
  1323. var kind = this.kind;
  1324. switch (kind) {
  1325. case 'N':
  1326. return next && next(this.value);
  1327. case 'E':
  1328. return error && error(this.error);
  1329. case 'C':
  1330. return complete && complete();
  1331. }
  1332. };
  1333. /**
  1334. * Takes an Observer or its individual callback functions, and calls `observe`
  1335. * or `do` methods accordingly.
  1336. * @param {Observer|function(value: T): void} nextOrObserver An Observer or
  1337. * the `next` callback.
  1338. * @param {function(err: any): void} [error] An Observer `error` callback.
  1339. * @param {function(): void} [complete] An Observer `complete` callback.
  1340. * @return {any}
  1341. */
  1342. Notification.prototype.accept = function (nextOrObserver, error, complete) {
  1343. if (nextOrObserver && typeof nextOrObserver.next === 'function') {
  1344. return this.observe(nextOrObserver);
  1345. }
  1346. else {
  1347. return this.do(nextOrObserver, error, complete);
  1348. }
  1349. };
  1350. /**
  1351. * Returns a simple Observable that just delivers the notification represented
  1352. * by this Notification instance.
  1353. * @return {any}
  1354. */
  1355. Notification.prototype.toObservable = function () {
  1356. var kind = this.kind;
  1357. switch (kind) {
  1358. case 'N':
  1359. return Observable_1.Observable.of(this.value);
  1360. case 'E':
  1361. return Observable_1.Observable.throw(this.error);
  1362. case 'C':
  1363. return Observable_1.Observable.empty();
  1364. }
  1365. throw new Error('unexpected notification kind value');
  1366. };
  1367. /**
  1368. * A shortcut to create a Notification instance of the type `next` from a
  1369. * given value.
  1370. * @param {T} value The `next` value.
  1371. * @return {Notification<T>} The "next" Notification representing the
  1372. * argument.
  1373. */
  1374. Notification.createNext = function (value) {
  1375. if (typeof value !== 'undefined') {
  1376. return new Notification('N', value);
  1377. }
  1378. return this.undefinedValueNotification;
  1379. };
  1380. /**
  1381. * A shortcut to create a Notification instance of the type `error` from a
  1382. * given error.
  1383. * @param {any} [err] The `error` error.
  1384. * @return {Notification<T>} The "error" Notification representing the
  1385. * argument.
  1386. */
  1387. Notification.createError = function (err) {
  1388. return new Notification('E', undefined, err);
  1389. };
  1390. /**
  1391. * A shortcut to create a Notification instance of the type `complete`.
  1392. * @return {Notification<any>} The valueless "complete" Notification.
  1393. */
  1394. Notification.createComplete = function () {
  1395. return this.completeNotification;
  1396. };
  1397. Notification.completeNotification = new Notification('C');
  1398. Notification.undefinedValueNotification = new Notification('N', undefined);
  1399. return Notification;
  1400. }());
  1401. exports.Notification = Notification;
  1402. //# sourceMappingURL=Notification.js.map
  1403.  
  1404. /***/ }),
  1405. /* 16 */
  1406. /***/ (function(module, exports, __webpack_require__) {
  1407.  
  1408. "use strict";
  1409.  
  1410. exports.empty = {
  1411. closed: true,
  1412. next: function (value) { },
  1413. error: function (err) { throw err; },
  1414. complete: function () { }
  1415. };
  1416. //# sourceMappingURL=Observer.js.map
  1417.  
  1418. /***/ }),
  1419. /* 17 */
  1420. /***/ (function(module, exports, __webpack_require__) {
  1421.  
  1422. "use strict";
  1423.  
  1424. var __extends = (this && this.__extends) || function (d, b) {
  1425. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  1426. function __() { this.constructor = d; }
  1427. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  1428. };
  1429. var Subscriber_1 = __webpack_require__(1);
  1430. /**
  1431. * We need this JSDoc comment for affecting ESDoc.
  1432. * @ignore
  1433. * @extends {Ignored}
  1434. */
  1435. var OuterSubscriber = (function (_super) {
  1436. __extends(OuterSubscriber, _super);
  1437. function OuterSubscriber() {
  1438. _super.apply(this, arguments);
  1439. }
  1440. OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  1441. this.destination.next(innerValue);
  1442. };
  1443. OuterSubscriber.prototype.notifyError = function (error, innerSub) {
  1444. this.destination.error(error);
  1445. };
  1446. OuterSubscriber.prototype.notifyComplete = function (innerSub) {
  1447. this.destination.complete();
  1448. };
  1449. return OuterSubscriber;
  1450. }(Subscriber_1.Subscriber));
  1451. exports.OuterSubscriber = OuterSubscriber;
  1452. //# sourceMappingURL=OuterSubscriber.js.map
  1453.  
  1454. /***/ }),
  1455. /* 18 */
  1456. /***/ (function(module, exports, __webpack_require__) {
  1457.  
  1458. "use strict";
  1459.  
  1460. var __extends = (this && this.__extends) || function (d, b) {
  1461. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  1462. function __() { this.constructor = d; }
  1463. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  1464. };
  1465. var Observable_1 = __webpack_require__(0);
  1466. var ScalarObservable_1 = __webpack_require__(19);
  1467. var EmptyObservable_1 = __webpack_require__(6);
  1468. var isScheduler_1 = __webpack_require__(82);
  1469. /**
  1470. * We need this JSDoc comment for affecting ESDoc.
  1471. * @extends {Ignored}
  1472. * @hide true
  1473. */
  1474. var ArrayObservable = (function (_super) {
  1475. __extends(ArrayObservable, _super);
  1476. function ArrayObservable(array, scheduler) {
  1477. _super.call(this);
  1478. this.array = array;
  1479. this.scheduler = scheduler;
  1480. if (!scheduler && array.length === 1) {
  1481. this._isScalar = true;
  1482. this.value = array[0];
  1483. }
  1484. }
  1485. ArrayObservable.create = function (array, scheduler) {
  1486. return new ArrayObservable(array, scheduler);
  1487. };
  1488. /**
  1489. * Creates an Observable that emits some values you specify as arguments,
  1490. * immediately one after the other, and then emits a complete notification.
  1491. *
  1492. * <span class="informal">Emits the arguments you provide, then completes.
  1493. * </span>
  1494. *
  1495. * <img src="./img/of.png" width="100%">
  1496. *
  1497. * This static operator is useful for creating a simple Observable that only
  1498. * emits the arguments given, and the complete notification thereafter. It can
  1499. * be used for composing with other Observables, such as with {@link concat}.
  1500. * By default, it uses a `null` IScheduler, which means the `next`
  1501. * notifications are sent synchronously, although with a different IScheduler
  1502. * it is possible to determine when those notifications will be delivered.
  1503. *
  1504. * @example <caption>Emit 10, 20, 30, then 'a', 'b', 'c', then start ticking every second.</caption>
  1505. * var numbers = Rx.Observable.of(10, 20, 30);
  1506. * var letters = Rx.Observable.of('a', 'b', 'c');
  1507. * var interval = Rx.Observable.interval(1000);
  1508. * var result = numbers.concat(letters).concat(interval);
  1509. * result.subscribe(x => console.log(x));
  1510. *
  1511. * @see {@link create}
  1512. * @see {@link empty}
  1513. * @see {@link never}
  1514. * @see {@link throw}
  1515. *
  1516. * @param {...T} values Arguments that represent `next` values to be emitted.
  1517. * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling
  1518. * the emissions of the `next` notifications.
  1519. * @return {Observable<T>} An Observable that emits each given input value.
  1520. * @static true
  1521. * @name of
  1522. * @owner Observable
  1523. */
  1524. ArrayObservable.of = function () {
  1525. var array = [];
  1526. for (var _i = 0; _i < arguments.length; _i++) {
  1527. array[_i - 0] = arguments[_i];
  1528. }
  1529. var scheduler = array[array.length - 1];
  1530. if (isScheduler_1.isScheduler(scheduler)) {
  1531. array.pop();
  1532. }
  1533. else {
  1534. scheduler = null;
  1535. }
  1536. var len = array.length;
  1537. if (len > 1) {
  1538. return new ArrayObservable(array, scheduler);
  1539. }
  1540. else if (len === 1) {
  1541. return new ScalarObservable_1.ScalarObservable(array[0], scheduler);
  1542. }
  1543. else {
  1544. return new EmptyObservable_1.EmptyObservable(scheduler);
  1545. }
  1546. };
  1547. ArrayObservable.dispatch = function (state) {
  1548. var array = state.array, index = state.index, count = state.count, subscriber = state.subscriber;
  1549. if (index >= count) {
  1550. subscriber.complete();
  1551. return;
  1552. }
  1553. subscriber.next(array[index]);
  1554. if (subscriber.closed) {
  1555. return;
  1556. }
  1557. state.index = index + 1;
  1558. this.schedule(state);
  1559. };
  1560. ArrayObservable.prototype._subscribe = function (subscriber) {
  1561. var index = 0;
  1562. var array = this.array;
  1563. var count = array.length;
  1564. var scheduler = this.scheduler;
  1565. if (scheduler) {
  1566. return scheduler.schedule(ArrayObservable.dispatch, 0, {
  1567. array: array, index: index, count: count, subscriber: subscriber
  1568. });
  1569. }
  1570. else {
  1571. for (var i = 0; i < count && !subscriber.closed; i++) {
  1572. subscriber.next(array[i]);
  1573. }
  1574. subscriber.complete();
  1575. }
  1576. };
  1577. return ArrayObservable;
  1578. }(Observable_1.Observable));
  1579. exports.ArrayObservable = ArrayObservable;
  1580. //# sourceMappingURL=ArrayObservable.js.map
  1581.  
  1582. /***/ }),
  1583. /* 19 */
  1584. /***/ (function(module, exports, __webpack_require__) {
  1585.  
  1586. "use strict";
  1587.  
  1588. var __extends = (this && this.__extends) || function (d, b) {
  1589. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  1590. function __() { this.constructor = d; }
  1591. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  1592. };
  1593. var Observable_1 = __webpack_require__(0);
  1594. /**
  1595. * We need this JSDoc comment for affecting ESDoc.
  1596. * @extends {Ignored}
  1597. * @hide true
  1598. */
  1599. var ScalarObservable = (function (_super) {
  1600. __extends(ScalarObservable, _super);
  1601. function ScalarObservable(value, scheduler) {
  1602. _super.call(this);
  1603. this.value = value;
  1604. this.scheduler = scheduler;
  1605. this._isScalar = true;
  1606. if (scheduler) {
  1607. this._isScalar = false;
  1608. }
  1609. }
  1610. ScalarObservable.create = function (value, scheduler) {
  1611. return new ScalarObservable(value, scheduler);
  1612. };
  1613. ScalarObservable.dispatch = function (state) {
  1614. var done = state.done, value = state.value, subscriber = state.subscriber;
  1615. if (done) {
  1616. subscriber.complete();
  1617. return;
  1618. }
  1619. subscriber.next(value);
  1620. if (subscriber.closed) {
  1621. return;
  1622. }
  1623. state.done = true;
  1624. this.schedule(state);
  1625. };
  1626. ScalarObservable.prototype._subscribe = function (subscriber) {
  1627. var value = this.value;
  1628. var scheduler = this.scheduler;
  1629. if (scheduler) {
  1630. return scheduler.schedule(ScalarObservable.dispatch, 0, {
  1631. done: false, value: value, subscriber: subscriber
  1632. });
  1633. }
  1634. else {
  1635. subscriber.next(value);
  1636. if (!subscriber.closed) {
  1637. subscriber.complete();
  1638. }
  1639. }
  1640. };
  1641. return ScalarObservable;
  1642. }(Observable_1.Observable));
  1643. exports.ScalarObservable = ScalarObservable;
  1644. //# sourceMappingURL=ScalarObservable.js.map
  1645.  
  1646. /***/ }),
  1647. /* 20 */
  1648. /***/ (function(module, exports, __webpack_require__) {
  1649.  
  1650. "use strict";
  1651.  
  1652. var root_1 = __webpack_require__(2);
  1653. var Symbol = root_1.root.Symbol;
  1654. exports.$$rxSubscriber = (typeof Symbol === 'function' && typeof Symbol.for === 'function') ?
  1655. Symbol.for('rxSubscriber') : '@@rxSubscriber';
  1656. //# sourceMappingURL=rxSubscriber.js.map
  1657.  
  1658. /***/ }),
  1659. /* 21 */
  1660. /***/ (function(module, exports, __webpack_require__) {
  1661.  
  1662. "use strict";
  1663.  
  1664. exports.isArrayLike = (function (x) { return x && typeof x.length === 'number'; });
  1665. //# sourceMappingURL=isArrayLike.js.map
  1666.  
  1667. /***/ }),
  1668. /* 22 */
  1669. /***/ (function(module, exports, __webpack_require__) {
  1670.  
  1671. "use strict";
  1672.  
  1673. function isDate(value) {
  1674. return value instanceof Date && !isNaN(+value);
  1675. }
  1676. exports.isDate = isDate;
  1677. //# sourceMappingURL=isDate.js.map
  1678.  
  1679. /***/ }),
  1680. /* 23 */
  1681. /***/ (function(module, exports, __webpack_require__) {
  1682.  
  1683. "use strict";
  1684.  
  1685. function isObject(x) {
  1686. return x != null && typeof x === 'object';
  1687. }
  1688. exports.isObject = isObject;
  1689. //# sourceMappingURL=isObject.js.map
  1690.  
  1691. /***/ }),
  1692. /* 24 */
  1693. /***/ (function(module, exports, __webpack_require__) {
  1694.  
  1695. "use strict";
  1696.  
  1697. function isPromise(value) {
  1698. return value && typeof value.subscribe !== 'function' && typeof value.then === 'function';
  1699. }
  1700. exports.isPromise = isPromise;
  1701. //# sourceMappingURL=isPromise.js.map
  1702.  
  1703. /***/ }),
  1704. /* 25 */
  1705. /***/ (function(module, exports, __webpack_require__) {
  1706.  
  1707. "use strict";
  1708.  
  1709. var root_1 = __webpack_require__(2);
  1710. var isArrayLike_1 = __webpack_require__(21);
  1711. var isPromise_1 = __webpack_require__(24);
  1712. var isObject_1 = __webpack_require__(23);
  1713. var Observable_1 = __webpack_require__(0);
  1714. var iterator_1 = __webpack_require__(7);
  1715. var InnerSubscriber_1 = __webpack_require__(55);
  1716. var observable_1 = __webpack_require__(8);
  1717. function subscribeToResult(outerSubscriber, result, outerValue, outerIndex) {
  1718. var destination = new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex);
  1719. if (destination.closed) {
  1720. return null;
  1721. }
  1722. if (result instanceof Observable_1.Observable) {
  1723. if (result._isScalar) {
  1724. destination.next(result.value);
  1725. destination.complete();
  1726. return null;
  1727. }
  1728. else {
  1729. return result.subscribe(destination);
  1730. }
  1731. }
  1732. else if (isArrayLike_1.isArrayLike(result)) {
  1733. for (var i = 0, len = result.length; i < len && !destination.closed; i++) {
  1734. destination.next(result[i]);
  1735. }
  1736. if (!destination.closed) {
  1737. destination.complete();
  1738. }
  1739. }
  1740. else if (isPromise_1.isPromise(result)) {
  1741. result.then(function (value) {
  1742. if (!destination.closed) {
  1743. destination.next(value);
  1744. destination.complete();
  1745. }
  1746. }, function (err) { return destination.error(err); })
  1747. .then(null, function (err) {
  1748. // Escaping the Promise trap: globally throw unhandled errors
  1749. root_1.root.setTimeout(function () { throw err; });
  1750. });
  1751. return destination;
  1752. }
  1753. else if (result && typeof result[iterator_1.$$iterator] === 'function') {
  1754. var iterator = result[iterator_1.$$iterator]();
  1755. do {
  1756. var item = iterator.next();
  1757. if (item.done) {
  1758. destination.complete();
  1759. break;
  1760. }
  1761. destination.next(item.value);
  1762. if (destination.closed) {
  1763. break;
  1764. }
  1765. } while (true);
  1766. }
  1767. else if (result && typeof result[observable_1.$$observable] === 'function') {
  1768. var obs = result[observable_1.$$observable]();
  1769. if (typeof obs.subscribe !== 'function') {
  1770. destination.error(new TypeError('Provided object does not correctly implement Symbol.observable'));
  1771. }
  1772. else {
  1773. return obs.subscribe(new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex));
  1774. }
  1775. }
  1776. else {
  1777. var value = isObject_1.isObject(result) ? 'an invalid object' : "'" + result + "'";
  1778. var msg = ("You provided " + value + " where a stream was expected.")
  1779. + ' You can provide an Observable, Promise, Array, or Iterable.';
  1780. destination.error(new TypeError(msg));
  1781. }
  1782. return null;
  1783. }
  1784. exports.subscribeToResult = subscribeToResult;
  1785. //# sourceMappingURL=subscribeToResult.js.map
  1786.  
  1787. /***/ }),
  1788. /* 26 */
  1789. /***/ (function(module, exports, __webpack_require__) {
  1790.  
  1791. "use strict";
  1792.  
  1793. var errorObject_1 = __webpack_require__(9);
  1794. var tryCatchTarget;
  1795. function tryCatcher() {
  1796. try {
  1797. return tryCatchTarget.apply(this, arguments);
  1798. }
  1799. catch (e) {
  1800. errorObject_1.errorObject.e = e;
  1801. return errorObject_1.errorObject;
  1802. }
  1803. }
  1804. function tryCatch(fn) {
  1805. tryCatchTarget = fn;
  1806. return tryCatcher;
  1807. }
  1808. exports.tryCatch = tryCatch;
  1809. ;
  1810. //# sourceMappingURL=tryCatch.js.map
  1811.  
  1812. /***/ }),
  1813. /* 27 */
  1814. /***/ (function(module, exports, __webpack_require__) {
  1815.  
  1816. "use strict";
  1817.  
  1818. Object.defineProperty(exports, "__esModule", { value: true });
  1819. /**
  1820. * Created by axetroy on 16-11-12.
  1821. */
  1822. var CONFIG = {
  1823. debug: false
  1824. };
  1825. exports.CONFIG = CONFIG;
  1826.  
  1827.  
  1828. /***/ }),
  1829. /* 28 */
  1830. /***/ (function(module, exports, __webpack_require__) {
  1831.  
  1832. "use strict";
  1833. /**
  1834. * Created by axetroy on 16-11-18.
  1835. */
  1836.  
  1837. Object.defineProperty(exports, "__esModule", { value: true });
  1838. var _ = __webpack_require__(30);
  1839. var log = _.once(function (project) {
  1840. console.log("%c Anti-Redirect %c Copyright \xa9 2015-%s %s", 'font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;font-size:64px;color:#00bbee;-webkit-text-fill-color:#00bbee;-webkit-text-stroke: 1px #00bbee;', "font-size:12px;color:#999999;", (new Date).getFullYear(), '\n' + (project || ''));
  1841. });
  1842. exports.log = log;
  1843.  
  1844.  
  1845. /***/ }),
  1846. /* 29 */
  1847. /***/ (function(module, exports, __webpack_require__) {
  1848.  
  1849. "use strict";
  1850. /**
  1851. * Created by axetroy on 16-11-18.
  1852. */
  1853.  
  1854. Object.defineProperty(exports, "__esModule", { value: true });
  1855. var Query = (function () {
  1856. function Query(queryStr) {
  1857. if (queryStr === void 0) { queryStr = ''; }
  1858. this.queryStr = queryStr;
  1859. this.object = {};
  1860. this.object = this.toObject(queryStr.replace(/^\?+/, ''));
  1861. }
  1862. Query.prototype.toObject = function (queryStr) {
  1863. var obj = {};
  1864. queryStr.split('&').forEach(function (item) {
  1865. var arr = item.split('=') || [];
  1866. var key = arr[0] || '';
  1867. var value = arr[1] || '';
  1868. try {
  1869. key = decodeURIComponent(arr[0] || '');
  1870. value = decodeURIComponent(arr[1] || '');
  1871. }
  1872. catch (err) {
  1873. }
  1874. key && (obj[key] = value);
  1875. });
  1876. return obj;
  1877. };
  1878. Query.prototype.toString = function () {
  1879. var arr = [];
  1880. for (var key in this.object) {
  1881. if (this.object.hasOwnProperty(key)) {
  1882. var value = this.object[key];
  1883. arr.push(key + '=' + value);
  1884. }
  1885. }
  1886. return arr.length ? '?' + arr.join('&') : '';
  1887. };
  1888. return Query;
  1889. }());
  1890. exports.default = Query;
  1891.  
  1892.  
  1893. /***/ }),
  1894. /* 30 */
  1895. /***/ (function(module, exports, __webpack_require__) {
  1896.  
  1897. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Underscore.js 1.8.3
  1898. // http://underscorejs.org
  1899. // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1900. // Underscore may be freely distributed under the MIT license.
  1901.  
  1902. (function() {
  1903.  
  1904. // Baseline setup
  1905. // --------------
  1906.  
  1907. // Establish the root object, `window` in the browser, or `exports` on the server.
  1908. var root = this;
  1909.  
  1910. // Save the previous value of the `_` variable.
  1911. var previousUnderscore = root._;
  1912.  
  1913. // Save bytes in the minified (but not gzipped) version:
  1914. var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
  1915.  
  1916. // Create quick reference variables for speed access to core prototypes.
  1917. var
  1918. push = ArrayProto.push,
  1919. slice = ArrayProto.slice,
  1920. toString = ObjProto.toString,
  1921. hasOwnProperty = ObjProto.hasOwnProperty;
  1922.  
  1923. // All **ECMAScript 5** native function implementations that we hope to use
  1924. // are declared here.
  1925. var
  1926. nativeIsArray = Array.isArray,
  1927. nativeKeys = Object.keys,
  1928. nativeBind = FuncProto.bind,
  1929. nativeCreate = Object.create;
  1930.  
  1931. // Naked function reference for surrogate-prototype-swapping.
  1932. var Ctor = function(){};
  1933.  
  1934. // Create a safe reference to the Underscore object for use below.
  1935. var _ = function(obj) {
  1936. if (obj instanceof _) return obj;
  1937. if (!(this instanceof _)) return new _(obj);
  1938. this._wrapped = obj;
  1939. };
  1940.  
  1941. // Export the Underscore object for **Node.js**, with
  1942. // backwards-compatibility for the old `require()` API. If we're in
  1943. // the browser, add `_` as a global object.
  1944. if (true) {
  1945. if (typeof module !== 'undefined' && module.exports) {
  1946. exports = module.exports = _;
  1947. }
  1948. exports._ = _;
  1949. } else {
  1950. root._ = _;
  1951. }
  1952.  
  1953. // Current version.
  1954. _.VERSION = '1.8.3';
  1955.  
  1956. // Internal function that returns an efficient (for current engines) version
  1957. // of the passed-in callback, to be repeatedly applied in other Underscore
  1958. // functions.
  1959. var optimizeCb = function(func, context, argCount) {
  1960. if (context === void 0) return func;
  1961. switch (argCount == null ? 3 : argCount) {
  1962. case 1: return function(value) {
  1963. return func.call(context, value);
  1964. };
  1965. case 2: return function(value, other) {
  1966. return func.call(context, value, other);
  1967. };
  1968. case 3: return function(value, index, collection) {
  1969. return func.call(context, value, index, collection);
  1970. };
  1971. case 4: return function(accumulator, value, index, collection) {
  1972. return func.call(context, accumulator, value, index, collection);
  1973. };
  1974. }
  1975. return function() {
  1976. return func.apply(context, arguments);
  1977. };
  1978. };
  1979.  
  1980. // A mostly-internal function to generate callbacks that can be applied
  1981. // to each element in a collection, returning the desired result — either
  1982. // identity, an arbitrary callback, a property matcher, or a property accessor.
  1983. var cb = function(value, context, argCount) {
  1984. if (value == null) return _.identity;
  1985. if (_.isFunction(value)) return optimizeCb(value, context, argCount);
  1986. if (_.isObject(value)) return _.matcher(value);
  1987. return _.property(value);
  1988. };
  1989. _.iteratee = function(value, context) {
  1990. return cb(value, context, Infinity);
  1991. };
  1992.  
  1993. // An internal function for creating assigner functions.
  1994. var createAssigner = function(keysFunc, undefinedOnly) {
  1995. return function(obj) {
  1996. var length = arguments.length;
  1997. if (length < 2 || obj == null) return obj;
  1998. for (var index = 1; index < length; index++) {
  1999. var source = arguments[index],
  2000. keys = keysFunc(source),
  2001. l = keys.length;
  2002. for (var i = 0; i < l; i++) {
  2003. var key = keys[i];
  2004. if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];
  2005. }
  2006. }
  2007. return obj;
  2008. };
  2009. };
  2010.  
  2011. // An internal function for creating a new object that inherits from another.
  2012. var baseCreate = function(prototype) {
  2013. if (!_.isObject(prototype)) return {};
  2014. if (nativeCreate) return nativeCreate(prototype);
  2015. Ctor.prototype = prototype;
  2016. var result = new Ctor;
  2017. Ctor.prototype = null;
  2018. return result;
  2019. };
  2020.  
  2021. var property = function(key) {
  2022. return function(obj) {
  2023. return obj == null ? void 0 : obj[key];
  2024. };
  2025. };
  2026.  
  2027. // Helper for collection methods to determine whether a collection
  2028. // should be iterated as an array or as an object
  2029. // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
  2030. // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
  2031. var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
  2032. var getLength = property('length');
  2033. var isArrayLike = function(collection) {
  2034. var length = getLength(collection);
  2035. return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;
  2036. };
  2037.  
  2038. // Collection Functions
  2039. // --------------------
  2040.  
  2041. // The cornerstone, an `each` implementation, aka `forEach`.
  2042. // Handles raw objects in addition to array-likes. Treats all
  2043. // sparse array-likes as if they were dense.
  2044. _.each = _.forEach = function(obj, iteratee, context) {
  2045. iteratee = optimizeCb(iteratee, context);
  2046. var i, length;
  2047. if (isArrayLike(obj)) {
  2048. for (i = 0, length = obj.length; i < length; i++) {
  2049. iteratee(obj[i], i, obj);
  2050. }
  2051. } else {
  2052. var keys = _.keys(obj);
  2053. for (i = 0, length = keys.length; i < length; i++) {
  2054. iteratee(obj[keys[i]], keys[i], obj);
  2055. }
  2056. }
  2057. return obj;
  2058. };
  2059.  
  2060. // Return the results of applying the iteratee to each element.
  2061. _.map = _.collect = function(obj, iteratee, context) {
  2062. iteratee = cb(iteratee, context);
  2063. var keys = !isArrayLike(obj) && _.keys(obj),
  2064. length = (keys || obj).length,
  2065. results = Array(length);
  2066. for (var index = 0; index < length; index++) {
  2067. var currentKey = keys ? keys[index] : index;
  2068. results[index] = iteratee(obj[currentKey], currentKey, obj);
  2069. }
  2070. return results;
  2071. };
  2072.  
  2073. // Create a reducing function iterating left or right.
  2074. function createReduce(dir) {
  2075. // Optimized iterator function as using arguments.length
  2076. // in the main function will deoptimize the, see #1991.
  2077. function iterator(obj, iteratee, memo, keys, index, length) {
  2078. for (; index >= 0 && index < length; index += dir) {
  2079. var currentKey = keys ? keys[index] : index;
  2080. memo = iteratee(memo, obj[currentKey], currentKey, obj);
  2081. }
  2082. return memo;
  2083. }
  2084.  
  2085. return function(obj, iteratee, memo, context) {
  2086. iteratee = optimizeCb(iteratee, context, 4);
  2087. var keys = !isArrayLike(obj) && _.keys(obj),
  2088. length = (keys || obj).length,
  2089. index = dir > 0 ? 0 : length - 1;
  2090. // Determine the initial value if none is provided.
  2091. if (arguments.length < 3) {
  2092. memo = obj[keys ? keys[index] : index];
  2093. index += dir;
  2094. }
  2095. return iterator(obj, iteratee, memo, keys, index, length);
  2096. };
  2097. }
  2098.  
  2099. // **Reduce** builds up a single result from a list of values, aka `inject`,
  2100. // or `foldl`.
  2101. _.reduce = _.foldl = _.inject = createReduce(1);
  2102.  
  2103. // The right-associative version of reduce, also known as `foldr`.
  2104. _.reduceRight = _.foldr = createReduce(-1);
  2105.  
  2106. // Return the first value which passes a truth test. Aliased as `detect`.
  2107. _.find = _.detect = function(obj, predicate, context) {
  2108. var key;
  2109. if (isArrayLike(obj)) {
  2110. key = _.findIndex(obj, predicate, context);
  2111. } else {
  2112. key = _.findKey(obj, predicate, context);
  2113. }
  2114. if (key !== void 0 && key !== -1) return obj[key];
  2115. };
  2116.  
  2117. // Return all the elements that pass a truth test.
  2118. // Aliased as `select`.
  2119. _.filter = _.select = function(obj, predicate, context) {
  2120. var results = [];
  2121. predicate = cb(predicate, context);
  2122. _.each(obj, function(value, index, list) {
  2123. if (predicate(value, index, list)) results.push(value);
  2124. });
  2125. return results;
  2126. };
  2127.  
  2128. // Return all the elements for which a truth test fails.
  2129. _.reject = function(obj, predicate, context) {
  2130. return _.filter(obj, _.negate(cb(predicate)), context);
  2131. };
  2132.  
  2133. // Determine whether all of the elements match a truth test.
  2134. // Aliased as `all`.
  2135. _.every = _.all = function(obj, predicate, context) {
  2136. predicate = cb(predicate, context);
  2137. var keys = !isArrayLike(obj) && _.keys(obj),
  2138. length = (keys || obj).length;
  2139. for (var index = 0; index < length; index++) {
  2140. var currentKey = keys ? keys[index] : index;
  2141. if (!predicate(obj[currentKey], currentKey, obj)) return false;
  2142. }
  2143. return true;
  2144. };
  2145.  
  2146. // Determine if at least one element in the object matches a truth test.
  2147. // Aliased as `any`.
  2148. _.some = _.any = function(obj, predicate, context) {
  2149. predicate = cb(predicate, context);
  2150. var keys = !isArrayLike(obj) && _.keys(obj),
  2151. length = (keys || obj).length;
  2152. for (var index = 0; index < length; index++) {
  2153. var currentKey = keys ? keys[index] : index;
  2154. if (predicate(obj[currentKey], currentKey, obj)) return true;
  2155. }
  2156. return false;
  2157. };
  2158.  
  2159. // Determine if the array or object contains a given item (using `===`).
  2160. // Aliased as `includes` and `include`.
  2161. _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) {
  2162. if (!isArrayLike(obj)) obj = _.values(obj);
  2163. if (typeof fromIndex != 'number' || guard) fromIndex = 0;
  2164. return _.indexOf(obj, item, fromIndex) >= 0;
  2165. };
  2166.  
  2167. // Invoke a method (with arguments) on every item in a collection.
  2168. _.invoke = function(obj, method) {
  2169. var args = slice.call(arguments, 2);
  2170. var isFunc = _.isFunction(method);
  2171. return _.map(obj, function(value) {
  2172. var func = isFunc ? method : value[method];
  2173. return func == null ? func : func.apply(value, args);
  2174. });
  2175. };
  2176.  
  2177. // Convenience version of a common use case of `map`: fetching a property.
  2178. _.pluck = function(obj, key) {
  2179. return _.map(obj, _.property(key));
  2180. };
  2181.  
  2182. // Convenience version of a common use case of `filter`: selecting only objects
  2183. // containing specific `key:value` pairs.
  2184. _.where = function(obj, attrs) {
  2185. return _.filter(obj, _.matcher(attrs));
  2186. };
  2187.  
  2188. // Convenience version of a common use case of `find`: getting the first object
  2189. // containing specific `key:value` pairs.
  2190. _.findWhere = function(obj, attrs) {
  2191. return _.find(obj, _.matcher(attrs));
  2192. };
  2193.  
  2194. // Return the maximum element (or element-based computation).
  2195. _.max = function(obj, iteratee, context) {
  2196. var result = -Infinity, lastComputed = -Infinity,
  2197. value, computed;
  2198. if (iteratee == null && obj != null) {
  2199. obj = isArrayLike(obj) ? obj : _.values(obj);
  2200. for (var i = 0, length = obj.length; i < length; i++) {
  2201. value = obj[i];
  2202. if (value > result) {
  2203. result = value;
  2204. }
  2205. }
  2206. } else {
  2207. iteratee = cb(iteratee, context);
  2208. _.each(obj, function(value, index, list) {
  2209. computed = iteratee(value, index, list);
  2210. if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
  2211. result = value;
  2212. lastComputed = computed;
  2213. }
  2214. });
  2215. }
  2216. return result;
  2217. };
  2218.  
  2219. // Return the minimum element (or element-based computation).
  2220. _.min = function(obj, iteratee, context) {
  2221. var result = Infinity, lastComputed = Infinity,
  2222. value, computed;
  2223. if (iteratee == null && obj != null) {
  2224. obj = isArrayLike(obj) ? obj : _.values(obj);
  2225. for (var i = 0, length = obj.length; i < length; i++) {
  2226. value = obj[i];
  2227. if (value < result) {
  2228. result = value;
  2229. }
  2230. }
  2231. } else {
  2232. iteratee = cb(iteratee, context);
  2233. _.each(obj, function(value, index, list) {
  2234. computed = iteratee(value, index, list);
  2235. if (computed < lastComputed || computed === Infinity && result === Infinity) {
  2236. result = value;
  2237. lastComputed = computed;
  2238. }
  2239. });
  2240. }
  2241. return result;
  2242. };
  2243.  
  2244. // Shuffle a collection, using the modern version of the
  2245. // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
  2246. _.shuffle = function(obj) {
  2247. var set = isArrayLike(obj) ? obj : _.values(obj);
  2248. var length = set.length;
  2249. var shuffled = Array(length);
  2250. for (var index = 0, rand; index < length; index++) {
  2251. rand = _.random(0, index);
  2252. if (rand !== index) shuffled[index] = shuffled[rand];
  2253. shuffled[rand] = set[index];
  2254. }
  2255. return shuffled;
  2256. };
  2257.  
  2258. // Sample **n** random values from a collection.
  2259. // If **n** is not specified, returns a single random element.
  2260. // The internal `guard` argument allows it to work with `map`.
  2261. _.sample = function(obj, n, guard) {
  2262. if (n == null || guard) {
  2263. if (!isArrayLike(obj)) obj = _.values(obj);
  2264. return obj[_.random(obj.length - 1)];
  2265. }
  2266. return _.shuffle(obj).slice(0, Math.max(0, n));
  2267. };
  2268.  
  2269. // Sort the object's values by a criterion produced by an iteratee.
  2270. _.sortBy = function(obj, iteratee, context) {
  2271. iteratee = cb(iteratee, context);
  2272. return _.pluck(_.map(obj, function(value, index, list) {
  2273. return {
  2274. value: value,
  2275. index: index,
  2276. criteria: iteratee(value, index, list)
  2277. };
  2278. }).sort(function(left, right) {
  2279. var a = left.criteria;
  2280. var b = right.criteria;
  2281. if (a !== b) {
  2282. if (a > b || a === void 0) return 1;
  2283. if (a < b || b === void 0) return -1;
  2284. }
  2285. return left.index - right.index;
  2286. }), 'value');
  2287. };
  2288.  
  2289. // An internal function used for aggregate "group by" operations.
  2290. var group = function(behavior) {
  2291. return function(obj, iteratee, context) {
  2292. var result = {};
  2293. iteratee = cb(iteratee, context);
  2294. _.each(obj, function(value, index) {
  2295. var key = iteratee(value, index, obj);
  2296. behavior(result, value, key);
  2297. });
  2298. return result;
  2299. };
  2300. };
  2301.  
  2302. // Groups the object's values by a criterion. Pass either a string attribute
  2303. // to group by, or a function that returns the criterion.
  2304. _.groupBy = group(function(result, value, key) {
  2305. if (_.has(result, key)) result[key].push(value); else result[key] = [value];
  2306. });
  2307.  
  2308. // Indexes the object's values by a criterion, similar to `groupBy`, but for
  2309. // when you know that your index values will be unique.
  2310. _.indexBy = group(function(result, value, key) {
  2311. result[key] = value;
  2312. });
  2313.  
  2314. // Counts instances of an object that group by a certain criterion. Pass
  2315. // either a string attribute to count by, or a function that returns the
  2316. // criterion.
  2317. _.countBy = group(function(result, value, key) {
  2318. if (_.has(result, key)) result[key]++; else result[key] = 1;
  2319. });
  2320.  
  2321. // Safely create a real, live array from anything iterable.
  2322. _.toArray = function(obj) {
  2323. if (!obj) return [];
  2324. if (_.isArray(obj)) return slice.call(obj);
  2325. if (isArrayLike(obj)) return _.map(obj, _.identity);
  2326. return _.values(obj);
  2327. };
  2328.  
  2329. // Return the number of elements in an object.
  2330. _.size = function(obj) {
  2331. if (obj == null) return 0;
  2332. return isArrayLike(obj) ? obj.length : _.keys(obj).length;
  2333. };
  2334.  
  2335. // Split a collection into two arrays: one whose elements all satisfy the given
  2336. // predicate, and one whose elements all do not satisfy the predicate.
  2337. _.partition = function(obj, predicate, context) {
  2338. predicate = cb(predicate, context);
  2339. var pass = [], fail = [];
  2340. _.each(obj, function(value, key, obj) {
  2341. (predicate(value, key, obj) ? pass : fail).push(value);
  2342. });
  2343. return [pass, fail];
  2344. };
  2345.  
  2346. // Array Functions
  2347. // ---------------
  2348.  
  2349. // Get the first element of an array. Passing **n** will return the first N
  2350. // values in the array. Aliased as `head` and `take`. The **guard** check
  2351. // allows it to work with `_.map`.
  2352. _.first = _.head = _.take = function(array, n, guard) {
  2353. if (array == null) return void 0;
  2354. if (n == null || guard) return array[0];
  2355. return _.initial(array, array.length - n);
  2356. };
  2357.  
  2358. // Returns everything but the last entry of the array. Especially useful on
  2359. // the arguments object. Passing **n** will return all the values in
  2360. // the array, excluding the last N.
  2361. _.initial = function(array, n, guard) {
  2362. return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
  2363. };
  2364.  
  2365. // Get the last element of an array. Passing **n** will return the last N
  2366. // values in the array.
  2367. _.last = function(array, n, guard) {
  2368. if (array == null) return void 0;
  2369. if (n == null || guard) return array[array.length - 1];
  2370. return _.rest(array, Math.max(0, array.length - n));
  2371. };
  2372.  
  2373. // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
  2374. // Especially useful on the arguments object. Passing an **n** will return
  2375. // the rest N values in the array.
  2376. _.rest = _.tail = _.drop = function(array, n, guard) {
  2377. return slice.call(array, n == null || guard ? 1 : n);
  2378. };
  2379.  
  2380. // Trim out all falsy values from an array.
  2381. _.compact = function(array) {
  2382. return _.filter(array, _.identity);
  2383. };
  2384.  
  2385. // Internal implementation of a recursive `flatten` function.
  2386. var flatten = function(input, shallow, strict, startIndex) {
  2387. var output = [], idx = 0;
  2388. for (var i = startIndex || 0, length = getLength(input); i < length; i++) {
  2389. var value = input[i];
  2390. if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {
  2391. //flatten current level of array or arguments object
  2392. if (!shallow) value = flatten(value, shallow, strict);
  2393. var j = 0, len = value.length;
  2394. output.length += len;
  2395. while (j < len) {
  2396. output[idx++] = value[j++];
  2397. }
  2398. } else if (!strict) {
  2399. output[idx++] = value;
  2400. }
  2401. }
  2402. return output;
  2403. };
  2404.  
  2405. // Flatten out an array, either recursively (by default), or just one level.
  2406. _.flatten = function(array, shallow) {
  2407. return flatten(array, shallow, false);
  2408. };
  2409.  
  2410. // Return a version of the array that does not contain the specified value(s).
  2411. _.without = function(array) {
  2412. return _.difference(array, slice.call(arguments, 1));
  2413. };
  2414.  
  2415. // Produce a duplicate-free version of the array. If the array has already
  2416. // been sorted, you have the option of using a faster algorithm.
  2417. // Aliased as `unique`.
  2418. _.uniq = _.unique = function(array, isSorted, iteratee, context) {
  2419. if (!_.isBoolean(isSorted)) {
  2420. context = iteratee;
  2421. iteratee = isSorted;
  2422. isSorted = false;
  2423. }
  2424. if (iteratee != null) iteratee = cb(iteratee, context);
  2425. var result = [];
  2426. var seen = [];
  2427. for (var i = 0, length = getLength(array); i < length; i++) {
  2428. var value = array[i],
  2429. computed = iteratee ? iteratee(value, i, array) : value;
  2430. if (isSorted) {
  2431. if (!i || seen !== computed) result.push(value);
  2432. seen = computed;
  2433. } else if (iteratee) {
  2434. if (!_.contains(seen, computed)) {
  2435. seen.push(computed);
  2436. result.push(value);
  2437. }
  2438. } else if (!_.contains(result, value)) {
  2439. result.push(value);
  2440. }
  2441. }
  2442. return result;
  2443. };
  2444.  
  2445. // Produce an array that contains the union: each distinct element from all of
  2446. // the passed-in arrays.
  2447. _.union = function() {
  2448. return _.uniq(flatten(arguments, true, true));
  2449. };
  2450.  
  2451. // Produce an array that contains every item shared between all the
  2452. // passed-in arrays.
  2453. _.intersection = function(array) {
  2454. var result = [];
  2455. var argsLength = arguments.length;
  2456. for (var i = 0, length = getLength(array); i < length; i++) {
  2457. var item = array[i];
  2458. if (_.contains(result, item)) continue;
  2459. for (var j = 1; j < argsLength; j++) {
  2460. if (!_.contains(arguments[j], item)) break;
  2461. }
  2462. if (j === argsLength) result.push(item);
  2463. }
  2464. return result;
  2465. };
  2466.  
  2467. // Take the difference between one array and a number of other arrays.
  2468. // Only the elements present in just the first array will remain.
  2469. _.difference = function(array) {
  2470. var rest = flatten(arguments, true, true, 1);
  2471. return _.filter(array, function(value){
  2472. return !_.contains(rest, value);
  2473. });
  2474. };
  2475.  
  2476. // Zip together multiple lists into a single array -- elements that share
  2477. // an index go together.
  2478. _.zip = function() {
  2479. return _.unzip(arguments);
  2480. };
  2481.  
  2482. // Complement of _.zip. Unzip accepts an array of arrays and groups
  2483. // each array's elements on shared indices
  2484. _.unzip = function(array) {
  2485. var length = array && _.max(array, getLength).length || 0;
  2486. var result = Array(length);
  2487.  
  2488. for (var index = 0; index < length; index++) {
  2489. result[index] = _.pluck(array, index);
  2490. }
  2491. return result;
  2492. };
  2493.  
  2494. // Converts lists into objects. Pass either a single array of `[key, value]`
  2495. // pairs, or two parallel arrays of the same length -- one of keys, and one of
  2496. // the corresponding values.
  2497. _.object = function(list, values) {
  2498. var result = {};
  2499. for (var i = 0, length = getLength(list); i < length; i++) {
  2500. if (values) {
  2501. result[list[i]] = values[i];
  2502. } else {
  2503. result[list[i][0]] = list[i][1];
  2504. }
  2505. }
  2506. return result;
  2507. };
  2508.  
  2509. // Generator function to create the findIndex and findLastIndex functions
  2510. function createPredicateIndexFinder(dir) {
  2511. return function(array, predicate, context) {
  2512. predicate = cb(predicate, context);
  2513. var length = getLength(array);
  2514. var index = dir > 0 ? 0 : length - 1;
  2515. for (; index >= 0 && index < length; index += dir) {
  2516. if (predicate(array[index], index, array)) return index;
  2517. }
  2518. return -1;
  2519. };
  2520. }
  2521.  
  2522. // Returns the first index on an array-like that passes a predicate test
  2523. _.findIndex = createPredicateIndexFinder(1);
  2524. _.findLastIndex = createPredicateIndexFinder(-1);
  2525.  
  2526. // Use a comparator function to figure out the smallest index at which
  2527. // an object should be inserted so as to maintain order. Uses binary search.
  2528. _.sortedIndex = function(array, obj, iteratee, context) {
  2529. iteratee = cb(iteratee, context, 1);
  2530. var value = iteratee(obj);
  2531. var low = 0, high = getLength(array);
  2532. while (low < high) {
  2533. var mid = Math.floor((low + high) / 2);
  2534. if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
  2535. }
  2536. return low;
  2537. };
  2538.  
  2539. // Generator function to create the indexOf and lastIndexOf functions
  2540. function createIndexFinder(dir, predicateFind, sortedIndex) {
  2541. return function(array, item, idx) {
  2542. var i = 0, length = getLength(array);
  2543. if (typeof idx == 'number') {
  2544. if (dir > 0) {
  2545. i = idx >= 0 ? idx : Math.max(idx + length, i);
  2546. } else {
  2547. length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
  2548. }
  2549. } else if (sortedIndex && idx && length) {
  2550. idx = sortedIndex(array, item);
  2551. return array[idx] === item ? idx : -1;
  2552. }
  2553. if (item !== item) {
  2554. idx = predicateFind(slice.call(array, i, length), _.isNaN);
  2555. return idx >= 0 ? idx + i : -1;
  2556. }
  2557. for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
  2558. if (array[idx] === item) return idx;
  2559. }
  2560. return -1;
  2561. };
  2562. }
  2563.  
  2564. // Return the position of the first occurrence of an item in an array,
  2565. // or -1 if the item is not included in the array.
  2566. // If the array is large and already in sort order, pass `true`
  2567. // for **isSorted** to use binary search.
  2568. _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);
  2569. _.lastIndexOf = createIndexFinder(-1, _.findLastIndex);
  2570.  
  2571. // Generate an integer Array containing an arithmetic progression. A port of
  2572. // the native Python `range()` function. See
  2573. // [the Python documentation](http://docs.python.org/library/functions.html#range).
  2574. _.range = function(start, stop, step) {
  2575. if (stop == null) {
  2576. stop = start || 0;
  2577. start = 0;
  2578. }
  2579. step = step || 1;
  2580.  
  2581. var length = Math.max(Math.ceil((stop - start) / step), 0);
  2582. var range = Array(length);
  2583.  
  2584. for (var idx = 0; idx < length; idx++, start += step) {
  2585. range[idx] = start;
  2586. }
  2587.  
  2588. return range;
  2589. };
  2590.  
  2591. // Function (ahem) Functions
  2592. // ------------------
  2593.  
  2594. // Determines whether to execute a function as a constructor
  2595. // or a normal function with the provided arguments
  2596. var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {
  2597. if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
  2598. var self = baseCreate(sourceFunc.prototype);
  2599. var result = sourceFunc.apply(self, args);
  2600. if (_.isObject(result)) return result;
  2601. return self;
  2602. };
  2603.  
  2604. // Create a function bound to a given object (assigning `this`, and arguments,
  2605. // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
  2606. // available.
  2607. _.bind = function(func, context) {
  2608. if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
  2609. if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');
  2610. var args = slice.call(arguments, 2);
  2611. var bound = function() {
  2612. return executeBound(func, bound, context, this, args.concat(slice.call(arguments)));
  2613. };
  2614. return bound;
  2615. };
  2616.  
  2617. // Partially apply a function by creating a version that has had some of its
  2618. // arguments pre-filled, without changing its dynamic `this` context. _ acts
  2619. // as a placeholder, allowing any combination of arguments to be pre-filled.
  2620. _.partial = function(func) {
  2621. var boundArgs = slice.call(arguments, 1);
  2622. var bound = function() {
  2623. var position = 0, length = boundArgs.length;
  2624. var args = Array(length);
  2625. for (var i = 0; i < length; i++) {
  2626. args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i];
  2627. }
  2628. while (position < arguments.length) args.push(arguments[position++]);
  2629. return executeBound(func, bound, this, this, args);
  2630. };
  2631. return bound;
  2632. };
  2633.  
  2634. // Bind a number of an object's methods to that object. Remaining arguments
  2635. // are the method names to be bound. Useful for ensuring that all callbacks
  2636. // defined on an object belong to it.
  2637. _.bindAll = function(obj) {
  2638. var i, length = arguments.length, key;
  2639. if (length <= 1) throw new Error('bindAll must be passed function names');
  2640. for (i = 1; i < length; i++) {
  2641. key = arguments[i];
  2642. obj[key] = _.bind(obj[key], obj);
  2643. }
  2644. return obj;
  2645. };
  2646.  
  2647. // Memoize an expensive function by storing its results.
  2648. _.memoize = function(func, hasher) {
  2649. var memoize = function(key) {
  2650. var cache = memoize.cache;
  2651. var address = '' + (hasher ? hasher.apply(this, arguments) : key);
  2652. if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);
  2653. return cache[address];
  2654. };
  2655. memoize.cache = {};
  2656. return memoize;
  2657. };
  2658.  
  2659. // Delays a function for the given number of milliseconds, and then calls
  2660. // it with the arguments supplied.
  2661. _.delay = function(func, wait) {
  2662. var args = slice.call(arguments, 2);
  2663. return setTimeout(function(){
  2664. return func.apply(null, args);
  2665. }, wait);
  2666. };
  2667.  
  2668. // Defers a function, scheduling it to run after the current call stack has
  2669. // cleared.
  2670. _.defer = _.partial(_.delay, _, 1);
  2671.  
  2672. // Returns a function, that, when invoked, will only be triggered at most once
  2673. // during a given window of time. Normally, the throttled function will run
  2674. // as much as it can, without ever going more than once per `wait` duration;
  2675. // but if you'd like to disable the execution on the leading edge, pass
  2676. // `{leading: false}`. To disable execution on the trailing edge, ditto.
  2677. _.throttle = function(func, wait, options) {
  2678. var context, args, result;
  2679. var timeout = null;
  2680. var previous = 0;
  2681. if (!options) options = {};
  2682. var later = function() {
  2683. previous = options.leading === false ? 0 : _.now();
  2684. timeout = null;
  2685. result = func.apply(context, args);
  2686. if (!timeout) context = args = null;
  2687. };
  2688. return function() {
  2689. var now = _.now();
  2690. if (!previous && options.leading === false) previous = now;
  2691. var remaining = wait - (now - previous);
  2692. context = this;
  2693. args = arguments;
  2694. if (remaining <= 0 || remaining > wait) {
  2695. if (timeout) {
  2696. clearTimeout(timeout);
  2697. timeout = null;
  2698. }
  2699. previous = now;
  2700. result = func.apply(context, args);
  2701. if (!timeout) context = args = null;
  2702. } else if (!timeout && options.trailing !== false) {
  2703. timeout = setTimeout(later, remaining);
  2704. }
  2705. return result;
  2706. };
  2707. };
  2708.  
  2709. // Returns a function, that, as long as it continues to be invoked, will not
  2710. // be triggered. The function will be called after it stops being called for
  2711. // N milliseconds. If `immediate` is passed, trigger the function on the
  2712. // leading edge, instead of the trailing.
  2713. _.debounce = function(func, wait, immediate) {
  2714. var timeout, args, context, timestamp, result;
  2715.  
  2716. var later = function() {
  2717. var last = _.now() - timestamp;
  2718.  
  2719. if (last < wait && last >= 0) {
  2720. timeout = setTimeout(later, wait - last);
  2721. } else {
  2722. timeout = null;
  2723. if (!immediate) {
  2724. result = func.apply(context, args);
  2725. if (!timeout) context = args = null;
  2726. }
  2727. }
  2728. };
  2729.  
  2730. return function() {
  2731. context = this;
  2732. args = arguments;
  2733. timestamp = _.now();
  2734. var callNow = immediate && !timeout;
  2735. if (!timeout) timeout = setTimeout(later, wait);
  2736. if (callNow) {
  2737. result = func.apply(context, args);
  2738. context = args = null;
  2739. }
  2740.  
  2741. return result;
  2742. };
  2743. };
  2744.  
  2745. // Returns the first function passed as an argument to the second,
  2746. // allowing you to adjust arguments, run code before and after, and
  2747. // conditionally execute the original function.
  2748. _.wrap = function(func, wrapper) {
  2749. return _.partial(wrapper, func);
  2750. };
  2751.  
  2752. // Returns a negated version of the passed-in predicate.
  2753. _.negate = function(predicate) {
  2754. return function() {
  2755. return !predicate.apply(this, arguments);
  2756. };
  2757. };
  2758.  
  2759. // Returns a function that is the composition of a list of functions, each
  2760. // consuming the return value of the function that follows.
  2761. _.compose = function() {
  2762. var args = arguments;
  2763. var start = args.length - 1;
  2764. return function() {
  2765. var i = start;
  2766. var result = args[start].apply(this, arguments);
  2767. while (i--) result = args[i].call(this, result);
  2768. return result;
  2769. };
  2770. };
  2771.  
  2772. // Returns a function that will only be executed on and after the Nth call.
  2773. _.after = function(times, func) {
  2774. return function() {
  2775. if (--times < 1) {
  2776. return func.apply(this, arguments);
  2777. }
  2778. };
  2779. };
  2780.  
  2781. // Returns a function that will only be executed up to (but not including) the Nth call.
  2782. _.before = function(times, func) {
  2783. var memo;
  2784. return function() {
  2785. if (--times > 0) {
  2786. memo = func.apply(this, arguments);
  2787. }
  2788. if (times <= 1) func = null;
  2789. return memo;
  2790. };
  2791. };
  2792.  
  2793. // Returns a function that will be executed at most one time, no matter how
  2794. // often you call it. Useful for lazy initialization.
  2795. _.once = _.partial(_.before, 2);
  2796.  
  2797. // Object Functions
  2798. // ----------------
  2799.  
  2800. // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
  2801. var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
  2802. var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
  2803. 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
  2804.  
  2805. function collectNonEnumProps(obj, keys) {
  2806. var nonEnumIdx = nonEnumerableProps.length;
  2807. var constructor = obj.constructor;
  2808. var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto;
  2809.  
  2810. // Constructor is a special case.
  2811. var prop = 'constructor';
  2812. if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);
  2813.  
  2814. while (nonEnumIdx--) {
  2815. prop = nonEnumerableProps[nonEnumIdx];
  2816. if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {
  2817. keys.push(prop);
  2818. }
  2819. }
  2820. }
  2821.  
  2822. // Retrieve the names of an object's own properties.
  2823. // Delegates to **ECMAScript 5**'s native `Object.keys`
  2824. _.keys = function(obj) {
  2825. if (!_.isObject(obj)) return [];
  2826. if (nativeKeys) return nativeKeys(obj);
  2827. var keys = [];
  2828. for (var key in obj) if (_.has(obj, key)) keys.push(key);
  2829. // Ahem, IE < 9.
  2830. if (hasEnumBug) collectNonEnumProps(obj, keys);
  2831. return keys;
  2832. };
  2833.  
  2834. // Retrieve all the property names of an object.
  2835. _.allKeys = function(obj) {
  2836. if (!_.isObject(obj)) return [];
  2837. var keys = [];
  2838. for (var key in obj) keys.push(key);
  2839. // Ahem, IE < 9.
  2840. if (hasEnumBug) collectNonEnumProps(obj, keys);
  2841. return keys;
  2842. };
  2843.  
  2844. // Retrieve the values of an object's properties.
  2845. _.values = function(obj) {
  2846. var keys = _.keys(obj);
  2847. var length = keys.length;
  2848. var values = Array(length);
  2849. for (var i = 0; i < length; i++) {
  2850. values[i] = obj[keys[i]];
  2851. }
  2852. return values;
  2853. };
  2854.  
  2855. // Returns the results of applying the iteratee to each element of the object
  2856. // In contrast to _.map it returns an object
  2857. _.mapObject = function(obj, iteratee, context) {
  2858. iteratee = cb(iteratee, context);
  2859. var keys = _.keys(obj),
  2860. length = keys.length,
  2861. results = {},
  2862. currentKey;
  2863. for (var index = 0; index < length; index++) {
  2864. currentKey = keys[index];
  2865. results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
  2866. }
  2867. return results;
  2868. };
  2869.  
  2870. // Convert an object into a list of `[key, value]` pairs.
  2871. _.pairs = function(obj) {
  2872. var keys = _.keys(obj);
  2873. var length = keys.length;
  2874. var pairs = Array(length);
  2875. for (var i = 0; i < length; i++) {
  2876. pairs[i] = [keys[i], obj[keys[i]]];
  2877. }
  2878. return pairs;
  2879. };
  2880.  
  2881. // Invert the keys and values of an object. The values must be serializable.
  2882. _.invert = function(obj) {
  2883. var result = {};
  2884. var keys = _.keys(obj);
  2885. for (var i = 0, length = keys.length; i < length; i++) {
  2886. result[obj[keys[i]]] = keys[i];
  2887. }
  2888. return result;
  2889. };
  2890.  
  2891. // Return a sorted list of the function names available on the object.
  2892. // Aliased as `methods`
  2893. _.functions = _.methods = function(obj) {
  2894. var names = [];
  2895. for (var key in obj) {
  2896. if (_.isFunction(obj[key])) names.push(key);
  2897. }
  2898. return names.sort();
  2899. };
  2900.  
  2901. // Extend a given object with all the properties in passed-in object(s).
  2902. _.extend = createAssigner(_.allKeys);
  2903.  
  2904. // Assigns a given object with all the own properties in the passed-in object(s)
  2905. // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
  2906. _.extendOwn = _.assign = createAssigner(_.keys);
  2907.  
  2908. // Returns the first key on an object that passes a predicate test
  2909. _.findKey = function(obj, predicate, context) {
  2910. predicate = cb(predicate, context);
  2911. var keys = _.keys(obj), key;
  2912. for (var i = 0, length = keys.length; i < length; i++) {
  2913. key = keys[i];
  2914. if (predicate(obj[key], key, obj)) return key;
  2915. }
  2916. };
  2917.  
  2918. // Return a copy of the object only containing the whitelisted properties.
  2919. _.pick = function(object, oiteratee, context) {
  2920. var result = {}, obj = object, iteratee, keys;
  2921. if (obj == null) return result;
  2922. if (_.isFunction(oiteratee)) {
  2923. keys = _.allKeys(obj);
  2924. iteratee = optimizeCb(oiteratee, context);
  2925. } else {
  2926. keys = flatten(arguments, false, false, 1);
  2927. iteratee = function(value, key, obj) { return key in obj; };
  2928. obj = Object(obj);
  2929. }
  2930. for (var i = 0, length = keys.length; i < length; i++) {
  2931. var key = keys[i];
  2932. var value = obj[key];
  2933. if (iteratee(value, key, obj)) result[key] = value;
  2934. }
  2935. return result;
  2936. };
  2937.  
  2938. // Return a copy of the object without the blacklisted properties.
  2939. _.omit = function(obj, iteratee, context) {
  2940. if (_.isFunction(iteratee)) {
  2941. iteratee = _.negate(iteratee);
  2942. } else {
  2943. var keys = _.map(flatten(arguments, false, false, 1), String);
  2944. iteratee = function(value, key) {
  2945. return !_.contains(keys, key);
  2946. };
  2947. }
  2948. return _.pick(obj, iteratee, context);
  2949. };
  2950.  
  2951. // Fill in a given object with default properties.
  2952. _.defaults = createAssigner(_.allKeys, true);
  2953.  
  2954. // Creates an object that inherits from the given prototype object.
  2955. // If additional properties are provided then they will be added to the
  2956. // created object.
  2957. _.create = function(prototype, props) {
  2958. var result = baseCreate(prototype);
  2959. if (props) _.extendOwn(result, props);
  2960. return result;
  2961. };
  2962.  
  2963. // Create a (shallow-cloned) duplicate of an object.
  2964. _.clone = function(obj) {
  2965. if (!_.isObject(obj)) return obj;
  2966. return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
  2967. };
  2968.  
  2969. // Invokes interceptor with the obj, and then returns obj.
  2970. // The primary purpose of this method is to "tap into" a method chain, in
  2971. // order to perform operations on intermediate results within the chain.
  2972. _.tap = function(obj, interceptor) {
  2973. interceptor(obj);
  2974. return obj;
  2975. };
  2976.  
  2977. // Returns whether an object has a given set of `key:value` pairs.
  2978. _.isMatch = function(object, attrs) {
  2979. var keys = _.keys(attrs), length = keys.length;
  2980. if (object == null) return !length;
  2981. var obj = Object(object);
  2982. for (var i = 0; i < length; i++) {
  2983. var key = keys[i];
  2984. if (attrs[key] !== obj[key] || !(key in obj)) return false;
  2985. }
  2986. return true;
  2987. };
  2988.  
  2989.  
  2990. // Internal recursive comparison function for `isEqual`.
  2991. var eq = function(a, b, aStack, bStack) {
  2992. // Identical objects are equal. `0 === -0`, but they aren't identical.
  2993. // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
  2994. if (a === b) return a !== 0 || 1 / a === 1 / b;
  2995. // A strict comparison is necessary because `null == undefined`.
  2996. if (a == null || b == null) return a === b;
  2997. // Unwrap any wrapped objects.
  2998. if (a instanceof _) a = a._wrapped;
  2999. if (b instanceof _) b = b._wrapped;
  3000. // Compare `[[Class]]` names.
  3001. var className = toString.call(a);
  3002. if (className !== toString.call(b)) return false;
  3003. switch (className) {
  3004. // Strings, numbers, regular expressions, dates, and booleans are compared by value.
  3005. case '[object RegExp]':
  3006. // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
  3007. case '[object String]':
  3008. // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
  3009. // equivalent to `new String("5")`.
  3010. return '' + a === '' + b;
  3011. case '[object Number]':
  3012. // `NaN`s are equivalent, but non-reflexive.
  3013. // Object(NaN) is equivalent to NaN
  3014. if (+a !== +a) return +b !== +b;
  3015. // An `egal` comparison is performed for other numeric values.
  3016. return +a === 0 ? 1 / +a === 1 / b : +a === +b;
  3017. case '[object Date]':
  3018. case '[object Boolean]':
  3019. // Coerce dates and booleans to numeric primitive values. Dates are compared by their
  3020. // millisecond representations. Note that invalid dates with millisecond representations
  3021. // of `NaN` are not equivalent.
  3022. return +a === +b;
  3023. }
  3024.  
  3025. var areArrays = className === '[object Array]';
  3026. if (!areArrays) {
  3027. if (typeof a != 'object' || typeof b != 'object') return false;
  3028.  
  3029. // Objects with different constructors are not equivalent, but `Object`s or `Array`s
  3030. // from different frames are.
  3031. var aCtor = a.constructor, bCtor = b.constructor;
  3032. if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor &&
  3033. _.isFunction(bCtor) && bCtor instanceof bCtor)
  3034. && ('constructor' in a && 'constructor' in b)) {
  3035. return false;
  3036. }
  3037. }
  3038. // Assume equality for cyclic structures. The algorithm for detecting cyclic
  3039. // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
  3040.  
  3041. // Initializing stack of traversed objects.
  3042. // It's done here since we only need them for objects and arrays comparison.
  3043. aStack = aStack || [];
  3044. bStack = bStack || [];
  3045. var length = aStack.length;
  3046. while (length--) {
  3047. // Linear search. Performance is inversely proportional to the number of
  3048. // unique nested structures.
  3049. if (aStack[length] === a) return bStack[length] === b;
  3050. }
  3051.  
  3052. // Add the first object to the stack of traversed objects.
  3053. aStack.push(a);
  3054. bStack.push(b);
  3055.  
  3056. // Recursively compare objects and arrays.
  3057. if (areArrays) {
  3058. // Compare array lengths to determine if a deep comparison is necessary.
  3059. length = a.length;
  3060. if (length !== b.length) return false;
  3061. // Deep compare the contents, ignoring non-numeric properties.
  3062. while (length--) {
  3063. if (!eq(a[length], b[length], aStack, bStack)) return false;
  3064. }
  3065. } else {
  3066. // Deep compare objects.
  3067. var keys = _.keys(a), key;
  3068. length = keys.length;
  3069. // Ensure that both objects contain the same number of properties before comparing deep equality.
  3070. if (_.keys(b).length !== length) return false;
  3071. while (length--) {
  3072. // Deep compare each member
  3073. key = keys[length];
  3074. if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
  3075. }
  3076. }
  3077. // Remove the first object from the stack of traversed objects.
  3078. aStack.pop();
  3079. bStack.pop();
  3080. return true;
  3081. };
  3082.  
  3083. // Perform a deep comparison to check if two objects are equal.
  3084. _.isEqual = function(a, b) {
  3085. return eq(a, b);
  3086. };
  3087.  
  3088. // Is a given array, string, or object empty?
  3089. // An "empty" object has no enumerable own-properties.
  3090. _.isEmpty = function(obj) {
  3091. if (obj == null) return true;
  3092. if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;
  3093. return _.keys(obj).length === 0;
  3094. };
  3095.  
  3096. // Is a given value a DOM element?
  3097. _.isElement = function(obj) {
  3098. return !!(obj && obj.nodeType === 1);
  3099. };
  3100.  
  3101. // Is a given value an array?
  3102. // Delegates to ECMA5's native Array.isArray
  3103. _.isArray = nativeIsArray || function(obj) {
  3104. return toString.call(obj) === '[object Array]';
  3105. };
  3106.  
  3107. // Is a given variable an object?
  3108. _.isObject = function(obj) {
  3109. var type = typeof obj;
  3110. return type === 'function' || type === 'object' && !!obj;
  3111. };
  3112.  
  3113. // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.
  3114. _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) {
  3115. _['is' + name] = function(obj) {
  3116. return toString.call(obj) === '[object ' + name + ']';
  3117. };
  3118. });
  3119.  
  3120. // Define a fallback version of the method in browsers (ahem, IE < 9), where
  3121. // there isn't any inspectable "Arguments" type.
  3122. if (!_.isArguments(arguments)) {
  3123. _.isArguments = function(obj) {
  3124. return _.has(obj, 'callee');
  3125. };
  3126. }
  3127.  
  3128. // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,
  3129. // IE 11 (#1621), and in Safari 8 (#1929).
  3130. if (typeof /./ != 'function' && typeof Int8Array != 'object') {
  3131. _.isFunction = function(obj) {
  3132. return typeof obj == 'function' || false;
  3133. };
  3134. }
  3135.  
  3136. // Is a given object a finite number?
  3137. _.isFinite = function(obj) {
  3138. return isFinite(obj) && !isNaN(parseFloat(obj));
  3139. };
  3140.  
  3141. // Is the given value `NaN`? (NaN is the only number which does not equal itself).
  3142. _.isNaN = function(obj) {
  3143. return _.isNumber(obj) && obj !== +obj;
  3144. };
  3145.  
  3146. // Is a given value a boolean?
  3147. _.isBoolean = function(obj) {
  3148. return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
  3149. };
  3150.  
  3151. // Is a given value equal to null?
  3152. _.isNull = function(obj) {
  3153. return obj === null;
  3154. };
  3155.  
  3156. // Is a given variable undefined?
  3157. _.isUndefined = function(obj) {
  3158. return obj === void 0;
  3159. };
  3160.  
  3161. // Shortcut function for checking if an object has a given property directly
  3162. // on itself (in other words, not on a prototype).
  3163. _.has = function(obj, key) {
  3164. return obj != null && hasOwnProperty.call(obj, key);
  3165. };
  3166.  
  3167. // Utility Functions
  3168. // -----------------
  3169.  
  3170. // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
  3171. // previous owner. Returns a reference to the Underscore object.
  3172. _.noConflict = function() {
  3173. root._ = previousUnderscore;
  3174. return this;
  3175. };
  3176.  
  3177. // Keep the identity function around for default iteratees.
  3178. _.identity = function(value) {
  3179. return value;
  3180. };
  3181.  
  3182. // Predicate-generating functions. Often useful outside of Underscore.
  3183. _.constant = function(value) {
  3184. return function() {
  3185. return value;
  3186. };
  3187. };
  3188.  
  3189. _.noop = function(){};
  3190.  
  3191. _.property = property;
  3192.  
  3193. // Generates a function for a given object that returns a given property.
  3194. _.propertyOf = function(obj) {
  3195. return obj == null ? function(){} : function(key) {
  3196. return obj[key];
  3197. };
  3198. };
  3199.  
  3200. // Returns a predicate for checking whether an object has a given set of
  3201. // `key:value` pairs.
  3202. _.matcher = _.matches = function(attrs) {
  3203. attrs = _.extendOwn({}, attrs);
  3204. return function(obj) {
  3205. return _.isMatch(obj, attrs);
  3206. };
  3207. };
  3208.  
  3209. // Run a function **n** times.
  3210. _.times = function(n, iteratee, context) {
  3211. var accum = Array(Math.max(0, n));
  3212. iteratee = optimizeCb(iteratee, context, 1);
  3213. for (var i = 0; i < n; i++) accum[i] = iteratee(i);
  3214. return accum;
  3215. };
  3216.  
  3217. // Return a random integer between min and max (inclusive).
  3218. _.random = function(min, max) {
  3219. if (max == null) {
  3220. max = min;
  3221. min = 0;
  3222. }
  3223. return min + Math.floor(Math.random() * (max - min + 1));
  3224. };
  3225.  
  3226. // A (possibly faster) way to get the current timestamp as an integer.
  3227. _.now = Date.now || function() {
  3228. return new Date().getTime();
  3229. };
  3230.  
  3231. // List of HTML entities for escaping.
  3232. var escapeMap = {
  3233. '&': '&amp;',
  3234. '<': '&lt;',
  3235. '>': '&gt;',
  3236. '"': '&quot;',
  3237. "'": '&#x27;',
  3238. '`': '&#x60;'
  3239. };
  3240. var unescapeMap = _.invert(escapeMap);
  3241.  
  3242. // Functions for escaping and unescaping strings to/from HTML interpolation.
  3243. var createEscaper = function(map) {
  3244. var escaper = function(match) {
  3245. return map[match];
  3246. };
  3247. // Regexes for identifying a key that needs to be escaped
  3248. var source = '(?:' + _.keys(map).join('|') + ')';
  3249. var testRegexp = RegExp(source);
  3250. var replaceRegexp = RegExp(source, 'g');
  3251. return function(string) {
  3252. string = string == null ? '' : '' + string;
  3253. return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
  3254. };
  3255. };
  3256. _.escape = createEscaper(escapeMap);
  3257. _.unescape = createEscaper(unescapeMap);
  3258.  
  3259. // If the value of the named `property` is a function then invoke it with the
  3260. // `object` as context; otherwise, return it.
  3261. _.result = function(object, property, fallback) {
  3262. var value = object == null ? void 0 : object[property];
  3263. if (value === void 0) {
  3264. value = fallback;
  3265. }
  3266. return _.isFunction(value) ? value.call(object) : value;
  3267. };
  3268.  
  3269. // Generate a unique integer id (unique within the entire client session).
  3270. // Useful for temporary DOM ids.
  3271. var idCounter = 0;
  3272. _.uniqueId = function(prefix) {
  3273. var id = ++idCounter + '';
  3274. return prefix ? prefix + id : id;
  3275. };
  3276.  
  3277. // By default, Underscore uses ERB-style template delimiters, change the
  3278. // following template settings to use alternative delimiters.
  3279. _.templateSettings = {
  3280. evaluate : /<%([\s\S]+?)%>/g,
  3281. interpolate : /<%=([\s\S]+?)%>/g,
  3282. escape : /<%-([\s\S]+?)%>/g
  3283. };
  3284.  
  3285. // When customizing `templateSettings`, if you don't want to define an
  3286. // interpolation, evaluation or escaping regex, we need one that is
  3287. // guaranteed not to match.
  3288. var noMatch = /(.)^/;
  3289.  
  3290. // Certain characters need to be escaped so that they can be put into a
  3291. // string literal.
  3292. var escapes = {
  3293. "'": "'",
  3294. '\\': '\\',
  3295. '\r': 'r',
  3296. '\n': 'n',
  3297. '\u2028': 'u2028',
  3298. '\u2029': 'u2029'
  3299. };
  3300.  
  3301. var escaper = /\\|'|\r|\n|\u2028|\u2029/g;
  3302.  
  3303. var escapeChar = function(match) {
  3304. return '\\' + escapes[match];
  3305. };
  3306.  
  3307. // JavaScript micro-templating, similar to John Resig's implementation.
  3308. // Underscore templating handles arbitrary delimiters, preserves whitespace,
  3309. // and correctly escapes quotes within interpolated code.
  3310. // NB: `oldSettings` only exists for backwards compatibility.
  3311. _.template = function(text, settings, oldSettings) {
  3312. if (!settings && oldSettings) settings = oldSettings;
  3313. settings = _.defaults({}, settings, _.templateSettings);
  3314.  
  3315. // Combine delimiters into one regular expression via alternation.
  3316. var matcher = RegExp([
  3317. (settings.escape || noMatch).source,
  3318. (settings.interpolate || noMatch).source,
  3319. (settings.evaluate || noMatch).source
  3320. ].join('|') + '|$', 'g');
  3321.  
  3322. // Compile the template source, escaping string literals appropriately.
  3323. var index = 0;
  3324. var source = "__p+='";
  3325. text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
  3326. source += text.slice(index, offset).replace(escaper, escapeChar);
  3327. index = offset + match.length;
  3328.  
  3329. if (escape) {
  3330. source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
  3331. } else if (interpolate) {
  3332. source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
  3333. } else if (evaluate) {
  3334. source += "';\n" + evaluate + "\n__p+='";
  3335. }
  3336.  
  3337. // Adobe VMs need the match returned to produce the correct offest.
  3338. return match;
  3339. });
  3340. source += "';\n";
  3341.  
  3342. // If a variable is not specified, place data values in local scope.
  3343. if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
  3344.  
  3345. source = "var __t,__p='',__j=Array.prototype.join," +
  3346. "print=function(){__p+=__j.call(arguments,'');};\n" +
  3347. source + 'return __p;\n';
  3348.  
  3349. try {
  3350. var render = new Function(settings.variable || 'obj', '_', source);
  3351. } catch (e) {
  3352. e.source = source;
  3353. throw e;
  3354. }
  3355.  
  3356. var template = function(data) {
  3357. return render.call(this, data, _);
  3358. };
  3359.  
  3360. // Provide the compiled source as a convenience for precompilation.
  3361. var argument = settings.variable || 'obj';
  3362. template.source = 'function(' + argument + '){\n' + source + '}';
  3363.  
  3364. return template;
  3365. };
  3366.  
  3367. // Add a "chain" function. Start chaining a wrapped Underscore object.
  3368. _.chain = function(obj) {
  3369. var instance = _(obj);
  3370. instance._chain = true;
  3371. return instance;
  3372. };
  3373.  
  3374. // OOP
  3375. // ---------------
  3376. // If Underscore is called as a function, it returns a wrapped object that
  3377. // can be used OO-style. This wrapper holds altered versions of all the
  3378. // underscore functions. Wrapped objects may be chained.
  3379.  
  3380. // Helper function to continue chaining intermediate results.
  3381. var result = function(instance, obj) {
  3382. return instance._chain ? _(obj).chain() : obj;
  3383. };
  3384.  
  3385. // Add your own custom functions to the Underscore object.
  3386. _.mixin = function(obj) {
  3387. _.each(_.functions(obj), function(name) {
  3388. var func = _[name] = obj[name];
  3389. _.prototype[name] = function() {
  3390. var args = [this._wrapped];
  3391. push.apply(args, arguments);
  3392. return result(this, func.apply(_, args));
  3393. };
  3394. });
  3395. };
  3396.  
  3397. // Add all of the Underscore functions to the wrapper object.
  3398. _.mixin(_);
  3399.  
  3400. // Add all mutator Array functions to the wrapper.
  3401. _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
  3402. var method = ArrayProto[name];
  3403. _.prototype[name] = function() {
  3404. var obj = this._wrapped;
  3405. method.apply(obj, arguments);
  3406. if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];
  3407. return result(this, obj);
  3408. };
  3409. });
  3410.  
  3411. // Add all accessor Array functions to the wrapper.
  3412. _.each(['concat', 'join', 'slice'], function(name) {
  3413. var method = ArrayProto[name];
  3414. _.prototype[name] = function() {
  3415. return result(this, method.apply(this._wrapped, arguments));
  3416. };
  3417. });
  3418.  
  3419. // Extracts the result from a wrapped and chained object.
  3420. _.prototype.value = function() {
  3421. return this._wrapped;
  3422. };
  3423.  
  3424. // Provide unwrapping proxy for some methods used in engine operations
  3425. // such as arithmetic and JSON stringification.
  3426. _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
  3427.  
  3428. _.prototype.toString = function() {
  3429. return '' + this._wrapped;
  3430. };
  3431.  
  3432. // AMD registration happens at the end for compatibility with AMD loaders
  3433. // that may not enforce next-turn semantics on modules. Even though general
  3434. // practice for AMD registration is to be anonymous, underscore registers
  3435. // as a named module because, like jQuery, it is a base library that is
  3436. // popular enough to be bundled in a third party lib, but not be part of
  3437. // an AMD load request. Those cases could generate an error when an
  3438. // anonymous define() is called outside of a loader request.
  3439. if (true) {
  3440. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
  3441. return _;
  3442. }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  3443. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  3444. }
  3445. }.call(this));
  3446.  
  3447.  
  3448. /***/ }),
  3449. /* 31 */
  3450. /***/ (function(module, exports, __webpack_require__) {
  3451.  
  3452. "use strict";
  3453.  
  3454. var Observable_1 = __webpack_require__(0);
  3455. var forkJoin_1 = __webpack_require__(63);
  3456. Observable_1.Observable.forkJoin = forkJoin_1.forkJoin;
  3457. //# sourceMappingURL=forkJoin.js.map
  3458.  
  3459. /***/ }),
  3460. /* 32 */
  3461. /***/ (function(module, exports, __webpack_require__) {
  3462.  
  3463. "use strict";
  3464.  
  3465. var Observable_1 = __webpack_require__(0);
  3466. var from_1 = __webpack_require__(64);
  3467. Observable_1.Observable.from = from_1.from;
  3468. //# sourceMappingURL=from.js.map
  3469.  
  3470. /***/ }),
  3471. /* 33 */
  3472. /***/ (function(module, exports, __webpack_require__) {
  3473.  
  3474. "use strict";
  3475.  
  3476. var Observable_1 = __webpack_require__(0);
  3477. var fromEvent_1 = __webpack_require__(65);
  3478. Observable_1.Observable.fromEvent = fromEvent_1.fromEvent;
  3479. //# sourceMappingURL=fromEvent.js.map
  3480.  
  3481. /***/ }),
  3482. /* 34 */
  3483. /***/ (function(module, exports, __webpack_require__) {
  3484.  
  3485. "use strict";
  3486.  
  3487. var Observable_1 = __webpack_require__(0);
  3488. var of_1 = __webpack_require__(66);
  3489. Observable_1.Observable.of = of_1.of;
  3490. //# sourceMappingURL=of.js.map
  3491.  
  3492. /***/ }),
  3493. /* 35 */
  3494. /***/ (function(module, exports, __webpack_require__) {
  3495.  
  3496. "use strict";
  3497.  
  3498. var Observable_1 = __webpack_require__(0);
  3499. var debounceTime_1 = __webpack_require__(67);
  3500. Observable_1.Observable.prototype.debounceTime = debounceTime_1.debounceTime;
  3501. //# sourceMappingURL=debounceTime.js.map
  3502.  
  3503. /***/ }),
  3504. /* 36 */
  3505. /***/ (function(module, exports, __webpack_require__) {
  3506.  
  3507. "use strict";
  3508.  
  3509. var Observable_1 = __webpack_require__(0);
  3510. var delay_1 = __webpack_require__(68);
  3511. Observable_1.Observable.prototype.delay = delay_1.delay;
  3512. //# sourceMappingURL=delay.js.map
  3513.  
  3514. /***/ }),
  3515. /* 37 */
  3516. /***/ (function(module, exports, __webpack_require__) {
  3517.  
  3518. "use strict";
  3519.  
  3520. var Observable_1 = __webpack_require__(0);
  3521. var do_1 = __webpack_require__(69);
  3522. Observable_1.Observable.prototype.do = do_1._do;
  3523. Observable_1.Observable.prototype._do = do_1._do;
  3524. //# sourceMappingURL=do.js.map
  3525.  
  3526. /***/ }),
  3527. /* 38 */
  3528. /***/ (function(module, exports, __webpack_require__) {
  3529.  
  3530. "use strict";
  3531.  
  3532. var Observable_1 = __webpack_require__(0);
  3533. var filter_1 = __webpack_require__(70);
  3534. Observable_1.Observable.prototype.filter = filter_1.filter;
  3535. //# sourceMappingURL=filter.js.map
  3536.  
  3537. /***/ }),
  3538. /* 39 */
  3539. /***/ (function(module, exports, __webpack_require__) {
  3540.  
  3541. "use strict";
  3542.  
  3543. var Observable_1 = __webpack_require__(0);
  3544. var map_1 = __webpack_require__(71);
  3545. Observable_1.Observable.prototype.map = map_1.map;
  3546. //# sourceMappingURL=map.js.map
  3547.  
  3548. /***/ }),
  3549. /* 40 */
  3550. /***/ (function(module, exports, __webpack_require__) {
  3551.  
  3552. "use strict";
  3553.  
  3554. var Observable_1 = __webpack_require__(0);
  3555. var mergeMap_1 = __webpack_require__(72);
  3556. Observable_1.Observable.prototype.mergeMap = mergeMap_1.mergeMap;
  3557. Observable_1.Observable.prototype.flatMap = mergeMap_1.mergeMap;
  3558. //# sourceMappingURL=mergeMap.js.map
  3559.  
  3560. /***/ }),
  3561. /* 41 */
  3562. /***/ (function(module, exports, __webpack_require__) {
  3563.  
  3564. "use strict";
  3565.  
  3566. var Observable_1 = __webpack_require__(0);
  3567. var retry_1 = __webpack_require__(74);
  3568. Observable_1.Observable.prototype.retry = retry_1.retry;
  3569. //# sourceMappingURL=retry.js.map
  3570.  
  3571. /***/ }),
  3572. /* 42 */
  3573. /***/ (function(module, exports, __webpack_require__) {
  3574.  
  3575. "use strict";
  3576.  
  3577. var Observable_1 = __webpack_require__(0);
  3578. var throttleTime_1 = __webpack_require__(75);
  3579. Observable_1.Observable.prototype.throttleTime = throttleTime_1.throttleTime;
  3580. //# sourceMappingURL=throttleTime.js.map
  3581.  
  3582. /***/ }),
  3583. /* 43 */
  3584. /***/ (function(module, exports, __webpack_require__) {
  3585.  
  3586. "use strict";
  3587.  
  3588. var Observable_1 = __webpack_require__(0);
  3589. var timeout_1 = __webpack_require__(76);
  3590. Observable_1.Observable.prototype.timeout = timeout_1.timeout;
  3591. //# sourceMappingURL=timeout.js.map
  3592.  
  3593. /***/ }),
  3594. /* 44 */
  3595. /***/ (function(module, exports, __webpack_require__) {
  3596.  
  3597. "use strict";
  3598.  
  3599. var __extends = (this && this.__extends) || (function () {
  3600. var extendStatics = Object.setPrototypeOf ||
  3601. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  3602. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  3603. return function (d, b) {
  3604. extendStatics(d, b);
  3605. function __() { this.constructor = d; }
  3606. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3607. };
  3608. })();
  3609. Object.defineProperty(exports, "__esModule", { value: true });
  3610. var redirect_on_request_1 = __webpack_require__(13);
  3611. var BaiduVideoRedirect = (function (_super) {
  3612. __extends(BaiduVideoRedirect, _super);
  3613. function BaiduVideoRedirect(domainTester, urlTester, matcher, ASelector) {
  3614. if (ASelector === void 0) { ASelector = 'a'; }
  3615. return _super.call(this, domainTester, urlTester, matcher, ASelector) || this;
  3616. }
  3617. BaiduVideoRedirect.prototype.handlerOneResponse = function (res) {
  3618. var url = res.response.match(/URL='(.*)'/);
  3619. if (url.length && url[1]) {
  3620. res.finalUrl = url[1];
  3621. }
  3622. return res;
  3623. };
  3624. return BaiduVideoRedirect;
  3625. }(redirect_on_request_1.RedirectOnRequest));
  3626. exports.default = new BaiduVideoRedirect(/v.baidu\.com/, /v\.baidu\.com\/link\?url=/, null);
  3627.  
  3628.  
  3629. /***/ }),
  3630. /* 45 */
  3631. /***/ (function(module, exports, __webpack_require__) {
  3632.  
  3633. "use strict";
  3634.  
  3635. var __extends = (this && this.__extends) || (function () {
  3636. var extendStatics = Object.setPrototypeOf ||
  3637. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  3638. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  3639. return function (d, b) {
  3640. extendStatics(d, b);
  3641. function __() { this.constructor = d; }
  3642. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3643. };
  3644. })();
  3645. Object.defineProperty(exports, "__esModule", { value: true });
  3646. var Observable_1 = __webpack_require__(0);
  3647. var http_1 = __webpack_require__(12);
  3648. var query_1 = __webpack_require__(29);
  3649. var redirect_on_request_1 = __webpack_require__(13);
  3650. function getText(htmlElement) {
  3651. return (htmlElement.innerText || htmlElement.textContent).trim();
  3652. }
  3653. var BaiduRedirect = (function (_super) {
  3654. __extends(BaiduRedirect, _super);
  3655. function BaiduRedirect(domainTester, urlTester, matcher, ASelector) {
  3656. if (ASelector === void 0) { ASelector = 'a'; }
  3657. return _super.call(this, domainTester, urlTester, matcher, ASelector) || this;
  3658. }
  3659. BaiduRedirect.prototype.handlerOneResponse = function (res) {
  3660. if (this.urlTester.test(res.finalUrl)) {
  3661. if (!res.response || /<\/noscript>$/.test(res.response.trim()))
  3662. throw res;
  3663. var url = res.response.match(/URL=\'?https?:\/\/[^'"]+/).join('').match(/https?:\/\/[^'"]+/)[0];
  3664. if (!url || !/^https?/.test(url) || this.urlTester.test(url))
  3665. throw res;
  3666. res.finalUrl = url;
  3667. }
  3668. return res;
  3669. };
  3670. BaiduRedirect.prototype.onInit = function () {
  3671. var _this = this;
  3672. if (!/www\.baidu\.com\/s/.test(window.top.location.href))
  3673. return;
  3674. var query = new query_1.default(window.top.location.search);
  3675. var skip = query.object.pn || 0;
  3676. query.object.tn = 'baidulocal';
  3677. query.object.timestamp = new Date().getTime();
  3678. query.object.rn = 50;
  3679. var url = location.protocol.replace(/:$/, '') + "://" + (location.host + location.pathname + query);
  3680. return Observable_1.Observable.forkJoin(http_1.http.get(url), http_1.http.get(url.replace(/pn=(\d+)/, "pn=" + (skip + 10)))).retry(2)
  3681. .timeout(http_1.timeout)
  3682. .subscribe(function (resList) {
  3683. if (!resList || !resList.length)
  3684. return;
  3685. resList.forEach(function (res) {
  3686. return _this.handlerOneRequestPage(res);
  3687. });
  3688. });
  3689. };
  3690. BaiduRedirect.prototype.handlerOneRequestPage = function (res) {
  3691. var _this = this;
  3692. var responseText = res.responseText.replace(/(src=[^>]*|link=[^>])/g, '');
  3693. var html = document.createElement('html');
  3694. html.innerHTML = responseText;
  3695. Observable_1.Observable.of(html.querySelectorAll('.f>a'))
  3696. .map(function (nodeList) { return [].slice.call(nodeList).map(function (ele) {
  3697. var local = [].slice.call(document.querySelectorAll('.t>a')).find(function (remoteEle) { return getText(remoteEle) === getText(ele); });
  3698. return local ? { local: local, remote: ele } : void 0;
  3699. })
  3700. .filter(function (v) { return !!v; }); })
  3701. .subscribe(function (items) {
  3702. items
  3703. .filter(function (item) { return !_this.urlTester.test(item.remote.href); })
  3704. .forEach(function (item) {
  3705. _this.urlTester.test(item.local.href) && item.local.setAttribute('origin-href', item.local.href);
  3706. item.local.href = item.remote.href;
  3707. item.local.setAttribute(_this.status.done, '1');
  3708. _this.DEBUG && (item.local.style.backgroundColor = 'red');
  3709. });
  3710. });
  3711. };
  3712. return BaiduRedirect;
  3713. }(redirect_on_request_1.RedirectOnRequest));
  3714. exports.default = new BaiduRedirect(/www\.baidu\.com/, /www\.baidu\.com\/link\?url=/, null, '#content_left a');
  3715.  
  3716.  
  3717. /***/ }),
  3718. /* 46 */
  3719. /***/ (function(module, exports, __webpack_require__) {
  3720.  
  3721. "use strict";
  3722.  
  3723. var __extends = (this && this.__extends) || (function () {
  3724. var extendStatics = Object.setPrototypeOf ||
  3725. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  3726. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  3727. return function (d, b) {
  3728. extendStatics(d, b);
  3729. function __() { this.constructor = d; }
  3730. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3731. };
  3732. })();
  3733. Object.defineProperty(exports, "__esModule", { value: true });
  3734. var Observable_1 = __webpack_require__(0);
  3735. var redirect_on_url_1 = __webpack_require__(3);
  3736. var GoogleRedirect = (function (_super) {
  3737. __extends(GoogleRedirect, _super);
  3738. function GoogleRedirect(domainTester, urlTester, matcher) {
  3739. return _super.call(this, domainTester, urlTester, matcher) || this;
  3740. }
  3741. GoogleRedirect.prototype.handlerOne = function (aEle) {
  3742. var _this = this;
  3743. return Observable_1.Observable.of(aEle)
  3744. .subscribe(function (aEle) {
  3745. if (aEle.getAttribute('onmousedown')) {
  3746. aEle.removeAttribute('onmousedown');
  3747. _this.DEBUG && (aEle.style.backgroundColor = 'green');
  3748. }
  3749. if (aEle.getAttribute('data-href')) {
  3750. aEle.href = aEle.getAttribute('data-href');
  3751. _this.DEBUG && (aEle.style.backgroundColor = 'green');
  3752. }
  3753. });
  3754. };
  3755. return GoogleRedirect;
  3756. }(redirect_on_url_1.RedirectOnUrl));
  3757. exports.default = new GoogleRedirect(/www\.google\./, null, null);
  3758.  
  3759.  
  3760. /***/ }),
  3761. /* 47 */
  3762. /***/ (function(module, exports, __webpack_require__) {
  3763.  
  3764. "use strict";
  3765.  
  3766. var __extends = (this && this.__extends) || (function () {
  3767. var extendStatics = Object.setPrototypeOf ||
  3768. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  3769. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  3770. return function (d, b) {
  3771. extendStatics(d, b);
  3772. function __() { this.constructor = d; }
  3773. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3774. };
  3775. })();
  3776. Object.defineProperty(exports, "__esModule", { value: true });
  3777. var redirect_on_url_1 = __webpack_require__(3);
  3778. var SoRedirect = (function (_super) {
  3779. __extends(SoRedirect, _super);
  3780. function SoRedirect(domainTester, urlTester, matcher) {
  3781. return _super.call(this, domainTester, urlTester, matcher) || this;
  3782. }
  3783. SoRedirect.prototype.handlerOneCallBack = function (aEle) {
  3784. aEle.removeAttribute('data-res'); // 去除点击追踪
  3785. aEle.href = aEle.href.replace(/\&(q|t|ts|src)=[^\&]*/g, '');
  3786. };
  3787. return SoRedirect;
  3788. }(redirect_on_url_1.RedirectOnUrl));
  3789. exports.default = new SoRedirect(/www\.so\.com/, /so\.com\/link\?url=/, /so\.com\/link\?url=(.*)/);
  3790.  
  3791.  
  3792. /***/ }),
  3793. /* 48 */
  3794. /***/ (function(module, exports, __webpack_require__) {
  3795.  
  3796. "use strict";
  3797.  
  3798. var __extends = (this && this.__extends) || (function () {
  3799. var extendStatics = Object.setPrototypeOf ||
  3800. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  3801. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  3802. return function (d, b) {
  3803. extendStatics(d, b);
  3804. function __() { this.constructor = d; }
  3805. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3806. };
  3807. })();
  3808. Object.defineProperty(exports, "__esModule", { value: true });
  3809. var Observable_1 = __webpack_require__(0);
  3810. var http_1 = __webpack_require__(12);
  3811. var query_1 = __webpack_require__(29);
  3812. var redirect_on_request_1 = __webpack_require__(13);
  3813. function getText(htmlElement) {
  3814. return (htmlElement.innerText || htmlElement.textContent).trim();
  3815. }
  3816. var SogouRedirect = (function (_super) {
  3817. __extends(SogouRedirect, _super);
  3818. function SogouRedirect(domainTester, urlTester, matcher, ASelector) {
  3819. if (ASelector === void 0) { ASelector = 'a'; }
  3820. return _super.call(this, domainTester, urlTester, matcher, ASelector) || this;
  3821. }
  3822. SogouRedirect.prototype.handlerOneResponse = function (res) {
  3823. if (this.urlTester.test(res.finalUrl)) {
  3824. var url = res.response.match(/URL=\'?https?:\/\/[^'"]+/).join('').match(/https?:\/\/[^'"]+/)[0];
  3825. if (!url || !/^https?/.test(url) || this.urlTester.test(url))
  3826. throw res;
  3827. res.finalUrl = url;
  3828. }
  3829. return res;
  3830. };
  3831. SogouRedirect.prototype.onInit = function () {
  3832. var _this = this;
  3833. if (!/www\.sogou\.com\/web/.test(window.top.location.href))
  3834. return;
  3835. var query = new query_1.default(window.top.location.search);
  3836. // 搜索使用http搜索,得到的是直接链接
  3837. var url = location.protocol.replace(/:$/, '').replace('s', '') + "://" + (location.host + location.pathname + query);
  3838. return Observable_1.Observable.forkJoin(http_1.http.get(url)).retry(2)
  3839. .timeout(http_1.timeout)
  3840. .subscribe(function (resList) {
  3841. if (!resList || !resList.length)
  3842. return;
  3843. resList.forEach(function (res) {
  3844. return _this.handlerOneRequestPage(res);
  3845. });
  3846. });
  3847. };
  3848. SogouRedirect.prototype.handlerOneRequestPage = function (res) {
  3849. var _this = this;
  3850. var responseText = res.responseText.replace(/(src=[^>]*|link=[^>])/g, '');
  3851. var html = document.createElement('html');
  3852. html.innerHTML = responseText;
  3853. // let selector = '#main .results div.vrwrap>h3';
  3854. // let selector = '#main .results h3>a';
  3855. var selector = '#main .results a[href*="www.sogou.com/link?url="]';
  3856. var remotes = [].slice.call(html.querySelectorAll('#main .results a[href]'));
  3857. var locals = [].slice.call(document.querySelectorAll(selector));
  3858. locals.forEach(function (localEle) {
  3859. remotes.forEach(function (remoteEle) {
  3860. var localText = getText(localEle);
  3861. var remoteText = getText(remoteEle);
  3862. // 通用按钮,例如【点击下载】
  3863. if (localEle.classList.contains('str-public-btn')) {
  3864. localText = getText(localEle.parentNode);
  3865. remoteText = getText(remoteEle.parentNode);
  3866. }
  3867. else if (localEle.classList.contains('str_img')) {
  3868. localText = getText(localEle.parentNode.parentNode);
  3869. remoteText = getText(remoteEle.parentNode.parentNode);
  3870. }
  3871. if (!localText || localText !== remoteText)
  3872. return;
  3873. _this.urlTester.test(localEle.href) && localEle.setAttribute('origin-href', localEle.href);
  3874. localEle.href = remoteEle.href;
  3875. _this.DEBUG && (localEle.style.backgroundColor = 'red');
  3876. });
  3877. });
  3878. };
  3879. return SogouRedirect;
  3880. }(redirect_on_request_1.RedirectOnRequest));
  3881. exports.default = new SogouRedirect(/www\.sogou\.com/, /www\.sogou\.com\/link\?url=/, null, '#content_left a');
  3882.  
  3883.  
  3884. /***/ }),
  3885. /* 49 */
  3886. /***/ (function(module, exports, __webpack_require__) {
  3887.  
  3888. "use strict";
  3889.  
  3890. var __extends = (this && this.__extends) || (function () {
  3891. var extendStatics = Object.setPrototypeOf ||
  3892. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  3893. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  3894. return function (d, b) {
  3895. extendStatics(d, b);
  3896. function __() { this.constructor = d; }
  3897. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3898. };
  3899. })();
  3900. Object.defineProperty(exports, "__esModule", { value: true });
  3901. var Observable_1 = __webpack_require__(0);
  3902. var redirect_on_url_1 = __webpack_require__(3);
  3903. var BaiduTiebaRedirect = (function (_super) {
  3904. __extends(BaiduTiebaRedirect, _super);
  3905. function BaiduTiebaRedirect(domainTester, urlTester, matcher) {
  3906. return _super.call(this, domainTester, urlTester, matcher) || this;
  3907. }
  3908. BaiduTiebaRedirect.prototype.handlerOne = function (aEle) {
  3909. var _this = this;
  3910. return Observable_1.Observable.of(aEle)
  3911. .filter(function (ele) { return _this.urlTester.test(ele.href); })
  3912. .subscribe(function (aEle) {
  3913. var url = '';
  3914. var text = aEle.innerText || aEle.textContent || '';
  3915. try {
  3916. url = decodeURIComponent(text);
  3917. }
  3918. catch (e) {
  3919. url = /https?:\/\//.test(text) ? text : '';
  3920. }
  3921. if (url) {
  3922. aEle.href = url;
  3923. _this.DEBUG && (aEle.style.backgroundColor = 'green');
  3924. }
  3925. });
  3926. };
  3927. return BaiduTiebaRedirect;
  3928. }(redirect_on_url_1.RedirectOnUrl));
  3929. exports.default = new BaiduTiebaRedirect(/tieba\.baidu\.com/, /jump\.bdimg\.com/, null);
  3930.  
  3931.  
  3932. /***/ }),
  3933. /* 50 */
  3934. /***/ (function(module, exports, __webpack_require__) {
  3935.  
  3936. "use strict";
  3937.  
  3938. var __extends = (this && this.__extends) || (function () {
  3939. var extendStatics = Object.setPrototypeOf ||
  3940. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  3941. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  3942. return function (d, b) {
  3943. extendStatics(d, b);
  3944. function __() { this.constructor = d; }
  3945. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3946. };
  3947. })();
  3948. Object.defineProperty(exports, "__esModule", { value: true });
  3949. var Observable_1 = __webpack_require__(0);
  3950. var redirect_on_url_1 = __webpack_require__(3);
  3951. var TwitterRedirect = (function (_super) {
  3952. __extends(TwitterRedirect, _super);
  3953. function TwitterRedirect(domainTester, urlTester, matcher) {
  3954. return _super.call(this, domainTester, urlTester, matcher) || this;
  3955. }
  3956. TwitterRedirect.prototype.handlerOne = function (aEle) {
  3957. var _this = this;
  3958. return Observable_1.Observable.of(aEle)
  3959. .filter(function (ele) { return _this.urlTester.test(ele.href) && /^https?:\/\//.test(ele.title); })
  3960. .subscribe(function (aEle) {
  3961. var url = decodeURIComponent(aEle.title);
  3962. if (url) {
  3963. aEle.href = url;
  3964. _this.DEBUG && (aEle.style.backgroundColor = 'green');
  3965. }
  3966. });
  3967. };
  3968. return TwitterRedirect;
  3969. }(redirect_on_url_1.RedirectOnUrl));
  3970. exports.default = new TwitterRedirect(/twitter\.com/, /t\.co\/\w+/, null);
  3971.  
  3972.  
  3973. /***/ }),
  3974. /* 51 */
  3975. /***/ (function(module, exports, __webpack_require__) {
  3976.  
  3977. "use strict";
  3978.  
  3979. var __extends = (this && this.__extends) || (function () {
  3980. var extendStatics = Object.setPrototypeOf ||
  3981. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  3982. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  3983. return function (d, b) {
  3984. extendStatics(d, b);
  3985. function __() { this.constructor = d; }
  3986. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  3987. };
  3988. })();
  3989. Object.defineProperty(exports, "__esModule", { value: true });
  3990. var Observable_1 = __webpack_require__(0);
  3991. var redirect_on_url_1 = __webpack_require__(3);
  3992. var WeiboRedirect = (function (_super) {
  3993. __extends(WeiboRedirect, _super);
  3994. function WeiboRedirect(domainTester, urlTester, matcher) {
  3995. return _super.call(this, domainTester, urlTester, matcher) || this;
  3996. }
  3997. WeiboRedirect.prototype.handlerOne = function (aEle) {
  3998. var _this = this;
  3999. return Observable_1.Observable.of(aEle)
  4000. .filter(function (ele) {
  4001. return _this.urlTester.test(ele.href) && /^https?:\/\//.test(ele.title);
  4002. })
  4003. .subscribe(function (aEle) {
  4004. var url = decodeURIComponent(aEle.title);
  4005. if (url) {
  4006. aEle.href = url;
  4007. _this.DEBUG && (aEle.style.backgroundColor = 'green');
  4008. }
  4009. });
  4010. };
  4011. return WeiboRedirect;
  4012. }(redirect_on_url_1.RedirectOnUrl));
  4013. exports.default = new WeiboRedirect(/weibo\.com/, /t\.cn\/\w+/, null);
  4014.  
  4015.  
  4016. /***/ }),
  4017. /* 52 */
  4018. /***/ (function(module, exports, __webpack_require__) {
  4019.  
  4020. "use strict";
  4021.  
  4022. var __extends = (this && this.__extends) || (function () {
  4023. var extendStatics = Object.setPrototypeOf ||
  4024. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4025. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  4026. return function (d, b) {
  4027. extendStatics(d, b);
  4028. function __() { this.constructor = d; }
  4029. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4030. };
  4031. })();
  4032. Object.defineProperty(exports, "__esModule", { value: true });
  4033. var redirect_on_url_1 = __webpack_require__(3);
  4034. var ZhihuDailyRedirect = (function (_super) {
  4035. __extends(ZhihuDailyRedirect, _super);
  4036. function ZhihuDailyRedirect(domainTester, urlTester, matcher) {
  4037. return _super.call(this, domainTester, urlTester, matcher) || this;
  4038. }
  4039. return ZhihuDailyRedirect;
  4040. }(redirect_on_url_1.RedirectOnUrl));
  4041. exports.default = new ZhihuDailyRedirect(/daily\.zhihu\.com/, /zhihu\.com\/\?target=/, /zhihu\.com\/\?target=(.*)/);
  4042.  
  4043.  
  4044. /***/ }),
  4045. /* 53 */
  4046. /***/ (function(module, exports, __webpack_require__) {
  4047.  
  4048. "use strict";
  4049.  
  4050. var __extends = (this && this.__extends) || (function () {
  4051. var extendStatics = Object.setPrototypeOf ||
  4052. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4053. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  4054. return function (d, b) {
  4055. extendStatics(d, b);
  4056. function __() { this.constructor = d; }
  4057. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4058. };
  4059. })();
  4060. Object.defineProperty(exports, "__esModule", { value: true });
  4061. var redirect_on_url_1 = __webpack_require__(3);
  4062. var ZhihuZhuanlanRedirect = (function (_super) {
  4063. __extends(ZhihuZhuanlanRedirect, _super);
  4064. function ZhihuZhuanlanRedirect(domainTester, urlTester, matcher) {
  4065. return _super.call(this, domainTester, urlTester, matcher) || this;
  4066. }
  4067. return ZhihuZhuanlanRedirect;
  4068. }(redirect_on_url_1.RedirectOnUrl));
  4069. exports.default = new ZhihuZhuanlanRedirect(/zhuanlan\.zhihu\.com/, /link\.zhihu\.com\/\?target=/, /link\.zhihu\.com\/\?target=(.*)/);
  4070.  
  4071.  
  4072. /***/ }),
  4073. /* 54 */
  4074. /***/ (function(module, exports, __webpack_require__) {
  4075.  
  4076. "use strict";
  4077.  
  4078. var __extends = (this && this.__extends) || (function () {
  4079. var extendStatics = Object.setPrototypeOf ||
  4080. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4081. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  4082. return function (d, b) {
  4083. extendStatics(d, b);
  4084. function __() { this.constructor = d; }
  4085. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4086. };
  4087. })();
  4088. Object.defineProperty(exports, "__esModule", { value: true });
  4089. var redirect_on_url_1 = __webpack_require__(3);
  4090. var ZhihuRedirect = (function (_super) {
  4091. __extends(ZhihuRedirect, _super);
  4092. function ZhihuRedirect(domainTester, urlTester, matcher) {
  4093. return _super.call(this, domainTester, urlTester, matcher) || this;
  4094. }
  4095. return ZhihuRedirect;
  4096. }(redirect_on_url_1.RedirectOnUrl));
  4097. exports.default = new ZhihuRedirect(/www\.zhihu\.com/, /zhihu\.com\/\?target=/, /zhihu\.com\/\?target=(.*)/);
  4098.  
  4099.  
  4100. /***/ }),
  4101. /* 55 */
  4102. /***/ (function(module, exports, __webpack_require__) {
  4103.  
  4104. "use strict";
  4105.  
  4106. var __extends = (this && this.__extends) || function (d, b) {
  4107. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  4108. function __() { this.constructor = d; }
  4109. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4110. };
  4111. var Subscriber_1 = __webpack_require__(1);
  4112. /**
  4113. * We need this JSDoc comment for affecting ESDoc.
  4114. * @ignore
  4115. * @extends {Ignored}
  4116. */
  4117. var InnerSubscriber = (function (_super) {
  4118. __extends(InnerSubscriber, _super);
  4119. function InnerSubscriber(parent, outerValue, outerIndex) {
  4120. _super.call(this);
  4121. this.parent = parent;
  4122. this.outerValue = outerValue;
  4123. this.outerIndex = outerIndex;
  4124. this.index = 0;
  4125. }
  4126. InnerSubscriber.prototype._next = function (value) {
  4127. this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);
  4128. };
  4129. InnerSubscriber.prototype._error = function (error) {
  4130. this.parent.notifyError(error, this);
  4131. this.unsubscribe();
  4132. };
  4133. InnerSubscriber.prototype._complete = function () {
  4134. this.parent.notifyComplete(this);
  4135. this.unsubscribe();
  4136. };
  4137. return InnerSubscriber;
  4138. }(Subscriber_1.Subscriber));
  4139. exports.InnerSubscriber = InnerSubscriber;
  4140. //# sourceMappingURL=InnerSubscriber.js.map
  4141.  
  4142. /***/ }),
  4143. /* 56 */
  4144. /***/ (function(module, exports, __webpack_require__) {
  4145.  
  4146. "use strict";
  4147.  
  4148. /**
  4149. * An execution context and a data structure to order tasks and schedule their
  4150. * execution. Provides a notion of (potentially virtual) time, through the
  4151. * `now()` getter method.
  4152. *
  4153. * Each unit of work in a Scheduler is called an {@link Action}.
  4154. *
  4155. * ```ts
  4156. * class Scheduler {
  4157. * now(): number;
  4158. * schedule(work, delay?, state?): Subscription;
  4159. * }
  4160. * ```
  4161. *
  4162. * @class Scheduler
  4163. */
  4164. var Scheduler = (function () {
  4165. function Scheduler(SchedulerAction, now) {
  4166. if (now === void 0) { now = Scheduler.now; }
  4167. this.SchedulerAction = SchedulerAction;
  4168. this.now = now;
  4169. }
  4170. /**
  4171. * Schedules a function, `work`, for execution. May happen at some point in
  4172. * the future, according to the `delay` parameter, if specified. May be passed
  4173. * some context object, `state`, which will be passed to the `work` function.
  4174. *
  4175. * The given arguments will be processed an stored as an Action object in a
  4176. * queue of actions.
  4177. *
  4178. * @param {function(state: ?T): ?Subscription} work A function representing a
  4179. * task, or some unit of work to be executed by the Scheduler.
  4180. * @param {number} [delay] Time to wait before executing the work, where the
  4181. * time unit is implicit and defined by the Scheduler itself.
  4182. * @param {T} [state] Some contextual data that the `work` function uses when
  4183. * called by the Scheduler.
  4184. * @return {Subscription} A subscription in order to be able to unsubscribe
  4185. * the scheduled work.
  4186. */
  4187. Scheduler.prototype.schedule = function (work, delay, state) {
  4188. if (delay === void 0) { delay = 0; }
  4189. return new this.SchedulerAction(this, work).schedule(state, delay);
  4190. };
  4191. Scheduler.now = Date.now ? Date.now : function () { return +new Date(); };
  4192. return Scheduler;
  4193. }());
  4194. exports.Scheduler = Scheduler;
  4195. //# sourceMappingURL=Scheduler.js.map
  4196.  
  4197. /***/ }),
  4198. /* 57 */
  4199. /***/ (function(module, exports, __webpack_require__) {
  4200.  
  4201. "use strict";
  4202.  
  4203. var __extends = (this && this.__extends) || function (d, b) {
  4204. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  4205. function __() { this.constructor = d; }
  4206. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4207. };
  4208. var Observable_1 = __webpack_require__(0);
  4209. var ScalarObservable_1 = __webpack_require__(19);
  4210. var EmptyObservable_1 = __webpack_require__(6);
  4211. /**
  4212. * We need this JSDoc comment for affecting ESDoc.
  4213. * @extends {Ignored}
  4214. * @hide true
  4215. */
  4216. var ArrayLikeObservable = (function (_super) {
  4217. __extends(ArrayLikeObservable, _super);
  4218. function ArrayLikeObservable(arrayLike, scheduler) {
  4219. _super.call(this);
  4220. this.arrayLike = arrayLike;
  4221. this.scheduler = scheduler;
  4222. if (!scheduler && arrayLike.length === 1) {
  4223. this._isScalar = true;
  4224. this.value = arrayLike[0];
  4225. }
  4226. }
  4227. ArrayLikeObservable.create = function (arrayLike, scheduler) {
  4228. var length = arrayLike.length;
  4229. if (length === 0) {
  4230. return new EmptyObservable_1.EmptyObservable();
  4231. }
  4232. else if (length === 1) {
  4233. return new ScalarObservable_1.ScalarObservable(arrayLike[0], scheduler);
  4234. }
  4235. else {
  4236. return new ArrayLikeObservable(arrayLike, scheduler);
  4237. }
  4238. };
  4239. ArrayLikeObservable.dispatch = function (state) {
  4240. var arrayLike = state.arrayLike, index = state.index, length = state.length, subscriber = state.subscriber;
  4241. if (subscriber.closed) {
  4242. return;
  4243. }
  4244. if (index >= length) {
  4245. subscriber.complete();
  4246. return;
  4247. }
  4248. subscriber.next(arrayLike[index]);
  4249. state.index = index + 1;
  4250. this.schedule(state);
  4251. };
  4252. ArrayLikeObservable.prototype._subscribe = function (subscriber) {
  4253. var index = 0;
  4254. var _a = this, arrayLike = _a.arrayLike, scheduler = _a.scheduler;
  4255. var length = arrayLike.length;
  4256. if (scheduler) {
  4257. return scheduler.schedule(ArrayLikeObservable.dispatch, 0, {
  4258. arrayLike: arrayLike, index: index, length: length, subscriber: subscriber
  4259. });
  4260. }
  4261. else {
  4262. for (var i = 0; i < length && !subscriber.closed; i++) {
  4263. subscriber.next(arrayLike[i]);
  4264. }
  4265. subscriber.complete();
  4266. }
  4267. };
  4268. return ArrayLikeObservable;
  4269. }(Observable_1.Observable));
  4270. exports.ArrayLikeObservable = ArrayLikeObservable;
  4271. //# sourceMappingURL=ArrayLikeObservable.js.map
  4272.  
  4273. /***/ }),
  4274. /* 58 */
  4275. /***/ (function(module, exports, __webpack_require__) {
  4276.  
  4277. "use strict";
  4278.  
  4279. var __extends = (this && this.__extends) || function (d, b) {
  4280. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  4281. function __() { this.constructor = d; }
  4282. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4283. };
  4284. var Observable_1 = __webpack_require__(0);
  4285. var EmptyObservable_1 = __webpack_require__(6);
  4286. var isArray_1 = __webpack_require__(10);
  4287. var subscribeToResult_1 = __webpack_require__(25);
  4288. var OuterSubscriber_1 = __webpack_require__(17);
  4289. /**
  4290. * We need this JSDoc comment for affecting ESDoc.
  4291. * @extends {Ignored}
  4292. * @hide true
  4293. */
  4294. var ForkJoinObservable = (function (_super) {
  4295. __extends(ForkJoinObservable, _super);
  4296. function ForkJoinObservable(sources, resultSelector) {
  4297. _super.call(this);
  4298. this.sources = sources;
  4299. this.resultSelector = resultSelector;
  4300. }
  4301. /* tslint:enable:max-line-length */
  4302. /**
  4303. * @param sources
  4304. * @return {any}
  4305. * @static true
  4306. * @name forkJoin
  4307. * @owner Observable
  4308. */
  4309. ForkJoinObservable.create = function () {
  4310. var sources = [];
  4311. for (var _i = 0; _i < arguments.length; _i++) {
  4312. sources[_i - 0] = arguments[_i];
  4313. }
  4314. if (sources === null || arguments.length === 0) {
  4315. return new EmptyObservable_1.EmptyObservable();
  4316. }
  4317. var resultSelector = null;
  4318. if (typeof sources[sources.length - 1] === 'function') {
  4319. resultSelector = sources.pop();
  4320. }
  4321. // if the first and only other argument besides the resultSelector is an array
  4322. // assume it's been called with `forkJoin([obs1, obs2, obs3], resultSelector)`
  4323. if (sources.length === 1 && isArray_1.isArray(sources[0])) {
  4324. sources = sources[0];
  4325. }
  4326. if (sources.length === 0) {
  4327. return new EmptyObservable_1.EmptyObservable();
  4328. }
  4329. return new ForkJoinObservable(sources, resultSelector);
  4330. };
  4331. ForkJoinObservable.prototype._subscribe = function (subscriber) {
  4332. return new ForkJoinSubscriber(subscriber, this.sources, this.resultSelector);
  4333. };
  4334. return ForkJoinObservable;
  4335. }(Observable_1.Observable));
  4336. exports.ForkJoinObservable = ForkJoinObservable;
  4337. /**
  4338. * We need this JSDoc comment for affecting ESDoc.
  4339. * @ignore
  4340. * @extends {Ignored}
  4341. */
  4342. var ForkJoinSubscriber = (function (_super) {
  4343. __extends(ForkJoinSubscriber, _super);
  4344. function ForkJoinSubscriber(destination, sources, resultSelector) {
  4345. _super.call(this, destination);
  4346. this.sources = sources;
  4347. this.resultSelector = resultSelector;
  4348. this.completed = 0;
  4349. this.haveValues = 0;
  4350. var len = sources.length;
  4351. this.total = len;
  4352. this.values = new Array(len);
  4353. for (var i = 0; i < len; i++) {
  4354. var source = sources[i];
  4355. var innerSubscription = subscribeToResult_1.subscribeToResult(this, source, null, i);
  4356. if (innerSubscription) {
  4357. innerSubscription.outerIndex = i;
  4358. this.add(innerSubscription);
  4359. }
  4360. }
  4361. }
  4362. ForkJoinSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  4363. this.values[outerIndex] = innerValue;
  4364. if (!innerSub._hasValue) {
  4365. innerSub._hasValue = true;
  4366. this.haveValues++;
  4367. }
  4368. };
  4369. ForkJoinSubscriber.prototype.notifyComplete = function (innerSub) {
  4370. var destination = this.destination;
  4371. var _a = this, haveValues = _a.haveValues, resultSelector = _a.resultSelector, values = _a.values;
  4372. var len = values.length;
  4373. if (!innerSub._hasValue) {
  4374. destination.complete();
  4375. return;
  4376. }
  4377. this.completed++;
  4378. if (this.completed !== len) {
  4379. return;
  4380. }
  4381. if (haveValues === len) {
  4382. var value = resultSelector ? resultSelector.apply(this, values) : values;
  4383. destination.next(value);
  4384. }
  4385. destination.complete();
  4386. };
  4387. return ForkJoinSubscriber;
  4388. }(OuterSubscriber_1.OuterSubscriber));
  4389. //# sourceMappingURL=ForkJoinObservable.js.map
  4390.  
  4391. /***/ }),
  4392. /* 59 */
  4393. /***/ (function(module, exports, __webpack_require__) {
  4394.  
  4395. "use strict";
  4396.  
  4397. var __extends = (this && this.__extends) || function (d, b) {
  4398. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  4399. function __() { this.constructor = d; }
  4400. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4401. };
  4402. var Observable_1 = __webpack_require__(0);
  4403. var tryCatch_1 = __webpack_require__(26);
  4404. var isFunction_1 = __webpack_require__(11);
  4405. var errorObject_1 = __webpack_require__(9);
  4406. var Subscription_1 = __webpack_require__(5);
  4407. var toString = Object.prototype.toString;
  4408. function isNodeStyleEventEmitter(sourceObj) {
  4409. return !!sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';
  4410. }
  4411. function isJQueryStyleEventEmitter(sourceObj) {
  4412. return !!sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';
  4413. }
  4414. function isNodeList(sourceObj) {
  4415. return !!sourceObj && toString.call(sourceObj) === '[object NodeList]';
  4416. }
  4417. function isHTMLCollection(sourceObj) {
  4418. return !!sourceObj && toString.call(sourceObj) === '[object HTMLCollection]';
  4419. }
  4420. function isEventTarget(sourceObj) {
  4421. return !!sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';
  4422. }
  4423. /**
  4424. * We need this JSDoc comment for affecting ESDoc.
  4425. * @extends {Ignored}
  4426. * @hide true
  4427. */
  4428. var FromEventObservable = (function (_super) {
  4429. __extends(FromEventObservable, _super);
  4430. function FromEventObservable(sourceObj, eventName, selector, options) {
  4431. _super.call(this);
  4432. this.sourceObj = sourceObj;
  4433. this.eventName = eventName;
  4434. this.selector = selector;
  4435. this.options = options;
  4436. }
  4437. /* tslint:enable:max-line-length */
  4438. /**
  4439. * Creates an Observable that emits events of a specific type coming from the
  4440. * given event target.
  4441. *
  4442. * <span class="informal">Creates an Observable from DOM events, or Node
  4443. * EventEmitter events or others.</span>
  4444. *
  4445. * <img src="./img/fromEvent.png" width="100%">
  4446. *
  4447. * Creates an Observable by attaching an event listener to an "event target",
  4448. * which may be an object with `addEventListener` and `removeEventListener`,
  4449. * a Node.js EventEmitter, a jQuery style EventEmitter, a NodeList from the
  4450. * DOM, or an HTMLCollection from the DOM. The event handler is attached when
  4451. * the output Observable is subscribed, and removed when the Subscription is
  4452. * unsubscribed.
  4453. *
  4454. * @example <caption>Emits clicks happening on the DOM document</caption>
  4455. * var clicks = Rx.Observable.fromEvent(document, 'click');
  4456. * clicks.subscribe(x => console.log(x));
  4457. *
  4458. * // Results in:
  4459. * // MouseEvent object logged to console everytime a click
  4460. * // occurs on the document.
  4461. *
  4462. * @see {@link from}
  4463. * @see {@link fromEventPattern}
  4464. *
  4465. * @param {EventTargetLike} target The DOMElement, event target, Node.js
  4466. * EventEmitter, NodeList or HTMLCollection to attach the event handler to.
  4467. * @param {string} eventName The event name of interest, being emitted by the
  4468. * `target`.
  4469. * @param {EventListenerOptions} [options] Options to pass through to addEventListener
  4470. * @param {SelectorMethodSignature<T>} [selector] An optional function to
  4471. * post-process results. It takes the arguments from the event handler and
  4472. * should return a single value.
  4473. * @return {Observable<T>}
  4474. * @static true
  4475. * @name fromEvent
  4476. * @owner Observable
  4477. */
  4478. FromEventObservable.create = function (target, eventName, options, selector) {
  4479. if (isFunction_1.isFunction(options)) {
  4480. selector = options;
  4481. options = undefined;
  4482. }
  4483. return new FromEventObservable(target, eventName, selector, options);
  4484. };
  4485. FromEventObservable.setupSubscription = function (sourceObj, eventName, handler, subscriber, options) {
  4486. var unsubscribe;
  4487. if (isNodeList(sourceObj) || isHTMLCollection(sourceObj)) {
  4488. for (var i = 0, len = sourceObj.length; i < len; i++) {
  4489. FromEventObservable.setupSubscription(sourceObj[i], eventName, handler, subscriber, options);
  4490. }
  4491. }
  4492. else if (isEventTarget(sourceObj)) {
  4493. var source_1 = sourceObj;
  4494. sourceObj.addEventListener(eventName, handler, options);
  4495. unsubscribe = function () { return source_1.removeEventListener(eventName, handler); };
  4496. }
  4497. else if (isJQueryStyleEventEmitter(sourceObj)) {
  4498. var source_2 = sourceObj;
  4499. sourceObj.on(eventName, handler);
  4500. unsubscribe = function () { return source_2.off(eventName, handler); };
  4501. }
  4502. else if (isNodeStyleEventEmitter(sourceObj)) {
  4503. var source_3 = sourceObj;
  4504. sourceObj.addListener(eventName, handler);
  4505. unsubscribe = function () { return source_3.removeListener(eventName, handler); };
  4506. }
  4507. else {
  4508. throw new TypeError('Invalid event target');
  4509. }
  4510. subscriber.add(new Subscription_1.Subscription(unsubscribe));
  4511. };
  4512. FromEventObservable.prototype._subscribe = function (subscriber) {
  4513. var sourceObj = this.sourceObj;
  4514. var eventName = this.eventName;
  4515. var options = this.options;
  4516. var selector = this.selector;
  4517. var handler = selector ? function () {
  4518. var args = [];
  4519. for (var _i = 0; _i < arguments.length; _i++) {
  4520. args[_i - 0] = arguments[_i];
  4521. }
  4522. var result = tryCatch_1.tryCatch(selector).apply(void 0, args);
  4523. if (result === errorObject_1.errorObject) {
  4524. subscriber.error(errorObject_1.errorObject.e);
  4525. }
  4526. else {
  4527. subscriber.next(result);
  4528. }
  4529. } : function (e) { return subscriber.next(e); };
  4530. FromEventObservable.setupSubscription(sourceObj, eventName, handler, subscriber, options);
  4531. };
  4532. return FromEventObservable;
  4533. }(Observable_1.Observable));
  4534. exports.FromEventObservable = FromEventObservable;
  4535. //# sourceMappingURL=FromEventObservable.js.map
  4536.  
  4537. /***/ }),
  4538. /* 60 */
  4539. /***/ (function(module, exports, __webpack_require__) {
  4540.  
  4541. "use strict";
  4542.  
  4543. var __extends = (this && this.__extends) || function (d, b) {
  4544. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  4545. function __() { this.constructor = d; }
  4546. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4547. };
  4548. var isArray_1 = __webpack_require__(10);
  4549. var isArrayLike_1 = __webpack_require__(21);
  4550. var isPromise_1 = __webpack_require__(24);
  4551. var PromiseObservable_1 = __webpack_require__(62);
  4552. var IteratorObservable_1 = __webpack_require__(61);
  4553. var ArrayObservable_1 = __webpack_require__(18);
  4554. var ArrayLikeObservable_1 = __webpack_require__(57);
  4555. var iterator_1 = __webpack_require__(7);
  4556. var Observable_1 = __webpack_require__(0);
  4557. var observeOn_1 = __webpack_require__(73);
  4558. var observable_1 = __webpack_require__(8);
  4559. /**
  4560. * We need this JSDoc comment for affecting ESDoc.
  4561. * @extends {Ignored}
  4562. * @hide true
  4563. */
  4564. var FromObservable = (function (_super) {
  4565. __extends(FromObservable, _super);
  4566. function FromObservable(ish, scheduler) {
  4567. _super.call(this, null);
  4568. this.ish = ish;
  4569. this.scheduler = scheduler;
  4570. }
  4571. /**
  4572. * Creates an Observable from an Array, an array-like object, a Promise, an
  4573. * iterable object, or an Observable-like object.
  4574. *
  4575. * <span class="informal">Converts almost anything to an Observable.</span>
  4576. *
  4577. * <img src="./img/from.png" width="100%">
  4578. *
  4579. * Convert various other objects and data types into Observables. `from`
  4580. * converts a Promise or an array-like or an
  4581. * [iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable)
  4582. * object into an Observable that emits the items in that promise or array or
  4583. * iterable. A String, in this context, is treated as an array of characters.
  4584. * Observable-like objects (contains a function named with the ES2015 Symbol
  4585. * for Observable) can also be converted through this operator.
  4586. *
  4587. * @example <caption>Converts an array to an Observable</caption>
  4588. * var array = [10, 20, 30];
  4589. * var result = Rx.Observable.from(array);
  4590. * result.subscribe(x => console.log(x));
  4591. *
  4592. * // Results in the following:
  4593. * // 10 20 30
  4594. *
  4595. * @example <caption>Convert an infinite iterable (from a generator) to an Observable</caption>
  4596. * function* generateDoubles(seed) {
  4597. * var i = seed;
  4598. * while (true) {
  4599. * yield i;
  4600. * i = 2 * i; // double it
  4601. * }
  4602. * }
  4603. *
  4604. * var iterator = generateDoubles(3);
  4605. * var result = Rx.Observable.from(iterator).take(10);
  4606. * result.subscribe(x => console.log(x));
  4607. *
  4608. * // Results in the following:
  4609. * // 3 6 12 24 48 96 192 384 768 1536
  4610. *
  4611. * @see {@link create}
  4612. * @see {@link fromEvent}
  4613. * @see {@link fromEventPattern}
  4614. * @see {@link fromPromise}
  4615. *
  4616. * @param {ObservableInput<T>} ish A subscribable object, a Promise, an
  4617. * Observable-like, an Array, an iterable or an array-like object to be
  4618. * converted.
  4619. * @param {Scheduler} [scheduler] The scheduler on which to schedule the
  4620. * emissions of values.
  4621. * @return {Observable<T>} The Observable whose values are originally from the
  4622. * input object that was converted.
  4623. * @static true
  4624. * @name from
  4625. * @owner Observable
  4626. */
  4627. FromObservable.create = function (ish, scheduler) {
  4628. if (ish != null) {
  4629. if (typeof ish[observable_1.$$observable] === 'function') {
  4630. if (ish instanceof Observable_1.Observable && !scheduler) {
  4631. return ish;
  4632. }
  4633. return new FromObservable(ish, scheduler);
  4634. }
  4635. else if (isArray_1.isArray(ish)) {
  4636. return new ArrayObservable_1.ArrayObservable(ish, scheduler);
  4637. }
  4638. else if (isPromise_1.isPromise(ish)) {
  4639. return new PromiseObservable_1.PromiseObservable(ish, scheduler);
  4640. }
  4641. else if (typeof ish[iterator_1.$$iterator] === 'function' || typeof ish === 'string') {
  4642. return new IteratorObservable_1.IteratorObservable(ish, scheduler);
  4643. }
  4644. else if (isArrayLike_1.isArrayLike(ish)) {
  4645. return new ArrayLikeObservable_1.ArrayLikeObservable(ish, scheduler);
  4646. }
  4647. }
  4648. throw new TypeError((ish !== null && typeof ish || ish) + ' is not observable');
  4649. };
  4650. FromObservable.prototype._subscribe = function (subscriber) {
  4651. var ish = this.ish;
  4652. var scheduler = this.scheduler;
  4653. if (scheduler == null) {
  4654. return ish[observable_1.$$observable]().subscribe(subscriber);
  4655. }
  4656. else {
  4657. return ish[observable_1.$$observable]().subscribe(new observeOn_1.ObserveOnSubscriber(subscriber, scheduler, 0));
  4658. }
  4659. };
  4660. return FromObservable;
  4661. }(Observable_1.Observable));
  4662. exports.FromObservable = FromObservable;
  4663. //# sourceMappingURL=FromObservable.js.map
  4664.  
  4665. /***/ }),
  4666. /* 61 */
  4667. /***/ (function(module, exports, __webpack_require__) {
  4668.  
  4669. "use strict";
  4670.  
  4671. var __extends = (this && this.__extends) || function (d, b) {
  4672. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  4673. function __() { this.constructor = d; }
  4674. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4675. };
  4676. var root_1 = __webpack_require__(2);
  4677. var Observable_1 = __webpack_require__(0);
  4678. var iterator_1 = __webpack_require__(7);
  4679. /**
  4680. * We need this JSDoc comment for affecting ESDoc.
  4681. * @extends {Ignored}
  4682. * @hide true
  4683. */
  4684. var IteratorObservable = (function (_super) {
  4685. __extends(IteratorObservable, _super);
  4686. function IteratorObservable(iterator, scheduler) {
  4687. _super.call(this);
  4688. this.scheduler = scheduler;
  4689. if (iterator == null) {
  4690. throw new Error('iterator cannot be null.');
  4691. }
  4692. this.iterator = getIterator(iterator);
  4693. }
  4694. IteratorObservable.create = function (iterator, scheduler) {
  4695. return new IteratorObservable(iterator, scheduler);
  4696. };
  4697. IteratorObservable.dispatch = function (state) {
  4698. var index = state.index, hasError = state.hasError, iterator = state.iterator, subscriber = state.subscriber;
  4699. if (hasError) {
  4700. subscriber.error(state.error);
  4701. return;
  4702. }
  4703. var result = iterator.next();
  4704. if (result.done) {
  4705. subscriber.complete();
  4706. return;
  4707. }
  4708. subscriber.next(result.value);
  4709. state.index = index + 1;
  4710. if (subscriber.closed) {
  4711. if (typeof iterator.return === 'function') {
  4712. iterator.return();
  4713. }
  4714. return;
  4715. }
  4716. this.schedule(state);
  4717. };
  4718. IteratorObservable.prototype._subscribe = function (subscriber) {
  4719. var index = 0;
  4720. var _a = this, iterator = _a.iterator, scheduler = _a.scheduler;
  4721. if (scheduler) {
  4722. return scheduler.schedule(IteratorObservable.dispatch, 0, {
  4723. index: index, iterator: iterator, subscriber: subscriber
  4724. });
  4725. }
  4726. else {
  4727. do {
  4728. var result = iterator.next();
  4729. if (result.done) {
  4730. subscriber.complete();
  4731. break;
  4732. }
  4733. else {
  4734. subscriber.next(result.value);
  4735. }
  4736. if (subscriber.closed) {
  4737. if (typeof iterator.return === 'function') {
  4738. iterator.return();
  4739. }
  4740. break;
  4741. }
  4742. } while (true);
  4743. }
  4744. };
  4745. return IteratorObservable;
  4746. }(Observable_1.Observable));
  4747. exports.IteratorObservable = IteratorObservable;
  4748. var StringIterator = (function () {
  4749. function StringIterator(str, idx, len) {
  4750. if (idx === void 0) { idx = 0; }
  4751. if (len === void 0) { len = str.length; }
  4752. this.str = str;
  4753. this.idx = idx;
  4754. this.len = len;
  4755. }
  4756. StringIterator.prototype[iterator_1.$$iterator] = function () { return (this); };
  4757. StringIterator.prototype.next = function () {
  4758. return this.idx < this.len ? {
  4759. done: false,
  4760. value: this.str.charAt(this.idx++)
  4761. } : {
  4762. done: true,
  4763. value: undefined
  4764. };
  4765. };
  4766. return StringIterator;
  4767. }());
  4768. var ArrayIterator = (function () {
  4769. function ArrayIterator(arr, idx, len) {
  4770. if (idx === void 0) { idx = 0; }
  4771. if (len === void 0) { len = toLength(arr); }
  4772. this.arr = arr;
  4773. this.idx = idx;
  4774. this.len = len;
  4775. }
  4776. ArrayIterator.prototype[iterator_1.$$iterator] = function () { return this; };
  4777. ArrayIterator.prototype.next = function () {
  4778. return this.idx < this.len ? {
  4779. done: false,
  4780. value: this.arr[this.idx++]
  4781. } : {
  4782. done: true,
  4783. value: undefined
  4784. };
  4785. };
  4786. return ArrayIterator;
  4787. }());
  4788. function getIterator(obj) {
  4789. var i = obj[iterator_1.$$iterator];
  4790. if (!i && typeof obj === 'string') {
  4791. return new StringIterator(obj);
  4792. }
  4793. if (!i && obj.length !== undefined) {
  4794. return new ArrayIterator(obj);
  4795. }
  4796. if (!i) {
  4797. throw new TypeError('object is not iterable');
  4798. }
  4799. return obj[iterator_1.$$iterator]();
  4800. }
  4801. var maxSafeInteger = Math.pow(2, 53) - 1;
  4802. function toLength(o) {
  4803. var len = +o.length;
  4804. if (isNaN(len)) {
  4805. return 0;
  4806. }
  4807. if (len === 0 || !numberIsFinite(len)) {
  4808. return len;
  4809. }
  4810. len = sign(len) * Math.floor(Math.abs(len));
  4811. if (len <= 0) {
  4812. return 0;
  4813. }
  4814. if (len > maxSafeInteger) {
  4815. return maxSafeInteger;
  4816. }
  4817. return len;
  4818. }
  4819. function numberIsFinite(value) {
  4820. return typeof value === 'number' && root_1.root.isFinite(value);
  4821. }
  4822. function sign(value) {
  4823. var valueAsNumber = +value;
  4824. if (valueAsNumber === 0) {
  4825. return valueAsNumber;
  4826. }
  4827. if (isNaN(valueAsNumber)) {
  4828. return valueAsNumber;
  4829. }
  4830. return valueAsNumber < 0 ? -1 : 1;
  4831. }
  4832. //# sourceMappingURL=IteratorObservable.js.map
  4833.  
  4834. /***/ }),
  4835. /* 62 */
  4836. /***/ (function(module, exports, __webpack_require__) {
  4837.  
  4838. "use strict";
  4839.  
  4840. var __extends = (this && this.__extends) || function (d, b) {
  4841. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  4842. function __() { this.constructor = d; }
  4843. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4844. };
  4845. var root_1 = __webpack_require__(2);
  4846. var Observable_1 = __webpack_require__(0);
  4847. /**
  4848. * We need this JSDoc comment for affecting ESDoc.
  4849. * @extends {Ignored}
  4850. * @hide true
  4851. */
  4852. var PromiseObservable = (function (_super) {
  4853. __extends(PromiseObservable, _super);
  4854. function PromiseObservable(promise, scheduler) {
  4855. _super.call(this);
  4856. this.promise = promise;
  4857. this.scheduler = scheduler;
  4858. }
  4859. /**
  4860. * Converts a Promise to an Observable.
  4861. *
  4862. * <span class="informal">Returns an Observable that just emits the Promise's
  4863. * resolved value, then completes.</span>
  4864. *
  4865. * Converts an ES2015 Promise or a Promises/A+ spec compliant Promise to an
  4866. * Observable. If the Promise resolves with a value, the output Observable
  4867. * emits that resolved value as a `next`, and then completes. If the Promise
  4868. * is rejected, then the output Observable emits the corresponding Error.
  4869. *
  4870. * @example <caption>Convert the Promise returned by Fetch to an Observable</caption>
  4871. * var result = Rx.Observable.fromPromise(fetch('http://myserver.com/'));
  4872. * result.subscribe(x => console.log(x), e => console.error(e));
  4873. *
  4874. * @see {@link bindCallback}
  4875. * @see {@link from}
  4876. *
  4877. * @param {Promise<T>} promise The promise to be converted.
  4878. * @param {Scheduler} [scheduler] An optional IScheduler to use for scheduling
  4879. * the delivery of the resolved value (or the rejection).
  4880. * @return {Observable<T>} An Observable which wraps the Promise.
  4881. * @static true
  4882. * @name fromPromise
  4883. * @owner Observable
  4884. */
  4885. PromiseObservable.create = function (promise, scheduler) {
  4886. return new PromiseObservable(promise, scheduler);
  4887. };
  4888. PromiseObservable.prototype._subscribe = function (subscriber) {
  4889. var _this = this;
  4890. var promise = this.promise;
  4891. var scheduler = this.scheduler;
  4892. if (scheduler == null) {
  4893. if (this._isScalar) {
  4894. if (!subscriber.closed) {
  4895. subscriber.next(this.value);
  4896. subscriber.complete();
  4897. }
  4898. }
  4899. else {
  4900. promise.then(function (value) {
  4901. _this.value = value;
  4902. _this._isScalar = true;
  4903. if (!subscriber.closed) {
  4904. subscriber.next(value);
  4905. subscriber.complete();
  4906. }
  4907. }, function (err) {
  4908. if (!subscriber.closed) {
  4909. subscriber.error(err);
  4910. }
  4911. })
  4912. .then(null, function (err) {
  4913. // escape the promise trap, throw unhandled errors
  4914. root_1.root.setTimeout(function () { throw err; });
  4915. });
  4916. }
  4917. }
  4918. else {
  4919. if (this._isScalar) {
  4920. if (!subscriber.closed) {
  4921. return scheduler.schedule(dispatchNext, 0, { value: this.value, subscriber: subscriber });
  4922. }
  4923. }
  4924. else {
  4925. promise.then(function (value) {
  4926. _this.value = value;
  4927. _this._isScalar = true;
  4928. if (!subscriber.closed) {
  4929. subscriber.add(scheduler.schedule(dispatchNext, 0, { value: value, subscriber: subscriber }));
  4930. }
  4931. }, function (err) {
  4932. if (!subscriber.closed) {
  4933. subscriber.add(scheduler.schedule(dispatchError, 0, { err: err, subscriber: subscriber }));
  4934. }
  4935. })
  4936. .then(null, function (err) {
  4937. // escape the promise trap, throw unhandled errors
  4938. root_1.root.setTimeout(function () { throw err; });
  4939. });
  4940. }
  4941. }
  4942. };
  4943. return PromiseObservable;
  4944. }(Observable_1.Observable));
  4945. exports.PromiseObservable = PromiseObservable;
  4946. function dispatchNext(arg) {
  4947. var value = arg.value, subscriber = arg.subscriber;
  4948. if (!subscriber.closed) {
  4949. subscriber.next(value);
  4950. subscriber.complete();
  4951. }
  4952. }
  4953. function dispatchError(arg) {
  4954. var err = arg.err, subscriber = arg.subscriber;
  4955. if (!subscriber.closed) {
  4956. subscriber.error(err);
  4957. }
  4958. }
  4959. //# sourceMappingURL=PromiseObservable.js.map
  4960.  
  4961. /***/ }),
  4962. /* 63 */
  4963. /***/ (function(module, exports, __webpack_require__) {
  4964.  
  4965. "use strict";
  4966.  
  4967. var ForkJoinObservable_1 = __webpack_require__(58);
  4968. exports.forkJoin = ForkJoinObservable_1.ForkJoinObservable.create;
  4969. //# sourceMappingURL=forkJoin.js.map
  4970.  
  4971. /***/ }),
  4972. /* 64 */
  4973. /***/ (function(module, exports, __webpack_require__) {
  4974.  
  4975. "use strict";
  4976.  
  4977. var FromObservable_1 = __webpack_require__(60);
  4978. exports.from = FromObservable_1.FromObservable.create;
  4979. //# sourceMappingURL=from.js.map
  4980.  
  4981. /***/ }),
  4982. /* 65 */
  4983. /***/ (function(module, exports, __webpack_require__) {
  4984.  
  4985. "use strict";
  4986.  
  4987. var FromEventObservable_1 = __webpack_require__(59);
  4988. exports.fromEvent = FromEventObservable_1.FromEventObservable.create;
  4989. //# sourceMappingURL=fromEvent.js.map
  4990.  
  4991. /***/ }),
  4992. /* 66 */
  4993. /***/ (function(module, exports, __webpack_require__) {
  4994.  
  4995. "use strict";
  4996.  
  4997. var ArrayObservable_1 = __webpack_require__(18);
  4998. exports.of = ArrayObservable_1.ArrayObservable.of;
  4999. //# sourceMappingURL=of.js.map
  5000.  
  5001. /***/ }),
  5002. /* 67 */
  5003. /***/ (function(module, exports, __webpack_require__) {
  5004.  
  5005. "use strict";
  5006.  
  5007. var __extends = (this && this.__extends) || function (d, b) {
  5008. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  5009. function __() { this.constructor = d; }
  5010. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5011. };
  5012. var Subscriber_1 = __webpack_require__(1);
  5013. var async_1 = __webpack_require__(4);
  5014. /**
  5015. * Emits a value from the source Observable only after a particular time span
  5016. * has passed without another source emission.
  5017. *
  5018. * <span class="informal">It's like {@link delay}, but passes only the most
  5019. * recent value from each burst of emissions.</span>
  5020. *
  5021. * <img src="./img/debounceTime.png" width="100%">
  5022. *
  5023. * `debounceTime` delays values emitted by the source Observable, but drops
  5024. * previous pending delayed emissions if a new value arrives on the source
  5025. * Observable. This operator keeps track of the most recent value from the
  5026. * source Observable, and emits that only when `dueTime` enough time has passed
  5027. * without any other value appearing on the source Observable. If a new value
  5028. * appears before `dueTime` silence occurs, the previous value will be dropped
  5029. * and will not be emitted on the output Observable.
  5030. *
  5031. * This is a rate-limiting operator, because it is impossible for more than one
  5032. * value to be emitted in any time window of duration `dueTime`, but it is also
  5033. * a delay-like operator since output emissions do not occur at the same time as
  5034. * they did on the source Observable. Optionally takes a {@link IScheduler} for
  5035. * managing timers.
  5036. *
  5037. * @example <caption>Emit the most recent click after a burst of clicks</caption>
  5038. * var clicks = Rx.Observable.fromEvent(document, 'click');
  5039. * var result = clicks.debounceTime(1000);
  5040. * result.subscribe(x => console.log(x));
  5041. *
  5042. * @see {@link auditTime}
  5043. * @see {@link debounce}
  5044. * @see {@link delay}
  5045. * @see {@link sampleTime}
  5046. * @see {@link throttleTime}
  5047. *
  5048. * @param {number} dueTime The timeout duration in milliseconds (or the time
  5049. * unit determined internally by the optional `scheduler`) for the window of
  5050. * time required to wait for emission silence before emitting the most recent
  5051. * source value.
  5052. * @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for
  5053. * managing the timers that handle the timeout for each value.
  5054. * @return {Observable} An Observable that delays the emissions of the source
  5055. * Observable by the specified `dueTime`, and may drop some values if they occur
  5056. * too frequently.
  5057. * @method debounceTime
  5058. * @owner Observable
  5059. */
  5060. function debounceTime(dueTime, scheduler) {
  5061. if (scheduler === void 0) { scheduler = async_1.async; }
  5062. return this.lift(new DebounceTimeOperator(dueTime, scheduler));
  5063. }
  5064. exports.debounceTime = debounceTime;
  5065. var DebounceTimeOperator = (function () {
  5066. function DebounceTimeOperator(dueTime, scheduler) {
  5067. this.dueTime = dueTime;
  5068. this.scheduler = scheduler;
  5069. }
  5070. DebounceTimeOperator.prototype.call = function (subscriber, source) {
  5071. return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));
  5072. };
  5073. return DebounceTimeOperator;
  5074. }());
  5075. /**
  5076. * We need this JSDoc comment for affecting ESDoc.
  5077. * @ignore
  5078. * @extends {Ignored}
  5079. */
  5080. var DebounceTimeSubscriber = (function (_super) {
  5081. __extends(DebounceTimeSubscriber, _super);
  5082. function DebounceTimeSubscriber(destination, dueTime, scheduler) {
  5083. _super.call(this, destination);
  5084. this.dueTime = dueTime;
  5085. this.scheduler = scheduler;
  5086. this.debouncedSubscription = null;
  5087. this.lastValue = null;
  5088. this.hasValue = false;
  5089. }
  5090. DebounceTimeSubscriber.prototype._next = function (value) {
  5091. this.clearDebounce();
  5092. this.lastValue = value;
  5093. this.hasValue = true;
  5094. this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));
  5095. };
  5096. DebounceTimeSubscriber.prototype._complete = function () {
  5097. this.debouncedNext();
  5098. this.destination.complete();
  5099. };
  5100. DebounceTimeSubscriber.prototype.debouncedNext = function () {
  5101. this.clearDebounce();
  5102. if (this.hasValue) {
  5103. this.destination.next(this.lastValue);
  5104. this.lastValue = null;
  5105. this.hasValue = false;
  5106. }
  5107. };
  5108. DebounceTimeSubscriber.prototype.clearDebounce = function () {
  5109. var debouncedSubscription = this.debouncedSubscription;
  5110. if (debouncedSubscription !== null) {
  5111. this.remove(debouncedSubscription);
  5112. debouncedSubscription.unsubscribe();
  5113. this.debouncedSubscription = null;
  5114. }
  5115. };
  5116. return DebounceTimeSubscriber;
  5117. }(Subscriber_1.Subscriber));
  5118. function dispatchNext(subscriber) {
  5119. subscriber.debouncedNext();
  5120. }
  5121. //# sourceMappingURL=debounceTime.js.map
  5122.  
  5123. /***/ }),
  5124. /* 68 */
  5125. /***/ (function(module, exports, __webpack_require__) {
  5126.  
  5127. "use strict";
  5128.  
  5129. var __extends = (this && this.__extends) || function (d, b) {
  5130. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  5131. function __() { this.constructor = d; }
  5132. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5133. };
  5134. var async_1 = __webpack_require__(4);
  5135. var isDate_1 = __webpack_require__(22);
  5136. var Subscriber_1 = __webpack_require__(1);
  5137. var Notification_1 = __webpack_require__(15);
  5138. /**
  5139. * Delays the emission of items from the source Observable by a given timeout or
  5140. * until a given Date.
  5141. *
  5142. * <span class="informal">Time shifts each item by some specified amount of
  5143. * milliseconds.</span>
  5144. *
  5145. * <img src="./img/delay.png" width="100%">
  5146. *
  5147. * If the delay argument is a Number, this operator time shifts the source
  5148. * Observable by that amount of time expressed in milliseconds. The relative
  5149. * time intervals between the values are preserved.
  5150. *
  5151. * If the delay argument is a Date, this operator time shifts the start of the
  5152. * Observable execution until the given date occurs.
  5153. *
  5154. * @example <caption>Delay each click by one second</caption>
  5155. * var clicks = Rx.Observable.fromEvent(document, 'click');
  5156. * var delayedClicks = clicks.delay(1000); // each click emitted after 1 second
  5157. * delayedClicks.subscribe(x => console.log(x));
  5158. *
  5159. * @example <caption>Delay all clicks until a future date happens</caption>
  5160. * var clicks = Rx.Observable.fromEvent(document, 'click');
  5161. * var date = new Date('March 15, 2050 12:00:00'); // in the future
  5162. * var delayedClicks = clicks.delay(date); // click emitted only after that date
  5163. * delayedClicks.subscribe(x => console.log(x));
  5164. *
  5165. * @see {@link debounceTime}
  5166. * @see {@link delayWhen}
  5167. *
  5168. * @param {number|Date} delay The delay duration in milliseconds (a `number`) or
  5169. * a `Date` until which the emission of the source items is delayed.
  5170. * @param {Scheduler} [scheduler=async] The IScheduler to use for
  5171. * managing the timers that handle the time-shift for each item.
  5172. * @return {Observable} An Observable that delays the emissions of the source
  5173. * Observable by the specified timeout or Date.
  5174. * @method delay
  5175. * @owner Observable
  5176. */
  5177. function delay(delay, scheduler) {
  5178. if (scheduler === void 0) { scheduler = async_1.async; }
  5179. var absoluteDelay = isDate_1.isDate(delay);
  5180. var delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay);
  5181. return this.lift(new DelayOperator(delayFor, scheduler));
  5182. }
  5183. exports.delay = delay;
  5184. var DelayOperator = (function () {
  5185. function DelayOperator(delay, scheduler) {
  5186. this.delay = delay;
  5187. this.scheduler = scheduler;
  5188. }
  5189. DelayOperator.prototype.call = function (subscriber, source) {
  5190. return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler));
  5191. };
  5192. return DelayOperator;
  5193. }());
  5194. /**
  5195. * We need this JSDoc comment for affecting ESDoc.
  5196. * @ignore
  5197. * @extends {Ignored}
  5198. */
  5199. var DelaySubscriber = (function (_super) {
  5200. __extends(DelaySubscriber, _super);
  5201. function DelaySubscriber(destination, delay, scheduler) {
  5202. _super.call(this, destination);
  5203. this.delay = delay;
  5204. this.scheduler = scheduler;
  5205. this.queue = [];
  5206. this.active = false;
  5207. this.errored = false;
  5208. }
  5209. DelaySubscriber.dispatch = function (state) {
  5210. var source = state.source;
  5211. var queue = source.queue;
  5212. var scheduler = state.scheduler;
  5213. var destination = state.destination;
  5214. while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) {
  5215. queue.shift().notification.observe(destination);
  5216. }
  5217. if (queue.length > 0) {
  5218. var delay_1 = Math.max(0, queue[0].time - scheduler.now());
  5219. this.schedule(state, delay_1);
  5220. }
  5221. else {
  5222. source.active = false;
  5223. }
  5224. };
  5225. DelaySubscriber.prototype._schedule = function (scheduler) {
  5226. this.active = true;
  5227. this.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, {
  5228. source: this, destination: this.destination, scheduler: scheduler
  5229. }));
  5230. };
  5231. DelaySubscriber.prototype.scheduleNotification = function (notification) {
  5232. if (this.errored === true) {
  5233. return;
  5234. }
  5235. var scheduler = this.scheduler;
  5236. var message = new DelayMessage(scheduler.now() + this.delay, notification);
  5237. this.queue.push(message);
  5238. if (this.active === false) {
  5239. this._schedule(scheduler);
  5240. }
  5241. };
  5242. DelaySubscriber.prototype._next = function (value) {
  5243. this.scheduleNotification(Notification_1.Notification.createNext(value));
  5244. };
  5245. DelaySubscriber.prototype._error = function (err) {
  5246. this.errored = true;
  5247. this.queue = [];
  5248. this.destination.error(err);
  5249. };
  5250. DelaySubscriber.prototype._complete = function () {
  5251. this.scheduleNotification(Notification_1.Notification.createComplete());
  5252. };
  5253. return DelaySubscriber;
  5254. }(Subscriber_1.Subscriber));
  5255. var DelayMessage = (function () {
  5256. function DelayMessage(time, notification) {
  5257. this.time = time;
  5258. this.notification = notification;
  5259. }
  5260. return DelayMessage;
  5261. }());
  5262. //# sourceMappingURL=delay.js.map
  5263.  
  5264. /***/ }),
  5265. /* 69 */
  5266. /***/ (function(module, exports, __webpack_require__) {
  5267.  
  5268. "use strict";
  5269.  
  5270. var __extends = (this && this.__extends) || function (d, b) {
  5271. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  5272. function __() { this.constructor = d; }
  5273. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5274. };
  5275. var Subscriber_1 = __webpack_require__(1);
  5276. /* tslint:enable:max-line-length */
  5277. /**
  5278. * Perform a side effect for every emission on the source Observable, but return
  5279. * an Observable that is identical to the source.
  5280. *
  5281. * <span class="informal">Intercepts each emission on the source and runs a
  5282. * function, but returns an output which is identical to the source.</span>
  5283. *
  5284. * <img src="./img/do.png" width="100%">
  5285. *
  5286. * Returns a mirrored Observable of the source Observable, but modified so that
  5287. * the provided Observer is called to perform a side effect for every value,
  5288. * error, and completion emitted by the source. Any errors that are thrown in
  5289. * the aforementioned Observer or handlers are safely sent down the error path
  5290. * of the output Observable.
  5291. *
  5292. * This operator is useful for debugging your Observables for the correct values
  5293. * or performing other side effects.
  5294. *
  5295. * Note: this is different to a `subscribe` on the Observable. If the Observable
  5296. * returned by `do` is not subscribed, the side effects specified by the
  5297. * Observer will never happen. `do` therefore simply spies on existing
  5298. * execution, it does not trigger an execution to happen like `subscribe` does.
  5299. *
  5300. * @example <caption>Map every every click to the clientX position of that click, while also logging the click event</caption>
  5301. * var clicks = Rx.Observable.fromEvent(document, 'click');
  5302. * var positions = clicks
  5303. * .do(ev => console.log(ev))
  5304. * .map(ev => ev.clientX);
  5305. * positions.subscribe(x => console.log(x));
  5306. *
  5307. * @see {@link map}
  5308. * @see {@link subscribe}
  5309. *
  5310. * @param {Observer|function} [nextOrObserver] A normal Observer object or a
  5311. * callback for `next`.
  5312. * @param {function} [error] Callback for errors in the source.
  5313. * @param {function} [complete] Callback for the completion of the source.
  5314. * @return {Observable} An Observable identical to the source, but runs the
  5315. * specified Observer or callback(s) for each item.
  5316. * @method do
  5317. * @name do
  5318. * @owner Observable
  5319. */
  5320. function _do(nextOrObserver, error, complete) {
  5321. return this.lift(new DoOperator(nextOrObserver, error, complete));
  5322. }
  5323. exports._do = _do;
  5324. var DoOperator = (function () {
  5325. function DoOperator(nextOrObserver, error, complete) {
  5326. this.nextOrObserver = nextOrObserver;
  5327. this.error = error;
  5328. this.complete = complete;
  5329. }
  5330. DoOperator.prototype.call = function (subscriber, source) {
  5331. return source.subscribe(new DoSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));
  5332. };
  5333. return DoOperator;
  5334. }());
  5335. /**
  5336. * We need this JSDoc comment for affecting ESDoc.
  5337. * @ignore
  5338. * @extends {Ignored}
  5339. */
  5340. var DoSubscriber = (function (_super) {
  5341. __extends(DoSubscriber, _super);
  5342. function DoSubscriber(destination, nextOrObserver, error, complete) {
  5343. _super.call(this, destination);
  5344. var safeSubscriber = new Subscriber_1.Subscriber(nextOrObserver, error, complete);
  5345. safeSubscriber.syncErrorThrowable = true;
  5346. this.add(safeSubscriber);
  5347. this.safeSubscriber = safeSubscriber;
  5348. }
  5349. DoSubscriber.prototype._next = function (value) {
  5350. var safeSubscriber = this.safeSubscriber;
  5351. safeSubscriber.next(value);
  5352. if (safeSubscriber.syncErrorThrown) {
  5353. this.destination.error(safeSubscriber.syncErrorValue);
  5354. }
  5355. else {
  5356. this.destination.next(value);
  5357. }
  5358. };
  5359. DoSubscriber.prototype._error = function (err) {
  5360. var safeSubscriber = this.safeSubscriber;
  5361. safeSubscriber.error(err);
  5362. if (safeSubscriber.syncErrorThrown) {
  5363. this.destination.error(safeSubscriber.syncErrorValue);
  5364. }
  5365. else {
  5366. this.destination.error(err);
  5367. }
  5368. };
  5369. DoSubscriber.prototype._complete = function () {
  5370. var safeSubscriber = this.safeSubscriber;
  5371. safeSubscriber.complete();
  5372. if (safeSubscriber.syncErrorThrown) {
  5373. this.destination.error(safeSubscriber.syncErrorValue);
  5374. }
  5375. else {
  5376. this.destination.complete();
  5377. }
  5378. };
  5379. return DoSubscriber;
  5380. }(Subscriber_1.Subscriber));
  5381. //# sourceMappingURL=do.js.map
  5382.  
  5383. /***/ }),
  5384. /* 70 */
  5385. /***/ (function(module, exports, __webpack_require__) {
  5386.  
  5387. "use strict";
  5388.  
  5389. var __extends = (this && this.__extends) || function (d, b) {
  5390. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  5391. function __() { this.constructor = d; }
  5392. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5393. };
  5394. var Subscriber_1 = __webpack_require__(1);
  5395. /* tslint:enable:max-line-length */
  5396. /**
  5397. * Filter items emitted by the source Observable by only emitting those that
  5398. * satisfy a specified predicate.
  5399. *
  5400. * <span class="informal">Like
  5401. * [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter),
  5402. * it only emits a value from the source if it passes a criterion function.</span>
  5403. *
  5404. * <img src="./img/filter.png" width="100%">
  5405. *
  5406. * Similar to the well-known `Array.prototype.filter` method, this operator
  5407. * takes values from the source Observable, passes them through a `predicate`
  5408. * function and only emits those values that yielded `true`.
  5409. *
  5410. * @example <caption>Emit only click events whose target was a DIV element</caption>
  5411. * var clicks = Rx.Observable.fromEvent(document, 'click');
  5412. * var clicksOnDivs = clicks.filter(ev => ev.target.tagName === 'DIV');
  5413. * clicksOnDivs.subscribe(x => console.log(x));
  5414. *
  5415. * @see {@link distinct}
  5416. * @see {@link distinctUntilChanged}
  5417. * @see {@link distinctUntilKeyChanged}
  5418. * @see {@link ignoreElements}
  5419. * @see {@link partition}
  5420. * @see {@link skip}
  5421. *
  5422. * @param {function(value: T, index: number): boolean} predicate A function that
  5423. * evaluates each value emitted by the source Observable. If it returns `true`,
  5424. * the value is emitted, if `false` the value is not passed to the output
  5425. * Observable. The `index` parameter is the number `i` for the i-th source
  5426. * emission that has happened since the subscription, starting from the number
  5427. * `0`.
  5428. * @param {any} [thisArg] An optional argument to determine the value of `this`
  5429. * in the `predicate` function.
  5430. * @return {Observable} An Observable of values from the source that were
  5431. * allowed by the `predicate` function.
  5432. * @method filter
  5433. * @owner Observable
  5434. */
  5435. function filter(predicate, thisArg) {
  5436. return this.lift(new FilterOperator(predicate, thisArg));
  5437. }
  5438. exports.filter = filter;
  5439. var FilterOperator = (function () {
  5440. function FilterOperator(predicate, thisArg) {
  5441. this.predicate = predicate;
  5442. this.thisArg = thisArg;
  5443. }
  5444. FilterOperator.prototype.call = function (subscriber, source) {
  5445. return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));
  5446. };
  5447. return FilterOperator;
  5448. }());
  5449. /**
  5450. * We need this JSDoc comment for affecting ESDoc.
  5451. * @ignore
  5452. * @extends {Ignored}
  5453. */
  5454. var FilterSubscriber = (function (_super) {
  5455. __extends(FilterSubscriber, _super);
  5456. function FilterSubscriber(destination, predicate, thisArg) {
  5457. _super.call(this, destination);
  5458. this.predicate = predicate;
  5459. this.thisArg = thisArg;
  5460. this.count = 0;
  5461. this.predicate = predicate;
  5462. }
  5463. // the try catch block below is left specifically for
  5464. // optimization and perf reasons. a tryCatcher is not necessary here.
  5465. FilterSubscriber.prototype._next = function (value) {
  5466. var result;
  5467. try {
  5468. result = this.predicate.call(this.thisArg, value, this.count++);
  5469. }
  5470. catch (err) {
  5471. this.destination.error(err);
  5472. return;
  5473. }
  5474. if (result) {
  5475. this.destination.next(value);
  5476. }
  5477. };
  5478. return FilterSubscriber;
  5479. }(Subscriber_1.Subscriber));
  5480. //# sourceMappingURL=filter.js.map
  5481.  
  5482. /***/ }),
  5483. /* 71 */
  5484. /***/ (function(module, exports, __webpack_require__) {
  5485.  
  5486. "use strict";
  5487.  
  5488. var __extends = (this && this.__extends) || function (d, b) {
  5489. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  5490. function __() { this.constructor = d; }
  5491. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5492. };
  5493. var Subscriber_1 = __webpack_require__(1);
  5494. /**
  5495. * Applies a given `project` function to each value emitted by the source
  5496. * Observable, and emits the resulting values as an Observable.
  5497. *
  5498. * <span class="informal">Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),
  5499. * it passes each source value through a transformation function to get
  5500. * corresponding output values.</span>
  5501. *
  5502. * <img src="./img/map.png" width="100%">
  5503. *
  5504. * Similar to the well known `Array.prototype.map` function, this operator
  5505. * applies a projection to each value and emits that projection in the output
  5506. * Observable.
  5507. *
  5508. * @example <caption>Map every every click to the clientX position of that click</caption>
  5509. * var clicks = Rx.Observable.fromEvent(document, 'click');
  5510. * var positions = clicks.map(ev => ev.clientX);
  5511. * positions.subscribe(x => console.log(x));
  5512. *
  5513. * @see {@link mapTo}
  5514. * @see {@link pluck}
  5515. *
  5516. * @param {function(value: T, index: number): R} project The function to apply
  5517. * to each `value` emitted by the source Observable. The `index` parameter is
  5518. * the number `i` for the i-th emission that has happened since the
  5519. * subscription, starting from the number `0`.
  5520. * @param {any} [thisArg] An optional argument to define what `this` is in the
  5521. * `project` function.
  5522. * @return {Observable<R>} An Observable that emits the values from the source
  5523. * Observable transformed by the given `project` function.
  5524. * @method map
  5525. * @owner Observable
  5526. */
  5527. function map(project, thisArg) {
  5528. if (typeof project !== 'function') {
  5529. throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');
  5530. }
  5531. return this.lift(new MapOperator(project, thisArg));
  5532. }
  5533. exports.map = map;
  5534. var MapOperator = (function () {
  5535. function MapOperator(project, thisArg) {
  5536. this.project = project;
  5537. this.thisArg = thisArg;
  5538. }
  5539. MapOperator.prototype.call = function (subscriber, source) {
  5540. return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));
  5541. };
  5542. return MapOperator;
  5543. }());
  5544. exports.MapOperator = MapOperator;
  5545. /**
  5546. * We need this JSDoc comment for affecting ESDoc.
  5547. * @ignore
  5548. * @extends {Ignored}
  5549. */
  5550. var MapSubscriber = (function (_super) {
  5551. __extends(MapSubscriber, _super);
  5552. function MapSubscriber(destination, project, thisArg) {
  5553. _super.call(this, destination);
  5554. this.project = project;
  5555. this.count = 0;
  5556. this.thisArg = thisArg || this;
  5557. }
  5558. // NOTE: This looks unoptimized, but it's actually purposefully NOT
  5559. // using try/catch optimizations.
  5560. MapSubscriber.prototype._next = function (value) {
  5561. var result;
  5562. try {
  5563. result = this.project.call(this.thisArg, value, this.count++);
  5564. }
  5565. catch (err) {
  5566. this.destination.error(err);
  5567. return;
  5568. }
  5569. this.destination.next(result);
  5570. };
  5571. return MapSubscriber;
  5572. }(Subscriber_1.Subscriber));
  5573. //# sourceMappingURL=map.js.map
  5574.  
  5575. /***/ }),
  5576. /* 72 */
  5577. /***/ (function(module, exports, __webpack_require__) {
  5578.  
  5579. "use strict";
  5580.  
  5581. var __extends = (this && this.__extends) || function (d, b) {
  5582. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  5583. function __() { this.constructor = d; }
  5584. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5585. };
  5586. var subscribeToResult_1 = __webpack_require__(25);
  5587. var OuterSubscriber_1 = __webpack_require__(17);
  5588. /* tslint:enable:max-line-length */
  5589. /**
  5590. * Projects each source value to an Observable which is merged in the output
  5591. * Observable.
  5592. *
  5593. * <span class="informal">Maps each value to an Observable, then flattens all of
  5594. * these inner Observables using {@link mergeAll}.</span>
  5595. *
  5596. * <img src="./img/mergeMap.png" width="100%">
  5597. *
  5598. * Returns an Observable that emits items based on applying a function that you
  5599. * supply to each item emitted by the source Observable, where that function
  5600. * returns an Observable, and then merging those resulting Observables and
  5601. * emitting the results of this merger.
  5602. *
  5603. * @example <caption>Map and flatten each letter to an Observable ticking every 1 second</caption>
  5604. * var letters = Rx.Observable.of('a', 'b', 'c');
  5605. * var result = letters.mergeMap(x =>
  5606. * Rx.Observable.interval(1000).map(i => x+i)
  5607. * );
  5608. * result.subscribe(x => console.log(x));
  5609. *
  5610. * // Results in the following:
  5611. * // a0
  5612. * // b0
  5613. * // c0
  5614. * // a1
  5615. * // b1
  5616. * // c1
  5617. * // continues to list a,b,c with respective ascending integers
  5618. *
  5619. * @see {@link concatMap}
  5620. * @see {@link exhaustMap}
  5621. * @see {@link merge}
  5622. * @see {@link mergeAll}
  5623. * @see {@link mergeMapTo}
  5624. * @see {@link mergeScan}
  5625. * @see {@link switchMap}
  5626. *
  5627. * @param {function(value: T, ?index: number): ObservableInput} project A function
  5628. * that, when applied to an item emitted by the source Observable, returns an
  5629. * Observable.
  5630. * @param {function(outerValue: T, innerValue: I, outerIndex: number, innerIndex: number): any} [resultSelector]
  5631. * A function to produce the value on the output Observable based on the values
  5632. * and the indices of the source (outer) emission and the inner Observable
  5633. * emission. The arguments passed to this function are:
  5634. * - `outerValue`: the value that came from the source
  5635. * - `innerValue`: the value that came from the projected Observable
  5636. * - `outerIndex`: the "index" of the value that came from the source
  5637. * - `innerIndex`: the "index" of the value from the projected Observable
  5638. * @param {number} [concurrent=Number.POSITIVE_INFINITY] Maximum number of input
  5639. * Observables being subscribed to concurrently.
  5640. * @return {Observable} An Observable that emits the result of applying the
  5641. * projection function (and the optional `resultSelector`) to each item emitted
  5642. * by the source Observable and merging the results of the Observables obtained
  5643. * from this transformation.
  5644. * @method mergeMap
  5645. * @owner Observable
  5646. */
  5647. function mergeMap(project, resultSelector, concurrent) {
  5648. if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
  5649. if (typeof resultSelector === 'number') {
  5650. concurrent = resultSelector;
  5651. resultSelector = null;
  5652. }
  5653. return this.lift(new MergeMapOperator(project, resultSelector, concurrent));
  5654. }
  5655. exports.mergeMap = mergeMap;
  5656. var MergeMapOperator = (function () {
  5657. function MergeMapOperator(project, resultSelector, concurrent) {
  5658. if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
  5659. this.project = project;
  5660. this.resultSelector = resultSelector;
  5661. this.concurrent = concurrent;
  5662. }
  5663. MergeMapOperator.prototype.call = function (observer, source) {
  5664. return source.subscribe(new MergeMapSubscriber(observer, this.project, this.resultSelector, this.concurrent));
  5665. };
  5666. return MergeMapOperator;
  5667. }());
  5668. exports.MergeMapOperator = MergeMapOperator;
  5669. /**
  5670. * We need this JSDoc comment for affecting ESDoc.
  5671. * @ignore
  5672. * @extends {Ignored}
  5673. */
  5674. var MergeMapSubscriber = (function (_super) {
  5675. __extends(MergeMapSubscriber, _super);
  5676. function MergeMapSubscriber(destination, project, resultSelector, concurrent) {
  5677. if (concurrent === void 0) { concurrent = Number.POSITIVE_INFINITY; }
  5678. _super.call(this, destination);
  5679. this.project = project;
  5680. this.resultSelector = resultSelector;
  5681. this.concurrent = concurrent;
  5682. this.hasCompleted = false;
  5683. this.buffer = [];
  5684. this.active = 0;
  5685. this.index = 0;
  5686. }
  5687. MergeMapSubscriber.prototype._next = function (value) {
  5688. if (this.active < this.concurrent) {
  5689. this._tryNext(value);
  5690. }
  5691. else {
  5692. this.buffer.push(value);
  5693. }
  5694. };
  5695. MergeMapSubscriber.prototype._tryNext = function (value) {
  5696. var result;
  5697. var index = this.index++;
  5698. try {
  5699. result = this.project(value, index);
  5700. }
  5701. catch (err) {
  5702. this.destination.error(err);
  5703. return;
  5704. }
  5705. this.active++;
  5706. this._innerSub(result, value, index);
  5707. };
  5708. MergeMapSubscriber.prototype._innerSub = function (ish, value, index) {
  5709. this.add(subscribeToResult_1.subscribeToResult(this, ish, value, index));
  5710. };
  5711. MergeMapSubscriber.prototype._complete = function () {
  5712. this.hasCompleted = true;
  5713. if (this.active === 0 && this.buffer.length === 0) {
  5714. this.destination.complete();
  5715. }
  5716. };
  5717. MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  5718. if (this.resultSelector) {
  5719. this._notifyResultSelector(outerValue, innerValue, outerIndex, innerIndex);
  5720. }
  5721. else {
  5722. this.destination.next(innerValue);
  5723. }
  5724. };
  5725. MergeMapSubscriber.prototype._notifyResultSelector = function (outerValue, innerValue, outerIndex, innerIndex) {
  5726. var result;
  5727. try {
  5728. result = this.resultSelector(outerValue, innerValue, outerIndex, innerIndex);
  5729. }
  5730. catch (err) {
  5731. this.destination.error(err);
  5732. return;
  5733. }
  5734. this.destination.next(result);
  5735. };
  5736. MergeMapSubscriber.prototype.notifyComplete = function (innerSub) {
  5737. var buffer = this.buffer;
  5738. this.remove(innerSub);
  5739. this.active--;
  5740. if (buffer.length > 0) {
  5741. this._next(buffer.shift());
  5742. }
  5743. else if (this.active === 0 && this.hasCompleted) {
  5744. this.destination.complete();
  5745. }
  5746. };
  5747. return MergeMapSubscriber;
  5748. }(OuterSubscriber_1.OuterSubscriber));
  5749. exports.MergeMapSubscriber = MergeMapSubscriber;
  5750. //# sourceMappingURL=mergeMap.js.map
  5751.  
  5752. /***/ }),
  5753. /* 73 */
  5754. /***/ (function(module, exports, __webpack_require__) {
  5755.  
  5756. "use strict";
  5757.  
  5758. var __extends = (this && this.__extends) || function (d, b) {
  5759. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  5760. function __() { this.constructor = d; }
  5761. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5762. };
  5763. var Subscriber_1 = __webpack_require__(1);
  5764. var Notification_1 = __webpack_require__(15);
  5765. /**
  5766. * @see {@link Notification}
  5767. *
  5768. * @param scheduler
  5769. * @param delay
  5770. * @return {Observable<R>|WebSocketSubject<T>|Observable<T>}
  5771. * @method observeOn
  5772. * @owner Observable
  5773. */
  5774. function observeOn(scheduler, delay) {
  5775. if (delay === void 0) { delay = 0; }
  5776. return this.lift(new ObserveOnOperator(scheduler, delay));
  5777. }
  5778. exports.observeOn = observeOn;
  5779. var ObserveOnOperator = (function () {
  5780. function ObserveOnOperator(scheduler, delay) {
  5781. if (delay === void 0) { delay = 0; }
  5782. this.scheduler = scheduler;
  5783. this.delay = delay;
  5784. }
  5785. ObserveOnOperator.prototype.call = function (subscriber, source) {
  5786. return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));
  5787. };
  5788. return ObserveOnOperator;
  5789. }());
  5790. exports.ObserveOnOperator = ObserveOnOperator;
  5791. /**
  5792. * We need this JSDoc comment for affecting ESDoc.
  5793. * @ignore
  5794. * @extends {Ignored}
  5795. */
  5796. var ObserveOnSubscriber = (function (_super) {
  5797. __extends(ObserveOnSubscriber, _super);
  5798. function ObserveOnSubscriber(destination, scheduler, delay) {
  5799. if (delay === void 0) { delay = 0; }
  5800. _super.call(this, destination);
  5801. this.scheduler = scheduler;
  5802. this.delay = delay;
  5803. }
  5804. ObserveOnSubscriber.dispatch = function (arg) {
  5805. var notification = arg.notification, destination = arg.destination;
  5806. notification.observe(destination);
  5807. this.unsubscribe();
  5808. };
  5809. ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {
  5810. this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));
  5811. };
  5812. ObserveOnSubscriber.prototype._next = function (value) {
  5813. this.scheduleMessage(Notification_1.Notification.createNext(value));
  5814. };
  5815. ObserveOnSubscriber.prototype._error = function (err) {
  5816. this.scheduleMessage(Notification_1.Notification.createError(err));
  5817. };
  5818. ObserveOnSubscriber.prototype._complete = function () {
  5819. this.scheduleMessage(Notification_1.Notification.createComplete());
  5820. };
  5821. return ObserveOnSubscriber;
  5822. }(Subscriber_1.Subscriber));
  5823. exports.ObserveOnSubscriber = ObserveOnSubscriber;
  5824. var ObserveOnMessage = (function () {
  5825. function ObserveOnMessage(notification, destination) {
  5826. this.notification = notification;
  5827. this.destination = destination;
  5828. }
  5829. return ObserveOnMessage;
  5830. }());
  5831. exports.ObserveOnMessage = ObserveOnMessage;
  5832. //# sourceMappingURL=observeOn.js.map
  5833.  
  5834. /***/ }),
  5835. /* 74 */
  5836. /***/ (function(module, exports, __webpack_require__) {
  5837.  
  5838. "use strict";
  5839.  
  5840. var __extends = (this && this.__extends) || function (d, b) {
  5841. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  5842. function __() { this.constructor = d; }
  5843. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5844. };
  5845. var Subscriber_1 = __webpack_require__(1);
  5846. /**
  5847. * Returns an Observable that mirrors the source Observable with the exception of an `error`. If the source Observable
  5848. * calls `error`, this method will resubscribe to the source Observable for a maximum of `count` resubscriptions (given
  5849. * as a number parameter) rather than propagating the `error` call.
  5850. *
  5851. * <img src="./img/retry.png" width="100%">
  5852. *
  5853. * Any and all items emitted by the source Observable will be emitted by the resulting Observable, even those emitted
  5854. * during failed subscriptions. For example, if an Observable fails at first but emits [1, 2] then succeeds the second
  5855. * time and emits: [1, 2, 3, 4, 5] then the complete stream of emissions and notifications
  5856. * would be: [1, 2, 1, 2, 3, 4, 5, `complete`].
  5857. * @param {number} count - Number of retry attempts before failing.
  5858. * @return {Observable} The source Observable modified with the retry logic.
  5859. * @method retry
  5860. * @owner Observable
  5861. */
  5862. function retry(count) {
  5863. if (count === void 0) { count = -1; }
  5864. return this.lift(new RetryOperator(count, this));
  5865. }
  5866. exports.retry = retry;
  5867. var RetryOperator = (function () {
  5868. function RetryOperator(count, source) {
  5869. this.count = count;
  5870. this.source = source;
  5871. }
  5872. RetryOperator.prototype.call = function (subscriber, source) {
  5873. return source.subscribe(new RetrySubscriber(subscriber, this.count, this.source));
  5874. };
  5875. return RetryOperator;
  5876. }());
  5877. /**
  5878. * We need this JSDoc comment for affecting ESDoc.
  5879. * @ignore
  5880. * @extends {Ignored}
  5881. */
  5882. var RetrySubscriber = (function (_super) {
  5883. __extends(RetrySubscriber, _super);
  5884. function RetrySubscriber(destination, count, source) {
  5885. _super.call(this, destination);
  5886. this.count = count;
  5887. this.source = source;
  5888. }
  5889. RetrySubscriber.prototype.error = function (err) {
  5890. if (!this.isStopped) {
  5891. var _a = this, source = _a.source, count = _a.count;
  5892. if (count === 0) {
  5893. return _super.prototype.error.call(this, err);
  5894. }
  5895. else if (count > -1) {
  5896. this.count = count - 1;
  5897. }
  5898. source.subscribe(this._unsubscribeAndRecycle());
  5899. }
  5900. };
  5901. return RetrySubscriber;
  5902. }(Subscriber_1.Subscriber));
  5903. //# sourceMappingURL=retry.js.map
  5904.  
  5905. /***/ }),
  5906. /* 75 */
  5907. /***/ (function(module, exports, __webpack_require__) {
  5908.  
  5909. "use strict";
  5910.  
  5911. var __extends = (this && this.__extends) || function (d, b) {
  5912. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  5913. function __() { this.constructor = d; }
  5914. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5915. };
  5916. var Subscriber_1 = __webpack_require__(1);
  5917. var async_1 = __webpack_require__(4);
  5918. /**
  5919. * Emits a value from the source Observable, then ignores subsequent source
  5920. * values for `duration` milliseconds, then repeats this process.
  5921. *
  5922. * <span class="informal">Lets a value pass, then ignores source values for the
  5923. * next `duration` milliseconds.</span>
  5924. *
  5925. * <img src="./img/throttleTime.png" width="100%">
  5926. *
  5927. * `throttleTime` emits the source Observable values on the output Observable
  5928. * when its internal timer is disabled, and ignores source values when the timer
  5929. * is enabled. Initially, the timer is disabled. As soon as the first source
  5930. * value arrives, it is forwarded to the output Observable, and then the timer
  5931. * is enabled. After `duration` milliseconds (or the time unit determined
  5932. * internally by the optional `scheduler`) has passed, the timer is disabled,
  5933. * and this process repeats for the next source value. Optionally takes a
  5934. * {@link IScheduler} for managing timers.
  5935. *
  5936. * @example <caption>Emit clicks at a rate of at most one click per second</caption>
  5937. * var clicks = Rx.Observable.fromEvent(document, 'click');
  5938. * var result = clicks.throttleTime(1000);
  5939. * result.subscribe(x => console.log(x));
  5940. *
  5941. * @see {@link auditTime}
  5942. * @see {@link debounceTime}
  5943. * @see {@link delay}
  5944. * @see {@link sampleTime}
  5945. * @see {@link throttle}
  5946. *
  5947. * @param {number} duration Time to wait before emitting another value after
  5948. * emitting the last value, measured in milliseconds or the time unit determined
  5949. * internally by the optional `scheduler`.
  5950. * @param {Scheduler} [scheduler=async] The {@link IScheduler} to use for
  5951. * managing the timers that handle the sampling.
  5952. * @return {Observable<T>} An Observable that performs the throttle operation to
  5953. * limit the rate of emissions from the source.
  5954. * @method throttleTime
  5955. * @owner Observable
  5956. */
  5957. function throttleTime(duration, scheduler) {
  5958. if (scheduler === void 0) { scheduler = async_1.async; }
  5959. return this.lift(new ThrottleTimeOperator(duration, scheduler));
  5960. }
  5961. exports.throttleTime = throttleTime;
  5962. var ThrottleTimeOperator = (function () {
  5963. function ThrottleTimeOperator(duration, scheduler) {
  5964. this.duration = duration;
  5965. this.scheduler = scheduler;
  5966. }
  5967. ThrottleTimeOperator.prototype.call = function (subscriber, source) {
  5968. return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler));
  5969. };
  5970. return ThrottleTimeOperator;
  5971. }());
  5972. /**
  5973. * We need this JSDoc comment for affecting ESDoc.
  5974. * @ignore
  5975. * @extends {Ignored}
  5976. */
  5977. var ThrottleTimeSubscriber = (function (_super) {
  5978. __extends(ThrottleTimeSubscriber, _super);
  5979. function ThrottleTimeSubscriber(destination, duration, scheduler) {
  5980. _super.call(this, destination);
  5981. this.duration = duration;
  5982. this.scheduler = scheduler;
  5983. }
  5984. ThrottleTimeSubscriber.prototype._next = function (value) {
  5985. if (!this.throttled) {
  5986. this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.duration, { subscriber: this }));
  5987. this.destination.next(value);
  5988. }
  5989. };
  5990. ThrottleTimeSubscriber.prototype.clearThrottle = function () {
  5991. var throttled = this.throttled;
  5992. if (throttled) {
  5993. throttled.unsubscribe();
  5994. this.remove(throttled);
  5995. this.throttled = null;
  5996. }
  5997. };
  5998. return ThrottleTimeSubscriber;
  5999. }(Subscriber_1.Subscriber));
  6000. function dispatchNext(arg) {
  6001. var subscriber = arg.subscriber;
  6002. subscriber.clearThrottle();
  6003. }
  6004. //# sourceMappingURL=throttleTime.js.map
  6005.  
  6006. /***/ }),
  6007. /* 76 */
  6008. /***/ (function(module, exports, __webpack_require__) {
  6009.  
  6010. "use strict";
  6011.  
  6012. var __extends = (this && this.__extends) || function (d, b) {
  6013. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  6014. function __() { this.constructor = d; }
  6015. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6016. };
  6017. var async_1 = __webpack_require__(4);
  6018. var isDate_1 = __webpack_require__(22);
  6019. var Subscriber_1 = __webpack_require__(1);
  6020. var TimeoutError_1 = __webpack_require__(80);
  6021. /**
  6022. * @param {number} due
  6023. * @param {Scheduler} [scheduler]
  6024. * @return {Observable<R>|WebSocketSubject<T>|Observable<T>}
  6025. * @method timeout
  6026. * @owner Observable
  6027. */
  6028. function timeout(due, scheduler) {
  6029. if (scheduler === void 0) { scheduler = async_1.async; }
  6030. var absoluteTimeout = isDate_1.isDate(due);
  6031. var waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due);
  6032. return this.lift(new TimeoutOperator(waitFor, absoluteTimeout, scheduler, new TimeoutError_1.TimeoutError()));
  6033. }
  6034. exports.timeout = timeout;
  6035. var TimeoutOperator = (function () {
  6036. function TimeoutOperator(waitFor, absoluteTimeout, scheduler, errorInstance) {
  6037. this.waitFor = waitFor;
  6038. this.absoluteTimeout = absoluteTimeout;
  6039. this.scheduler = scheduler;
  6040. this.errorInstance = errorInstance;
  6041. }
  6042. TimeoutOperator.prototype.call = function (subscriber, source) {
  6043. return source.subscribe(new TimeoutSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.scheduler, this.errorInstance));
  6044. };
  6045. return TimeoutOperator;
  6046. }());
  6047. /**
  6048. * We need this JSDoc comment for affecting ESDoc.
  6049. * @ignore
  6050. * @extends {Ignored}
  6051. */
  6052. var TimeoutSubscriber = (function (_super) {
  6053. __extends(TimeoutSubscriber, _super);
  6054. function TimeoutSubscriber(destination, absoluteTimeout, waitFor, scheduler, errorInstance) {
  6055. _super.call(this, destination);
  6056. this.absoluteTimeout = absoluteTimeout;
  6057. this.waitFor = waitFor;
  6058. this.scheduler = scheduler;
  6059. this.errorInstance = errorInstance;
  6060. this.index = 0;
  6061. this._previousIndex = 0;
  6062. this._hasCompleted = false;
  6063. this.scheduleTimeout();
  6064. }
  6065. Object.defineProperty(TimeoutSubscriber.prototype, "previousIndex", {
  6066. get: function () {
  6067. return this._previousIndex;
  6068. },
  6069. enumerable: true,
  6070. configurable: true
  6071. });
  6072. Object.defineProperty(TimeoutSubscriber.prototype, "hasCompleted", {
  6073. get: function () {
  6074. return this._hasCompleted;
  6075. },
  6076. enumerable: true,
  6077. configurable: true
  6078. });
  6079. TimeoutSubscriber.dispatchTimeout = function (state) {
  6080. var source = state.subscriber;
  6081. var currentIndex = state.index;
  6082. if (!source.hasCompleted && source.previousIndex === currentIndex) {
  6083. source.notifyTimeout();
  6084. }
  6085. };
  6086. TimeoutSubscriber.prototype.scheduleTimeout = function () {
  6087. var currentIndex = this.index;
  6088. this.scheduler.schedule(TimeoutSubscriber.dispatchTimeout, this.waitFor, { subscriber: this, index: currentIndex });
  6089. this.index++;
  6090. this._previousIndex = currentIndex;
  6091. };
  6092. TimeoutSubscriber.prototype._next = function (value) {
  6093. this.destination.next(value);
  6094. if (!this.absoluteTimeout) {
  6095. this.scheduleTimeout();
  6096. }
  6097. };
  6098. TimeoutSubscriber.prototype._error = function (err) {
  6099. this.destination.error(err);
  6100. this._hasCompleted = true;
  6101. };
  6102. TimeoutSubscriber.prototype._complete = function () {
  6103. this.destination.complete();
  6104. this._hasCompleted = true;
  6105. };
  6106. TimeoutSubscriber.prototype.notifyTimeout = function () {
  6107. this.error(this.errorInstance);
  6108. };
  6109. return TimeoutSubscriber;
  6110. }(Subscriber_1.Subscriber));
  6111. //# sourceMappingURL=timeout.js.map
  6112.  
  6113. /***/ }),
  6114. /* 77 */
  6115. /***/ (function(module, exports, __webpack_require__) {
  6116.  
  6117. "use strict";
  6118.  
  6119. var __extends = (this && this.__extends) || function (d, b) {
  6120. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  6121. function __() { this.constructor = d; }
  6122. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6123. };
  6124. var Subscription_1 = __webpack_require__(5);
  6125. /**
  6126. * A unit of work to be executed in a {@link Scheduler}. An action is typically
  6127. * created from within a Scheduler and an RxJS user does not need to concern
  6128. * themselves about creating and manipulating an Action.
  6129. *
  6130. * ```ts
  6131. * class Action<T> extends Subscription {
  6132. * new (scheduler: Scheduler, work: (state?: T) => void);
  6133. * schedule(state?: T, delay: number = 0): Subscription;
  6134. * }
  6135. * ```
  6136. *
  6137. * @class Action<T>
  6138. */
  6139. var Action = (function (_super) {
  6140. __extends(Action, _super);
  6141. function Action(scheduler, work) {
  6142. _super.call(this);
  6143. }
  6144. /**
  6145. * Schedules this action on its parent Scheduler for execution. May be passed
  6146. * some context object, `state`. May happen at some point in the future,
  6147. * according to the `delay` parameter, if specified.
  6148. * @param {T} [state] Some contextual data that the `work` function uses when
  6149. * called by the Scheduler.
  6150. * @param {number} [delay] Time to wait before executing the work, where the
  6151. * time unit is implicit and defined by the Scheduler.
  6152. * @return {void}
  6153. */
  6154. Action.prototype.schedule = function (state, delay) {
  6155. if (delay === void 0) { delay = 0; }
  6156. return this;
  6157. };
  6158. return Action;
  6159. }(Subscription_1.Subscription));
  6160. exports.Action = Action;
  6161. //# sourceMappingURL=Action.js.map
  6162.  
  6163. /***/ }),
  6164. /* 78 */
  6165. /***/ (function(module, exports, __webpack_require__) {
  6166.  
  6167. "use strict";
  6168.  
  6169. var __extends = (this && this.__extends) || function (d, b) {
  6170. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  6171. function __() { this.constructor = d; }
  6172. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6173. };
  6174. var root_1 = __webpack_require__(2);
  6175. var Action_1 = __webpack_require__(77);
  6176. /**
  6177. * We need this JSDoc comment for affecting ESDoc.
  6178. * @ignore
  6179. * @extends {Ignored}
  6180. */
  6181. var AsyncAction = (function (_super) {
  6182. __extends(AsyncAction, _super);
  6183. function AsyncAction(scheduler, work) {
  6184. _super.call(this, scheduler, work);
  6185. this.scheduler = scheduler;
  6186. this.work = work;
  6187. this.pending = false;
  6188. }
  6189. AsyncAction.prototype.schedule = function (state, delay) {
  6190. if (delay === void 0) { delay = 0; }
  6191. if (this.closed) {
  6192. return this;
  6193. }
  6194. // Always replace the current state with the new state.
  6195. this.state = state;
  6196. // Set the pending flag indicating that this action has been scheduled, or
  6197. // has recursively rescheduled itself.
  6198. this.pending = true;
  6199. var id = this.id;
  6200. var scheduler = this.scheduler;
  6201. //
  6202. // Important implementation note:
  6203. //
  6204. // Actions only execute once by default, unless rescheduled from within the
  6205. // scheduled callback. This allows us to implement single and repeat
  6206. // actions via the same code path, without adding API surface area, as well
  6207. // as mimic traditional recursion but across asynchronous boundaries.
  6208. //
  6209. // However, JS runtimes and timers distinguish between intervals achieved by
  6210. // serial `setTimeout` calls vs. a single `setInterval` call. An interval of
  6211. // serial `setTimeout` calls can be individually delayed, which delays
  6212. // scheduling the next `setTimeout`, and so on. `setInterval` attempts to
  6213. // guarantee the interval callback will be invoked more precisely to the
  6214. // interval period, regardless of load.
  6215. //
  6216. // Therefore, we use `setInterval` to schedule single and repeat actions.
  6217. // If the action reschedules itself with the same delay, the interval is not
  6218. // canceled. If the action doesn't reschedule, or reschedules with a
  6219. // different delay, the interval will be canceled after scheduled callback
  6220. // execution.
  6221. //
  6222. if (id != null) {
  6223. this.id = this.recycleAsyncId(scheduler, id, delay);
  6224. }
  6225. this.delay = delay;
  6226. // If this action has already an async Id, don't request a new one.
  6227. this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);
  6228. return this;
  6229. };
  6230. AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) {
  6231. if (delay === void 0) { delay = 0; }
  6232. return root_1.root.setInterval(scheduler.flush.bind(scheduler, this), delay);
  6233. };
  6234. AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
  6235. if (delay === void 0) { delay = 0; }
  6236. // If this action is rescheduled with the same delay time, don't clear the interval id.
  6237. if (delay !== null && this.delay === delay) {
  6238. return id;
  6239. }
  6240. // Otherwise, if the action's delay time is different from the current delay,
  6241. // clear the interval id
  6242. return root_1.root.clearInterval(id) && undefined || undefined;
  6243. };
  6244. /**
  6245. * Immediately executes this action and the `work` it contains.
  6246. * @return {any}
  6247. */
  6248. AsyncAction.prototype.execute = function (state, delay) {
  6249. if (this.closed) {
  6250. return new Error('executing a cancelled action');
  6251. }
  6252. this.pending = false;
  6253. var error = this._execute(state, delay);
  6254. if (error) {
  6255. return error;
  6256. }
  6257. else if (this.pending === false && this.id != null) {
  6258. // Dequeue if the action didn't reschedule itself. Don't call
  6259. // unsubscribe(), because the action could reschedule later.
  6260. // For example:
  6261. // ```
  6262. // scheduler.schedule(function doWork(counter) {
  6263. // /* ... I'm a busy worker bee ... */
  6264. // var originalAction = this;
  6265. // /* wait 100ms before rescheduling the action */
  6266. // setTimeout(function () {
  6267. // originalAction.schedule(counter + 1);
  6268. // }, 100);
  6269. // }, 1000);
  6270. // ```
  6271. this.id = this.recycleAsyncId(this.scheduler, this.id, null);
  6272. }
  6273. };
  6274. AsyncAction.prototype._execute = function (state, delay) {
  6275. var errored = false;
  6276. var errorValue = undefined;
  6277. try {
  6278. this.work(state);
  6279. }
  6280. catch (e) {
  6281. errored = true;
  6282. errorValue = !!e && e || new Error(e);
  6283. }
  6284. if (errored) {
  6285. this.unsubscribe();
  6286. return errorValue;
  6287. }
  6288. };
  6289. AsyncAction.prototype._unsubscribe = function () {
  6290. var id = this.id;
  6291. var scheduler = this.scheduler;
  6292. var actions = scheduler.actions;
  6293. var index = actions.indexOf(this);
  6294. this.work = null;
  6295. this.delay = null;
  6296. this.state = null;
  6297. this.pending = false;
  6298. this.scheduler = null;
  6299. if (index !== -1) {
  6300. actions.splice(index, 1);
  6301. }
  6302. if (id != null) {
  6303. this.id = this.recycleAsyncId(scheduler, id, null);
  6304. }
  6305. };
  6306. return AsyncAction;
  6307. }(Action_1.Action));
  6308. exports.AsyncAction = AsyncAction;
  6309. //# sourceMappingURL=AsyncAction.js.map
  6310.  
  6311. /***/ }),
  6312. /* 79 */
  6313. /***/ (function(module, exports, __webpack_require__) {
  6314.  
  6315. "use strict";
  6316.  
  6317. var __extends = (this && this.__extends) || function (d, b) {
  6318. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  6319. function __() { this.constructor = d; }
  6320. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6321. };
  6322. var Scheduler_1 = __webpack_require__(56);
  6323. var AsyncScheduler = (function (_super) {
  6324. __extends(AsyncScheduler, _super);
  6325. function AsyncScheduler() {
  6326. _super.apply(this, arguments);
  6327. this.actions = [];
  6328. /**
  6329. * A flag to indicate whether the Scheduler is currently executing a batch of
  6330. * queued actions.
  6331. * @type {boolean}
  6332. */
  6333. this.active = false;
  6334. /**
  6335. * An internal ID used to track the latest asynchronous task such as those
  6336. * coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and
  6337. * others.
  6338. * @type {any}
  6339. */
  6340. this.scheduled = undefined;
  6341. }
  6342. AsyncScheduler.prototype.flush = function (action) {
  6343. var actions = this.actions;
  6344. if (this.active) {
  6345. actions.push(action);
  6346. return;
  6347. }
  6348. var error;
  6349. this.active = true;
  6350. do {
  6351. if (error = action.execute(action.state, action.delay)) {
  6352. break;
  6353. }
  6354. } while (action = actions.shift()); // exhaust the scheduler queue
  6355. this.active = false;
  6356. if (error) {
  6357. while (action = actions.shift()) {
  6358. action.unsubscribe();
  6359. }
  6360. throw error;
  6361. }
  6362. };
  6363. return AsyncScheduler;
  6364. }(Scheduler_1.Scheduler));
  6365. exports.AsyncScheduler = AsyncScheduler;
  6366. //# sourceMappingURL=AsyncScheduler.js.map
  6367.  
  6368. /***/ }),
  6369. /* 80 */
  6370. /***/ (function(module, exports, __webpack_require__) {
  6371.  
  6372. "use strict";
  6373.  
  6374. var __extends = (this && this.__extends) || function (d, b) {
  6375. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  6376. function __() { this.constructor = d; }
  6377. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6378. };
  6379. /**
  6380. * An error thrown when duetime elapses.
  6381. *
  6382. * @see {@link timeout}
  6383. *
  6384. * @class TimeoutError
  6385. */
  6386. var TimeoutError = (function (_super) {
  6387. __extends(TimeoutError, _super);
  6388. function TimeoutError() {
  6389. var err = _super.call(this, 'Timeout has occurred');
  6390. this.name = err.name = 'TimeoutError';
  6391. this.stack = err.stack;
  6392. this.message = err.message;
  6393. }
  6394. return TimeoutError;
  6395. }(Error));
  6396. exports.TimeoutError = TimeoutError;
  6397. //# sourceMappingURL=TimeoutError.js.map
  6398.  
  6399. /***/ }),
  6400. /* 81 */
  6401. /***/ (function(module, exports, __webpack_require__) {
  6402.  
  6403. "use strict";
  6404.  
  6405. var __extends = (this && this.__extends) || function (d, b) {
  6406. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  6407. function __() { this.constructor = d; }
  6408. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  6409. };
  6410. /**
  6411. * An error thrown when one or more errors have occurred during the
  6412. * `unsubscribe` of a {@link Subscription}.
  6413. */
  6414. var UnsubscriptionError = (function (_super) {
  6415. __extends(UnsubscriptionError, _super);
  6416. function UnsubscriptionError(errors) {
  6417. _super.call(this);
  6418. this.errors = errors;
  6419. var err = Error.call(this, errors ?
  6420. errors.length + " errors occurred during unsubscription:\n " + errors.map(function (err, i) { return ((i + 1) + ") " + err.toString()); }).join('\n ') : '');
  6421. this.name = err.name = 'UnsubscriptionError';
  6422. this.stack = err.stack;
  6423. this.message = err.message;
  6424. }
  6425. return UnsubscriptionError;
  6426. }(Error));
  6427. exports.UnsubscriptionError = UnsubscriptionError;
  6428. //# sourceMappingURL=UnsubscriptionError.js.map
  6429.  
  6430. /***/ }),
  6431. /* 82 */
  6432. /***/ (function(module, exports, __webpack_require__) {
  6433.  
  6434. "use strict";
  6435.  
  6436. function isScheduler(value) {
  6437. return value && typeof value.schedule === 'function';
  6438. }
  6439. exports.isScheduler = isScheduler;
  6440. //# sourceMappingURL=isScheduler.js.map
  6441.  
  6442. /***/ }),
  6443. /* 83 */
  6444. /***/ (function(module, exports, __webpack_require__) {
  6445.  
  6446. "use strict";
  6447.  
  6448. var Subscriber_1 = __webpack_require__(1);
  6449. var rxSubscriber_1 = __webpack_require__(20);
  6450. var Observer_1 = __webpack_require__(16);
  6451. function toSubscriber(nextOrObserver, error, complete) {
  6452. if (nextOrObserver) {
  6453. if (nextOrObserver instanceof Subscriber_1.Subscriber) {
  6454. return nextOrObserver;
  6455. }
  6456. if (nextOrObserver[rxSubscriber_1.$$rxSubscriber]) {
  6457. return nextOrObserver[rxSubscriber_1.$$rxSubscriber]();
  6458. }
  6459. }
  6460. if (!nextOrObserver && !error && !complete) {
  6461. return new Subscriber_1.Subscriber(Observer_1.empty);
  6462. }
  6463. return new Subscriber_1.Subscriber(nextOrObserver, error, complete);
  6464. }
  6465. exports.toSubscriber = toSubscriber;
  6466. //# sourceMappingURL=toSubscriber.js.map
  6467.  
  6468. /***/ }),
  6469. /* 84 */
  6470. /***/ (function(module, exports) {
  6471.  
  6472. var g;
  6473.  
  6474. // This works in non-strict mode
  6475. g = (function() {
  6476. return this;
  6477. })();
  6478.  
  6479. try {
  6480. // This works if eval is allowed (see CSP)
  6481. g = g || Function("return this")() || (1,eval)("this");
  6482. } catch(e) {
  6483. // This works if the window reference is available
  6484. if(typeof window === "object")
  6485. g = window;
  6486. }
  6487.  
  6488. // g can still be undefined, but nothing to do about it...
  6489. // We return undefined, instead of nothing here, so it's
  6490. // easier to handle this case. if(!global) { ...}
  6491.  
  6492. module.exports = g;
  6493.  
  6494.  
  6495. /***/ }),
  6496. /* 85 */
  6497. /***/ (function(module, exports, __webpack_require__) {
  6498.  
  6499. "use strict";
  6500.  
  6501. Object.defineProperty(exports, "__esModule", { value: true });
  6502. __webpack_require__(32);
  6503. __webpack_require__(34);
  6504. __webpack_require__(33);
  6505. __webpack_require__(31);
  6506. __webpack_require__(39);
  6507. __webpack_require__(38);
  6508. __webpack_require__(37);
  6509. __webpack_require__(40);
  6510. __webpack_require__(41);
  6511. __webpack_require__(43);
  6512. __webpack_require__(36);
  6513. __webpack_require__(42);
  6514. __webpack_require__(35);
  6515. var baidu_1 = __webpack_require__(45);
  6516. var tieba_1 = __webpack_require__(49);
  6517. var baidu_video_1 = __webpack_require__(44);
  6518. var google_1 = __webpack_require__(46);
  6519. var weibo_1 = __webpack_require__(51);
  6520. var twitter_1 = __webpack_require__(50);
  6521. var so_1 = __webpack_require__(47);
  6522. var zhihu_1 = __webpack_require__(54);
  6523. var zhihu_daily_1 = __webpack_require__(52);
  6524. var zhihu_zhuanlan_1 = __webpack_require__(53);
  6525. var sogou_1 = __webpack_require__(48);
  6526. baidu_1.default.bootstrap();
  6527. tieba_1.default.bootstrap();
  6528. baidu_video_1.default.bootstrap();
  6529. google_1.default.bootstrap();
  6530. weibo_1.default.bootstrap();
  6531. twitter_1.default.bootstrap();
  6532. so_1.default.bootstrap();
  6533. zhihu_1.default.bootstrap();
  6534. zhihu_daily_1.default.bootstrap();
  6535. zhihu_zhuanlan_1.default.bootstrap();
  6536. sogou_1.default.bootstrap();
  6537.  
  6538.  
  6539. /***/ })
  6540. /******/ ]);