a zip code crypto-currency system good for red ONLY

common-testing.umd.js 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. /**
  2. * @license Angular v5.2.11
  3. * (c) 2010-2018 Google, Inc. https://angular.io/
  4. * License: MIT
  5. */
  6. (function (global, factory) {
  7. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common')) :
  8. typeof define === 'function' && define.amd ? define('@angular/common/testing', ['exports', '@angular/core', '@angular/common'], factory) :
  9. (factory((global.ng = global.ng || {}, global.ng.common = global.ng.common || {}, global.ng.common.testing = {}),global.ng.core,global.ng.common));
  10. }(this, (function (exports,_angular_core,_angular_common) { 'use strict';
  11. /*! *****************************************************************************
  12. Copyright (c) Microsoft Corporation. All rights reserved.
  13. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  14. this file except in compliance with the License. You may obtain a copy of the
  15. License at http://www.apache.org/licenses/LICENSE-2.0
  16. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  18. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  19. MERCHANTABLITY OR NON-INFRINGEMENT.
  20. See the Apache Version 2.0 License for specific language governing permissions
  21. and limitations under the License.
  22. ***************************************************************************** */
  23. /* global Reflect, Promise */
  24. var extendStatics = Object.setPrototypeOf ||
  25. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  26. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  27. function __extends(d, b) {
  28. extendStatics(d, b);
  29. function __() { this.constructor = d; }
  30. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  31. }
  32. /**
  33. * @license Angular v5.2.11
  34. * (c) 2010-2018 Google, Inc. https://angular.io/
  35. * License: MIT
  36. */
  37. /**
  38. * @fileoverview added by tsickle
  39. * @suppress {checkTypes} checked by tsc
  40. */
  41. /**
  42. * @license
  43. * Copyright Google Inc. All Rights Reserved.
  44. *
  45. * Use of this source code is governed by an MIT-style license that can be
  46. * found in the LICENSE file at https://angular.io/license
  47. */
  48. /**
  49. * A spy for {\@link Location} that allows tests to fire simulated location events.
  50. *
  51. * \@experimental
  52. */
  53. var SpyLocation = /** @class */ (function () {
  54. function SpyLocation() {
  55. this.urlChanges = [];
  56. this._history = [new LocationState('', '')];
  57. this._historyIndex = 0;
  58. /**
  59. * \@internal
  60. */
  61. this._subject = new _angular_core.EventEmitter();
  62. /**
  63. * \@internal
  64. */
  65. this._baseHref = '';
  66. /**
  67. * \@internal
  68. */
  69. this._platformStrategy = /** @type {?} */ ((null));
  70. }
  71. /**
  72. * @param {?} url
  73. * @return {?}
  74. */
  75. SpyLocation.prototype.setInitialPath = /**
  76. * @param {?} url
  77. * @return {?}
  78. */
  79. function (url) { this._history[this._historyIndex].path = url; };
  80. /**
  81. * @param {?} url
  82. * @return {?}
  83. */
  84. SpyLocation.prototype.setBaseHref = /**
  85. * @param {?} url
  86. * @return {?}
  87. */
  88. function (url) { this._baseHref = url; };
  89. /**
  90. * @return {?}
  91. */
  92. SpyLocation.prototype.path = /**
  93. * @return {?}
  94. */
  95. function () { return this._history[this._historyIndex].path; };
  96. /**
  97. * @param {?} path
  98. * @param {?=} query
  99. * @return {?}
  100. */
  101. SpyLocation.prototype.isCurrentPathEqualTo = /**
  102. * @param {?} path
  103. * @param {?=} query
  104. * @return {?}
  105. */
  106. function (path, query) {
  107. if (query === void 0) { query = ''; }
  108. var /** @type {?} */ givenPath = path.endsWith('/') ? path.substring(0, path.length - 1) : path;
  109. var /** @type {?} */ currPath = this.path().endsWith('/') ? this.path().substring(0, this.path().length - 1) : this.path();
  110. return currPath == givenPath + (query.length > 0 ? ('?' + query) : '');
  111. };
  112. /**
  113. * @param {?} pathname
  114. * @return {?}
  115. */
  116. SpyLocation.prototype.simulateUrlPop = /**
  117. * @param {?} pathname
  118. * @return {?}
  119. */
  120. function (pathname) {
  121. this._subject.emit({ 'url': pathname, 'pop': true, 'type': 'popstate' });
  122. };
  123. /**
  124. * @param {?} pathname
  125. * @return {?}
  126. */
  127. SpyLocation.prototype.simulateHashChange = /**
  128. * @param {?} pathname
  129. * @return {?}
  130. */
  131. function (pathname) {
  132. // Because we don't prevent the native event, the browser will independently update the path
  133. this.setInitialPath(pathname);
  134. this.urlChanges.push('hash: ' + pathname);
  135. this._subject.emit({ 'url': pathname, 'pop': true, 'type': 'hashchange' });
  136. };
  137. /**
  138. * @param {?} url
  139. * @return {?}
  140. */
  141. SpyLocation.prototype.prepareExternalUrl = /**
  142. * @param {?} url
  143. * @return {?}
  144. */
  145. function (url) {
  146. if (url.length > 0 && !url.startsWith('/')) {
  147. url = '/' + url;
  148. }
  149. return this._baseHref + url;
  150. };
  151. /**
  152. * @param {?} path
  153. * @param {?=} query
  154. * @return {?}
  155. */
  156. SpyLocation.prototype.go = /**
  157. * @param {?} path
  158. * @param {?=} query
  159. * @return {?}
  160. */
  161. function (path, query) {
  162. if (query === void 0) { query = ''; }
  163. path = this.prepareExternalUrl(path);
  164. if (this._historyIndex > 0) {
  165. this._history.splice(this._historyIndex + 1);
  166. }
  167. this._history.push(new LocationState(path, query));
  168. this._historyIndex = this._history.length - 1;
  169. var /** @type {?} */ locationState = this._history[this._historyIndex - 1];
  170. if (locationState.path == path && locationState.query == query) {
  171. return;
  172. }
  173. var /** @type {?} */ url = path + (query.length > 0 ? ('?' + query) : '');
  174. this.urlChanges.push(url);
  175. this._subject.emit({ 'url': url, 'pop': false });
  176. };
  177. /**
  178. * @param {?} path
  179. * @param {?=} query
  180. * @return {?}
  181. */
  182. SpyLocation.prototype.replaceState = /**
  183. * @param {?} path
  184. * @param {?=} query
  185. * @return {?}
  186. */
  187. function (path, query) {
  188. if (query === void 0) { query = ''; }
  189. path = this.prepareExternalUrl(path);
  190. var /** @type {?} */ history = this._history[this._historyIndex];
  191. if (history.path == path && history.query == query) {
  192. return;
  193. }
  194. history.path = path;
  195. history.query = query;
  196. var /** @type {?} */ url = path + (query.length > 0 ? ('?' + query) : '');
  197. this.urlChanges.push('replace: ' + url);
  198. };
  199. /**
  200. * @return {?}
  201. */
  202. SpyLocation.prototype.forward = /**
  203. * @return {?}
  204. */
  205. function () {
  206. if (this._historyIndex < (this._history.length - 1)) {
  207. this._historyIndex++;
  208. this._subject.emit({ 'url': this.path(), 'pop': true });
  209. }
  210. };
  211. /**
  212. * @return {?}
  213. */
  214. SpyLocation.prototype.back = /**
  215. * @return {?}
  216. */
  217. function () {
  218. if (this._historyIndex > 0) {
  219. this._historyIndex--;
  220. this._subject.emit({ 'url': this.path(), 'pop': true });
  221. }
  222. };
  223. /**
  224. * @param {?} onNext
  225. * @param {?=} onThrow
  226. * @param {?=} onReturn
  227. * @return {?}
  228. */
  229. SpyLocation.prototype.subscribe = /**
  230. * @param {?} onNext
  231. * @param {?=} onThrow
  232. * @param {?=} onReturn
  233. * @return {?}
  234. */
  235. function (onNext, onThrow, onReturn) {
  236. return this._subject.subscribe({ next: onNext, error: onThrow, complete: onReturn });
  237. };
  238. /**
  239. * @param {?} url
  240. * @return {?}
  241. */
  242. SpyLocation.prototype.normalize = /**
  243. * @param {?} url
  244. * @return {?}
  245. */
  246. function (url) { return /** @type {?} */ ((null)); };
  247. SpyLocation.decorators = [
  248. { type: _angular_core.Injectable },
  249. ];
  250. /** @nocollapse */
  251. SpyLocation.ctorParameters = function () { return []; };
  252. return SpyLocation;
  253. }());
  254. var LocationState = /** @class */ (function () {
  255. function LocationState(path, query) {
  256. this.path = path;
  257. this.query = query;
  258. }
  259. return LocationState;
  260. }());
  261. /**
  262. * @fileoverview added by tsickle
  263. * @suppress {checkTypes} checked by tsc
  264. */
  265. /**
  266. * @license
  267. * Copyright Google Inc. All Rights Reserved.
  268. *
  269. * Use of this source code is governed by an MIT-style license that can be
  270. * found in the LICENSE file at https://angular.io/license
  271. */
  272. /**
  273. * A mock implementation of {\@link LocationStrategy} that allows tests to fire simulated
  274. * location events.
  275. *
  276. * \@stable
  277. */
  278. var MockLocationStrategy = /** @class */ (function (_super) {
  279. __extends(MockLocationStrategy, _super);
  280. function MockLocationStrategy() {
  281. var _this = _super.call(this) || this;
  282. _this.internalBaseHref = '/';
  283. _this.internalPath = '/';
  284. _this.internalTitle = '';
  285. _this.urlChanges = [];
  286. /**
  287. * \@internal
  288. */
  289. _this._subject = new _angular_core.EventEmitter();
  290. return _this;
  291. }
  292. /**
  293. * @param {?} url
  294. * @return {?}
  295. */
  296. MockLocationStrategy.prototype.simulatePopState = /**
  297. * @param {?} url
  298. * @return {?}
  299. */
  300. function (url) {
  301. this.internalPath = url;
  302. this._subject.emit(new _MockPopStateEvent(this.path()));
  303. };
  304. /**
  305. * @param {?=} includeHash
  306. * @return {?}
  307. */
  308. MockLocationStrategy.prototype.path = /**
  309. * @param {?=} includeHash
  310. * @return {?}
  311. */
  312. function (includeHash) {
  313. if (includeHash === void 0) { includeHash = false; }
  314. return this.internalPath;
  315. };
  316. /**
  317. * @param {?} internal
  318. * @return {?}
  319. */
  320. MockLocationStrategy.prototype.prepareExternalUrl = /**
  321. * @param {?} internal
  322. * @return {?}
  323. */
  324. function (internal) {
  325. if (internal.startsWith('/') && this.internalBaseHref.endsWith('/')) {
  326. return this.internalBaseHref + internal.substring(1);
  327. }
  328. return this.internalBaseHref + internal;
  329. };
  330. /**
  331. * @param {?} ctx
  332. * @param {?} title
  333. * @param {?} path
  334. * @param {?} query
  335. * @return {?}
  336. */
  337. MockLocationStrategy.prototype.pushState = /**
  338. * @param {?} ctx
  339. * @param {?} title
  340. * @param {?} path
  341. * @param {?} query
  342. * @return {?}
  343. */
  344. function (ctx, title, path, query) {
  345. this.internalTitle = title;
  346. var /** @type {?} */ url = path + (query.length > 0 ? ('?' + query) : '');
  347. this.internalPath = url;
  348. var /** @type {?} */ externalUrl = this.prepareExternalUrl(url);
  349. this.urlChanges.push(externalUrl);
  350. };
  351. /**
  352. * @param {?} ctx
  353. * @param {?} title
  354. * @param {?} path
  355. * @param {?} query
  356. * @return {?}
  357. */
  358. MockLocationStrategy.prototype.replaceState = /**
  359. * @param {?} ctx
  360. * @param {?} title
  361. * @param {?} path
  362. * @param {?} query
  363. * @return {?}
  364. */
  365. function (ctx, title, path, query) {
  366. this.internalTitle = title;
  367. var /** @type {?} */ url = path + (query.length > 0 ? ('?' + query) : '');
  368. this.internalPath = url;
  369. var /** @type {?} */ externalUrl = this.prepareExternalUrl(url);
  370. this.urlChanges.push('replace: ' + externalUrl);
  371. };
  372. /**
  373. * @param {?} fn
  374. * @return {?}
  375. */
  376. MockLocationStrategy.prototype.onPopState = /**
  377. * @param {?} fn
  378. * @return {?}
  379. */
  380. function (fn) { this._subject.subscribe({ next: fn }); };
  381. /**
  382. * @return {?}
  383. */
  384. MockLocationStrategy.prototype.getBaseHref = /**
  385. * @return {?}
  386. */
  387. function () { return this.internalBaseHref; };
  388. /**
  389. * @return {?}
  390. */
  391. MockLocationStrategy.prototype.back = /**
  392. * @return {?}
  393. */
  394. function () {
  395. if (this.urlChanges.length > 0) {
  396. this.urlChanges.pop();
  397. var /** @type {?} */ nextUrl = this.urlChanges.length > 0 ? this.urlChanges[this.urlChanges.length - 1] : '';
  398. this.simulatePopState(nextUrl);
  399. }
  400. };
  401. /**
  402. * @return {?}
  403. */
  404. MockLocationStrategy.prototype.forward = /**
  405. * @return {?}
  406. */
  407. function () { throw 'not implemented'; };
  408. MockLocationStrategy.decorators = [
  409. { type: _angular_core.Injectable },
  410. ];
  411. /** @nocollapse */
  412. MockLocationStrategy.ctorParameters = function () { return []; };
  413. return MockLocationStrategy;
  414. }(_angular_common.LocationStrategy));
  415. var _MockPopStateEvent = /** @class */ (function () {
  416. function _MockPopStateEvent(newUrl) {
  417. this.newUrl = newUrl;
  418. this.pop = true;
  419. this.type = 'popstate';
  420. }
  421. return _MockPopStateEvent;
  422. }());
  423. exports.SpyLocation = SpyLocation;
  424. exports.MockLocationStrategy = MockLocationStrategy;
  425. Object.defineProperty(exports, '__esModule', { value: true });
  426. })));
  427. //# sourceMappingURL=common-testing.umd.js.map