1/******/ (function(modules) { // webpackBootstrap 2/******/ // The module cache 3/******/ var installedModules = {}; 4 5/******/ // The require function 6/******/ function __webpack_require__(moduleId) { 7 8/******/ // Check if module is in cache 9/******/ if(installedModules[moduleId]) 10/******/ return installedModules[moduleId].exports; 11 12/******/ // Create a new module (and put it into the cache) 13/******/ var module = installedModules[moduleId] = { 14/******/ exports: {}, 15/******/ id: moduleId, 16/******/ loaded: false 17/******/ }; 18 19/******/ // Execute the module function 20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21 22/******/ // Flag the module as loaded 23/******/ module.loaded = true; 24 25/******/ // Return the exports of the module 26/******/ return module.exports; 27/******/ } 28 29 30/******/ // expose the modules object (__webpack_modules__) 31/******/ __webpack_require__.m = modules; 32 33/******/ // expose the module cache 34/******/ __webpack_require__.c = installedModules; 35 36/******/ // __webpack_public_path__ 37/******/ __webpack_require__.p = ""; 38 39/******/ // Load entry module and return exports 40/******/ return __webpack_require__(0); 41/******/ }) 42/************************************************************************/ 43/******/ ([ 44/* 0 */ 45/***/ function(module, exports, __webpack_require__) { 46 47 /* WEBPACK VAR INJECTION */(function(global) {"use strict"; 48 __webpack_require__(1); 49 var event_target_1 = __webpack_require__(2); 50 var define_property_1 = __webpack_require__(4); 51 var register_element_1 = __webpack_require__(5); 52 var property_descriptor_1 = __webpack_require__(6); 53 var timers_1 = __webpack_require__(8); 54 var utils_1 = __webpack_require__(3); 55 var set = 'set'; 56 var clear = 'clear'; 57 var blockingMethods = ['alert', 'prompt', 'confirm']; 58 var _global = typeof window == 'undefined' ? global : window; 59 timers_1.patchTimer(_global, set, clear, 'Timeout'); 60 timers_1.patchTimer(_global, set, clear, 'Interval'); 61 timers_1.patchTimer(_global, set, clear, 'Immediate'); 62 timers_1.patchTimer(_global, 'request', 'cancel', 'AnimationFrame'); 63 timers_1.patchTimer(_global, 'mozRequest', 'mozCancel', 'AnimationFrame'); 64 timers_1.patchTimer(_global, 'webkitRequest', 'webkitCancel', 'AnimationFrame'); 65 for (var i = 0; i < blockingMethods.length; i++) { 66 var name = blockingMethods[i]; 67 utils_1.patchMethod(_global, name, function (delegate, symbol, name) { 68 return function (s, args) { 69 return Zone.current.run(delegate, _global, args, name); 70 }; 71 }); 72 } 73 event_target_1.eventTargetPatch(_global); 74 property_descriptor_1.propertyDescriptorPatch(_global); 75 utils_1.patchClass('MutationObserver'); 76 utils_1.patchClass('WebKitMutationObserver'); 77 utils_1.patchClass('FileReader'); 78 define_property_1.propertyPatch(); 79 register_element_1.registerElementPatch(_global); 80 // Treat XMLHTTPRequest as a macrotask. 81 patchXHR(_global); 82 var XHR_TASK = utils_1.zoneSymbol('xhrTask'); 83 function patchXHR(window) { 84 function findPendingTask(target) { 85 var pendingTask = target[XHR_TASK]; 86 return pendingTask; 87 } 88 function scheduleTask(task) { 89 var data = task.data; 90 data.target.addEventListener('readystatechange', function () { 91 if (data.target.readyState === data.target.DONE) { 92 if (!data.aborted) { 93 task.invoke(); 94 } 95 } 96 }); 97 var storedTask = data.target[XHR_TASK]; 98 if (!storedTask) { 99 data.target[XHR_TASK] = task; 100 }
101 setNative.apply(data.target, data.args); 102 return task; 103 } 104 function placeholderCallback() { 105 } 106 function clearTask(task) { 107 var data = task.data; 108 // Note - ideally, we would call data.target.removeEventListener here, but it's too late 109 // to prevent it from firing. So instead, we store info for the event listener. 110 data.aborted = true; 111 return clearNative.apply(data.target, data.args); 112 } 113 var setNative = utils_1.patchMethod(window.XMLHttpRequest.prototype, 'send', function () { return function (self, args) { 114 var zone = Zone.current; 115 var options = { 116 target: self, 117 isPeriodic: false, 118 delay: null, 119 args: args, 120 aborted: false 121 }; 122 return zone.scheduleMacroTask('XMLHttpRequest.send', placeholderCallback, options, scheduleTask, clearTask); 123 }; }); 124 var clearNative = utils_1.patchMethod(window.XMLHttpRequest.prototype, 'abort', function (delegate) { return function (self, args) { 125 var task = findPendingTask(self); 126 if (task && typeof task.type == 'string') { 127 // If the XHR has already completed, do nothing. 128 if (task.cancelFn == null) { 129 return; 130 } 131 task.zone.cancelTask(task); 132 } 133 // Otherwise, we are trying to abort an XHR which has not yet been sent, so there is no task to cancel. Do nothing. 134 }; }); 135 } 136 /// GEO_LOCATION 137 if (_global['navigator'] && _global['navigator'].geolocation) { 138 utils_1.patchPrototype(_global['navigator'].geolocation, [ 139 'getCurrentPosition', 140 'watchPosition' 141 ]); 142 } 143 144 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 145 146/***/ }, 147/* 1 */ 148/***/ function(module, exports) { 149 150 /* WEBPACK VAR INJECTION */(function(global) {; 151 ; 152 var Zone = (function (global) { 153 if (global.Zone) { 154 throw new Error('Zone already loaded.'); 155 } 156 var Zone = (function () { 157 function Zone(parent, zoneSpec) { 158 this._properties = null; 159 this._parent = parent; 160 this._name = zoneSpec ? zoneSpec.name || 'unnamed' : '<root>'; 161 this._properties = zoneSpec && zoneSpec.properties || {}; 162 this._zoneDelegate = new ZoneDelegate(this, this._parent && this._parent._zoneDelegate, zoneSpec); 163 } 164 Object.defineProperty(Zone, "current", { 165 get: function () { return _currentZone; }, 166 enumerable: true, 167 configurable: true 168 }); 169 ; 170 Object.defineProperty(Zone, "currentTask", { 171 get: function () { return _currentTask; }, 172 enumerable: true, 173 configurable: true 174 }); 175 ; 176 Object.defineProperty(Zone.prototype, "parent", { 177 get: function () { return this._parent; }, 178 enumerable: true, 179 configurable: true 180 }); 181 ; 182 Object.defineProperty(Zone.prototype, "name", { 183 get: function () { return this._name; }, 184 enumerable: true, 185 configurable: true 186 }); 187 ; 188 Zone.prototype.get = function (key) { 189 var zone = this.getZoneWith(key); 190 if (zone) 191 return zone._properties[key]; 192 }; 193 Zone.prototype.getZoneWith = function (key) { 194 var current = this; 195 while (current) { 196 if (current._properties.hasOwnProperty(key)) { 197 return current; 198 } 199 current = current._parent; 200 } 201 return null; 202 }; 203 Zone.prototype.fork = function (zoneSpec) { 204 if (!zoneSpec) 205 throw new Error('ZoneSpec required!'); 206 return this._zoneDelegate.fork(this, zoneSpec); 207 }; 208 Zone.prototype.wrap = function (callback, source) { 209 if (typeof callback !== 'function') { 210 throw new Error('Expecting function got: ' + callback); 211 } 212 var _callback = this._zoneDelegate.intercept(this, callback, source); 213 var zone = this; 214 return function () { 215 return zone.runGuarded(_callback, this, arguments, source); 216 }; 217 }; 218 Zone.prototype.run = function (callback, applyThis, applyArgs, source) {
219 if (applyThis === void 0) { applyThis = null; } 220 if (applyArgs === void 0) { applyArgs = null; } 221 if (source === void 0) { source = null; } 222 var oldZone = _currentZone; 223 _currentZone = this; 224 try { 225 return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source); 226 } 227 finally { 228 _currentZone = oldZone; 229 } 230 }; 231 Zone.prototype.runGuarded = function (callback, applyThis, applyArgs, source) { 232 if (applyThis === void 0) { applyThis = null; } 233 if (applyArgs === void 0) { applyArgs = null; } 234 if (source === void 0) { source = null; } 235 var oldZone = _currentZone; 236 _currentZone = this; 237 try { 238 try { 239 return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source); 240 } 241 catch (error) { 242 if (this._zoneDelegate.handleError(this, error)) { 243 throw error; 244 } 245 } 246 } 247 finally { 248 _currentZone = oldZone; 249 } 250 }; 251 Zone.prototype.runTask = function (task, applyThis, applyArgs) { 252 task.runCount++; 253 if (task.zone != this) 254 throw new Error('A task can only be run in the zone which created it! (Creation: ' + 255 task.zone.name + '; Execution: ' + this.name + ')'); 256 var previousTask = _currentTask; 257 _currentTask = task; 258 var oldZone = _currentZone; 259 _currentZone = this; 260 try { 261 if (task.type == 'macroTask' && task.data && !task.data.isPeriodic) { 262 task.cancelFn = null; 263 } 264 try { 265 return this._zoneDelegate.invokeTask(this, task, applyThis, applyArgs); 266 } 267 catch (error) { 268 if (this._zoneDelegate.handleError(this, error)) { 269 throw error; 270 } 271 } 272 } 273 finally { 274 _currentZone = oldZone; 275 _currentTask = previousTask; 276 } 277 }; 278 Zone.prototype.scheduleMicroTask = function (source, callback, data, customSchedule) { 279 return this._zoneDelegate.scheduleTask(this, new ZoneTask('microTask', this, source, callback, data, customSchedule, null)); 280 }; 281 Zone.prototype.scheduleMacroTask = function (source, callback, data, customSchedule, customCancel) { 282 return this._zoneDelegate.scheduleTask(this, new ZoneTask('macroTask', this, source, callback, data, customSchedule, customCancel)); 283 }; 284 Zone.prototype.scheduleEventTask = function (source, callback, data, customSchedule, customCancel) { 285 return this._zoneDelegate.scheduleTask(this, new ZoneTask('eventTask', this, source, callback, data, customSchedule, customCancel)); 286 }; 287 Zone.prototype.cancelTask = function (task) { 288 var value = this._zoneDelegate.cancelTask(this, task); 289 task.runCount = -1; 290 task.cancelFn = null; 291 return value; 292 }; 293 Zone.__symbol__ = __symbol__; 294 return Zone; 295 }()); 296 ; 297 var ZoneDelegate = (function () { 298 function ZoneDelegate(zone, parentDelegate, zoneSpec) { 299 this._taskCounts = { microTask: 0, macroTask: 0, eventTask: 0 }; 300 this.zone = zone; 301 this._parentDelegate = parentDelegate; 302 this._forkZS = zoneSpec && (zoneSpec && zoneSpec.onFork ? zoneSpec : parentDelegate._forkZS); 303 this._forkDlgt = zoneSpec && (zoneSpec.onFork ? parentDelegate : parentDelegate._forkDlgt); 304 this._interceptZS = zoneSpec && (zoneSpec.onIntercept ? zoneSpec : parentDelegate._interceptZS); 305 this._interceptDlgt = zoneSpec && (zoneSpec.onIntercept ? parentDelegate : parentDelegate._interceptDlgt); 306 this._invokeZS = zoneSpec && (zoneSpec.onInvoke ? zoneSpec : parentDelegate._invokeZS); 307 this._invokeDlgt = zoneSpec && (zoneSpec.onInvoke ? parentDelegate : parentDelegate._invokeDlgt); 308 this._handleErrorZS = zoneSpec && (zoneSpec.onHandleError ? zoneSpec : parentDelegate._handleErrorZS); 309 this._handleErrorDlgt = zoneSpec && (zoneSpec.onHandleError ? parentDelegate : parentDelegate._handleErrorDlgt); 310 this._scheduleTaskZS = zoneSpec && (zoneSpec.onScheduleTask ? zoneSpec : parentDelegate._scheduleTaskZS); 311 this._scheduleTaskDlgt = zoneSpec && (zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt); 312 this._invokeTaskZS = zoneSpec && (zoneSpec.onInvokeTask ? zoneSpec : parentDelegate._invokeTaskZS); 313 this._invokeTaskDlgt = zoneSpec && (zoneSpec.onInvokeTask ? parentDelegate : parentDelegate._invokeTaskDlgt); 314 this._cancelTaskZS = zoneSpec && (zoneSpec.onCancelTask ? zoneSpec : parentDelegate._cancelTaskZS); 315 this._cancelTaskDlgt = zoneSpec && (zoneSpec.onCancelTask ? parentDelegate : parentDelegate._cancelTaskDlgt); 316 this._hasTaskZS = zoneSpec && (zoneSpec.onHasTask ? zoneSpec : parentDelegate._hasTaskZS); 317 this._hasTaskDlgt = zoneSpec && (zoneSpec.onHasTask ? parentDelegate : parentDelegate._hasTaskDlgt); 318 } 319 ZoneDelegate.prototype.fork = function (targetZone, zoneSpec) { 320 return this._forkZS 321 ? this._forkZS.onFork(this._forkDlgt, this.zone, targetZone, zoneSpec) 322 : new Zone(targetZone, zoneSpec); 323 }; 324 ZoneDelegate.prototype.intercept = function (targetZone, callback, source) { 325 return this._interceptZS 326 ? this._interceptZS.onIntercept(this._interceptDlgt, this.zone, targetZone, callback, source) 327 : callback; 328 }; 329 ZoneDelegate.prototype.invoke = function (targetZone, callback, applyThis, applyArgs, source) { 330 return this._invokeZS 331 ? this._invokeZS.onInvoke(this._invokeDlgt, this.zone, targetZone, callback, applyThis, applyArgs, source) 332 : callback.apply(applyThis, applyArgs); 333 }; 334 ZoneDelegate.prototype.handleError = function (targetZone, error) { 335 return this._handleErrorZS 336 ? this._handleErrorZS.onHandleError(this._handleErrorDlgt, this.zone, targetZone, error) 337 : true; 338 }; 339 ZoneDelegate.prototype.scheduleTask = function (targetZone, task) { 340 try { 341 if (this._scheduleTaskZS) { 342 return this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt, this.zone, targetZone, task); 343 } 344 else if (task.scheduleFn) { 345 task.scheduleFn(task); 346 } 347 else if (task.type == 'microTask') { 348 scheduleMicroTask(task); 349 } 350 else { 351 throw new Error('Task is missing scheduleFn.'); 352 } 353 return task; 354 } 355 finally { 356 if (targetZone == this.zone) { 357 this._updateTaskCount(task.type, 1); 358 } 359 } 360 }; 361 ZoneDelegate.prototype.invokeTask = function (targetZone, task, applyThis, applyArgs) { 362 try { 363 return this._invokeTaskZS 364 ? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this.zone, targetZone, task, applyThis, applyArgs) 365 : task.callback.apply(applyThis, applyArgs); 366 } 367 finally { 368 if (targetZone == this.zone && (task.type != 'eventTask') && !(task.data && task.data.isPeriodic)) { 369 this._updateTaskCount(task.type, -1); 370 } 371 } 372 }; 373 ZoneDelegate.prototype.cancelTask = function (targetZone, task) { 374 var value; 375 if (this._cancelTaskZS) { 376 value = this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt, this.zone, targetZone, task); 377 } 378 else if (!task.cancelFn) { 379 throw new Error('Task does not support cancellation, or is already canceled.'); 380 } 381 else { 382 value = task.cancelFn(task); 383 } 384 if (targetZone == this.zone) { 385 // this should not be in the finally block, because exceptions assume not canceled. 386 this._updateTaskCount(task.type, -1); 387 } 388 return value; 389 }; 390 ZoneDelegate.prototype.hasTask = function (targetZone, isEmpty) { 391 return this._hasTaskZS && this._hasTaskZS.onHasTask(this._hasTaskDlgt, this.zone, targetZone, isEmpty); 392 }; 393 ZoneDelegate.prototype._updateTaskCount = function (type, count) { 394 var counts = this._taskCounts; 395 var prev = counts[type]; 396 var next = counts[type] = prev + count; 397 if (next < 0) { 398 throw new Error('More tasks executed then were scheduled.'); 399 } 400 if (prev == 0 || next == 0) { 401 var isEmpty = { 402 microTask: counts.microTask > 0, 403 macroTask: counts.macroTask > 0, 404 eventTask: counts.eventTask > 0, 405 change: type 406 }; 407 try { 408 this.hasTask(this.zone, isEmpty); 409 } 410 finally { 411 if (this._parentDelegate) { 412 this._parentDelegate._updateTaskCount(type, count); 413 } 414 } 415 } 416 }; 417 return ZoneDelegate; 418 }()); 419 var ZoneTask = (function () { 420 function ZoneTask(type, zone, source, callback, options, scheduleFn, cancelFn) { 421 this.runCount = 0; 422 this.type = type; 423 this.zone = zone; 424 this.source = source; 425 this.data = options; 426 this.scheduleFn = scheduleFn; 427 this.cancelFn = cancelFn; 428 this.callback = callback; 429 var self = this; 430 this.invoke = function () { 431 _numberOfNestedTaskFrames++; 432 try { 433 return zone.runTask(self, this, arguments); 434 } 435 finally { 436 if (_numberOfNestedTaskFrames == 1) { 437 drainMicroTaskQueue(); 438 } 439 _numberOfNestedTaskFrames--; 440 } 441 }; 442 } 443 ZoneTask.prototype.toString = function () { 444 if (this.data && typeof this.data.handleId !== 'undefined') { 445 return this.data.handleId; 446 } 447 else { 448 return this.toString(); 449 } 450 }; 451 return ZoneTask; 452 }()); 453 function __symbol__(name) { return '__zone_symbol__' + name; } 454 ; 455 var symbolSetTimeout = __symbol__('setTimeout'); 456 var symbolPromise = __symbol__('Promise'); 457 var symbolThen = __symbol__('then'); 458 var _currentZone = new Zone(null, null); 459 var _currentTask = null; 460 var _microTaskQueue = []; 461 var _isDrainingMicrotaskQueue = false;
462 var _uncaughtPromiseErrors = []; 463 var _numberOfNestedTaskFrames = 0; 464 function scheduleQueueDrain() { 465 // if we are not running in any task, and there has not been anything scheduled 466 // we must bootstrap the initial task creation by manually scheduling the drain 467 if (_numberOfNestedTaskFrames == 0 && _microTaskQueue.length == 0) { 468 // We are not running in Task, so we need to kickstart the microtask queue. 469 if (global[symbolPromise]) { 470 global[symbolPromise].resolve(0)[symbolThen](drainMicroTaskQueue); 471 } 472 else { 473 global[symbolSetTimeout](drainMicroTaskQueue, 0); 474 } 475 } 476 } 477 function scheduleMicroTask(task) { 478 scheduleQueueDrain(); 479 _microTaskQueue.push(task); 480 } 481 function consoleError(e) { 482 var rejection = e && e.rejection; 483 if (rejection) { 484 console.error('Unhandled Promise rejection:', rejection instanceof Error ? rejection.message : rejection, '; Zone:', e.zone.name, '; Task:', e.task && e.task.source, '; Value:', rejection, rejection instanceof Error ? rejection.stack : undefined); 485 } 486 console.error(e); 487 } 488 function drainMicroTaskQueue() { 489 if (!_isDrainingMicrotaskQueue) { 490 _isDrainingMicrotaskQueue = true; 491 while (_microTaskQueue.length) { 492 var queue = _microTaskQueue; 493 _microTaskQueue = []; 494 for (var i = 0; i < queue.length; i++) { 495 var task = queue[i]; 496 try { 497 task.zone.runTask(task, null, null); 498 } 499 catch (e) { 500 consoleError(e); 501 } 502 } 503 } 504 while (_uncaughtPromiseErrors.length) { 505 var _loop_1 = function() { 506 var uncaughtPromiseError = _uncaughtPromiseErrors.shift(); 507 try { 508 uncaughtPromiseError.zone.runGuarded(function () { throw uncaughtPromiseError; }); 509 } 510 catch (e) { 511 consoleError(e); 512 } 513 }; 514 while (_uncaughtPromiseErrors.length) { 515 _loop_1(); 516 } 517 } 518 _isDrainingMicrotaskQueue = false; 519 } 520 } 521 function isThenable(value) { 522 return value && value.then; 523 } 524 function forwardResolution(value) { return value; } 525 function forwardRejection(rejection) { return ZoneAwarePromise.reject(rejection); } 526 var symbolState = __symbol__('state'); 527 var symbolValue = __symbol__('value'); 528 var source = 'Promise.then'; 529 var UNRESOLVED = null; 530 var RESOLVED = true; 531 var REJECTED = false; 532 var REJECTED_NO_CATCH = 0; 533 function makeResolver(promise, state) { 534 return function (v) { 535 resolvePromise(promise, state, v); 536 // Do not return value or you will break the Promise spec. 537 }; 538 } 539 function resolvePromise(promise, state, value) { 540 if (promise[symbolState] === UNRESOLVED) { 541 if (value instanceof ZoneAwarePromise && value[symbolState] !== UNRESOLVED) { 542 clearRejectedNoCatch(value); 543 resolvePromise(promise, value[symbolState], value[symbolValue]); 544 } 545 else if (isThenable(value)) { 546 value.then(makeResolver(promise, state), makeResolver(promise, false)); 547 } 548 else { 549 promise[symbolState] = state; 550 var queue = promise[symbolValue]; 551 promise[symbolValue] = value; 552 for (var i = 0; i < queue.length;) { 553 scheduleResolveOrReject(promise, queue[i++], queue[i++], queue[i++], queue[i++]); 554 } 555 if (queue.length == 0 && state == REJECTED) { 556 promise[symbolState] = REJECTED_NO_CATCH; 557 try { 558 throw new Error("Uncaught (in promise): " + value); 559 } 560 catch (e) { 561 var error = e; 562 error.rejection = value; 563 error.promise = promise; 564 error.zone = Zone.current; 565 error.task = Zone.currentTask; 566 _uncaughtPromiseErrors.push(error); 567 scheduleQueueDrain(); 568 } 569 } 570 } 571 } 572 // Resolving an already resolved promise is a noop. 573 return promise; 574 } 575 function clearRejectedNoCatch(promise) { 576 if (promise[symbolState] === REJECTED_NO_CATCH) { 577 promise[symbolState] = REJECTED; 578 for (var i = 0; i < _uncaughtPromiseErrors.length; i++) { 579 if (promise === _uncaughtPromiseErrors[i].promise) { 580 _uncaughtPromiseErrors.splice(i, 1); 581 break; 582 } 583 } 584 } 585 }
586 function scheduleResolveOrReject(promise, zone, chainPromise, onFulfilled, onRejected) { 587 clearRejectedNoCatch(promise); 588 var delegate = promise[symbolState] ? onFulfilled || forwardResolution : onRejected || forwardRejection; 589 zone.scheduleMicroTask(source, function () { 590 try { 591 resolvePromise(chainPromise, true, zone.run(delegate, null, [promise[symbolValue]])); 592 } 593 catch (error) { 594 resolvePromise(chainPromise, false, error); 595 } 596 }); 597 } 598 var ZoneAwarePromise = (function () { 599 function ZoneAwarePromise(executor) { 600 var promise = this; 601 if (!(promise instanceof ZoneAwarePromise)) { 602 throw new Error('Must be an instanceof Promise.'); 603 } 604 promise[symbolState] = UNRESOLVED; 605 promise[symbolValue] = []; // queue; 606 try { 607 executor && executor(makeResolver(promise, RESOLVED), makeResolver(promise, REJECTED)); 608 } 609 catch (e) { 610 resolvePromise(promise, false, e); 611 } 612 } 613 ZoneAwarePromise.resolve = function (value) { 614 return resolvePromise(new this(null), RESOLVED, value); 615 }; 616 ZoneAwarePromise.reject = function (error) { 617 return resolvePromise(new this(null), REJECTED, error); 618 }; 619 ZoneAwarePromise.race = function (values) { 620 var resolve; 621 var reject; 622 var promise = new this(function (res, rej) { resolve = res; reject = rej; }); 623 function onResolve(value) { promise && (promise = null || resolve(value)); } 624 function onReject(error) { promise && (promise = null || reject(error)); } 625 for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { 626 var value = values_1[_i]; 627 if (!isThenable(value)) { 628 value = this.resolve(value); 629 } 630 value.then(onResolve, onReject); 631 } 632 return promise; 633 }; 634 ZoneAwarePromise.all = function (values) { 635 var resolve; 636 var reject; 637 var promise = new this(function (res, rej) { resolve = res; reject = rej; }); 638 var count = 0; 639 var resolvedValues = []; 640 function onReject(error) { promise && reject(error); promise = null; } 641 for (var _i = 0, values_2 = values; _i < values_2.length; _i++) { 642 var value = values_2[_i]; 643 if (!isThenable(value)) { 644 value = this.resolve(value); 645 } 646 value.then((function (index) { return function (value) { 647 resolvedValues[index] = value; 648 count--; 649 if (promise && !count) { 650 resolve(resolvedValues); 651 } 652 promise == null; 653 }; })(count), onReject); 654 count++; 655 } 656 if (!count) 657 resolve(resolvedValues); 658 return promise; 659 }; 660 ZoneAwarePromise.prototype.then = function (onFulfilled, onRejected) { 661 var chainPromise = new this.constructor(null); 662 var zone = Zone.current; 663 if (this[symbolState] == UNRESOLVED) { 664 this[symbolValue].push(zone, chainPromise, onFulfilled, onRejected); 665 } 666 else { 667 scheduleResolveOrReject(this, zone, chainPromise, onFulfilled, onRejected); 668 }
669 return chainPromise; 670 }; 671 ZoneAwarePromise.prototype.catch = function (onRejected) { 672 return this.then(null, onRejected); 673 }; 674 return ZoneAwarePromise; 675 }()); 676 var NativePromise = global[__symbol__('Promise')] = global.Promise; 677 global.Promise = ZoneAwarePromise; 678 if (NativePromise) { 679 var NativePromiseProtototype = NativePromise.prototype; 680 var NativePromiseThen_1 = NativePromiseProtototype[__symbol__('then')] 681 = NativePromiseProtototype.then; 682 NativePromiseProtototype.then = function (onResolve, onReject) { 683 var nativePromise = this; 684 return new ZoneAwarePromise(function (resolve, reject) { 685 NativePromiseThen_1.call(nativePromise, resolve, reject); 686 }).then(onResolve, onReject); 687 }; 688 } 689 // This is not part of public API, but it is usefull for tests, so we expose it. 690 Promise[Zone.__symbol__('uncaughtPromiseErrors')] = _uncaughtPromiseErrors; 691 return global.Zone = Zone; 692 })(typeof window === 'undefined' ? global : window); 693 694 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 695 696/***/ }, 697/* 2 */ 698/***/ function(module, exports, __webpack_require__) { 699 700 "use strict"; 701 var utils_1 = __webpack_require__(3); 702 var WTF_ISSUE_555 = 'Anchor,Area,Audio,BR,Base,BaseFont,Body,Button,Canvas,Content,DList,Directory,Div,Embed,FieldSet,Font,Form,Frame,FrameSet,HR,Head,Heading,Html,IFrame,Image,Input,Keygen,LI,Label,Legend,Link,Map,Marquee,Media,Menu,Meta,Meter,Mod,OList,Object,OptGroup,Option,Output,Paragraph,Pre,Progress,Quote,Script,Select,Source,Span,Style,TableCaption,TableCell,TableCol,Table,TableRow,TableSection,TextArea,Title,Track,UList,Unknown,Video'; 703 var NO_EVENT_TARGET = 'ApplicationCache,EventSource,FileReader,InputMethodContext,MediaController,MessagePort,Node,Performance,SVGElementInstance,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebKitNamedFlow,Window,Worker,WorkerGlobalScope,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload,IDBRequest,IDBOpenDBRequest,IDBDatabase,IDBTransaction,IDBCursor,DBIndex'.split(','); 704 var EVENT_TARGET = 'EventTarget'; 705 function eventTargetPatch(_global) { 706 var apis = []; 707 var isWtf = _global['wtf']; 708 if (isWtf) { 709 // Workaround for: https://github.com/google/tracing-framework/issues/555 710 apis = WTF_ISSUE_555.split(',').map(function (v) { return 'HTML' + v + 'Element'; }).concat(NO_EVENT_TARGET); 711 } 712 else if (_global[EVENT_TARGET]) { 713 apis.push(EVENT_TARGET); 714 } 715 else { 716 // Note: EventTarget is not available in all browsers, 717 // if it's not available, we instead patch the APIs in the IDL that inherit from EventTarget 718 apis = NO_EVENT_TARGET; 719 } 720 for (var i = 0; i < apis.length; i++) { 721 var type = _global[apis[i]]; 722 utils_1.patchEventTargetMethods(type && type.prototype); 723 } 724 } 725 exports.eventTargetPatch = eventTargetPatch; 726 727 728/***/ }, 729/* 3 */ 730/***/ function(module, exports) { 731 732 /* WEBPACK VAR INJECTION */(function(global) {/** 733 * Suppress closure compiler errors about unknown 'process' variable 734 * @fileoverview 735 * @suppress {undefinedVars} 736 */ 737 "use strict";
738 exports.zoneSymbol = Zone['__symbol__']; 739 var _global = typeof window == 'undefined' ? global : window; 740 function bindArguments(args, source) { 741 for (var i = args.length - 1; i >= 0; i--) { 742 if (typeof args[i] === 'function') { 743 args[i] = Zone.current.wrap(args[i], source + '_' + i); 744 } 745 } 746 return args; 747 } 748 exports.bindArguments = bindArguments; 749 ; 750 function patchPrototype(prototype, fnNames) { 751 var source = prototype.constructor['name']; 752 var _loop_1 = function(i) { 753 var name_1 = fnNames[i]; 754 var delegate = prototype[name_1]; 755 if (delegate) { 756 prototype[name_1] = (function (delegate) { 757 return function () { 758 return delegate.apply(this, bindArguments(arguments, source + '.' + name_1)); 759 }; 760 })(delegate); 761 } 762 }; 763 for (var i = 0; i < fnNames.length; i++) { 764 _loop_1(i); 765 } 766 } 767 exports.patchPrototype = patchPrototype; 768 ; 769 exports.isWebWorker = (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope); 770 exports.isNode = (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'); 771 exports.isBrowser = !exports.isNode && !exports.isWebWorker && !!(typeof window !== 'undefined' && window['HTMLElement']); 772 function patchProperty(obj, prop) { 773 var desc = Object.getOwnPropertyDescriptor(obj, prop) || { 774 enumerable: true, 775 configurable: true 776 }; 777 // A property descriptor cannot have getter/setter and be writable 778 // deleting the writable and value properties avoids this error: 779 // 780 // TypeError: property descriptors must not specify a value or be writable when a 781 // getter or setter has been specified 782 delete desc.writable; 783 delete desc.value; 784 // substr(2) cuz 'onclick' -> 'click', etc 785 var eventName = prop.substr(2); 786 var _prop = '_' + prop; 787 desc.set = function (fn) { 788 if (this[_prop]) { 789 this.removeEventListener(eventName, this[_prop]); 790 } 791 if (typeof fn === 'function') { 792 var wrapFn = function (event) { 793 var result; 794 result = fn.apply(this, arguments); 795 if (result != undefined && !result) 796 event.preventDefault(); 797 }; 798 this[_prop] = wrapFn; 799 this.addEventListener(eventName, wrapFn, false); 800 } 801 else { 802 this[_prop] = null; 803 } 804 }; 805 // The getter would return undefined for unassigned properties but the default value of an unassigned property is null 806 desc.get = function () { 807 return this[_prop] || null; 808 }; 809 Object.defineProperty(obj, prop, desc); 810 } 811 exports.patchProperty = patchProperty; 812 ; 813 function patchOnProperties(obj, properties) { 814 var onProperties = []; 815 for (var prop in obj) { 816 if (prop.substr(0, 2) == 'on') { 817 onProperties.push(prop); 818 } 819 } 820 for (var j = 0; j < onProperties.length; j++) { 821 patchProperty(obj, onProperties[j]); 822 } 823 if (properties) { 824 for (var i = 0; i < properties.length; i++) { 825 patchProperty(obj, 'on' + properties[i]); 826 } 827 } 828 } 829 exports.patchOnProperties = patchOnProperties; 830 ; 831 var EVENT_TASKS = exports.zoneSymbol('eventTasks'); 832 var ADD_EVENT_LISTENER = 'addEventListener'; 833 var REMOVE_EVENT_LISTENER = 'removeEventListener'; 834 var SYMBOL_ADD_EVENT_LISTENER = exports.zoneSymbol(ADD_EVENT_LISTENER);
835 var SYMBOL_REMOVE_EVENT_LISTENER = exports.zoneSymbol(REMOVE_EVENT_LISTENER); 836 function findExistingRegisteredTask(target, handler, name, capture, remove) { 837 var eventTasks = target[EVENT_TASKS]; 838 if (eventTasks) { 839 for (var i = 0; i < eventTasks.length; i++) { 840 var eventTask = eventTasks[i]; 841 var data = eventTask.data; 842 if (data.handler === handler 843 && data.useCapturing === capture 844 && data.eventName === name) { 845 if (remove) { 846 eventTasks.splice(i, 1); 847 } 848 return eventTask; 849 } 850 } 851 } 852 return null; 853 } 854 function attachRegisteredEvent(target, eventTask) { 855 var eventTasks = target[EVENT_TASKS]; 856 if (!eventTasks) { 857 eventTasks = target[EVENT_TASKS] = []; 858 } 859 eventTasks.push(eventTask); 860 } 861 function scheduleEventListener(eventTask) { 862 var meta = eventTask.data; 863 attachRegisteredEvent(meta.target, eventTask); 864 return meta.target[SYMBOL_ADD_EVENT_LISTENER](meta.eventName, eventTask.invoke, meta.useCapturing); 865 } 866 function cancelEventListener(eventTask) { 867 var meta = eventTask.data; 868 findExistingRegisteredTask(meta.target, eventTask.invoke, meta.eventName, meta.useCapturing, true);
869 meta.target[SYMBOL_REMOVE_EVENT_LISTENER](meta.eventName, eventTask.invoke, meta.useCapturing); 870 } 871 function zoneAwareAddEventListener(self, args) { 872 var eventName = args[0]; 873 var handler = args[1]; 874 var useCapturing = args[2] || false; 875 // - Inside a Web Worker, `this` is undefined, the context is `global` 876 // - When `addEventListener` is called on the global context in strict mode, `this` is undefined 877 // see https://github.com/angular/zone.js/issues/190 878 var target = self || _global; 879 var delegate = null; 880 if (typeof handler == 'function') { 881 delegate = handler; 882 } 883 else if (handler && handler.handleEvent) { 884 delegate = function (event) { return handler.handleEvent(event); }; 885 } 886 var validZoneHandler = false; 887 try { 888 // In cross site contexts (such as WebDriver frameworks like Selenium), 889 // accessing the handler object here will cause an exception to be thrown which 890 // will fail tests prematurely. 891 validZoneHandler = handler && handler.toString() === "[object FunctionWrapper]"; 892 } 893 catch (e) { 894 // Returning nothing here is fine, because objects in a cross-site context are unusable 895 return; 896 } 897 // Ignore special listeners of IE11 & Edge dev tools, see https://github.com/angular/zone.js/issues/150 898 if (!delegate || validZoneHandler) { 899 return target[SYMBOL_ADD_EVENT_LISTENER](eventName, handler, useCapturing); 900 } 901 var eventTask = findExistingRegisteredTask(target, handler, eventName, useCapturing, false); 902 if (eventTask) { 903 // we already registered, so this will have noop. 904 return target[SYMBOL_ADD_EVENT_LISTENER](eventName, eventTask.invoke, useCapturing); 905 } 906 var zone = Zone.current; 907 var source = target.constructor['name'] + '.addEventListener:' + eventName; 908 var data = { 909 target: target, 910 eventName: eventName, 911 name: eventName, 912 useCapturing: useCapturing, 913 handler: handler 914 }; 915 zone.scheduleEventTask(source, delegate, data, scheduleEventListener, cancelEventListener); 916 } 917 function zoneAwareRemoveEventListener(self, args) { 918 var eventName = args[0]; 919 var handler = args[1]; 920 var useCapturing = args[2] || false; 921 // - Inside a Web Worker, `this` is undefined, the context is `global` 922 // - When `addEventListener` is called on the global context in strict mode, `this` is undefined 923 // see https://github.com/angular/zone.js/issues/190 924 var target = self || _global; 925 var eventTask = findExistingRegisteredTask(target, handler, eventName, useCapturing, true); 926 if (eventTask) { 927 eventTask.zone.cancelTask(eventTask); 928 } 929 else {
930 target[SYMBOL_REMOVE_EVENT_LISTENER](eventName, handler, useCapturing); 931 } 932 } 933 function patchEventTargetMethods(obj) { 934 if (obj && obj.addEventListener) { 935 patchMethod(obj, ADD_EVENT_LISTENER, function () { return zoneAwareAddEventListener; }); 936 patchMethod(obj, REMOVE_EVENT_LISTENER, function () { return zoneAwareRemoveEventListener; }); 937 return true; 938 } 939 else { 940 return false; 941 } 942 } 943 exports.patchEventTargetMethods = patchEventTargetMethods; 944 ; 945 var originalInstanceKey = exports.zoneSymbol('originalInstance'); 946 // wrap some native API on `window` 947 function patchClass(className) { 948 var OriginalClass = _global[className]; 949 if (!OriginalClass) 950 return; 951 _global[className] = function () { 952 var a = bindArguments(arguments, className); 953 switch (a.length) { 954 case 0: 955 this[originalInstanceKey] = new OriginalClass(); 956 break; 957 case 1: 958 this[originalInstanceKey] = new OriginalClass(a[0]); 959 break; 960 case 2: 961 this[originalInstanceKey] = new OriginalClass(a[0], a[1]); 962 break; 963 case 3: 964 this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]); 965 break; 966 case 4: 967 this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]); 968 break; 969 default: throw new Error('Arg list too long.'); 970 } 971 }; 972 var instance = new OriginalClass(function () { }); 973 var prop; 974 for (prop in instance) { 975 // https://bugs.webkit.org/show_bug.cgi?id=44721 976 if (className === 'XMLHttpRequest' && prop === 'responseBlob') 977 continue; 978 (function (prop) { 979 if (typeof instance[prop] === 'function') { 980 _global[className].prototype[prop] = function () { 981 return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments); 982 }; 983 } 984 else { 985 Object.defineProperty(_global[className].prototype, prop, { 986 set: function (fn) { 987 if (typeof fn === 'function') { 988 this[originalInstanceKey][prop] = Zone.current.wrap(fn, className + '.' + prop); 989 } 990 else { 991 this[originalInstanceKey][prop] = fn; 992 } 993 }, 994 get: function () { 995 return this[originalInstanceKey][prop]; 996 } 997 }); 998 } 999 }(prop)); 1000 } 1001 for (prop in OriginalClass) { 1002 if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) { 1003 _global[className][prop] = OriginalClass[prop]; 1004 } 1005 } 1006 } 1007 exports.patchClass = patchClass; 1008 ; 1009 function createNamedFn(name, delegate) { 1010 try { 1011 return (Function('f', "return function " + name + "(){return f(this, arguments)}"))(delegate); 1012 } 1013 catch (e) { 1014 // if we fail, we must be CSP, just return delegate. 1015 return function () { 1016 return delegate(this, arguments); 1017 }; 1018 } 1019 } 1020 exports.createNamedFn = createNamedFn; 1021 function patchMethod(target, name, patchFn) { 1022 var proto = target; 1023 while (proto && !proto.hasOwnProperty(name)) { 1024 proto = Object.getPrototypeOf(proto); 1025 } 1026 if (!proto && target[name]) { 1027 // somehow we did not find it, but we can see it. This happens on IE for Window properties. 1028 proto = target; 1029 } 1030 var delegateName = exports.zoneSymbol(name); 1031 var delegate; 1032 if (proto && !(delegate = proto[delegateName])) { 1033 delegate = proto[delegateName] = proto[name]; 1034 proto[name] = createNamedFn(name, patchFn(delegate, delegateName, name)); 1035 } 1036 return delegate; 1037 } 1038 exports.patchMethod = patchMethod; 1039 1040 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 1041 1042/***/ }, 1043/* 4 */ 1044/***/ function(module, exports, __webpack_require__) { 1045 1046 "use strict"; 1047 var utils_1 = __webpack_require__(3); 1048 /* 1049 * This is necessary for Chrome and Chrome mobile, to enable 1050 * things like redefining `createdCallback` on an element. 1051 */ 1052 var _defineProperty = Object.defineProperty; 1053 var _getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; 1054 var _create = Object.create; 1055 var unconfigurablesKey = utils_1.zoneSymbol('unconfigurables'); 1056 function propertyPatch() { 1057 Object.defineProperty = function (obj, prop, desc) { 1058 if (isUnconfigurable(obj, prop)) { 1059 throw new TypeError('Cannot assign to read only property \'' + prop + '\' of ' + obj); 1060 } 1061 var originalConfigurableFlag = desc.configurable; 1062 if (prop !== 'prototype') { 1063 desc = rewriteDescriptor(obj, prop, desc); 1064 } 1065 return _tryDefineProperty(obj, prop, desc, originalConfigurableFlag); 1066 }; 1067 Object.defineProperties = function (obj, props) {
1068 Object.keys(props).forEach(function (prop) { 1069 Object.defineProperty(obj, prop, props[prop]); 1070 }); 1071 return obj; 1072 }; 1073 Object.create = function (obj, proto) { 1074 if (typeof proto === 'object' && !Object.isFrozen(proto)) { 1075 Object.keys(proto).forEach(function (prop) { 1076 proto[prop] = rewriteDescriptor(obj, prop, proto[prop]); 1077 }); 1078 } 1079 return _create(obj, proto); 1080 }; 1081 Object.getOwnPropertyDescriptor = function (obj, prop) { 1082 var desc = _getOwnPropertyDescriptor(obj, prop); 1083 if (isUnconfigurable(obj, prop)) { 1084 desc.configurable = false; 1085 } 1086 return desc; 1087 }; 1088 } 1089 exports.propertyPatch = propertyPatch; 1090 ; 1091 function _redefineProperty(obj, prop, desc) { 1092 var originalConfigurableFlag = desc.configurable; 1093 desc = rewriteDescriptor(obj, prop, desc); 1094 return _tryDefineProperty(obj, prop, desc, originalConfigurableFlag); 1095 } 1096 exports._redefineProperty = _redefineProperty; 1097 ; 1098 function isUnconfigurable(obj, prop) { 1099 return obj && obj[unconfigurablesKey] && obj[unconfigurablesKey][prop]; 1100 } 1101 function rewriteDescriptor(obj, prop, desc) { 1102 desc.configurable = true; 1103 if (!desc.configurable) { 1104 if (!obj[unconfigurablesKey]) { 1105 _defineProperty(obj, unconfigurablesKey, { writable: true, value: {} }); 1106 } 1107 obj[unconfigurablesKey][prop] = true; 1108 } 1109 return desc; 1110 } 1111 function _tryDefineProperty(obj, prop, desc, originalConfigurableFlag) { 1112 try { 1113 return _defineProperty(obj, prop, desc); 1114 } 1115 catch (e) { 1116 if (desc.configurable) { 1117 // In case of errors, when the configurable flag was likely set by rewriteDescriptor(), let's retry with the original flag value 1118 if (typeof originalConfigurableFlag == 'undefined') { 1119 delete desc.configurable; 1120 } 1121 else { 1122 desc.configurable = originalConfigurableFlag; 1123 } 1124 return _defineProperty(obj, prop, desc); 1125 } 1126 else { 1127 throw e; 1128 } 1129 } 1130 } 1131 1132 1133/***/ }, 1134/* 5 */ 1135/***/ function(module, exports, __webpack_require__) { 1136 1137 "use strict"; 1138 var define_property_1 = __webpack_require__(4); 1139 var utils_1 = __webpack_require__(3); 1140 function registerElementPatch(_global) { 1141 if (!utils_1.isBrowser || !('registerElement' in _global.document)) { 1142 return; 1143 } 1144 var _registerElement = document.registerElement; 1145 var callbacks = [ 1146 'createdCallback', 1147 'attachedCallback', 1148 'detachedCallback', 1149 'attributeChangedCallback' 1150 ]; 1151 document.registerElement = function (name, opts) { 1152 if (opts && opts.prototype) { 1153 callbacks.forEach(function (callback) { 1154 var source = 'Document.registerElement::' + callback; 1155 if (opts.prototype.hasOwnProperty(callback)) { 1156 var descriptor = Object.getOwnPropertyDescriptor(opts.prototype, callback); 1157 if (descriptor && descriptor.value) { 1158 descriptor.value = Zone.current.wrap(descriptor.value, source); 1159 define_property_1._redefineProperty(opts.prototype, callback, descriptor); 1160 } 1161 else { 1162 opts.prototype[callback] = Zone.current.wrap(opts.prototype[callback], source); 1163 } 1164 } 1165 else if (opts.prototype[callback]) { 1166 opts.prototype[callback] = Zone.current.wrap(opts.prototype[callback], source); 1167 } 1168 }); 1169 } 1170 return _registerElement.apply(document, [name, opts]); 1171 }; 1172 } 1173 exports.registerElementPatch = registerElementPatch; 1174 1175 1176/***/ }, 1177/* 6 */ 1178/***/ function(module, exports, __webpack_require__) { 1179 1180 "use strict"; 1181 var webSocketPatch = __webpack_require__(7); 1182 var utils_1 = __webpack_require__(3); 1183 var eventNames = 'copy cut paste abort blur focus canplay canplaythrough change click contextmenu dblclick drag dragend dragenter dragleave dragover dragstart drop durationchange emptied ended input invalid keydown keypress keyup load loadeddata loadedmetadata loadstart message mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup pause play playing progress ratechange reset scroll seeked seeking select show stalled submit suspend timeupdate volumechange waiting mozfullscreenchange mozfullscreenerror mozpointerlockchange mozpointerlockerror error webglcontextrestored webglcontextlost webglcontextcreationerror'.split(' '); 1184 function propertyDescriptorPatch(_global) { 1185 if (utils_1.isNode) { 1186 return; 1187 } 1188 var supportsWebSocket = typeof WebSocket !== 'undefined';
1189 if (canPatchViaPropertyDescriptor()) { 1190 // for browsers that we can patch the descriptor: Chrome & Firefox 1191 if (utils_1.isBrowser) { 1192 utils_1.patchOnProperties(HTMLElement.prototype, eventNames); 1193 } 1194 utils_1.patchOnProperties(XMLHttpRequest.prototype, null); 1195 if (typeof IDBIndex !== 'undefined') { 1196 utils_1.patchOnProperties(IDBIndex.prototype, null); 1197 utils_1.patchOnProperties(IDBRequest.prototype, null); 1198 utils_1.patchOnProperties(IDBOpenDBRequest.prototype, null); 1199 utils_1.patchOnProperties(IDBDatabase.prototype, null); 1200 utils_1.patchOnProperties(IDBTransaction.prototype, null); 1201 utils_1.patchOnProperties(IDBCursor.prototype, null); 1202 } 1203 if (supportsWebSocket) { 1204 utils_1.patchOnProperties(WebSocket.prototype, null); 1205 } 1206 } 1207 else { 1208 // Safari, Android browsers (Jelly Bean) 1209 patchViaCapturingAllTheEvents(); 1210 utils_1.patchClass('XMLHttpRequest'); 1211 if (supportsWebSocket) { 1212 webSocketPatch.apply(_global); 1213 } 1214 } 1215 } 1216 exports.propertyDescriptorPatch = propertyDescriptorPatch; 1217 function canPatchViaPropertyDescriptor() { 1218 if (utils_1.isBrowser && !Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'onclick') 1219 && typeof Element !== 'undefined') { 1220 // WebKit https://bugs.webkit.org/show_bug.cgi?id=134364 1221 // IDL interface attributes are not configurable 1222 var desc = Object.getOwnPropertyDescriptor(Element.prototype, 'onclick'); 1223 if (desc && !desc.configurable) 1224 return false; 1225 } 1226 Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', { 1227 get: function () { 1228 return true; 1229 } 1230 }); 1231 var req = new XMLHttpRequest(); 1232 var result = !!req.onreadystatechange; 1233 Object.defineProperty(XMLHttpRequest.prototype, 'onreadystatechange', {}); 1234 return result; 1235 } 1236 ; 1237 var unboundKey = utils_1.zoneSymbol('unbound'); 1238 // Whenever any eventListener fires, we check the eventListener target and all parents 1239 // for `onwhatever` properties and replace them with zone-bound functions 1240 // - Chrome (for now) 1241 function patchViaCapturingAllTheEvents() { 1242 var _loop_1 = function(i) { 1243 var property = eventNames[i]; 1244 var onproperty = 'on' + property; 1245 document.addEventListener(property, function (event) { 1246 var elt = event.target, bound, source; 1247 if (elt) { 1248 source = elt.constructor['name'] + '.' + onproperty; 1249 } 1250 else { 1251 source = 'unknown.' + onproperty; 1252 } 1253 while (elt) { 1254 if (elt[onproperty] && !elt[onproperty][unboundKey]) { 1255 bound = Zone.current.wrap(elt[onproperty], source); 1256 bound[unboundKey] = elt[onproperty]; 1257 elt[onproperty] = bound; 1258 } 1259 elt = elt.parentElement; 1260 } 1261 }, true); 1262 }; 1263 for (var i = 0; i < eventNames.length; i++) { 1264 _loop_1(i); 1265 } 1266 ; 1267 } 1268 ; 1269 1270 1271/***/ }, 1272/* 7 */ 1273/***/ function(module, exports, __webpack_require__) { 1274 1275 "use strict"; 1276 var utils_1 = __webpack_require__(3); 1277 // we have to patch the instance since the proto is non-configurable 1278 function apply(_global) { 1279 var WS = _global.WebSocket; 1280 // On Safari window.EventTarget doesn't exist so need to patch WS add/removeEventListener 1281 // On older Chrome, no need since EventTarget was already patched 1282 if (!_global.EventTarget) { 1283 utils_1.patchEventTargetMethods(WS.prototype); 1284 } 1285 _global.WebSocket = function (a, b) { 1286 var socket = arguments.length > 1 ? new WS(a, b) : new WS(a); 1287 var proxySocket; 1288 // Safari 7.0 has non-configurable own 'onmessage' and friends properties on the socket instance 1289 var onmessageDesc = Object.getOwnPropertyDescriptor(socket, 'onmessage'); 1290 if (onmessageDesc && onmessageDesc.configurable === false) { 1291 proxySocket = Object.create(socket); 1292 ['addEventListener', 'removeEventListener', 'send', 'close'].forEach(function (propName) { 1293 proxySocket[propName] = function () { 1294 return socket[propName].apply(socket, arguments); 1295 }; 1296 }); 1297 } 1298 else { 1299 // we can patch the real socket 1300 proxySocket = socket; 1301 } 1302 utils_1.patchOnProperties(proxySocket, ['close', 'error', 'message', 'open']); 1303 return proxySocket; 1304 }; 1305 for (var prop in WS) { 1306 _global.WebSocket[prop] = WS[prop]; 1307 } 1308 } 1309 exports.apply = apply; 1310 1311 1312/***/ }, 1313/* 8 */ 1314/***/ function(module, exports, __webpack_require__) { 1315 1316 "use strict"; 1317 var utils_1 = __webpack_require__(3); 1318 function patchTimer(window, setName, cancelName, nameSuffix) { 1319 var setNative = null; 1320 var clearNative = null; 1321 setName += nameSuffix; 1322 cancelName += nameSuffix; 1323 function scheduleTask(task) { 1324 var data = task.data; 1325 data.args[0] = task.invoke;
1326 data.handleId = setNative.apply(window, data.args); 1327 return task; 1328 } 1329 function clearTask(task) { 1330 return clearNative(task.data.handleId); 1331 } 1332 setNative = utils_1.patchMethod(window, setName, function (delegate) { return function (self, args) { 1333 if (typeof args[0] === 'function') { 1334 var zone = Zone.current; 1335 var options = { 1336 handleId: null, 1337 isPeriodic: nameSuffix === 'Interval', 1338 delay: (nameSuffix === 'Timeout' || nameSuffix === 'Interval') ? args[1] || 0 : null, 1339 args: args 1340 }; 1341 var task = zone.scheduleMacroTask(setName, args[0], options, scheduleTask, clearTask); 1342 if (!task) { 1343 return task; 1344 } 1345 // Node.js must additionally support the ref and unref functions. 1346 var handle = task.data.handleId; 1347 if (handle.ref && handle.unref) { 1348 task.ref = handle.ref.bind(handle); 1349 task.unref = handle.unref.bind(handle); 1350 } 1351 return task; 1352 } 1353 else { 1354 // cause an error by calling it directly. 1355 return delegate.apply(window, args); 1356 } 1357 }; }); 1358 clearNative = utils_1.patchMethod(window, cancelName, function (delegate) { return function (self, args) { 1359 var task = args[0]; 1360 if (task && typeof task.type === 'string') { 1361 if (task.cancelFn && task.data.isPeriodic || task.runCount === 0) { 1362 // Do not cancel already canceled functions 1363 task.zone.cancelTask(task); 1364 } 1365 } 1366 else { 1367 // cause an error by calling it directly. 1368 delegate.apply(window, args); 1369 } 1370 }; }); 1371 } 1372 exports.patchTimer = patchTimer; 1373 1374 1375/***/ } 1376/******/ ]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.