source: trip-planner-front/node_modules/@angular/common/esm2015/upgrade/src/location_shim.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 73.2 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { ReplaySubject } from 'rxjs';
9import { deepEqual, isAnchor, isPromise } from './utils';
10const PATH_MATCH = /^([^?#]*)(\?([^#]*))?(#(.*))?$/;
11const DOUBLE_SLASH_REGEX = /^\s*[\\/]{2,}/;
12const IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i;
13const DEFAULT_PORTS = {
14 'http:': 80,
15 'https:': 443,
16 'ftp:': 21
17};
18/**
19 * Location service that provides a drop-in replacement for the $location service
20 * provided in AngularJS.
21 *
22 * @see [Using the Angular Unified Location Service](guide/upgrade#using-the-unified-angular-location-service)
23 *
24 * @publicApi
25 */
26export class $locationShim {
27 constructor($injector, location, platformLocation, urlCodec, locationStrategy) {
28 this.location = location;
29 this.platformLocation = platformLocation;
30 this.urlCodec = urlCodec;
31 this.locationStrategy = locationStrategy;
32 this.initalizing = true;
33 this.updateBrowser = false;
34 this.$$absUrl = '';
35 this.$$url = '';
36 this.$$host = '';
37 this.$$replace = false;
38 this.$$path = '';
39 this.$$search = '';
40 this.$$hash = '';
41 this.$$changeListeners = [];
42 this.cachedState = null;
43 this.urlChanges = new ReplaySubject(1);
44 this.lastBrowserUrl = '';
45 // This variable should be used *only* inside the cacheState function.
46 this.lastCachedState = null;
47 const initialUrl = this.browserUrl();
48 let parsedUrl = this.urlCodec.parse(initialUrl);
49 if (typeof parsedUrl === 'string') {
50 throw 'Invalid URL';
51 }
52 this.$$protocol = parsedUrl.protocol;
53 this.$$host = parsedUrl.hostname;
54 this.$$port = parseInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null;
55 this.$$parseLinkUrl(initialUrl, initialUrl);
56 this.cacheState();
57 this.$$state = this.browserState();
58 this.location.onUrlChange((newUrl, newState) => {
59 this.urlChanges.next({ newUrl, newState });
60 });
61 if (isPromise($injector)) {
62 $injector.then($i => this.initialize($i));
63 }
64 else {
65 this.initialize($injector);
66 }
67 }
68 initialize($injector) {
69 const $rootScope = $injector.get('$rootScope');
70 const $rootElement = $injector.get('$rootElement');
71 $rootElement.on('click', (event) => {
72 if (event.ctrlKey || event.metaKey || event.shiftKey || event.which === 2 ||
73 event.button === 2) {
74 return;
75 }
76 let elm = event.target;
77 // traverse the DOM up to find first A tag
78 while (elm && elm.nodeName.toLowerCase() !== 'a') {
79 // ignore rewriting if no A tag (reached root element, or no parent - removed from document)
80 if (elm === $rootElement[0] || !(elm = elm.parentNode)) {
81 return;
82 }
83 }
84 if (!isAnchor(elm)) {
85 return;
86 }
87 const absHref = elm.href;
88 const relHref = elm.getAttribute('href');
89 // Ignore when url is started with javascript: or mailto:
90 if (IGNORE_URI_REGEXP.test(absHref)) {
91 return;
92 }
93 if (absHref && !elm.getAttribute('target') && !event.isDefaultPrevented()) {
94 if (this.$$parseLinkUrl(absHref, relHref)) {
95 // We do a preventDefault for all urls that are part of the AngularJS application,
96 // in html5mode and also without, so that we are able to abort navigation without
97 // getting double entries in the location history.
98 event.preventDefault();
99 // update location manually
100 if (this.absUrl() !== this.browserUrl()) {
101 $rootScope.$apply();
102 }
103 }
104 }
105 });
106 this.urlChanges.subscribe(({ newUrl, newState }) => {
107 const oldUrl = this.absUrl();
108 const oldState = this.$$state;
109 this.$$parse(newUrl);
110 newUrl = this.absUrl();
111 this.$$state = newState;
112 const defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, newState, oldState)
113 .defaultPrevented;
114 // if the location was changed by a `$locationChangeStart` handler then stop
115 // processing this location change
116 if (this.absUrl() !== newUrl)
117 return;
118 // If default was prevented, set back to old state. This is the state that was locally
119 // cached in the $location service.
120 if (defaultPrevented) {
121 this.$$parse(oldUrl);
122 this.state(oldState);
123 this.setBrowserUrlWithFallback(oldUrl, false, oldState);
124 this.$$notifyChangeListeners(this.url(), this.$$state, oldUrl, oldState);
125 }
126 else {
127 this.initalizing = false;
128 $rootScope.$broadcast('$locationChangeSuccess', newUrl, oldUrl, newState, oldState);
129 this.resetBrowserUpdate();
130 }
131 if (!$rootScope.$$phase) {
132 $rootScope.$digest();
133 }
134 });
135 // update browser
136 $rootScope.$watch(() => {
137 if (this.initalizing || this.updateBrowser) {
138 this.updateBrowser = false;
139 const oldUrl = this.browserUrl();
140 const newUrl = this.absUrl();
141 const oldState = this.browserState();
142 let currentReplace = this.$$replace;
143 const urlOrStateChanged = !this.urlCodec.areEqual(oldUrl, newUrl) || oldState !== this.$$state;
144 // Fire location changes one time to on initialization. This must be done on the
145 // next tick (thus inside $evalAsync()) in order for listeners to be registered
146 // before the event fires. Mimicing behavior from $locationWatch:
147 // https://github.com/angular/angular.js/blob/master/src/ng/location.js#L983
148 if (this.initalizing || urlOrStateChanged) {
149 this.initalizing = false;
150 $rootScope.$evalAsync(() => {
151 // Get the new URL again since it could have changed due to async update
152 const newUrl = this.absUrl();
153 const defaultPrevented = $rootScope
154 .$broadcast('$locationChangeStart', newUrl, oldUrl, this.$$state, oldState)
155 .defaultPrevented;
156 // if the location was changed by a `$locationChangeStart` handler then stop
157 // processing this location change
158 if (this.absUrl() !== newUrl)
159 return;
160 if (defaultPrevented) {
161 this.$$parse(oldUrl);
162 this.$$state = oldState;
163 }
164 else {
165 // This block doesn't run when initalizing because it's going to perform the update to
166 // the URL which shouldn't be needed when initalizing.
167 if (urlOrStateChanged) {
168 this.setBrowserUrlWithFallback(newUrl, currentReplace, oldState === this.$$state ? null : this.$$state);
169 this.$$replace = false;
170 }
171 $rootScope.$broadcast('$locationChangeSuccess', newUrl, oldUrl, this.$$state, oldState);
172 if (urlOrStateChanged) {
173 this.$$notifyChangeListeners(this.url(), this.$$state, oldUrl, oldState);
174 }
175 }
176 });
177 }
178 }
179 this.$$replace = false;
180 });
181 }
182 resetBrowserUpdate() {
183 this.$$replace = false;
184 this.$$state = this.browserState();
185 this.updateBrowser = false;
186 this.lastBrowserUrl = this.browserUrl();
187 }
188 browserUrl(url, replace, state) {
189 // In modern browsers `history.state` is `null` by default; treating it separately
190 // from `undefined` would cause `$browser.url('/foo')` to change `history.state`
191 // to undefined via `pushState`. Instead, let's change `undefined` to `null` here.
192 if (typeof state === 'undefined') {
193 state = null;
194 }
195 // setter
196 if (url) {
197 let sameState = this.lastHistoryState === state;
198 // Normalize the inputted URL
199 url = this.urlCodec.parse(url).href;
200 // Don't change anything if previous and current URLs and states match.
201 if (this.lastBrowserUrl === url && sameState) {
202 return this;
203 }
204 this.lastBrowserUrl = url;
205 this.lastHistoryState = state;
206 // Remove server base from URL as the Angular APIs for updating URL require
207 // it to be the path+.
208 url = this.stripBaseUrl(this.getServerBase(), url) || url;
209 // Set the URL
210 if (replace) {
211 this.locationStrategy.replaceState(state, '', url, '');
212 }
213 else {
214 this.locationStrategy.pushState(state, '', url, '');
215 }
216 this.cacheState();
217 return this;
218 // getter
219 }
220 else {
221 return this.platformLocation.href;
222 }
223 }
224 cacheState() {
225 // This should be the only place in $browser where `history.state` is read.
226 this.cachedState = this.platformLocation.getState();
227 if (typeof this.cachedState === 'undefined') {
228 this.cachedState = null;
229 }
230 // Prevent callbacks fo fire twice if both hashchange & popstate were fired.
231 if (deepEqual(this.cachedState, this.lastCachedState)) {
232 this.cachedState = this.lastCachedState;
233 }
234 this.lastCachedState = this.cachedState;
235 this.lastHistoryState = this.cachedState;
236 }
237 /**
238 * This function emulates the $browser.state() function from AngularJS. It will cause
239 * history.state to be cached unless changed with deep equality check.
240 */
241 browserState() {
242 return this.cachedState;
243 }
244 stripBaseUrl(base, url) {
245 if (url.startsWith(base)) {
246 return url.substr(base.length);
247 }
248 return undefined;
249 }
250 getServerBase() {
251 const { protocol, hostname, port } = this.platformLocation;
252 const baseHref = this.locationStrategy.getBaseHref();
253 let url = `${protocol}//${hostname}${port ? ':' + port : ''}${baseHref || '/'}`;
254 return url.endsWith('/') ? url : url + '/';
255 }
256 parseAppUrl(url) {
257 if (DOUBLE_SLASH_REGEX.test(url)) {
258 throw new Error(`Bad Path - URL cannot start with double slashes: ${url}`);
259 }
260 let prefixed = (url.charAt(0) !== '/');
261 if (prefixed) {
262 url = '/' + url;
263 }
264 let match = this.urlCodec.parse(url, this.getServerBase());
265 if (typeof match === 'string') {
266 throw new Error(`Bad URL - Cannot parse URL: ${url}`);
267 }
268 let path = prefixed && match.pathname.charAt(0) === '/' ? match.pathname.substring(1) : match.pathname;
269 this.$$path = this.urlCodec.decodePath(path);
270 this.$$search = this.urlCodec.decodeSearch(match.search);
271 this.$$hash = this.urlCodec.decodeHash(match.hash);
272 // make sure path starts with '/';
273 if (this.$$path && this.$$path.charAt(0) !== '/') {
274 this.$$path = '/' + this.$$path;
275 }
276 }
277 /**
278 * Registers listeners for URL changes. This API is used to catch updates performed by the
279 * AngularJS framework. These changes are a subset of the `$locationChangeStart` and
280 * `$locationChangeSuccess` events which fire when AngularJS updates its internally-referenced
281 * version of the browser URL.
282 *
283 * It's possible for `$locationChange` events to happen, but for the browser URL
284 * (window.location) to remain unchanged. This `onChange` callback will fire only when AngularJS
285 * actually updates the browser URL (window.location).
286 *
287 * @param fn The callback function that is triggered for the listener when the URL changes.
288 * @param err The callback function that is triggered when an error occurs.
289 */
290 onChange(fn, err = (e) => { }) {
291 this.$$changeListeners.push([fn, err]);
292 }
293 /** @internal */
294 $$notifyChangeListeners(url = '', state, oldUrl = '', oldState) {
295 this.$$changeListeners.forEach(([fn, err]) => {
296 try {
297 fn(url, state, oldUrl, oldState);
298 }
299 catch (e) {
300 err(e);
301 }
302 });
303 }
304 /**
305 * Parses the provided URL, and sets the current URL to the parsed result.
306 *
307 * @param url The URL string.
308 */
309 $$parse(url) {
310 let pathUrl;
311 if (url.startsWith('/')) {
312 pathUrl = url;
313 }
314 else {
315 // Remove protocol & hostname if URL starts with it
316 pathUrl = this.stripBaseUrl(this.getServerBase(), url);
317 }
318 if (typeof pathUrl === 'undefined') {
319 throw new Error(`Invalid url "${url}", missing path prefix "${this.getServerBase()}".`);
320 }
321 this.parseAppUrl(pathUrl);
322 if (!this.$$path) {
323 this.$$path = '/';
324 }
325 this.composeUrls();
326 }
327 /**
328 * Parses the provided URL and its relative URL.
329 *
330 * @param url The full URL string.
331 * @param relHref A URL string relative to the full URL string.
332 */
333 $$parseLinkUrl(url, relHref) {
334 // When relHref is passed, it should be a hash and is handled separately
335 if (relHref && relHref[0] === '#') {
336 this.hash(relHref.slice(1));
337 return true;
338 }
339 let rewrittenUrl;
340 let appUrl = this.stripBaseUrl(this.getServerBase(), url);
341 if (typeof appUrl !== 'undefined') {
342 rewrittenUrl = this.getServerBase() + appUrl;
343 }
344 else if (this.getServerBase() === url + '/') {
345 rewrittenUrl = this.getServerBase();
346 }
347 // Set the URL
348 if (rewrittenUrl) {
349 this.$$parse(rewrittenUrl);
350 }
351 return !!rewrittenUrl;
352 }
353 setBrowserUrlWithFallback(url, replace, state) {
354 const oldUrl = this.url();
355 const oldState = this.$$state;
356 try {
357 this.browserUrl(url, replace, state);
358 // Make sure $location.state() returns referentially identical (not just deeply equal)
359 // state object; this makes possible quick checking if the state changed in the digest
360 // loop. Checking deep equality would be too expensive.
361 this.$$state = this.browserState();
362 }
363 catch (e) {
364 // Restore old values if pushState fails
365 this.url(oldUrl);
366 this.$$state = oldState;
367 throw e;
368 }
369 }
370 composeUrls() {
371 this.$$url = this.urlCodec.normalize(this.$$path, this.$$search, this.$$hash);
372 this.$$absUrl = this.getServerBase() + this.$$url.substr(1); // remove '/' from front of URL
373 this.updateBrowser = true;
374 }
375 /**
376 * Retrieves the full URL representation with all segments encoded according to
377 * rules specified in
378 * [RFC 3986](https://tools.ietf.org/html/rfc3986).
379 *
380 *
381 * ```js
382 * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo
383 * let absUrl = $location.absUrl();
384 * // => "http://example.com/#/some/path?foo=bar&baz=xoxo"
385 * ```
386 */
387 absUrl() {
388 return this.$$absUrl;
389 }
390 url(url) {
391 if (typeof url === 'string') {
392 if (!url.length) {
393 url = '/';
394 }
395 const match = PATH_MATCH.exec(url);
396 if (!match)
397 return this;
398 if (match[1] || url === '')
399 this.path(this.urlCodec.decodePath(match[1]));
400 if (match[2] || match[1] || url === '')
401 this.search(match[3] || '');
402 this.hash(match[5] || '');
403 // Chainable method
404 return this;
405 }
406 return this.$$url;
407 }
408 /**
409 * Retrieves the protocol of the current URL.
410 *
411 * ```js
412 * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo
413 * let protocol = $location.protocol();
414 * // => "http"
415 * ```
416 */
417 protocol() {
418 return this.$$protocol;
419 }
420 /**
421 * Retrieves the protocol of the current URL.
422 *
423 * In contrast to the non-AngularJS version `location.host` which returns `hostname:port`, this
424 * returns the `hostname` portion only.
425 *
426 *
427 * ```js
428 * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo
429 * let host = $location.host();
430 * // => "example.com"
431 *
432 * // given URL http://user:password@example.com:8080/#/some/path?foo=bar&baz=xoxo
433 * host = $location.host();
434 * // => "example.com"
435 * host = location.host;
436 * // => "example.com:8080"
437 * ```
438 */
439 host() {
440 return this.$$host;
441 }
442 /**
443 * Retrieves the port of the current URL.
444 *
445 * ```js
446 * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo
447 * let port = $location.port();
448 * // => 80
449 * ```
450 */
451 port() {
452 return this.$$port;
453 }
454 path(path) {
455 if (typeof path === 'undefined') {
456 return this.$$path;
457 }
458 // null path converts to empty string. Prepend with "/" if needed.
459 path = path !== null ? path.toString() : '';
460 path = path.charAt(0) === '/' ? path : '/' + path;
461 this.$$path = path;
462 this.composeUrls();
463 return this;
464 }
465 search(search, paramValue) {
466 switch (arguments.length) {
467 case 0:
468 return this.$$search;
469 case 1:
470 if (typeof search === 'string' || typeof search === 'number') {
471 this.$$search = this.urlCodec.decodeSearch(search.toString());
472 }
473 else if (typeof search === 'object' && search !== null) {
474 // Copy the object so it's never mutated
475 search = Object.assign({}, search);
476 // remove object undefined or null properties
477 for (const key in search) {
478 if (search[key] == null)
479 delete search[key];
480 }
481 this.$$search = search;
482 }
483 else {
484 throw new Error('LocationProvider.search(): First argument must be a string or an object.');
485 }
486 break;
487 default:
488 if (typeof search === 'string') {
489 const currentSearch = this.search();
490 if (typeof paramValue === 'undefined' || paramValue === null) {
491 delete currentSearch[search];
492 return this.search(currentSearch);
493 }
494 else {
495 currentSearch[search] = paramValue;
496 return this.search(currentSearch);
497 }
498 }
499 }
500 this.composeUrls();
501 return this;
502 }
503 hash(hash) {
504 if (typeof hash === 'undefined') {
505 return this.$$hash;
506 }
507 this.$$hash = hash !== null ? hash.toString() : '';
508 this.composeUrls();
509 return this;
510 }
511 /**
512 * Changes to `$location` during the current `$digest` will replace the current
513 * history record, instead of adding a new one.
514 */
515 replace() {
516 this.$$replace = true;
517 return this;
518 }
519 state(state) {
520 if (typeof state === 'undefined') {
521 return this.$$state;
522 }
523 this.$$state = state;
524 return this;
525 }
526}
527/**
528 * The factory function used to create an instance of the `$locationShim` in Angular,
529 * and provides an API-compatiable `$locationProvider` for AngularJS.
530 *
531 * @publicApi
532 */
533export class $locationShimProvider {
534 constructor(ngUpgrade, location, platformLocation, urlCodec, locationStrategy) {
535 this.ngUpgrade = ngUpgrade;
536 this.location = location;
537 this.platformLocation = platformLocation;
538 this.urlCodec = urlCodec;
539 this.locationStrategy = locationStrategy;
540 }
541 /**
542 * Factory method that returns an instance of the $locationShim
543 */
544 $get() {
545 return new $locationShim(this.ngUpgrade.$injector, this.location, this.platformLocation, this.urlCodec, this.locationStrategy);
546 }
547 /**
548 * Stub method used to keep API compatible with AngularJS. This setting is configured through
549 * the LocationUpgradeModule's `config` method in your Angular app.
550 */
551 hashPrefix(prefix) {
552 throw new Error('Configure LocationUpgrade through LocationUpgradeModule.config method.');
553 }
554 /**
555 * Stub method used to keep API compatible with AngularJS. This setting is configured through
556 * the LocationUpgradeModule's `config` method in your Angular app.
557 */
558 html5Mode(mode) {
559 throw new Error('Configure LocationUpgrade through LocationUpgradeModule.config method.');
560 }
561}
562//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYXRpb25fc2hpbS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbW1vbi91cGdyYWRlL3NyYy9sb2NhdGlvbl9zaGltLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUlILE9BQU8sRUFBQyxhQUFhLEVBQUMsTUFBTSxNQUFNLENBQUM7QUFHbkMsT0FBTyxFQUFDLFNBQVMsRUFBRSxRQUFRLEVBQUUsU0FBUyxFQUFDLE1BQU0sU0FBUyxDQUFDO0FBRXZELE1BQU0sVUFBVSxHQUFHLGdDQUFnQyxDQUFDO0FBQ3BELE1BQU0sa0JBQWtCLEdBQUcsZUFBZSxDQUFDO0FBQzNDLE1BQU0saUJBQWlCLEdBQUcsMkJBQTJCLENBQUM7QUFDdEQsTUFBTSxhQUFhLEdBQTRCO0lBQzdDLE9BQU8sRUFBRSxFQUFFO0lBQ1gsUUFBUSxFQUFFLEdBQUc7SUFDYixNQUFNLEVBQUUsRUFBRTtDQUNYLENBQUM7QUFFRjs7Ozs7OztHQU9HO0FBQ0gsTUFBTSxPQUFPLGFBQWE7SUF1QnhCLFlBQ0ksU0FBYyxFQUFVLFFBQWtCLEVBQVUsZ0JBQWtDLEVBQzlFLFFBQWtCLEVBQVUsZ0JBQWtDO1FBRDlDLGFBQVEsR0FBUixRQUFRLENBQVU7UUFBVSxxQkFBZ0IsR0FBaEIsZ0JBQWdCLENBQWtCO1FBQzlFLGFBQVEsR0FBUixRQUFRLENBQVU7UUFBVSxxQkFBZ0IsR0FBaEIsZ0JBQWdCLENBQWtCO1FBeEJsRSxnQkFBVyxHQUFHLElBQUksQ0FBQzt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